From cf1470cb639912c7c5381a3341d6cc0a2ceba7ed Mon Sep 17 00:00:00 2001 From: Cookiez Date: Tue, 24 Mar 2026 09:30:30 +0100 Subject: [PATCH] Added Neovim Plugins: - Remenber where you exited file - Limited treesitter header context - Added autocompletion --- modules/neovim/home.nix | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/modules/neovim/home.nix b/modules/neovim/home.nix index 051dd88..02a7d87 100644 --- a/modules/neovim/home.nix +++ b/modules/neovim/home.nix @@ -65,6 +65,8 @@ ]; plugins = { + # Remeber where you left the file last time + lastplace.enable = true; # Statusline at the bottom of the screen lualine.enable = true; # Tab bar at the top of the screen @@ -84,7 +86,40 @@ }; }; # Shows the current function/class context pinned at the top of the buffer - treesitter-context.enable = true; + treesitter-context = { + enable = true; + settings = { + # Cap the context header + max_lines = 4; + # When over the limit, drop outermost context + trim_scope = "outer"; + # Only show context in tall-enough windows + min_window_height = 20; + }; + }; + + # Provides autocompletion suggestions + blink-cmp = { + enable = true; + settings = { + keymap.preset = "default"; # Tab/S-Tab to navigate, Enter to confirm + sources.default = ["lsp" "path" "snippets" "buffer"]; + completion = { + documentation.auto_show = true; + ghost_text.enabled = true; # inline preview of the top suggestion + }; + }; + }; + + lsp = { + enable = true; + servers = { + nixd.enable = true; # Nix + ts_ls.enable = true; # TypeScript/JavaScript + # ... add more as needed + }; + }; + # Text objects based on treesitter nodes (e.g. select a function body) treesitter-textobjects.enable = true; # Auto-closes and renames HTML/JSX tags using treesitter