LinuxQuestions.org
Visit Jeremy's Blog.
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 03-27-2010, 11:37 PM   #1
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,031

Rep: Reputation: 63
Vim help,editing multiple files


If i do vim file1.txt and file2.txt,only the file1.txt is displayed.
Then how can i switch from one file to another in vim?
 
Old 03-27-2010, 11:54 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,825
Blog Entries: 1

Rep: Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221
you could use:
Quote:
:bnext
:bprevious
I don't know the shortcuts though.
 
Old 03-28-2010, 12:30 AM   #3
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,031

Original Poster
Rep: Reputation: 63
Quote:
Originally Posted by sycamorex View Post
you could use:


I don't know the shortcuts though.
So one is hidden buffer,right?
 
Old 03-28-2010, 12:34 AM   #4
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,825
Blog Entries: 1

Rep: Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221
Quote:
Originally Posted by cola View Post
So one is hidden buffer,right?
Yes, if you open it with:
Code:
vim file1 file2
 
Old 03-28-2010, 12:58 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
:n takes you to the next file
:e# toggles between two files
:rew rewinds you to the first file

Those are traditional vi commands; there are probably several other ways of doing it but those are the only ones I know and use.

vi/vim are like that -- they have so many commands we tend to explore only as far as necessary to do the things we want to do, and miss out on many other goodies.
 
Old 03-28-2010, 01:01 AM   #6
cola
Senior Member
 
Registered: Sep 2007
Location: Dhaka,Bangladesh
Distribution: Debian
Posts: 1,031

Original Poster
Rep: Reputation: 63
Quote:
Originally Posted by catkin View Post
:n takes you to the next file
:e# toggles between two files
:rew rewinds you to the first file

Those are traditional vi commands; there are probably several other ways of doing it but those are the only ones I know and use.

vi/vim are like that -- they have so many commands we tend to explore only as far as necessary to do the things we want to do, and miss out on many other goodies.
Code:
vi/vim are like that -- they have so many commands we tend to explore only as far as necessary to do the things we want to do, and miss out on many other goodies.
Right.
 
  


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 slow editing php files in ubuntu exodist Linux - Software 5 05-17-2008 03:18 PM
Editing remote files (on FTP) with VIM does not works depi Linux - Software 3 09-04-2006 08:23 AM
VIM: editing files via ftp robertmarkbram Linux - Software 2 10-17-2004 02:41 AM
multiple files in VIM james.farrow Linux - Newbie 3 07-09-2004 06:46 AM
editing two files in vim schatoor Linux - Software 2 12-28-2002 09:56 AM

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

All times are GMT -5. The time now is 04:24 PM.

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