Bugging me for a long time

4 views
Skip to first unread message

Kevin

unread,
Nov 11, 2008, 9:24:15 PM11/11/08
to vim_use
I have a mapping:

" set vim to give me page down on spacebar
nmap <Space> <C-F>


Now, how do I get Shift-space to give me <C-B> ? I've tried a whole
bunch of them, and they dont seem to work...

bill lam

unread,
Nov 11, 2008, 9:36:06 PM11/11/08
to vim...@googlegroups.com

Does your terminal (emulator) give different key sequences for space
and shift space? AFAICS xterm can not distinguish between tab and
shift tab.

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩152 白居易 賦得古原草送別
離離原上草 一歲一枯榮 野火燒不盡 春風吹又生
遠芳侵古道 晴翠接荒城 又送王孫去 萋萋滿別情

Gary Johnson

unread,
Nov 11, 2008, 9:44:13 PM11/11/08
to vim...@googlegroups.com

Are you using vim or gvim?

In gvim running on a Red Hat Linux system, I can enter insert mode,
type Ctrl-K, then hold the Shift key while hitting the space bar and
see this

<S-Space>

I can then execute this mapping,

:namp <S-Space> <C-B>

and it works just fine.

In vim running in an xterm, however, the Ctrl-K Shift-Space sequence
shows nothing. Further, while in insert mode, typing Ctrl-V
followed by a space with the Shift key held down just inserts a
space. This demonstrates that xterm doesn't produce a special
character sequence for the Shift-Space combination, so there's no
way to use that key combination for a map or anything else.

HTH,
Gary

Kevin

unread,
Nov 11, 2008, 10:11:34 PM11/11/08
to vim_use
Well how about that! I had no idea that was why it was not working!

I rarely use gvim, it takes me too far from the shell, I'm using vim
in the terminal. Thanks!

On Nov 11, 9:44 pm, Gary Johnson <garyj...@spk.agilent.com> wrote:

dickey

unread,
Nov 13, 2008, 7:14:38 AM11/13/08
to vim_use
On Nov 11, 9:36 pm, bill lam <cbill....@gmail.com> wrote:
> Does your terminal (emulator) give different key sequences for space
> and shift space?  AFAICS xterm can not distinguish between tab and
> shift tab.

It's been in xterm a while:

http://invisible-island.net/xterm/xterm.log.html#xterm_47

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

bill lam

unread,
Nov 13, 2008, 8:52:57 AM11/13/08
to vim...@googlegroups.com
On Thu, 13 Nov 2008, dickey wrote:

>
> On Nov 11, 9:36 pm, bill lam <cbill....@gmail.com> wrote:
> > Does your terminal (emulator) give different key sequences for space
> > and shift space?  AFAICS xterm can not distinguish between tab and
> > shift tab.
>
> It's been in xterm a while:
>
> http://invisible-island.net/xterm/xterm.log.html#xterm_47

I use ubuntu and xterm -version gave XTerm(235). But shift tab does
not work in vim and mutt, Does it require other setting to make it
work?

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

唐詩269 李白 下江陵
朝辭白帝彩雲間 千里江陵一日還 兩岸猿聲啼不住 輕舟已過萬重山

dickey

unread,
Nov 14, 2008, 1:23:06 PM11/14/08
to vim_use
On Nov 13, 8:52 am, bill lam <cbill....@gmail.com> wrote:
> On Thu, 13 Nov 2008, dickey wrote:
>
> > On Nov 11, 9:36 pm, bill lam <cbill....@gmail.com> wrote:
> > > Does your terminal (emulator) give different key sequences for space
> > > and shift space?  AFAICS xterm can not distinguish between tab and
> > > shift tab.
>
> > It's been in xterm a while:
>
> >http://invisible-island.net/xterm/xterm.log.html#xterm_47
>
> I use ubuntu and xterm -version gave XTerm(235). But shift tab does
> not work in vim and mutt, Does it require other setting to make it
> work?

it shouldn't require other settings (since it's built-in)
But a few of the things that can go wrong:
(a) override of the translations resource can interfere with the built-
in definitions (packagers sometimes do this)
(b) vim and mutt use the terminfo data (which should define the kcbt
value, viewable with infocmp).
If it were only vim, I'd point out that vim has an internal set of
data for terminals.
mutt could be using slang (and pointing to a termcap...) or
ncurses.
(c) some packagers have local patches to the terminal database (and
introduce problems).

bill lam

unread,
Nov 16, 2008, 1:02:56 AM11/16/08
to vim...@googlegroups.com
On Fri, 14 Nov 2008, dickey wrote:
> it shouldn't require other settings (since it's built-in)
> But a few of the things that can go wrong:
> (a) override of the translations resource can interfere with the built-
> in definitions (packagers sometimes do this)
> (b) vim and mutt use the terminfo data (which should define the kcbt
> value, viewable with infocmp).
> If it were only vim, I'd point out that vim has an internal set of
> data for terminals.
> mutt could be using slang (and pointing to a termcap...) or
> ncurses.
> (c) some packagers have local patches to the terminal database (and
> introduce problems).

I can confirmed that bash and wyrd running on xterm can distinguish


between tab and shift tab.

--

regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

唐詩191 杜甫 詠懷古跡五首之二
搖落深知宋玉悲 風流儒雅亦吾師 悵望千秋一灑淚 蕭條異代不同時
江山故宅空文藻 雲雨荒臺豈夢思 最是楚宮俱泯滅 舟人指點到今疑

dickey

unread,
Nov 16, 2008, 11:12:11 AM11/16/08
to vim_use
On Nov 16, 1:02 am, bill lam <cbill....@gmail.com> wrote:
> On Fri, 14 Nov 2008, dickey wrote:
> > it shouldn't require other settings (since it's built-in)
> > But a few of the things that can go wrong:
...
> I can confirmed that bash and wyrd running on xterm can distinguish
> between tab and shift tab.

Then the problem with vim and mutt is (at least) not in xterm's
resource-settings.
I'd check the terminal description first, looking at the output from
infocmp.
It should have a string for kcbt, e.g., kcbt=\E[Z,

bill lam

unread,
Nov 18, 2008, 2:45:18 AM11/18/08
to vim...@googlegroups.com
On Sun, 16 Nov 2008, dickey wrote:

>
> On Nov 16, 1:02 am, bill lam <cbill....@gmail.com> wrote:
> > On Fri, 14 Nov 2008, dickey wrote:
> > > it shouldn't require other settings (since it's built-in)
> > > But a few of the things that can go wrong:
> ...
> > I can confirmed that bash and wyrd running on xterm can distinguish
> > between tab and shift tab.
>
> Then the problem with vim and mutt is (at least) not in xterm's
> resource-settings.
> I'd check the terminal description first, looking at the output from
> infocmp.
> It should have a string for kcbt, e.g., kcbt=\E[Z,

Thank you for help. It turned out I export $TERMCAP in .bashrc for
vi (old vi) that did not include in backtab entry. Now all work well.

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

唐詩224 王維 鹿柴
空山不見人 但聞人語響 返景入深林 復照青苔上

Reply all
Reply to author
Forward
0 new messages