Re: how to replace ESC to some other key?

2007-04-10 Thread panshizhu
map something to , and it will insert a real tab character for
you.
for example:
inoremap   
will map F6 for you, replace it with anything you want.

I always need such a map, since I've set 'expandtab' all the time.
--
Sincerely, Pan, Shi Zhu. ext: 2606


wangxu <[EMAIL PROTECTED]> 写于 2007-04-11 23:16:08:

> That's a very good tip: )
> I also wanna know how to insert a "Tab" when I editing files like
> /etc/hosts?
> Can I?
>
> [EMAIL PROTECTED] wrote:
> > wangxu <[EMAIL PROTECTED]> 写于 2007-04-05 21:08:43:
> >
> >> but in this situation,is there any way to auto-indent *.py?
> >>
> >>
> >
> >  << is "decrease indent" (hold on Shift, then '<' twice)
> >  >> is "increase indent"
> > You can use << or >> command in Normal mode and Visual mode. which is
as
> > good as, if no better than, the  key.
> >
> > --
> > Sincerely, Pan, Shi Zhu. ext: 2606
>

Re: how to replace ESC to some other key?

2007-04-10 Thread Zhaojun WU

On 4/11/07, wangxu <[EMAIL PROTECTED]> wrote:

That's a very good tip: )
I also wanna know how to insert a "Tab" when I editing files like
/etc/hosts?
Can I?


What I did for indenting is I usually use space to replace the TAB
with the following settings:

set expandtab
set tabstop=4

But if I indeed need a realy TAB, I press "CTRL+V TAB" to get one.

This may be not what you want, because I didn't go through the whole
thread. Anyway, hope that helps a bit. :)

--
Best,
Zhaojun (Joseph)



[EMAIL PROTECTED] wrote:
> wangxu <[EMAIL PROTECTED]> 写于 2007-04-05 21:08:43:
>
>> but in this situation,is there any way to auto-indent *.py?
>>
>>
>
>  << is "decrease indent" (hold on Shift, then '<' twice)
>  >> is "increase indent"
> You can use << or >> command in Normal mode and Visual mode. which is as
> good as, if no better than, the  key.
>
> --
> Sincerely, Pan, Shi Zhu. ext: 2606




Re: how to replace ESC to some other key?

2007-04-10 Thread wangxu
That's a very good tip: )
I also wanna know how to insert a "Tab" when I editing files like
/etc/hosts?
Can I?

[EMAIL PROTECTED] wrote:
> wangxu <[EMAIL PROTECTED]> 写于 2007-04-05 21:08:43:
>   
>> but in this situation,is there any way to auto-indent *.py?
>>
>> 
>
>  << is "decrease indent" (hold on Shift, then '<' twice)
>  >> is "increase indent"
> You can use << or >> command in Normal mode and Visual mode. which is as
> good as, if no better than, the  key.
>
> --
> Sincerely, Pan, Shi Zhu. ext: 2606



Re: how to replace ESC to some other key?

2007-04-06 Thread Yakov Lerner

On 4/6/07, Taylor Venable <[EMAIL PROTECTED]> wrote:

On Wed, 4 Apr 2007 10:22:43 -0400
"Yakov Lerner" <[EMAIL PROTECTED]> wrote:

> On 4/4/07, wangxu <[EMAIL PROTECTED]> wrote:
> > ESC is so far from the center of the keyboard.
> > Can I replace this key to Caps Lock,for example?
>
> I heard some people use Tab as a substitute for Esc. Weird.
> But it's easier to do in platform-independent way.
>
> Yakov

If Wikipedia is correct in that vi was originally written on ADM-3A
terminals (I think I also read that on here at one time as well) and
that this particular terminal had it's escape key where nearly all
modern keyboards have a tab key, it kinda makes sense.

Here's the page, for reference: http://en.wikipedia.org/wiki/Vi


Indeed. And it didn't have tab key, did it ?

I use the  "mini-keyboard" (measures 29x11cm).
I love it becaise everything is nearby. Fingers need to traver less.
And takes less space on the crammed desktop :-)

Another nice relevant link is this keyboard:

   http://www.engadget.com/tag/optimus
   optimis keyboard where every key is a [color] display

Yakov


Re: how to replace ESC to some other key?

2007-04-05 Thread panshizhu
wangxu <[EMAIL PROTECTED]> 写于 2007-04-05 21:08:43:
> but in this situation,is there any way to auto-indent *.py?
>

 << is "decrease indent" (hold on Shift, then '<' twice)
 >> is "increase indent"
You can use << or >> command in Normal mode and Visual mode. which is as
good as, if no better than, the  key.

--
Sincerely, Pan, Shi Zhu. ext: 2606

Re: how to replace ESC to some other key?

2007-04-05 Thread Taylor Venable
On Wed, 4 Apr 2007 10:22:43 -0400
"Yakov Lerner" <[EMAIL PROTECTED]> wrote:

> On 4/4/07, wangxu <[EMAIL PROTECTED]> wrote:
> > ESC is so far from the center of the keyboard.
> > Can I replace this key to Caps Lock,for example?
> 
> I heard some people use Tab as a substitute for Esc. Weird.
> But it's easier to do in platform-independent way.
> 
> Yakov

If Wikipedia is correct in that vi was originally written on ADM-3A
terminals (I think I also read that on here at one time as well) and
that this particular terminal had it's escape key where nearly all
modern keyboards have a tab key, it kinda makes sense.

Here's the page, for reference: http://en.wikipedia.org/wiki/Vi

Although I'm not going to switch to that scheme any time soon -
 ^[ works just as well.

-- 
Taylor Venable
[EMAIL PROTECTED]
http://www.metasyntax.net/


Re: how to replace ESC to some other key?

2007-04-05 Thread Matthew Winn
On Thu, 05 Apr 2007 09:08:43 -0400, wangxu <[EMAIL PROTECTED]>
wrote:

> but in this situation,is there any way to auto-indent *.py?

I wouldn't have thought so, since the meaning of the code is implied
by the indentation rather than vice versa.

Personally I always indent using the basic autoindent option along
with ^T and ^D. I format my code for the benefit of human readers
(mainly myself), so I lay it out to maximise the clarity. Manual
indentation works best for that, and after nearly two decades of
practice my use of ^T and ^D as required has become automatic.

-- 
Matthew Winn


Re: how to replace ESC to some other key?

2007-04-04 Thread A.J.Mechelynck

[EMAIL PROTECTED] wrote:

"Yakov Lerner" <[EMAIL PROTECTED]> 写于 2007-04-04 22:22:43:

On 4/4/07, wangxu <[EMAIL PROTECTED]> wrote:

ESC is so far from the center of the keyboard.
Can I replace this key to Caps Lock,for example?

I heard some people use Tab as a substitute for Esc. Weird.
But it's easier to do in platform-independent way.

Yakov


It's not weird IMO, Tab key is rarely required inside Vim, thanks to the
powerful auto-indent feature of Vim (you don't need the tab key even when
editing Makefile!), I never feel a need to use  key in vim during the
last 3 years.


I use the Tab key in Vim constantly, not only to insert hard tabs but also for 
'wildmenu' completion. I don't feel Esc is "too far away" but maybe it comes 
(see below) from my early piano lessons (which did not, however, make a 
pianist out of me).




Personaly, I think it is easier to train my fingers to reach the
so-called-far-away-ESC-key. (Imagine that the piano players often need to
reach keys in the piano much farther than ESC, and they do that precisely.)

--
Sincerely, Pan, Shi Zhu. ext: 2606




Best regards,
Tony.
--
Keep America beautiful.  Swallow your beer cans.


Re: how to replace ESC to some other key?

2007-04-04 Thread wangxu
but in this situation,is there any way to auto-indent *.py?


[EMAIL PROTECTED] wrote:
> "Yakov Lerner" <[EMAIL PROTECTED]> 写于 2007-04-04 22:22:43:
>   
>> On 4/4/07, wangxu <[EMAIL PROTECTED]> wrote:
>> 
>>> ESC is so far from the center of the keyboard.
>>> Can I replace this key to Caps Lock,for example?
>>>   
>> I heard some people use Tab as a substitute for Esc. Weird.
>> But it's easier to do in platform-independent way.
>>
>> Yakov
>> 
>
> It's not weird IMO, Tab key is rarely required inside Vim, thanks to the
> powerful auto-indent feature of Vim (you don't need the tab key even when
> editing Makefile!), I never feel a need to use  key in vim during the
> last 3 years.
>
> Personaly, I think it is easier to train my fingers to reach the
> so-called-far-away-ESC-key. (Imagine that the piano players often need to
> reach keys in the piano much farther than ESC, and they do that precisely.)
>
> --
> Sincerely, Pan, Shi Zhu. ext: 2606



Re: how to replace ESC to some other key?

2007-04-04 Thread panshizhu
"Yakov Lerner" <[EMAIL PROTECTED]> 写于 2007-04-04 22:22:43:
> On 4/4/07, wangxu <[EMAIL PROTECTED]> wrote:
> > ESC is so far from the center of the keyboard.
> > Can I replace this key to Caps Lock,for example?
>
> I heard some people use Tab as a substitute for Esc. Weird.
> But it's easier to do in platform-independent way.
>
> Yakov

It's not weird IMO, Tab key is rarely required inside Vim, thanks to the
powerful auto-indent feature of Vim (you don't need the tab key even when
editing Makefile!), I never feel a need to use  key in vim during the
last 3 years.

Personaly, I think it is easier to train my fingers to reach the
so-called-far-away-ESC-key. (Imagine that the piano players often need to
reach keys in the piano much farther than ESC, and they do that precisely.)

--
Sincerely, Pan, Shi Zhu. ext: 2606

Re: how to replace ESC to some other key?

2007-04-04 Thread Yakov Lerner

On 4/4/07, wangxu <[EMAIL PROTECTED]> wrote:

ESC is so far from the center of the keyboard.
Can I replace this key to Caps Lock,for example?


I heard some people use Tab as a substitute for Esc. Weird.
But it's easier to do in platform-independent way.

Yakov


Re: how to replace ESC to some other key?

2007-04-04 Thread Tom Purl
On Wed, April 4, 2007 10:55 am, wangxu wrote:
> ESC is so far from the center of the keyboard.  Can I replace this key
> to Caps Lock,for example?

I don't know how you would do it with the Caps Lock key, but here's what
I put  in my vimrc to do it with the command key:

let mapleader = ","

HTH!

Tom Purl




Re: how to replace ESC to some other key?

2007-04-04 Thread Winfred Lu

It is no recommended to map Esc to CapsLock,
because you have to figure out different mapping ways for different
environments.

Try Ctrl-[, Esc is equivalent to Ctrl-[.

or,
FYR, I myself use "imap jj " instead.


Re: how to replace ESC to some other key?

2007-04-03 Thread panshizhu
wangxu <[EMAIL PROTECTED]> 写于 2007-04-04 23:55:55:
> ESC is so far from the center of the keyboard.
> Can I replace this key to Caps Lock,for example?
> Thanks.

This was well discussed on vim online.

Search for tips in vim.sf.net. You'll got all things you need to assign
CapsLock to ESC.

--
Sincerely, Pan, Shi Zhu. ext: 2606

how to replace ESC to some other key?

2007-04-03 Thread wangxu
ESC is so far from the center of the keyboard.
Can I replace this key to Caps Lock,for example?
Thanks.