我的vimrc

现在公司服务器上用的vimrc. 脚本最后几个插件几乎没怎么用到, 实际上熟读Practical Vim Edit Text at the Speed of Thought后除了ctags和cscope基本不需要其它插件. 将don't repeat yourself贯彻始终才是关键.

  1 "vim set
  2 "colorscheme elflord 
  3 colorscheme evening 
  4 "colorscheme molokai 
  5 "let g:molokai_original=1 
  6 "let g:rehash256=1 
  7 set guifont=Monospace\ 12 
  8 "file type 
  9 filetype on 
 10 filetype plugin on 
 11 "editing set 
 12 set nu 
 13 set ruler 
 14 set showcmd 
 15 "search 
 16 set incsearch 
 17 set hlsearch 
 18 set wrapscan 
 19 "syntax 
 20 syntax enable 
 21 syntax on 
 22 "indent 
 23 filetype indent on 
 24 set tabstop=4 
 25 "set expandtab 
 26 set shiftwidth=4 
 27 set formatoptions=tcrqn 
 28 set autoindent 
 29 set cindent 
 30 "encoding set 
 31 set encoding=utf-8 
 32 set fileencodings=ucs-bom,utf-8,cp936 
 33 set fileencoding=gb2312 
 34 set termencoding=utf-8 
 35 "if use ; as mapleader move with ; in normal mode will be much slower 
 36 "<leader> 
 37 "let mapleader="\" 
 38 "map * / # 
 39 xnoremap * :<C-u>call <SID>VSetSearch()<CR>/<C-R>=@/<CR><CR> 
 40 xnoremap # :<C-u>call <SID>VSetSearch()<CR>?<C-R>=@/<CR><CR> 
 41 function! s:VSetSearch() 
 42         let temp = @s 
 43         norm! gv"sy 
 44         let @/ = '\V' . substitute(escape(@s, '/\'), '\n', '\\n', 'g') 
 45         let @s = temp 
 46 endfunction 
 47 "add cmd :Qargs 
 48 command! -nargs=0 -bar Qargs execute 'args' QuickfixFilenames() 
 49 function! QuickfixFilenames() 
 50         let buffer_numbers = {} 
 51         for quickfix_item in getqflist() 
 52                 let buffer_numbers[quickfix_item['bufnr']] = bufname(quickfix_item['bufnr']) 
 53         endfor 
 54         return join(map(values(buffer_numbers), 'fnameescape(v:val)')) 
 55 endfunction 
 56 "remap curosr move key in insert mode 
 57 imap <C-j> <DOWN> 
 58 imap <C-k> <UP> 
 59 cnoremap <C-p> <UP> 
 60 cnoremap <C-n> <DOWN> 
 61 cnoremap <expr> %% getcmdtype() == ':'   expand('%:h').'/' : '%%' 
 62 "cscope 
 63 map <leader>a :cs add ./cscope.out ./<CR> 
 64 nmap <leader>c :cs find c <C-R>=expand("<cword>")<CR><CR> 
 65 nmap <leader>d :cs find g <C-R>=expand("<cword>")<CR><CR> 
 66 nmap <leader>i :cs find i <C-R>=expand("<cword>")<CR><CR> 
 67 nmap <leader>f :cs find f <C-R>=expand("<cword>")<CR><CR> 
 68 nmap <leader>s :cs find s <C-R>=expand("<cword>")<CR><CR> 
 69 "minibufexplorer 
 70 let g:miniBufExplMapCTabSwitchBufs = 1 
 71 "damn secureCRT block <C-Tab> so remap another key here 
 72 nmap <leader><C-f> <C-Tab> 
 73 nmap <leader><C-n> <C-S-Tab> 
 74 "other option not use for now 
 75 "let g:miniBufExplMapWindowNavVim = 1 
 76 "let g:miniBufExplMapWindowNavArrows = 1 
 77 "let g:miniBufExplModSelTarget = 1 
 78 "grep.vim 
 79 let Grep_Default_Options = '-rin' 
 80 let Grep_Default_Filelist = './' 
 81 let Grep_Skip_Files = '*.o *.dep' 
 82 "pathogen 
 83 call pathogen#infect() 
 84 call pathogen#helptags() 
 85 "A.vim 
 86 nmap <leader>q :A!<CR> 
 87 nmap <leader>w :AV!<CR> 
 88 nmap <leader>e :AS!<CR> 
 89 "NERDTree 
 90 nmap <leader>1 :NERDTreeToggle<CR> 
 91 let g:NERDTreeWinPos="left" 
 92 let g:NERDTreeWinSize=30 
 93 let g:NERDTreeShowLineNumber=1 
 94 let g:neocomplcache_enable_at_startup=1 
 95 "Syntastic 
 96 "set statusline+=%#warningmsg# 
 97 "set statusline+=%{SyntasticStatuslineFlag()} 
 98 "set statusline+=%* 
 99 "let g:syntastic_always_populate_loc_list = 1 
100 "let g:syntastic_auto_loc_list = 1 
101 "let g:syntastic_check_on_open = 1 
102 "let g:syntastic_check_on_wq = 0 
103  

 

posted @ 2018-02-22 15:46  Five100Miles  阅读(254)  评论(0编辑  收藏  举报