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:24bind-key -T copy-mode C-k send-keys -X copy-end-of-line, so I suppose it's probably not the cause of the issue.
– Rastapopoulos Oct 13 '17 at 15:56C-k. You can check this by executing::verb ino <c-k>. If such a mapping exists, the file location from which it was sourced should be printed. This link might also help you: https://vi.stackexchange.com/a/7723/13370 – user852573 Oct 13 '17 at 17:38:verb ino <c-k>in a buffer whereC-kdoesn'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:05mailbuffer (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^Kinside your buffer. If you don't see anything, it means something is consumingC-kbefore Vim. – user852573 Oct 14 '17 at 10:17C-v C-kand 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.confand it didn't work).The problematic line in my .tmux.conf was this one:
– Rastapopoulos Oct 14 '17 at 10:36is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim)(diff)?$"'. Adding|muttin the regular expression fixed it. Thanks again for your time and for your help!