diff --git a/fish/config.fish b/fish/config.fish index 88c1239..2d84c2a 100755 --- a/fish/config.fish +++ b/fish/config.fish @@ -4,6 +4,7 @@ set -xg EDITOR (which code) function fish_user_key_bindings set -U FZF_LEGACY_KEYBINDINGS 0 source $HOME/.config/fish/conf.d/fzf_key_bindings.fish + source $HOME/.config/fish/functions/keys_bindings.fish end set -x FZF_COMPLETE 1 @@ -12,4 +13,4 @@ set -x FZF_REVERSE_ISEARCH_OPTS '--preview-window=up:10 --preview="echo {}" --he # locals.fish is a home for anything machine specific if test -e ~/.config/fish/locals.fish source ~/.config/fish/locals.fish -end \ No newline at end of file +end diff --git a/fish/functions/keys.fish b/fish/functions/keys.fish new file mode 100644 index 0000000..01d94ab --- /dev/null +++ b/fish/functions/keys.fish @@ -0,0 +1,43 @@ +function keys -d "Help for bound keys" + echo Alt-K\tShow this help + + echo Line Level + echo -------------------------------------------------- + echo Ctrl-A\t Move Cursor to beginning line + echo Ctrl-E\t Move Cursor to end of line + echo Ctrl-U\t Delete to beginning of line \(to killring\) + echo Ctrl-K\t Delete to end of line \(to killlring\) + echo + + echo Word Level + echo -------------------------------------------------- + echo Ctrl-W\t Delete back a word \(to killring\) + echo Alt-D\t Delete forward word \(to killring\) + echo Alt-T\t Transpose last two words + echo Alt-C\t Captialize current word + echo Alt-U\t Uppercase current word + echo Alt-Up\t Search history for token at cursor \(fish\) + echo Option-Left\t Move cursor to next word + echo Option-Right\t Move cursor to previous word + echo + + echo Character level + echo -------------------------------------------------- + echo Ctrl-T\t Transpose last two characters + echo Fn-Del\t Forward Delete a character + echo + + echo killring + echo -------------------------------------------------- + echo Ctrl-Y\t Paste last killring entry + echo Alt-Y\t Rotate back a killring entry + echo + + echo fzf fish add-ons + echo --------------------------------------------------------- + echo Ctrl-R\t search history w/fzf+preview + echo Ctrl-F\t insert a file path \(starts from token under by cursor\) + echo Alt-O\t change into subdirectories \(starts from token by cursor\) + echo Ctrl-O\t open file using default editor + echo Ctrl-G\t open file using system bound app \(pdf/img/etc\) +end \ No newline at end of file diff --git a/fish/functions/keys_bindings.fish b/fish/functions/keys_bindings.fish new file mode 100644 index 0000000..337ba72 --- /dev/null +++ b/fish/functions/keys_bindings.fish @@ -0,0 +1 @@ +bind --preset $argv \ek 'begin; echo; keys; commandline -f repaint; end' \ No newline at end of file