Skip to content

Instantly share code, notes, and snippets.

@s3rvac
Created February 24, 2024 14:55
Show Gist options
  • Save s3rvac/0153f0e2722be7372d502922a1c8c754 to your computer and use it in GitHub Desktop.
Save s3rvac/0153f0e2722be7372d502922a1c8c754 to your computer and use it in GitHub Desktop.
Undercurl in Neovim running in Tmux and Konsole

Undercurl in Neovim running in Tmux and Konsole

A HOWTO for getting undercurl support in Neovim running in Tmux and Konsole.

Konsole

You need to be running Konsole v22.11.80 or newer (undercurl support was introduced in this commit on 2022-08-26).

Tmux

Add the following settings to your TMux configuration file (e.g. ~/.tmux.conf):

set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'

To see whether it works, run printf "\e[4:3mhello world\e[0m\n" in your shell (tested on Bash 5.2). You should see the sentence "hello world" underlined with a wavy line.

Neovim

Ensure that you are running a sufficiently new version of Neovim (undercurl support for Konsole was added in this PR on 2022-09-16).

To see whether it works, try e.g. enabling spell checking (:set spell) and ensure that your colorscheme uses undercurl for spelling errors (e.g. hi SpellBad cterm=undercurl).

@s3rvac
Copy link
Author

s3rvac commented Feb 24, 2024

Here is an example of how it looks in my colorscheme:

undercurl-konsole-tmux-nvim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment