From 4a23ddeb541ccf01624717b42157420d6ba804a5 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 27 Apr 2022 17:33:09 -0700 Subject: [PATCH 1/2] ned: fixes for edit and cd --- .config/shell/bin/ned | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.config/shell/bin/ned b/.config/shell/bin/ned index 9d8042e..b433639 100755 --- a/.config/shell/bin/ned +++ b/.config/shell/bin/ned @@ -17,7 +17,6 @@ DEFAULT_NEW_NOTE_NAME="$(date +'%m-%d')$DEFAULT_NEW_NOTE_EXT" # Some fzf commands FZF="fzf -1 --layout=reverse --info=inline --height=10%" -FZF_SEARCH="$FZF -q " usage() { cat <<-EOF @@ -50,18 +49,19 @@ edit() { # This logic is to allow $2 to be optional if [ -n "$3" ]; then SEARCH_TERM="$3" - NOTE_DIR="$(cd "$BASE_DIR" && fd -t f | sed 's-\./--g' | $FZF_SEARCH "$2")" || exit + NOTE_DIR="$BASE_DIR/$(cd "$BASE_DIR" && fd -t d -d 1 | sed 's-\./--g' | $FZF -q "$2")" || exit elif [ -n "$2" ]; then SEARCH_TERM="$2" + else + echo "$0: Error: No file specified" && usage && exit fi - # TODO: what if there is no $2 provided # Searching for 'T' will get you today's note if [ "$SEARCH_TERM" = 'T' ]; then SEARCH_TERM="$DEFAULT_NEW_NOTE_NAME" fi - NOTE="$NOTE_DIR/$(cd "$NOTE_DIR" && $FZF_SEARCH "$SEARCH_TERM")" || exit + NOTE="$NOTE_DIR/$(cd "$NOTE_DIR" && $FZF -q "$SEARCH_TERM")" || exit open_file "$NOTE" } @@ -79,7 +79,7 @@ new() { # TODO: what if there is no $2 provided # Note dir - NEW_NOTE_DIR="$BASE_DIR/$(cd "$BASE_DIR" && fd -d 1 | sed 's-\./--g' | $FZF_SEARCH "$2")/notes" || exit + NEW_NOTE_DIR="$BASE_DIR/$(cd "$BASE_DIR" && fd -t d -d 1 | sed 's-\./--g' | $FZF -q "$2")/notes" || exit # make the directory if it doesn't exist [ -d "${NEW_NOTE_DIR}" ] || mkdir "${NEW_NOTE_DIR}" @@ -112,7 +112,9 @@ subshell() { shell() { if [ -n "${2+foo}" ]; then - DIR="$BASE_DIR/$(cd "$BASE_DIR" && fd -d 1 -t d | sed 's-\./--g' | $FZF_SEARCH "$2")" || exit + DIR="$BASE_DIR/$(cd "$BASE_DIR" && fd -d 1 -t d | sed 's-\./--g' | $FZF -q "$2")" || exit + else + DIR="$BASE_DIR" fi if cd "$DIR"; then subshell From e2ff9c733b01189605f5f45b4c550c3d1fe34974 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 27 Apr 2022 17:34:38 -0700 Subject: [PATCH 2/2] nvim: add f10 mapping for insert mode --- .config/nvim/lua/blake/plugins.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index c68bad4..02615fd 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -220,6 +220,7 @@ return require('packer').startup({function() config = function() require('blake.other').zenmode() vim.cmd 'nnoremap ZenMode' + vim.cmd 'inoremap ZenMode' end, } -- use { -- dim text outside paragraph or function