kassio / neoterm

Wrapper of some vim/neovim's :terminal functions.
Other
1.32k stars 117 forks source link

Choose orientation on Tnew #175

Closed GCorbel closed 6 years ago

GCorbel commented 6 years ago

I created some bindings to create new tabs vertically or horizontally

" Quickly create a new terminal in a vertical split
tnoremap <C-a> <C-\><C-n>:Tpos vertical<CR>:Tnew<CR>
noremap <C-a> :Tpos vertical<CR>:Tnew<CR>
inoremap <C-a> <Esc>:Tpos vertical<CR>:Tnew<CR>

" Quickly create a new terminal in a horizontal split
tnoremap <C-q> <C-\><C-n>:Tpos horizontal<CR>:Tnew<CR>
noremap <C-q> :Tpos horizontal<CR>:Tnew<CR>
inoremap <C-q> <Esc>:Tpos horizontal<CR>:Tnew<CR>

I think it would be easier to have a position for the first argument of :Tnew like :Tnew horionztal or :Tnew vertical.

Also, it can be useful to open a new term in a new tab. I did this but it doesn't use neoterm :

" Quickly create a new terminal in a new tab
tnoremap <C-z> <C-\><C-n>:tabnew<CR>:term<CR>:startinsert<CR>
noremap <C-z> :tabnew<CR>:term<CR>:startinsert<CR>
inoremap <C-z> <Esc>:tabnew<CR>:term<CR>:startinsert<CR>

What you think?

kassio commented 6 years ago

I was planning to do this a long time, now you can do :vertical Tnew for vertical, or :botright Tnew for a horizontal one.

GCorbel commented 6 years ago

awesome, thanks.

kassio commented 6 years ago

The commit for this was causing a lot of bugs, so I reverted. I'll try do it again later.

kassio commented 6 years ago

This feature was recently added back, hopefully without bugs now. 🙏