Skip to content

Instantly share code, notes, and snippets.

@Indy9000
Last active June 11, 2017 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Indy9000/41108afb1475ffb095f4da70cd78eeb4 to your computer and use it in GitHub Desktop.
Save Indy9000/41108afb1475ffb095f4da70cd78eeb4 to your computer and use it in GitHub Desktop.
Lesser known Vim Magic
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