speed up vim "browsing"

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

speed up vim "browsing"

Post by Red Squirrel »

When viewing huge files in vim, is there a way to say, scroll by 100 lines at a time, or any specified number? When editing stuff like the apache configuration, I need to hold the down arrow key and wait and wait and wait until I get to the bottom. There has to be an easier way.

Archived topic from Anythingforums, old topic ID:1251, old post ID:15948
Honk if you love Jesus, text if you want to meet Him!
megaspaz
Posts: 340
Joined: Wed Dec 18, 2002 10:08 pm

speed up vim "browsing"

Post by megaspaz »

Red Squirrel wrote: When viewing huge files in vim, is there a way to say, scroll by 100 lines at a time, or any specified number? When editing stuff like the apache configuration, I need to hold the down arrow key and wait and wait and wait until I get to the bottom. There has to be an easier way.
not sure on the scrolling bit, but you can traverse the document faster if you know what you're looking for. if you know what you're looking for in the document you can have vi search the document for what you're looking for. kinda like find in notepad (or any other text editor). in vi command mode use slash and the word/phrase you're looking for. ex.

:/KeepAlive<press enter key>

that will match anything in the document. if it's not the right section then type this in command mode repeatedly until you find what you need:

:/<press enter key>

the slash will match the next line (it will place the cursor at the beginning of the line) that has the search pattern in it; in this case it will keep matching anything that has KeepAlive in it until you change the search pattern (searching for a new word or something).

This works in both vim and gvim.

Archived topic from Anythingforums, old topic ID:1251, old post ID:15963
Image
Resistance is futile...

Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums

"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

speed up vim "browsing"

Post by Red Squirrel »

Oh I see, yeah that should do it since usually I know what I'm looking for, that will actually make things faster in most cases well when editing apache files anyway.

Archived topic from Anythingforums, old topic ID:1251, old post ID:15968
Honk if you love Jesus, text if you want to meet Him!
megaspaz
Posts: 340
Joined: Wed Dec 18, 2002 10:08 pm

speed up vim "browsing"

Post by megaspaz »

Red Squirrel wrote: Oh I see, yeah that should do it since usually I know what I'm looking for, that will actually make things faster in most cases well when editing apache files anyway.
yeah. usually most of the time if you open a file looking for something, you know what you're looking for, just not where. it's much easier to use a text editor's find function on large docs than it is to scroll through those large docs.

Archived topic from Anythingforums, old topic ID:1251, old post ID:15972
Image
Resistance is futile...

Registered Linux User #321628
Anime/Toon Avatars
Other Cool Forums

"Never hold your farts in. They travel up your spine, into your brain, and that's where you get s**tty ideas from..." - Woyaya - January 10, 2004
Locked