chore: allow configuring height

also fixes window management for top and bottom tree side
This commit is contained in:
kiyan
2021-10-03 14:12:21 +02:00
parent 8fe2b547ac
commit fb32f35d7f
6 changed files with 53 additions and 20 deletions

View File

@@ -80,14 +80,23 @@ end
function M.window_options()
local opts = {}
if vim.g.nvim_tree_side == 'right' then
local side = require'nvim-tree.view'.View.side
if side == 'right' then
opts.open_command = 'h'
opts.preview_command = 'l'
opts.split_command = 'aboveleft'
else
elseif side == "left" then
opts.open_command = 'l'
opts.preview_command = 'h'
opts.split_command = 'belowright'
elseif side == "top" then
opts.open_command = 'j'
opts.preview_command = 'k'
opts.split_command = 'bot'
else
opts.open_command = 'k'
opts.preview_command = 'j'
opts.split_command = 'top'
end
return opts