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
Some may be more advanced than others, and some are vi only... | |
Vim Tutorials | |
============= | |
* http://blog.smr.co.in/linux/advanced-vim-tutorial/ | |
* http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html | |
* http://www.derekwyatt.org/vim/vim-tutorial-videos/vim-advanced-tutorial-videos/ | |
* http://linuxgazette.net/152/srinivasan.html | |
* http://www.eng.hawaii.edu/Tutor/vi.html |
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
"""""""""" | |
" Options | |
"""""""""" | |
" Use :help 'option (inclduing the ' character) to learn more about each one. | |
" | |
" Buffer (File) Options: | |
set hidden " Edit multiple unsaved files at the same time | |
set confirm " Prompt to save unsaved changes when exiting | |
" Keep various histories between edits | |
set viminfo='1000,f1,<500,:100,/100 |
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
NOTE: Some of Vim's way of handling certain regex features differs from | |
PCRE. Some people complain about this and wonder why Vim didn't just use the | |
already existing PCRE way. The reason is that Vim started getting some of | |
these things at the same time Perl did, or even beforehand. So, it's not | |
that Vim decided to flout history and Go Its Own Way just to be difficult. | |
Respect that Vim -can- do these things and has been able to do so for a long | |
time now; and suck it up and learn Vim's way. :-) |
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
" disable the syntastic plugin if editing a file more than 700 lines long | |
function DisablePlugins() | |
if line('$') > 700 | |
let g:loaded_syntastic = 1 | |
endif | |
endfunction | |
au BufRead * call DisablePlugins() |
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
" Update a timestamp on BufWrite | |
" Barry Arthur, 2012 04 04 | |
function! UpdateTimestamp() | |
let old_pos = getpos('.') | |
let old_search = histget("search", -1) | |
g/^# \d\{4}-\d\d-\d\d \d\d:\d\d: \.0 +\d\{4} \/\s*sputnick/s/^.\{-}\/\s*sputnick\s*$/\="# " . strftime('%F %H:%M: .0 %z') . " \/ sputnick"/ | |
exe "normal /".old_search | |
call setpos('.', old_pos) | |
endfunction |
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
func! Foo() | |
call setline('.', "s///") | |
call setpos('.', [0, 1, 3, 0]) | |
startinsert | |
endfunc |
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
function! PrependToRTP(name) | |
let &runtimepath = a:name . ',' . &rtp | |
endfunction | |
" Prepend tests repos to &rtp | |
call PrependToRTP(expand('$HOME').'/projects/vim/plugins/runVimTests') | |
call PrependToRTP(expand('$HOME').'/projects/vim/plugins/vimtap') | |
" Glabal vars for commonly tested plugins | |
let runVimTests_common = {} |
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
NERDTree | |
TagbarOpen | |
wincmd p | |
wincmd J | |
exe 2 . "wincmd w" | |
wincmd L |
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
" Original Code by Houl | |
" Refactored by Barry Arthur, 20 Apr 2012 | |
" UniqMapFirst({list}, {map-expr}) | |
" | |
" Remove duplicates from {list}, after applying {map-expr} (see :h map()). | |
" The instance with the lowest index is kept. | |
" | |
function! UniqMapFirst(list, mapexpr) "{{{ | |
let mlist = map(copy(a:list), a:mapexpr) |
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
EXPORT | |
this | |
EXPORT | |
abc | |
here |
OlderNewer