Vim 9.0 is released with new script syntax and semantics. Here is how to install Vim on Ubuntu Linux using terminal commands.
Vim9 script provides a syntax that is much more similar to other languages. In other words: “less weird”. Compiled functions are introduced which allow for a large speed improvement. You can expect around ten times faster execution, or even more. The price to pay is that Vim9 script is not backwards compatible. But don’t worry, you can still use your old scripts, the new script language is added, it does not replace the legacy script.
The main goal of Vim9 script is to drastically improve performance. This is accomplished by compiling commands into instructions that can be efficiently executed. An increase in execution speed of 10 to 100 times can be expected. A secondary goal is to avoid Vim-specific constructs and get closer to commonly used programming languages, such as JavaScript, TypeScript and Java.
The performance improvements can only be achieved by not being 100% backwards compatible. For example, making function arguments available in the “a:” dictionary adds quite a lot of overhead. In a Vim9 function this dictionary is not available. Other differences are more subtle, such as how errors are handled.
The Vim9 script syntax and semantics are used in:
- a function defined with the :def command
- a script file where the first command is vim9script
- an autocommand defined in the context of the above
- a command prefixed with the vim9cmd command modifier
- Vim9 script and legacy Vim script can be mixed.
- There is no requirement to rewrite old scripts, they keep working as before.
Download Vim
Vim 9.0 is the latest stable version. It is highly recommended, many bugs have been fixed since previous versions. If you have a problem with it (e.g., when it’s too big for your system), you could try version 6.4 or 5.8 instead.
To avoid having to update this page for every new version, there are links to the directories. From there select the files you want to download. In the file names ## stands for the version number. For example, vim##src.zip with version 9.0 is vim90src.zip and vim-##-src.tar.gz for version 9.0 is vim-9.0-src.tar.gz. Links are provided for quick access to the latest version.
Note that the links point to the latest version (currently 9.0) to avoid that caching causes you to get an older version.
Install Vim on Ubuntu Linux
Run the following commands to install Vim on Ubuntu using apt-get command:
sudo apt update
sudo apt install vim
Once installed, you can check Vim version using the command vim –version
If you want to uninstall or remove vim package from Linux Ubuntu Systems, run the following commands:
sudo apt remove vim
sudo apt autoclean && sudo apt autoremove
Compile and Install Vim
sudo apt install ncurses-dev
sudo apt install make
sudo apt install build-essential
wget https://github.com/vim/vim/archive/master.zip
sudo apt install unzip
unzip master.zip
cd vim-master
cd src/
./configure
make
sudo make install
After executing the above commands VIM will be installed to the directory /usr/local/bin/vim.