1. 程式人生 > 其它 >linux centos7 升級 vim7.4位8.2

linux centos7 升級 vim7.4位8.2

 

1、系統

[root@localhost test]# lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 
7.9.2009 (Core) Release: 7.9.2009 Codename: Core

 

2、vim當前版本

[root@localhost test]# vim --version | head
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 15 2020 16:44:08)
Included patches: 1-207, 209-629
Modified by <[email protected]>
Compiled by <[email protected]>
Huge version without GUI.  Features included (
+) or not (-): +acl +farsi +mouse_netterm +syntax +arabic +file_in_path +mouse_sgr +tag_binary +autocmd +find_in_path -mouse_sysmouse +tag_old_static -balloon_eval +float +mouse_urxvt -tag_any_white -browse +folding +mouse_xterm -tcl

 

3、解除安裝vim

[root@localhost test]# yum remove vim -y

 

4、下載vim8.2安裝包及安裝

[root@localhost software]# wget https://github.com/vim/vim/archive/v8.2.1862.tar.gz
[root@localhost software]# tar -xzvf v8.2.1862.tar.gz
[root@localhost software]# mv v8.2.1862.tar.gz vim-8.2.1862/
[root@localhost software]# cd vim-8.2.1862/
[root@localhost vim-8.2.1862]# ./configure --prefix /usr/share/vim/
[root@localhost vim-8.2.1862]# make
[root@localhost vim-8.2.1862]# make install

 

5、測試新版本

[root@localhost bin]# /usr/share/vim/bin/vim --version | head
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May  6 2022 20:28:39)
Included patches: 1-1862
Compiled by [email protected]
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
-balloon_eval      -footer            +multi_lang        +terminal

 

6、新增命令別名、環境變數

[root@localhost bin]# echo "alias vim='/usr/share/vim/bin/vim' " >> /etc/bashrc
[root@localhost bin]# source /etc/bashrc
[root@localhost bin]# vim --version | head
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May  6 2022 20:28:39)
Included patches: 1-1862
Compiled by [email protected]
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
-balloon_eval      -footer            +multi_lang        +terminal

沒有問題。