Last active
December 17, 2015 16:58
-
-
Save mikaelz/5642227 to your computer and use it in GitHub Desktop.
VIM snippets, special searching and parsing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Search empty CSS selectors | |
/{\n\t\n} | |
Change filetype, syntax (htt, tpl, etc.) | |
:set ft=html.php | |
Delete every line in the file that does match a pattern | |
:g/pattern/d | |
Delete every line in the file that does not match a pattern | |
:v/pattern/d | |
Replace 2 or more spaces - http://stackoverflow.com/a/3860542/289404 | |
:s/ \{2,}/ /g | |
Jumping long distance - http://vimuniversity.com/samples/jumping-long-distances | |
nG - jump to line n ("line 5, Go") | |
C-o - jump backwards ("out") | |
C-i - jump forwards ("in") | |
L - jump to bottom of screen ("low") | |
M - jump to middle of screen ("middle") | |
H - jump to top of screen ("high") | |
zt - put this line at the 't'op of the screen | |
zb - put this line at the 'b'ottom of the screen | |
zz - put this line at the middle of the screen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment