LinuxQuestions.org
Review your favorite Linux distribution.
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 07-08-2004, 10:46 AM   #1
james.farrow
Member
 
Registered: Mar 2003
Location: UK Darlington
Distribution: Fedora Freebsd Centos
Posts: 288

Rep: Reputation: 31
multiple files in VIM


I'm a newbie , and would like to know how to open multiple files in VIM and 'flick' between them?
i.e.
vim somefile.h anotherfile.h onemore.h prog.cpp

I've tried the above , I don't get an error , but want to know how to view the other open files?

Thanx Jimmy
 
Old 07-08-2004, 09:23 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
I'm not sure what the most efficient way is - typing :buffers will show the files and :b2 will edit the second and so on.

In vi, :n and ^^ works.

Try :help buffers in vim.
 
Old 07-09-2004, 02:08 AM   #3
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
In vim, you can use :e to open another file for editing and then cycle between your open files (buffers) using :bn and :bp (buffer next, buffer previous). You can also type :sp filename to split open another file. Move between windows using Ctrl+W and then movement keys (arrows) or Ctrl+W again to cycle through the open files.


Håkan
 
Old 07-09-2004, 06:46 AM   #4
james.farrow
Member
 
Registered: Mar 2003
Location: UK Darlington
Distribution: Fedora Freebsd Centos
Posts: 288

Original Poster
Rep: Reputation: 31
Cheers I'll give it a go when back at me PC

Thanx
 
  


Reply


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
Vim leaves temp files everywhere dive Slackware 7 11-21-2005 01:22 PM
vim: Piping through multiple external commands tragos Linux - Software 2 03-19-2005 02:09 PM
VIM: editing files via ftp robertmarkbram Linux - Software 2 10-17-2004 02:41 AM
How to shift files when using VIM? ICO Linux - General 2 10-21-2003 04:25 PM
editing two files in vim schatoor Linux - Software 2 12-28-2002 09:56 AM


All times are GMT -5. The time now is 11:12 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration