""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files, backups and undo
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nobackup
set nowb
set noswapfile
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"=> Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Use spaces instead tabs
set expandtab
" set 1 tab=4 spaces
set shiftwidth=4
set tabstop=4
" Linebreak on 500 characters
set lbr
set tw=500
" Auto indent
set ai
" Smart indent
set si
" Wrap lines
set wrap
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"=> Visual Model Related
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" search the current selected word
vnoremap <slient> * :call VisualSelection('f')<CR>
vnoremap <slient> # :call VisualSelection('b')<CR>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Moving around, tabs, windows and buffers
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Treat long lines as bread lines(useful when moving around in them)
map j gj
map k gk
" Map <Space> to / (search) and Ctr-<Space> to ?(backwards search)
map <space> /
map <c-space> ?
" Smart way to move between windows
nnoremap <c-h> <c-w>h
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-l> <c-w>h
" Increase and decrease window width and height
nnoremap <C-S-Left> 5<c-w><
nnoremap <C-S-Down> 5<c-w>-
nnoremap <C-S-Up> 4<c-w>+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Plugins Configuration
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Create tags
set tags+=/home/lxy/.vim/sys_tags
nmap <F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
" Tlist Configuration
"only show one file's tag
let Tlist_Show_One_File=1
"when there's only window,exit vim
let Tlist_Exit_OnlyWindow=1
"show taglist menu
let Tlist_Show_Menu=1
"auto update tags
nmap <silent> <F7> :TlistUpdate<cr>
"combine taglist and winmanager,and show them together
let g:winManagerWindowLayout='FileExplorer|TagList'
nmap <silent> <F8> :WMToggle<cr>
" OmniCpp configuration
set completeopt=menu
let OmniCpp_MayCompleteDot = 1 " autocomplete with .
let OmniCpp_MayCompleteArrow = 1 " autocomplete with ->
let OmniCpp_MayCompleteScope = 1 " autocomplete with ::
let OmniCpp_SelectFirstItem = 2 " select first item (but don't insert)
let OmniCpp_NamespaceSearch = 2 " search namespaces in this and included files
let OmniCpp_ShowPrototypeInAbbr = 1 " show function prototype in popup window
let OmniCpp_GlobalScopeSearch=1
let OmniCpp_DisplayMode=1
let OmniCpp_DefaultNamespaces=["std"]
set cursorline
set cursorcolumn
近期评论