Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion plugin/split-term.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
let s:force_vertical = exists('g:split_term_vertical') ? 1 : 0
let s:map_keys = exists('g:disable_key_mappings') ? 0 : 1
let s:default_shell = exists('g:split_term_default_shell') ? g:split_term_default_shell : 0
let s:default_height = exists('g:split_term_height') ? string(g:split_term_height) : ''
let s:default_width = exists('g:split_term_width') ? string(g:split_term_width) : ''

" utilities around neovim's :term

Expand Down Expand Up @@ -46,7 +48,11 @@ endfunction
" specify the number of visible columns or rows.
fun! s:openBuffer(count, vertical)
let cmd = a:vertical ? 'vnew' : 'new'
let cmd = a:count ? a:count . cmd : cmd
if cmd == 'vnew'
let cmd = a:count ? a:count . cmd : s:default_width . cmd
else
let cmd = a:count ? a:count . cmd : s:default_height . cmd
endif
exe cmd
endf

Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ let g:split_term_default_shell = "bash"

`g:disable_key_mappings` - disable key mappings of the plugin

`g:split_term_height` - set default height at which horizontal terminal will be open

`g:split_term_width` - set default width at which vertical terminal will be open

## Mappings

The plugin remaps specifically a few keys for a better terminal buffer experience. This
Expand Down