summaryrefslogtreecommitdiff
path: root/modules/terminal.vim
diff options
context:
space:
mode:
authorChristianChiarulli <[email protected]>2019-02-16 17:12:38 -0500
committerChristianChiarulli <[email protected]>2019-02-16 17:12:38 -0500
commit7bdd4f7123d815cdad69f9d0ed248da6559b7d08 (patch)
tree01d037a299957cd818e04d302aaac21f58f6e6a7 /modules/terminal.vim
parentfa1be111d1224f9dad7c4c94ff3ab30f64894023 (diff)
added test file
Diffstat (limited to 'modules/terminal.vim')
-rw-r--r--modules/terminal.vim25
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/terminal.vim b/modules/terminal.vim
new file mode 100644
index 00000000..5dfe28c3
--- /dev/null
+++ b/modules/terminal.vim
@@ -0,0 +1,25 @@
+" I am experimenting with different ways to use the terminal in nvim "
+" So far I hate all my options
+
+let s:term_buf = 0
+let s:term_win = 0
+
+function! Term_toggle(height)
+ if win_gotoid(s:term_win)
+ hide
+ else
+ botright new
+ exec "resize " . a:height
+ try
+ exec "buffer " . s:term_buf
+ catch
+ call termopen($SHELL, {"detach": 0})
+ let s:term_buf = bufnr("")
+ endtry
+ startinsert!
+ let s:term_win = win_getid()
+ endif
+endfunction
+
+nnoremap <silent> <M-t> :call Term_toggle(10)<cr>
+tnoremap <silent> <M-t> <C-\><C-n>:call Term_toggle(10)<cr>