How to configure Vim on Linux Platform

mkdir .vim
cd .vim/
mkdir bundle
git clone https://github.com/VundleVime/Vundle.vim.git

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

vim .vimrc        
#add Vundle configuration

#Install ctags and scope
sudo apt-get install ctags(ctags -R)
sudo apt-get install scope(cscope -Rbq)

#configure tagbar/nerdtree/ALE/YouCompleteMe/vim-gutentags
(1)use "Plugin"  in the ".vimrc".
   for example: Plugin 'majutsushi/tagbar' " Tag bar"
   
(2)open "vim" and use folloing codes (commandline pattern) to install software
   ":PluginInstall"

(3)open ".vimrc" to configure software.

"************************.vimrc configuration begin*****************************

"Vundle------------------------------------------------------------
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
call vundle#end()
filetype plugin indent on

"scope-------------------------------------------------------------
if has("cscope")
    set csprg=/usr/bin/cscope
    set csto=1
    set cst
    set nocsverb
    if filereadable("cscope.out")
         cs add cscope.out
    endif
    set csverb
endif

:set cscopequickfix=s-,c-,d-,i-,t-,e-
nmap <silent> <F5> : cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <silent> <F6> : cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <silent> <F7> : cs find c  <C-R>=expand("<cword>")<CR><CR>

"tagbar----------------------------------------------------------
Plugin 'majutsushi/tagbar' " Tag bar"
let g:tagbar_width=25
autocmd BufReadPost *.cpp,*.c,*.h,*.cc,*.cxx call tagbar#autoopen()

"nerdtree--------------------------------------------------------
Plugin 'scrooloose/nerdtree'
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
let NERDTreeWinSize=15
let NERDTreeShowLineNumber=1
let NERDTreeAutoCenter=1
let NERDTreeShowBookmarks=1

"ALE(asynchronization lint Engine)-------------------------------
Plugin 'w0rp/ale'
let g:ale_sign_column_always = 1
let g:ale_sign_error = 'x'
let g:ale_sign_warning = 'w'
let g:ale_echo_msg_format = '[%linter%] %code: %%s'
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_c_gcc_options = '-Wall -O2 -std=c99'
let g:ale_cpp_gcc_options = '-Wall -O2 -std=c++14'
let g:ale_c_cppcheck_options = ''
let g:ale_cpp_cppcheck_options = ''

"youcompleteme---------------------------------------------------
Plugin 'Valloric/YouCompleteMe'
let g:ycm_server_python_interpreter='/usr/bin/python'
let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py'

"vim-gutentags---------------------------------------------------
Plugin 'ludovicchabant/vim-gutentags'
let g:gutentags_project_root=['.root','.svn','.git','.hg','.project']
let g:gutentags_ctags_extra_args=['--fields=+niazS','--extra=+q']                                                                                                                     let g:gutentags_ctags_extra_args+=['--c++-kinds=+px']
let g:gutentags_ctags_extra_args+=['--c-kinds=+px']

"Others---------------------------------------------------------
set nu!
syntax enable
syntax on
colorscheme desert
:set autowrite

"************************.vimrc configuration end*******************************

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章