From 5863191b7fc081719f359c04f8a2bb3a666f0645 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Fri, 27 Feb 2026 00:40:48 +0530 Subject: Successfully configured auto completion --- modules/tools/fzf/default.nix | 57 +++++++++++++++++++----------------- modules/tools/git/default.nix | 6 ++-- modules/tools/nixvim/keymaps.nix | 2 +- modules/tools/nixvim/plugins/cmp.nix | 5 ++++ modules/tools/nixvim/plugins/lsp.nix | 7 +++++ 5 files changed, 47 insertions(+), 30 deletions(-) (limited to 'modules') diff --git a/modules/tools/fzf/default.nix b/modules/tools/fzf/default.nix index 9fc9457..f971ca9 100644 --- a/modules/tools/fzf/default.nix +++ b/modules/tools/fzf/default.nix @@ -6,37 +6,40 @@ }; config = lib.mkIf config.tools.fzf.enable { - programs.fzf.enable = true; - programs.fzf.defaultOptions = [ - "--height 100%" - "--layout=reverse" - ''--pointer=\" \"'' - ''--header=\" \"'' - ''--prompt=\" \"'' - ''--marker=\"✓ \"'' - "--border=none" - "--cycle" - "--no-info" - "--margin=\"1,2\"" - ]; + programs.fzf = { + enable = true; - programs.fzf.colors = with config.scheme.withHashtag; { - fg = base05; # Foreground - bg = "-1"; # Background (-1 for transparent) - hl = base0D; # Highlight + defaultOptions = [ + "--height 100%" + "--layout=reverse" + ''--pointer=\" \"'' + ''--header=\" \"'' + ''--prompt=\" \"'' + ''--marker=\"✓ \"'' + "--border=none" + "--cycle" + "--no-info" + "--margin=\"1,2\"" + ]; - "fg+" = base07; # Foreground for selected item - "bg+" = "-1"; # Background for selected item - "hl+" = base0D; # Highlight for selected item + colors = with config.scheme.withHashtag; { + fg = base05; # Foreground + bg = "-1"; # Background (-1 for transparent) + hl = base0D; # Highlight - gutter = "-1"; # Remove the white margin at the left + "fg+" = base07; # Foreground for selected item + "bg+" = "-1"; # Background for selected item + "hl+" = base0D; # Highlight for selected item - info = base0B; # Info text (usually count of items) - border = base03; # Border color - prompt = base0A; # Prompt text color - pointer = base0F; # Pointer color (e.g., > for selected) - marker = base0C; # Marker color (e.g., for multi-select) - spinner = base0C; # Spinner color (during search) + gutter = "-1"; # Remove the white margin at the left + + info = base0B; # Info text (usually count of items) + border = base03; # Border color + prompt = base0A; # Prompt text color + pointer = base0F; # Pointer color (e.g., > for selected) + marker = base0C; # Marker color (e.g., for multi-select) + spinner = base0C; # Spinner color (during search) + }; }; }; } diff --git a/modules/tools/git/default.nix b/modules/tools/git/default.nix index dc563ea..f6082f4 100644 --- a/modules/tools/git/default.nix +++ b/modules/tools/git/default.nix @@ -17,8 +17,10 @@ programs.git = { enable = true; settings = { - user.name = config.tools.git.username; - user.email = config.tools.git.email; + user = { + name = config.tools.git.username; + email = config.tools.git.email; + }; credential.helper = "store --file ${config.xdg.cacheHome}/git/credential"; core.askPass = ""; }; diff --git a/modules/tools/nixvim/keymaps.nix b/modules/tools/nixvim/keymaps.nix index 24f3832..60a2ff4 100644 --- a/modules/tools/nixvim/keymaps.nix +++ b/modules/tools/nixvim/keymaps.nix @@ -1,4 +1,4 @@ -{ pkgs, config, lib, ... }: +{ config, lib, ... }: { config = lib.mkIf config.tools.nixvim.enable { diff --git a/modules/tools/nixvim/plugins/cmp.nix b/modules/tools/nixvim/plugins/cmp.nix index e74f468..b02c17e 100644 --- a/modules/tools/nixvim/plugins/cmp.nix +++ b/modules/tools/nixvim/plugins/cmp.nix @@ -12,6 +12,11 @@ "" = "cmp.mapping.select_next_item()"; "" = "cmp.mapping.select_prev_item()"; }; + sources = [ + { name = "nvim_lsp"; } + { name = "path"; } + { name = "buffer"; } + ]; }; }; } diff --git a/modules/tools/nixvim/plugins/lsp.nix b/modules/tools/nixvim/plugins/lsp.nix index be9cc15..f11cf00 100644 --- a/modules/tools/nixvim/plugins/lsp.nix +++ b/modules/tools/nixvim/plugins/lsp.nix @@ -3,6 +3,13 @@ { config.programs.nixvim.plugins.lsp = lib.mkIf config.tools.nixvim.enable { enable = true; + keymaps.lspBuf = { + K = "hover"; + gD = "references"; + gd = "definition"; + gi = "implementation"; + gt = "type_definition"; + }; servers = { nil_ls = { enable = true; -- cgit v1.2.3