Screen command disable the control key ctrl-a to use it in vim?

ε祈祈猫儿з 提交于 2019-12-02 13:33:09

问题


I sometimes open vim with screen linux command but since ctrl-a is considered as control key I cannot increment numbers using the same combination inside the editor.

I don't want to remap entirly ctrl-a but is there a way to disable it so I can use it in vim ?


回答1:


In screen, you can pass on the prefix key via Ctrl-A followed by a (cp. here). In tmux, this would be Ctrl-b Ctrl-b. Either can be adapted in the tool's configuration file.

Alternatively, you could remap the increment inside Vim, e.g. by putting the following into your ~/.vimrc:

noremap <C-q> <C-a>



回答2:


You can remap screen to use a different escape if you want. I use Ctrlt.

In .screenrc:

escape ^Tt

This will map the screen metacharacter to Ctrlt. And it also maps the literal sequence of Ctrlt + t to send a Ctrl-t through to the application running inside screen.

This would free Ctrla so screen will not be using it, and it will be passed through to Vim.



来源:https://stackoverflow.com/questions/42136436/screen-command-disable-the-control-key-ctrl-a-to-use-it-in-vim

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!