Home Vim and development tooling
Vim and development tooling
Cancel

Vim and development tooling

Tooling that I use and is documented here for setup and maintenance:

Neovim

Neovim Setup

1
2
3
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
sudo rm -rf /opt/nvim-linux64
sudo tar -C /opt -xzf nvim-linux64.tar.gz

Add this to ~/.bashrc:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
export PATH=$PATH:/opt/nvim-linux64/bin
export EDITOR=nvim

vim () {
    if [[ -z "$@" ]]; then
	SESSION_FILE="Session.vim"
	GIT_BRANCH=""
	if [[ -d ".git" ]]; then
	    GIT_BRANCH=$(git branch --show-current)
	    SESSION_FILE="Session-${GIT_BRANCH}.vim"
	fi
	if [[ -f "$SESSION_FILE" ]]; then
	    nvim -S "$SESSION_FILE" -c "lua vim.g.savesession = true ; vim.g.sessionfile = \"${SESSION_FILE}\""
	else
	    nvim -c "lua vim.g.savesession = true ; vim.g.sessionfile = \"${SESSION_FILE}\""
	fi
    else
    	nvim "$@"
    fi
}

Install:

  • Go
  • pyright
  • ruff
  • prettierd

Add the following config file:

~/.config/nvim/init.lua

Neovim Usage

LSP

  • (Normal) g+r - Goto references
  • (Normal) g+I - Goto implementation
  • (Normal) g+D - Goto declaration
  • (Normal) g+d - Goto definition
  • (Normal) <SPACE>+r+n - Rename

tmux

tmux Setup

1
2
# Debian.
sudo apt install -y tmux
1
2
# Setup tpm.
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

Create the config file:

~/.tmux.conf

Run tmux and then install plugins with CTRL-B + I.

Install powerline fonts: sudo apt install -y fonts-powerline. A reboot or logout/login might be necessary.

tmux Usage

  • CTRL-B + z: Zoom in or out of a pane