As you may know, it can't enable an undercurl on any English word mispelled on iTerm2 with Neovim even if setting t_Cs and t_Ce.
This shared information are based on the dotfile from Takuya Matsuyama setting and zsh on your SHELL configuration.
First thing first, export your TERM on your ~/.zshrc. Source your .zshrc is necessary.
export TERM="xterm-256color"
[[ -n $TMUX ]] && export TERM="screen-256color"
Your .vimrc or init.lua need to add these two options
vim.opt.spell = true
vim.opt.spelllang = { 'en_us' }
Next, add Smulx=\E[4:%p1%dm, to your TERM.
For example smul=\E[4m, Smulx=\E[4:%p1%dm, tbc=\E[3g, tbc=\E[3g, ...
infocmp > /tmp/${TERM}.ti
Add Smulx=\E[4\:%p1%dm, after smul=\E[4m,
tic -x /tmp/${TERM}.ti
Then edit any file you prefer. This example uses base.lua file. _vim ~/.config/nvim/lua/user/base.lua
Move to tmux, your tmux session should inherit the TERM from .zshrc setting by switching to use screen-256color instead of xterm-256color. Performing the same process of TERM reconfiguration.
infocmp > /tmp/${TERM}.ti
Add Smulx=\E[4\:%p1%dm, after smul=\E[4m,
tic -x /tmp/${TERM}.ti
You can recheck your TERMINFO using the additional setting.
infocmp -l -x | grep Smulx
vpa=\E[%i%p1%dd, Smulx=\E[4\:%p1%dm,
Your tmux session can also display the undercurl line of each misspelled word.
Top comments (0)