comment multiple lines
How to comment multiple lines in nvim.
- Go to the first line you want to start to comment. Place cursor at the beginning.
- Enter Visual Block mode by pressing Ctrl+v.
- Use arrow keys or j to select multiple lines.
- Shift+I to enter insert mode.
- Choose a character (#) to use.
- Esc to comment multiple lines.
Ctrl+v
Use cursor or j
Shift+I
#
Esc
To uncomment
- Place cursor on the first comment.
- Enter Visual Block or Ctrl+v.
- Select columns using cursor or j,k.
- Press x or d to delete on selected lines.
Ctrl+v
Use cursor or j
x or d