Install vim linux ubuntu

How to Install Vim on Ubuntu

Learn to install Vim on Ubuntu Linux. Also learn to make Vim the default text editor in Ubuntu and Debian based distributions.

Vim is an excellent command line text editor. Once you master the basics of Vim, there is no looking back.

Ubuntu is one of the most popular Linux distribution for both desktop and server usage. Unfortunately, the default command line text editor in Ubuntu is Nano.

While Nano is also a good editor, you may still prefer using Vim. If that’s the case, let me show you how to install Vim on Ubuntu.

Install Vim on Ubuntu

The good thing is that Ubuntu is available in the main Ubuntu repository. This means that you don’t have to do any extra effort in installing Vim on Ubuntu.

All you need to do is to use the following command:

It will show all the packages that will be installed with Vim. Press Y or enter when prompted and you should have Vim installed in a few seconds.

Installing Vim on Ubuntu

Make Vim the default editor in Ubuntu and other Debian-based distributions

Normally, when you have to edit a file in the terminal, you use vim filename command for that. But some command line utilities allow you to edit their configuration files in the default text editor.

Since Nano is the default text editor in Ubuntu, you might not like that the files are being opened in Nano. What you can do is to change the default text editor to Vim in Ubuntu and other Debian based distributions.

Here’s how to do that. In the terminal, type the following command:

sudo update-alternatives --config editor

The output will present you all the text editors installed on your system and you’ll have to select one of them as the default editor.

sudo update-alternatives --config editor There are 5 choices for the alternative editor (providing /usr/bin/editor). Selection Path Priority Status ------------------------------------------------------------ * 0 /bin/nano 40 auto mode 1 /bin/ed -100 manual mode 2 /bin/nano 40 manual mode 3 /usr/bin/vim.basic 30 manual mode 4 /usr/bin/vim.tiny 15 manual mode 5 /usr/bin/vscodium 0 manual mode Press to keep the current choice[*], or type selection number:

The Vim that you know and love to use is Vim Basic. That Vim tiny is a stripped down version of Vim and you may not get all the Vim features in it. To avoid bad surprises, go with Vim basic.

In my case, if I enter 3, Vim basic will become the default text editor. If you want to revert it, you can repeat the steps.

Читайте также:  Astra linux hp proliant

Making Vim the default editor in Ubuntu

I hope this quick little tutorial helped you to install Vim on Ubuntu and make it the default text editor.

If you really want to master Vim like a pro, I highly recommend this training package from Jovica Ilic.

If you have any questions or suggestions, please feel free to leave a comment.

Источник

How to install Vim on Ubuntu

Vim is a powerful text editor available on almost all modern computing platforms. It is bundled in the default installation of most Linux distributions, though Ubuntu and Debian ship with the minimal version of Vim. The version lack features such as syntax highlighting, making it less robust or valuable as it could be.

To get the full benefit of Vim, you need to install its more feature-rich version. Ubuntu and Debian do provide such version of Vim in its default apt repository. You can install the full version of Vim on Ubuntu via apt at the terminal.

Steps to install full version of Vim on Ubuntu and Debian variance:

Open terminal from the application launcher or via the + + keyboard shortcut.

$ vi --version VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 13 2022 09:35:02) Included patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919 Modified by team+vim@tracker.debian.org Compiled by team+vim@tracker.debian.org Small version without GUI. Features included (+) or not (-): +acl -file_in_path -mouse_urxvt -tcl -arabic -find_in_path +mouse_xterm -termguicolors +autocmd -float +multi_byte -terminal -autochdir -folding -multi_lang +terminfo -autoservername -footer -mzscheme +termresponse -balloon_eval +fork() -netbeans_intg -textobjects -balloon_eval_term -gettext +num64 -textprop -browse -hangul_input -packages -timers +builtin_terms +iconv -path_extra +title -byte_offset +insert_expand -perl -toolbar -channel -ipv6 -persistent_undo +user_commands -cindent -job -popupwin -vartabs -clientserver +jumplist -printer +vertsplit -clipboard -keymap -profile +vim9script +cmdline_compl -lambda -python -viminfo +cmdline_hist -langmap -python3 +virtualedit -cmdline_info -libcall -quickfix +visual +comments -linebreak -reltime +visualextra -conceal -lispindent -rightleft +vreplace -cryptv +listcmds -ruby +wildignore -cscope +localmap +scrollbind -wildmenu +cursorbind -lua -signs +windows -cursorshape -menu -smartindent +writebackup -dialog -mksession -sodium -X11 -diff +modify_fname -sound +xfontset -digraphs +mouse -spell -xim -dnd -mouseshape -startuptime -xpm -ebcdic -mouse_dec -statusline -xsmp -emacs_tags -mouse_gpm -sun_workshop -xterm_clipboard -eval -mouse_jsbterm -syntax -xterm_save +ex_extra -mouse_netterm +tag_binary -extra_search +mouse_sgr -tag_old_static -farsi -mouse_sysmouse -tag_any_white system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" defaults file: "$VIMRUNTIME/defaults.vim" fall-back for $VIM: "/usr/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -ffile-prefix-map=/build/vim-NNb5ax/vim-8.2.3995=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -DTINY_VIMRC -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lselinux -lacl -lattr
$ sudo apt remove --assume-yes vim-tiny [sudo] password for user: Reading package lists. Done Building dependency tree. Done Reading state information. Done The following packages were automatically installed and are no longer required: vim-common xxd Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: ubuntu-minimal vim-tiny 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. After this operation, 1,764 kB disk space will be freed. (Reading database . 168092 files and directories currently installed.) Removing ubuntu-minimal (1.481) . Removing vim-tiny (2:8.2.3995-1ubuntu2.1) .
$ sudo apt update Hit:1 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease Hit:2 http://ports.ubuntu.com/ubuntu-ports jammy-proposed InRelease Hit:3 http://us.ports.ubuntu.com/ubuntu-ports jammy InRelease Hit:4 http://us.ports.ubuntu.com/ubuntu-ports jammy-updates InRelease Hit:5 http://us.ports.ubuntu.com/ubuntu-ports jammy-backports InRelease Reading package lists. Done Building dependency tree. Done Reading state information. Done All packages are up to date.
$ sudo apt install --assume-yes vim Reading package lists. Done Building dependency tree. Done Reading state information. Done The following additional packages will be installed: vim-runtime Suggested packages: ctags vim-doc vim-scripts The following NEW packages will be installed: vim vim-runtime 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 8,492 kB of archives. After this operation, 37.4 MB of additional disk space will be used. ##### snipped
$ vi --version VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 13 2022 09:35:02) Included patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919 Modified by team+vim@tracker.debian.org Compiled by team+vim@tracker.debian.org Huge version without GUI. Features included (+) or not (-): +acl +file_in_path +mouse_urxvt -tag_any_white +arabic +find_in_path +mouse_xterm -tcl +autocmd +float +multi_byte +termguicolors +autochdir +folding +multi_lang +terminal -autoservername -footer -mzscheme +terminfo -balloon_eval +fork() +netbeans_intg +termresponse +balloon_eval_term +gettext +num64 +textobjects -browse -hangul_input +packages +textprop ++builtin_terms +iconv +path_extra +timers +byte_offset +insert_expand -perl +title +channel +ipv6 +persistent_undo -toolbar +cindent +job +popupwin +user_commands -clientserver +jumplist +postscript +vartabs -clipboard +keymap +printer +vertsplit +cmdline_compl +lambda +profile +vim9script +cmdline_hist +langmap -python +viminfo +cmdline_info +libcall +python3 +virtualedit +comments +linebreak +quickfix +visual +conceal +lispindent +reltime +visualextra +cryptv +listcmds +rightleft +vreplace +cscope +localmap -ruby +wildignore +cursorbind -lua +scrollbind +wildmenu +cursorshape +menu +signs +windows +dialog_con +mksession +smartindent +writebackup +diff +modify_fname +sodium -X11 +digraphs +mouse -sound -xfontset -dnd -mouseshape +spell -xim -ebcdic +mouse_dec +startuptime -xpm +emacs_tags +mouse_gpm +statusline -xsmp +eval -mouse_jsbterm -sun_workshop -xterm_clipboard +ex_extra +mouse_netterm +syntax -xterm_save +extra_search +mouse_sgr +tag_binary -farsi -mouse_sysmouse -tag_old_static system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" defaults file: "$VIMRUNTIME/defaults.vim" fall-back for $VIM: "/usr/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -ffile-prefix-map=/build/vim-NNb5ax/vim-8.2.3995=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lselinux -lsodium -lacl -lattr -lgpm -L/usr/lib/python3.10/config-3.10-aarch64-linux-gnu -lpython3.10 -lcrypt -ldl -lm -lm

Источник

How to Install Latest Vim 9.0 in Linux Systems

Vi has been around for a long, developed around 1976, it offered users traditional yet powerful features such as an effective editing interface, terminal control, and many more.

However, it lacked certain captivating features for example multiple screens, syntax highlighting, multiple undo functionality, and so on, that many Unix/Linux users were looking for in a complete text editor.

Therefore, Vim (Vi Improved) was developed to bring users a fully-featured, advanced, and complete text editor. Vim is a powerful, highly configurable, cross-platform, and popular text editor that runs on Unix-like systems such as Linux, OS X, Solaris, *BSD, and MS-Windows.

It is feature-rich and highly extensible as well, using several community-developed plugins, you can turn Vim into more than a simple text editor using vim tricks and tips.

Vim Features

A number of its notable features include:

  • A new Vim9 script to improve performance.
  • Persistent, multi-level undo tree.
  • Supports multiple screens.
  • Highly extensible using multiple plugins.
  • Offers users a powerful and reliable search tool.
  • Supports several programming languages and file formats.
  • Supports and integrates with numerous tools and many more.

After many years of gradual improvement, Vim now takes a significant step with a major Vim 9.0 release, which comes with some important improvements, several bug fixes, and new features as listed on the release announcement page.

How To Install Vim 9.0 Editor in Linux Systems

In most modern Linux distributions, you can install Vim editor from the default repositories using the package manager, but the available version you will get is a little older.

$ sudo apt install vim [On Debian, Ubuntu, and Mint] $ sudo dnf install vim [On RHEL, CentOS and Fedora] $ sudo pacman -S vim [On Arch Linux and Manjaro] $ sudo zypper install vim [On OpenSuse]

Although Vim 9.0 is out, it will take a good amount of time before it gets into official software repositories for the different Linux distributions.

Luckily, users of Ubuntu and Mint and its derivatives can use the unofficial and untrusted PPA to install it as shown.

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

After installation, you can launch vim from the command line and view information about it as shown:

Running Vim 9.0 in Ubuntu 20.04

To uninstall it and move back to the older version in the Ubuntu repository, run the following commands to purge the PPA:

$ sudo apt install ppa-purge $ sudo ppa-purge ppa:jonathonf/vim

Arch users can install the latest Vim using the pacman command as shown:

Compiling Vim 9.0 from Sources in Linux

For other Linux distributions, it will take some time to include it in official software repositories, but you can try the latest Vim 9.0 by compiling it from the source on your own as shown.

# git clone https://github.com/vim/vim.git # cd vim/src # make # make test # make install # vim

Running Vim 9.0 in Rocky Linux 9

There is also a Vim Appimage which is built daily and runs on many Linux systems.

Last but not least, if you have installed Vim, try it out and get back to us by using the feedback section below. Make any suggestions or share your experience with us and much more. We shall be delighted to get vital remarks from you.

Источник

Оцените статью
Adblock
detector