set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
"set diffexpr=MyDiff()
"function MyDiff()
" let opt = '-a --binary '
" if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
" if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
" let arg1 = v:fname_in
" if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
" let arg2 = v:fname_new
" if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
" let arg3 = v:fname_out
" if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
" let eq = ''
" if $VIMRUNTIME =~ ' '
" if &sh =~ '\<cmd'
" let cmd = '""' . $VIMRUNTIME . '\diff"'
" let eq = '"'
" else
" let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
" endif
" else
" let cmd = $VIMRUNTIME . '\diff'
" endif
" silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
"endfunction
colo elflord
"set nu
set guioptions-=m
set guioptions-=T
set guioptions-=r
set sw=4
set ts=4
set autoindent
set nobackup
set guifont=courier_new:h18:b
"leader 设置为","
let mapleader = ","
"以最大化打开
au guiEnter * simalt ~x
"光标所在行高亮
set cursorline
"用中文显示帮助
"set helplang=cn
set fencs=utf-8,cp936
set tags=tags
set autochdir
set laststatus=2 " 显示状态栏 (默认值为 1, 无法显示状态栏)
set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ %c:%l/%L%)\
"let b:tablify_headerDelimiter = '*'
"let b:tablify_horHeaderDelimiter = '-'
"When no beep or flash is wanted, i don't like the f*** beep
"set vb t_vb=
"edit vimrc
map <silent> <leader>ee :e $MYVIMRC<cr>
"source vimrc
map <silent> <leader>ss :so $MYVIMRC<cr>
"cs a F:\VimRef\cscope-15.8\src\cscope.out
"vimManagerWindow
let g:winManagerWindowLayout='FileExplorer|TagList'
nmap wm :WMToggle<cr>
"in insert mode, insert the current file name without th.
imap <leader>fn <c-r>=expand('%:t:r')<cr>
"窗口分割时,进行切换的按键热键需要连接两次,比如从下方窗口移动
"光标到上方窗口,需要<c-w><c-w>k,非常麻烦,现在重映射为<c-k>,切换的
"时候会变得非常方便.
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
"cscope
"<C-_> Ctrl和下划线组合
nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-_>i :cs find i <C-R>=expand("<cfile>")<CR><CR>
nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>
"查找函数调用
nmap F :cs f c <C-R><C-W><CR>
"查找符号
nmap S :cs f s<C-R><C-W><CR>
"使用"ctrl+空格" 查找时就会使vim水平分隔窗口,结果显示在 新的窗口中
"nmap <C-Space>s :scs find s <C-R>=expand("<cword>")<CR><CR>
"nmap <C-Space>g :scs find g <C-R>=expand("<cword>")<CR><CR>
"nmap <C-Space>c :scs find c <C-R>=expand("<cword>")<CR><CR>
"nmap <C-Space>t :scs find t <C-R>=expand("<cword>")<CR><CR>
"nmap <C-Space>e :scs find e <C-R>=expand("<cword>")<CR><CR>
"nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
"nmap <C-Space>i :scs find i <C-R>=expand("<cfile>")<CR><CR>
"nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR>
Current vimrc
最新推荐文章于 2024-04-15 19:52:05 发布