feat(nvim/toggleterm): position based on screen size
This commit is contained in:
parent
7908f337e3
commit
f5b275385c
@ -22,10 +22,28 @@
|
|||||||
shell = "zsh";
|
shell = "zsh";
|
||||||
direction = "float"; # 'vertical' | 'horizontal' | 'window' | 'float'
|
direction = "float"; # 'vertical' | 'horizontal' | 'window' | 'float'
|
||||||
auto_scroll = true;
|
auto_scroll = true;
|
||||||
float_opts = {
|
float_opts = let
|
||||||
|
widthP = "0.9";
|
||||||
|
heightP = "0.9";
|
||||||
|
in rec {
|
||||||
border = "single"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
|
border = "single"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
|
||||||
width = 80;
|
width = ''
|
||||||
height = 20;
|
function()
|
||||||
|
return math.floor(vim.o.columns * ${widthP})
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
height = ''
|
||||||
|
function()
|
||||||
|
return math.floor(vim.o.lines * ${heightP})
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
row = ''
|
||||||
|
function()
|
||||||
|
local heightFn = ${height}
|
||||||
|
print(heightFn())
|
||||||
|
return math.floor((vim.o.lines - heightFn()) / 2) - 1
|
||||||
|
end
|
||||||
|
'';
|
||||||
winblend = 0;
|
winblend = 0;
|
||||||
};
|
};
|
||||||
winbar = {
|
winbar = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user