(a 600MB+ sized c/c++ compiler which is capable of hi-light and JB styled completion!! and of-course with VIM efficiency !!)

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

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.

  1. It seems to use 32bit version is recommended on vim's official site, but you know, it feels not quite good 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 (note to compile linux ver of vim, need to configure && make && make install, where prefix. enable-pythoninterp, enable-luainterp, enable-python3interp, enable-cscope, enable-rubyinterp, enable-perlinterp, enable-python2interp might need to be specified at configure time.) If python/python3 are not installed in ordinary path, specify it by with-python-config-dir/with-pythno3-config-dir=/usr/lib/python3.x/config/ along with the enable options.
    1. ./configure --prefix=/usr --enable-luainterp --enable-pythoninterp --enable-python3interp --enable-cscope --with-python-config-dir=/usr/lib64/python2./config/ --with-python3-config-dir=/usr/lib64/python3./config-3.4m/
  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 '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=
  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 =
  33. let g:ycm_min_num_of_chars_for_completion =
  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=
  36. set backspace=
  37. set smartindent
  38. set expandtab
  39. set tabstop=
  40. set shiftwidth=
  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=
  55. set cmdheight=
  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-
  65. set fenc=utf-
  66. set fileencodings=utf-,latin-,ascii,gbk,usc-bom,cp936,Shift-JIS
  67. set ff=unix
  68. set fileformats=unix,dos,mac
  69.  
  70. language messages zh_CN.utf-
  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 =
  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!

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 -- -j 4 in the same folder

Done.

plugin: cscope

  1. Plugin 'brookhoog/cscope.vim'
  2. nnoremap <leader>fa :call CscopeFindInteractive(expand('<cword>'))<CR>

Theseare the vim's quirk techniques.

reopen file in vim at last closed file location, by:

  1. source /usr/share/vim/vim*/vimrc_example.vim
  2. or:
  3. source /usr/share/vim/vim*/defaults.vim
  4. # in the file contains an intro that explains reopen at last closed location

gvim work notes.. a few days' work on 64bit vim and plugin compilations的更多相关文章

  1. Gvim插件管理Vundle

    之前关于gvim的博客中提到的很多插件安装比较繁琐,这一篇来介绍一下gvim管理插件的插件--vundle的安装以及使用,让givm的插件安装更加的简单 首先给出vundle的git地址 https: ...

  2. 【转】Gvim开发环境配置笔记--Windows篇

    配置文件(vimrc) set nocompatible set nu! set cursorline colorscheme murphy " vim 自身命令行模式智能补全 set wi ...

  3. Windows下gvim配置

    Windows下gvim配置原作地:http://hi.baidu.com/leemoncc/blog/item/a6be15cf40d7ab31b600c806.html 0.准备软件及插件. (a ...

  4. Env:Gvim开发环境配置笔记--Windows篇

    转自:http://www.cnblogs.com/xiekeli/archive/2012/08/13/2637176.html 加班的时候,听同事提到gvim在windows下的使用,然后突然想起 ...

  5. Gvim for php 安装配置

    VIM for PHP Windows 2011-05-14 11:51:51|  分类: Php|举报|字号 订阅     虽然vim本质上只是一个编辑器.但只要配合一些适当的插件,vim也能变成一 ...

  6. [转载] ubuntu下定制Vim/Gvim及使用技巧

    vim是linux下的编辑器之神,是玩linux的必备工具,同样emacs是神的编辑器,两个编辑器是各有千秋,看个人的喜好,青菜萝卜各有所爱.我是比较喜欢vim,用vim编写bash,perl,pyt ...

  7. 设置ISE/vivado中默认文本编辑器为gvim

    ise windows版,添加方式 ISE下点击菜单Edit -> Preferences -> Editor. 在Editor选项框里选择Custom,在Command line syn ...

  8. Gvim使用心得--设置篇[转]

    1.设置自己喜欢的字体? 点“编辑”--“选择字体”, 然后在字体列表中选择一个你喜欢的字体和字号,然后确认. 如果想每次都使用这个这个字体 需要加到启动文件中 比如我的 set guifont=Co ...

  9. 【转】gvim配置及相关插件安装

    0.准备软件及插件.(a)gvim72.exe 地址ftp://ftp.vim.org/pub/vim/pc/gvim72.exe.(b)vimcdoc-1.7.0-setup.exe 地址http: ...

随机推荐

  1. Linux C/C++编译环境搭建

    1. 配置GCC,LInux 在安装后已经有GCC了,但可能文件不全,我们可以利用 sudo apt-get install build-essential 安装 2. 安装文本编辑器 sudo ap ...

  2. 打开"我的电脑"等特殊文件夹ShellExecute

    procedure TForm2.btn10Click(Sender: TObject); begin ShellExecute(handle,'open','mailt', nil,nil,SW_S ...

  3. 使用 mulan-1.5.0 如何构造.arff文件

    1. 为什么要使用mulan 我用mulan来做多标签数据的分类,但是mulan的输入数据由两个文件控制,一个是data.arff文件,这个文件列出的所有的属性以及这些属性值的类型和他们对应的值.la ...

  4. Chapter 16_0 面向对象编程

    Lua中的table就是一种对象. 1.table和对象一样拥有状态 2.和对象一样有一个独立的标识符(a self) 3.和对象一样,具有独立于创建者和创建地的生命周期. 对象有他们自己的操作,ta ...

  5. SQL Server 把当前日期中月份和几号中的0 去掉

    select left(convert(varchar(10),getdate(),20),4)+replace(right(convert(varchar(10),getdate(),20),6), ...

  6. Ecstore1.2启用mongodb添加索引

    配置config(连接mongo) mongo define('KVSTORE_STORAGE', 'base_kvstore_mongodb'); define('MONGODB_SERVER_CO ...

  7. python中的矩阵运算

    摘自:http://m.blog.csdn.net/blog/taxueguilai1992/46581861 python的numpy库提供矩阵运算的功能,因此我们在需要矩阵运算的时候,需要导入nu ...

  8. php字符操作

    //一:定义字符串的方法 //1.双引号 //2.单引号 //3.heredoc语法结构 //heredoc语法定义字符串 $str=<<<TAG 我的武功终成武林盟主TAG;//注 ...

  9. 汇总jQuery的61种选择器及示例

    汇总jQuery的61种选择器及示例 恋痿喃 ㄍń稀广 因罘乐睽 ú燔蒇 骤幄觳 ч豹 齑骝氮铷 宅廓Ω孓 锏遒 荛猩ㄜ彬 芡钷ж ┊贩错鹌 掩饰着可还是几步就窜到了门口看着这个让她 ...

  10. 不合法语句 self.contentView.frame.origin.x = x;

    下面的写法是错误的: CGFloat x = self.contentView.frame.origin.x; x = _lastDownX + translation.x; self.content ...