diff --git a/plugins/by-name/fff/default.nix b/plugins/by-name/fff/default.nix new file mode 100644 index 00000000..68106bd9 --- /dev/null +++ b/plugins/by-name/fff/default.nix @@ -0,0 +1,36 @@ +{ lib, ... }: +lib.nixvim.plugins.mkNeovimPlugin { + name = "fff"; + package = "fff-nvim"; + description = "A fast fuzzy file finder."; + + maintainers = [ lib.maintainers.GaetanLepage ]; + + settingsExample = { + base_path = lib.nixvim.nestedLiteralLua "vim.fn.getcwd()"; + max_results = 100; + layout = { + height = 0.8; + width = 0.8; + preview_position = "right"; + }; + key_bindings = { + close = [ + "" + "" + ]; + select_file = ""; + open_split = ""; + open_vsplit = ""; + open_tab = ""; + move_up = [ + "" + "" + ]; + move_down = [ + "" + "" + ]; + }; + }; +} diff --git a/tests/test-sources/plugins/by-name/fff/default.nix b/tests/test-sources/plugins/by-name/fff/default.nix new file mode 100644 index 00000000..a20831da --- /dev/null +++ b/tests/test-sources/plugins/by-name/fff/default.nix @@ -0,0 +1,120 @@ +{ lib, ... }: +{ + empty = { + plugins.fff.enable = true; + }; + + example = { + plugins.fff = { + enable = true; + + settings = { + base_path = lib.nixvim.mkRaw "vim.fn.getcwd()"; + max_results = 100; + layout = { + height = 0.8; + width = 0.8; + preview_position = "right"; + }; + key_bindings = { + close = [ + "" + "" + ]; + select_file = ""; + open_split = ""; + open_vsplit = ""; + open_tab = ""; + move_up = [ + "" + "" + ]; + move_down = [ + "" + "" + ]; + }; + + }; + }; + }; + + defaults = { + plugins.fff = { + enable = true; + + settings = { + base_path = lib.nixvim.mkRaw "vim.fn.getcwd()"; + prompt = "🪿 "; + title = "FFFiles"; + max_results = 100; + max_threads = 4; + lazy_sync = true; + layout = { + height = 0.8; + width = 0.8; + prompt_position = "bottom"; + preview_position = "right"; + preview_size = 0.5; + }; + preview = { + enabled = true; + max_size = lib.nixvim.mkRaw "10 * 1024 * 1024"; + chunk_size = 8192; + binary_file_threshold = 1024; + imagemagick_info_format_str = "%m: %wx%h, %[colorspace], %q-bit"; + line_numbers = false; + wrap_lines = false; + show_file_info = true; + filetypes = { + svg.wrap_lines = true; + markdown.wrap_lines = true; + text.wrap_lines = true; + }; + }; + keymaps = { + close = ""; + select = ""; + select_split = ""; + select_vsplit = ""; + select_tab = ""; + move_up = [ + "" + "" + ]; + move_down = [ + "" + "" + ]; + preview_scroll_up = ""; + preview_scroll_down = ""; + toggle_debug = ""; + }; + hl = { + border = "FloatBorder"; + normal = "Normal"; + cursor = "CursorLine"; + matched = "IncSearch"; + title = "Title"; + prompt = "Question"; + active_file = "Visual"; + frecency = "Number"; + debug = "Comment"; + }; + frecency = { + enabled = true; + db_path = lib.nixvim.mkRaw "vim.fn.stdpath('cache') .. '/fff_nvim'"; + }; + debug = { + enabled = false; + show_scores = false; + }; + logging = { + enabled = true; + log_file = lib.nixvim.mkRaw "vim.fn.stdpath('log') .. '/fff.log'"; + log_level = "info"; + }; + }; + }; + }; +}