From 8fcd7f1a92a9e8b8c9be91d8bc52b15742abfb20 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 3 May 2025 20:44:17 +0200 Subject: [PATCH] plugins/lf: init --- plugins/by-name/lf/default.nix | 33 +++++++++ .../plugins/by-name/lf/default.nix | 68 +++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 plugins/by-name/lf/default.nix create mode 100644 tests/test-sources/plugins/by-name/lf/default.nix diff --git a/plugins/by-name/lf/default.nix b/plugins/by-name/lf/default.nix new file mode 100644 index 00000000..6e68f970 --- /dev/null +++ b/plugins/by-name/lf/default.nix @@ -0,0 +1,33 @@ +{ lib, ... }: +lib.nixvim.plugins.mkNeovimPlugin { + name = "lf"; + packPathName = "lf.nvim"; + package = "lf-nvim"; + + description = '' + Lf file manager integration for Neovim + ''; + + maintainers = [ lib.maintainers.bpeetz ]; + + settingsExample = { + default_action = "drop"; + default_actions = { + "" = "tabedit"; + "" = "split"; + "" = "vsplit"; + "" = "tab drop"; + }; + winblend = 10; + dir = ""; + direction = "float"; + border = "rounded"; + height.__raw = "vim.fn.float2nr(vim.fn.round(0.75 * vim.o.lines))"; + width.__raw = "vim.fn.float2nr(vim.fn.round(0.75 * vim.o.columns))"; + escape_quit = true; + focus_on_open = true; + tmux = false; + default_file_manager = true; + disable_netrw_warning = true; + }; +} diff --git a/tests/test-sources/plugins/by-name/lf/default.nix b/tests/test-sources/plugins/by-name/lf/default.nix new file mode 100644 index 00000000..bed73504 --- /dev/null +++ b/tests/test-sources/plugins/by-name/lf/default.nix @@ -0,0 +1,68 @@ +{ + empty = { + plugins.lf.enable = true; + }; + + defaults = { + plugins.lf = { + enable = true; + + settings = { + default_action = "drop"; + default_actions = { + "" = "tabedit"; + "" = "split"; + "" = "vsplit"; + "" = "tab drop"; + }; + winblend = 10; + layout_mapping = ""; + views = [ + { + width = 0.8; + height = 0.8; + } + { + width = 0.2; + height = 0.9; + col = 0; + row = 0.5; + } + { + width = 1; + height = 0.8; + col = 1; + row = 0; + } + ]; + }; + }; + }; + + example = { + plugins.lf = { + enable = true; + + settings = { + default_action = "drop"; + default_actions = { + "" = "tabedit"; + "" = "split"; + "" = "vsplit"; + "" = "tab drop"; + }; + winblend = 10; + dir = ""; + direction = "float"; + border = "rounded"; + height.__raw = "vim.fn.float2nr(vim.fn.round(0.75 * vim.o.lines))"; + width.__raw = "vim.fn.float2nr(vim.fn.round(0.75 * vim.o.columns))"; + escape_quit = true; + focus_on_open = true; + tmux = false; + default_file_manager = true; + disable_netrw_warning = true; + }; + }; + }; +}