vimtips
-
% matches opening and closing chars (){}[], and with matchit.vim, def/end, HTML tags, etc. as well!
9:00 AM Nov 2nd
from API
-
40,50m30 will move lines 40 through 50 to line 30. Most visual mode commands can be used w/ line numbers.
8:00 AM Oct 30th
from API
-
:%s#.*(hours).*#1# will delete everything on a line except for the string 'hours'.
8:00 AM Oct 29th
from API
-
* # g* g# each searches for the word under the cursor (forwards/backwards)
8:00 AM Oct 28th
from API
-
In gvim, change the cursor depending on what mode you are in (normal, insert, etc):
8:00 AM Oct 27th
from API
-
; is a motion to repeat last find with f. f' would find next quote. c; would change up to the next ' (via @)
8:00 AM Oct 26th
from API
-
From a command-line, vim scp://username@host//path/to/file to edit a remote file locally. (See for dependencies.)
9:00 AM Oct 23rd
from API
-
/joe/+3 will search for joe and place the cursor three lines below the match.
9:00 AM Oct 22nd
from API
-
/< CTRL-r >< CTRL-w > will pull the word under the cursor into search.
9:00 AM Oct 21st
from API
-
Basic commands 'f' and 't' (like first and 'til) are very powerful. See :help t or :help f.
9:00 AM Oct 20th
from API
-
Count the number of occurences of a word in a file with :%s/<word>//gn
9:00 AM Oct 19th
from API
-
/.*fred&.*joe/ will search for fred AND joe, in any order.
8:58 AM Oct 16th
from API
-
/fred\_s*joe/ will search for fred AND joe with whitespace (including newline) in between.
8:58 AM Oct 15th
from API
-
/joe/e+1 will search for joe and place the cursor at the end of the match, plus on character.
8:58 AM Oct 14th
from API
-
< CTRL-n >< CTRL-p > offers word-completion while in insert mode.
8:58 AM Oct 13th
from API
-
:set foldmethod=syntax to make editing long files of code much easier. zo to open a fold. zc to close it. See more
8:58 AM Oct 12th
from API
-
:vimgrep pattern **/*.txt will search all *.txt files in the current directory and its subdirectories for the pattern.
8:58 AM Oct 9th
from API
-
/fred|joe/ will search for either fred OR joe.
8:58 AM Oct 8th
from API
-
:%s/^ \ n \{3}// will delete a block of 3 empty lines. (remove the spaces)
8:59 AM Oct 7th
from API
-
Ctrl-a, Ctrl-x will increment and decrement, respectively, the number under the cursor.
8:59 AM Oct 6th
from API
|
- Name vimtips
- Location Indiana
- Bio Like VI or VIM? So do we, so use it more effectively with daily tips
|