" νΈλ¦¬νκ² μ¬μ©ν μμλλ‘ μ»€μ€ν μ νμλ€.
" λ²λ€ μκ°λ³΄λ€ λ§κΈ΄νμ§λ§ μ΄λ κ² νμλ λΆνΈν¨μμ΄ νΈλ¦¬νκ² μ°λκ²κ°λ€.
γ γ γ γ γ γ γ γ
"========= default variables setting ========= set cindent set bg=dark set ruler " νλ©΄ μ°μΈ‘ νλ¨μ νμ¬ μ»€μμ μμΉ(μ€,μΉΈ)λ₯Ό 보μ¬μ€λ€. set number " μ€ set modifiable set hlsearch " Highlight Search set ts=4 " tab stop - tab ν¬κΈ° set sw=4 " shift width - shift ν¬κΈ° μ‘°μ set sts=4 " soft tab stop - tab μ΄λ ν¬κΈ° set incsearch set ignorecase set printoptions=portrait:n,wrap:n,duplex:off set ai " auto indent set ignorecase " κ²μμ λμλ¬Έμ ꡬλ³νμ§μμ set cindent " c style indent set si " smart indent set expandtab " tab λμ λμ΄μ°κΈ°λ‘ set fileencodings=utf-8,euc-kr " νμΌμΈμ½λ© νμ μ§μ set bs=indent,eol,start " backspace ν€ μ¬μ© κ°λ₯ set title " μ λͺ©μ νμ set showmatch " λ§€μΉλλ κ΄νΈλ₯Ό 보μ¬μ€ colorscheme torte "set nowrap " μλ μ€λ°κΏ νμ§ μμ set nobackup "λ°±μ νμΌ μλ§λ€κΈ° set wmnu " tab μλμμ±μ κ°λ₯ν λͺ©λ‘μ 보μ¬μ€ set history=1000 " λͺ λ Ήμ΄μ λν νμ€ν 리λ₯Ό 1000κ°κΉμ§ set nocompatible " λ°©ν₯ν€λ‘ μ΄λκ°λ₯ highlight Comment term=bold cterm=bold ctermtg=2 ""μ£Όμ μκΉλ³κ²½"
syntax on
call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'taglist-plus' plugin 'vim-airline/vim-airline'
" "plugin 'AutoComplPop' call vundle#end()
"========= vundle setting ========= set nocompatible " be iMproved filetype off " required!
"set rtp+=/.vim/bundle/vundle/
set rtp+=/.vim
set rtp+=/.vim/bundle/Vundle.vim
call vundle#begin('/.vim/bundle')
call vundle#rc()
" let Vundle manage Vundle " required! Bundle 'gmarik/vundle'
Bundle 'vim-airline/vim-airline' "μνλ°κ°μ§ "Bundle 'airblade/vim-gitgutter' "μ½λ λ³κ²½ λ΄μ νλμ " vim-scripts repos "Bundle 'ctrlpvim/ctrlp.vim' "Bundle 'tpope/vim-fugitive' κΉμ°κ²° "
Bundle 'snipMate' Bundle 'L9' Bundle 'FuzzyFinder' Bundle 'The-NERD-tree' Bundle 'taglist.vim' Bundle 'bufexplorer.zip' Bundle 'DirDiff.vim' Bundle 'git://github.com/wesleyche/SrcExpl.git' "Bundle 'git://github.com/altercation/vim-colors-solarized.git' Bundle 'AutoComplPop' filetype plugin indent on " required! " " Brief help " :BundleList - list configured bundles " :BundleInstall(!) - install(update) bundles " :BundleSearch(!) foo - search(or refresh cache first) for foo " :BundleClean(!) - confirm(or auto-approve) removal of unused bundles " " see :h vundle for more details or wiki for FAQ " NOTE: comments after Bundle command are not allowed..
"========= key mapping ==========
map v]}zf "μ½λμ { λΆλΆμμ μμ μ κΈ° map zo "μμ νΌμΉκΈ° map :! gcc % -o %<.exe map :!%<.exe
map :BufExplorer
map map
"Vim λ΄μ μ°½ ν¬κΈ° μ‘°μ nmap < nmap - nmap + nmap >
"Vim λ΄μμ μ°½ κ° μ΄λ nmap h nmap j nmap k nmap l
nmap :w nmap :browse e
"----------------------------- "Tag List config filetype on"vim filetpye on nmap :TlistToggle let Tlist_Ctags_Cmd="/usr/bin/ctags" let Tlist_Inc_Winwidth=0 let Tlist_Exit_OnlyWindow=0 "window close=off let Tlist_Auto_Open=0 let Tlist_Use_Right_Window=1 "-----------------------------"
"-----------------------------" "Source Explorer config "// The switch of the Source Explorer nmap :SrcExplToggle
" // Set the height of Source Explorer window let g:SrcExpl_winHeight = 8
" // Set 100 ms for refreshing the Source Explorer let g:SrcExpl_refreshTime = 100
" // Set "Enter" key to jump into the exact definition context " let g:SrcExpl_jumpKey = ""
" // Set "Space" key for back from the definition context let g:SrcExpl_gobackKey = ""
" // In order to Avoid conflicts, the Source Explorer should know what plugins " // are using buffers. And you need add their bufname into the list below " // according to the command ":buffers!" let g:SrcExpl_pluginList = [ \ "Tag_List", \ "NERD_tree", \ "Source_Explorer" \ ]
" // Enable/Disable the local definition searching, and note that this is not " // guaranteed to work, the Source Explorer doesn't check the syntax for now. " // It only searches for a match with the keyword according to command 'gd' let g:SrcExpl_searchLocalDef = 1
" // Do not let the Source Explorer update the tags file when opening let g:SrcExpl_isUpdateTags = 0
" // Use 'Exuberant Ctags' with '--sort=foldcase -R .' or '-L cscope.files' to " // create/update a tags file let g:SrcExpl_updateTagsCmd = "ctags --sort=foldcase -R ."
" // Set "" key for updating the tags file artificially let g:SrcExpl_updateTagsKey = ""
"-----------------------------"
set tags+=/root/kernel/linux-3.8.10/tags
"-----------------------------" "NERD Tree config let NERDTreeWinPos="left" let g:NERDTreeDirArrows=0 nmap :NERDTreeToggle "-----------------------------"
"========= switch between file buffers ======== map ,x :bn! " Switch to Next File Buffer map ,z :bp! " Switch to Previous File Buffer map ,w :bw " Close Current File Buffer
map ,1 :b!1 " Switch to File Buffer #1 map ,2 :b!2 " Switch to File Buffer #2 map ,3 :b!3 " Switch to File Buffer #3 map ,4 :b!4 " Switch to File Buffer #4 map ,5 :b!5 " Switch to File Buffer #5 map ,6 :b!6 " Switch to File Buffer #6 map ,7 :b!7 " Switch to File Buffer #7 map ,8 :b!8 " Switch to File Buffer #8 map ,9 :b!9 " Switch to File Buffer #9 map ,0 :b!0 " Switch to File Buffer #0
"========= ctags setting ======== "Upon vim open a file buffer, CWD is switched to the position of the current "file "autocmd BufEnter * silent! lcd %:p:h:gs/ /\/
"set tags=./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()
func! Tn() exe "tn" endfunc nmap ,tn :call Tn()
func! Tp() exe "tp" endfunc nmap ,tp :call Tp()
func! Tr() exe "tr" endfunc nmap ,tr :call Tr()
func! Tl() exe "tl" endfunc nmap ,tl :call Tl()
endif
"======== cscope setting ======== set csprg=/usr/bin/cscope set csto=0 set cst
func! Csw() exe "cs show" endfunc nmap ,csw :call Csw()
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! Cse() let cse = expand("") new exe "cs find e ".cse if getline(1) == " " exe "q!" endif endfunc nmap ,cse :call Cse()
func! Csf() let csf = expand("") new exe "cs find f ".csf if getline(1) == " " exe "q!" endif endfunc nmap ,csf :call Csf()
func! Csg() let csg = expand("") new exe "cs find g ".csg if getline(1) == " " exe "q!" endif endfunc nmap ,csg :call Csg()
func! Csi() let csi = expand("") new exe "cs find i ".csi if getline(1) == " " exe "q!" endif endfunc nmap ,csi :call Csi()
func! Css() let css = expand("") new exe "cs find s ".css if getline(1) == " " exe "q!" endif endfunc nmap ,css :call Css()
func! Cst() let cst = expand("") new exe "cs find t ".cst if getline(1) == " " exe "q!" endif endfunc nmap ,cst :call Cst()
if filereadable("cscope.out") set nocsverb cs add cscope.out set csverb endif
"====,ma===== 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()
"====,mk===== make setting ============= let startdir = getcwd() func! Make() exe "!cd ".startdir exe "make" endfunc nmap ,mk :call Make()
"====,h====== hexViewer setting ============= let b:hexViewer = 0 func! Hv() if (b:hexViewer == 0) let b:hexViewer = 1 exe "%!xxd" else let b:hexViewer = 0 exe "%!xxd -r" endif endfunc nmap ,h :call Hv()
"============ file buffer CleanClose ============= func! CleanClose(tosave) if (a:tosave == 1) w! endif let todelbufNr = bufnr("%") let newbufNr = bufnr("#") if ((newbufNr != -1) && (newbufNr != todelbufNr) && buflisted(newbufNr)) exe "b".newbufNr else bnext endif
if (bufnr("%") == todelbufNr) new endif exe "bd".todelbufNr endfunc
nmap ,cf :call CleanClose(0)
"============ open CWD ============= nmap ,od :e ./
"============ project specific settings ============= if filereadable(".project.vimrc") source .project.vimrc endif
"========= solarized scheme ======= "syntax enable "set t_Co=256 "let g:solarized_termcolors=256 "colorscheme jellybeans "==================================
"======AutoComplPop ============= function! InsertTabWrapper() let col=col('.')-1 if !col||getline('.')[col-1]!~'\k' return "<TAB>" else if pumvisible() return "<C-M>" else return "<C-N><C-P>" end endif endfunction
inoremap =InsertTabWrapper()
hi Pmenu ctermbg=blue hi PmenuSel ctermbg=yellow ctermbg=black hi PmenuSbar ctermbg=blue "==================================