:terminal command in Vim 8

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

:terminal command in Vim 8

marco restelli
Dear all,
   I am experimenting with the :terminal command in Vim 8 after
reading about it on this list. The feature is great!

I have a couple of questions about it:

1) to enter Terminal-Normal mode I would like to use <ESC> instead of
the combination  CTRL-W N  . I see I can use termkey to define
something else as  CTRL-W  but it would still a combination of two
keys. What I would like is using just plain <ESC>

2) I would like to automatically set
  setlocal bufhidden=hide
for each terminal. How could I do this?

Thank you!
   Marco

--
--
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
|

Re: :terminal command in Vim 8

Bram Moolenaar

Marco Restelli wrote:

> Dear all,
>    I am experimenting with the :terminal command in Vim 8 after
> reading about it on this list. The feature is great!
>
> I have a couple of questions about it:
>
> 1) to enter Terminal-Normal mode I would like to use <ESC> instead of
> the combination  CTRL-W N  . I see I can use termkey to define
> something else as  CTRL-W  but it would still a combination of two
> keys. What I would like is using just plain <ESC>

tnoremap <Esc> <C-W>N

> 2) I would like to automatically set
>   setlocal bufhidden=hide
> for each terminal. How could I do this?

This doesn't work very well yet.  I'll look into triggering BufWinEnter
after setting 'buftype'.  Once that is done then this will work:

au BufWinEnter * if &buftype == 'terminal' | setlocal bufhidden=hide | endif


--
hundred-and-one symptoms of being an internet addict:
169. You hire a housekeeper for your home page.

 /// 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.
Reply | Threaded
Open this post in threaded view
|

Re: :terminal command in Vim 8

marco restelli
2017-09-21 22:16 GMT+02:00, Bram Moolenaar <[hidden email]>:

>
> Marco Restelli wrote:
>
>> Dear all,
>>    I am experimenting with the :terminal command in Vim 8 after
>> reading about it on this list. The feature is great!
>>
>> I have a couple of questions about it:
>>
>> 1) to enter Terminal-Normal mode I would like to use <ESC> instead of
>> the combination  CTRL-W N  . I see I can use termkey to define
>> something else as  CTRL-W  but it would still a combination of two
>> keys. What I would like is using just plain <ESC>
>
> tnoremap <Esc> <C-W>N

Yes, thanks!

>> 2) I would like to automatically set it
>>   setlocal bufhidden=hide
>> for each terminal. How could I do this?
>
> This doesn't work very well yet.  I'll look into triggering BufWinEnter
> after setting 'buftype'.  Once that is done then this will work:
>
> au BufWinEnter * if &buftype == 'terminal' | setlocal bufhidden=hide |
> endif

OK.

Thank you,
   Marco

--
--
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.