I'm a vi enjoyer. So I always enable vi anywhere support it.

Here’s the list of couple places that I enable vi mode.

  1. Bash shell set -o vi I always enable bash movement mode in my .bashrc file. With it set, I can switch between normal mode and edit mode by pressing ESC. Editing works as any normal shell, but when switching to normal mode, I can use vi movement keys like j, k, h, l, w, b, e, $, ^, editing current line is also faster by using selectors such as cw, dw, C, D.... One important note is that we are using vi mode, not vim, so selectors like ciw, caw, ci( does not work.

  2. export EDITOR=vim , yes, another .bashrc configuration. This allow me to open up a quick vim buffer with current line. So I can do a lot more with vim to make sure my long command is correct. I don’t use this as often because vi mode is already good enough. But in some cases like editing a long curl command with multiple headers and json payload, using vim is much better. While in command line, press ^XE (^ is ctrl key) to open editor. If you don’t set EDITOR environment, default editor such as nano will be used.

  3. The vim itself. I used to enjoy vim but I found writing vimscript is hard. And neovim is easier version of vim to use. I’m avoiding to say neovim is better, because I believe they’re both doing their best. I just find neovim a bit easier to use (maybe skill issue).

  4. Leetcode vim mode. You can change Leetcode editor key binding by opening editor settings > Code editor > Key binding > Vim. It work perfectly and you don’t have to :w to save your code. But if your muscle memory still does so, no problems. The down side of vim mode on Leetcode is you cannot copy the code to clipboard. Any time I need to copy code to run debug locally, I have to switch back to Standard mode to copy then paste to my local vim. 😢 Hope they can change it in the future.

  5. Terminal emulator. I use kitty terminal emulator. It uses GPU for rendering, displays images, animations in terminal, pdf as well. So I can quickly view many documents without leaving my beloved terminal. It is super customizable, so I use vi keys to move between split windows. I map custom keys in ~/.config/kitty/kitty.conf like so:

     map super+k neighboring_window up
     map super+j neighboring_window down
     map super+h neighboring_window left
     map super+l neighboring_window right
    
  6. ipython

     ipython --TerminalInteractiveShell.editing_mode=vi
    
  7. Browser. Sadly, no, I don’t use any vi or vim key binding plugins in browser. I used to, but I found it can break the modern JavaScript frameworks in different ways. Especially on input fields.