Sunday, May 18, 2014

Re: short cut in vim over ssh connection

On 05/16/2014 04:01 PM, Tim Chase wrote:
> On 2014-05-15 20:21, max tzeng wrote:
>> I uses xshell or putty to connect to ubuntu server.
>> When using vim over terminal, there are some short cut which i made
>> doesn't work . EX: ctrl+ FN# or Shift+FN#
>> But it works if using gvim in xwindow .
>>
>> Besides, if log in in ubuntu and operate in terminator.
>> The short cut is work as i expect.
>>
>> Does anyone have idea about this problem ?
>
> While I'm not familiar with xshell, I suspect that the issue may be
> how your terminal is sending those codes over the wire to your server.
>
> In Putty's options, I see under Terminal→Keyboard that it has options
> for how the FN keys get transmitted. I'd play with those settings
> and make sure that they match the settings expected by Vim in your
> terminal. You can go into insert mode, hit control+V and then press
> control+FN or shift+FN and see what Vim thinks your terminal client
> is sending to compare.

Getting special keys working in console Vim can be a chore. To
help with that, I've written fixkey, a plugin that knows about
some common terminal emulators and helps configure Vim for them.
You can find the plugin at vim.org and github.com:

http://www.vim.org/scripts/script.php?script_id=4693
https://github.com/drmikehenry/vim-fixkey/

The fixkey documentation provides instructions for installing
the plugin and for configuring PuTTY; see section 3.5 ("Setup
PuTTY") on this page:
https://github.com/drmikehenry/vim-fixkey/blob/master/doc/fixkey.txt

Fixkey supports two ways of configuring PuTTY. By default,
PuTTY sets the TERM environment variable to masquerade as xterm,
despite having many key definitions that are different from
xterm. In addition, there are a good many keys that are
inoperable entirely or indistinguishable from other keys. For
example, Control-Home doesn't send any codes at all, and Control
F1-F12 send the same codes as F1-F12. Fixkey supports this
configuration as long as you configure PuTTY to stop
masquerading as xterm by setting TERM to "putty" or
"putty-256color".

Alternatively, you might prefer to use PuTTY's SCO keymap.
Though there are still inoperable and indistinguishable codes,
Control-F1 through Control-F12 are usable in this configuration
(although the delete key is aliased with Backspace). To use
this option, TERM must be set to "putty-sco", and PuTTY must be
configured for the SCO keymap.

I don't often use PuTTY (and particularly the SCO keymap).
While composing this reply, I noticed that fixkey 0.3.2 did not
correctly setup F1 through F12 in the "putty-sco" configuration,
so if you want to try that mode, make sure you have at least
version 0.3.3 of fixkey.

Michael Henry

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: