kassio / neoterm

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

Merge `g:neoterm_position` and `g:neoterm_size` options #198

Closed jlesquembre closed 6 years ago

jlesquembre commented 6 years ago

I found that running Tnew with these 2 configurations opens the neoterm split on the same position:

let g:neoterm_position = 'vertical'
let g:neoterm_tnew_mod = 'botright'
let g:neoterm_position = 'horizontal'
let g:neoterm_tnew_mod = 'botright'

To really open a new neoterm vertically you need this configuration:

let g:neoterm_tnew_mod = 'botright'
let g:neoterm_size = 'v'

I think g:neoterm_position option can be removed, since it's possible to open a neoterm split vertically setting g:neoterm_size to 'v'. And the only place where g:neoterm_position is used is here: https://github.com/kassio/neoterm/blob/f742d8af2a89e513643d17d673eae8d9c4563ebf/autoload/neoterm.vim#L215-L217

Also, in my opinion, less options makes the configuration easier.

kassio commented 6 years ago

Yeah, the current state is a bit messy, but I'm planning in simplify. Just a bit of context:

  1. g:neoterm_position is used for :T {cmd} when no neoterm is yet opened.
  2. g:neoterm_size has other reason to exists, which is to define the size of the split when opening a neoterm. You can hack it to open a vertical neoterm, but it's a side effect of its intention.
kassio commented 6 years ago

So, now g:neoterm_position and g:neoterm_tnew_mod no long exist. They were replaced by g:neoterm_default_mod which will receive a vim mods (:h mods). This way, by default, :T and :Tnew will use the current window, or the g:neoterm_default_mod if no command mods is provided. g:neoterm_size still exists to define the window(split) size.

jlesquembre commented 6 years ago

Thanks for the changes, I tested it and looks better. I just created a PR #200 to clarify a bit the g:neoterm_size option