Open a file at a line
Start vim with the cursor on line 42
vim +42 file.txt
- tool
- vim10 commands
More vim commands
-
/pattern (n/N next/prev) ?pattern (backward)/ searches forward, ? searches backward, n/N go to the next or previous match
-
:g/^#/dDelete all lines that start with # (comments)
-
gg=GGo to the top (gg) and re-indent to the end of the file (=G)
-
qa (record into a) q (stop) @a (play) 10@a (play 10 times)Macros repeat the same edits for you in vim
-
:set numberTurn on line numbers; :set nonumber hides them