(a 600MB+ sized c/c++ compiler which is capable of hi-light and JB styled completion!! and of-course with VIM efficiency !!)javascript
Till now, several days passed before I started learning to compile a self-designed gvim.. It is no good experience, but full of discoveries.php
First of all, I want to point out that all the plugins loaded or wish to be loaded by vim needs to have the same bit-width. That means, using 32 bits of vim requires all its components including its plugins to be 32 bits.java
./configure --prefix=/usr --enable-luainterp --enable-pythoninterp --enable-python3interp --enable-cscope --with-python-config-dir=/usr/lib64/python2.7/config/ --with-python3-config-dir=/usr/lib64/python3.4/config-3.4m/
Here's my _vimrc file: (it's only for my own usage, very likely to have flaws.. and it's for Win usage)python
1 set nocompatible 2 filetype off 3 4 set rtp+=$VIM/vimfiles/bundle/Vundle.vim/ 5 call vundle#rc('$VIM/vimfiles/bundle/') 6 7 Plugin 'VundleVim/Vundle.vim' 8 Plugin 'jiangmiao/auto-pairs' 9 Plugin 'bufexplorer.zip' 10 Plugin 'Lokaltog/vim-powerline' 11 Plugin 'wesleyche/SrcExpl' 12 Plugin 'junegunn/limelight.vim' 13 Plugin 'sickill/vim-pasta' 14 Plugin 'scrooloose/syntastic' 15 Plugin 'xuhdev/SingleCompile' 16 Plugin 'Valloric/YouCompleteMe', {'do':'./install.py'} 17 Plugin 'chriskempson/base16-vim' 18 19 let c_cpp_comments=0 20 21 filetype plugin indent on 22 23 noremap <c-k> <c-w>k 24 noremap <c-j> <c-w>j 25 noremap <c-h> <c-w>h 26 noremap <c-l> <c-w>l 27 28 syntax on 29 filetype on 30 filetype plugin on 31 filetype plugin indent on 32 let g:ycm_auto_trigger = 1 33 let g:ycm_min_num_of_chars_for_completion = 2 34 let g:ycm_global_ycm_extra_conf = 'E:/vim64/vimfiles/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py' 35 set t_Co=256 36 set backspace=2 37 set smartindent 38 set expandtab 39 set tabstop=4 40 set shiftwidth=4 41 set smarttab 42 set foldenable 43 set foldmethod=indent 44 set autoread 45 set ignorecase 46 set smartcase 47 48 imap <c-k> <Up> 49 imap <c-j> <Down> 50 imap <c-h> <Left> 51 imap <c-l> <Right> 52 53 set nu 54 set laststatus=2 55 set cmdheight=2 56 set cursorline 57 set nowrap 58 colorscheme base16-tomorrow 59 set shortmess=atI 60 set guioptions-=m 61 set guioptions-=T 62 set guioptions-=r 63 set guioptions-=L 64 set encoding=utf-8 65 set fenc=utf-8 66 set fileencodings=utf-8,latin-1,ascii,gbk,usc-bom,cp936,Shift-JIS 67 set ff=unix 68 set fileformats=unix,dos,mac 69 70 language messages zh_CN.utf-8 71 72 nnoremap <c-s> :w<CR> 73 nnoremap <c-c> ESC 74 nnoremap <c-c> :nohl<CR> 75 nnoremap <c-F9> :SCCompile<CR> 76 nnoremap <c-F10> :SCCompileRun<CR> 77 nnoremap <c-F11> :SCChooseCompiler<CR> 78 let g:ycm_min_num_identifier_candidate_chars = 2 79 let g:ycm_semantic_triggers = { 80 \ 'c' : ['->', '.'], 81 \ 'objc' : ['->', '.', 're!\[[_a-zA-Z]+\w*\s', 're!^\s*[^\W\d]\w*\s', 82 \ 're!\[.*\]\s'], 83 \ 'ocaml' : ['.', '#'], 84 \ 'cpp,objcpp' : ['->', '.', '::','re!\w+'], 85 \ 'perl' : ['->'], 86 \ 'php' : ['->', '::'], 87 \ 'cs,java,javascript,typescript,d,python,perl6,scala,vb,elixir,go' : ['.'], 88 \ 'ruby' : ['.', '::'], 89 \ 'lua' : ['.', ':'], 90 \ 'erlang' : [':'], 91 \ } 92 autocmd InsertLeave * :pclose
note that some maps of keys might be in collision, use :verbose i/nmap <c-*> to check it out!linux
It's not a big problem until I came across Valloric/YouCompleteMe.. This plugin needs to be compiled before utilization..c++
4-step preparations: (Of course, python is previously installed on your machine.. and it's not included in the 4 preparations)git
Notes: to get ycm from git, just use vundle to manage, type :PluginInstall (It might be :BundleInstall or whatever else..), wait till donegithub
to get cmake, download a binary and install it, remember to add its bin path to env-path..typescript
to get clang, download a binary according to system and use 7z to unzip it to $YCM/ycm_temp/llvm_root/vim
Then we have to build the ycm app:
https://github.com/Valloric/YouCompleteMe#windows
Other systems guides can also be found there...
Done.
plugin: cscope
Plugin 'brookhoog/cscope.vim' nnoremap <leader>fa :call CscopeFindInteractive(expand('<cword>'))<CR>
These are the vim's quirk techniques.
reopen file in vim at last closed file location, by:
source /usr/share/vim/vim*/vimrc_example.vim or: source /usr/share/vim/vim*/defaults.vim # in the file contains an intro that explains reopen at last closed location