aboutsummaryrefslogtreecommitdiffstats
path: root/hm/soispha/conf/nvim/plugins/lualine
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-08-26 23:42:21 +0200
committerSoispha <soispha@vhack.eu>2023-08-26 23:42:21 +0200
commit3f600ab07dbad3b6dd7655587ddea158b19aea71 (patch)
tree7164ccd965e1d14ade970aeb8eb188b1442a6c91 /hm/soispha/conf/nvim/plugins/lualine
parentStyle(treewide): Format all lua-files makes lua ➛ nix easier (diff)
downloadnixos-config-3f600ab07dbad3b6dd7655587ddea158b19aea71.zip
Refactor(treewide): Abbreviate path names
Diffstat (limited to '')
-rw-r--r--hm/soispha/conf/nvim/plugins/lualine/default.nix (renamed from home-manager/soispha/config/neovim/nixvim/plugins/lualine/default.nix)54
1 files changed, 29 insertions, 25 deletions
diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lualine/default.nix b/hm/soispha/conf/nvim/plugins/lualine/default.nix
index de48efea..0b789558 100644
--- a/home-manager/soispha/config/neovim/nixvim/plugins/lualine/default.nix
+++ b/hm/soispha/conf/nvim/plugins/lualine/default.nix
@@ -19,31 +19,35 @@
'';
};
get_mixed_indent = {
- __raw = ''
- function()
- local space_pat = [[\v^ +]]
- local tab_pat = [[\v^\t+]]
- local space_indent = vim.fn.search(space_pat, 'nwc')
- local tab_indent = vim.fn.search(tab_pat, 'nwc')
- local mixed = (space_indent > 0 and tab_indent > 0)
- local mixed_same_line
- if not mixed then
- mixed_same_line = vim.fn.search([[\v^(\t+ | +\t)]], 'nwc')
- mixed = mixed_same_line > 0
- end
- if not mixed then return "" end
- if mixed_same_line ~= nil and mixed_same_line > 0 then
- return 'MI:' .. mixed_same_line
- end
- local space_indent_cnt = vim.fn.searchcount({ pattern = space_pat, max_count = 1e3 }).total
- local tab_indent_cnt = vim.fn.searchcount({ pattern = tab_pat, max_count = 1e3 }).total
- if space_indent_cnt > tab_indent_cnt then
- return 'MI:' .. tab_indent
- else
- return 'MI:' .. space_indent
- end
- end
- '';
+ __raw =
+ /*
+ lua
+ */
+ ''
+ function()
+ local space_pat = [[\v^ +]]
+ local tab_pat = [[\v^\t+]]
+ local space_indent = vim.fn.search(space_pat, 'nwc')
+ local tab_indent = vim.fn.search(tab_pat, 'nwc')
+ local mixed = (space_indent > 0 and tab_indent > 0)
+ local mixed_same_line
+ if not mixed then
+ mixed_same_line = vim.fn.search([[\v^(\t+ | +\t)]], 'nwc')
+ mixed = mixed_same_line > 0
+ end
+ if not mixed then return "" end
+ if mixed_same_line ~= nil and mixed_same_line > 0 then
+ return 'MI:' .. mixed_same_line
+ end
+ local space_indent_cnt = vim.fn.searchcount({ pattern = space_pat, max_count = 1e3 }).total
+ local tab_indent_cnt = vim.fn.searchcount({ pattern = tab_pat, max_count = 1e3 }).total
+ if space_indent_cnt > tab_indent_cnt then
+ return 'MI:' .. tab_indent
+ else
+ return 'MI:' .. space_indent
+ end
+ end
+ '';
};
in {
enable = true;