Tagbar - fairulazmin/note GitHub Wiki

Install tagbar

Add plugin

open the ~/.vim/vim-plug/plugins.vim and ~/.config/nvim/vim-plug/plugins.vim file via nvim/vim and add the following code:

call plug#begin('~/.vim/autoload/plugged')
  ...
  ...
  ...
  " Plugin for tagbar
  Plug 'majutsushi/tagbar'
call plug#end()

Install the plugin

Vim / Neovim

Open Vim

vim

Open Neovim

nvim

Install the plugins

:PlugInstall

Create plug config file

Vim

Create tagbar.vim file

touch ~/.vim/vim-plug/tagbar.vim

Neovim

Create a tagbar.vim file

touch ~/.config/nvim/vim-plug/tagbar.vim

Add settings

open the ~/.vim/vim-plug/tagbar.vim or ~/.config/nvim/vim-plug/tagbar.vim file via vim and add the following code:

nmap <F8> :TagbarToggle<CR>

Source the plugins

Vim

Add the following line to .vimrc

source $HOME/.vim/vim-plug/tagbar.vim

Neovim

Add the following line to init.vim

source $HOME/.config/nvim/vim-plug/tagbar.vim

Install Ctags

Open terminal and run following code

sudo apt-get install exuberant-ctags