Here’s the list of couple places that I enable vi mode.
- Bash shell - set -o viI always enable bash movement mode in my- .bashrcfile. 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- vimovement 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- vimode, not- vim, so selectors like- ciw, caw, ci(does not work.
- export EDITOR=vim, yes, another- .bashrcconfiguration. This allow me to open up a quick vim buffer with current line. So I can do a lot more with- vimto make sure my long command is correct. I don’t use this as often because- vimode is already good enough. But in some cases like editing a long- curlcommand with multiple headers and- jsonpayload, using vim is much better. While in command line, press- ^XE(^ is ctrl key) to open editor. If you don’t set- EDITORenvironment, default editor such as- nanowill be used.
- The - vimitself. I used to enjoy- vimbut I found writing- vimscriptis hard. And- neovimis easier version of- vimto use. I’m avoiding to say- neovimis better, because I believe they’re both doing their best. I just find- neovima bit easier to use (maybe skill issue).
- 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- :wto save your code. But if your muscle memory still does so, no problems. The down side of- vim modeon 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.
- Terminal emulator. I use - kittyterminal 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- vikeys to move between split windows. I map custom keys in- ~/.config/kitty/kitty.conflike 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
- ipython- ipython --TerminalInteractiveShell.editing_mode=vi
- Browser. Sadly, no, I don’t use any - vior- vimkey binding plugins in browser. I used to, but I found it can break the modern JavaScript frameworks in different ways. Especially on input fields.