-
-
Notifications
You must be signed in to change notification settings - Fork 2
1.3. Vim Tips
Pierre Germain edited this page Nov 14, 2018
·
2 revisions
Add this to your .vimrc
:set backspace=2
# in your .vimrc
:set mouse=a
# for NERDTree
let g:NERDTreeMouseMode=3
:echo expand('%:p')
# replace " at the beginning of each lines with four spaces. Note a space after ".
:%s/^ / / # note that you don't need the last / but there are four spaces.
# move intentation to left for every line
:%normal <<
gg"+yG
:%y+
# if you are in .vimrc
:so %
# from other file
:so $MYVIMRC
# check your .vimrc
:echo $MYVIMRC
Or add the following to your .vimrc to auto-load
ex1
augroup myvimrchooks
au!
autocmd bufwritepost .vimrc source ~/.vimrc
augroup END
augroup reload_vimrc " {
autocmd!
autocmd BufWritePost $MYVIMRC source $MYVIMRC
augroup END " }
After a search words are hightlighted. but using :noh
or :nohl
hightlight will be disabled. If you want it back then type n
.
:noh
# go to shell
:sh
:shell
# go back to vim
exit
# go to shell
ctrl+z
# go back to vim
fg
:w ~/dirname/filename.md
# to overwrite
:w! ~/dirname/filename.md
Print it out from a browser.
# change to html
:TOhtml
# save it
:w ~/Documents/filename.html
# open it in a browser and print it out
# or save it as a txt and open it from another programme and print it out.
:%d
% is all lines in range. So you can use :%s/old/new/g
to substitute all.
1 # first line
$ # last line
. # current line
% # all lines
21,25 # lines 21 to 25 inclusive
.,$ # current line to end
Important: The Tables of Content are generated. Any change will be overridden on the next update.
For more information: GitHub Wikifier