NERDBUDE

[ code. keyboards. terminals. cyber. ]

[HOWTO] [WHOAMI] [PODCAST] [FRANKENSWITCHES] [GERMAN]

VIM IV



PLUGINS

So we have checked off the basic functions such as writing, marking, deleting, copying, pasting, etc. in the first three parts, i.e. basically we can work with Vim.
However, Vim offers more (as with everything). What if we want syntax highlighting, the folder structure, maybe a fancier status line etc? There are plugins for that and for the CULT OF VIM provides numerous plugins that greatly extend Vim's functionality.
.
But before I come to the plugins themselves, briefly to the question of how plugins are used in Vim.
There are several plugin managers for Vim. The best known are the following:

  Pathogen
  Vim Packages
  Vundle
  Neobundle
  vim-plug
  dein.vim

Which one you use is of course up to you. I use PATHOGEN here and am very satisfied with it.
To install PATHOGEN two simple terminal commands and a modification of the .VIMRC config file are enough (I will talk about this in another part):

TERMINAL
  mkdir -p ~/.vim/autoload ~/.vim/bundle && \
  curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

The following line is added to the .VIMRC file and then Pathogen is ready for use:

.VIMRC
  execute pathogen#infect()

Once these three steps are done, you can start installing plugins. Most plugins support the use via Pathogen and this makes it quite easy to add plugins to Vim. This brings up the next question, "Where do I find plugins?". On the one hand, you can of course browse Github, Gitlab and similar collections. However, this can get annoying quickly in some circumstances and costs a lot of time. Fortunately, there is VIMAWESOME. VIMAWESOME is a collection of Vim plugins wonderfully categorized and presented in a manageable way.

Now when you have found a plugin you want to use the installation via Pathogen is done quickly (here using NERDtree as an example):

.VIMRC
  cd ~/.vim/bundle
  git clone https://github.com/scrooloose/nerdtree


Done! Now the filetree can be shown in Vim with the command ":NERDtree" which is entered in the NORMAL mode. If we want now, that NERDtree is started from the beginning, must still another entry into the .VIMRC Configfile:

  let g:NERDtree


Now we have created the basis for plugins. In the following a few more plugins that I have installed and which I can recommend at the current time without reservation.

FUNKY PLUGINS


vim-startify




Vim-startify provides a beautiful splash screen when Vim is started without specifying files, and is useful if you have files that are frequently edited (configs) and you want quick access to them without typing the path to the file each time. Vim-startify has the possibility to show a list of recently opened files but also static links to files that are frequently used.
. But - and the eye hacks along - also the possibility to display a simple ASCII-style graphic (for me the simple "HACK!"). Saves a lot writing and looks on top of it still chic.

vimwiki




I've already written about VimWiki here (VIMWIKI). A small local wiki we use to keep our notes, project data, tasks and anything else the imagination can come up with. In other words, everything a knowledgebase needs. The pages are styled via markdown and help wonderfully to keep the jumbled thoughts at least sorted.


lighline




The status bar of Vim is quite simple and basic. Unfortunately also a bit boring. Fortunately there is Lightline. It replaces the standard status bar of Vim with a nicer one. Lightline supports many themes and color schemes. So if you want to have it a bit more colorful, use Lightline.


colorizer




I often have to deal with HTML color codes. It is practical if these are displayed immediately in Vim or in the code file. Grade when it comes to the NERDBUDE files or if you Colorschemes for your system zusammenschraub quite handy.
.

NERDtree




NERDtree, which was used as an example earlier, provides a filetree that can be displayed on the left or right side of Vim. So you don't have to leave your Vim instance if you want to open other files comfortably.

Have fun with plugins!

//EOF