Skip to content

Commit

Permalink
Add support for terminal in default Vim
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherProksY committed Mar 20, 2021
1 parent 8056ef8 commit 5de8b0d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ How to use
- Use default `<hjkl>` keys to adjust the split size.
- `<q>` to finish.

3. Open Terminal *(only for NeoVim users)*:
3. Open Terminal:
- `<C-t>` to *open / close* terminal.
- Use default `<C-\><C-n>` mapping to return to normal mode inside terminal split.

Expand Down
13 changes: 12 additions & 1 deletion plugin/ez-window.vim
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,18 @@ function! s:NewTerminal()
normal i
endif
else
echo "Sorry, you are not a 'NeoVim' user ;("
if exists('t:terminal_buffer')
if (bufwinid(t:terminal_buffer) > 0)
exe "bd! " . t:terminal_buffer
unlet t:terminal_buffer
else
botright terminal ++rows=10
let t:terminal_buffer = bufnr()
endif
else
botright terminal ++rows=10
let t:terminal_buffer = bufnr()
endif
endif
endfunction

Expand Down

0 comments on commit 5de8b0d

Please sign in to comment.