LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, Arch, Ubuntu
Posts: 101

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?

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

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

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:25 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration