CentOS中安装YouCompleteMe插件详解(4)

  整个vimrc配置如下
   """""""""""""""""""""""""""""""""""""""""""
  filetype off
  set rtp+=~/.vim/bundle/Vundle.vim
  call vundle#begin()
  Plugin 'gmarik/Vundle.vim'
  " My Plugins here:"

  Plugin 'bling/vim-airline'
  "let g:airline_powerline_fonts = 1"
  set laststatus=2
  set t_Co=256

  Plugin 'scrooloose/nerdtree'
  let mapleader=","
  nmap <silent> <leader>ne :NERDTree<CR>
  nmap <silent> <leader>nc :NERDTreeClose<CR>
  "map <silent> <F3> :NERDTreeToggle<CR>"
  Plugin 'kien/ctrlp.vim'
  "Plugin 'altercation/vim-colors-solarized'"
  let g:ctrlp_custom_ignore = {
  \ 'dir': 'vendor/bundle/*\|vendor/cache/*\|public\|spec',
  \ 'file': '\v\.(exe|so|dll|swp|log|jpg|png|json)$',
  \ }
  syntax enable
  set background=dark
  let g:solarized_termcolors=256
  " colorscheme flatcolor

  Plugin 'taglist.vim'
  let Tlist_Show_One_File = 1 "不同时显示多个文件的tag,只显示当前文件的"
  let Tlist_Exit_OnlyWindow = 1 "如果taglist窗口是最后一个窗口,则退出vim"
  "let Tlist_Use_Right_Window = 1" "在右侧窗口中显示taglist窗口"
  "nmap <F4> :TlistToggle<cr>"

  Plugin 'Valloric/YouCompleteMe'
  Plugin 'rdnetto/YCM-Generator'
  let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
  let g:ycm_confirm_extra_conf = 0
  nnoremap <leader>gl :YcmCompleter GoToDeclaration<CR>
  nnoremap <leader>gf :YcmCompleter GoToDefinition<CR>
  nnoremap <leader>gg :YcmCompleter GoToDefinitionElseDeclaration<CR>
  inoremap <c-o> <c-x><c-o>
  let g:ycm_semantic_triggers = {
  \ 'c' : ['->', ' ', '.', ' ', '(', '[', '&'],
  \ 'cpp,objcpp' : ['->', '.', ' ', '(', '[', '&', '::'],
  \ 'perl' : ['->', '::', ' '],
  \ 'php' : ['->', '::', '.'],
  \ 'cs,java,javascript,d,vim,python,perl6,scala,vb,elixir,go' : ['.'],
  \ 'ruby' : ['.', '::'],
  \ 'lua' : ['.', ':']
  \ }

  Plugin 'winmanager'
  let g:winManagerWindowLayout="NERDTree|TagList"
  let g:NERDTree_title="[NERDTree]"
  function! NERDTree_Start()
  exec 'NERDTree'
  endfunction
  function! NERDTree_IsValid()
  return 1
  endfunction
  nmap <silent> <F2> :if IsWinManagerVisible() <BAR> WMToggle<CR> <BAR> else <BAR> WMToggle<CR>:q<CR> endif <CR><CR>

  " All of your Plugins must be added before the following line"
  call vundle#end() " required"
  filetype plugin indent on " required"

  set nu "show line number"
  set ts=4 "tab length is 4"
  autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
  set list listchars=tab:→\ ,trail:·
  set hlsearch incsearch smartcase ignorecase
  autocmd BufNewFile,BufRead *.json set filetype=javascript

  
   nmap mm :call ChangeMouse()<cr>
  function ChangeMouse()
  if &mouse == "a"
  set mouse-=a
  else
  let &mouse = "a"
  endif
  endfunction

  set nocompatible
  set autoindent
  set backspace=indent,eol,start

  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
  
   安装 TMUX
  yum install automake
  yum install libevent-devel ncurses-devel

  安装TMUX错误:‘EVBUFFER_EOL_LF’未声明 ----未尝试!!!!!!!!!!

  原因是使用的libevent的版本太低造成的,要求libevent>= 2.0.10-stable

  wget –no-check-certificate https://sourceforge.net/projects/levent/files/libevent/libevent-2.0/libevent-2.0.22-stable.tar.gz
  按照
  成功安装

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/13330.html