From 6297f4c01a70c9af30b1678ca238976b9e2bf4aa Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 1 May 2025 00:40:07 +0200 Subject: [PATCH] plugins/vimade: init --- plugins/by-name/vimade/default.nix | 32 ++++ .../plugins/by-name/vimade/default.nix | 146 ++++++++++++++++++ 2 files changed, 178 insertions(+) create mode 100644 plugins/by-name/vimade/default.nix create mode 100644 tests/test-sources/plugins/by-name/vimade/default.nix diff --git a/plugins/by-name/vimade/default.nix b/plugins/by-name/vimade/default.nix new file mode 100644 index 00000000..9b1098b6 --- /dev/null +++ b/plugins/by-name/vimade/default.nix @@ -0,0 +1,32 @@ +{ lib, ... }: +lib.nixvim.plugins.mkNeovimPlugin { + name = "vimade"; + + maintainers = [ lib.maintainers.GaetanLepage ]; + + settingsExample = { + fadelevel = 0.7; + recipe = [ + "duo" + { animate = true; } + ]; + tint = { + bg = { + rgb = [ + 255 + 255 + 255 + ]; + intensity = 0.1; + }; + fg = { + rgb = [ + 255 + 255 + 255 + ]; + intensity = 0.1; + }; + }; + }; +} diff --git a/tests/test-sources/plugins/by-name/vimade/default.nix b/tests/test-sources/plugins/by-name/vimade/default.nix new file mode 100644 index 00000000..4664a43f --- /dev/null +++ b/tests/test-sources/plugins/by-name/vimade/default.nix @@ -0,0 +1,146 @@ +{ + empty = { + plugins.vimade.enable = true; + }; + + example = { + plugins.vimade = { + enable = true; + + settings = { + fadelevel = 0.7; + recipe = [ + "duo" + { animate = true; } + ]; + tint = { + bg = { + rgb = [ + 255 + 255 + 255 + ]; + intensity = 0.1; + }; + fg = { + rgb = [ + 255 + 255 + 255 + ]; + intensity = 0.1; + }; + }; + }; + }; + }; + + defaults = { + plugins.vimade = { + enable = true; + + settings = { + recipe = [ + "default" + { animate = false; } + ]; + ncmode = "buffers"; + fadelevel = 0.4; + basebg = ""; + tint = { + }; + blocklist = { + default = { + highlights = { + laststatus_3.__raw = '' + function(win, active) + -- Global statusline, laststatus=3, is currently disabled as multiple windows take + -- ownership of the StatusLine highlight (see #85). + if vim.go.laststatus == 3 then + -- you can also return tables (e.g. {'StatusLine', 'StatusLineNC'}) + return 'StatusLine' + end + end + ''; + __unkeyed-1 = "TabLineSel"; + __unkeyed-2 = "Pmenu"; + __unkeyed-3 = "PmenuSel"; + __unkeyed-4 = "PmenuKind"; + __unkeyed-5 = "PmenuKindSel"; + __unkeyed-6 = "PmenuExtra"; + __unkeyed-7 = "PmenuExtraSel"; + __unkeyed-8 = "PmenuThumb"; + }; + buf_opts = { + buftype = [ "prompt" ]; + }; + }; + default_block_floats.__raw = '' + function (win, active) + return win.win_config.relative ~= "" and + (win ~= active or win.buf_opts.buftype =='terminal') and true or false + end + ''; + }; + link = [ ]; + groupdiff = true; + groupscrollbind = false; + enablefocusfading = false; + checkinterval = 1000; + usecursorhold = false; + nohlcheck = true; + focus = { + providers = { + filetypes = { + default = [ + [ + "treesitter" + { + min_node_size = 2; + min_size = 1; + max_size = 0; + exclude = [ + "script_file" + "stream" + "document" + "source_file" + "translation_unit" + "chunk" + "module" + "stylesheet" + "statement_block" + "block" + "pair" + "program" + "switch_case" + "catch_clause" + "finally_clause" + "property_signature" + "dictionary" + "assignment" + "expression_statement" + "compound_statement" + ]; + } + ] + [ + "blanks" + { + min_size = 1; + max_size = "35%"; + } + ] + [ + "static" + { + size = "35%"; + } + ] + ]; + }; + }; + }; + }; + }; + }; +}