I use the following setting for automatic line number toggle.
augroup numbertoggle autocmd! autocmd BufEnter,FocusGained,InsertLeave * set relativenumber autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber augroup END
But it seems that this setting does not work inside tmux. If I open two tmux panes side by side and open a file with Neovim in one pane and then switch to another tmux pane, the relative line number in Neovim does not change to absolute number. How to fix this issue?
Besides, I use
set -g mouse on inside
~/.tmux.conf so that I can use mouse clicks to change tmux panes, if that information is relevant.