VIM
I always wanted to understand why many developers use VIM even when modern IDE is so sophisticated and can make the development environment so rich and easy. But, I was wrong and I’m happy that I realized this sooner than later. Here are my reasons on why developers should try out VIM
- It’s lightweight.
- You have complete control of the editor.
- Any plugin you think of, it’s available already.
- No to trackpad.
- Strong developer community.
Components to VIM
To configure VIM all you need is vimrc file. You define all your plugins, mappings and color schemes there. The way I define my vimrc is by splitting them into five components namely,
- init.vim
- plugins.vim
- mappings.vim
- theme.vim
- misc.vim
init.vim
Think init.vim, as a set of the instruction set that’s applied to all files. For example, displaying number lines, ruler, smarttab can be thought of instruction which you need irrespective of file type.
plugins.vim
As the name suggests, its where you put all third party plugins you need. Usually, plugins are installed through a plugin manager. I use plug.vim as the plugin manager.
plugins to consider
* fzf
* ycm
mappings.vim
Vim is popular for the modes it offers. To understand more about the modes, refer vim wiki. Many times, you switch from
insert to normal mode. The default key binding is ESC, you can change that to jk and command used it :imap jj
theme.vim
Commands which are used to change the graphical interface of vim without side effects.
misc.vim
Anything that doesn’t fit the above categories come under this section. Things like auto-completion for python, syntax highlighting for c++ are the candidates that need to be put under misc.vim.