is the [Esc] key not very unreachable?

65 views
Skip to first unread message

Nathan Huesken

unread,
Jun 1, 2009, 8:24:27 AM6/1/09
to VIM Mailinglist
Hello dear vim users,

I am completly new to vim, and I have a few questions:

- To me it feels like the [Esc] key would be very unreachable (for a
key which has to be pressed very often). How do other vim user cope with
this?

- I would like to use vim to write C++. I need gdb and I find it very
usefull to have gdb integrated into the editor. I find several plugins
for gdb ... are they all good or should I stick to specific one?

- When I press {, I like the } to be inserted with it. When I press }
int front of a {, I would like to jump over the } (look at eclipse
behavior for an example. Is this possible?

Thanks!
Nathan

Tim Chase

unread,
Jun 1, 2009, 10:20:09 AM6/1/09
to VIM Mailinglist
> Hello dear vim users,

Welcome

> - To me it feels like the [Esc] key would be very unreachable (for a
> key which has to be pressed very often). How do other vim user cope with
> this?

Various folks use solutions that work for them. On my laptops, I
often find that I hit <F1> accidentally when stabbing for <esc>,
so I just remap them:

:inoremap <f1> <esc>
:nnoremap <f1> <esc>
... (for other mapping modes)

This allows me to mash in the upper left corner of my keyboard
with less need for accuracy.

Alternatively, some folks use control+[ which sends vim the same
character as the <esc>. I use this occasionally depending on the
keyboard.

Lastly, some folks remap an existing vim functionality such as
the comma or semi-colon to serve as <esc> However I happen to
regularly use both of those keys, so that has never appealed to me.

> - I would like to use vim to write C++. I need gdb and I find it very
> usefull to have gdb integrated into the editor. I find several plugins
> for gdb ... are they all good or should I stick to specific one?

Can't help you much here. When I've needed to do debugging, I
usually use "screen" and just flip between the two sessions.

> - When I press {, I like the } to be inserted with it. When I press }
> int front of a {, I would like to jump over the } (look at eclipse
> behavior for an example. Is this possible?

The first one can be done with

:inoremap { {}<left>

The second one, I'm not sure I 100% understand (not using
Eclipse), but it sounds like you just want

:inoremap } }<left>


Ben Fritz

unread,
Jun 1, 2009, 11:25:44 AM6/1/09
to vim_use


On Jun 1, 7:24 am, Nathan Huesken <v...@lonely-star.org> wrote:
> - When I press {, I like the } to be inserted with it. When I press }
> int front of a {, I would like to jump over the } (look at eclipse
> behavior for an example. Is this possible?
>

http://vim.wikia.com/wiki/Automatically_append_closing_characters has
some good suggestions.

There may be others in http://vim.wikia.com/wiki/Category:Brackets but
I haven't really looked at most of them.

Ben Fritz

unread,
Jun 1, 2009, 2:05:37 PM6/1/09
to vim_use


On Jun 1, 10:25 am, Ben Fritz <fritzophre...@gmail.com> wrote:
> http://vim.wikia.com/wiki/Automatically_append_closing_characters has
> some good suggestions.
>

...which I've just updated with a far superior solution than was
already there, that doesn't have a bunch of side effects.

John Beckett

unread,
Jun 1, 2009, 8:14:40 PM6/1/09
to vim...@googlegroups.com
Nathan Huesken wrote:
> To me it feels like the [Esc] key would be very unreachable
> (for a key which has to be pressed very often). How do other
> vim user cope with this?

It stops bothering you after a few months :[

I have recently done a lot of merging of various ideas that
people have used. I don't use any of these, but sometimes I
think I might try...

http://vim.wikia.com/wiki/Avoid_the_escape_key

John

Andreas Bernauer

unread,
Jun 3, 2009, 5:29:12 AM6/3/09
to vim...@googlegroups.com

Nathan Huesken wrote:
> - To me it feels like the [Esc] key would be very unreachable (for a
> key which has to be pressed very often). How do other vim user cope with
> this?

I mapped Esc to CapsLock with xkbcomp as I never user CapsLock. Works great for me.

The Gnome keyboard configurator can do this for you, too.

--
Andreas.

bill lam

unread,
Jun 3, 2009, 7:55:25 PM6/3/09
to vim...@googlegroups.com
On Wed, 03 Jun 2009, Andreas Bernauer wrote:
>
>
>
> Nathan Huesken wrote:
> > - To me it feels like the [Esc] key would be very unreachable (for a
> > key which has to be pressed very often). How do other vim user cope with
> > this?
>
> I mapped Esc to CapsLock with xkbcomp as I never user CapsLock. Works great for me.

I also swapped Esc with Capslock but using xmodmap. The position of
Esc should be where it was when the first vi was developed.

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩162 馬戴 灞上秋居
灞原風雨定 晚見雁行頻 落葉他鄉樹 寒燈獨夜人
空園白露滴 孤壁野僧鄰 寄臥郊扉久 何年致此身

Efraim Yawitz

unread,
Jun 4, 2009, 7:49:27 AM6/4/09
to vim...@googlegroups.com
On Thu, Jun 4, 2009 at 2:55 AM, bill lam <cbil...@gmail.com> wrote:
> I also swapped Esc with Capslock but using xmodmap.  The position of
> Esc should be where it was when the first vi was developed.

Where is that?

bill lam

unread,
Jun 4, 2009, 9:30:49 AM6/4/09
to vim...@googlegroups.com

What is 'that'?

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

唐詩266 王昌齡 春宮曲
昨夜風開露井桃 未央前殿月輪高 平陽歌舞新承寵 簾外春寒賜錦袍

Teemu Likonen

unread,
Jun 4, 2009, 10:00:02 AM6/4/09
to bill lam, vim...@googlegroups.com
On 2009-06-04 21:30 (+0800), bill lam wrote:

> On Thu, 04 Jun 2009, Efraim Yawitz wrote:
>> On Thu, Jun 4, 2009 at 2:55 AM, bill lam <cbil...@gmail.com> wrote:
>> > I also swapped Esc with Capslock but using xmodmap.  The position of
>> > Esc should be where it was when the first vi was developed.
>> Where is that?
>
> What is 'that'?

Where exactly was the Esc key when the first Vi was developed?

bill lam

unread,
Jun 4, 2009, 10:06:36 AM6/4/09
to vim...@googlegroups.com

Should be on the left of 'Q'
http://en.wikipedia.org/wiki/Vi

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

唐詩122 王維 漢江臨眺
楚塞三湘接 荊門九派通 江流天地外 山色有無中
郡邑浮前浦 波瀾動遠空 襄陽好風日 留醉與山翁

Tim Chase

unread,
Jun 4, 2009, 10:12:30 AM6/4/09
to vim...@googlegroups.com
bill lam wrote:
> On Thu, 04 Jun 2009, Efraim Yawitz wrote:
>> On Thu, Jun 4, 2009 at 2:55 AM, bill lam <cbil...@gmail.com> wrote:
>>> I also swapped Esc with Capslock but using xmodmap. The position of
>>> Esc should be where it was when the first vi was developed.
>> Where is that?
>
> What is 'that'?

I think "that" is the "position of the Esc [key] when the first
vi was developed"

Though I'm not sure about that -- I've been using computers for
quite a while (over 20 years...dang, I feel old & geeky) and the
Esc has always been in the top-left of the keyboard: from Apple
][ series computers to my first x86 PC, to the DEC Ultrix
keyboards. Are you sure you aren't getting confused with the
Control vs CapsLock placement[1] war? :)

-tim

[1]
http://www.manicai.net/comp/swap-caps-ctrl.html


bill lam

unread,
Jun 4, 2009, 11:21:15 AM6/4/09
to vim...@googlegroups.com
On Thu, 04 Jun 2009, Tim Chase wrote:
>
> bill lam wrote:
> > On Thu, 04 Jun 2009, Efraim Yawitz wrote:
> >> On Thu, Jun 4, 2009 at 2:55 AM, bill lam <cbil...@gmail.com> wrote:
> >>> I also swapped Esc with Capslock but using xmodmap. The position of
> >>> Esc should be where it was when the first vi was developed.
> >> Where is that?
> >
> > What is 'that'?
>
> I think "that" is the "position of the Esc [key] when the first
> vi was developed"

Thanks. Btw I like your mononono.

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

唐詩019 孟浩然 夏日南亭懷辛大
山光忽西落 池月漸東上 散髮乘夜涼 開軒臥閑敞 荷風送香氣 竹露滴清響
欲取鳴琴彈 恨無知音賞 感此懷故人 中宵勞夢想

Florian Rehnisch

unread,
Jun 4, 2009, 1:32:49 PM6/4/09
to vim...@googlegroups.com
* Nathan Huesken <v...@lonely-star.org> [090601 15:48]:

> - To me it feels like the [Esc] key would be very unreachable (for a
> key which has to be pressed very often). How do other vim user cope with
> this?

Well, I have mapped <esc> to C-K. I also have l_ctrl and
capslock swapped. I like it.

flori

pansz

unread,
Jun 4, 2009, 11:48:08 PM6/4/09
to vim...@googlegroups.com
bill lam 写道:

> On Wed, 03 Jun 2009, Andreas Bernauer wrote:
>> Nathan Huesken wrote:
>>> - To me it feels like the [Esc] key would be very unreachable (for a
>>> key which has to be pressed very often). How do other vim user cope with
>>> this?
>> I mapped Esc to CapsLock with xkbcomp as I never user CapsLock. Works great for me.
>
> I also swapped Esc with Capslock but using xmodmap. The position of
> Esc should be where it was when the first vi was developed.
>

IMO the position of : (colon) should be where it was when the first vi
was developed. i.e. it does not require pressing the shift key.

Teemu Likonen

unread,
Jun 5, 2009, 12:33:51 AM6/5/09
to vim...@googlegroups.com
On 2009-06-05 11:48 (+0800), pansz wrote:

> IMO the position of : (colon) should be where it was when the first vi
> was developed. i.e. it does not require pressing the shift key.

When the first Vi was developed keyboards (and operating systems) were
quite unusable for lot of languages. What's a frequently used key in one
language may not be frequently used in some other language. Colon (:)
needs a Shift key in the Finnish keyboard and this is good because there
are many other, more frequently needed keys which are better located in
non-Shifted positions. In general a user interface shouldn't depend too
much on the physical location of keys.

Tony Mechelynck

unread,
Jun 5, 2009, 7:58:25 PM6/5/09
to vim...@googlegroups.com
On 04/06/09 01:55, bill lam wrote:
> On Wed, 03 Jun 2009, Andreas Bernauer wrote:
>>
>>
>>
>> Nathan Huesken wrote:
>>> - To me it feels like the [Esc] key would be very unreachable (for a
>>> key which has to be pressed very often). How do other vim user cope with
>>> this?
>>
>> I mapped Esc to CapsLock with xkbcomp as I never user CapsLock. Works great for me.
>
> I also swapped Esc with Capslock but using xmodmap. The position of
> Esc should be where it was when the first vi was developed.
>

That kind of reasoning reeks of "Progress is impossible; every change is
necessarily for the worse". Should we go back to the first version of
the first Vi then? Do it if you want; I won't. I prefer Vim's
'nocompatible' mode, its support of arrow keys, numeric-keypad keys and
(e.g. for user mappings or for the F1=Help function) F keys, none of
which existed in that primitive keyboard. Also multiple split-windows,
scripts in a true programming language with if/elseif/end/endif,
try/case/finally/endtry, autocommands, variables which may be Integer,
String, Float, List or Dictionary, and so on and so forth. I _do_
believe in today's version being better than that of thirty years ago.
(Within limits: I'm not a convert to the Dvorak keyboard, and I don't
use a keyboard in two separate pieces, one for each hand. There are also
such things as misguided "improvements".)

In fact I like the Esc key being "safely out of the way": it means that
I don't risk hitting it when I want something else, or something else
when I want it. But, in typical Vim fashion, other solutions are
available for people with other preferences, and several have been
mentioned in this thread:
- use Ctrl-[ which is, to Vim, a synonym of Esc
- map it by Vim means tooo something you don't use
- map it by OS means to something you don't use -- I've seen Caps Lock
mentioned; but that's a key which I personally do use, for instance for

TITLES
------

for EMPHASIS, for Unicode codepoint names (which are by convention
always in all caps), or when imitating the style of the RFC's, where the
expressions SHOULD, SHOULD NOT, MUST, MUST NOT, MAY, etc., have a
conventional meaning when they are printed in all caps.


Best regards,
Tony.
--
Grain grows best in shit
-- Ursula K. LeGuin

bill lam

unread,
Jun 5, 2009, 8:48:13 PM6/5/09
to vim...@googlegroups.com
On Sat, 06 Jun 2009, Tony Mechelynck wrote:
> That kind of reasoning reeks of "Progress is impossible; every change is
> necessarily for the worse". Should we go back to the first version of
> the first Vi then? Do it if you want; I won't. I prefer Vim's

I think that you might misunderstand my message, I did not imply the
original vi or that ancient keyboard are better. OP questioned why
the frequently used key [esc] is located in such an unreachable position.

Swapping doesn't mean disable capslock, pressing the esc will just do
the capslock's job.

How to press the escape key is just a personal preference, but for I,
a touch typist, swapping it with capslock is more convenient.

ymmv

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

唐詩207 元稹 遣悲懷三首之三
閑坐悲君亦自悲 百年都是幾多時 鄧攸無子尋知命 潘岳悼亡猶費詞
同穴窅冥何所望 他生緣會更難期 惟將終夜長開眼 報答平生未展眉

Roberto Miura Honji

unread,
Jun 9, 2009, 4:12:51 AM6/9/09
to vim...@googlegroups.com, VIM Mailinglist


2009/6/1 Nathan Huesken <v...@lonely-star.org>


Hello dear vim users,

I am completly new to vim, and I have a few questions:

- To me it feels like the [Esc] key would be very unreachable (for a
key which has to be pressed very often). How do other vim user cope with
this?
I exchanged esc key and caps-lock key using xmodmap.

File to xmodmap:
remove Lock = Caps_Lock
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock

- I would like to use vim to write C++. I need gdb and I find it very
usefull to have gdb integrated into the editor. I find several plugins
for gdb ... are they all good or should I stick to specific one?

In attach a script that I'm working to integrated vim with gdb. It's not complete yet, any sugestion send me a e-mail.

How to use:
:source gdbdebugger.vim
:GdbVim <Path-to-executable-file>

Now you are on gdb-mod.
b - Create a new breakpoint on line under cursor
r  - Run
n - Next
s - Step
p - Print value of variable under cursor (using word)
P - Print value of variable under cursor (using WORD)
c - Continue
q - quit gdb.
<ESC> - go out of gdb-mode.


- When I press {, I like the } to be inserted with it. When I press }
int front of a {, I would like to jump over the } (look at eclipse
behavior for an example. Is this possible?

For this you already have a good answers.


Thanks!
Nathan





--
----------------------------------------------
Roberto Miura Honji
LAS - Laboratório de Administração e Segurança de Sistemas
Engenharia de Computação - 2006
Instituto de Computação - UNICAMP

email: miura...@gmail.com (principal)
email: ra06...@students.ic.unicamp.br
msn:   miura...@msn.com
-------------------------------------------
gdbdebugger.vim

Roberto Miura Honji

unread,
Jun 9, 2009, 4:12:51 AM6/9/09
to vim...@googlegroups.com, VIM Mailinglist


2009/6/1 Nathan Huesken <v...@lonely-star.org>


Hello dear vim users,

I am completly new to vim, and I have a few questions:

- To me it feels like the [Esc] key would be very unreachable (for a
key which has to be pressed very often). How do other vim user cope with
this?
I exchanged esc key and caps-lock key using xmodmap.


File to xmodmap:
remove Lock = Caps_Lock
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock

- I would like to use vim to write C++. I need gdb and I find it very
usefull to have gdb integrated into the editor. I find several plugins
for gdb ... are they all good or should I stick to specific one?
In attach a script that I'm working to integrated vim with gdb. It's not complete yet, any sugestion send me a e-mail.

How to use:
:source gdbdebugger.vim
:GdbVim <Path-to-executable-file>

Now you are on gdb-mod.
b - Create a new breakpoint on line under cursor
r  - Run
n - Next
s - Step
p - Print value of variable under cursor (using word)
P - Print value of variable under cursor (using WORD)
c - Continue
q - quit gdb.
<ESC> - go out of gdb-mode.

- When I press {, I like the } to be inserted with it. When I press }
int front of a {, I would like to jump over the } (look at eclipse
behavior for an example. Is this possible?
For this you already have a good answers.


Thanks!
Nathan


gdbdebugger.vim

Tony Mechelynck

unread,
Jun 9, 2009, 5:19:56 AM6/9/09
to vim...@googlegroups.com
On 06/06/09 02:48, bill lam wrote:
> On Sat, 06 Jun 2009, Tony Mechelynck wrote:
>> That kind of reasoning reeks of "Progress is impossible; every change is
>> necessarily for the worse". Should we go back to the first version of
>> the first Vi then? Do it if you want; I won't. I prefer Vim's
>
> I think that you might misunderstand my message, I did not imply the
> original vi or that ancient keyboard are better. OP questioned why
> the frequently used key [esc] is located in such an unreachable position.
>
> Swapping doesn't mean disable capslock, pressing the esc will just do
> the capslock's job.
>
> How to press the escape key is just a personal preference, but for I,
> a touch typist, swapping it with capslock is more convenient.
>
> ymmv
>

Maybe I lacked sleep or something: rereading that post, it seems more
"flamy" than my usual. It is of course a personal preference, but maybe
what triggered my ire was the flat-out, unqualified statement that the
Esc key "should" be where it was on the keyboard used by the author of
the original Vi, i.e., at the left end of one of the letter rows. I
probably wouldn't have reacted to a post saying "I prefer" the Esc key
where most people have CapsLock nowadays.

The fact that I prefer Esc out of the way may be due to the fact that
I'm not what people call a "touch typist": I type fast enough, but
mostly with the five fingers of my right hand, which I let move left and
right above the keyboard the way a pianist's or organist's hands move
over the instrument's keyboard depending on which kays they have to
press next.

I have a sister who is a touch typist, and what's more, for both AZERTY
and QWERTY (but of course not both at the same time), but I've never
heard her say that she would like some keys to be swapped.


Best regards,
Tony.
--
Earn cash in your spare time -- blackmail your friends

Carsten Agger

unread,
Jun 9, 2009, 5:50:01 AM6/9/09
to vim...@googlegroups.com
I currently like to use vim as an ebook reader, using commands like L, H
and z<CR> to navigate the text.

Only one thing bothers me: The cursor, which is always the somewhere,
blinking away. Is there a way to hide/disable it?

The cursor is of course important, but while I'm not using it, I don't
have to see it, I think.

Maybe there's a simple solution, but :help cursor didn't yield anything
helpful.

Thanks in advance for any suggestions.

br
Carsten Agger
Denmark

--
http://www.modspil.dk
http://www.faklen.dk/en

Jürgen Krämer

unread,
Jun 9, 2009, 7:17:26 AM6/9/09
to vim...@googlegroups.com

Hi,

Carsten Agger wrote:
> I currently like to use vim as an ebook reader, using commands like L, H
> and z<CR> to navigate the text.
>
> Only one thing bothers me: The cursor, which is always the somewhere,
> blinking away. Is there a way to hide/disable it?
>
> The cursor is of course important, but while I'm not using it, I don't
> have to see it, I think.
>
> Maybe there's a simple solution, but :help cursor didn't yield anything
> helpful.

have a look at

:help 'guicursor'

if you are using a GUI version or running Vim in a Win32 console, or at

:help termcap-cursor-shape

if you are running Vim in terminal.

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

pansz

unread,
Jun 9, 2009, 9:21:05 PM6/9/09
to vim...@googlegroups.com
Carsten Agger 写道:

> I currently like to use vim as an ebook reader, using commands like L, H
> and z<CR> to navigate the text.
>
> Only one thing bothers me: The cursor, which is always the somewhere,
> blinking away. Is there a way to hide/disable it?
>
> The cursor is of course important, but while I'm not using it, I don't
> have to see it, I think.
>
> Maybe there's a simple solution, but :help cursor didn't yield anything
> helpful.
>
> Thanks in advance for any suggestions.

There's a script to use vim as less (the cursorless viewer mode designed
for ebook reader):

/usr/local/share/vim/vim72/macros/less.sh

if you compiled vim for your own it should be at the above directory, if
not, you should found at similar directory such as

/usr/share/vim/vim72/macros/less.sh


John Beckett

unread,
Jun 9, 2009, 9:22:29 PM6/9/09
to vim...@googlegroups.com
Carsten Agger wrote:
> I currently like to use vim as an ebook reader, using
> commands like L, H and z<CR> to navigate the text.

By the way, you may like to try two columns:
http://vim.wikia.com/wiki/View_text_file_in_two_columns

One column of text is enough for me, but sometimes quick
browsing with two columns might be handy.

John

Carsten Agger

unread,
Jun 10, 2009, 2:18:57 AM6/10/09
to vim...@googlegroups.com
tir, 09 06 2009 kl. 13:17 +0200, skrev Jürgen Krämer:
>
> Hi,
>
> Carsten Agger wrote:
> > I currently like to use vim as an ebook reader, using commands like L, H
> > and z<CR> to navigate the text.
> >
> > Only one thing bothers me: The cursor, which is always the somewhere,
> > blinking away. Is there a way to hide/disable it?
> >
> > The cursor is of course important, but while I'm not using it, I don't
> > have to see it, I think.
> >
> > Maybe there's a simple solution, but :help cursor didn't yield anything
> > helpful.
>
> have a look at
>
> :help 'guicursor'
>
> if you are using a GUI version or running Vim in a Win32 console, or at
>
> :help termcap-cursor-shape
>
> if you are running Vim in terminal.

Thanks a lot!

"guicursor=n-v-c:lcursor0-blinkon0 "

made the difference.

regards,

Carsten


Reply all
Reply to author
Forward
0 new messages