码迷,mamicode.com
首页 > 系统相关 > 详细

gvim work notes.. a few days work on 64bit vim and plugin compilations

时间:2016-05-09 15:53:11      阅读:331      评论:0      收藏:0      [点我收藏+]

标签:

Till now, several days passed before I started learning to compile a self-designed gvim.. It is no good experience, but also full of discoveries.

First of all, I want to point out that all the plugins vim loaded or wish to be loaded 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.

  1. It seems to use 32bit version is recommended on vim‘s official site, but you know, it feels not quite good feeling when running 32bit apps on 64bit machine. So downloaded two source files from official site, one is runtime binaries, and the other is the source. Unrar these compressed data to one file named ‘vim64‘ is suggested.
  2. To install/compile the souce file, need to install python/python3 (required), something like "nmake -f Make_mvc.mak GUI=yes PYTHON3=path PYTHON3_VER=3X DYNAMIC_PYTHON3=yes MSVCVER=m.n CPU=AMD64/IA64" needs to be run in cmd. If well-configured, gvim/vim is generated in the /src folder, for more, read the Make_*.mak file according to your compiler, if nmake, *=mvc
  3. To configure for better experiences in gvim, some plugins are recommended. jiangmiao/auto-pairs, Lokaltog/vim-powerline, xuhdev/SingleCompile, scrooloose/syntastic, Valloric/YouCompleteMe, VundleVim/Vundle.vim, sickill/vim-pasta and so on, might add/delete in the future.

Here‘s my _vimrc file: (it‘s only for my own usage, very likely to have flaws.. and it‘s for Win usage)

 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 std_c.zip
13 Plugin junegunn/limelight.vim
14 Plugin sickill/vim-pasta
15 Plugin scrooloose/syntastic
16 Plugin xuhdev/SingleCompile
17 Plugin Valloric/YouCompleteMe, {do:./install.py}
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 filetype on
29 filetype plugin on
30 filetype plugin indent on
31 let g:ycm_auto_trigger = 1
32 let g:ycm_min_num_of_chars_for_completion = 2
33 set t_Co=256
34 set backspace=2
35 set smartindent
36 set expandtab
37 set tabstop=4
38 set shiftwidth=4
39 set smarttab
40 set foldenable
41 set foldmethod=indent
42 set autoread
43 set ignorecase
44 set smartcase
45 
46 imap <c-k> <Up>
47 imap <c-j> <Down>
48 imap <c-h> <Left>
49 imap <c-l> <Right>
50 
51 set nu
52 set laststatus=2
53 set cmdheight=2
54 set cursorline
55 set nowrap
56 colorscheme Tomorrow-Night-Eighties
57 set shortmess=atI
58 set guioptions-=m
59 set guioptions-=T
60 set guioptions-=r
61 set guioptions-=L
62 set encoding=utf-8
63 set fenc=utf-8
64 set fileencodings=utf-8,latin-1,ascii,gbk,usc-bom,cp936,Shift-JIS
65 set ff=unix
66 set fileformats=unix,dos,mac
67 
68 language messages zh_CN.utf-8
69 
70 nnoremap <c-s> :w<CR>
71 nnoremap <c-c> ESC
72 nnoremap <c-c> :nohl<CR>
73 nnoremap <c-F9> :SCCompile<CR>
74 nnoremap <c-F10> :SCCompileRun<CR>
75 nnoremap <c-F11> :SCChooseCompiler<CR>
76 let g:ycm_min_num_identifier_candidate_chars = 2
77 let g:ycm_semantic_triggers =  {
78   \   c : [->, .],
79   \   objc : [->, ., re!\[[_a-zA-Z]+\w*\s, re!^\s*[^\W\d]\w*\s,
80   \             re!\[.*\]\s],
81   \   ocaml : [., #],
82   \   cpp,objcpp : [->, ., ::,re!\w+],
83   \   perl : [->],
84   \   php : [->, ::],
85   \   cs,java,javascript,typescript,d,python,perl6,scala,vb,elixir,go : [.],
86   \   ruby : [., ::],
87   \   lua : [., :],
88   \   erlang : [:],
89   \ }
90 autocmd InsertLeave * :pclose

 

note that some maps of keys might be in collision, use :verbose i/nmap <c-*> to check it out!

It‘s not a big problem until I came across Valloric/YouCompleteMe.. This plugin needs to be compiled before utilization..

4-step preparations: (Of course, python is previously installed on your machine.. and it‘s not included in the 4 preparations)

  1. get ycm from git
  2. get cmake
  3. get clang
  4. 7z installed

Notes: to get ycm from git, just use vundle to manage, type :PluginInstall (It might be :BundleInstall or whatever else..), wait till done

to get cmake, download a binary and install it, remember to add its bin path to env-path..

to get clang, download a binary according to system and use 7z to unzip it to $YCM/ycm_temp/llvm_root/

Then we have to build the ycm app:

https://github.com/Valloric/YouCompleteMe#windows

Other systems guides can also be found there...

  1. create folder ycm_build in $YCM
  2. generate makefiles, using cmake -G "Visual Studio m.n Win64" "$YCM/ycm_temp/llvm_root" . "$YCM/third_party/ycmd/cpp" in the created folder
  3. compile with the generated files and .vcxproj, cmake --build . --target ycm_core --config Release in the same folder

Done.

gvim work notes.. a few days work on 64bit vim and plugin compilations

标签:

原文地址:http://www.cnblogs.com/sansna/p/5474015.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!