drmikehenry / vim-fixkey

https://github.com/drmikehenry/
125 stars 10 forks source link

Neovim compatibility #8

Closed HaleTom closed 6 years ago

HaleTom commented 6 years ago
Error detected while processing function Fixkey_setTmuxKeys[2]..Fixkey_setScreenCompatibleKeys[1]..Fixkey_setMetaLetters[4]..Fixkey_setKey:
line    1:
E518: Unknown option: <M-a>=^[a
Error detected while processing function Fixkey_setTmuxKeys[2]..Fixkey_setScreenCompatibleKeys[1]..Fixkey_setMetaLetters[7]..Fixkey_setKey:
line    1:
E518: Unknown option: <M-A>=^[A
Error detected while processing function Fixkey_setTmuxKeys[2]..Fixkey_setScreenCompatibleKeys[1]..Fixkey_setMetaLetters[4]..Fixkey_setKey:
line    1:
E518: Unknown option: <M-b>=^[b
Error detected while processing function Fixkey_setTmuxKeys[2]..Fixkey_setScreenCompatibleKeys[1]..Fixkey_setMetaLetters[7]..Fixkey_setKey:
line    1:
E518: Unknown option: <M-B>=^[B

...

Error detected while processing function Fixkey_setTmuxKeys[2]..Fixkey_setScreenCompatibleKeys[1]..Fixkey_setMetaLetters[4]..Fixkey_setKey:
line    1:
E518: Unknown option: <M-y>=^[y
Error detected while processing function Fixkey_setTmuxKeys[2]..Fixkey_setScreenCompatibleKeys[1]..Fixkey_setMetaLetters[7]..Fixkey_setKey:
line    1:
E518: Unknown option: <M-Y>=^[Y
Error detected while processing function Fixkey_setTmuxKeys[2]..Fixkey_setScreenCompatibleKeys[1]..Fixkey_setMetaLetters[4]..Fixkey_setKey:
line    1:
E518: Unknown option: <M-z>=^[z
Error detected while processing function Fixkey_setTmuxKeys[2]..Fixkey_setScreenCompatibleKeys[1]..Fixkey_setMetaLetters[7]..Fixkey_setKey:
line    1:
E518: Unknown option: <M-Z>=^[Z
Error detected while processing function Fixkey_setTmuxKeys[2]..Fixkey_setScreenCompatibleKeys[7]..Fixkey_setKey:
line    1:
E518: Unknown option: <M-Enter>=^[^M
Error detected while processing /home/ravi/.local/share/vim/bundle/vim-fixkey/plugin/fixkey.vim:
line  610:
E518: Unknown option: ttymouse=xterm
Press ENTER or type command to continue

The ttymouse issue at the end seems to be resolvable by using:

if !has('nvim')
  set ttymouse=xterm2
endif

I'm not sure about the mapping issues though.

HaleTom commented 6 years ago

For now, I'm doing the analogous to not load the plugin:

" Exclude bundles which don't work in Neovim
if !has('nvim')
  " Fixkey - fixes meta / alt key codes for console Vim
  NeoBundle 'drmikehenry/vim-fixkey' " https://github.com/drmikehenry/vim-fixkey
endif
drmikehenry commented 6 years ago

I don't run Neovim, but I thought it natively supports mapping alt keys in the terminal, making vim-fixkey unnecessary. See, for instance, the Neovim help at {{help t_xx}} (on this page: https://neovim.io/doc/user/vim_diff.html). Your fix to skip loading of vim-fixkey seems like the right idea to me when running on Neovim.

HaleTom commented 6 years ago

Excellent, thanks!

rysson commented 5 years ago

making vim-fixkey unnecessary

@drmikehenry, Could you add neovim detection inside plugin (and skip in that case)? It will be useful in shared (vim & neovim) configuration for new users and/or new installations.

drmikehenry commented 5 years ago

Fixkey version 0.3.11 adds a check for has('nvim') and silently skips its initialization if Neovim is detected. Thanks to @rysson for testing this on Neovim.