Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta mappings not working when $TERM is not xterm #25

Open
pablox-cl opened this issue Dec 29, 2014 · 2 comments
Open

Meta mappings not working when $TERM is not xterm #25

pablox-cl opened this issue Dec 29, 2014 · 2 comments

Comments

@pablox-cl
Copy link

While I see vim-rsi is correctly mapping <M-d>:

:verbose imap <m-d>
i  ä           * <C-O>dw
        Last set from ~/.vim/.cache/neobundle/vim-rsi/plugin/rsi.vim

My $TERM/terminfo(?), prints ALT + D as ^]d, unsurprisingly typing the ä, results in the desired command. When running vim from an xterm, it correctly(?), maps ALT + D as ä.

It seems every other terminal emulator (rxvt, and almost everyone [if not all] based on the vte gtk widget) maps ALT + D as ^]d. Though, setting <M-d> as <esc>d, partially solves the problem:

execute "set <M-d>=\ed"
" I tried using \<Esc>, but it's too fast(?) and exists insert mode and let you in operator pending after inserting a `d`.

If I understand correctly, problem with that is that you use <M-d> fast enough (below ttimeoutlen?) the command gets executed as two: ^[, and d and you get out of insert mode and d is inserted in normal mode.

Anyway, I think a plausible workaround could be checking the term, and in case is not xterm, run that line. If you are interested I can do a PR.

@justinmk
Copy link
Contributor

Did you try withvim -u NONE -N -c 'set rtp +=path/to/vim-rsi' -c 'runtime plugin/rsi.vim' ?

@pablox-cl
Copy link
Author

Yep, it results in the same behaviour, why it could be useful?

Anyway, I still find this solution a bit erratic :/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants