LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 09:46 AM   #1
james.farrow
Member
 
Registered: Mar 2003
Location: UK Darlington
Distribution: Fedora Freebsd Centos
Posts: 296

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, 08: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, 01: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, 05:46 AM   #4
james.farrow
Member
 
Registered: Mar 2003
Location: UK Darlington
Distribution: Fedora Freebsd Centos
Posts: 296

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

Thanx
 
  


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:55 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
Open Source Consulting | Domain Registration