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

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.

时间: 2024-08-01 09:30:36

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

windows上搭建python+gvim开发环境

参照了 http://www.cnblogs.com/xd502djj/archive/2010/09/16/1827683.html ,发现有些问题,所以修改了一些. Vim as Python IDE on windows(转) 下载安装Python. 从Vim的网站下载vim,建议下Self-installing executable的版本. 编辑vim的配置文件_vimrc,windows的_vimrc用户文件可以在用户目录下创建. 设置中文支持 " 设置编码自动识别, 中文引号显示 &

Gvim各种插件配置(windows环境下)

1.Vundle插件:https://github.com/gmarik/Vundle.vim 用于管理Vim插件,安装此插件需要系统中已安装git,参考链接:Git for Windows安装和基本设置 在Vim/vimfiles路径下新建文件夹bundle,然后在此文件夹下克隆github上的vundel项目: 完成后会在bundle文件夹下看到Vundle.vim文件夹下的内容,开始配置vundle: 在.vimrc文件中添加如下代码: 1 filetype off 2 3 "Vundle

Windows下将gvim配置为Python IDE[转]

正文 Windows下将gvim配置为Python IDE 回到顶部 1.准备工作 将下面的安装包或者文件下载好 1) Python 2.7  http://www.python.org/ftp/python/2.7.2/python-2.7.2.msi 2) gvim8.0   http://www.vim.org/download.php 3) Exuberant Ctags http://ctags.sourceforge.net/ 4) Taglist  http://www.vim.o

gvim打造IDE的记录,方法和步骤适用于vim

http://blog.csdn.net/namecyf/article/details/7787479 http://www.cnblogs.com/CodeWorkerLiMing/archive/2012/12/22/2829330.html //一些win的gvim的技巧集合 全工程搜索 http://www.cnblogs.com/xiekeli/archive/2012/08/13/2637176.html 通用的插件安装方法 ms-windows当中的方法 一般都是把解压出来的pl

ubuntu下定制Vim/Gvim及使用技巧

vim是linux下的编辑器之神,是玩linux的必备工具,同样emacs是神的编辑器,两个编辑器是各有千秋,看个人的喜好,青菜萝卜各有所爱.我是比较喜欢vim,用vim编写bash,perl,python脚本,以及修改配置文件等等,本文就主要介绍在Ubuntu下gvim环境的搭建,希望对大家有所帮助. 一. Ubuntu安装gvim方法 安装gvim的方法,最简单方法是在Ubuntu软件中心搜索gvim,然后点击安装即可,如下图: 如果使用命令行可以打开终端,输入sudo apt-get in

GVim一些常用快捷键

最近新入职,也打算玩玩vim 由于用的是Windows的系统,所以就用的gvim,也给以后linux和mac打下基础 vim版本7.4:http://pan.baidu.com/s/1dDvjfWX#path=%252FVim-7.4-for-windows-64bit-build 阅读了一下vim的用户文档,都是英文的,很蛋疼,但凑合着能看明白,下面列举下一些常用快捷键,有不对的希望更正. h是左,l是右,j是下,k是上 9k 是将光标上移9行,其他移位同理,9999k移动到文件首字符 ctr

对vim/gvim进行启动精简的探讨.

前言:  用了很久的vim, 插件装得越来越多, 输入vim/gvim后打开项目越来越慢? 这个时候我们有必要引入一些方法来精简vim了. 导致vim变慢的情况, 需要具体分析一下.  是不是在不久前装了几款插件后, 发现启动gtk的vim卡了不少? 打开单行超过80字符的时候非常卡? vim启动的时候有一个参数, --startuptime 我们可以利用它来查看启动加载. #gvim --startuptime 'time.txt' 然后打开当前目录下的time.txt 这个文件,  就是下面

【随笔】Win7下GVIM的安装与配置

针对各种语言的编辑器千千万万,最好的就是最适合自己的,这句话一点没错. 偶然间,需要在Windows上编写代码,MyEclipse等太大,完全没有必要,所以就想起来了vim这个神器.个子小,功能强,就他了! Vim是从 vi 发展出来的一个文本编辑器.代码补完.编译及错误跳转等方便编程的功能特别丰富,在程序员中被广泛使用.和Emacs并列成为类Unix系统用户最喜欢的编辑器. 我们在Windows里也可以使用他,那就是gvim. 其实gvim和vim的区别是VIM要求全部键盘操作,而GVIM可以

设置ISE中默认文本编辑器为gvim

ise windows版,添加方式 ISE下点击菜单Edit -> Preferences -> Editor. 在Editor选项框里选择Custom,在Command line syntax文本框里输入:{d:\program files\vim\gvim.exe}  +$2 $1把路径改成你自己的路径,然后注意+前面有个空格,$1前面也有个空格,路径用大括号括起来 vivado windows版,添加方式 记得环境变量中加入gvim:path=D:/Program Files/Vim/v