LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   term in Vi (https://www.linuxquestions.org/questions/linux-software-2/term-in-vi-35083/)

NSKL 11-10-2002 03:55 PM

term in Vi
 
I know Emacs can split a window and have a terminal in it. Is this possible in Vi? I know i can split a window with :split or :vsplit but can i run a terminal inside it?
Thanks
-NSKL

moses 11-30-2002 07:54 AM

I don't think what you are asking for is exactly possible, here's a
quick reference for emacs and vi commands, not complete by any means:
http://qref.sourceforge.net/Debian/r...h-edit.en.html

MasterC 11-30-2002 11:11 AM

Why would you want something like that? I don't see the benefit other than you can type on both areas at the same time without switching tty's.

Cool

adam_boz 12-01-2002 08:31 PM

it's nice to be able to edit some code, and then try to compile/run it to see the errors on the same screen so that you can fix it.

in normal mode, you can use :!<command> and it will run <command> inside vi(m)... I don't know if that's exactly what you want though.

EDIT:

or check out the vi mode in zsh.... really cool stuff

Ciccio 12-01-2002 08:36 PM

Ok, if you are using a GUI why not just opening two terminals??? Better... why not using emacs?? eheheh

moses 12-01-2002 10:37 PM

*Don flame retardant suit *
1) Because emacs sucks.
2) Becuase not everyone LIKES to use a window manager.
*duck and cover*

Seriously, though, if you had to use a window manager, I would suggest
using one that allows you to switch between windows with the keyboard
(Alt-Tab, on my setup of WindowMaker), since this would be almost as
fast as using a split vi window. . .

When I'm programming, I usually use the console, and just hop between
virtual consoles. It's not elegant, and sometimes it really sucks when
you need to read output while typing input, but it sure is better than
using a window manager. If I need to use a window manager (GTK
stuff, for example), then I use two xterms and swap between them
with Alt-Tab.

Ciccio 12-01-2002 11:03 PM

I think that the whole point of the Window Managers (like gnome or KDE) is to replace Windows (M$). Perhaps you don't like it but it is a very good solution. Personally I use consoles almos all the time, but still in a graphical environment and switch betwen them with shift ->/<-

adam_boz 12-01-2002 11:10 PM

the only thing annoying about that is if you have a bunch of x-terms (or anythiong for that matter) open, then you have to go through all of them before you get back to the one you want.

Ciccio 12-01-2002 11:21 PM

yeah... but also is alt+tab and I think it is better this way (I mean, with a GUI)... if not you could always use different virutal terminals and switch with ctr + alt + Fn

0x0001 12-02-2002 06:27 AM

Don't know if the following is possible in vi (since i use vim), but the vim manual doesn't states that it is not possible in vi. So i'm talking about what vim can do here, you can try it out in vi, and be happy if it works, or you can switch to vim if it doesn't:

:make runs a makefile and keeps the erroroutput, vim provides commands (:cn :cp) to jump between the positions and files where the errors occured. :cl allows you to list all errors.

You might also want to look how ctags work. IIRC vi supports it. This allows you to jump between the declaration and definition of function, classes, etc.
These are very helpfull when coding and debuging.

moses 12-02-2002 07:55 AM

Quote:

Originally posted by adam_boz
the only thing annoying about that is if you have a bunch of x-terms (or anythiong for that matter) open, then you have to go through all of them before you get back to the one you want.
That's the beauty of a window manager like OpenWindows or
WindowMaker (I'd be surprised if KDE and Gnome don't also support this),
you can easily set up a number of virtual desktops and switch between
them w/o the mouse. That way, you can have your two xterms side by
side on one virtual desktop, and all the other junk that comes with WMs
on other VDs. . .
Another nice thing about X is that you can set it up to be able to hop out to
the console w/o killing your X session, so you still have those virtual
consoles available to you (except 1, usually), which is really what I do
when I'm programming or screwing with the system.

vi does support tags.

neo77777 12-02-2002 08:40 AM

Back to original, I've been researching the question in some extent, it is a very intersting idea to have because wherever I edit some "written for everybody" scripts I have to hunt down some libs and stuff, so I always end up with
:!shell_command
inside vi. Well let me dig a little farther maybe I'll come up with something

neo77777 12-02-2002 08:51 AM

Also take a look at Vi like Emacs project (VILE) http://sal.kachinatech.com/G/5/VILE.html

nonamenobody 12-02-2002 09:23 AM

why not just background vi (ctrl-z) and stick it back in the forground when you want it again (fg)?

Ciccio 12-02-2002 11:26 AM

AFAIK X sessions use the 7th virtual line: tty7 = ctr + alt + F7

And if you use the root command #init n (where n is the init level you want) for starting the XFS and window manager then you can still use that tty for other things. And you will start all the necesary services you want (and even stop the ones you don't want)


All times are GMT -5. The time now is 08:05 PM.