LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-25-2007, 03:48 AM   #1
xlq
Member
 
Registered: Feb 2007
Distribution: Slackware 12.0
Posts: 58

Rep: Reputation: 15
VIM question: can I stop <Esc> moving the cursor back?


In insert mode, pressing escape moves the cursor back one character.
This is annoying, but I haven't found how to turn this behaviour off.
 
Old 05-25-2007, 07:38 AM   #2
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
Well, if you press <ESC> in insert mode, you actually leave insert mode and go to command mode! The "jumping" cursor is a sign of that, since the cursor in insert mode is always on the next position handled, while in command mode, it's on the actual position (you can't use commands on empty space in a file, can you...); that's about it, you can't do much about that. But I guess some wizard'll tell you otherwise

M.
 
Old 05-26-2007, 03:54 AM   #3
xlq
Member
 
Registered: Feb 2007
Distribution: Slackware 12.0
Posts: 58

Original Poster
Rep: Reputation: 15
In that case, the cursor should move forward when I enter insert mode again, but it doesn't.
 
Old 05-26-2007, 04:55 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Quote:
Originally Posted by xlq
In that case, the cursor should move forward when I enter insert mode again, but it doesn't.
Nope, that's not correct.

If you enter insert mode (i), you want to insert under the cursor. If you want to append (a) the cursor is moved forward one position. Works as designed

MoonMind's answer is a bit crude, but basically correct.
 
Old 05-30-2007, 12:58 PM   #5
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
I think my fault was to be too patronizing - not actually crude, but simplifying things on purpose. Shouldn't have done that, sorry.

M.

P.S. I think actually leaving out the smili-ed last sentence and the bracketed one from my post would have helped a lot... I'll leave it unchanged as an example...
 
Old 05-30-2007, 01:21 PM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

@MoonMind: No need to apologize!

It did not mean to say you were/are patronizing in any way. I meant crude as in: The explanation was a bit rough / short. Or crude, as in crude oil
 
Old 05-30-2007, 01:44 PM   #7
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 4.0 Etch
Posts: 1,349

Rep: Reputation: 49
I think the true answer is that vi is an arcane editor born out of the even more arcane line editor "ed". Vi's quirks are just something vi users get used to.

If you want to use an editor which makes sense, use something else. If you want to use the editor which will exist on any *nix even in the most desperate of minimal rescue modes, use vi.
 
Old 05-30-2007, 01:46 PM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Now, this is patronizing.

 
Old 06-03-2007, 08:39 AM   #9
xlq
Member
 
Registered: Feb 2007
Distribution: Slackware 12.0
Posts: 58

Original Poster
Rep: Reputation: 15
I'm not using Vi, I'm using Vim + Vimgdb. It makes a very good development environment.
Yes, Vim does take a long time to get used to, but it sure beats KWrite
 
Old 06-03-2007, 10:46 AM   #10
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
druuna:

You're right - but I was referring to the reasons of my explanation being (or appearing) crude - but let's drop that, I'm not sulking or anything

xlg:

I think you're right. I like vi(m) for that fact that it facilitates handling large chunks of text or code in a great way. But it's not "easy" to use (in fact, it is if you know how, but it's sometimes counter-intuitive). I've used a lot of editors on different systems, mostly graphical, but when it comes to bumming your way through a messy file (or doing quick, but controlled edits in some random file), vim's second to none. Arcane? Maybe - but that'd make a lot of things that require some learning to use "arcane". Useless? Not in the least! And the fact that vi can be expected to be around on *NIX-y systems is important, too. Heck, I even have a copy of the ancient WinElvis on my USB storage device somewhere - just in case

Okay, and now let's settle this - or we'll have to discuss Emacs next...

M.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remember last cursor position in VIM rangalo Debian 4 05-12-2007 09:52 AM
vim: startup at last cursor position chrism01 Solaris / OpenSolaris 3 02-20-2007 11:25 AM
Character under cursor in Vim 7.0. judgex Programming 1 08-14-2006 08:06 PM
Vim Cursor Color Mr_Munkey Linux - Software 0 01-06-2006 05:42 PM
Mapping Esc to windows key in Vim frankie_DJ Linux - Newbie 2 10-14-2004 02:56 PM


All times are GMT -5. The time now is 05:47 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration