Skip to content

Commit

Permalink
Help for hotkeys I'm trying to get better at
Browse files Browse the repository at this point in the history
Execute 'keys'

-or-

Alt-K for help while retaining current command line (useful when mid
editing)
  • Loading branch information
mattorb committed Jul 4, 2019
1 parent 119c23e commit 991abba
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fish/config.fish
Expand Up @@ -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
Expand All @@ -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
end
43 changes: 43 additions & 0 deletions 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
1 change: 1 addition & 0 deletions fish/functions/keys_bindings.fish
@@ -0,0 +1 @@
bind --preset $argv \ek 'begin; echo; keys; commandline -f repaint; end'

0 comments on commit 991abba

Please sign in to comment.