set an option for terminal buffer

20 views
Skip to first unread message

Marcin Szamotulski

unread,
Sep 30, 2017, 2:58:38 PM9/30/17
to Vim Use
Hello,

I was trying to find out a way how to set options for a terminal buffer
and there seems to be no way to to that. BufAdd and BufEnter trigger to
early (buftype not yet set) and OptionSet autocommand is not triggered.
Is there other way?

Best regards,
Marcin
signature.asc

Bram Moolenaar

unread,
Oct 1, 2017, 8:24:13 AM10/1/17
to vim...@googlegroups.com, Marcin Szamotulski

Marcin Szamotulski wrote:

> I was trying to find out a way how to set options for a terminal buffer
> and there seems to be no way to to that. BufAdd and BufEnter trigger to
> early (buftype not yet set) and OptionSet autocommand is not triggered.
> Is there other way?

It's in the help:

After opening the terminal window and setting 'buftype' to "terminal" the
BufWinEnter autocommand event is triggered. This makes it possible to set
options specifically for the window and buffer. Example: >
au BufWinEnter * if &buftype == 'terminal' | setlocal bufhidden=hide | endif



--
Married is a three ring circus:
First comes the engagement ring.
Then comes the wedding ring.
Then comes the suffering.

/// Bram Moolenaar -- Br...@Moolenaar.net -- 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 ///
Reply all
Reply to author
Forward
0 new messages