Interactive find and replace
% means whole document, not just the current line.
/g means every occurence, not just the first one.
/c is the interactive option.
Normally, to search in a non-greedy way, we add a punctuation mark, as in
.*? which means any string of characters as short as possible. For instance:
Applied to the string
abc<p>def<a>ghi<b>jkl would match
<p>def<a> and capture
def. To make non-greedy searches with Vim, replace
Split the screen in half and display two different parts of a given file
:vsp :set scrollbind
Then, on the right pane, scroll down or up, further in the file, and do:
From that point on, as you scroll on one pane, the other one will follow. To undo:
- Vim Cheat Sheet
- Vim Navigation Commands: sequences you have no excuse not to know
- Learn Vimscript the Hard Way
- How to Do 90% of What Plugins Do (With Just Vim)
- Vim anti-patterns
- Building Vim from source
- Use Vim as a Java IDE
- Auto closing an HTML tag
- Here is why vim uses the hjkl keys as arrow keys
- Your First Vim Plugin
- vim + tmux - OMG!Code
- What is your most productive shortcut with Vim?
- Why I love Vim: It’s the lesser-known features that make it so amazing