Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 12-01-2012, 08:15 AM   #1
Registered: Jan 2012
Location: /dev/null
Distribution: Slackware, Fedora, Debian, Arch, Ubuntu
Posts: 99

Rep: Reputation: 4
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?

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

Rep: Reputation: 58
Try ESC a
Old 12-01-2012, 08:50 AM   #3
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,133
Blog Entries: 2

Rep: Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836Reputation: 4836
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
Senior Member
Registered: May 2008
Posts: 4,315
Blog Entries: 7

Rep: Reputation: 1767Reputation: 1767Reputation: 1767Reputation: 1767Reputation: 1767Reputation: 1767Reputation: 1767Reputation: 1767Reputation: 1767Reputation: 1767Reputation: 1767
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)


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 02:18 AM.

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