##.vimrc 예 TODO: 예제로 사용할 .vimrc 설정 내용 정리 ###샘플 .vimrc "===========default setting set cindent set smartindent set autoindent set nowrap set ff=unix set bg=dark set ruler "specify folders to be searched set path=/root/work/include,/usr/include,/usr/local/include,/usr/src/include "===========key mapping "folding map v]}zf "unfolding map zo "Taglist plugin map :Tlist "Buffer Explorer plugin map :BufExplorer map map "===========indent on/off map ,noi :set noai:set nocindent:set nosmartindent map ,sei :set ai:set cindent:set smartindent "===========moving between file buffers map ,1 :b!1 map ,2 :b!2 map ,3 :b!3 map ,4 :b!4 map ,5 :b!5 map ,6 :b!6 map ,7 :b!7 map ,8 :b!8 map ,9 :b!9 map ,0 :b!10 map ,x :bn! "next buffer map ,z :bp! "previous buffer map ,w :bw "close current file buffer "===========ctags setting set tags=./tags,./TAGS,tags,TAGS,../tags,../../tags,/usr/include/tags,/usr/local/include/tags if version >= 500 func! Sts() let st = expand("") exe "sts ".st endfunc nmap ,st :call Sts() func! Tj() let st = expand("") exe "tj ".st endfunc nmap ,tj :call Tj() endif "===========cscope setting set csprg=/usr/bin/cscope set nocsverb cs add /home/username/vim/linux-3.7.1/cscope.out set csverb set csto=0 set cst func! Css() let css = expand("") new exe "cs find s ".css if getline(1) == "" exe "q!" endif endfunc nmap ,css :call Css() func! Csc() let csc = expand("") new exe "cs find c ".csc if getline(1) == "" exe "q!" endif endfunc nmap ,csc :call Csc() func! Csd() let csd = expand("") new exe "cs find d ".csd if getline(1) == "" exe "q!" endif endfunc nmap ,csd :call Csd() func! Csg() let csg = expand("") new exe "cs find g ".csg if getline(1) == "" exe "q!" endif endfunc nmap ,csg :call Csg() "===========man page setting func! Man() let sm = expand("") exe "!man -S 2:3:4:5:6:7:8:9:tcl:n:l:p:o ".sm endfunc nmap ,ma :call Man() "===========executing shell script func! EEdic() let sed = expand("") new exec "r! eedic.sh ".sed set nomod wrap endfunc nmap ,ed :call EEdic()gg ###샘플 shell 스크립트: eedic.sh #!/bin/sh w3m -dump \ "http://kr.dictionary.search.yahoo.com/search/dictionaryp?p=$1&subtype=eng" \ 2> /dev/null \ | awk 'BEGIN { flg = 0 } \ /단어 더 보기/ || /숙어/ || /예문/ { flg = 0 } \ { \ if (flg) print $0 \ }/단어 \(영한\)/ { flg = 1 }' \ | sed 's/\[.*\]//g' | sed 's/?//g' | sed 's/단어장에 추가//g' | sed 's/단어장에//g' \ | sed -e 's/^추가//g' | sed -e 's/^[[:space:]]*([[:space:]]*$//g' | sed 's/ㅁ//g' \ | sed 's/()//g' | sed -e 's/^[[:space:]]*)//g' | sed 's/]//g' \ | sed -e 's/[[:space:]]*$//g' | sed '/^$/d' echo "" *** ##janus janus는 Vim, GVim, MacVim에 대한 플러그인, 매핑 설정에 대한 배포버전이다. url: https://github.com/carlhuda/janus ###설치방법 prerequisites $ sudo apt-get install ack ctags git ruby rake curl installing $ curl -Lo- https://bit.ly/janus-bootstrap | bash