Difference between revisions of "Vim"
From www.b-kaempgen.de
(Created page with "Description::Useful commands in the text editor Vim. * go into insert mode: i * leave insert mode: esc * :wq / :x Write file to disk and quit the editor * \h see help * \e f...") |
|||
(2 intermediate revisions by one user not shown) | |||
Line 8: | Line 8: | ||
* \i | * \i | ||
* searching in vim: / (n for next, N for previous) | * searching in vim: / (n for next, N for previous) | ||
+ | * search and replace of all occurences in file: :%s/foo/bar/g | ||
* Deleting the next 5 lines: d5d | * Deleting the next 5 lines: d5d | ||
* Goto line 7: :7 | * Goto line 7: :7 | ||
+ | * Special characters: In INSERT mode Ctrl+k and then digraph [http://www.alecjacobson.com/weblog/?p=443] | ||
+ | * Add something at the end of each line: %s/.*/& SUFFIX / | ||
[[Category:Howto]] | [[Category:Howto]] |
Latest revision as of 00:56, 9 October 2014
Useful commands in the text editor Vim.
- go into insert mode: i
- leave insert mode: esc
- :wq / :x Write file to disk and quit the editor
- \h see help
- \e file
- \i
- searching in vim: / (n for next, N for previous)
- search and replace of all occurences in file: :%s/foo/bar/g
- Deleting the next 5 lines: d5d
- Goto line 7: :7
- Special characters: In INSERT mode Ctrl+k and then digraph [1]
- Add something at the end of each line: %s/.*/& SUFFIX /