How to install vim on OpenSUSE / SUSE Linux with zypper

You need the VIM text editor on the OpenSUSE cloud server but it is not available. How to install vim on OpenSUSE / SUSE Linux?

This article will show you how to install the VIM text editor on OpenSUSE / SUSE Linux (SELS) using the zypper command.

How to install vim on OpenSUSE / SUSE Linux

VIM means Vi IMproved and is often called the text editor of a programmer. VIM is very popular among sysadmins, DevOps engineers, regular Linux users. By default, OpenSUSE Linux does not come with vi or vim. However, we can search and install VIM as follows.

Step 1: Search for vim packages

Open a terminal and enter the following command. We can search vim packages with metadata for keywords. Use the following command:

$ sudo zypper search vim

The result will get the following:

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: Get information about vim packages on OpenSUSE or SUSE Enterprise Linux

So what we need is vim package. To find out application version information, run:

$ sudo zypper info vim $ sudo zypper info vim-plugin-nginx

Sample output:

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: Install 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 the bash shell alias to the ~ / .bashrc or ~ / .bash_aliases file:

$ echo "alias vi='vim'" >> ~/.bashrc

Reload, type:

$ source ~/.bashrc

We can also set vim as the default text editor across SUSE Linux Enterprise Server (SLES) systems as follows:

$ sudo -i # echo 'export VISUAL="vim"' > /etc/profile.d/vimeditor.sh # echo 'export EDITOR="vim"' >> /etc/profile.d/vimeditor.sh

Instructions for using VIM

New to VIM? Want to learn all about the Vim commands and editor? No need to search the Internet or buy books about studying. VIM comes with full instructions from start to finish. All you have to do is type the following command at shell prompt: 

$ vimtutor

The optional [language] argument is a 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/

Then type:

$ vimtutor es $ vimtutor lv $ vimtutor tr $ vimtutor it

Install VIM Plugin

First we have to look for vim related packages and plugins as follows:

$ sudo zypper search vim

Assuming you want to install support for Ruby on Rails, use the command:

$ sudo zypper install vim-plugin-rails

Conclude

Vi is the first real screen-based editor for UNIX, and is still very popular among systems and developers. VIM improves vi by adding new features, more windows, undo multiple levels, highlight blocks, etc.

4.3 ★ | 3 Vote