{"id":955,"date":"2014-02-28T02:21:10","date_gmt":"2014-02-27T18:21:10","guid":{"rendered":"https:\/\/cowman-chiang.no-ip.org\/wordpress\/?p=955"},"modified":"2019-06-20T10:25:08","modified_gmt":"2019-06-20T02:25:08","slug":"upgrade-vim-version-to-7-4","status":"publish","type":"post","link":"https:\/\/cowmanchiang.me\/wp\/?p=955","title":{"rendered":"Upgrade Vim version to 7.4"},"content":{"rendered":"<p>\u6309\u7167\u5b98\u7db2\u7684\u8aaa\u660e <a href=\"http:\/\/www.vim.org\/download.php\">(\u9023\u7d50)<\/a>\uff0c\u5347\u7d1avim\u7248\u672c\u6709\u9ede\u7c21\u55ae<br \/>\n\u4e0d\u904e\u53ef\u4ee5\u5148\u6aa2\u67e5vim\u7684\u7248\u672c\uff0c\u4ee5\u514d\u505a\u767d\u5de5\u4e86<!--more--><\/p>\n<pre lang=\"bash\">\n[root@WP ~]# vim --version\nVIM - Vi IMproved 7.2 (2008 Aug 9, compiled Apr  5 2012 10:12:47)\n\u5f15\u5165\u4fee\u6b63: 1-411\n\u4fee\u6539\u8005\u70ba<bugzilla@redhat.com>\n\u7de8\u8b6f\u8005:<bugzilla@redhat.com>\n\u8d85\u5f37\u7248\u672c \u4e0d\u4f7f\u7528\u5716\u578b\u754c\u9762\u3002\n \u76ee\u524d\u53ef\u4f7f\u7528(+)\u8207\u4e0d\u53ef\u4f7f\u7528(-)\u7684\u6a21\u7d44\u5217\u8868:\n+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent\n-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments\n+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic\n+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path\n+float +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand\n+jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap\n+menu +mksession +modify_fname +mouse -mouseshape +mouse_dec +mouse_gpm\n-mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte\n+multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra +perl +postscript\n+printer +profile +python +quickfix +reltime +rightleft -ruby +scrollbind\n+signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax\n+tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse\n+textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual\n+visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup\n-X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save\n        \u7cfb\u7d71 vimrc \u8a2d\u5b9a\u6a94: \"\/etc\/vimrc\"\n  \u4f7f\u7528\u8005\u500b\u4eba vimrc \u8a2d\u5b9a\u6a94: \"$HOME\/.vimrc\"\n   \u4f7f\u7528\u8005\u500b\u4eba exrc \u8a2d\u5b9a\u6a94: \"$HOME\/.exrc\"\n              $VIM \u9810\u8a2d\u503c: \"\/usr\/share\/vim\"\n\u7de8\u8b6f\u65b9\u5f0f: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall  -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -D_FORTIFY_SOURCE=1    -D_REENTRANT -D_GNU_SOURCE  -fstack-protector -I\/usr\/local\/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I\/usr\/lib\/perl5\/CORE  -I\/usr\/include\/python2.6 -pthread\n\u93c8\u7d50\u65b9\u5f0f: gcc   -Wl,-E -Wl,-rpath,\/usr\/lib\/perl5\/CORE   -L\/usr\/local\/lib -o vim       -lselinux  -lncurses -lacl -lgpm   -Wl,-E -Wl,-rpath,\/usr\/lib\/perl5\/CORE  -fstack-protector -L\/usr\/local\/lib  -L\/usr\/lib\/perl5\/CORE -lperl -lresolv -lutil -lc -L\/usr\/lib\/python2.6\/config -lpython2.6 -lutil -lm -Xlinker -export-dynamic\n<\/pre>\n<p>\u9019\u908a\u53ef\u4ee5\u770b\u5230\u76ee\u524d\u5b89\u88dd\u7248\u672c\u70ba7.2<br \/>\n\u4f86\u5148\u628a\u820a\u7248\u79fb\u9664\u6389<\/p>\n<pre lang=\"bash\">\n[root@WP src]# yum erase vim\nLoaded plugins: fastestmirror\nSetting up Remove Process\nResolving Dependencies\n--> Running transaction check\n---> Package vim-enhanced.i686 2:7.2.411-1.8.el6 will be erased\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n===================================================================================================================================================\n Package                              Arch                         Version                                     Repository                     Size\n===================================================================================================================================================\nRemoving:\n vim-enhanced                         i686                         2:7.2.411-1.8.el6                           @base                         1.8 M\n\nTransaction Summary\n===================================================================================================================================================\nRemove        1 Package(s)\n\nInstalled size: 1.8 M\nIs this ok [y\/N]:y\nDownloading Packages:\nRunning rpm_check_debug\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n  Erasing    : 2:vim-enhanced-7.2.411-1.8.el6.i686                                                                                             1\/1\n  Verifying  : 2:vim-enhanced-7.2.411-1.8.el6.i686                                                                                             1\/1\n\nRemoved:\n  vim-enhanced.i686 2:7.2.411-1.8.el6\n\nComplete!\n<\/pre>\n<p>\u63a5\u8457\u5c31\u4f86\u7167\u8457\u5b98\u7db2\u8aaa\u660e\u5347\u7d1a\u52307.4\u5427~~<\/p>\n<pre lang=\"bash\">\n[root@WP ~]# hg clone https:\/\/vim.googlecode.com\/hg\/ vim\n-bash: hg\uff1a\u547d\u4ee4\u627e\u4e0d\u5230\n<\/pre>\n<p>\u53ef\u4ee5\u5f97\u77e5\u7f3a\u5c11Mercuial\u5957\u4ef6\uff0c\u4f7f\u7528yum\u9032\u884c\u5b89\u88dd<\/p>\n<pre lang=\"bash\">\n[root@WP ~]# yum install hg\nLoaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n * base: ftp.twaren.net\n * epel: mirror01.idc.hinet.net\n * extras: ftp.twaren.net\n * rpmforge: ftp.kddilabs.jp\n * updates: ftp.twaren.net\nSetting up Install Process\nResolving Dependencies\n--> Running transaction check\n---> Package mercurial.i686 0:1.4-3.el6 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n=======================================================================================================================================\n Package                           Arch                         Version                             Repository                    Size\n=======================================================================================================================================\nInstalling:\n mercurial                         i686                         1.4-3.el6                           base                         1.5 M\n\nTransaction Summary\n=======================================================================================================================================\nInstall       1 Package(s)\n\nTotal download size: 1.5 M\nInstalled size: 7.0 M\nIs this ok [y\/N]: y\nDownloading Packages:\nmercurial-1.4-3.el6.i686.rpm                                                                                    | 1.5 MB     00:00\nRunning rpm_check_debug\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n  Installing : mercurial-1.4-3.el6.i686                                                                                            1\/1\n  Verifying  : mercurial-1.4-3.el6.i686                                                                                            1\/1\n\nInstalled:\n  mercurial.i686 0:1.4-3.el6\n\nComplete!\n<\/pre>\n<p>\u5c07Source\u6a94\u6848\u8907\u88fd\u5230vim\u8cc7\u6599\u593e\u5167<\/p>\n<pre lang=\"bash\">\n[root@WP ~]# hg clone https:\/\/vim.googlecode.com\/hg\/ vim\nrequesting all changes\nadding changesets\nadding manifests\nadding file changes\nadded 5695 changesets with 29802 changes to 2679 files (+2 heads)\nupdating to branch default\n2497 files updated, 0 files merged, 0 files removed, 0 files unresolved\n<\/pre>\n<p>\u5c31\u5230vim\/src\u88e1\u9762\u9032\u884cmake\u5427~<\/p>\n<pre lang=\"shell\">\n[root@WP ~]# cd vim\/src\n[root@WP src]# make\n<\/pre>\n<p>\u9019\u6642\u5019\u767c\u73fe\u9084\u662f\u5c11\u4e86\u6771\u897f&#8230;<\/p>\n<pre lang=\"shell\">\nchecking for tgetent in -ltermcap... no\nchecking for tgetent in -lcurses... no\nno terminal library found\nchecking for tgetent()... configure: error: NOT FOUND!\n      You need to install a terminal library; for example ncurses.\n      Or specify the name of the library with --with-tlib.\nmake[1]: *** [config] Error 1\nmake[1]: Leaving directory `\/root\/ycm_build\/vim\/src'\nmake: *** [first] Error 2\n<\/pre>\n<p>\u5c31\u4f86\u5b89\u88ddncurses-devel library<\/p>\n<pre lang=\"bash\">\n[root@WP src]# yum install ncurses-devel\nLoaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n * base: ftp.twaren.net\n * epel: mirror01.idc.hinet.net\n * extras: ftp.twaren.net\n * rpmforge: ftp.kddilabs.jp\n * updates: ftp.twaren.net\nSetting up Install Process\nResolving Dependencies\n--> Running transaction check\n---> Package ncurses-devel.i686 0:5.7-3.20090208.el6 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n=======================================================================================================================================\n Package                            Arch                      Version                                  Repository                 Size\n=======================================================================================================================================\nInstalling:\n ncurses-devel                      i686                      5.7-3.20090208.el6                       base                      642 k\n\nTransaction Summary\n=======================================================================================================================================\nInstall       1 Package(s)\n\nTotal download size: 642 k\nInstalled size: 1.7 M\nIs this ok [y\/N]: y\nDownloading Packages:\nncurses-devel-5.7-3.20090208.el6.i686.rpm                                                                       | 642 kB     00:00\nRunning rpm_check_debug\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n  Installing : ncurses-devel-5.7-3.20090208.el6.i686                                                                               1\/1\n  Verifying  : ncurses-devel-5.7-3.20090208.el6.i686                                                                               1\/1\n\nInstalled:\n  ncurses-devel.i686 0:5.7-3.20090208.el6\n\nComplete!\n<\/pre>\n<p>\u7136\u5f8c\u518d\u8dd1\u4e00\u4e0bmake\u8dd1\u4e00\u4e0bvim\u7684\u7de8\u8b6f<\/p>\n<pre lang=\"bash\">\n##\u524d\u7565##\nlink.sh: Linked fine\ncd xxd; CC=\"gcc\" CFLAGS=\" -O2 -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1\" LDFLAGS=\"-L\/usr\/local\/lib -Wl,--as-needed\" \n                make -f Makefile\nmake[3]: Entering directory `\/root\/ycm_build\/vim\/src\/xxd'\ngcc  -O2 -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -L\/usr\/local\/lib -Wl,--as-needed -DUNIX -o xxd xxd.c\nmake[3]: Leaving directory `\/root\/ycm_build\/vim\/src\/xxd'\nmake[2]: Leaving directory `\/root\/ycm_build\/vim\/src'\nmake[1]: Leaving directory `\/root\/ycm_build\/vim\/src'\n<\/pre>\n<p>\u7136\u5f8c\u8dd1\u4e00\u4e0bmake install\u9032\u884c\u5b89\u88dd<\/p>\n<pre lang=\"bash\">\n[root@WP src]# make install\n##\u524d\u7565##\nif test -n \"\" -a -f po\/Makefile; then \n           cd po; make prefix=\/usr\/local LOCALEDIR=\/usr\/local\/share\/vim\/vim74\/lang \n           INSTALL_DATA=cp FILEMOD=644 install; \n        fi\nif test -d ..\/runtime\/lang; then \n           cp ..\/runtime\/lang\/README.txt ..\/runtime\/lang\/*.vim \/usr\/local\/share\/vim\/vim74\/lang; \n           chmod 644 \/usr\/local\/share\/vim\/vim74\/lang\/README.txt \/usr\/local\/share\/vim\/vim74\/lang\/*.vim; \n        fi\nif test -d ..\/runtime\/keymap; then \n           cp ..\/runtime\/keymap\/README.txt ..\/runtime\/keymap\/*.vim \/usr\/local\/share\/vim\/vim74\/keymap; \n           chmod 644 \/usr\/local\/share\/vim\/vim74\/keymap\/README.txt \/usr\/local\/share\/vim\/vim74\/keymap\/*.vim; \n        fi\nif test -d \/usr\/local\/share\/icons\/hicolor\/48x48\/apps -a -w \/usr\/local\/share\/icons\/hicolor\/48x48\/apps \n                -a ! -f \/usr\/local\/share\/icons\/hicolor\/48x48\/apps\/gvim.png; then \n           cp ..\/runtime\/vim48x48.png \/usr\/local\/share\/icons\/hicolor\/48x48\/apps\/gvim.png; \n        fi\nif test -d \/usr\/local\/share\/icons\/locolor\/32x32\/apps -a -w \/usr\/local\/share\/icons\/locolor\/32x32\/apps \n                -a ! -f \/usr\/local\/share\/icons\/locolor\/32x32\/apps\/gvim.png; then \n           cp ..\/runtime\/vim32x32.png \/usr\/local\/share\/icons\/locolor\/32x32\/apps\/gvim.png; \n        fi\nif test -d \/usr\/local\/share\/icons\/locolor\/16x16\/apps -a -w \/usr\/local\/share\/icons\/locolor\/16x16\/apps \n                -a ! -f \/usr\/local\/share\/icons\/locolor\/16x16\/apps\/gvim.png; then \n           cp ..\/runtime\/vim16x16.png \/usr\/local\/share\/icons\/locolor\/16x16\/apps\/gvim.png; \n        fi\n<\/pre>\n<p>\u9019\u6642\u5019\u5982\u679c\u5fc3\u6025\u8457\u60f3\u6253vim\u6703\u5f97\u5230\u4ee5\u4e0b\u7684\u7d50\u679c&#8230;.<\/p>\n<pre lang=\"bash\">\n[root@WP src]# vim\n-bash: \/usr\/bin\/vim: \u6c92\u6709\u6b64\u4e00\u6a94\u6848\u6216\u76ee\u9304\n<\/pre>\n<p>\u4f86\u628a\u74b0\u5883\u767b\u9304\u8b8a\u6578\u91cd\u8dd1\u4e00\u4e0b\uff0c\u5c31\u767c\u73feok\u4e86!<\/p>\n<pre lang=\"bash\">\n[root@WP src]# hash -r\n[root@WP src]# vim --version\nVIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 28 2014 02:15:51)\nIncluded patches: 1-192\nCompiled by cowman@WP\nNormal version without GUI.  Features included (+) or not (-):\n+acl             -farsi           -mouse_netterm   +syntax\n-arabic          +file_in_path    -mouse_sgr       +tag_binary\n+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static\n-balloon_eval    +float           -mouse_urxvt     -tag_any_white\n-browse          +folding         +mouse_xterm     -tcl\n+builtin_terms   -footer          +multi_byte      +terminfo\n+byte_offset     +fork()          +multi_lang      +termresponse\n+cindent         -gettext         -mzscheme        +textobjects\n-clientserver    -hangul_input    +netbeans_intg   +title\n-clipboard       +iconv           +path_extra      -toolbar\n+cmdline_compl   +insert_expand   -perl            +user_commands\n+cmdline_hist    +jumplist        +persistent_undo +vertsplit\n+cmdline_info    -keymap          +postscript      +virtualedit\n+comments        -langmap         +printer         +visual\n-conceal         +libcall         -profile         +visualextra\n+cryptv          +linebreak       -python          +viminfo\n-cscope          +lispindent      -python3         +vreplace\n+cursorbind      +listcmds        +quickfix        +wildignore\n+cursorshape     +localmap        +reltime         +wildmenu\n+dialog_con      -lua             -rightleft       +windows\n+diff            +menu            -ruby            +writebackup\n+digraphs        +mksession       +scrollbind      -X11\n-dnd             +modify_fname    +signs           -xfontset\n-ebcdic          +mouse           +smartindent     -xim\n-emacs_tags      -mouseshape      -sniff           -xsmp\n+eval            -mouse_dec       +startuptime     -xterm_clipboard\n+ex_extra        -mouse_gpm       +statusline      -xterm_save\n+extra_search    -mouse_jsbterm   -sun_workshop    -xpm\n   system vimrc file: \"$VIM\/vimrc\"\n     user vimrc file: \"$HOME\/.vimrc\"\n 2nd user vimrc file: \"~\/.vim\/vimrc\"\n      user exrc file: \"$HOME\/.exrc\"\n  fall-back for $VIM: \"\/usr\/local\/share\/vim\"\nCompilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1\nLinking: gcc   -L\/usr\/local\/lib -Wl,--as-needed -o vim        -lm -ltinfo -lnsl  -lselinux\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6309\u7167\u5b98\u7db2\u7684\u8aaa\u660e (\u9023\u7d50)\uff0c\u5347\u7d1avim\u7248\u672c\u6709\u9ede\u7c21\u55ae \u4e0d\u904e\u53ef\u4ee5\u5148\u6aa2\u67e5vim\u7684\u7248\u672c\uff0c\u4ee5\u514d\u505a\u767d\u5de5\u4e86<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-955","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/955","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=955"}],"version-history":[{"count":1,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/955\/revisions"}],"predecessor-version":[{"id":2054,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/955\/revisions\/2054"}],"wp:attachment":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}