Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to compile and install vim8 for Centos7

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "Centos7 how to compile and install vim8", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Centos7 how to compile and install vim8" bar!

Environment

Centos7.7 Minimal

Vim-8.2.221

Install VIM8

You need to install dependency packages and common toolkits first:

[root@localhost ~] # yum-y install git ncurses-devel ruby ruby-devel lua lua-devel perl perl-devel python3 python3-devel python2-devel perl-ExtUtils-Embed lrzsz cmake wget gcc gcc-c++ unzip

Download the latest vim installation package from the github repository

[root@localhost ~] # git clone https://github.com/vim/vim

Start compiling and installing vim

[root@localhost] # cd vim-master/ [root@localhost vim-master] #. / configure-- with-features=huge\-- enable-rubyinterp=yes\-- enable-luainterp=yes\-- enable-perlinterp=yes\-- enable-python3interp=yes\-- enable-pythoninterp=yes\-- with-python-config-dir=/usr/lib64/python2.7/config\ -- with-python3-config-dir=/usr/lib64/python3.6/config-3.6m-x86_64-linux-gnu\-- enable-fontset=yes\-- enable-cscope=yes\-- enable-multibyte\-- disable-gui\-- enable-fail-if-missing\-- prefix=/usr/local\- -with-compiledby='Professional operations' [root@localhost vim-master] # make VIMRUNTIMEDIR=/usr/local/share/vim/vim82 & & make install

-- enable-fail-if-missing indicates that the problem will prompt an error and stop

-- enable-***interp=yes indicates to join * support.

-- with-***-config-dir=*** indicates the specified configuration file path

Make VIMRUNTIMEDIR=*** indicates the location of the specified VIM executable file

Execute vim to check the version

[root@localhost ~] # vim

How to install the vim plug-in?

After installing your favorite plug-in, the Vim editor is much easier to use.

Install plug-in Manager

Two tools are installed here, one is pathogen, and the other is vimogen.

The Pathogen plug-in is used to centrally manage the plug-ins of vim. Vimogen is used with pathogen to add the address of the plug-in in ~ / .vimogen_repos, and then run vimogen to automatically install the plug-in in .vimogen _ repos. The directory where the plug-in is installed is the directory managed by pathogen.

Install pathogen first:

[root@localhost ~] # mkdir-P. vim / {autoload,bundle} [root@localhost ~] # curl-LSso ~ / .vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

Create a .vimrc file in the home directory, but you don't have to create it if you have it. Add the following to the .vimrc file:

Vim ~ / .vimrcexecute pathogen#infect () syntax onfiletype plugin indent onset hlsearchset backspace=indent,eol,start

Then install vimogen:

[root@localhost ~] # git clone https://github.com/rkulla/vimogen[root@localhost ~] # cp-p vimogen/vimogen / usr/local/bin/

Create a ~ / .vimogen_repos file, which contains plug-ins that I need to use.

[root@localhost] # vim ~ / .vimogen_repos https://github.com/ianva/vim-youdao-translaterhttps://github.com/scrooloose/nerdtree

Run the vimogen command, and then enter 1 to install:

[root@localhost ~] # vimogen1) INSTALL2) UNINSTALL3) UPDATE4) EXITEnter the number of the menu option to perform: 1

Configure the .vimrc file to enable the two plug-ins you just installed

[root@localhost ~] # vim .vimrc execute pathogen#infect () syntax onfiletype plugin indent onset hlsearchset backspace=indent,eol Start "= nerdtree=autocmd StdinReadPre * let s:std_in=1autocmd VimEnter * if argc () = = 1 & & isdirectory (argv () [0]) & &! exists (" s:std_in ") | exe 'NERDTree' argv () [0] | wincmd p | ene | endifmap:NERDTreeToggleautocmd bufenter * if (" $") = = 1 & exists (" b:NERDTree ") & & b:NERDTree.isTabTree () | Q | endif" = vim-youdao-translator=vnoremap:Ydvnnoremap:Ydcnoremapyd: Yde

Demonstrate the plug-in

Nerdtree

Nerdtree implements the function of displaying the directory tree on the left. The effect is as follows:

Press ctrl+ n to open or close the directory tree.

You can create files or directories in the directory tree. When the directory tree is active, press m to open the menu, and then you can choose to create, delete, and so on.

Enter a to create a file or directory

Add "/" to create a directory, not "/" to create a file.

Vim-youdao-translator

At present, I can only use this plug-in for word translation, ha.

Move the cursor over the word and press ctrl+t to translate it. The translation will be displayed in the command bar at the bottom of the editor.

Thank you for reading, the above is the content of "how to compile and install vim8 for Centos7". After the study of this article, I believe you have a deeper understanding of how to compile and install vim8 for Centos7, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report