Last active
June 11, 2017 11:38
-
-
Save Indy9000/41108afb1475ffb095f4da70cd78eeb4 to your computer and use it in GitHub Desktop.
Lesser known Vim Magic
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
Execute currently saved .py file | |
`:! python %` | |
Count the number of words in the saved file | |
`:!wc %` | |
Read a file in to Vim | |
`:!r filename` | |
Insert output of a shell command to current file | |
`:! ls -al` | |
Insert a web page text into current file | |
`:! w3m http://en.wikipedia.org/wiki/Vi -dump` | |
In place replace a region after a transform | |
`:20,25 ! rot13` | |
Load another file into a horizontal split screen | |
`:sp filename` | |
Load another file into a vertical split screen | |
`:vsp filename` | |
Switch split screens | |
`ctrl+ww` | |
(Install color scheme)[https://vimcolors.com] | |
copy your color scheme to `~/.vim/colors/` | |
and set it in `~/.vimrc` | |
``` | |
syntax on | |
colorscheme distinguished | |
``` | |
Mark a line so you can navigate to it | |
`mk` | |
Navigate to the marked like 'k' | |
``k` | |
Highlight word you search | |
`:set hlsearch` | |
Turn off highlighting of last searched word | |
`:nohlsearch` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment