🪴 Second Brain

Search IconIcon to open search

Vim

Created April 17, 2022

Vim is probably one of the oldest text editors there is, rivaled only by eMacs.
What distingues it from any other editor is that it places the user in different modes. The insert mode is exactly the same thing as normal editor, while in the normal mode, every letter executes a command. For example, typing A places you in insert mode but with the cursor at the end of the line.\

Commands can be combined into more powerful combinations

1
2
3
4
5
6
w  // moves the cursor to the next word
dw // deletes the next word
b  // moves the cursore to the prev word
db // deleted the previous word

dd // delete the entire line

I won’t go in depth on teaching vim as there are many tutorials online.

What’s worth noting is that vim on its own is kind of useless compared to VsCode for example. However, where it shines is in the massive amount of community maintained plugins, along with its very customizable configuration.
There is tho, a learning curve in creating custom config, and finding the right plugins for the job.

As an example, I have 58 plugins installed, without which life would be hard.

Which vim to use

Be mindful that there are 3 popula implementations of vim:

Recommend plugins

Here’s a list of plugins I recommend to have as Must-Have:

  1. Fzf-lua which is based on the amazing Fzf tool
  2. Coc is an all-in-one plugins for autocomplete, language server, diagnostics, etc… It loads VsCode extensions when needed, and is highly extensible. Here’s the list of coc-plugins I use: 2.1. ‘coc-snippets’ 2.2. ‘coc-pairs’ 2.3. ‘coc-diagnostic’ 2.4. ‘coc-emoji’ 2.5. ‘coc-json’ 2.6. ‘coc-tsserver’ 2.7. ‘coc-pyright’ 2.8. ‘coc-tailwindcss’ 2.9. ‘coc-tabnine’ 2.10. ‘coc-vimlsp’ 2.11. ‘coc-prettier’ 2.12. ‘coc-spell-checker’ 2.13. ‘coc-cspell-dicts’

Note that there is a growing ecosystem of native lua plugins that can replace Fzf and Coc such as:

  1. Telescope
  2. nvim-lspconfig

A full list of the plugins I use is available here
You can scan my complete configuration in my dotfiles.


Further reading:


Interactive Graph