From bc198142d4897f48cb914445490ce45de0d75a34 Mon Sep 17 00:00:00 2001 From: Soispha Date: Fri, 25 Aug 2023 12:30:36 +0200 Subject: Fix(hm/conf/neovim/plugins/telescope): Init --- .../neovim/nixvim/plugins/lsp/keymaps/default.nix | 16 ----------- .../neovim/nixvim/plugins/telescope/default.nix | 10 +++++++ .../nixvim/plugins/telescope/defaults/default.nix | 31 ++++++++++++++++++++++ .../plugins/telescope/extensions/default.nix | 6 +++++ .../telescope/extensions/frecency/default.nix | 22 +++++++++++++++ .../telescope/extensions/fzy-native/default.nix | 5 ++++ .../telescope/extensions/symbols/default.nix | 20 ++++++++++++++ .../nixvim/plugins/telescope/keymaps/default.nix | 21 +++++++++++++++ 8 files changed, 115 insertions(+), 16 deletions(-) create mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/default.nix create mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/defaults/default.nix create mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/default.nix create mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/frecency/default.nix create mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/fzy-native/default.nix create mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/symbols/default.nix create mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/keymaps/default.nix (limited to 'home-manager') diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix index 1cca9866..66d4eb93 100644 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix +++ b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix @@ -24,18 +24,10 @@ action = "declaration"; desc = "[G]o to [d]eclaration"; }; - "gd" = { - action = "definition"; - desc = "[G]o to [d]efinition"; - }; "hi" = { action = "hover"; desc = "Display [h]over [i]nformation"; }; - "gi" = { - action = "implementation"; - desc = "[G]o to the [i]mplementations"; - }; "sh" = { action = "signature_help"; desc = "Display [s]ignature [h]elp"; @@ -48,10 +40,6 @@ action = "remove_workspace_folder"; desc = "[W]orkspace folder [r]emove"; }; - "gtd" = { - action = "type_definition"; - desc = "[G]o to the [t]ype [d]efinition under the cursor"; - }; "rn" = { action = "rename"; desc = "[R]e[n]ame the item under the cursor"; @@ -60,10 +48,6 @@ action = "code_action"; desc = "Open the [c]ode [a]ction menu"; }; - "gr" = { - action = "references"; - desc = "[G]o to all [r]eferences to the symbol"; - }; }; }; maps = { diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/default.nix new file mode 100644 index 00000000..b5054ed0 --- /dev/null +++ b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/default.nix @@ -0,0 +1,10 @@ +{...}: { + imports = [ + ./defaults + ./keymaps + ./extensions + ]; + programs.nixvim.plugins.telescope = { + enable = true; + }; +} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/defaults/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/defaults/default.nix new file mode 100644 index 00000000..e8dffca8 --- /dev/null +++ b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/defaults/default.nix @@ -0,0 +1,31 @@ +{...}: { + programs.nixvim.plugins.telescope.defaults = { + mappings = let + insert_and_normal_mappings = { + # map actions.which_key to (default: ) + # actions.which_key shows the mappings for your picker, + # e.g. git_{create, delete, ...}_branch for the git_branches picker + "" = "which_key"; + }; + in { + i = + insert_and_normal_mappings; + n = + { + "t" = "move_selection_next"; + "n" = "move_selection_previous"; + "" = "toggle_all"; + + "" = "preview_scrolling_up"; + "" = "preview_scrolling_down"; + "" = "preview_scrolling_left"; + "" = "preview_scrolling_right"; + + "" = "close"; + "q" = "close"; + } + // insert_and_normal_mappings; + }; + + }; +} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/default.nix new file mode 100644 index 00000000..ddaf47ee --- /dev/null +++ b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/default.nix @@ -0,0 +1,6 @@ +{...}: { + imports = [ + ./frecency + ./fzy-native + ]; +} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/frecency/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/frecency/default.nix new file mode 100644 index 00000000..ab7b9205 --- /dev/null +++ b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/frecency/default.nix @@ -0,0 +1,22 @@ +{...}: { + programs.nixvim = { + maps = { + normal = { + "gff" = { + action = "function() require('telescope').extensions.frecency.frecency() end"; + lua = true; + desc = "activate the frecency file selection"; + }; + }; + }; + plugins.telescope = { + extensions.frecency = { + enable = true; + showUnindexed = true; + showScores = true; + # TODO add this: + #db_safe_mode = true; + }; + }; + }; +} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/fzy-native/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/fzy-native/default.nix new file mode 100644 index 00000000..9653177c --- /dev/null +++ b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/fzy-native/default.nix @@ -0,0 +1,5 @@ +{...}: { + programs.nixvim.plugins.telescope.extensions.fzy-native = { + enable = true; + }; +} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/symbols/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/symbols/default.nix new file mode 100644 index 00000000..bbe19fb6 --- /dev/null +++ b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/symbols/default.nix @@ -0,0 +1,20 @@ +{...}: { + programs.nixvim.maps = { + normal = { + "gff" = { + action = "function() require('telescope').extensions.frecency.frecency() end"; + lua = true; + desc = "activate the frecency file selection"; + }; + }; + }; + programs.nixvim.plugins.telescope = { + extensions.frecency = { + enable = true; + showUnindexed = true; + showScores = true; + # TODO add this: + #db_safe_mode = true; + }; + }; +} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/keymaps/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/keymaps/default.nix new file mode 100644 index 00000000..a0ffdd5e --- /dev/null +++ b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/keymaps/default.nix @@ -0,0 +1,21 @@ +{...}: { + programs.nixvim.plugins.telescope.keymaps = { + # TODO add diagnostics and workspace symbols here + "gd" = { + action = "lsp_definitions"; + desc = "[G]oto [D]efinition (Telescope)"; + }; + "gtd" = { + action = "lsp_type_definitions"; + desc = "[G]oto the [t]ype [D]efinition (Telescope)"; + }; + "gi" = { + action = "lsp_implementations"; + desc = "[G]oto [I]mplementations (Telescope)"; + }; + "gr" = { + action = "lsp_references"; + desc = "[G]o to all [R]eferences of the symbol (Telescope)"; + }; + }; +} -- cgit 1.4.1