Skip to content

vim

Vim and Neovim setup: vimtex with Zathura, Neo-tree, packer.nvim and vim-plug.

1 min read

References

vimtex + Zathura

Terminal window
brew install macvim
brew tap zegervdv/zathura
brew install zathura --with-synctex
brew install zathura-pdf-poppler

Make sure to follow the zathura-pdf-poppler caveat about symlinking it to zathura’s plugin directory.

Terminal window
brew install mactex-no-gui

Install vim-plug. Add the call plug#begin(~/.vim/plugged') and call plug#end() lines to your .vimrc as recommended in the README.

Install VimTeX using vim-plug as your plugin manager. Check out my .vimrc code below.

Reload .vimrc and run :PlugInstall in vim to perform installation

Terminal window
" https://github.com/junegunn/vim-plug
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'lervag/vimtex'
let g:tex_flavor='latex'
let g:vimtex_view_method='zathura'
let g:vimtex_quickfix_mode=0
" these two lines are for a separate plugin I use: https://github.com/KeitaNakamura/tex-conceal.vim
set conceallevel=1
let g:tex_conceal='abdmg'
" Initialize plugin system
call plug#end()

neovim, Neo-tree.nvim

Install neovim:

Terminal window
brew install neovim

Using packer.nvim

Install packager:

Terminal window
git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim

Add Neo-tree to your configuration:

Open your Neovim config file (usually located at ~/.config/nvim/init.lua for Lua):

require('packer').startup(function()
use {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
requires = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- optional, for file icons
"MunifTanjim/nui.nvim",
}
}
end)

Install the plugin:

Terminal window
:PackerSync

Configure Neo-tree:

require("neo-tree").setup({
-- your configuration here
})

Using vim-plug

Install vim-plug:

Terminal window
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Add Neo-tree to your configuration:

Open your Neovim config file (usually located at ~/.config/nvim/init.vim for vimscript or init.lua for Lua).

call plug#begin('~/.local/share/nvim/plugged')
Plug 'nvim-neo-tree/neo-tree.nvim', { 'branch': 'v3.x' }
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-tree/nvim-web-devicons' " optional, for file icons
Plug 'MunifTanjim/nui.nvim'
call plug#end()

Install the plugin:

Terminal window
:PlugInstall

Configure Neo-tree:

require("neo-tree").setup({
-- your configuration here
})

Using Neo-tree

Terminal window
:Neotree toggle

Related articles

1 min read

ngrok

Exposing a local server to the internet with ngrok tunnels for testing and demos.

  • Developer Tools
1 min read

NetBeans

Building NetBeans from source, cleaning the Recent Projects list and choosing the JDK it runs on.

  • Developer Tools
1 min read

Sonar

Static code analysis with SonarQube and SonarCloud from Maven builds.

  • Observability & Testing
  • Developer Tools

Type to search the whole site.