Skip to content

Commit

Permalink
terminal/editors/neovim: lualine disable aerial and location on large…
Browse files Browse the repository at this point in the history
… buffers
  • Loading branch information
khaneliman committed Jul 11, 2024
1 parent 5e5fbcf commit 8fdc927
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions modules/home/programs/terminal/editors/neovim/plugins/lualine.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{ config, lib, ... }:
let
inherit (lib) mkIf;

cond.__raw = # Lua
''
function()
local buf_size_limit = 1024 * 1024 -- 1MB size limit
if vim.api.nvim_buf_get_offset(0, vim.api.nvim_buf_line_count(0)) > buf_size_limit then
return false
end
return true
end
'';
in
{
programs.nixvim = {
Expand Down Expand Up @@ -69,6 +81,8 @@ in
{
name = "aerial";
extraConfig = {
inherit cond;

# -- The separator to be used to separate symbols in status line.
sep = " ) ";

Expand All @@ -90,6 +104,15 @@ in
};
}
];

lualine_z = [
{
name = "location";
extraConfig = {
inherit cond;
};
}
];
};

tabline = mkIf (!config.programs.nixvim.plugins.bufferline.enable) {
Expand All @@ -112,17 +135,7 @@ in
{
name = "navic";
extraConfig = {
cond.__raw = # Lua
''
function()
local buf_size_limit = 1024 * 1024 -- 1MB size limit
if vim.api.nvim_buf_get_offset(0, vim.api.nvim_buf_line_count(0)) > buf_size_limit then
return false
end
return true
end
'';
inherit cond;
};
}
];
Expand Down

0 comments on commit 8fdc927

Please sign in to comment.