I configured mutt to use vim as an editor to write emails (with set editor=vim
in .muttrc
), and I have noticed that when I am in tmux (with an empty .tmux.conf
), the vim keybinding CTRL-K in insert mode, which is handy to insert digraphs, does not work.
Outside of Tmux && mutt, everything works fine: typing CTRL-K causes the character ?
to temporarily appear under the cursor, and the next two characters I type are correctly interpreted as a digraph.
Does anyone know where the error might be coming from?
Thank you.
C-k
, so Vim doesn't receive it. I'm not sure these shell commands will work for you, because I use an old version, but you could trytmux list-keys
. This should list the keybindings installed in a tmux session. They can be divided into several tables. I suspect the one you should look for is calledroot
, because these keybindings don't need a prefix. To see them, trytmux list-keys -T root
. Look for the wordC-k
. If you find it, and you want to remove it, try to add this to your.tmux.conf
:unbind-key -T root C-k
, then restart tmux. – user852573 Oct 13 '17 at 15:24:verb ino <c-k>
in a buffer whereC-k
doesn't insert digraphs. If a filetype plugin is involved, it would install buffer-local mappings, for example only in a file whose type ismail
. The command will find a global mapping from any buffer, but it will only find a buffer-local one in the right type of buffer. – user852573 Oct 13 '17 at 18:05mail
buffer (example:~/.vim/after/ftplugin/mail.vim
), you could writeino <buffer> <c-g><c-g> <c-k>
. With this mapping, you would insert a digraph by pressingC-g C-g
. Also, you could try to check whether Vim receivesC-k
, by inserting one literally. If you pressC-v C-k
, you should see the caret notation^K
inside your buffer. If you don't see anything, it means something is consumingC-k
before Vim. – user852573 Oct 14 '17 at 10:17C-v C-k
and nothing appears. It turns out that, in fact, the key was received by tmux and not sent to vim, because of mappings I defined in my tmux.conf (which is strange, considering that I was opening withtmux -f empty.conf
and it didn't work). The problematic line in my .tmux.conf was this one:is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim)(diff)?$"'
. Adding|mutt
in the regular expression fixed it. Thanks again for your time and for your help! – Rastapopoulos Oct 14 '17 at 10:36