vimrc 配置


set nocompatible " be iMproved, required
filetype off " required

" set the runtime path to include Vundle and initialize


set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

 

" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')


" let Vundle manage Vundle, required

Plugin 'gmarik/vundle'


Plugin 'VundleVim/Vundle.vim'

 


" Snippets are separated from the engine. Add this if you want them:

Plugin 'honza/vim-snippets'
Plugin 'SirVer/ultisnips'

Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'

""Plugin 'SirVer/ultisnips'''

 


Plugin 'scrooloose/syntastic'

 

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
"Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.

Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.

Plugin 'ascenator/L9', {'name': 'newL9'}


Plugin 'Valloric/YouCompleteMe'


" All of your Plugins must be added before the following line


call vundle#end() " required
filetype plugin indent on " required

 

" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

 

 

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" \u663e\u793a\u76f8\u5173

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"set shortmess=atI " \u542f\u52a8\u7684\u65f6\u5019\u4e0d\u663e\u793a\u90a3\u4e2a\u63f4\u52a9\u4e4c\u5e72\u8fbe\u513f\u7ae5\u7684\u63d0\u793a

"winpos 5 5 " \u8bbe\u5b9a\u7a97\u53e3\u4f4d\u7f6e

"set lines=40 columns=155 " \u8bbe\u5b9a\u7a97\u53e3\u5927\u5c0f

"set nu " \u663e\u793a\u884c\u53f7

set go= " \u4e0d\u8981\u56fe\u5f62\u6309\u94ae

"color asmanian2 " \u8bbe\u7f6e\u80cc\u666f\u4e3b\u9898

set guifont=Courier_New:h10:cANSI " \u8bbe\u7f6e\u5b57\u4f53

syntax on " \u8bed\u6cd5\u9ad8\u4eae

autocmd InsertLeave * se nocul " \u7528\u6d45\u8272\u9ad8\u4eae\u5f53\u524d\u884c

autocmd InsertEnter * se cul " \u7528\u6d45\u8272\u9ad8\u4eae\u5f53\u524d\u884c

"set ruler " \u663e\u793a\u6807\u5c3a

set showcmd " \u8f93\u5165\u7684\u547d\u4ee4\u663e\u793a\u51fa\u6765\uff0c\u770b\u7684\u6e05\u695a\u4e9b

"set cmdheight=1 " \u547d\u4ee4\u884c\uff08\u5728\u72b6\u6001\u884c\u4e0b\uff09\u7684\u9ad8\u5ea6\uff0c\u8bbe\u7f6e\u4e3a1

"set whichwrap+=<,>,h,l " \u5141\u8bb8backspace\u548c\u5149\u6807\u952e\u8de8\u8d8a\u884c\u8fb9\u754c(\u4e0d\u5efa\u8bae)

"set scrolloff=3 " \u5149\u6807\u79fb\u52a8\u5230buffer\u7684\u9876\u90e8\u548c\u5e95\u90e8\u65f6\u4fdd\u63013\u884c\u8ddd\u79bb

set novisualbell " \u4e0d\u8981\u95ea\u70c1(\u4e0d\u660e\u767d)

set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")} "\u72b6\u6001\u884c\u663e\u793a\u7684\u5185\u5bb9

set laststatus=1 " \u542f\u52a8\u663e\u793a\u72b6\u6001\u884c(1),\u603b\u662f\u663e\u793a\u72b6\u6001\u884c(2)

set foldenable " \u5141\u8bb8\u6298\u53e0

set foldmethod=manual " \u624b\u52a8\u6298\u53e0

set background=dark "\u80cc\u666f\u4f7f\u7528\u9ed1\u8272

set nocompatible "\u53bb\u6389\u8ba8\u538c\u7684\u6709\u5173vi\u4e00\u81f4\u6027\u6a21\u5f0f\uff0c\u907f\u514d\u4ee5\u524d\u7248\u672c\u7684\u4e00\u4e9bbug\u548c\u5c40\u9650

" \u663e\u793a\u4e2d\u6587\u5e2e\u52a9

if version >= 603

set helplang=cn

set encoding=utf-8

endif

" \u8bbe\u7f6e\u914d\u8272\u65b9\u6848

"colorscheme murphy


"colorscheme torte
"colorscheme murphy
colorscheme desert
"colorscheme desert
colorscheme elflord
"colorscheme ron

 

 

"\u5b57\u4f53

"if (has("gui_running"))

" set guifont=Bitstream\ Vera\ Sans\ Mono\ 10

"endif



set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936

set termencoding=utf-8

set encoding=utf-8

set fileencodings=ucs-bom,utf-8,cp936

set fileencoding=utf-8

 

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"""""\u65b0\u6587\u4ef6\u6807\u9898""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"\u65b0\u5efa.c,.h,.sh,.java\u6587\u4ef6\uff0c\u81ea\u52a8\u63d2\u5165\u6587\u4ef6\u5934

autocmd BufNewFile *.cpp,*.[ch],*.sh,*.java exec ":call SetTitle()"

""\u5b9a\u4e49\u51fd\u6570SetTitle\uff0c\u81ea\u52a8\u63d2\u5165\u6587\u4ef6\u5934

func SetTitle()

"\u5982\u679c\u6587\u4ef6\u7c7b\u578b\u4e3a.sh\u6587\u4ef6

if &filetype == 'sh'

call setline(1,"\#########################################################################")

call append(line("."), "\# File Name: ".expand("%"))

call append(line(".")+1, "\# Author: ma6174")

call append(line(".")+2, "\# mail: ma6174@163.com")

call append(line(".")+3, "\# Created Time: ".strftime("%c"))

call append(line(".")+4, "\#########################################################################")

call append(line(".")+5, "\#!/bin/bash")

call append(line(".")+6, "")

else

call setline(1, "/*************************************************************************")

call append(line("."), " > File Name: ".expand("%"))

call append(line(".")+1, " > Author: ma6174")

call append(line(".")+2, " > Mail: ma6174@163.com ")

call append(line(".")+3, " > Created Time: ".strftime("%c"))

call append(line(".")+4, " ************************************************************************/")

call append(line(".")+5, "")

endif

if &filetype == 'cpp'

call append(line(".")+6, "#include<iostream>")

call append(line(".")+7, "using namespace std;")

call append(line(".")+8, "")

endif

if &filetype == 'c'

call append(line(".")+6, "#include<stdio.h>")

call append(line(".")+7, "")

endif

"\u65b0\u5efa\u6587\u4ef6\u540e\uff0c\u81ea\u52a8\u5b9a\u4f4d\u5230\u6587\u4ef6\u672b\u5c3e

autocmd BufNewFile * normal G

endfunc

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"\u952e\u76d8\u547d\u4ee4

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

 

nmap <leader>w :w!<cr>

nmap <leader>f :find<cr>

 

" \u6620\u5c04\u5168\u9009+\u590d\u5236 ctrl+a

map <C-A> ggVGY

map! <C-A> <Esc>ggVGY

map <F12> gg=G

" \u9009\u4e2d\u72b6\u6001\u4e0b Ctrl+c \u590d\u5236

vmap <C-c> "+y

"\u53bb\u7a7a\u884c

nnoremap <F2> :g/^\s*$/d<CR>

"\u6bd4\u8f83\u6587\u4ef6

nnoremap <C-F2> :vert diffsplit

"\u65b0\u5efa\u6807\u7b7e

map <M-F2> :tabnew<CR>

"\u5217\u51fa\u5f53\u524d\u76ee\u5f55\u6587\u4ef6

map <F3> :tabnew .<CR>

"\u6253\u5f00\u6811\u72b6\u6587\u4ef6\u76ee\u5f55

map <C-F3> \be

"C\uff0cC++ \u6309F5\u7f16\u8bd1\u8fd0\u884c

map <F5> :call CompileRunGcc()<CR>

func! CompileRunGcc()

exec "w"

if &filetype == 'c'

exec "!g++ % -o %<"

exec "! ./%<"

elseif &filetype == 'cpp'

exec "!g++ % -o %<"

exec "! ./%<"

elseif &filetype == 'java'

exec "!javac %"

exec "!java %<"

elseif &filetype == 'sh'

:!./%

endif

endfunc

"C,C++\u7684\u8c03\u8bd5

map <F8> :call Rungdb()<CR>

func! Rungdb()

exec "w"

exec "!g++ % -g -o %<"

exec "!gdb ./%<"

endfunc

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

""\u5b9e\u7528\u8bbe\u7f6e

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" \u8bbe\u7f6e\u5f53\u6587\u4ef6\u88ab\u6539\u52a8\u65f6\u81ea\u52a8\u8f7d\u5165

set autoread

" quickfix\u6a21\u5f0f

autocmd FileType c,cpp map <buffer> <leader><space> :w<cr>:make<cr>

"\u4ee3\u7801\u8865\u5168

set completeopt=preview,menu

"\u5141\u8bb8\u63d2\u4ef6

filetype plugin on

"\u5171\u4eab\u526a\u8d34\u677f

set clipboard+=unnamed

"\u4ece\u4e0d\u5907\u4efd

set nobackup

"make \u8fd0\u884c

:set makeprg=g++\ -Wall\ \ %

"\u81ea\u52a8\u4fdd\u5b58

set autowrite

set ruler " \u6253\u5f00\u72b6\u6001\u680f\u6807\u5c3a

set cursorline " \u7a81\u51fa\u663e\u793a\u5f53\u524d\u884c

set magic " \u8bbe\u7f6e\u9b54\u672f

set guioptions-=T " \u9690\u85cf\u5de5\u5177\u680f

set guioptions-=m " \u9690\u85cf\u83dc\u5355\u680f

"set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ %c:%l/%L%)\

" \u8bbe\u7f6e\u5728\u72b6\u6001\u884c\u663e\u793a\u7684\u4fe1\u606f

set foldcolumn=0

set foldmethod=indent

set foldlevel=3

set foldenable " \u5f00\u59cb\u6298\u53e0

" \u4e0d\u8981\u4f7f\u7528vi\u7684\u952e\u76d8\u6a21\u5f0f\uff0c\u800c\u662fvim\u81ea\u5df1\u7684

set nocompatible

" \u8bed\u6cd5\u9ad8\u4eae

set syntax=on

" \u53bb\u6389\u8f93\u5165\u9519\u8bef\u7684\u63d0\u793a\u58f0\u97f3

set noeb

" \u5728\u5904\u7406\u672a\u4fdd\u5b58\u6216\u53ea\u8bfb\u6587\u4ef6\u7684\u65f6\u5019\uff0c\u5f39\u51fa\u786e\u8ba4

set confirm

" \u81ea\u52a8\u7f29\u8fdb

set autoindent

set cindent

" Tab\u952e\u7684\u5bbd\u5ea6

set tabstop=4

" \u7edf\u4e00\u7f29\u8fdb\u4e3a4

set softtabstop=4

set shiftwidth=4

" \u4e0d\u8981\u7528\u7a7a\u683c\u4ee3\u66ff\u5236\u8868\u7b26

set noexpandtab

" \u5728\u884c\u548c\u6bb5\u5f00\u59cb\u5904\u4f7f\u7528\u5236\u8868\u7b26

set smarttab

" \u663e\u793a\u884c\u53f7

set number

" \u5386\u53f2\u8bb0\u5f55\u6570

set history=1000

"\u7981\u6b62\u751f\u6210\u4e34\u65f6\u6587\u4ef6

set nobackup

set noswapfile

"\u641c\u7d22\u5ffd\u7565\u5927\u5c0f\u5199

set ignorecase

"\u641c\u7d22\u9010\u5b57\u7b26\u9ad8\u4eae

set hlsearch

set incsearch

"\u884c\u5185\u66ff\u6362

set gdefault

"\u7f16\u7801\u8bbe\u7f6e

set enc=utf-8

set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936

"\u8bed\u8a00\u8bbe\u7f6e

set langmenu=zh_CN.UTF-8

set helplang=cn

" \u6211\u7684\u72b6\u6001\u884c\u663e\u793a\u7684\u5185\u5bb9\uff08\u5305\u62ec\u6587\u4ef6\u7c7b\u578b\u548c\u89e3\u7801\uff09

"set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}

"set statusline=[%F]%y%r%m%*%=[Line:%l/%L,Column:%c][%p%%]

" \u603b\u662f\u663e\u793a\u72b6\u6001\u884c

set laststatus=2

" \u547d\u4ee4\u884c\uff08\u5728\u72b6\u6001\u884c\u4e0b\uff09\u7684\u9ad8\u5ea6\uff0c\u9ed8\u8ba4\u4e3a1\uff0c\u8fd9\u91cc\u662f2

set cmdheight=2

" \u4fa6\u6d4b\u6587\u4ef6\u7c7b\u578b

filetype on

" \u8f7d\u5165\u6587\u4ef6\u7c7b\u578b\u63d2\u4ef6

filetype plugin on

" \u4e3a\u7279\u5b9a\u6587\u4ef6\u7c7b\u578b\u8f7d\u5165\u76f8\u5173\u7f29\u8fdb\u6587\u4ef6

filetype indent on

" \u4fdd\u5b58\u5168\u5c40\u53d8\u91cf

set viminfo+=!

" \u5e26\u6709\u5982\u4e0b\u7b26\u53f7\u7684\u5355\u8bcd\u4e0d\u8981\u88ab\u6362\u884c\u5206\u5272

set iskeyword+=_,$,@,%,#,-

" \u5b57\u7b26\u95f4\u63d2\u5165\u7684\u50cf\u7d20\u884c\u6570\u76ee

set linespace=0

" \u589e\u5f3a\u6a21\u5f0f\u4e2d\u7684\u547d\u4ee4\u884c\u81ea\u52a8\u5b8c\u6210\u64cd\u4f5c

set wildmenu

" \u4f7f\u56de\u683c\u952e\uff08backspace\uff09\u6b63\u5e38\u5904\u7406indent, eol, start\u7b49

set backspace=2

" \u5141\u8bb8backspace\u548c\u5149\u6807\u952e\u8de8\u8d8a\u884c\u8fb9\u754c

set whichwrap+=<,>,h,l

" \u53ef\u4ee5\u5728buffer\u7684\u4efb\u4f55\u5730\u65b9\u4f7f\u7528\u9f20\u6807\uff08\u7c7b\u4f3coffice\u4e2d\u5728\u5de5\u4f5c\u533a\u53cc\u51fb\u9f20\u6807\u5b9a\u4f4d\uff09


set mouse=a
""set mouse=

set selection=exclusive

set selectmode=mouse,key

" \u901a\u8fc7\u4f7f\u7528: commands\u547d\u4ee4\uff0c\u544a\u8bc9\u6211\u4eec\u6587\u4ef6\u7684\u54ea\u4e00\u884c\u88ab\u6539\u53d8\u8fc7

set report=0

" \u5728\u88ab\u5206\u5272\u7684\u7a97\u53e3\u95f4\u663e\u793a\u7a7a\u767d\uff0c\u4fbf\u4e8e\u9605\u8bfb

set fillchars=vert:\ ,stl:\ ,stlnc:\

" \u9ad8\u4eae\u663e\u793a\u5339\u914d\u7684\u62ec\u53f7

set showmatch

" \u5339\u914d\u62ec\u53f7\u9ad8\u4eae\u7684\u65f6\u95f4\uff08\u5355\u4f4d\u662f\u5341\u5206\u4e4b\u4e00\u79d2\uff09

set matchtime=1

" \u5149\u6807\u79fb\u52a8\u5230buffer\u7684\u9876\u90e8\u548c\u5e95\u90e8\u65f6\u4fdd\u63013\u884c\u8ddd\u79bb

set scrolloff=3

" \u4e3aC\u7a0b\u5e8f\u63d0\u4f9b\u81ea\u52a8\u7f29\u8fdb

set smartindent

" \u9ad8\u4eae\u663e\u793a\u666e\u901atxt\u6587\u4ef6\uff08\u9700\u8981txt.vim\u811a\u672c\uff09

au BufRead,BufNewFile * setfiletype txt

"\u81ea\u52a8\u8865\u5168

:inoremap ( ()<ESC>i

:inoremap ) <c-r>=ClosePair(')')<CR>

:inoremap { {<CR>}<ESC>O

:inoremap } <c-r>=ClosePair('}')<CR>

:inoremap [ []<ESC>i

:inoremap ] <c-r>=ClosePair(']')<CR>

:inoremap " ""<ESC>i

:inoremap ' ''<ESC>i

function! ClosePair(char)

if getline('.')[col('.') - 1] == a:char

return "\<Right>"

else

return a:char

endif

endfunction

filetype plugin indent on

"\u6253\u5f00\u6587\u4ef6\u7c7b\u578b\u68c0\u6d4b, \u52a0\u4e86\u8fd9\u53e5\u624d\u53ef\u4ee5\u7528\u667a\u80fd\u8865\u5168

set completeopt=longest,menu

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" CTags\u7684\u8bbe\u5b9a

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""autocmd FileType h,cpp,cc,c,s,S set tags+=/home_a/cllei/work/neihe/mips/tags
""autocmd FileType h,cpp,cc,c,s,S set tags+=/home_a/cllei/work/isvp/opensource/kernel/tags
autocmd FileType h,cpp,cc,c,s,S set tags+=/home_a/cllei/work/test/kernel/tags

 

 

"
""let Tlist_Show_One_File=1
"\u4e0d\u540c\u65f6\u663e\u793a\u591a\u4e2a\u6587\u4ef6\u7684tag\uff0c\u53ea\u663e\u793a\u5f53\u524d\u6587\u4ef6\u7684
"
""\u8bbe\u7f6etags

set tags=tags


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap <F7> :SrcExplToggle<CR>
nmap <C-H> <C-W>h
nmap <C-J> <C-W>j
nmap <C-K> <C-W>k
nmap <C-L> <C-W>l

" // 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 = "<ENTER>"

" // Set "Space" key for back from the definition context
let g:SrcExpl_gobackKey = "<SPACE>"


let g:SrcExpl_isUpdateTags = 0

 

 

 

 

 

 

 


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"\u5176\u4ed6\u4e1c\u4e1c

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"\u9ed8\u8ba4\u6253\u5f00Taglist

 

""""""""""""""""""""""""""""""

" Tag list (ctags)

""""""""""""""""""""""""""""""""
filetype on
nmap <F6> :TlistToggle<CR>

let Tlist_Ctags_Cmd = '/usr/bin/ctags'

let Tlist_Auto_Open=0

"let Tlist_Show_One_File = 1 "\u4e0d\u540c\u65f6\u663e\u793a\u591a\u4e2a\u6587\u4ef6\u7684tag\uff0c\u53ea\u663e\u793a\u5f53\u524d\u6587\u4ef6\u7684

let Tlist_Exit_OnlyWindow = 0 "\u5982\u679ctaglist\u7a97\u53e3\u662f\u6700\u540e\u4e00\u4e2a\u7a97\u53e3\uff0c\u5219\u9000\u51favim

let Tlist_Use_Right_Window = 1 "\u5728\u53f3\u4fa7\u7a97\u53e3\u4e2d\u663e\u793ataglist\u7a97\u53e3

 

let NERDTreeWinPos = "left"
map <F9> :NERDTreeToggle<CR>


" for ycm
let g:ycm_error_symbol = '>>'
let g:ycm_warning_symbol = '>*'
nnoremap <leader>gl :YcmCompleter GoToDeclaration<CR>
nnoremap <leader>gf :YcmCompleter GoToDefinition<CR>
"nnoremap <leader>gg :YcmCompleter GoToDefinitionElseDeclaration<CR>
nmap <F4> :YcmDiags<CR>

""let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py'


"let g:ycm_server_python_interpreter='/usr/bin/python'
"let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py'
"let g:ycm_python_binary_path = 'python'

""set completeopt=longest,menu "\u8ba9Vim\u7684\u8865\u5168\u83dc\u5355\u884c\u4e3a\u4e0e\u4e00\u822cIDE\u4e00\u81f4(\u53c2\u8003VimTip1228)
autocmd InsertLeave * if pumvisible() == 0|pclose|endif "\u79bb\u5f00\u63d2\u5165\u6a21\u5f0f\u540e\u81ea\u52a8\u5173\u95ed\u9884\u89c8\u7a97\u53e3
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>" "\u56de\u8f66\u5373\u9009\u4e2d\u5f53\u524d\u9879
"\u4e0a\u4e0b\u5de6\u53f3\u952e\u7684\u884c\u4e3a \u4f1a\u663e\u793a\u5176\u4ed6\u4fe1\u606f
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"

"youcompleteme \u9ed8\u8ba4tab s-tab \u548c\u81ea\u52a8\u8865\u5168\u51b2\u7a81
"let g:ycm_key_list_select_completion=['<c-n>']
let g:ycm_key_list_select_completion = ['<Down>']
"let g:ycm_key_list_previous_completion=['<c-p>']
let g:ycm_key_list_previous_completion = ['<Up>']
let g:ycm_confirm_extra_conf=0 "\u5173\u95ed\u52a0\u8f7d.ycm_extra_conf.py\u63d0\u793a

let g:ycm_collect_identifiers_from_tags_files=1 " \u5f00\u542f YCM \u57fa\u4e8e\u6807\u7b7e\u5f15\u64ce
let g:ycm_min_num_of_chars_for_completion=2 " \u4ece\u7b2c2\u4e2a\u952e\u5165\u5b57\u7b26\u5c31\u5f00\u59cb\u7f57\u5217\u5339\u914d\u9879
let g:ycm_cache_omnifunc=0 " \u7981\u6b62\u7f13\u5b58\u5339\u914d\u9879,\u6bcf\u6b21\u90fd\u91cd\u65b0\u751f\u6210\u5339\u914d\u9879
let g:ycm_seed_identifiers_with_syntax=1 " \u8bed\u6cd5\u5173\u952e\u5b57\u8865\u5168
nnoremap <F5> :YcmForceCompileAndDiagnostics<CR> "force recomile with syntastic
"nnoremap <leader>lo :lopen<CR> "open locationlist
"nnoremap <leader>lc :lclose<CR> "close locationlist
inoremap <leader><leader> <C-x><C-o>
"\u5728\u6ce8\u91ca\u8f93\u5165\u4e2d\u4e5f\u80fd\u8865\u5168
let g:ycm_complete_in_comments = 1
"\u5728\u5b57\u7b26\u4e32\u8f93\u5165\u4e2d\u4e5f\u80fd\u8865\u5168
let g:ycm_complete_in_strings = 1
"\u6ce8\u91ca\u548c\u5b57\u7b26\u4e32\u4e2d\u7684\u6587\u5b57\u4e5f\u4f1a\u88ab\u6536\u5165\u8865\u5168
let g:ycm_collect_identifiers_from_comments_and_strings = 0

nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR> " \u8df3\u8f6c\u5230\u5b9a\u4e49\u5904

function! s:CustomizeYcmQuickFixWindow()
" Move the window to the top of the screen.
wincmd K
" Set the window height to 5.
5wincmd _
endfunction

autocmd User YcmQuickFixOpened call s:CustomizeYcmQuickFixWindow()


let g:ycm_min_num_identifier_candidate_chars = 0

let g:ycm_auto_trigger = 1


"let g:ycm_filetype_whitelist = { '*': 1 }

let g:ycm_show_diagnostics_ui = 1

let g:ycm_enable_diagnostic_signs = 1

let g:ycm_enable_diagnostic_highlighting = 1

 

 


let g:ycm_echo_current_diagnostic = 1

 

let g:ycm_collect_identifiers_from_tags_files = 1


"FlagsForFile(filename, client_data = {'v:version': 800})


"let g:ycm_extra_conf_vim_data = []

let g:ycm_add_preview_to_completeopt = 1


"let g:ycm_key_invoke_completion = '<C-Space>'

let g:ycm_semantic_triggers = {
\ 'c' : ['->', ' ', '.', ' ', '(', '[', '&'],
\ 'objc' : ['->', '.', 're!\[[_a-zA-Z]+\w*\s', 're!^\s*[^\W\d]\w*\s',
\ 're!\[.*\]\s'],
\ 'ocaml' : ['.', '#'],
\ 'cpp,objcpp' : ['->', '.', '::'],
\ 'perl' : ['->'],
\ 'php' : ['->', '::'],
\ 'cs,java,javascript,typescript,d,python,perl6,scala,vb,elixir,go' : ['.'],
\ 'ruby' : ['.', '::'],
\ 'lua' : ['.', ':'],
\ 'erlang' : [':'],
\ }


let g:ycm_use_ultisnips_completer = 1

 

 

"execute pathogen#infect()


"set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*

"let g:syntastic_always_populate_loc = list
"let g:syntastic_auto_loc_list = 1
"let g:syntastic_check_on_open = 1
"let g:syntastic_check_on_wq = 0


"syntax on " \u5f00\u542f\u6587\u4ef6\u7c7b\u578b\u4fa6\u6d4b
"filetype indent on " \u9488\u5bf9\u4e0d\u540c\u7684\u6587\u4ef6\u7c7b\u578b\u91c7\u7528\u4e0d\u540c\u7684\u7f29\u8fdb\u683c\u5f0f
"filetype plugin on " \u9488\u5bf9\u4e0d\u540c\u7684\u6587\u4ef6\u7c7b\u578b\u52a0\u8f7d\u5bf9\u5e94\u7684\u63d2\u4ef6
"filetype plugin indent on " \u542f\u7528\u81ea\u52a8\u8865\u5168


let g:snipMate = {}
let g:snipMate.scope_aliases = {}
let g:snipMate.scope_aliases['ruby'] = 'ruby,ruby-rails,ruby-1.9'

 

" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"

" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"

set nocp


""imap <F10> <C-X><C-I>
"set completeopt=menu,menuone
let OmniCpp_MayCompleteDot=1 "" \u201c \u6253\u5f00 . \u64cd\u4f5c\u7b26
let OmniCpp_MayCompleteArrow=1 "" "\u6253\u5f00 -> \u64cd\u4f5c\u7b26
let OmniCpp_MayCompleteScope=1 "" \u201d\u6253\u5f00 :: \u64cd\u4f5c\u7b26
let OmniCpp_NamespaceSearch=1 "" \u201c\u6253\u5f00\u547d\u540d\u7a7a\u95f4
let OmniCpp_GlobalScopeSearch=1
let OmniCpp_DefaultNamespace=["std"]
let OmniCpp_ShowPrototypeInAbbr=1 "" \u201c\u6253\u5f00\u663e\u793a\u51fd\u6570\u539f\u578b
let OmniCpp_SelectFirstItem = 2 ""\u201d\u81ea\u52a8\u5f39\u51fa\u65f6\u81ea\u52a8\u8df3\u81f3\u7b2c\u4e00\u4e2a

 

 

""let OmniCpp_DisplayMode=1 " Class scope completion mode: always show all members

"let OmniCpp_DefaultNamespaces=["std"]
"
"let OmniCpp_ShowScopeInAbbr=1 " show scope in abbreviation and remove the
"last column
"
""let OmniCpp_ShowAccess=1

 

let g:SuperTabDefaultCompletionType="context"

 


set nocompatible " be iMproved, required
filetype off " required

" set the runtime path to include Vundle and initialize


set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

 

" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')


" let Vundle manage Vundle, required

Plugin 'gmarik/vundle'


Plugin 'VundleVim/Vundle.vim'

 


" Snippets are separated from the engine. Add this if you want them:

Plugin 'honza/vim-snippets'
Plugin 'SirVer/ultisnips'

Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'

""Plugin 'SirVer/ultisnips'''

 


Plugin 'scrooloose/syntastic'

 

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
"Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.

Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.

Plugin 'ascenator/L9', {'name': 'newL9'}


Plugin 'Valloric/YouCompleteMe'


" All of your Plugins must be added before the following line


call vundle#end() " required
filetype plugin indent on " required

 

" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

 

 

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" \u663e\u793a\u76f8\u5173

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"set shortmess=atI " \u542f\u52a8\u7684\u65f6\u5019\u4e0d\u663e\u793a\u90a3\u4e2a\u63f4\u52a9\u4e4c\u5e72\u8fbe\u513f\u7ae5\u7684\u63d0\u793a

"winpos 5 5 " \u8bbe\u5b9a\u7a97\u53e3\u4f4d\u7f6e

"set lines=40 columns=155 " \u8bbe\u5b9a\u7a97\u53e3\u5927\u5c0f

"set nu " \u663e\u793a\u884c\u53f7

set go= " \u4e0d\u8981\u56fe\u5f62\u6309\u94ae

"color asmanian2 " \u8bbe\u7f6e\u80cc\u666f\u4e3b\u9898

set guifont=Courier_New:h10:cANSI " \u8bbe\u7f6e\u5b57\u4f53

syntax on " \u8bed\u6cd5\u9ad8\u4eae

autocmd InsertLeave * se nocul " \u7528\u6d45\u8272\u9ad8\u4eae\u5f53\u524d\u884c

autocmd InsertEnter * se cul " \u7528\u6d45\u8272\u9ad8\u4eae\u5f53\u524d\u884c

"set ruler " \u663e\u793a\u6807\u5c3a

set showcmd " \u8f93\u5165\u7684\u547d\u4ee4\u663e\u793a\u51fa\u6765\uff0c\u770b\u7684\u6e05\u695a\u4e9b

"set cmdheight=1 " \u547d\u4ee4\u884c\uff08\u5728\u72b6\u6001\u884c\u4e0b\uff09\u7684\u9ad8\u5ea6\uff0c\u8bbe\u7f6e\u4e3a1

"set whichwrap+=<,>,h,l " \u5141\u8bb8backspace\u548c\u5149\u6807\u952e\u8de8\u8d8a\u884c\u8fb9\u754c(\u4e0d\u5efa\u8bae)

"set scrolloff=3 " \u5149\u6807\u79fb\u52a8\u5230buffer\u7684\u9876\u90e8\u548c\u5e95\u90e8\u65f6\u4fdd\u63013\u884c\u8ddd\u79bb

set novisualbell " \u4e0d\u8981\u95ea\u70c1(\u4e0d\u660e\u767d)

set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")} "\u72b6\u6001\u884c\u663e\u793a\u7684\u5185\u5bb9

set laststatus=1 " \u542f\u52a8\u663e\u793a\u72b6\u6001\u884c(1),\u603b\u662f\u663e\u793a\u72b6\u6001\u884c(2)

set foldenable " \u5141\u8bb8\u6298\u53e0

set foldmethod=manual " \u624b\u52a8\u6298\u53e0

set background=dark "\u80cc\u666f\u4f7f\u7528\u9ed1\u8272

set nocompatible "\u53bb\u6389\u8ba8\u538c\u7684\u6709\u5173vi\u4e00\u81f4\u6027\u6a21\u5f0f\uff0c\u907f\u514d\u4ee5\u524d\u7248\u672c\u7684\u4e00\u4e9bbug\u548c\u5c40\u9650

" \u663e\u793a\u4e2d\u6587\u5e2e\u52a9

if version >= 603

set helplang=cn

set encoding=utf-8

endif

" \u8bbe\u7f6e\u914d\u8272\u65b9\u6848

"colorscheme murphy


"colorscheme torte
"colorscheme murphy
colorscheme desert
"colorscheme desert
colorscheme elflord
"colorscheme ron

 

 

"\u5b57\u4f53

"if (has("gui_running"))

" set guifont=Bitstream\ Vera\ Sans\ Mono\ 10

"endif



set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936

set termencoding=utf-8

set encoding=utf-8

set fileencodings=ucs-bom,utf-8,cp936

set fileencoding=utf-8

 

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"""""\u65b0\u6587\u4ef6\u6807\u9898""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"\u65b0\u5efa.c,.h,.sh,.java\u6587\u4ef6\uff0c\u81ea\u52a8\u63d2\u5165\u6587\u4ef6\u5934

autocmd BufNewFile *.cpp,*.[ch],*.sh,*.java exec ":call SetTitle()"

""\u5b9a\u4e49\u51fd\u6570SetTitle\uff0c\u81ea\u52a8\u63d2\u5165\u6587\u4ef6\u5934

func SetTitle()

"\u5982\u679c\u6587\u4ef6\u7c7b\u578b\u4e3a.sh\u6587\u4ef6

if &filetype == 'sh'

call setline(1,"\#########################################################################")

call append(line("."), "\# File Name: ".expand("%"))

call append(line(".")+1, "\# Author: ma6174")

call append(line(".")+2, "\# mail: ma6174@163.com")

call append(line(".")+3, "\# Created Time: ".strftime("%c"))

call append(line(".")+4, "\#########################################################################")

call append(line(".")+5, "\#!/bin/bash")

call append(line(".")+6, "")

else

call setline(1, "/*************************************************************************")

call append(line("."), " > File Name: ".expand("%"))

call append(line(".")+1, " > Author: ma6174")

call append(line(".")+2, " > Mail: ma6174@163.com ")

call append(line(".")+3, " > Created Time: ".strftime("%c"))

call append(line(".")+4, " ************************************************************************/")

call append(line(".")+5, "")

endif

if &filetype == 'cpp'

call append(line(".")+6, "#include<iostream>")

call append(line(".")+7, "using namespace std;")

call append(line(".")+8, "")

endif

if &filetype == 'c'

call append(line(".")+6, "#include<stdio.h>")

call append(line(".")+7, "")

endif

"\u65b0\u5efa\u6587\u4ef6\u540e\uff0c\u81ea\u52a8\u5b9a\u4f4d\u5230\u6587\u4ef6\u672b\u5c3e

autocmd BufNewFile * normal G

endfunc

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"\u952e\u76d8\u547d\u4ee4

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

 

nmap <leader>w :w!<cr>

nmap <leader>f :find<cr>

 

" \u6620\u5c04\u5168\u9009+\u590d\u5236 ctrl+a

map <C-A> ggVGY

map! <C-A> <Esc>ggVGY

map <F12> gg=G

" \u9009\u4e2d\u72b6\u6001\u4e0b Ctrl+c \u590d\u5236

vmap <C-c> "+y

"\u53bb\u7a7a\u884c

nnoremap <F2> :g/^\s*$/d<CR>

"\u6bd4\u8f83\u6587\u4ef6

nnoremap <C-F2> :vert diffsplit

"\u65b0\u5efa\u6807\u7b7e

map <M-F2> :tabnew<CR>

"\u5217\u51fa\u5f53\u524d\u76ee\u5f55\u6587\u4ef6

map <F3> :tabnew .<CR>

"\u6253\u5f00\u6811\u72b6\u6587\u4ef6\u76ee\u5f55

map <C-F3> \be

"C\uff0cC++ \u6309F5\u7f16\u8bd1\u8fd0\u884c

map <F5> :call CompileRunGcc()<CR>

func! CompileRunGcc()

exec "w"

if &filetype == 'c'

exec "!g++ % -o %<"

exec "! ./%<"

elseif &filetype == 'cpp'

exec "!g++ % -o %<"

exec "! ./%<"

elseif &filetype == 'java'

exec "!javac %"

exec "!java %<"

elseif &filetype == 'sh'

:!./%

endif

endfunc

"C,C++\u7684\u8c03\u8bd5

map <F8> :call Rungdb()<CR>

func! Rungdb()

exec "w"

exec "!g++ % -g -o %<"

exec "!gdb ./%<"

endfunc

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

""\u5b9e\u7528\u8bbe\u7f6e

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" \u8bbe\u7f6e\u5f53\u6587\u4ef6\u88ab\u6539\u52a8\u65f6\u81ea\u52a8\u8f7d\u5165

set autoread

" quickfix\u6a21\u5f0f

autocmd FileType c,cpp map <buffer> <leader><space> :w<cr>:make<cr>

"\u4ee3\u7801\u8865\u5168

set completeopt=preview,menu

"\u5141\u8bb8\u63d2\u4ef6

filetype plugin on

"\u5171\u4eab\u526a\u8d34\u677f

set clipboard+=unnamed

"\u4ece\u4e0d\u5907\u4efd

set nobackup

"make \u8fd0\u884c

:set makeprg=g++\ -Wall\ \ %

"\u81ea\u52a8\u4fdd\u5b58

set autowrite

set ruler " \u6253\u5f00\u72b6\u6001\u680f\u6807\u5c3a

set cursorline " \u7a81\u51fa\u663e\u793a\u5f53\u524d\u884c

set magic " \u8bbe\u7f6e\u9b54\u672f

set guioptions-=T " \u9690\u85cf\u5de5\u5177\u680f

set guioptions-=m " \u9690\u85cf\u83dc\u5355\u680f

"set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ %c:%l/%L%)\

" \u8bbe\u7f6e\u5728\u72b6\u6001\u884c\u663e\u793a\u7684\u4fe1\u606f

set foldcolumn=0

set foldmethod=indent

set foldlevel=3

set foldenable " \u5f00\u59cb\u6298\u53e0

" \u4e0d\u8981\u4f7f\u7528vi\u7684\u952e\u76d8\u6a21\u5f0f\uff0c\u800c\u662fvim\u81ea\u5df1\u7684

set nocompatible

" \u8bed\u6cd5\u9ad8\u4eae

set syntax=on

" \u53bb\u6389\u8f93\u5165\u9519\u8bef\u7684\u63d0\u793a\u58f0\u97f3

set noeb

" \u5728\u5904\u7406\u672a\u4fdd\u5b58\u6216\u53ea\u8bfb\u6587\u4ef6\u7684\u65f6\u5019\uff0c\u5f39\u51fa\u786e\u8ba4

set confirm

" \u81ea\u52a8\u7f29\u8fdb

set autoindent

set cindent

" Tab\u952e\u7684\u5bbd\u5ea6

set tabstop=4

" \u7edf\u4e00\u7f29\u8fdb\u4e3a4

set softtabstop=4

set shiftwidth=4

" \u4e0d\u8981\u7528\u7a7a\u683c\u4ee3\u66ff\u5236\u8868\u7b26

set noexpandtab

" \u5728\u884c\u548c\u6bb5\u5f00\u59cb\u5904\u4f7f\u7528\u5236\u8868\u7b26

set smarttab

" \u663e\u793a\u884c\u53f7

set number

" \u5386\u53f2\u8bb0\u5f55\u6570

set history=1000

"\u7981\u6b62\u751f\u6210\u4e34\u65f6\u6587\u4ef6

set nobackup

set noswapfile

"\u641c\u7d22\u5ffd\u7565\u5927\u5c0f\u5199

set ignorecase

"\u641c\u7d22\u9010\u5b57\u7b26\u9ad8\u4eae

set hlsearch

set incsearch

"\u884c\u5185\u66ff\u6362

set gdefault

"\u7f16\u7801\u8bbe\u7f6e

set enc=utf-8

set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936

"\u8bed\u8a00\u8bbe\u7f6e

set langmenu=zh_CN.UTF-8

set helplang=cn

" \u6211\u7684\u72b6\u6001\u884c\u663e\u793a\u7684\u5185\u5bb9\uff08\u5305\u62ec\u6587\u4ef6\u7c7b\u578b\u548c\u89e3\u7801\uff09

"set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}

"set statusline=[%F]%y%r%m%*%=[Line:%l/%L,Column:%c][%p%%]

" \u603b\u662f\u663e\u793a\u72b6\u6001\u884c

set laststatus=2

" \u547d\u4ee4\u884c\uff08\u5728\u72b6\u6001\u884c\u4e0b\uff09\u7684\u9ad8\u5ea6\uff0c\u9ed8\u8ba4\u4e3a1\uff0c\u8fd9\u91cc\u662f2

set cmdheight=2

" \u4fa6\u6d4b\u6587\u4ef6\u7c7b\u578b

filetype on

" \u8f7d\u5165\u6587\u4ef6\u7c7b\u578b\u63d2\u4ef6

filetype plugin on

" \u4e3a\u7279\u5b9a\u6587\u4ef6\u7c7b\u578b\u8f7d\u5165\u76f8\u5173\u7f29\u8fdb\u6587\u4ef6

filetype indent on

" \u4fdd\u5b58\u5168\u5c40\u53d8\u91cf

set viminfo+=!

" \u5e26\u6709\u5982\u4e0b\u7b26\u53f7\u7684\u5355\u8bcd\u4e0d\u8981\u88ab\u6362\u884c\u5206\u5272

set iskeyword+=_,$,@,%,#,-

" \u5b57\u7b26\u95f4\u63d2\u5165\u7684\u50cf\u7d20\u884c\u6570\u76ee

set linespace=0

" \u589e\u5f3a\u6a21\u5f0f\u4e2d\u7684\u547d\u4ee4\u884c\u81ea\u52a8\u5b8c\u6210\u64cd\u4f5c

set wildmenu

" \u4f7f\u56de\u683c\u952e\uff08backspace\uff09\u6b63\u5e38\u5904\u7406indent, eol, start\u7b49

set backspace=2

" \u5141\u8bb8backspace\u548c\u5149\u6807\u952e\u8de8\u8d8a\u884c\u8fb9\u754c

set whichwrap+=<,>,h,l

" \u53ef\u4ee5\u5728buffer\u7684\u4efb\u4f55\u5730\u65b9\u4f7f\u7528\u9f20\u6807\uff08\u7c7b\u4f3coffice\u4e2d\u5728\u5de5\u4f5c\u533a\u53cc\u51fb\u9f20\u6807\u5b9a\u4f4d\uff09


set mouse=a
""set mouse=

set selection=exclusive

set selectmode=mouse,key

" \u901a\u8fc7\u4f7f\u7528: commands\u547d\u4ee4\uff0c\u544a\u8bc9\u6211\u4eec\u6587\u4ef6\u7684\u54ea\u4e00\u884c\u88ab\u6539\u53d8\u8fc7

set report=0

" \u5728\u88ab\u5206\u5272\u7684\u7a97\u53e3\u95f4\u663e\u793a\u7a7a\u767d\uff0c\u4fbf\u4e8e\u9605\u8bfb

set fillchars=vert:\ ,stl:\ ,stlnc:\

" \u9ad8\u4eae\u663e\u793a\u5339\u914d\u7684\u62ec\u53f7

set showmatch

" \u5339\u914d\u62ec\u53f7\u9ad8\u4eae\u7684\u65f6\u95f4\uff08\u5355\u4f4d\u662f\u5341\u5206\u4e4b\u4e00\u79d2\uff09

set matchtime=1

" \u5149\u6807\u79fb\u52a8\u5230buffer\u7684\u9876\u90e8\u548c\u5e95\u90e8\u65f6\u4fdd\u63013\u884c\u8ddd\u79bb

set scrolloff=3

" \u4e3aC\u7a0b\u5e8f\u63d0\u4f9b\u81ea\u52a8\u7f29\u8fdb

set smartindent

" \u9ad8\u4eae\u663e\u793a\u666e\u901atxt\u6587\u4ef6\uff08\u9700\u8981txt.vim\u811a\u672c\uff09

au BufRead,BufNewFile * setfiletype txt

"\u81ea\u52a8\u8865\u5168

:inoremap ( ()<ESC>i

:inoremap ) <c-r>=ClosePair(')')<CR>

:inoremap { {<CR>}<ESC>O

:inoremap } <c-r>=ClosePair('}')<CR>

:inoremap [ []<ESC>i

:inoremap ] <c-r>=ClosePair(']')<CR>

:inoremap " ""<ESC>i

:inoremap ' ''<ESC>i

function! ClosePair(char)

if getline('.')[col('.') - 1] == a:char

return "\<Right>"

else

return a:char

endif

endfunction

filetype plugin indent on

"\u6253\u5f00\u6587\u4ef6\u7c7b\u578b\u68c0\u6d4b, \u52a0\u4e86\u8fd9\u53e5\u624d\u53ef\u4ee5\u7528\u667a\u80fd\u8865\u5168

set completeopt=longest,menu

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" CTags\u7684\u8bbe\u5b9a

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""autocmd FileType h,cpp,cc,c,s,S set tags+=/home_a/cllei/work/neihe/mips/tags
""autocmd FileType h,cpp,cc,c,s,S set tags+=/home_a/cllei/work/isvp/opensource/kernel/tags
autocmd FileType h,cpp,cc,c,s,S set tags+=/home_a/cllei/work/test/kernel/tags

 

 

"
""let Tlist_Show_One_File=1
"\u4e0d\u540c\u65f6\u663e\u793a\u591a\u4e2a\u6587\u4ef6\u7684tag\uff0c\u53ea\u663e\u793a\u5f53\u524d\u6587\u4ef6\u7684
"
""\u8bbe\u7f6etags

set tags=tags


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap <F7> :SrcExplToggle<CR>
nmap <C-H> <C-W>h
nmap <C-J> <C-W>j
nmap <C-K> <C-W>k
nmap <C-L> <C-W>l

" // 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 = "<ENTER>"

" // Set "Space" key for back from the definition context
let g:SrcExpl_gobackKey = "<SPACE>"


let g:SrcExpl_isUpdateTags = 0

 

 

 

 

 

 

 


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"\u5176\u4ed6\u4e1c\u4e1c

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"\u9ed8\u8ba4\u6253\u5f00Taglist

 

""""""""""""""""""""""""""""""

" Tag list (ctags)

""""""""""""""""""""""""""""""""
filetype on
nmap <F6> :TlistToggle<CR>

let Tlist_Ctags_Cmd = '/usr/bin/ctags'

let Tlist_Auto_Open=0

"let Tlist_Show_One_File = 1 "\u4e0d\u540c\u65f6\u663e\u793a\u591a\u4e2a\u6587\u4ef6\u7684tag\uff0c\u53ea\u663e\u793a\u5f53\u524d\u6587\u4ef6\u7684

let Tlist_Exit_OnlyWindow = 0 "\u5982\u679ctaglist\u7a97\u53e3\u662f\u6700\u540e\u4e00\u4e2a\u7a97\u53e3\uff0c\u5219\u9000\u51favim

let Tlist_Use_Right_Window = 1 "\u5728\u53f3\u4fa7\u7a97\u53e3\u4e2d\u663e\u793ataglist\u7a97\u53e3

 

let NERDTreeWinPos = "left"
map <F9> :NERDTreeToggle<CR>


" for ycm
let g:ycm_error_symbol = '>>'
let g:ycm_warning_symbol = '>*'
nnoremap <leader>gl :YcmCompleter GoToDeclaration<CR>
nnoremap <leader>gf :YcmCompleter GoToDefinition<CR>
"nnoremap <leader>gg :YcmCompleter GoToDefinitionElseDeclaration<CR>
nmap <F4> :YcmDiags<CR>

""let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py'


"let g:ycm_server_python_interpreter='/usr/bin/python'
"let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py'
"let g:ycm_python_binary_path = 'python'

""set completeopt=longest,menu "\u8ba9Vim\u7684\u8865\u5168\u83dc\u5355\u884c\u4e3a\u4e0e\u4e00\u822cIDE\u4e00\u81f4(\u53c2\u8003VimTip1228)
autocmd InsertLeave * if pumvisible() == 0|pclose|endif "\u79bb\u5f00\u63d2\u5165\u6a21\u5f0f\u540e\u81ea\u52a8\u5173\u95ed\u9884\u89c8\u7a97\u53e3
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>" "\u56de\u8f66\u5373\u9009\u4e2d\u5f53\u524d\u9879
"\u4e0a\u4e0b\u5de6\u53f3\u952e\u7684\u884c\u4e3a \u4f1a\u663e\u793a\u5176\u4ed6\u4fe1\u606f
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"

"youcompleteme \u9ed8\u8ba4tab s-tab \u548c\u81ea\u52a8\u8865\u5168\u51b2\u7a81
"let g:ycm_key_list_select_completion=['<c-n>']
let g:ycm_key_list_select_completion = ['<Down>']
"let g:ycm_key_list_previous_completion=['<c-p>']
let g:ycm_key_list_previous_completion = ['<Up>']
let g:ycm_confirm_extra_conf=0 "\u5173\u95ed\u52a0\u8f7d.ycm_extra_conf.py\u63d0\u793a

let g:ycm_collect_identifiers_from_tags_files=1 " \u5f00\u542f YCM \u57fa\u4e8e\u6807\u7b7e\u5f15\u64ce
let g:ycm_min_num_of_chars_for_completion=2 " \u4ece\u7b2c2\u4e2a\u952e\u5165\u5b57\u7b26\u5c31\u5f00\u59cb\u7f57\u5217\u5339\u914d\u9879
let g:ycm_cache_omnifunc=0 " \u7981\u6b62\u7f13\u5b58\u5339\u914d\u9879,\u6bcf\u6b21\u90fd\u91cd\u65b0\u751f\u6210\u5339\u914d\u9879
let g:ycm_seed_identifiers_with_syntax=1 " \u8bed\u6cd5\u5173\u952e\u5b57\u8865\u5168
nnoremap <F5> :YcmForceCompileAndDiagnostics<CR> "force recomile with syntastic
"nnoremap <leader>lo :lopen<CR> "open locationlist
"nnoremap <leader>lc :lclose<CR> "close locationlist
inoremap <leader><leader> <C-x><C-o>
"\u5728\u6ce8\u91ca\u8f93\u5165\u4e2d\u4e5f\u80fd\u8865\u5168
let g:ycm_complete_in_comments = 1
"\u5728\u5b57\u7b26\u4e32\u8f93\u5165\u4e2d\u4e5f\u80fd\u8865\u5168
let g:ycm_complete_in_strings = 1
"\u6ce8\u91ca\u548c\u5b57\u7b26\u4e32\u4e2d\u7684\u6587\u5b57\u4e5f\u4f1a\u88ab\u6536\u5165\u8865\u5168
let g:ycm_collect_identifiers_from_comments_and_strings = 0

nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR> " \u8df3\u8f6c\u5230\u5b9a\u4e49\u5904

function! s:CustomizeYcmQuickFixWindow()
" Move the window to the top of the screen.
wincmd K
" Set the window height to 5.
5wincmd _
endfunction

autocmd User YcmQuickFixOpened call s:CustomizeYcmQuickFixWindow()


let g:ycm_min_num_identifier_candidate_chars = 0

let g:ycm_auto_trigger = 1


"let g:ycm_filetype_whitelist = { '*': 1 }

let g:ycm_show_diagnostics_ui = 1

let g:ycm_enable_diagnostic_signs = 1

let g:ycm_enable_diagnostic_highlighting = 1

 

 


let g:ycm_echo_current_diagnostic = 1

 

let g:ycm_collect_identifiers_from_tags_files = 1


"FlagsForFile(filename, client_data = {'v:version': 800})


"let g:ycm_extra_conf_vim_data = []

let g:ycm_add_preview_to_completeopt = 1


"let g:ycm_key_invoke_completion = '<C-Space>'

let g:ycm_semantic_triggers = {
\ 'c' : ['->', ' ', '.', ' ', '(', '[', '&'],
\ 'objc' : ['->', '.', 're!\[[_a-zA-Z]+\w*\s', 're!^\s*[^\W\d]\w*\s',
\ 're!\[.*\]\s'],
\ 'ocaml' : ['.', '#'],
\ 'cpp,objcpp' : ['->', '.', '::'],
\ 'perl' : ['->'],
\ 'php' : ['->', '::'],
\ 'cs,java,javascript,typescript,d,python,perl6,scala,vb,elixir,go' : ['.'],
\ 'ruby' : ['.', '::'],
\ 'lua' : ['.', ':'],
\ 'erlang' : [':'],
\ }


let g:ycm_use_ultisnips_completer = 1

 

 

"execute pathogen#infect()


"set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*

"let g:syntastic_always_populate_loc = list
"let g:syntastic_auto_loc_list = 1
"let g:syntastic_check_on_open = 1
"let g:syntastic_check_on_wq = 0


"syntax on " \u5f00\u542f\u6587\u4ef6\u7c7b\u578b\u4fa6\u6d4b
"filetype indent on " \u9488\u5bf9\u4e0d\u540c\u7684\u6587\u4ef6\u7c7b\u578b\u91c7\u7528\u4e0d\u540c\u7684\u7f29\u8fdb\u683c\u5f0f
"filetype plugin on " \u9488\u5bf9\u4e0d\u540c\u7684\u6587\u4ef6\u7c7b\u578b\u52a0\u8f7d\u5bf9\u5e94\u7684\u63d2\u4ef6
"filetype plugin indent on " \u542f\u7528\u81ea\u52a8\u8865\u5168


let g:snipMate = {}
let g:snipMate.scope_aliases = {}
let g:snipMate.scope_aliases['ruby'] = 'ruby,ruby-rails,ruby-1.9'

 

" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"

" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"

set nocp


""imap <F10> <C-X><C-I>
"set completeopt=menu,menuone
let OmniCpp_MayCompleteDot=1 "" \u201c \u6253\u5f00 . \u64cd\u4f5c\u7b26
let OmniCpp_MayCompleteArrow=1 "" "\u6253\u5f00 -> \u64cd\u4f5c\u7b26
let OmniCpp_MayCompleteScope=1 "" \u201d\u6253\u5f00 :: \u64cd\u4f5c\u7b26
let OmniCpp_NamespaceSearch=1 "" \u201c\u6253\u5f00\u547d\u540d\u7a7a\u95f4
let OmniCpp_GlobalScopeSearch=1
let OmniCpp_DefaultNamespace=["std"]
let OmniCpp_ShowPrototypeInAbbr=1 "" \u201c\u6253\u5f00\u663e\u793a\u51fd\u6570\u539f\u578b
let OmniCpp_SelectFirstItem = 2 ""\u201d\u81ea\u52a8\u5f39\u51fa\u65f6\u81ea\u52a8\u8df3\u81f3\u7b2c\u4e00\u4e2a

 

 

""let OmniCpp_DisplayMode=1 " Class scope completion mode: always show all members

"let OmniCpp_DefaultNamespaces=["std"]
"
"let OmniCpp_ShowScopeInAbbr=1 " show scope in abbreviation and remove the
"last column
"
""let OmniCpp_ShowAccess=1

 

let g:SuperTabDefaultCompletionType="context"

 

posted @ 2017-07-18 20:42  回到武侠时代  阅读(127)  评论(0编辑  收藏  举报