How To Install vim-gitgutter on CentOS 8

vim-gitgutter is Shows a git diff in the gutter and stages/undoes hunks and partial hunks

Introduction

In this tutorial we learn how to install vim-gitgutter on CentOS 8.

What is vim-gitgutter

A Vim plugin which shows a git diff in the ‘gutter’ (sign column). It shows which lines have been added, modified, or removed. You can also preview, stage, and undo individual hunks; and stage partial hunks. The plugin also provides a hunk text object. The signs are always up to date and the plugin never saves your buffer.

We can use yum or dnf to install vim-gitgutter on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install vim-gitgutter.

Install vim-gitgutter on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install vim-gitgutter using dnf by running the following command:

sudo dnf -y install vim-gitgutter

Install vim-gitgutter on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install vim-gitgutter using yum by running the following command:

sudo yum -y install vim-gitgutter

How To Uninstall vim-gitgutter on CentOS 8

To uninstall only the vim-gitgutter package we can use the following command:

sudo dnf remove vim-gitgutter

vim-gitgutter Package Contents on CentOS 8

/usr/share/doc/vim-gitgutter
/usr/share/doc/vim-gitgutter/README.mkd
/usr/share/doc/vim-gitgutter/gitgutter.txt
/usr/share/doc/vim-gitgutter/test
/usr/share/doc/vim-gitgutter/test/cp932.txt
/usr/share/doc/vim-gitgutter/test/fixture.txt
/usr/share/doc/vim-gitgutter/test/fixture_dos.txt
/usr/share/doc/vim-gitgutter/test/runner.vim
/usr/share/doc/vim-gitgutter/test/test
/usr/share/doc/vim-gitgutter/test/test_gitgutter.vim
/usr/share/licenses/vim-gitgutter
/usr/share/licenses/vim-gitgutter/LICENCE
/usr/share/metainfo/vim-gitgutter.metainfo.xml
/usr/share/vim/vimfiles/autoload/gitgutter
/usr/share/vim/vimfiles/autoload/gitgutter.vim
/usr/share/vim/vimfiles/autoload/gitgutter/async.vim
/usr/share/vim/vimfiles/autoload/gitgutter/debug.vim
/usr/share/vim/vimfiles/autoload/gitgutter/diff.vim
/usr/share/vim/vimfiles/autoload/gitgutter/diff_highlight.vim
/usr/share/vim/vimfiles/autoload/gitgutter/fold.vim
/usr/share/vim/vimfiles/autoload/gitgutter/highlight.vim
/usr/share/vim/vimfiles/autoload/gitgutter/hunk.vim
/usr/share/vim/vimfiles/autoload/gitgutter/sign.vim
/usr/share/vim/vimfiles/autoload/gitgutter/utility.vim
/usr/share/vim/vimfiles/plugin/gitgutter.vim
/usr/share/vim/vimfiles/unplace.vim

References

Summary

In this tutorial we learn how to install vim-gitgutter on CentOS 8 using yum and dnf.