Home  |  Forums  |  914 Info  |  Blogs
 
914World.com - The fastest growing online 914 community!
 
Porsche, and the Porsche crest are registered trademarks of Dr. Ing. h.c. F. Porsche AG. This site is not affiliated with Porsche in any way.
Its only purpose is to provide an online forum for car enthusiasts. All other trademarks are property of their respective owners.
 

Welcome Guest ( Log In | Register )

> OT: vim commands...., Already googled it...
bd1308
post Aug 16 2005, 09:58 PM
Post #1


Sir Post-a-lot
*****

Group: Members
Posts: 8,020
Joined: 24-January 05
From: Louisville,KY
Member No.: 3,501



I googled it and came up with information, but none of it could prove to be useful.

if i write something long, like a story or something and I want to edit a word in the middle, is there any way to skip line by line through the wrapped "line" in vim? or do I just have to use the right arrow key for ten days to go through each letter until i get the right one?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies
Gint
post Aug 17 2005, 05:38 AM
Post #2


Mike Ginter
***************

Group: Admin
Posts: 16,096
Joined: 26-December 02
From: Denver CO.
Member No.: 20
Region Association: Rocky Mountains



Look at the man page and other reference material for vi. vim uses similar commands.

Use "/" and then enter your search term or string. Then use "n" to go to the next of your search terms throughout the file. Then you can use standard vi like replace commands.

Roger came very cose. ":1" will take you to line 1, a different number will take you to that line. "Cntrl-g" will show you what line your actually on of how many lines in the file BTW. Use ":" to enter command mode if not already there. Then, %s/wordtoreplace/newword vim doesn't seem to require the "g" and the end to make the change global as vi does. So if you only want to change one word, you'll have to use the first method I listed (or one of many other's) or otherwise figure that out on your own.

Jeff's advice is good also. I always use manual line breaks with vi in a long file. It's only a text editor. It wasn't intended for desktop publishing.

Buy a book! Find a good tech forum. You can usually search and find answers to these types f questions on a good firum for the subject matter.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 2nd July 2025 - 10:14 PM