aboutsummaryrefslogtreecommitdiffstats
path: root/home-manager/soispha
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-08-25 12:30:36 +0200
committerSoispha <soispha@vhack.eu>2023-08-25 12:31:09 +0200
commitbc198142d4897f48cb914445490ce45de0d75a34 (patch)
tree917ea2f91dfb25673071f19bad663042dcd21551 /home-manager/soispha
parentFix(hm/conf/leap): Squas (diff)
downloadnixos-config-bc198142d4897f48cb914445490ce45de0d75a34.zip
Fix(hm/conf/neovim/plugins/telescope): Init
Diffstat (limited to 'home-manager/soispha')
-rw-r--r--home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix16
-rw-r--r--home-manager/soispha/config/neovim/nixvim/plugins/telescope/default.nix10
-rw-r--r--home-manager/soispha/config/neovim/nixvim/plugins/telescope/defaults/default.nix31
-rw-r--r--home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/default.nix6
-rw-r--r--home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/frecency/default.nix22
-rw-r--r--home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/fzy-native/default.nix5
-rw-r--r--home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/symbols/default.nix20
-rw-r--r--home-manager/soispha/config/neovim/nixvim/plugins/telescope/keymaps/default.nix21
8 files changed, 115 insertions, 16 deletions
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";
};
- "<space>gd" = {
- action = "definition";
- desc = "[G]o to [d]efinition";
- };
"<space>hi" = {
action = "hover";
desc = "Display [h]over [i]nformation";
};
- "<space>gi" = {
- action = "implementation";
- desc = "[G]o to the [i]mplementations";
- };
"<space>sh" = {
action = "signature_help";
desc = "Display [s]ignature [h]elp";
@@ -48,10 +40,6 @@
action = "remove_workspace_folder";
desc = "[W]orkspace folder [r]emove";
};
- "<space>gtd" = {
- action = "type_definition";
- desc = "[G]o to the [t]ype [d]efinition under the cursor";
- };
"<space>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";
};
- "<space>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 <c-h> (default: <c-/>)
+ # actions.which_key shows the mappings for your picker,
+ # e.g. git_{create, delete, ...}_branch for the git_branches picker
+ "<C-h>" = "which_key";
+ };
+ in {
+ i =
+ insert_and_normal_mappings;
+ n =
+ {
+ "t" = "move_selection_next";
+ "n" = "move_selection_previous";
+ "<Space>" = "toggle_all";
+
+ "<C-d>" = "preview_scrolling_up";
+ "<C-u>" = "preview_scrolling_down";
+ "<Left>" = "preview_scrolling_left";
+ "<Right>" = "preview_scrolling_right";
+
+ "<Esc>" = "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
+ "<space>gd" = {
+ action = "lsp_definitions";
+ desc = "[G]oto [D]efinition (Telescope)";
+ };
+ "<space>gtd" = {
+ action = "lsp_type_definitions";
+ desc = "[G]oto the [t]ype [D]efinition (Telescope)";
+ };
+ "<space>gi" = {
+ action = "lsp_implementations";
+ desc = "[G]oto [I]mplementations (Telescope)";
+ };
+ "<space>gr" = {
+ action = "lsp_references";
+ desc = "[G]o to all [R]eferences of the symbol (Telescope)";
+ };
+ };
+}