修改~/.vimrc文件 修改内容如下:
if v:lang =~ “utf8
"
∣
∣
v
:
l
a
n
g
=
"
U
T
F
−
8
" || v:lang =~ "UTF-8
"∣∣v:lang= "UTF−8”
set fileencodings=utf-8,latin1
endif
set encoding=utf-8
syntax on
set ts=4
set so=7
set cc=80
set ruler " show the cursor position all the time
set number
set cindent
set t_Co=256
set expandtab
set autoindent
set history=50 " keep 50 lines of command line history
set autochdir
set nocompatible " Use Vim defaults (much better!)
set shiftwidth=4
set background=dark
set viminfo='20,"50 " read/write a .viminfo file, don’t store more
colorscheme PaperColor
set bs=indent,eol,start " allow backspacing over everything in insert mode
set statusline=[%F]\ [%{&ff}]
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set shiftwidth=4
set laststatus=2
set wrap
set nohlsearch
set nofoldenable
set mouse=a
"
" this will lead to vim too slow
"
" set foldmethod=syntax
nmap :cs find g =expand("")
nmap :cs find c =expand("")
nmap :cs find t =expand("")
nmap :cs find e =expand("")
nmap :cs find f =expand("")
nmap :!gtags
nmap :vsp:l
“configure of PaperColor”
let g:PaperColor_Theme_Options = {
\ ‘cpp’: {
\ ‘highlight_standard_library’: 1
\ },
\ ‘c’: {
\ ‘highlight_builtins’ : 1
\ }
\ }
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
"let Vundle manage Vundle
Bundle ‘gmarik/vundle’
Bundle ‘majutsushi/tagbar’
Bundle ‘Valloric/YouCompleteMe’
Bundle ‘DoxygenToolkit.vim’
Bundle ‘scrooloose/nerdtree’
Bundle ‘scrooloose/nerdcommenter’
Bundle ‘NLKNguyen/papercolor-theme’
Bundle ‘Yggdroot/LeaderF’
Bundle ‘Yggdroot/indentLine’
Bundle ‘Shougo/deol.nvim’
" Bundle ‘davidhalter/jedi-vim’
“unite”
" let g:unite_source_history_yank_enable = 1
" call unite#filters#matcher_default#use([‘matcher_fuzzy’])
" call unite#filters#sorter_default#use([‘sorter_rank’])
" nnoremap :Unite -no-split -buffer-name=lines -start-insert line
" " nnoremap f :Unite -no-split -buffer-name=files -start-insert file_rec/async
" autocmd FileType unite call s:unite_settings()
" function! s:unite_settings()
" let b:SuperTabDisabled=1
" imap (unite_select_next_line)
" imap (unite_select_previous_line)
" endfunction
“indent line”
let g:indentLine_enabled = 1
" cscope
set cscopetag
set cscopeprg=‘gtags-cscope’
let GtagsCscope_Auto_Update = 0
let GtagsCscope_Auto_Load = 1
let CtagsCscope_Auto_Map = 1
let GtagsCscope_Quiet = 1
“content of make_file_list.sh is:”
“find source_code_path -path “dictionary_ignore” -prune -o -type f -print > /tmp/gtags.files”
“this script generate a file list with ignore files in specific dictionary,”
“and file list will be used by gtags”
nmap :!make_file_list.sh && gtags -f /tmp/gtags.files &
nmap :!gtags &
“configure of nerdcommenter”
let g:NERDSpaceDelims=1
let g:NERDAltDelims_c = 1
“configure of tagbar”
nmap :TagbarToggle
let g:tagbar_left = 0
let g:tagbar_width = 60
let g:tagbar_autoclose = 1
let g:tagbar_type_ruby = {
\ ‘kinds’ : [
\ ‘m:modules’,
\ ‘c:classes’,
\ ‘d:describes’,
\ ‘C:contexts’,
\ ‘f:methods’,
\ ‘F:singleton methods’
\ ]
\ }
“configure of NERDTree”
nmap f :NERDTreeToggle
let NERDTreeWinPos=‘left’
let NERDTreeShowLineNumbers=1
let NERDTreeAutoCenter=1
let NERDTreeShowHidden=1
let NERDTreeWinSize=31
let g:nerdtree_tabs_open_on_console_startup=1
let NERDTreeIgnore=[’.pyc’,’~$’,’.swp’,’.ycm_extra_conf.py’,’\GPATH’,’\GRTAGS’,’\GTAGS’,’\build’]
let NERDTreeShowBookmarks=1
let NERDTreeQuitOnOpen=1
let NERDTreeStatusline=1
let g:NERDTreeDirArrowExpandable = ‘’
let g:NERDTreeDirArrowCollapsible = '’
“configure of YouCompleteMe”
set completeopt=longest,menu
let g:ycm_min_num_of_chars_for_completion=2
let g:ycm_complete_in_strings = 1
let g:ycm_key_invoke_completion = ‘’
let g:ycm_global_ycm_extra_conf = ‘~/.ycm_extra_conf.py’
let g:ycm_confirm_extra_conf=0
let g:ycm_seed_identifiers_with_syntax=1
let g:ycm_filetype_blacklist = {
\ ‘tagbar’ : 1,
\ ‘nerdtree’ : 1,
}
nnoremap gd :YcmCompleter GoToDeclaration
nnoremap gf :YcmCompleter GoToDefinition
nnoremap gg :YcmCompleter GoToDefinitionElseDeclaration
let g:ycm_error_symbol = ‘>>’
let g:ycm_warning_symbol = ‘>>’
nmap :YcmDiags
“config of leaderf”
nmap :LeaderfLine
nmap :LeaderfFile /home/zxy/sflagent_c7/branches/sflagent_lenovo_dongde_v0
nmap :LeaderfFile
let g:Lf_WildIgnore = {
\ ‘dir’: [’.svn’,’.git’,’.hg’,‘build’],
\ ‘file’: [’.o’,’.cmd’,’.a’]
}
“Deol.vim”
nmap s :Deol
nmap q :q
filetype plugin indent on