Created
April 22, 2009 00:32
-
-
Save c9s/99499 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
" vim:fdm=marker:sw=2:ts=2:et:noet:fdl=0: | |
"============================ | |
" Author: Cornelius < cornelius.howl{at}gmail{dot}com > | |
" WebSite: http://c9s.blogspot.com | |
" Date: Wed 28 Mar 2007 04:37:26 AM CST | |
" Usage: {{{ | |
" * press 'za' on each fold. then you can edit the settings. | |
" * press 'zm' , 'zr' to open/close all folds. | |
" * template for filetype is located in .vim/skeleton/ | |
" * gvim configuration is located at .gvimrc | |
" * snippet files are located in .vim/after/ftplugin/*_snippets.vim | |
" perl included. | |
" | |
" * \e open nerdtree ( vim built-in file explorer ) | |
" * \be open buffer explorer | |
" * \bs open buffer explorer in a split-window | |
" * \q quick fix window , if you use :vimgrep for | |
" searching, \q can display to result in a toggled-window | |
" * \t open taglist window (emit ctags) | |
" * te tabedit | |
" * tn open a new tabpage | |
" * <C-x>{a,s,d,w,x} move gvim windows (left,full,right,top,bottom) | |
" * ,h disable highlight (after you search something) | |
" * :set incs icase search | |
" * <F10> to toggle paste feature (normal mode) | |
" * <F2> insert datetime (insert mode) | |
" * ; is equal to : (to insert command) | |
" * :Iamperl to set file syntax as perl | |
" | |
" * use visual mode to select block , press '=' to re-indent, it will auto | |
" emit perltidy for perlcode. please install perltidy first. | |
" | |
" for debian-based: | |
" sudo apt-get install perltidy | |
" for macos: | |
" sudo port install perltidy | |
" | |
" or install by cpan | |
" sudo cpanp -i PerlTidy | |
" | |
" * if you are looking for indent setting, please search 'sw' | |
" * you can indent codes by <Tab>,<Shift-Tab> directly , or use visual-mode to indent | |
" * command-mode cursor jumping ( Ctrl-{f,b,a,e} ) | |
" }}} | |
"============================ | |
" general settings {{{ | |
behave mswin | |
syntax on | |
filetype on | |
filetype plugin on | |
filetype indent on | |
let g:loaded_netrw = 1 | |
let g:loaded_netrwPlugin = 1 | |
" }}} | |
" options {{{ | |
"set cedit=<C-y> | |
"nm : q:i | |
"nm / q/i | |
"nm ? q?i | |
" numbers of colo | |
" set t_Co=256 | |
set sh=zsh | |
" scroll jump | |
set sj=1 | |
" scroll off | |
set so=6 | |
set tags+=~/.tags | |
set dict+=~/vim_completion | |
"set thesaurus= | |
"setlocal spell spelllang=en_US | |
"If you want to put swap files in a fixed place, put a command resembling the | |
"following ones in your .vimrc | |
set dir=~/tmp | |
"(for MS-DOS and Win32) | |
"set dir=c:\\tmp | |
"set wildmode=full,list | |
"set wildmode=list:full | |
set wildmode=longest,list | |
set wildignore+=*.o,*.a,*.so,*.obj,*.exe,*.lib,*.ncb,*.opt,*.plg,.svn,.git | |
" set wildoptions | |
set winaltkeys=no | |
" statusline format | |
"set statusline=%<%f\ %h%m%r%=%k[%{(&fenc==\"\")?&enc:&fenc}%{(&bomb?\",bom\":\"\")}]\ %-14.(%l,%c%v%)\ %p | |
" scrollbind | |
"set scb | |
" history | |
set history=60 | |
set sr nu sta sc noeb nocp wmnu | |
set et | |
set sw=4 | |
set ts=4 | |
set sts=4 | |
" no error bell,visual bell | |
"set novb | |
set modeline | |
set mat=15 | |
set maxmem=4096 | |
set ignorecase | |
set smartcase | |
set ruler is nowrap ai si hls sm bs=indent,eol,start | |
set ff=unix | |
"set wm=6 | |
"set hlsearch | |
" encoding | |
"set fileencodings=utf-8,big5,gbk,sjis,euc-jp,euc-kr,utf-bom,iso8859-1 | |
set fencs=utf-8,big5,euc-jp,utf-bom,iso8859-1 | |
set fenc=utf-8 enc=utf-8 tenc=utf-8 | |
" color scheme {{{ | |
"colors default | |
"colors zellner | |
"colors tango | |
"colors marklar | |
"colors darkzen | |
"colors af | |
"colors black_angus | |
"colors c9s | |
"colors jhdark | |
" }}} | |
" }}} | |
" built-in color {{{ | |
" colors blue | |
" colors darkblue | |
" colors default | |
" colors delek | |
" colors desert | |
" colors elflord | |
" colors evening | |
" colors koehler | |
" colors morning | |
" colors murphy | |
" colors pablo | |
" colors peachpuff | |
" colors ron | |
" colors shine | |
" colors slate | |
" colors torte | |
" colors zellner | |
" colors tango | |
" }}} | |
" menu {{{ | |
"am svk.commit :svkcommit<cr> | |
"am svk.revert :!svk revert %<cr> | |
"am svk.log :read !svk log -l 20<cr> | |
am &Options.Edit\ Vimrc\ In\ New\ Tab :tabedit $MYVIMRC<CR> | |
am &Options.Reload\ Vimrc :source $MYVIMRC<CR> | |
am &Options.- : | |
am &Options.Bitstream\ Vera\ Sans\ Mono :set guifont=Bitstream\ Vera\ Sans\ Mono\ 10<CR> | |
am &Options.DejaVu\ Sans\ Mono :set guifont=Dejavu\ Sans\ Mono\ 10<CR> | |
am &Options.Andale\ Mono :set guifont=Andale\ Mono\ 10<CR> | |
am &Options.Monaco :set guifont=Monaco\ 10<CR> | |
"}}} | |
" fold options {{{ | |
"set fdt=FoldText() | |
set vop=folds,cursor | |
" fdc: fold column | |
set fdc=4 | |
" fdn: fold nest max | |
set fdn=2 | |
" fdl: fold level | |
set fdl=1 | |
" fml: fold min line | |
set fml=3 | |
"set fdm=marker | |
"set fdm=manual | |
" }}} | |
" foldexpr {{{ | |
fu! GetPerlFold() | |
let l = getline(v:lnum) | |
if l =~ '^\v(sub\s+.*\{\s*$|template\s|\=\w+\s)' | |
retu '>1' | |
elsei l =~ '^\v(for|while)>' | |
retu '>1' | |
elsei l =~ '^\v(\};?|\=cut)' | |
retu '<1' | |
elseif l =~ '^\s*#.*{{{' | |
return 'a1' | |
elseif l =~ '^\s*#.*}}}' | |
retu 's1' | |
el | |
retu "=" | |
en | |
endf | |
" }}} | |
" foldtext {{{ | |
"--------------------------------------------------- | |
fu! FoldText() | |
let line = getline(v:foldstart) | |
let cms = &commentstring | |
" make pattern | |
let cms = substitute( cms , '%s' , '|' , 'g' ) | |
let cms = substitute( cms , '[*<!>]' , '\\\0' , 'g' ) | |
let cms = '\v(' . cms | |
if cms =~ '|$' | |
else | |
let cms .= '|' | |
en | |
let cms .= '\{\{\{\d=)' | |
" for debug | |
"let g:test = cms | |
" strip commentstring | |
if line =~ cms | |
let sub = substitute( line, cms , '', 'g') | |
" strip prefix | |
elseif line =~ '^\v(sub|template)\s' | |
let sub = substitute( line, '^\v(sub|template)\s''?(\w+)''?.*','\1: \2','') | |
elseif line =~ '^\v\=(\w+)\s' | |
let sub = substitute( line, '^\v\=(\w+)\s(\w+)','\1: \2','') | |
else | |
let sub = line | |
en | |
" strip space | |
let sub = substitute( sub, '^\s*' , '', 'g') | |
let sub = substitute( sub, '\s*$' , '', 'g') | |
" count line | |
let num = v:foldend - v:foldstart | |
" make format line | |
let fline = printf( "|%3d|- %s " , v:foldend - v:foldstart ,sub ) | |
"return fold | |
retu v:folddashes . v:folddashes . v:folddashes . fline | |
endf | |
" | |
" FOLD NOTES {{{ | |
" [z.]z | |
" jump to begining of fold and end of fold | |
" zj,zk | |
" jump to next or previous fold | |
" za | |
" toggle fold | |
" zn | |
" to disable fold | |
" zn | |
" to enable fold | |
" set nofoldenable | |
" disable folding | |
" | |
" fold-foldtext | |
" | |
" v:foldstart line number of first line in the fold | |
" v:foldend line number of last line in the fold | |
" v:folddashes a string that contains dashes to represent the | |
" foldlevel. | |
" v:foldlevel the foldlevel of the fold | |
" }}} | |
" }}} | |
" skeleton {{{ | |
au bufnewfile *.c 0r ~/.vim/skeleton/template.c | |
au bufnewfile *.cpp 0r ~/.vim/skeleton/template.cpp | |
au bufnewfile *.h 0r ~/.vim/skeleton/template.h | |
au bufnewfile *.java 0r ~/.vim/skeleton/template.java | |
au bufnewfile *.sh 0r ~/.vim/skeleton/template.sh | |
au bufnewfile *.css 0r ~/.vim/skeleton/template.css | |
au bufnewfile *.html 0r ~/.vim/skeleton/template.html | |
au bufnewfile *.s 0r ~/.vim/skeleton/template.s | |
" }}} | |
" autocommand {{{ | |
" make view ( save folds , tabs , cursor position ) | |
au bufwinleave *.c,*.pm,*.pl,*.cpp silent mkview | |
au bufwinenter *.c,*.pm,*.pl,*.cpp silent loadview | |
au bufread,bufnewfile *.txt :set textwidth=80 | |
"au bufwritepost ~/.vimrc source ~/.vimrc | |
" }}} | |
" keymap {{{ | |
" make tab in v mode indent code | |
nm <tab> v> | |
nm <s-tab> v< | |
xmap <tab> >gv | |
xmap <s-tab> <gv | |
" tabpage | |
nmap <c-x><c-f> :tabedit | |
nmap <c-x><c-n> :tab new<CR> | |
" paste mass text | |
set pastetoggle=<F1> | |
" must disable winaltkey | |
nm <a-x> <c-w><c-w><c-w>_ | |
nm <a-=> <c-w>= | |
nn <c-w>9 8<c-w>+ | |
nn <c-w>0 8<c-w>- | |
nm ,h :noh<cr> | |
nmap ,s :source $myvimrc | |
nmap ,v :e $myvimrc | |
im <f2> <c-r>=strftime("%y %b %d %x")<cr> | |
" command line jump to head , end | |
cm <c-a> <home> | |
cm <c-e> <end> | |
" back one character: | |
cno <c-b> <left> | |
cno <c-d> <del> | |
cno <c-f> <right> | |
cno <c-n> <down> | |
cno <c-p> <up> | |
cno <esc><c-b> <s-left> | |
cno <esc><c-f> <s-right> | |
"| ctrl-r {0-9a-z"%#:-=.} *c_ctrl-r* *c_<c-r>* | |
"| '"' the unnamed register, containing the text of | |
"| the last delete or yank | |
"| '%' the current file name | |
"| '#' the alternate file name | |
"| '*' the clipboard contents (x11: primary selection) | |
"| '+' the clipboard contents | |
"| '/' the last search pattern | |
"| ':' the last command-line | |
"| '-' the last small (less than a line) delete | |
"| '.' the last inserted text | |
"cnoremap <c-v> <c-r>* | |
"| ctrl-r ctrl-f *c_ctrl-r_ctrl-f* *c_<c-r>_<c-f>* | |
"| ctrl-r ctrl-p *c_ctrl-r_ctrl-p* *c_<c-r>_<c-p>* | |
"| ctrl-r ctrl-w *c_ctrl-r_ctrl-w* *c_<c-r>_<c-w>* | |
"| ctrl-r ctrl-a *c_ctrl-r_ctrl-a* *c_<c-r>_<c-a>* | |
"| insert the object under the cursor: | |
"| ctrl-f the filename under the cursor | |
"| ctrl-p the filename under the cursor, expanded with | |
"| 'path' as in |gf| | |
"| ctrl-w the word under the cursor | |
"| ctrl-a the word under the cursor; see |word| | |
" wrapper | |
nnoremap ,w{ bi{<ESC>ea}<ESC> | |
nnoremap ,w( bi(<ESC>ea)<ESC> | |
nnoremap ,w' bi'<ESC>ea'<ESC> | |
nnoremap ,w" bi"<ESC>ea"<ESC> | |
"nm <f7> :make<cr> | |
" | |
" change assign | |
nm cr= ^f=cf; | |
nm cl= ^f=c^ | |
" change ( sp1 , sp2 , var3 , spl ) | |
"nmc s | |
nm gp1 0f(lvf,h | |
nm gp2 0f(f,lvf,h | |
nm gp3 0f(f,f,lvf,h | |
nm gp0 0f(lvi( | |
nm gpl 0f)hvf,l | |
"nm <f2> :w<cr> | |
"nm <f3> :q<cr> | |
nm <f4> ggvg"+y'' | |
nm dt f<vf>f>d | |
nm <c-n> :m .+1<cr> | |
nm <c-p> :m .-2<cr> | |
nm <c-k>mx :!chmod u+x %<cr> | |
nm <c-k>sh :sh<cr> | |
"nm <c-k>mf [{v]}zf | |
nm <c-k>mh :tohtml<cr>:w %:r.html<cr>:q<cr> | |
nm <c-h> 0 | |
nm <c-l> $ | |
nm =b {=}'' | |
" insert perl interpolation | |
im <c-v>@ @{[ ]}<esc>2hi | |
im <c-v>" ""<esc>i | |
im <c-v>' ''<esc>i | |
im <c-v>{ { }<esc>hi | |
" XXX: hate | |
"nn ; : | |
" maybe this | |
command! W :w | |
nn q; q:i | |
nn q/ q/i | |
" tabpage map | |
" XXX: i need f,t now | |
"nm tn :tabnew<cr> | |
" | |
" }}} | |
" commands {{{ | |
" grep pattern in this file | |
com! -nargs=* VG :vimgrep <args> % | |
" for vimrc | |
com! EditVimrc :tabedit $MYVIMRC | |
com! ReloadVimrc :source $MYVIMRC | |
" grep sliently | |
com! -nargs=* G :grep <args> | |
" }}} | |
" convert <arrow "{{{ | |
com! -range -nargs=0 ConvertARROW call _ConvertARROW(<line1>,<line2>) | |
"com! -range ConvertLtGt call ConvLtGt() | |
fu! _ConvertARROW(s,e) | |
silent exec a:s . ',' . a:e . 's/</\</g' | |
silent exec a:s . ',' . a:e . 's/>/\>/g' | |
endf | |
"}}} | |
" buffer sel by pattern {{{ | |
" ==================================== | |
function! BufSel(pattern) | |
let buf_count = bufnr("$") | |
let cur_bufnr = 1 | |
let nummatches = 0 | |
let firstmatchingbufnr = 0 | |
while cur_bufnr <= buf_count | |
if(bufexists(cur_bufnr)) | |
let currbufname = bufname(cur_bufnr) | |
if(match(currbufname, a:pattern) > -1) | |
echo cur_bufnr . ": ". bufname(cur_bufnr) | |
let nummatches += 1 | |
let firstmatchingbufnr = cur_bufnr | |
endif | |
endif | |
let cur_bufnr = cur_bufnr + 1 | |
endwhile | |
if(nummatches == 1) | |
execute ":buffer ". firstmatchingbufnr | |
elseif(nummatches > 1) | |
let desiredbufnr = input("Enter buffer number: ") | |
if(strlen(desiredbufnr) != 0) | |
execute ":buffer ". desiredbufnr | |
endif | |
else | |
echo "No matching buffers" | |
endif | |
endfunction | |
function! BufSelInput() | |
let pattern = input( "pattern: " ) | |
call BufSel( pattern ) | |
endfunction | |
"Bind the BufSel() function to a user-command | |
command! -nargs=1 Bs :call BufSel("<args>") | |
nmap <leader>bf :call BufSelInput()<CR> | |
" ==================================== | |
" }}} | |
" blogger template {{{ | |
" ctrl-f5 | |
fu! GetColorCode() | |
let name = input( "name:" ) | |
let desp = input( "description:" ) | |
"let line = getline(".") | |
sil! exec 'silent! s/\(#[0-9a-f]\{3,6\}\)\(.\{-}$\)/$'.name.' \2\r' | |
\ . '<variable name="'.name.'" ' | |
\ . 'description="'.desp.'" \r\t\t' | |
\ . 'type="color" default="\1" value="\1">\r' | |
\ . '/' | |
sil exec "normal vkkx" | |
sil exec "/\\v<b:skin><![cdata[" | |
sil exec "normal p" | |
endf | |
nm <c-f5> :cal Getcolorcode()<cr> | |
fu! GetBtFold() " blogger template fold | |
if getline(v:lnum) =~ '\v\<(b:widget|b:includable|b:section|b:skin).{-}(\/)@<!\>' | |
retu 'a1' | |
elsei getline(v:lnum) =~ '\v\<\/(b:widget|b:includable|b:section|b:skin)\>' | |
retu 's1' | |
el | |
retu "=" | |
en | |
endf | |
" }}} | |
" inserting prefix {{{ | |
"vm <c-h> :s/^/prefix/<cr> | |
" | |
" vm <c-h> <esc>:cal subs()<cr> | |
" | |
" function! subs() | |
" let g:str = input( "prefix:" ) | |
" exec "'<" | |
" let sn = line(".") | |
" exec "'>" | |
" let en = line(".") | |
" exec ':'.sn.','.en.'s/^/' . g:str . '/g' | |
" endfunction | |
"================================================== | |
" }}} | |
" all space {{{ | |
fu! _Allspace() | |
setlocal expandtab | |
retab! | |
endf | |
command! -nargs=0 Allspace :call _Allspace() | |
"}}} | |
" find file {{{ | |
function! Find(name) | |
let l:list=system("find . -name '".a:name."' | perl -ne 'print \"$.\\t$_\"'") | |
let l:num=strlen(substitute(l:list, "[^\n]", "", "g")) | |
if l:num < 1 | |
echo "'".a:name."' not found" | |
return | |
endif | |
if l:num != 1 | |
echo l:list | |
let l:input=input("Which ? (CR=nothing)\n") | |
if strlen(l:input)==0 | |
return | |
endif | |
if strlen(substitute(l:input, "[0-9]", "", "g"))>0 | |
echo "Not a number" | |
return | |
endif | |
if l:input<1 || l:input>l:num | |
echo "Out of range" | |
return | |
endif | |
let l:line=matchstr("\n".l:list, "\n".l:input."\t[^\n]*") | |
else | |
let l:line=l:list | |
endif | |
let l:line=substitute(l:line, "^[^\t]*\t./", "", "") | |
execute ":e ".l:line | |
endfunction | |
command! -nargs=1 Find :call Find("<args>") | |
"}}} | |
" vimgrep {{{ | |
" XXX: deprecated? orz | |
fu! Vimgrep() | |
cal inputsave() | |
let g:mypattern = input("pattern(vimgrep):") | |
if strlen( g:mypattern ) == 0 | |
" do nothing | |
else | |
exec ':vimgrep "' . g:mypattern . '" * ' | |
en | |
cal inputrestore() | |
endf | |
"nnoremap .gr :vimgrep *<left><left> | |
nn ,gr :cal Vimgrep()<cr> | |
" }}} | |
" quickfix window {{{ | |
com! -bang -nargs=? QFix cal QFixToggle(<bang>0) | |
fu! QFixToggle(forced) | |
if exists("g:qfix_win") && a:forced == 0 | |
cclose | |
unlet g:qfix_win | |
else | |
copen 10 | |
let g:qfix_win = bufnr("$") | |
en | |
endf | |
nn <leader>q :QFix<cr> | |
" }}} | |
"========================================== | |
" FILE SPECIFIED OPTIONS | |
"========================================== | |
" c code {{{ | |
au Filetype c :cal C_RC() | |
au Filetype cpp :cal CPP_RC() | |
fu! C_RC() | |
set path+=/usr/include/c++/4.1.2/ | |
let c_comment_strings=1 | |
nm <f7>r :!./%:r.out<cr> | |
set cindent | |
ab #d #define | |
ab #i #include | |
setlocal equalprg=indent | |
nm <F7> :make<CR> | |
"au bufread,bufnewfile *.c nm <c-f7> :!gcc -Wall % -o %:r.out<cr> | |
"au bufread,bufnewfile *.c :set makeprg=gcc\ -wall\ %\ -o\ %:r.out | |
endf | |
fu! CPP_RC() | |
let c_comment_strings=1 | |
set ep=indent | |
nm <F7> :make<CR> | |
"au bufread,bufnewfile *.cpp nm <c-f7> :!g++ -wall % -o %:r.out<cr> | |
"au bufread,bufnewfile *.cpp :set makeprg=g++\ -wall\ %\ -o\ %:r.out | |
endf | |
" }}} | |
" html code {{{ | |
let html_use_css = 1 | |
au Filetype html :cal HTML_RC() | |
fu! HTML_RC() | |
nm <F7> :!firefox %<CR> | |
endf | |
" }}} | |
" perl code {{{ | |
let perl_include_pod = 1 | |
let perl_extended_vars = 1 | |
let perl_want_scope_in_variables = 1 | |
" perl template | |
au BufNewFile *.pl :0r ~/.vim/skeleton/template.pl | |
au BufNewFile *.pm :0r ~/.vim/skeleton/template.pm | |
au BufNewFile *.t :0r ~/.vim/skeleton/template.t | |
au BufNewFile *.tt :0r ~/.vim/skeleton/template.tt | |
com! Iamperl :call Iamperl__() | |
fu! Iamperl__() | |
set syntax=perl | |
call PERL_RC() | |
endf | |
let perl_fold=1 | |
let perl_fold_blocks=1 | |
au Filetype perl :cal PERL_RC() | |
function! _perl_comment() | |
let l = getline('.') | |
if l =~ '^#' | |
exec 's/^#//g' | |
else | |
exec 's/^/#/g' | |
endif | |
endfunction | |
fu! PERL_RC() | |
"check perl code with :make | |
"au filetype perl set makeprg=perl\ -c\ %\ $* | |
"au filetype perl set errorformat=%f:%l:%m | |
"au filetype perl set autowrite | |
" set tt2 as html | |
au BufRead,BufNewFile *.tt2 :setfiletype html | |
" run perl code | |
nmap <C-c><C-c> :!perl %<CR> | |
" syntax check | |
nmap <C-c><C-y> :!perl -c %<CR> | |
vmap ,c :call _perl_comment()<CR> | |
nmap ,c :call _perl_comment()<CR> | |
setlocal equalprg=perltidy | |
"set fdm=manual | |
setlocal fdm=syntax | |
" indentexpr , indent-expression | |
fu! RenameVar() | |
cal inputsave() | |
let varname = input("variablename: ") | |
if strlen( varname ) == 0 | |
" do nothing | |
else | |
let newvarname = input("new variablename: ") | |
exec 'slient :%s/${\?'.varname.'}\?\>/$'.newvarname.'/g' | |
en | |
cal inputrestore() | |
endf | |
com! RenameVar :cal RenameVar() | |
"set fde=GetPerlFold() | |
endf | |
" }}} | |
" php code {{{ | |
au Filetype php :cal PHP_RC() | |
fu! PHP_RC() | |
endf | |
"}}} | |
" haskell {{{ | |
au filetype haskell :cal HASKELL_RC() | |
fu! HASKELL_RC() | |
" if has("gui_running") | |
" "colors slate2 | |
" en | |
endf | |
" }}} | |
" bash"{{{ | |
au Filetype bash :cal BASH_RC() | |
fu! BASH_RC() | |
nm <F7> :!bash %<CR> | |
endf | |
"}}} | |
" xul code {{{ | |
au bufnewfile *.xul :0r ~/.vim/skeleton/template.xul | |
" }}} | |
"============================================================= | |
" PLUGIN SETTING | |
"============================================================= | |
" winexplorer plugin {{{ | |
nm <c-w><c-f> :FirstExplorerWindow<cr> | |
nm <c-w><c-b> :BottomExplorerWindow<cr> | |
nm <leader>w :WMToggle<cr> | |
" }}} | |
" textmate-like snippets {{{ | |
com! EditSnippets :tabedit ~/.vim/after/ftplugin/ | |
let g:snip_start_tag = "«" | |
let g:snip_end_tag = "»" | |
" }}} | |
" vcs {{{ | |
" XXX: deprecated (not useful) | |
" set rtp+=~/.vim/plugin/vcscommand | |
" }}} | |
" ctags for windows {{{ | |
if has("win32") | |
let Tlist_ctags_cmd = $vimruntime . '/ctags/ctags.exe' | |
en | |
" taglist | |
nm <leader>t :TlistToggle<cr> | |
"let tlist_compact_format=1 | |
"let tlist_display_prototype=1 | |
" }}} | |
" nerd tree explorer {{{ | |
" notes: | |
" | |
" o open selected file, or expand selected dir | |
" go open selected file, but leave cursor in the nerdtree | |
" t open selected node in a new tab | |
" t same as 't' but keep the focus on the current tab | |
" <tab> open selected file in a split window | |
" g<tab> same as <tab>, but leave the cursor on the nerdtree | |
" ! execute the current file | |
" o recursively open the selected directory | |
" x close the current nodes parent | |
" x recursively close all children of the current node | |
" e open a netrw for the current dir | |
" | |
map <leader>e :NERDTreeToggle<cr> | |
" }}} | |
" bufexplorer {{{ | |
" \b{s|v|e} | |
" | |
" notes | |
" <f1> toggle help information. | |
" <cr> or opens the buffer that is under the cursor into the current | |
" <leftmouse> window. | |
" s opens the buffer that is under the cursor into a newly split | |
" window. | |
" d deletes the buffer from the list that is under the cursor. | |
" o toggles open mode. only available in 'split mode'. | |
" p toggles the showing of a split filename/pathname. | |
" q quit exploring. | |
" r reverses the order the buffers are listed in. | |
" r toggles relative path/absolute path. | |
" s selects the order the buffers are listed in. either by buffer | |
" number, file name, file extension, most recently used (mru), or | |
" full path. | |
" t toggles split type. only available in 'split mode'. | |
" }}} | |
" mru recent file list {{{ | |
let MRU_Auto_Close = 0 | |
let MRU_Use_Current_Window = 1 | |
let MRU_Max_Entries = 20 | |
" }}} | |
" fuzzy finder " {{{ | |
let g:FuzzyFinderOptions = { 'Base':{}, 'Buffer':{}, 'File':{}, 'Dir':{}, 'MruFile':{}, 'MruCmd':{}, 'Bookmark':{}, 'Tag':{}, 'TaggedFile':{}} | |
let g:FuzzyFinderOptions.Base.ignore_case = 1 | |
let g:FuzzyFinderOptions.Base.abbrev_map = { | |
\ '^jf ' : [ | |
\ 'lib/*/*/*', | |
\ 'etc/', | |
\ 'share/web/static', | |
\ 't/' | |
\ ], | |
\ } | |
nnoremap <silent> <leader>ff :FuzzyFinderFile!<CR> | |
nnoremap <silent> <leader>fd :FuzzyFinderDir!<CR> | |
nnoremap <silent> <leader>fb :FuzzyFinderBuffer!<CR> | |
" }}} | |
" jifty syntax {{{ | |
let jifty_fold_schema = 1 | |
let jifty_fold_schema_column = 1 | |
let jifty_fold_template = 1 | |
let jifty_fold_tags = 1 | |
let jifty_fold_dispatcher = 1 | |
" }}} | |
" svk do {{{ | |
function! _SVKDO() | |
let action = input( "svk action to " . expand('%') . " : " ) | |
if strlen( action ) < 1 | |
echo "no action" | |
return | |
endif | |
let append_param = '' | |
if action =~ '\(ci\|commit\)' | |
let commit_message = input("commit message: ") | |
if strlen( commit_message ) < 1 | |
return | |
endif | |
let append_param .= '-m "' . commit_message . '"' | |
endif | |
exec "!svk " . action . " " . expand('%') . " " . append_param | |
endfunction | |
command! SVKDO :call _SVKDO() | |
nmap <D-k> :SVKDO<CR> | |
" }}} | |
" custom tabpage key for mac and other platform {{{ | |
" window size key for macbook | |
" | |
if has('gui_mac') | |
nmap <silent> <D--> :resize -5<CR> | |
nmap <silent> <D-=> :resize +5<CR> | |
nmap <silent> <D-]> :vertical resize +5<CR> | |
nmap <silent> <D-[> :vertical resize -5<CR> | |
nmap <silent> <D-\> <C-w><C-w> | |
nmap <silent> <D-;> gT | |
nmap <silent> <D-'> gt | |
" nmap <c-x>tf :tabfind | |
" nmap <c-x>th :tab help<CR> | |
nmap <D-s> :w<CR> | |
else | |
nmap <C-t><C-e> :tabedit | |
nmap <C-t><C-f> :tabfind | |
endif | |
"}}} | |
" macros {{{ | |
" let @a = "yypp" | |
" let @b = "i==============================" | |
" }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment