via Vim Tips Wiki
:%s/foo/bar/gc
Change each 'foo' to 'bar', but ask for confirmation first.
Or I have EasyGrep installed so
- Leader vv - Grep for the word under the cursor, match all occurences, like |gstar|
- Leader vV - Grep for the word under the cursor, match whole word, like |star|
- Leader vr - Perform a global search search on the word under the cursor and prompt for a pattern with which to replace it.
via vimcasts.org
ctrl-w s
split the current window horizontally, loading the same file in the new windowctrl-w v
split the current window vertically, loading the same file in the new window:on[ly]
close all windows except the currently active windowctrl-W T
Move current split window into its own tab
Surround.vim is all about "surroundings": parentheses, brackets, quotes, XML tags, and more. The plugin provides mappings to easily delete, change and add such surroundings in pairs.
- vi"(double quote): select inside ""
- vit: select inside tag
- ci"(double quote): change inside ""
- yit: copy inside tag
- yi{: copy inside {
If you are HTML/CSS guy, then above and mix should be enough to utilize surround.vim
You can pair with easyGrep's Leader vr it's very useful.
Make selecting with mouse in Vim do so in Visual Mode, Remap arrow keys to act as hjkl
- Mouse uses visual mode when selecting
set selectmode=key
- Arrow keys, in visual mode, act like hjkl
:map <down> j
:map <up> k
:map <left> h
:map <right> l
- Use tab to open files in buffer
:tab ball