LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-01-2012, 08:15 AM   #1
haziz
Member
 
Registered: Jan 2012
Location: /dev/null
Distribution: Slackware, Fedora, Debian, Centos, Ubuntu
Posts: 60

Rep: Reputation: 1
Vi/Elvis Editing and Cursor Position at End of Line?


When I am using vi (which I think invokes elvis by default on Slackware 13.37) I am able to insert text as expected but when I edit out typos by using ESC x the cursor movement key l as well as $ places the cursor on the last letter rather than beyond it therefore forcing me to insert any new text to the left of the last letter essentially forcing a typo unless I delete back all the way to a space. I hope I was able to explain this right. The actual arrow key will usually allow me to go beyond the last letter, but not always.

To help explain what I am doing:

This is text with a tttypog

I fix it with ESC x

This is a text with a typog

but ESC l or ESC $ allows me only to move the cursor to the g thus forcing me to insert any new text only to the left of the g

This is a text with a typorapicalg

Am I doing something wrong?

Thanks.
 
Old 12-01-2012, 08:50 AM   #2
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS6
Posts: 267

Rep: Reputation: 57
Try ESC a
 
Old 12-01-2012, 08:50 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
If you want to append text to a line use a instead of i to activate the insert mode. That will place the cursor right to the last character. Works that way in Vim, don't know about Vi, but I think that should be the same.
 
Old 12-02-2012, 04:55 AM   #4
GazL
Senior Member
 
Registered: May 2008
Posts: 3,439

Rep: Reputation: 956Reputation: 956Reputation: 956Reputation: 956Reputation: 956Reputation: 956Reputation: 956Reputation: 956
It's 'A' not 'a' that you want.

i = insert before character under cursor
a = insert after character under cursor
A = insert (append) at the end of line (short-cut for $a)
 
  


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
Debian - linux console hides the last lines at the end. Can't see the cursor line. saavedra29 Linux - Software 2 08-06-2012 07:17 AM
BASH Sort list by end of line to x position in each line? SilversleevesX Programming 14 08-19-2010 08:30 PM
[SOLVED] How to get the cursor position line at the mid of the windows in vim? cola Linux - Newbie 5 03-28-2010 10:18 AM
deletion of line above the cursor position. dina3e Linux - Newbie 1 04-07-2008 09:41 PM


All times are GMT -5. The time now is 08:40 PM.

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