Split a shell?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Split a shell?

Antun Karlovac
I'm used to working with several files in :split mode. Is there a way to
  have one of the "windows" be a the unix/linux shell?

-Antun
Reply | Threaded
Open this post in threaded view
|

Re: Split a shell?

A.J.Mechelynck
Antun Karlovac wrote:
> I'm used to working with several files in :split mode. Is there a way to
>  have one of the "windows" be a the unix/linux shell?
>
> -Antun
>
>
>

Probably not an _interactive_ shell, unless you want to compile Vim with
unofficial patches. I know there is a project to do just that, but Bram
is highly skeptical of its usefulness: if you want a bloated (and slow)
editor which includes everything but the kitchen sink, use Emacs.

You can run a _batch_ shell from Vim though, and get its output in a
split window rather easily.

See
        :help design-not
        :help filter
        :help :read!

Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

RE: Split a shell?

jason heddings-2
Is it possible to retain control of Vim as the program is running?  This
would be very useful say in the case of a build (our typical build takes 20
min or so).

It would be great to watch the build output as the compile is happening in a
Vim window, but still be able to edit in other windows.  This is probably
similar to shell functionallity and may not be in the scope of Vim.

--jah


-----Original Message-----
From: A. J. Mechelynck [mailto:[hidden email]]
Sent: Friday, 28 October, 2005 13:43
To: Antun Karlovac
Cc: [hidden email]
Subject: Re: Split a shell?

Antun Karlovac wrote:
> I'm used to working with several files in :split mode. Is there a way
> to  have one of the "windows" be a the unix/linux shell?
>
> -Antun
>
>
>

Probably not an _interactive_ shell, unless you want to compile Vim with
unofficial patches. I know there is a project to do just that, but Bram is
highly skeptical of its usefulness: if you want a bloated (and slow) editor
which includes everything but the kitchen sink, use Emacs.

You can run a _batch_ shell from Vim though, and get its output in a split
window rather easily.

See
        :help design-not
        :help filter
        :help :read!

Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: Split a shell?

Tim Chase-2
> Is it possible to retain control of Vim as the program is
> running?  This would be very useful say in the case of a build
> (our typical build takes 20 min or so).
>
> It would be great to watch the build output as the compile is
> happening in a Vim window, but still be able to edit in other
> windows.  This is probably similar to shell functionallity and
> may not be in the scope of Vim.

To do what you're describing on a *nix box, I typically run vim
within a "screen" session.  This allows for splitting (currently
only horizontally, not vertically yet, though it's on the feature
list for an upcoming version) the screen and having diff.
processes run in each.

I usually just run each full-screen (without splitting the
screen) unless I have cause to see more than one on the screen at
the same time.  "screen" allows for monitoring hidden windows for
either activity or silence, and will notify you with the system
bell (or visual bell) that something has happened.  If you're
compiling, you'd likely want to monitor for silence.  If you've
got an IM program or a download running, you might want to
monitor for activity.

Thus, if I were doing your 20-minute-compile, I'd

start screen

edit stuff in vim

create a new screen window

start the compile

set the window to monitor for silence

switch back over to the Vim window

work contendedly in vim, checking back occasionally
     (or splitting the other window) if you're nosey

when "screen" notifies you of inactivity, your build is
     likely done.


Just my take on the matter...let "screen" do what it's good at,
and let Vim do what it's good at.

-tim



Reply | Threaded
Open this post in threaded view
|

Re: Split a shell?

A.J.Mechelynck
In reply to this post by jason heddings-2
jason heddings wrote:
> Is it possible to retain control of Vim as the program is running?  This
> would be very useful say in the case of a build (our typical build takes 20
> min or so).
>
> It would be great to watch the build output as the compile is happening in a
> Vim window, but still be able to edit in other windows.  This is probably
> similar to shell functionallity and may not be in the scope of Vim.
>
> --jah

To retain control of (g)vim while a shell script runs in the background,
launch it from outside vim, possibly redirecting its output to a
logfile. (Start gvim first, it will use its own Windows or X11 window
and the shell prompt will immediately reappear.) After the other job
finishes, you can open its logfile in Vim. On Unix-like OSes, add & at
the end of the command-line to have it run in the background.

To watch the output while it's being produced (again, on Unix-like
systems), you may want to use the tail program with its -f option.

Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: Split a shell?

henrik-10
In reply to this post by A.J.Mechelynck
Maybe multi-gnome terminal is the think you are looking for i am  using
that sometimes to be able to use the unix shell freely.

Regards ,
  Henrik
--
The war between Emacs and Vi is over.  Vi has won with 3 to 1.
                       http://www.ssc.com/lg/issue30/raymond.html

On Fri, 2005-10-28 at 21:43 +0200, A. J. Mechelynck wrote:
> Antun Karlovac wrote:
> > I'm used to working with several files in :split mode. Is there a way to
> >  have one of the "windows" be a the unix/linux shell?
> >
> > -Antun
> >
> >
> >
>



Reply | Threaded
Open this post in threaded view
|

RE: Split a shell?

David Fishburn
In reply to this post by Antun Karlovac
 

> -----Original Message-----
> From: Antun Karlovac [mailto:[hidden email]]
> Sent: Friday, October 28, 2005 2:52 PM
> To: [hidden email]
> Subject: Split a shell?
>
> I'm used to working with several files in :split mode. Is
> there a way to
>   have one of the "windows" be a the unix/linux shell?

You can look at this plugin:

Python Shell - terminal/shell buffer script for python enabled [g]vim
http://www.vim.org/scripts/script.php?script_id=165
Author: Brian Sturk

HTH,
Dave

Reply | Threaded
Open this post in threaded view
|

Re: Split a shell?

bsturk
In reply to this post by A.J.Mechelynck
>>I'm used to working with several files in :split mode. Is there a way to
>> have one of the "windows" be a the unix/linux shell?
>>
>>-Antun
>
>
> Probably not an _interactive_ shell, unless you want to compile Vim with
> unofficial patches. I know there is a project to do just that, but Bram
> is highly skeptical of its usefulness: if you want a bloated (and slow)
> editor which includes everything but the kitchen sink, use Emacs.
>
> You can run a _batch_ shell from Vim though, and get its output in a
> split window rather easily.
>
> See
> :help design-not
> :help filter
> :help :read!
>
> Best regards,
> Tony.

I've written a plugin that does this but only requires vim to be built with
python.  No unofficial patches.  It however is limited due to vim not being
designed to support some of the things the script tries to do.  It however works
very well for non-curses programs, including compiler output.   :)

You can download it here:

        http://vim.sourceforge.net/scripts/script.php?script_id=165

I welcome feedback on it too...

~brian


--
.--------------------------------------------------,--------.
| Brian Sturk - http://users.adelphia.net/~bsturk \  C/C++  | .>   )\,^a__
|-------------------------. bsturk<AT>adelphia.net | Python |(  _ _)/ /-."~
| http://www.telengard.com `------------------------`-------| `( )_ )/
| Telengard Technologies Inc. - NT/*nix UI & device drivers |_<_s_<_s
`-----------------------------------------------------------'
Reply | Threaded
Open this post in threaded view
|

Re: Split a shell?

R Sam
I have been using Brian Sturk's vimshell script for quite a long while now and I
really like it. It does have some annoyances, but those maybe because of the
way vim behaves, but for the most part it works great.

The one feature I like most of it is that once you create the first shell inside
a vim session, you can then create as many as you want including naming
them with meaningful names.

So typically I will have one shell named _compile_, one _run_, etc.
Then you can switch to each using the buffer explorer.

Regards,
-Sam


On 10/31/05, Brian Sturk <[hidden email]> wrote:

> >>I'm used to working with several files in :split mode. Is there a way to
> >> have one of the "windows" be a the unix/linux shell?
> >>
> >>-Antun
> >
> >
> > Probably not an _interactive_ shell, unless you want to compile Vim with
> > unofficial patches. I know there is a project to do just that, but Bram
> > is highly skeptical of its usefulness: if you want a bloated (and slow)
> > editor which includes everything but the kitchen sink, use Emacs.
> >
> > You can run a _batch_ shell from Vim though, and get its output in a
> > split window rather easily.
> >
> > See
> >       :help design-not
> >       :help filter
> >       :help :read!
> >
> > Best regards,
> > Tony.
>
> I've written a plugin that does this but only requires vim to be built with
> python.  No unofficial patches.  It however is limited due to vim not being
> designed to support some of the things the script tries to do.  It however works
> very well for non-curses programs, including compiler output.   :)
>
> You can download it here:
>
>         http://vim.sourceforge.net/scripts/script.php?script_id=165
>
> I welcome feedback on it too...
>
> ~brian
>
>
> --
> .--------------------------------------------------,--------.
> | Brian Sturk - http://users.adelphia.net/~bsturk \  C/C++  | .>   )\,^a__
> |-------------------------. bsturk<AT>adelphia.net | Python |(  _ _)/ /-."~
> | http://www.telengard.com `------------------------`-------| `( )_ )/
> | Telengard Technologies Inc. - NT/*nix UI & device drivers |_<_s_<_s
> `-----------------------------------------------------------'
>
Reply | Threaded
Open this post in threaded view
|

Re: Split a shell?

bsturk
R Sam wrote:

>I have been using Brian Sturk's vimshell script for quite a long while now and I
>really like it. It does have some annoyances, but those maybe because of the
>way vim behaves, but for the most part it works great.
>
>The one feature I like most of it is that once you create the first shell inside
>a vim session, you can then create as many as you want including naming
>them with meaningful names.
>
>So typically I will have one shell named _compile_, one _run_, etc.
>Then you can switch to each using the buffer explorer.
>
>Regards,
>-Sam
>
>  
>
Hi Sam,

Glad you are using the script and liking it.  I've tried to make the
annoyances as tolerable as possible (like timing out reads when
executing commands etc).  Some things are just impossible to do within
vim without changing vim itself.  I'm hoping someday it can be a 100%
finished script.  Not much would be needed to get the things in the TODO
file implemented correctly.  Sam, if the things that are not working
correctly are not noted in the README or TODO it's possible I could
address it for you.  Are you using vimsh under a UNIX variant?

~brian
Reply | Threaded
Open this post in threaded view
|

Re: Split a shell?

Ernest Obusek
Where can I find this script?  I tried to search for it on vim.org  
and couldn't find it.

On Oct 31, 2005, at 4:07 PM, Brian Sturk wrote:

> R Sam wrote:
>
>> I have been using Brian Sturk's vimshell script for quite a long  
>> while now and I
>> really like it. It does have some annoyances, but those maybe  
>> because of the
>> way vim behaves, but for the most part it works great.
>>
>> The one feature I like most of it is that once you create the  
>> first shell inside
>> a vim session, you can then create as many as you want including  
>> naming
>> them with meaningful names.
>>
>> So typically I will have one shell named _compile_, one _run_, etc.
>> Then you can switch to each using the buffer explorer.
>>
>> Regards,
>> -Sam
>>
>>
> Hi Sam,
>
> Glad you are using the script and liking it.  I've tried to make  
> the annoyances as tolerable as possible (like timing out reads when  
> executing commands etc).  Some things are just impossible to do  
> within vim without changing vim itself.  I'm hoping someday it can  
> be a 100% finished script.  Not much would be needed to get the  
> things in the TODO file implemented correctly.  Sam, if the things  
> that are not working correctly are not noted in the README or TODO  
> it's possible I could address it for you.  Are you using vimsh  
> under a UNIX variant?
>
> ~brian

Reply | Threaded
Open this post in threaded view
|

Re: Split a shell?

A.J.Mechelynck
Ernest Obusek wrote:

> Where can I find this script?  I tried to search for it on vim.org and
> couldn't find it.
>
> On Oct 31, 2005, at 4:07 PM, Brian Sturk wrote:
>
>> R Sam wrote:
>>
>>> I have been using Brian Sturk's vimshell script for quite a long
>>> while now and I
>>> really like it. It does have some annoyances, but those maybe because
>>> of the
>>> way vim behaves, but for the most part it works great.
>>>
>>> The one feature I like most of it is that once you create the first
>>> shell inside
>>> a vim session, you can then create as many as you want including naming
>>> them with meaningful names.
>>>
>>> So typically I will have one shell named _compile_, one _run_, etc.
>>> Then you can switch to each using the buffer explorer.
>>>
>>> Regards,
>>> -Sam
>>>
>>>
>> Hi Sam,
>>
>> Glad you are using the script and liking it.  I've tried to make the
>> annoyances as tolerable as possible (like timing out reads when
>> executing commands etc).  Some things are just impossible to do within
>> vim without changing vim itself.  I'm hoping someday it can be a 100%
>> finished script.  Not much would be needed to get the things in the
>> TODO file implemented correctly.  Sam, if the things that are not
>> working correctly are not noted in the README or TODO it's possible I
>> could address it for you.  Are you using vimsh under a UNIX variant?
>>
>> ~brian
>
>
>
>

Search for vimsh not vimshell. The search finds two scripts,
http://vim.sourceforge.net/scripts/script.php?script_id=1069 and
http://vim.sourceforge.net/scripts/script.php?script_id=165

Script #165 is interactive and requires python. Script #1069 is (IIUC) a
command-line interpreter written in Vim script.

Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: Split a shell?

R Sam
In reply to this post by Ernest Obusek
Hi Ernest,

The script that I was talking about and that Brian has written is the
second one pointed to by Tony. i.e:

http://vim.sourceforge.net/scripts/script.php?script_id=165

As Tony mentioned you would need Python installed as well
as vim compiled with +python.

Give it a try as it is really neat and useful.

Regards,
-Sam

On 11/2/05, Ernest Obusek <[hidden email]> wrote:

> Where can I find this script?  I tried to search for it on vim.org
> and couldn't find it.
>
> On Oct 31, 2005, at 4:07 PM, Brian Sturk wrote:
>
> > R Sam wrote:
> >
> >> I have been using Brian Sturk's vimshell script for quite a long
> >> while now and I
> >> really like it. It does have some annoyances, but those maybe
> >> because of the
> >> way vim behaves, but for the most part it works great.
> >>
> >> The one feature I like most of it is that once you create the
> >> first shell inside
> >> a vim session, you can then create as many as you want including
> >> naming
> >> them with meaningful names.
> >>
> >> So typically I will have one shell named _compile_, one _run_, etc.
> >> Then you can switch to each using the buffer explorer.
> >>
> >> Regards,
> >> -Sam
> >>
> >>
> > Hi Sam,
> >
> > Glad you are using the script and liking it.  I've tried to make
> > the annoyances as tolerable as possible (like timing out reads when
> > executing commands etc).  Some things are just impossible to do
> > within vim without changing vim itself.  I'm hoping someday it can
> > be a 100% finished script.  Not much would be needed to get the
> > things in the TODO file implemented correctly.  Sam, if the things
> > that are not working correctly are not noted in the README or TODO
> > it's possible I could address it for you.  Are you using vimsh
> > under a UNIX variant?
> >
> > ~brian
>
>