Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to compile and install Vim in Ubuntu system

Shulou Source: shulou.com Published: 2022-06-01 12:27:23 09月20日 Update

This article mainly introduces "how to compile and install Vim in the Ubuntu system". In the daily operation, I believe that many people have doubts about how to compile and install Vim in the Ubuntu system. The editor consulted all kinds of materials and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the doubt of "how to compile and install Vim in the Ubuntu system". Next, please follow the editor to study!

Brief introduction

Vim is a text editor developed from vi. The convenient programming functions such as code completion, compilation and error jump are particularly rich and are widely used by programmers. Juxtaposed with Emacs as the favorite editor for users of Unix-like systems.

For most users, Vim has a steep learning curve. This means that progress may be slow when you start learning, but once you have mastered some basic operations, you can greatly improve your editing efficiency. To help with learning, Vim prepares Vim teaching for beginners. You can usually type "vimtutor" under the Unix system command line or click the Vim teaching icon on the Windows desktop to enter. The basic and advanced functions of Vim are described in more detail in the Vim user manual. You can enter ": help user-manual" in Vim to enter the user's manual. In addition to the original English version, the manual has also been translated into national languages by volunteers, including Chinese.

New users should also learn Vim's help system. You can type "help" with no parameters in Vim to read the main help file.

Installation

Here are the installation notes:

1. Add the necessary terminal libraries:

The code is as follows:

Sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev

two。 Download vim source code, open the download page of www.vim.org and select unix source code to download: vim-7.3.tar.bz2

3. Decompress it and enter the source directory: cd vim/src

4.

The code is as follows:

$make distclean # clean up all files generated by the last compilation

5. Execute:

The code is as follows:

. / configure-- with-features=huge-- enable-pythoninterp=yes-- enable-gui=gnome2-- enable-cscope-- enable-fontset-- enable-perlinterp-- enable-rubyinterp-- with-python-config-dir=/usr/lib/python2.6/config # compilation configuration

6. Compile:

The code is as follows:

Make

7. Installation:

The code is as follows:

Sudo make install

Description:

In the compiled configuration-- enable-gui=gnome2 enables GUI, that is, you can use gvim. Still not used to the vim in the terminal.

-- enable-pythoninterp=yes enables vim's support for python

-- with-python-config-dir=/usr/lib/python2.6/config points to the configuration folder of python, which can be modified according to your actual situation because of the different installation version / path. (the default installation path of python for Ubunut 10.10 that I use)

Add to menu item

Now let's add it to the menu item. The Ubuntu menu items are saved in the / usr/share/applications directory, so now the terminal enters the following code:

The code is as follows:

Sudo gedit / usr/share/applications/gvim.desktop

Enter in the editor

The code is as follows:

[Desktop Entry]

Name=Gvim

Commit [zh _ CN] = Gvim editor

Exec=gvim

Icon=/usr/share/pixmaps/gnome-word.png

Terminal=false

X-MultipleArgs=false

Type=Application

Categories=Application;Development

Encoding=UTF-8

StartupNotify=true

Name=GVim Text Editor

At this point, the study on "how to compile and install Vim in the Ubuntu system" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Compilation code system learning user help input editor manual file source code terminal menu configuration function teaching more version directory path Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info MySQL Docker Huawei macOS