LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Vi/Elvis Editing and Cursor Position at End of Line? (http://www.linuxquestions.org/questions/slackware-14/vi-elvis-editing-and-cursor-position-at-end-of-line-4175439581/)

haziz 12-01-2012 08:15 AM

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.

david1941 12-01-2012 08:50 AM

Try ESC a

TobiSGD 12-01-2012 08:50 AM

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.

GazL 12-02-2012 04:55 AM

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)


All times are GMT -5. The time now is 06:54 PM.