Vim tip: The best line number config (current + relative line numbers)
Everyone has their own preferences for config/.vimrc options, but for me I think that having the current line number and relative line numbers is the most useful way to use Vim.
The current line number is always shown in the left gutter, along with the relative line numbers above/below.
This is useful when wanting to move a to a certain line above/below the current line. You can use keyboard shortcuts (e.g. to move 5 lines down:
See the screenshot above to make sense of what I'm trying to say, if it isn't clear.
This is the config to add to your .vimrc to get it working:
- :set relativenumber
- :set number
- :set number relativenumber