From 79fbb9b446838f561753805601bd7285b1b046fa Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 7 Mar 2024 09:58:32 +0530 Subject: [PATCH] add wilder --- config/default.nix | 3 +++ config/utils/vim-be-good.nix | 6 +++++ config/utils/whichkey.nix | 20 ++++++++++++++++ config/utils/wilder.nix | 44 ++++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 config/utils/vim-be-good.nix create mode 100644 config/utils/whichkey.nix create mode 100644 config/utils/wilder.nix diff --git a/config/default.nix b/config/default.nix index a419ef6..0e40cec 100644 --- a/config/default.nix +++ b/config/default.nix @@ -74,5 +74,8 @@ ./utils/toggleterm.nix ./utils/ultimate-autopair.nix ./utils/undotree.nix + ./utils/vim-be-good.nix + ./utils/whichkey.nix + ./utils/wilder.nix ]; } diff --git a/config/utils/vim-be-good.nix b/config/utils/vim-be-good.nix new file mode 100644 index 0000000..718ae19 --- /dev/null +++ b/config/utils/vim-be-good.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + extraPlugins = with pkgs.vimPlugins; [ + vim-be-good + ]; +} diff --git a/config/utils/whichkey.nix b/config/utils/whichkey.nix new file mode 100644 index 0000000..f99d9ab --- /dev/null +++ b/config/utils/whichkey.nix @@ -0,0 +1,20 @@ +{ + # TODO: Implement general mappings + plugins.which-key = { + enable = true; + ignoreMissing = false; + icons = { + breadcrumb = "ยป"; + group = "+"; + separator = "๎ฎŠ"; # โžœ + }; + # registrations = { + # "t" = "๎ž• Terminal"; + # }; + window = { + border = "none"; + winblend = 0; + }; + }; +} + diff --git a/config/utils/wilder.nix b/config/utils/wilder.nix new file mode 100644 index 0000000..f469b0c --- /dev/null +++ b/config/utils/wilder.nix @@ -0,0 +1,44 @@ +{ + plugins.wilder = { + enable = true; + modes = [":" "/" "?"]; + pipeline = [ + '' + wilder.branch( + wilder.python_file_finder_pipeline({ + file_command = function(ctx, arg) + if string.find(arg, '.') ~= nil then + return {'fd', '-tf', '-H'} + else + return {'fd', '-tf'} + end + end, + dir_command = {'fd', '-td'}, + filters = {'cpsm_filter'}, + }), + wilder.substitute_pipeline({ + pipeline = wilder.python_search_pipeline({ + skip_cmdtype_check = 1, + pattern = wilder.python_fuzzy_pattern({ + start_at_boundary = 0, + }), + }), + }), + wilder.cmdline_pipeline({ + language = 'python', + fuzzy = 1, + }), + { + wilder.check(function(ctx, x) return x == "" end), + wilder.history(), + }, + wilder.python_search_pipeline({ + pattern = wilder.python_fuzzy_pattern({ + start_at_boundary = 0, + }), + }) + ) '' + ]; + }; +} +