Rethink vim

idea

I’m a heavy vim user. I have used vim for more than 5 years. I’d like to enable vim mode in all the tools as long as it is supported such as Intellij Idea, VSCode. Also like other geeks, I have tried many “vim enhanced” tools like neovim, emacs, spacemaces. Though those tools have a lot of pleasant features than pure vim, it doesn’t last long for me to use them.

Why? Coz they become very heavy with a lot of plugins and a lot of commands which I may not need all of them. But my head is unconsciously forced to remember all the command shortcut anyway. So finally, I turned back to use vim enabled Intellij idea and VSCode only. I don’t want my head blow up!

Hmm, but there’s still something that I don’t feel good. That’s the “leading key”. You know, in intellij idea most of the commands are started with Command key instead Ctrl key in VSCode. So when I switch between them, I often mix them up. So in the spirit of spacemacs, I begin to change the leading key to Space which I regard as a great idea since Space is the biggest key in the keyboard . That’s pretty amazing! You should try that😊.

This week I started to write some haskell while rereading the book learn you a haskell for great good. The programs are pretty short so I use VIM to write them. I customized .vimrc to make it handy for me. After one week’s typing, I realized that I even don’t need an IDE or a modern editor to write code, VIM is enough. I enjoy the typing process without code prompting, it enforces my memory of the language syntax and library, I feel pretty confident about writing haskell now!

Below is the minimum VIM configuration which I believe is sufficient.

  • syntax on
  • enable auto completion
  • configure tab to 2 spaces
  • remap window navigation command to start with Space
  • show the cursor line so it’s evident where the cursor is now
  • nerdtree plugin for tree like file navigation
  • surround plugin to edit surroundings
  • ultisnips plugin for live code template
  • vim-plug. It’s a vim plugin manager. Actually this is not essential, but we can use it to add nerdtree, surround and ultisnips plugins. It’s a configuration based tool but not command based which means whenever you want to add a new plugin, you should add the plugin to .vimrc file first.

You can refer to my vimrc gist.