Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-03-2009, 06:32 PM
|
#1
|
Senior Member
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168
|
Emacs: Open two files in horizontal windows from command line
Hi, I'm a VIM user trying to get familiar with you other guys' methods of evil.
In vimlandia, we have a -O flag which will cause subsequent files specified on the command line to open in side-by-side horizontal windows within VIM.
...Can your editor do that? I've seen no mention of it online or in the man page.
Thanks,
Jameson
|
|
|
02-03-2009, 08:17 PM
|
#2
|
Senior Member
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,849
|
Quote:
Originally Posted by jhwilliams
... subsequent files specified on the command line to open in side-by-side horizontal windows within VIM.
|
The command "xemacs file1.txt file2.txt" or "emacs -nw file1.txt file2.txt" will open an editor window with two edit buffers organized like:
Code:
+---------------------------------+
| |
| |
| |
+--file1.txt----------------------+
| |
| |
| |
+--file2.txt----------------------+
I haven't seen an Emacs configuration with the side-by-side vertical windows that "vim -O" gives you. That's not to say it's impossible; I'm sure some Lisp guru has gotten Emacs to do this. Personally, I'm not sure how useful it is. In the 24+ years I've been using Emacs (it was the basis for the Perfect software packages back in the Jurassic days of the PC) and a slew of other editors, I can't say that I've ever lusted for that particular window configuration.
Not that it answers your question but I seem to recall that the "Point" editor that Logitech shipped with its mice back in the '80s could use side-by-side windows. (Cool editor. It could edit immense files. I used to be able to help WordPerfect users recover corrupted files that WP refused to open after a bad block turned up on a floppy.)
Go ahead... feel superior that Vim can do this. It won't bother me at all.
Cheers...
Rick
|
|
|
02-03-2009, 08:36 PM
|
#3
|
Senior Member
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168
Original Poster
|
:-). Hey Rick, thanks for the reply. The side-by-side window feature seems almost necessary on my 13.3" laptop widescreen. Mileage tends to the city driving rates when I go for the up/down stacked windows. Emacs does have the feature when you get in there, Meta-X-3 opens a new one. I've been surprised that Emacs with all of its fan fare does not have some of the basic features of VIM to which I've grown accustomed (such as the aforementioned), but I also recognize that I don't have enough practice using it yet to state that it's an inferior editor versus simply not knowing my way around it.
|
|
|
02-06-2009, 12:11 AM
|
#4
|
Senior Member
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,849
|
Quote:
Originally Posted by jhwilliams
I've been surprised that Emacs with all of its fan fare does not have some of the basic features of VIM to which I've grown accustomed (such as the aforementioned) ...
|
And Emacs has, I'm sure, a few features that vi/vim users can only dream about. I recall when I was using microemacs regularly and having a real simple method of compiling my source code and being able to immediately jump into a new buffer containing any compiler diagnostics. I've never seen that available in vi-related editor though that's not to say such a thing is unavailable. I can remember being impressed by some real vi pros who knew how to do some fairly magical things. (I've never seen vi run its own adventure game though.)
Quote:
... but I also recognize that I don't have enough practice using it yet to state that it's an inferior editor versus simply not knowing my way around it.
|
Whew. I was afraid we might be in danger of reviving one of the oldest Holy Wars on the Internet. Just to be safe let's keep it down lest we attract the real fanatics.
Later...
Rick
|
|
|
02-06-2009, 01:32 AM
|
#5
|
Member
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Rep:
|
Well as an emacs fan, I just couldn't let this one pass 
I got this link after a quick search: http://tsdh.wordpress.com/2007/03/09...s-wide-enough/
It splits the window vertically if the current window is > 165 columns. I changed it to 80 just to be sure, and it works: when the terminal is normal sized, the files are stacked one below the other (as usual). When I retry with a maximized terminal, the files are side by side.
I don't understand a word of lisp, but it does seem to work decent. Put it in your .emacs and give it a try too.
|
|
|
All times are GMT -5. The time now is 02:19 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|