TMUX and vim - missing tmux-256color terminfo

This is a quick bit of notes for anyone out there searching for info on how to fix an issue with vim not being able to find the tmux-256color terminal profile (terminfo) under Ubuntu 18.04 and possibly later. Many posts on the internet recommend using screen-256color, but this isn't necessary. Here's what I did.

  1. Add an alias under .bash-aliases to run tmux in 256 color mode:

    alias tmux="tmux -2"

  2. Add the following config to tmux:

    set -g default-terminal "tmux-256color"

    set -g terminal-overrides "*:colors=256" # force 256 colors

  3. The crucial bit: install ncurses-term to give you the terminfo profiles for tmux-256color:

    sudo apt install ncurses-term

Et voila! You now have a working tmux and vim session with 256 colors. Go wild with the possibilities.

Hope this helps!