How to install vim on OpenSUSE/SUSE Linux using zypper

I need VIM text editor on my OpenSUSE cloud server, and it is missing. How do I install vim on OpenSUSE/SUSE Linux cloud server?

This page explains how to install VIM text editor on OpenSUSE/SUSE Linux server (SELS) or workstation using the zypper command.
Tutorial requirements
Operating system/appOpenSUSE/SUSE Linux
Root privileges required Yes
Difficulty Easy (rss)
Estimated completion time 2m
Table of contents

How to install vim on OpenSUSE/SUSE Linux

VIM means Vi IMproved and often called as a programmer’s text editor. VIM is popular among sysadmins, DevOps engineers, Linux enthusiasts, and users. By default, OpenSUSE Linux minimal version does not comes with vi or vim to keep cloud images small. However, we can search and install VIM as follows.

Step 1: Search for vim packages

Open the terminal application and then enter the following command. We can search vim package using metadata for keywords. The syntax is as follows:
$ sudo zypper search vim
Here is what I get on my box:

Loading repository data...
Reading installed packages...
 
S | Name                      | Summary                                                             | Type
--+---------------------------+---------------------------------------------------------------------+-----------
  | gvim                      | A GUI for Vi                                                        | package
  | llvm-vim-plugins          | Vim plugins for LLVM                                                | package
  | llvm5-vim-plugins         | Vim plugins for LLVM                                                | package
  | llvm7-vim-plugins         | Vim plugins for LLVM                                                | package
  | meson-vim                 | Vim support for meson.build files                                   | package
  | neovim                    | Vim-fork focused on extensibility and agility                       | package
  | neovim                    | Vim-fork focused on extensibility and agility                       | srcpackage
  | neovim-lang               | Translations for package neovim                                     | package
  | python-Jinja2-vim         | Jinja2 syntax files for Vim                                         | package
  | python2-neovim            | Python client to Neovim                                             | package
  | python3-neovim            | Python client to Neovim                                             | package
  | rtorrent-vim              | Vim syntax file for rTorrent's config file                          | package
  | texlive-context-vim       | Generate ConTeXt syntax highlighting code from vim                  | package
  | texlive-context-vim-doc   | Documentation for texlive-context-vim                               | package
  | vagrant-vim               | Vagrantfile syntax files for the vim editor                         | package
  | vim                       | Vi IMproved                                                         | package
  | vim                       | Vi IMproved                                                         | srcpackage
  | vim-bootstrap             | Vim Bootstrap is a vimrc generator                                  | package
  | vim-data                  | Data files needed for extended vim functionality                    | package
  | vim-data-common           | Common Data files for vim & gvim                                    | package
  | vim-icinga2               | Vim syntax highlighting for icinga2                                 | package
  | vim-plugin-NERDcommenter  | A plugin that allows for easy commenting of code for many filetypes | package
  | vim-plugin-NERDtree       | A tree explorer plugin for navigating the filesystem                | package
  | vim-plugin-a              | Alternate files quickly                                             | package
  | vim-plugin-ack            | Run the ack search tool from Vim                                    | package
  | vim-plugin-align          | Plugin to produce aligned text, equations, declarations, etc        | package
  | vim-plugin-bufexplorer    | Buffer Explorer / Browser                                           | package
  | vim-plugin-calendar       | Calendar for vim                                                    | package
  | vim-plugin-colorschemes   | Vim color schemes selection                                         | package
  | vim-plugin-colorsel       | A RGB/HSV color selector                                            | package
  | vim-plugin-conky          | Conky Configuration File Support for Vim                            | package
  | vim-plugin-devhelp        | Devhelp plugin for Vim                                              | package
  | vim-plugin-diffchanges    | Show changes since the last save                                    | package
  | vim-plugin-editorconfig   | EditorConfig plugin for Vim                                         | package
  | vim-plugin-fugitive       | Fugitive plugin for Vim                                             | package
  | vim-plugin-gitdiff        | Show git diff in a split window                                     | package
  | vim-plugin-gnupg          | Plugin for transparent editing of gpg encrypted files               | package
  | vim-plugin-latex          | A rich set of tools for editing LaTeX                               | package
  | vim-plugin-locateopen     | Edit file without entering the whole path                           | package
  | vim-plugin-matrix         | Matrix screensaver for vim                                          | package
  | vim-plugin-minibufexpl    | Elegant buffer explorer that takes very little screen space         | package
  | vim-plugin-multiplesearch | Display multiple searches at the same time                          | package
  | vim-plugin-neomutt        | Neomutt plugin for Vim                                              | package
  | vim-plugin-nginx          | VIM support for nginx config files                                  | package
  | vim-plugin-powerline      | Powerline VIM plugin                                                | package
  | vim-plugin-project        | Organize/Navigate projects of files                                 | package
  | vim-plugin-quilt          | Quilt support for vim                                               | package
  | vim-plugin-rails          | Support for Ruby on Rails development                               | package
  | vim-plugin-searchcomplete | Tab completion of words inside of a search                          | package
  | vim-plugin-showmarks      | Visually shows the location of marks                                | package
  | vim-plugin-snipmate       | Implements some of TextMate's snippets features in Vim              | package
  | vim-plugin-supertab       | Easy insert mode completion with Tab key                            | package
  | vim-plugin-taglist        | Source code browser with support for many languages                 | package
  | vim-plugin-tlib           | Utility functions for vim                                           | package
  | vim-plugin-tregisters     | List, edit, and run/execute registers/clipboards                    | package
  | vim-plugin-tselectbuffer  | A quick buffer selector/switcher                                    | package
  | vim-plugin-tselectfiles   | A quick file selector/browser/explorer                              | package
  | vim-plugin-utl            | Universal text linking for vim                                      | package
  | vim-plugin-vimwiki        | Personal wiki for vim                                               | package
  | vim-plugin-zoomwin        | Zoom in/out of windows (toggle between one window and multi-window) | package

Step 2: Getting info about vim package on OpenSUSE or SUSE Enterprise Linux

So, what we need is vim package. Let us find out information about that, run:
$ sudo zypper info vim
$ sudo zypper info vim-plugin-nginx

Outputs:

Loading repository data...
Reading installed packages...
 
 
Information for package vim:
----------------------------
Repository     : Main Update Repository
Name           : vim
Version        : 8.0.1568-lp151.5.6.1
Arch           : x86_64
Vendor         : openSUSE
Installed Size : 3.1 MiB
Installed      : No
Status         : not installed
Source package : vim-8.0.1568-lp151.5.6.1.src
Summary        : Vi IMproved
Description    : 
    Vim (Vi IMproved) is an almost compatible version of the UNIX editor
    vi. Almost every possible command can be performed using only ASCII
    characters. Only the 'Q' command is missing (you do not need it). Many
    new features have been added: multilevel undo, command line history,
    file name completion, block operations, and editing of binary data.

Step 3: Installing VIM on OpenSUSE Linux 15.1 server

Execute the following zypper command to install vim:
$ sudo zypper install vim

Step 4: Start using vim

All you have to do is type the following command:
$ vim filename
$ sudo vim /etc/nginx/nginx.conf
$ vim [options] do-to-rds-migration.sh

We can create a permanent Bash alias:
$ alias vi='vim'
Next, add bash shell aliases to ~/.bashrc or ~/.bash_aliases file:
$ echo "alias vi='vim'" >> ~/.bashrc
Reload it, enter:
$ source ~/.bashrc
We can also set vim as the system wide default text editor on SUSE Linux Enterprise Server (SLES) as follows:
$ sudo -i
# echo 'export VISUAL="vim"' > /etc/profile.d/vimeditor.sh
# echo 'export EDITOR="vim"' >> /etc/profile.d/vimeditor.sh

The Vim tutor

Are you new to VIM? Do you want to learn all about Vim commands and editor? No need to search the Internet or get a book. VIM comes with the Vim tutor. All you have to do is type the following command at the shell prompt:
$ vimtutor
The optional [language] argument is the two-letter name of a language, like “it” or “es”. To list installed languages, run the following ls command $ ls -l /usr/share/vim/vim*/tutor/
Hence, I can type:
$ vimtutor es
$ vimtutor lv
$ vimtutor tr
$ vimtutor it

Installing vim plugins

We can enhance vim with additional set of plugins. But, first we must search for vim related packages and plugins as follows:
$ sudo zypper search vim
Say you want to install support for Ruby on Rails development, run:
$ sudo zypper install vim-plugin-rails
I am going to install Nginx on OpenSUSE/SUSE Linux, so let us install VIM support for nginx config files too:
$ sudo zypper install vim-plugin-nginx
Sample session:

Loading repository data...
Reading installed packages...
Resolving package dependencies...
 
The following NEW package is going to be installed:
  vim-plugin-nginx
 
1 new package to install.
Overall download size: 69.9 KiB. Already cached: 0 B. After the operation, additional 128.6 KiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package vim-plugin-nginx-1.16.1-lp151.4.11.1.noarch       (1/1),  69.9 KiB (128.6 KiB unpacked)
Retrieving: vim-plugin-nginx-1.16.1-lp151.4.11.1.noarch.rpm .........................................[done]
 
Checking for file conflicts: ........................................................................[done]
(1/1) Installing: vim-plugin-nginx-1.16.1-lp151.4.11.1.noarch .......................................[done]

Conclusion

In this tutorial, we learned how to install VIM (VIsual editor iMproved) is an updated and improved version of the vi editor on OpenSUSE or SUSE Linux Enterprise Server. Vi was the first real screen-based editor for UNIX, and is still very popular among sysadmins and developers. VIM improves on vi by adding new features multiple windows, multi-level undo, block highlighting, and more. See VIM official page here for more information.

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.