# https://stackoverflow.com/a/42107711/52817 # Use Vi, not Emacs, shortcuts for editing set editing-mode vi set show-mode-in-prompt on set vi-ins-mode-string \1\e[6 q\2 set vi-cmd-mode-string \1\e[2 q\2 # https://vim.fandom.com/wiki/Use_vi_shortcuts_in_terminal # Show all completions as soon as I press tab, # even if there's more than one set show-all-if-ambiguous on # Ignore case set completion-ignore-case on # On menu-complete, first display the common prefix, # then cycle through the options when hitting TAB set menu-complete-display-prefix on # https://cirw.in/blog/bracketed-paste set enable-bracketed-paste on # Keymaps for when we're in insert (i.e., typing stuff in) mode set keymap vi-insert # switch to block cursor before executing a command RETURN: "\e\n" # Pressing tab will list all completions & select the first one. # Pressing it again will cycle through available completions. TAB: menu-complete # Shift-TAB cycles completions backward "\e[Z": menu-complete-backward ctrl-_: undo ctrl-a: beginning-of-line ctrl-b: backward-char ctrl-d: delete-char ctrl-e: end-of-line ctrl-f: forward-char ctrl-t: transpose-char ctrl-h: backward-delete-char ctrl-k: kill-line ctrl-l: clear-screen ctrl-n: next-history ctrl-p: previous-history # ctrl-u (unix-line-discard) already works ctrl-w: backward-kill-word # ctrl-y (yank) already works "\e.": yank-last-arg "\eb": backward-word "\ec": capitalize-word "\ed": kill-word "\ef": forward-word "\eh": backward-kill-word "\el": downcase-word "\et": transpose-words "\eu": upcase-word "\ey": yank-pop # Keymaps for when we're in command mode (e.g., after hitting ESC) # set keymap vi-command