diff --git a/pkgs/nvim/config/utils/toggleterm.nix b/pkgs/nvim/config/utils/toggleterm.nix index f9e23f8..f31229b 100644 --- a/pkgs/nvim/config/utils/toggleterm.nix +++ b/pkgs/nvim/config/utils/toggleterm.nix @@ -22,10 +22,28 @@ shell = "zsh"; direction = "float"; # 'vertical' | 'horizontal' | 'window' | 'float' 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 - width = 80; - height = 20; + width = '' + 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; }; winbar = {