Line Numbers In Vim
Vim doesn’t show line numbers by default, they can be turned on in your vim configuration. Vim has an absolute, relative and hybrid line numbering mode.
Absolute Line Numbers
number option to your vim config, Vim sets up absolute line numbers to show the line number for each line in the current buffer.
" set absolute numbers set number " or set nu
Relative Line Numbers
relativenumber option, each line in your file is numbered relative to the cursor’s current position.
" set relative numbers set relativenumber " or set rnu " turn relative numbers off :set norelativenumber :set nornu
Hybrid Line Numbers
relativenumber at the same time produces activates the hybrid line number mode. All lines will show their relative number, except for current line, which will show its absolute line number.
" turn hybrid numbers on set relativenumber set number " or set rnu set nu " toggle hybrid line numbers :set number! relativenumber! :set nu! rnu!
That’s it. That’s the post. Got any questions, corrections? Leave a comment below!