Uncategorized

Vim 8.2 Released – How To Install Vim In Ubuntu Linux

Vim 8.2 is released. Here is how to install vim in Ubuntu Linux. Also learn how to uninstall vim in Ubuntu.

Vim Text Editor

Vim is a highly configurable text editor for efficiently creating and changing any kind of text. It is included as “vi” with most UNIX systems and with Apple OS X.

Vim is rock stable and is continuously being developed to become even better.
Among its features are:

  • persistent, multi-level undo tree
  • extensive plugin system
  • support for hundreds of programming languages and file formats
  • powerful search and replace
  • integrates with many tools

Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.

Vim is often called a “programmer’s editor,” and so useful for programming that many consider it an entire IDE. It’s not just for programmers, though. Vim is perfect for all kinds of text editing, from composing email to editing configuration files.

Despite what the above comic suggests, Vim can be configured to work in a very simple (Notepad-like) way, called evim or Easy Vim.

Note that Vim isn’t a word processor. Although it can display text with various forms of highlighting and formatting, it isn’t there to provide WYSIWYG editing of typeset documents.

Vim 8.2

Vim 8.2 is a minor release, a lot of bugs have been fixed, documentation was updated, test coverage was improved, etc. There are a few interesting new features.

The top two items were clear: Popup windows and text properties.

Popup Windows – It make it possible to show messages, function prototypes, code snippets and anything else on top of the text being edited. They open and close quickly and can be highlighted in many ways. More about that below.

This was no small effort. Although the existing window support could be used, popup windows are different enough to require a lot of extra logic. Especially to update the screen efficiently. Also to make it easy for plugin writers to use them; you don’t need to tell Vim exactly where to show one, just give a reference point and the text to display, Vim will figure out the size and where the popup fits best.

Popup windows can be used for many purposes, here are a few examples:

  1. When a background build finishes a message popup can show “Build finished successfully” on top of the screen, without interfering with what the user is working on.
  2. When using Insert mode completion extra info for a completion item can be displayed in an info popup.
  3. A list of choices can be displayed, where the user selects an entry with keys or with the mouse.
  4. While typing a function call, a popup can show the documentation and the list of arguments, just next to where the user is typing. The new text properties feature can be used to highlight types.
  5. Plugins are the main audience for the popup window feature, there are many options to change the positioning, size and highlighting.

Text Properties – It can be used for something as simple as highlighting a text snippet or something as complicated as using an external parser to locate syntax items and highlight them asynchronously. This can be used instead of the pattern based syntax highlighting. A text property sticks with the text, also when inserting a word before it. And this is done efficiently by storing the properties with the text.

The new change listener support can be used to keep the highlighting up-to-date and support other LSP features. An example of what can be done with this is the “govim” plugin. It connects to a server (written in Go) and uses “gopls”, the Language Server Protocol (LSP) server for Go.

Other noticeable new features

  1. The xdiff library has been included for a much improved diff view.
  2. When ‘incsearch’ is set it also applies to “:substitute”.
    “modifyOtherKeys” was added to allow mapping more key combinations.
  3. ConPTY support was added for Windows 10, can show full color in the console.
  4. The MS-Windows installer supports translations, silent install and looks much better.

Install Vim 8.2 Using Git

Run the following commands in Terminal to install Vim on Ubuntu using Git:

sudo apt install git
git clone https://github.com/vim/vim.git
cd vim
./configure
sudo apt install ncurses-dev
sudo yum install ncurses-devel
make
sudo make install

Install Vim 8.2 Using PPA

Run the following commands in Terminal to install Vim on Ubuntu using PPA:

sudo add-apt-repository ppa:jonathonf/vim
sudo apt update
sudo apt install vim

That’s all. If you want to uninstall it, use the commands below:

sudo apt install ppa-purge
sudo ppa-purge ppa:jonathonf/vim
sudo add-apt-repository --remove ppa:jonathonf/vim

Once Vim is installed, run the command below to check Vim version.

vim --version

Vim 8.2 Released – How To Install Vim In Ubuntu Linux originally posted on Source Digit – Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos.