LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-24-2008, 08:42 PM   #1
dina3e
Member
 
Registered: Mar 2008
Location: Bangalore
Distribution: Enterprise Red Hat linux
Posts: 98

Rep: Reputation: 16
Smile quiting the vi editor...


hi i have suppose to open 7files in vi editor. but after editing the 3rd file i want that file is removedf from the list of 7 . so that there be only 6 file left for editing. if i will check by command in vi editor in command mode by
args
it only display the remaining..
 
Old 03-24-2008, 10:05 PM   #2
Slokunshialgo
Member
 
Registered: Jan 2006
Distribution: Ubuntu 9.04, Fedora 10
Posts: 76

Rep: Reputation: 17
I have no idea how to edit multiple files as a time, but I usually just use :q! to quit, or ZZ to quit & save.
 
Old 03-24-2008, 10:36 PM   #3
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
What vi are you using? If you are using real vi (the one available here), the only way to do it is manually with the n command. I.e.,
Code:
:args
file1 file2 [file3] file4 file5 file6 file7
:n file1 file2 file4 file5 file6 file7
:args
[file1] file2 file4 file5 file6 file7
If you are using vim (available here), you can use the command argd or bd (depending on whether you are used to cycling with n or bn). In vim, using bn/bp with bd is more natural (since you can sometimes manipulate the argument list and be in a state editing a file not in the list).

For argd:
Code:
:args
file1 file2 [file3] file4 file5 file6 file7
:argd %
:args
file1 file2 [file4] file5 file6 file7
For bd:
Code:
:ls
  1      "file1"                        line 1
  2 #    "file2"                        line 1
  3 %a   "file3"                        line 1
  4      "file4"                        line 1
  5      "file5"                        line 1
  6      "file6"                        line 1
  7      "file7"                        line 1
:bd
:ls
  1      "file1"                        line 1
  2 %a   "file2"                        line 1
  4      "file4"                        line 1
  5      "file5"                        line 1
  6      "file6"                        line 1
  7      "file7"                        line 1

Last edited by osor; 03-24-2008 at 10:37 PM.
 
Old 03-25-2008, 02:51 PM   #4
windhair
LQ Newbie
 
Registered: Oct 2005
Posts: 16

Rep: Reputation: 0
If you are using vi version 6+, you should try the new tabs feature, which provide the possibility to edit files in tab mode, you can move from tab to tab by the command "gt".
to open multi-file in tab mode, input
[HTML]vim(gvim) -p file1 file2 file3[/HTML]
 
Old 04-04-2008, 08:31 PM   #5
dina3e
Member
 
Registered: Mar 2008
Location: Bangalore
Distribution: Enterprise Red Hat linux
Posts: 98

Original Poster
Rep: Reputation: 16
Smile

Quote:
Originally Posted by osor View Post
What vi are you using? If you are using real vi (the one available here), the only way to do it is manually with the n command. I.e.,
Code:
:args
file1 file2 [file3] file4 file5 file6 file7
:n file1 file2 file4 file5 file6 file7
:args
[file1] file2 file4 file5 file6 file7
If you are using vim (available here), you can use the command argd or bd (depending on whether you are used to cycling with n or bn). In vim, using bn/bp with bd is more natural (since you can sometimes manipulate the argument list and be in a state editing a file not in the list).

For argd:
Code:
:args
file1 file2 [file3] file4 file5 file6 file7
:argd %
:args
file1 file2 [file4] file5 file6 file7
For bd:
Code:
:ls
  1      "file1"                        line 1
  2 #    "file2"                        line 1
  3 %a   "file3"                        line 1
  4      "file4"                        line 1
  5      "file5"                        line 1
  6      "file6"                        line 1
  7      "file7"                        line 1
:bd
:ls
  1      "file1"                        line 1
  2 %a   "file2"                        line 1
  4      "file4"                        line 1
  5      "file5"                        line 1
  6      "file6"                        line 1
  7      "file7"                        line 1
it's really great to share a knowledge in linux. i have come out the problem what i try to over come only by this..
 
  


Reply

Tags
editor, vi


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
Three applications quiting on startup CrownAmbassador Linux - Desktop 3 09-10-2006 03:40 PM
usb quiting ktc0ut Suse/Novell 1 05-25-2005 05:09 AM
Firefox quiting when clicking on a link? BajaNick General 7 01-30-2005 11:46 AM
Qt QuiTing. Seriously, compiling problem with QT dotancohen Linux - Newbie 5 01-18-2005 04:10 PM
How to quit the X interface without quiting the system? chamberlain Linux - General 3 06-20-2004 07:47 PM


All times are GMT -5. The time now is 09:38 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration