LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-08-2006, 01:59 AM   #1
dismas
LQ Newbie
 
Registered: Sep 2005
Location: a shack in VT, USA
Distribution: Slackware
Posts: 14

Rep: Reputation: 0
Question Moving around in vi


I'm trying to write a collection of stories in vi so that at the same time as I'm writing, I can also learn vi. I realize that vi isn't really meant for this sort of thing.

Although, if a sentence runs over onto the next line, vi looks at this as a single line. So if I move up and down in the document, I move from one paragraph to the next instead of what is visually the next line up on the screen. Is there a way around this?

Also, if the answer is to just put in a hard return near the end of each line on the screen, is there an easy way to take out all those hard returns when I'm satisfied that I know vi and move the document into an actual word processor?
 
Old 12-08-2006, 02:29 AM   #2
jerril
Member
 
Registered: Nov 2005
Location: Ontario, Canada
Distribution: Ubuntu
Posts: 114

Rep: Reputation: 15
Hi Dismas;

I've never found an easy way to move line to line in that way. In vim 7.0, ctrl+left/right arrow will move the cursor one word either way. You can also use escape and use the "(" and ")" to move from sentence to sentence, then resume editing. That is actually the best way to use a modal text editor.

There are many ways to join lines after you have split them. The "J" command is used to join lines. However I rarely do this. I usually keep my lines pretty formatted using the external formatter: "!}fmt" from inside a paragraph will clean it up.

I use txt2tags for markup, the broken lines are joined together in it's processor. Paragraphs are always separated by at least one blank line.

I use text files for almost everything and Vim is my editor, I don't think I'd ever want to use anything else for any kind of writing.

Vi is a daunting editor to learn, but it is well worth the effort.

Good Luck

jer
 
Old 12-08-2006, 02:41 AM   #3
anamericanjoe
Member
 
Registered: May 2006
Posts: 69

Rep: Reputation: 16
You can use the w command to move forward one word and the b command to move back one word. You can also use the $ command to move you to the end of the line and 0 to move you to the beginning of a line.
 
Old 12-08-2006, 03:26 AM   #4
Broder
Member
 
Registered: Oct 2006
Location: Santa Barbara, C.A.
Distribution: Mood dependent
Posts: 117

Rep: Reputation: 15
Another handy feature is esc :set list This will show you where the line breaks are, :set nolist to undo.
 
  


Reply

Tags
vi


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
moving to 2.6 tramni1980 Slackware 1 10-15-2006 05:37 PM
help with moving to another hd jclu Linux - Hardware 0 11-30-2005 11:40 AM
copying/moving stalls when moving a lot of data to a usb stick =X= Linux - Hardware 10 07-30-2004 05:29 AM
moving from 2.4.xx to 2.6.3... Tih8710 Programming 2 06-21-2004 06:55 AM
Moving up MasterC Linux - General 10 06-06-2002 05:51 AM


All times are GMT -5. The time now is 08:35 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