vim — editing files in the terminal
cheat sheet · vim / vi https://lab.dimsanych.ru/en/wiki/vim/Cheat sheet
-
ienter insert mode to type text -
Escgo back to Normal -
:wsave -
:qquit -
:wqsave and quit -
:q!quit without saving -
/textsearch forward through the file -
:%s/a/b/gcreplace across the whole file, confirming each replacement
Options
Command-line flags, not in-editor commands: vim +42 file opens the file
straight at line 42, vim -R file opens it read-only (protection against
accidental edits), vim -u NONE starts without your personal
~/.vimrc — useful for checking whether your config is the cause of odd
behavior.