dvtm icon indicating copy to clipboard operation
dvtm copied to clipboard

Issue with using with vim

Open tnguyen14 opened this issue 9 years ago • 3 comments

I am running into an issue with using dvtm with vim. When I open vim from a dvtm window, I could move to the right pane <Ctrl-L>, but not move back to the left pane <Ctrl-h>.

Here is my vim mapping for this action https://github.com/tnguyen14/dotfiles/blob/master/home/.vimrc#L126

I could still do the default command <Ctrl-w><Ctrl-l> and <Ctrl-w><Ctrl-h>, just not the remapped keys.

Does anyone have any suggestion?

tnguyen14 avatar Jan 28 '16 15:01 tnguyen14

The problem is that vim can not distinguish between <Ctrl-H> and Backspace the former gets translated to the latter somewhere down the line. This is some of the darker corners of terminal input handling for which I currently have neither the time nor the motivation to look into.

noremap <BS> <C-W><C-H> would give you the desired behavior (at the cost of a broken Backspace key).

The first thing to look into would be what dvtm actually receives from curses. Whether Ctrl-H is already translated to KEY_BACKSPACE at this stage or not. The next step would be what dvtm actually sends to the underlying application, at first glance it looks like DEL (see also the FAQ entry from st). Then the journey would take use to vim and how it interprets it etc ...

martanne avatar Jan 28 '16 16:01 martanne

Thanks for the explanation @martanne.

How should I go about investigating what Ctrl-H is actually translated to?

tnguyen14 avatar Jan 28 '16 21:01 tnguyen14

You might be able to salvage this stuff to get whatever you are working on working:

https://github.com/dpzmick/dvtm/blob/master/vim_navigate.c + some other changes to dvtm https://github.com/dpzmick/vim-dvtm-navigator

dpzmick avatar Apr 07 '16 20:04 dpzmick