sudo apt remove tiny-vim
sudo apt build-dep vim
git clone https://github.com/vim/vim.git
cd vim/src
make distclean # if you build Vim before
make
sudo make install
vim # enjoy!
:1,10s/^/\/\/
from line [ 1 ]
to line [ 10 ]
s is for substitution
/
^ indicates the beginning of the line
/
\/\/ each forward slash needs to escaped with a backslash.
add a space on the end for readability of commented lines
:1,10s/^\/\//
from line [ 1 ]
to line [ 10 ]
s is for substitution
/
^ indicates the beginning of the line
NOTE: the slash between beginning of line and comment is removed
\/\/ each forward slash needs to escaped with a backslash.
/
include the space on the end to return to normal code formatting
:1 Enter (Go to line 1)
qa (Start recording on register a)
Shift-I (Enter insert mode at the beginning of the line
# (Add a '#' at the beginning of the line)
Esc (Back to normal mode)
q (Stop recording)
:2,4 normal @a (re-run the macro recorded to register a on lines between 2 and 4)