Cursor - g6ai/dotfiles GitHub Wiki
Cursor settings for
- Bash, Zsh
- tmux
- Vim, Neovim
in different terminal emulators.
Bash
See inputrc, the vi mode string section. Both cursor settings in normal Bash session and tmux session are discussed there.
Zsh
Cursor in Zsh are managed by a Zsh plugin Zsh Vi Mode. The Zsh plugins are managed by Oh My Zsh.
tmux
From tmux manual, TERMINFO_EXTENSIONS section:
Ss, Se Set or reset the cursor style. If set, a sequence such as this may be used to change the cursor to an underline:
$ printf '\033[4 q'
If Se is not set, Ss with argument 0 will be used to reset the cursor style instead.
So this line is usually added to tmux.conf
:
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[5 q'
n.b. per this tmux issue comment:
Try \033 or \E instead of \e in terminal-overrides, I don't think we support \e.
Relevant tmux issues: https://github.com/tmux/tmux/issues/1557 and https://github.com/tmux/tmux/issues/1416.
Vim
See vimrc, the Cursor setting section.
Neovim
FAQ in Neovim GitHub repo
OfficialMost cursor-relevant issues have already been discussed in the FAQ, here are a selection of most imperative ones:
- Cursor style isn't restored after exiting or suspending and resuming Nvim
- Cursor shape doesn't change in tmux