- 论坛徽章:
- 0
|
使用VIM写程序时,只要写到->符号,光标就会自动的跑到最开始声明的变量的地方,不知道是怎么回事?
VIM配置内容:- """""""""""""""""""""""""""""""""""""""""""""""""""""
- " 基本配置
- """""""""""""""""""""""""""""""""""""""""""""""""""""
- set nocompatible
- set mouse=a
- syntax on
- filetype on
- filetype plugin on
- filetype plugin indent on
- au GUIEnter * simalt ~x "启动后最大化
- set autowrite
- set number
- set showcmd
- set lcs=tab:>-,trail:-
- "set list
- set showmode
- set title
- set tabstop=4
- set ruler
- set encoding=utf-8 "utf-8
- set fileencoding=gb18030 "utf-8
- set fileencodings=utf-8,gb18030,utf-16,big5
- set nobackup
- set autoindent
- set smartindent
- set expandtab
- set shiftwidth=4
- set smarttab
- set fdm=indent
- "set fdc=4
- set nowrap
- set hlsearch
- set incsearch
- set cindent
- set autochdir"ctags
- set tags=tags;"ctags
- set nowrap "设置不自动换行
- set guioptions+=b
- set autochdir
- set foldmethod=syntax
- set foldlevelstart=99
- """""""""""""""""""""""""""""""""""""""""""""""""""""
- " 设置缩进线
- """""""""""""""""""""""""""""""""""""""""""""""""""""
- "set list
- "set listchars=tab:\|\
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""
- " WinManage配置,窗口管理
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""
- let g:winManagerWindowLayout='FileExplorer|TagList|BufExplorer'
- let g:winManagerWidth=35 "设置左栏的宽度
- nmap <F4> :WMToggle<CR>
- map fc <Esc>:call CleanClose(1)<CR>
- map fq <Esc>:call CleanClose(0)<CR>
- function! 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
- endfunction
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""
- " Taglist配置
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""
- map <F3> :Tlist<CR>
- let Tlist_Use_Right_Window=1
- let Tlist_File_Fold_Auto_Close=1
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " NERD Tree配置
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""
- "map <F1> :NERDTreeMirror<CR>
- "map <F2> :NERDTreeToggle<CR>
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " NeoComplete设置,输入自动显示
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""
- let g:NeoComplCache_EnableAtStartup=1
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " WkSpaceExplorer配置,可以显示项目
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""
- nmap wk :WKSpace%<CR>
- let g:WKSpaceExplorer_Use_Right_Window=1
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " Vim的智能补全, 即所谓的Omni Completion
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""
- fun! OmniComplete()
- let left = strpart(getline('.'), col('.') - 2, 1)
- if left =~ "^$"
- return ""
- elseif left =~ '
- return ""
- else
- return "\<C-x>\<C-o>"
- endfun
- inoremap <silent> <S-Tab> <C-R>=OmniComplete()<CR>
- " turn on Omni completion
- autocmd FileType c set ofu=ccomplete#Complete
- autocmd FileType php set ofu=phpcomplete#CompletePHP
- autocmd FileType python set ofu=pythoncomplete#Complete
- autocmd FileType javascript set ofu=javascriptcomplete#CompleteJS
- autocmd FileType html set ofu=htmlcomplete#CompleteTags
- autocmd FileType css set ofu=csscomplete#CompleteCSS
- autocmd FileType xml set ofu=xmlcomplete#CompleteTags
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " Tab键来智能补全tags:
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""
- "fun! KeywordComplete()
- " let left = strpart(getline('.'), col('.') - 2, 1)
- " if left =~ "^$"
- " return "\<Tab>"
- " elseif left =~ '
- " return "\<Tab>"
- " else
- " return "\<C-N>"
- "endfun
- "inoremap <silent> <Tab> <C-R>=KeywordComplete()<CR>
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " cscope配置
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""
- if has("cscope")
- set cscopequickfix=s-,c-,d-,i-,t-,e-
- set csto=0
- set cst
- set csverb
- endif
复制代码 |
|