dhruvasagar / vim-zoom

Toggle zoom in / out individual windows (splits)
239 stars 15 forks source link

Showcmd of Control-Modified Keys Changes After Intalling vim-zoom #27

Closed austinliuigi closed 1 year ago

austinliuigi commented 2 years ago

After installing vim-zoom, when pressing control-modified keys (e.g. \ or \), showcmd shows an unusual sequence.

The expected behavior is for showcmd to show ^ as the control key, but with vim-zoom installed it shows <80>ü^

Without vim-zoom installed:

image

With vim-zoom installed

image
dhruvasagar commented 2 years ago

@austinliuigi Is this just by installing vim-zoom or are you zoomed in / out ?

austinliuigi commented 2 years ago

@dhruvasagar Yeah just by installing vim-zoom. Not zoomed in or out.

austinliuigi commented 2 years ago

It's no issue with the functionality, just an eye sore, really.

schnz commented 1 year ago

It's because of the nmap definition in zoom.vim:

  nmap <C-W>m <Plug>(zoom-toggle)

The literal <C-W> causes this wired representation of the keysequence when showcmd is set. Also see https://vi.stackexchange.com/questions/6088/using-c-causes-80%C3%BCd-to-flash-in-the-showcmd-area . There is a helpful comment from Mamrezo:

In insert mode, try this: Hit <C-V> and then <C-,> this will insert the sequence of keys Vim tracked from Shell

When using the suggested trick, it is possible to declare the nmap as follows:

" Do not copy & paste the line below! The ^W sequence is the representation of the ETB char (ASCII Code 0x17)
nmap ^Wm <Plug>(zoom-toggle)

Notice how <C-W> becomes ^W. With this definition, the statusbar correctly shows ^W without flashing <80>ü^.

dhruvasagar commented 1 year ago

As of now I am going to ignore this. It's more to do with vim and vim-zoom.