linux:vim
Table of Contents
Vim
Syntax Highlighting
To enable syntax highlighting for unique file names edit:
/home/USERNAME/.vimrc
au BufNewFile,BufRead FILE.NAME setf SYNTAX
Syntax files are in:
/usr/share/vim/vim74/syntax/
Search and Replace
Find each occurrence of 'foo' (in all lines), and replace it with 'bar'.
:%s/foo/bar/gc
- Remove “%” to search only a single line.
- Remove “g” to search only for first instance.
- Remove “c” to not ask for confirmation.
- Add “i” to make case insensitive.
- Add “I” to make case sensitive.
Change only whole words exactly matching 'foo' to 'bar'; ask for confirmation.
:%s/\<foo\>/bar/gc
linux/vim.txt · Last modified: by 127.0.0.1
