Upgrade Vim version to 7.4 (tar install)

前一篇文章將vim更新至7.4後不僅plugin安裝失敗,連syntax顏色都不見了
所以就來試試看另外用tar安裝的方式
(但應該只是BundleInstall沒有執行….,不過都移除重新安裝了就沒再試了)

基本上準備工作大致相同,參考 1 2
先安裝基本需求套件

[root@WP ~]# yum groupinstall 'Development Tools'
[root@WP ~]# yum install ruby
[root@WP ~]# yum install perl-devel python-devel ruby-devel
[root@WP ~]# yum install perl-ExtUtils-Embed ncurses-devel

下載vim tar檔案並解壓縮

[root@WP ~]# cd /tmp
[root@WP tmp]# mkdir vim_install
[root@WP vim_install]# cd vim_install
[root@WP vim_install]#wget http://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
[root@WP vim_install]#wget http://ftp.vim.org/pub/vim/extra/vim-7.2-lang.tar.gz
[root@WP vim_install]#wget http://ftp.vim.org/pub/vim/extra/vim-7.2-extra.tar.gz
[root@WP vim_install]#tar xf vim-7.4.tar.bz2
[root@WP vim_install]#tar xf vim-7.2-extra.tar.gz
[root@WP vim_install]#tar xf vim-7.2-lang.tar.gz
[root@WP vim_install]#mv vim72 vim74
[root@WP src]#cd vim/74/src

編譯安裝檔案,這邊make有加參數-j,按照網路看到的說明是說這將以多線程處理,不過是沒啥感覺有變快…主機問題吧
另外要注意python目錄位置的部分

[root@WP src]#./configure -with-features=huge -enable-rubyinterp -enable-pythoninterp -with-python-config-dir=/usr/lib/python2.6 -enable-perlinterp -enable-gui=gtk2 -enable-cscope
[root@WP src]#make -j4 && make install

接著安裝vundle,將利用它來安裝一些plugin的部分,若指令執行發現目錄已存在~我是先把舊的目錄砍掉…

git clone https://github.com/gmarik/vundle ~/.vim/bundle/vundle

然後先編輯vimrc

[root@WP src]# vim /etc/vimrc

syntax on

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" alternatively, pass a path where Vundle should install bundles
"let path = '~/some/path/here'
"call vundle#rc(path)

" let Vundle manage Vundle, required
Bundle 'gmarik/vundle'

" The following are examples of different formats supported.
" Keep bundle commands between here and filetype plugin indent on.
" scripts on GitHub repos
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'tpope/vim-rails.git'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" scripts from http://vim-scripts.org/vim/scripts.html
Bundle 'L9'
Bundle 'FuzzyFinder'
" scripts not on GitHub
Bundle 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Bundle 'file:///home/gmarik/path/to/plugin'
" ...

filetype plugin indent on     " required
"
" Brief help
" :BundleList          - list configured bundles
" :BundleInstall(!)    - install (update) bundles
" :BundleSearch(!) foo - search (or refresh cache first) for foo
" :BundleClean(!)      - confirm (or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle commands are not allowed.

接著便進入vim程式執行:bundleInstall
(這邊會跳錯,但是看不出哪裡有錯)

這時候在vim內執行:scriptnames 應該就可以看到蠻多已安裝的script了

This entry was posted in Linux. Bookmark the permalink.