How to stop Ctrl-H and Ctrl-[ from generating Backspace and Escape

  • Thread starter Thread starter Dubious Dude
  • Start date Start date
D

Dubious Dude

Hello,

I use the gvim editor, available for Windows. I am using Windows
2000, service pack 4. One of the things that speeds up the usage of
gvim is the use of Ctrl-H for Backspace, and Ctrl-[ for Escape. This
is because your fingers never leave the home row on the keyboard.
Backspace & Escape are two of the most frequently used keys in gvim.
However, after quite a long time of using Ctrl-H and Ctrl-[, and
insidious problem arises -- repetitive stress syndrom. Before, when
one moves ones hands around to hit the Escape and Backspace keys, it
had the benefit of giving one's hand a break. I'm trying to revert
back to doing that, but it seems impossible because using Ctrl-H and
Ctrl-[ have become so automatic. Imagine someone telling you to type
text from now on, using some weird key for the letter "a" and "e"; it
would be impossible to do unless you actually prevent the "a" and "e"
key from generating the letters "a" and "e". I want to do something
similar -- namely, prevent Ctrl-H and Ctrl-[ from generating Backspace
and Escape characers. However, I still want the Backspace key and
Escape key to generate those characters. Is there a way to do this on
Windows 2000? I've already asked on the newsgroup for gvim, but no
suggestions so far for Windows. Thanks.
 
Assign to an unused command as a macro? See excerpt from documentation
below.

You can use the map command from vi (typically in your EXINIT) with a
command of the form:
:map lhs rhsCR

mapping lhs into rhs. There are restrictions: lhs should be one
keystroke (either 1 character or one function key) since it must be
entered within one second (unless notimeout is set, in which case you
can type it as slowly as you wish, and vi will wait for you to finish it
before it echoes anything). The lhs can be no longer than 10 characters,
the rhs no longer than 100. To get a space, tab or newline into lhs or
rhs you should escape them with a ^V. (It may be necessary to double the
^V if the map command is given inside vi, rather than in ex.) Spaces and
tabs inside the rhs need not be escaped
 
Bob said:
Assign to an unused command as a macro? See excerpt from documentation
below.

You can use the map command from vi (typically in your EXINIT) with a
command of the form:
:map lhs rhsCR

mapping lhs into rhs. There are restrictions: lhs should be one
keystroke (either 1 character or one function key) since it must be
entered within one second (unless notimeout is set, in which case you
can type it as slowly as you wish, and vi will wait for you to finish it
before it echoes anything). The lhs can be no longer than 10 characters,
the rhs no longer than 100. To get a space, tab or newline into lhs or
rhs you should escape them with a ^V. (It may be necessary to double the
^V if the map command is given inside vi, rather than in ex.) Spaces and
tabs inside the rhs need not be escaped

Hi, Bob,

These are the mappings I used in Vim:

imap <C-H> <Space>!!STOP IT!!<Space>
imap <C-[> <Space>!!STOP IT!!<Space>

The <C-H> mapping worked fine, and so did the <C-[> There is one
catch, however. The <C-[> mapping also maps the Escape key. I can
always break out of insert by using Ctrl-C, but that's no better
than using Ctrl-[. Such is life, I suppose. Thanks for your effort.

Dubious said:
I use the gvim editor, available for Windows. I am using Windows
2000, service pack 4. One of the things that speeds up the usage of
gvim is the use of Ctrl-H for Backspace, and Ctrl-[ for Escape. This
is because your fingers never leave the home row on the keyboard.
Backspace & Escape are two of the most frequently used keys in gvim.
However, after quite a long time of using Ctrl-H and Ctrl-[, and
insidious problem arises -- repetitive stress syndrom. Before, when
one moves ones hands around to hit the Escape and Backspace keys, it
had the benefit of giving one's hand a break. I'm trying to revert
back to doing that, but it seems impossible because using Ctrl-H and
Ctrl-[ have become so automatic. Imagine someone telling you to type
text from now on, using some weird key for the letter "a" and "e"; it
would be impossible to do unless you actually prevent the "a" and "e"
key from generating the letters "a" and "e". I want to do something
similar -- namely, prevent Ctrl-H and Ctrl-[ from generating Backspace
and Escape characers. However, I still want the Backspace key and
Escape key to generate those characters. Is there a way to do this on
Windows 2000? I've already asked on the newsgroup for gvim, but no
suggestions so far for Windows. Thanks.
 
You're welcome, happy typing!

Dubious said:
Bob said:
Assign to an unused command as a macro? See excerpt from documentation
below.

You can use the map command from vi (typically in your EXINIT) with a
command of the form:
:map lhs rhsCR

mapping lhs into rhs. There are restrictions: lhs should be one
keystroke (either 1 character or one function key) since it must be
entered within one second (unless notimeout is set, in which case you
can type it as slowly as you wish, and vi will wait for you to finish it
before it echoes anything). The lhs can be no longer than 10 characters,
the rhs no longer than 100. To get a space, tab or newline into lhs or
rhs you should escape them with a ^V. (It may be necessary to double the
^V if the map command is given inside vi, rather than in ex.) Spaces and
tabs inside the rhs need not be escaped


Hi, Bob,

These are the mappings I used in Vim:

imap <C-H> <Space>!!STOP IT!!<Space>
imap <C-[> <Space>!!STOP IT!!<Space>

The <C-H> mapping worked fine, and so did the <C-[> There is one
catch, however. The <C-[> mapping also maps the Escape key. I can
always break out of insert by using Ctrl-C, but that's no better
than using Ctrl-[. Such is life, I suppose. Thanks for your effort.


Dubious said:
I use the gvim editor, available for Windows. I am using Windows
2000, service pack 4. One of the things that speeds up the usage of
gvim is the use of Ctrl-H for Backspace, and Ctrl-[ for Escape. This
is because your fingers never leave the home row on the keyboard.
Backspace & Escape are two of the most frequently used keys in gvim.
However, after quite a long time of using Ctrl-H and Ctrl-[, and
insidious problem arises -- repetitive stress syndrom. Before, when
one moves ones hands around to hit the Escape and Backspace keys, it
had the benefit of giving one's hand a break. I'm trying to revert
back to doing that, but it seems impossible because using Ctrl-H and
Ctrl-[ have become so automatic. Imagine someone telling you to type
text from now on, using some weird key for the letter "a" and "e"; it
would be impossible to do unless you actually prevent the "a" and "e"
key from generating the letters "a" and "e". I want to do something
similar -- namely, prevent Ctrl-H and Ctrl-[ from generating Backspace
and Escape characers. However, I still want the Backspace key and
Escape key to generate those characters. Is there a way to do this on
Windows 2000? I've already asked on the newsgroup for gvim, but no
suggestions so far for Windows. Thanks.
 
Back
Top