Recognize Vim terminal buffers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Recognize Vim terminal buffers

Lifepillar
Is there any way yet to recognize that a window's buffer is a
terminal buffer (say, to define a custom status line)?

To be clear, I am talking about the terminal feature currently under
development in Vim.

Thanks,
Life.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recognize Vim terminal buffers

Christian Brabandt

On Fr, 11 Aug 2017, Lifepillar wrote:

> Is there any way yet to recognize that a window's buffer is a
> terminal buffer (say, to define a custom status line)?
>
> To be clear, I am talking about the terminal feature currently under
> development in Vim.

You can check the buftype option, which should be terminal as long as
the job is still running or use something like

index(term_list(), bufnr('')) > -1


Best,
Christian
--
Nichts auf der Welt ist so gerecht verteilt wie der Verstand. Denn
jedermann ist überzeugt, daß er genug davon habe.
                -- René Descartes (1596-1650)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recognize Vim terminal buffers

Lifepillar
On 11/08/2017 18:21, Christian Brabandt wrote:

>
> On Fr, 11 Aug 2017, Lifepillar wrote:
>
>> Is there any way yet to recognize that a window's buffer is a
>> terminal buffer (say, to define a custom status line)?
>>
>> To be clear, I am talking about the terminal feature currently under
>> development in Vim.
>
> You can check the buftype option, which should be terminal as long as
> the job is still running or use something like
>
> index(term_list(), bufnr('')) > -1

Thanks, both work even after the job is finished.

Wouldn't it make sense to also set filetype to vim_terminal or something
like that, to take advantage of ftdetect?

Life.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recognize Vim terminal buffers

Bram Moolenaar

Lifepillar wrote:

> On 11/08/2017 18:21, Christian Brabandt wrote:
> >
> > On Fr, 11 Aug 2017, Lifepillar wrote:
> >
> >> Is there any way yet to recognize that a window's buffer is a
> >> terminal buffer (say, to define a custom status line)?
> >>
> >> To be clear, I am talking about the terminal feature currently under
> >> development in Vim.
> >
> > You can check the buftype option, which should be terminal as long as
> > the job is still running or use something like
> >
> > index(term_list(), bufnr('')) > -1
>
> Thanks, both work even after the job is finished.
>
> Wouldn't it make sense to also set filetype to vim_terminal or something
> like that, to take advantage of ftdetect?

The text in the window can be anything.  A filetype is set if we know
what kind of text there is.  So setting the filetype for a terminal is
unexpected.

--
Citizens are not allowed to attend a movie house or theater nor ride in a
public streetcar within at least four hours after eating garlic.
                [real standing law in Indiana, United States of America]

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...