How to Install VIM editor on Ubuntu?IntroductionVim is a text editor and improved version of Vi editor. It is designed to use as CLI (Command Line Interface) and GUI (Graphical User Interface) application. It is designed and developed by Bram Moolenaar and first released on November, 1991. VIM is an open-source and free, screen-based text editor. The cross-platform expansion has made it present for several other systems since its publication for the Amiga. It was voted the most famous editor by the readers of Linux Journal in 2018; the developer survey, i.e., Stack Overflow, found it to be the 3rd most famous text editor in 2015 and the 5th most famous development environment in 2019. In this tutorial, we will install VIM editor on the Ubuntu operating system. To install, make sure we have updated version of Ubuntu and functioning terminal. Prerequisites
Brief History of VIMThe forerunner of VIM, Stevie, was made by Tim Thompson in 1987 for the Atari ST and further improved by G.R. Walter and Tony Andrews. Bram Moolenaar started operating on VIM, basing his implementation on Stevie for the Amiga system in 1988, along with the initial public release in 1991. The title "VIM" was short for "Vi IMitation" during its initial release, but it was modified to "Vi IMproved" in 1993. License of VIMVIM is published upon the Vim license. It contains a few charityware clauses that inspire users who like the application to consider contributing to children. The Vim license is suitable with the GNU General Public License by a unique clause permitting the distribution of changed copies upon the GNU GPL 2.0 or later versions. Interface of VIMThe interface of VIM isn't based on the icons or menus but on the commands provided inside the text user interface like VI; gVim, its GUI mode, includes toolbars and menus for generally used commands; however, the complete functionality is still represented by its commands line mode. Vi tends to permit a typist to place their fingers on the home row, which could be a benefit for a touch typist. The VIM editor contains a built-in tutorial for newcomers known as vimtutor, which is basically installed with Vim. However, it is a different executable and could be executed using a shell command. The User Manual of Vim details the features of Vim and can be found online or executed from inside Vim. Also, Vim includes a built-in help feature, which permits users to ask and navigate with features and commands. Registers Vim provides several unique memory entries known as registers (don't confuse them with processor or hardware registers). When copying, pasting, deleting, or cutting text, the user can select to save the manipulated text within a register. Thirty-six general-purpose registers are available that are related to numbers and letters and a variety of unique ones that either include unique values (last command, current filename, etc.) or serve a unique objective. Modes Vim supports two or more editing modes like vi. Type characters are specified either as command sequences or are entered as text, relying on the mode. 12 editing modes, six variants, and six common modes are available in Vim:
Customization of VIMVim is highly extensible and customizable, making it an interesting tool for customers who demand a bigger amount of flexibility and control over the text editing platform. Text input is provided by a range of features developed to enhance keyboard efficiency. Customers can run hard commands using "key mapping", which could be extended and customized. The "recording" aspect permits the establishment of macros to activate keystroke sequences and call user-defined or internal mappings and functions. Abbreviations, the same as key mappings or macros, provide the expansion of short text strings into longer ones and could also be used for correcting mistakes. Also, Vim facilitates an "easy" mode for customers looking for an easier solution to text editing. Several plugins are available that enhance and include new functionality in Vim. Usually, these plugins are written in the internal scripting language Vim, vimscript (also called VimL), but can also be specified in other languages. Many projects grouped together complex customizations and scripts and focused on turning Vim into a resource for a particular task or including a bigger flavor to its nature. Some examples are VimOutliner, which facilitates a comfortable outliner for Unix-like system users, and Cream, which enables Vim to act like a click-and-type editor. Improvements and features of VimVim includes a compatibility mode with vi, but when this mode isn't used, Vim contains several improvements over vi. But Vim isn't entirely suitable with vi as specified in POSIX and the Single Unix Specification alike in compatibility mode. The developers of Vim said that it's very much suitable with Vi.
Vim scriptIt is also known as VimL or Vimscript. Vim script is a scripting language integrated into Vim. Early Vim versions added commands for function definitions and control flow, which is the ex-based editor language of the actual vi editor. Since the 7 version, Vim script supports more developed data types, including dictionaries and lists, and an easier mode of object-oriented programming. Many built-in functions, including filter() and map(), permit a common functional programming form, and the Vim script has contained lambda since the 8.0 version. Mostly, Vim script is specified in the form of imperative programming. Vim macros can include a normal-mode command sequence but can also request ex-functions or commands specified in Vim script for harder tasks. Most extensions (known as plugins or scripts) of the Vim functionality are specified in the Vim script, although plugins can also use other languages, such as Racket, Tcl, Ruby, Lua, Python, or Perl. These plugins can manually be installed, or they can be installed by a plugin manager, like Vim-Plug, Pathogen, or Vundle. The files of the Vim script are saved as plain text, the same as other code, and .vim is usually the extension of the filename. One important exception to it is the config file of Vim, i.e., .vimrc. Availability of VimWhile the vi editor was available on Unix OSes originally, Vim has been shipped to several operating systems, such as Atari MiNT, AmigaOS, DOS, BeOS, Windows initiating from Windows NT 3.1, MorphOS, OS/390, OS/2, OpenVMS, RISC OS, QNX, BSD, Classic Mac OS, and Linux. Vim is also ported with Apple macOS. Vim-independent ports are available for iOS and Android. Vim forkNeovim is a Vim fork that aims to develop the maintainability and extensibility of Vim. Several features of this fork are available, including support for built-in Language Server Protocol, asynchronous I/O support, and Lua scripting support with the luaJIT language interpreter. It is an open-source software project, and its source code is present on GitHub. After a Vim patch aiding multi-threading was dismissed, the Neovim project began in 2014. In March 2014, it had well fundraising, supporting a single full-time developer at least. Many frontends are supporting development that uses the capabilities of Neovim. Neovim achieved built-in Language Server Protocol support and complete support for Lua, such as the capability of writing the primary configuration file in the Lua language rather than VimL with the 0.5 version of Neovim on 2 July 2021. VIM InstallationInstalling VIM editor is pretty easy, it just require a single command to install. The following command is used to install VIM editor. Type 'Y' and press enter, it will start installation of required packages and application. After that, we can run vim either from the terminal or application manager. We can find it in system by typing VIM, as we did below. Click on the icon and it will open a terminal for VIM editor. It looks something like the below. Well, we have successfully installed VIM editor on our system. Now, we can use it to code in any programming language. |