mirror of
https://github.com/mhinz/vim-galore.git
synced 2025-02-24 01:59:28 +08:00
Neovim: add new stuff to :terminal
This commit is contained in:
parent
ea942ed2e9
commit
00bd2c49ce
@ -16,6 +16,31 @@ programs](../README.md#running-external-programs-and-using-filters) like this:
|
|||||||
pipes ([libuv processes](https://nikhilm.github.io/uvbook/processes.html)) for
|
pipes ([libuv processes](https://nikhilm.github.io/uvbook/processes.html)) for
|
||||||
communication now. Use `:te read foo && echo $foo` instead.
|
communication now. Use `:te read foo && echo $foo` instead.
|
||||||
|
|
||||||
|
By now you might have noticed, that you can't leave the insert mode in a
|
||||||
|
terminal buffer via `<esc>`, since it gets captured by the terminal emulator
|
||||||
|
instead of Neovim. Use `<c-\><c-n>` instead.
|
||||||
|
|
||||||
|
Since terminal buffers are a new kind of buffer (`&buftype` is set to
|
||||||
|
"terminal"), there are also new commands for creating terminal
|
||||||
|
[mappings](../README.md#mappings): `:tmap`, `:tnoremap`, and `:tunmap`.
|
||||||
|
|
||||||
|
There are also two new [autocmd](../README.md#autocmds) events: `TermOpen` and
|
||||||
|
`TermClose`.
|
||||||
|
|
||||||
|
Here an example configuration:
|
||||||
|
|
||||||
|
```vim
|
||||||
|
if has('nvim')
|
||||||
|
nnoremap <leader>t :vsplit +terminal<cr>
|
||||||
|
tnoremap <esc> <c-\><c-n>
|
||||||
|
tnoremap <a-h> <c-\><c-n><c-w>h
|
||||||
|
tnoremap <a-j> <c-\><c-n><c-w>j
|
||||||
|
tnoremap <a-k> <c-\><c-n><c-w>k
|
||||||
|
tnoremap <a-l> <c-\><c-n><c-w>l
|
||||||
|
autocmd BufEnter term://* startinsert
|
||||||
|
endif
|
||||||
|
```
|
||||||
|
|
||||||
Related help:
|
Related help:
|
||||||
|
|
||||||
:h :terminal
|
:h :terminal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user