From 214b8dea909d7fcafd4570ac6dd6a569e2ab2339 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Thu, 22 May 2025 18:35:38 +0800 Subject: [PATCH] feat(nvf): WIP bloating --- modules/home/cli/editor/nvf/autocomplete.nix | 32 +++++++++++++++++++- modules/home/cli/editor/nvf/clipboard.nix | 6 ++++ modules/home/cli/editor/nvf/default.nix | 9 +++++- modules/home/cli/editor/nvf/diagnostics.nix | 6 ++++ modules/home/cli/editor/nvf/keymaps.nix | 7 +++++ modules/home/cli/editor/nvf/languages.nix | 26 ++++++++++++++-- modules/home/cli/editor/nvf/notify.nix | 2 +- modules/home/cli/editor/nvf/visuals.nix | 1 - modules/nixos/system/nix-config.nix | 3 +- 9 files changed, 84 insertions(+), 8 deletions(-) create mode 100644 modules/home/cli/editor/nvf/clipboard.nix create mode 100644 modules/home/cli/editor/nvf/diagnostics.nix diff --git a/modules/home/cli/editor/nvf/autocomplete.nix b/modules/home/cli/editor/nvf/autocomplete.nix index 0adaead..65193a3 100644 --- a/modules/home/cli/editor/nvf/autocomplete.nix +++ b/modules/home/cli/editor/nvf/autocomplete.nix @@ -1,6 +1,36 @@ +{ lib }: { blink-cmp = { enable = true; - setupOpts.signature.enabled = true; + friendly-snippets.enable = true; + mappings = { + next = ""; # FIXME: results in the menu appearing when navigating + previous = ""; + }; + sourcePlugins = { + emoji.enable = true; + ripgrep.enable = true; + spell.enable = true; + }; + setupOpts = { + completion.documentation.auto_show_delay_ms = 0; + signature.enabled = true; + enabled = + lib.generators.mkLuaInline + # lua + '' + --- Disable completion for markdown + function() + return not vim.tbl_contains({"markdown"}, vim.bo.filetype) + and vim.bo.buftype ~= "prompt" + and vim.b.completion ~= false + end + ''; + cmdline = { + enabled = true; + sources = null; + completion.menu.auto_show = false; + }; + }; }; } diff --git a/modules/home/cli/editor/nvf/clipboard.nix b/modules/home/cli/editor/nvf/clipboard.nix new file mode 100644 index 0000000..a6eaa9a --- /dev/null +++ b/modules/home/cli/editor/nvf/clipboard.nix @@ -0,0 +1,6 @@ +{ + enable = true; + #FIXME: List doenst work for some reason + registers = "unnamedplus"; + providers.wl-copy.enable = true; +} diff --git a/modules/home/cli/editor/nvf/default.nix b/modules/home/cli/editor/nvf/default.nix index 185df36..c3cd7a7 100644 --- a/modules/home/cli/editor/nvf/default.nix +++ b/modules/home/cli/editor/nvf/default.nix @@ -8,12 +8,19 @@ programs.nvf = { enable = true; settings.vim = { + hideSearchHighlight = true; undoFile.enable = true; - autocomplete = import ./autocomplete.nix; + fzf-lua.enable = true; + git.enable = true; + autocomplete = import ./autocomplete.nix { inherit lib; }; + autopairs.nvim-autopairs.enable = true; binds = import ./binds.nix; + clipboard = import ./clipboard.nix; + diagnostics = import ./diagnostics.nix; keymaps = import ./keymaps.nix; languages = import ./languages.nix; lsp = import ./lsp.nix; + options = import ./options.nix; notify = import ./notify.nix; utility = import ./utility.nix; diff --git a/modules/home/cli/editor/nvf/diagnostics.nix b/modules/home/cli/editor/nvf/diagnostics.nix new file mode 100644 index 0000000..6b1d100 --- /dev/null +++ b/modules/home/cli/editor/nvf/diagnostics.nix @@ -0,0 +1,6 @@ +{ + nvim-lint = { + enable = true; + lint_after_save = true; + }; +} diff --git a/modules/home/cli/editor/nvf/keymaps.nix b/modules/home/cli/editor/nvf/keymaps.nix index 6b53f99..a9bd489 100644 --- a/modules/home/cli/editor/nvf/keymaps.nix +++ b/modules/home/cli/editor/nvf/keymaps.nix @@ -1,4 +1,11 @@ [ + { + desc = ""; + key = "f"; + mode = "n"; + action = ":FzfLua files"; + silent = true; + } { desc = "Open the file path under the cursor, making the file if it doesn't exist."; key = "gf"; diff --git a/modules/home/cli/editor/nvf/languages.nix b/modules/home/cli/editor/nvf/languages.nix index 9fe5d1f..45d0beb 100644 --- a/modules/home/cli/editor/nvf/languages.nix +++ b/modules/home/cli/editor/nvf/languages.nix @@ -2,7 +2,27 @@ enableExtraDiagnostics = true; enableFormat = true; enableTreesitter = true; - nix.enable = true; - nix.format.type = "nixfmt"; - nix.lsp.server = "nixd"; + bash.enable = true; + clang.enable = true; + csharp.enable = true; + css.enable = true; + go.enable = true; + html.enable = true; + lua.enable = true; + markdown.enable = true; + markdown.extensions.markview-nvim.enable = true; + nix = { + enable = true; + format.type = "nixfmt"; + lsp.server = "nil"; + }; + python.enable = true; + python.lsp.server = "python-lsp-server"; + rust.enable = true; + rust.crates.enable = true; + ts.enable = true; + ts.extensions.ts-error-translator.enable = true; + typst.enable = true; + typst.extensions.typst-preview-nvim.enable = true; + yaml.enable = true; } diff --git a/modules/home/cli/editor/nvf/notify.nix b/modules/home/cli/editor/nvf/notify.nix index ebf1415..0db3279 100644 --- a/modules/home/cli/editor/nvf/notify.nix +++ b/modules/home/cli/editor/nvf/notify.nix @@ -1,3 +1,3 @@ { - nvim-notify.enable = true; + } diff --git a/modules/home/cli/editor/nvf/visuals.nix b/modules/home/cli/editor/nvf/visuals.nix index f669ab0..3982421 100644 --- a/modules/home/cli/editor/nvf/visuals.nix +++ b/modules/home/cli/editor/nvf/visuals.nix @@ -1,7 +1,6 @@ { indent-blankline.enable = true; fidget-nvim.enable = true; - highlight-undo.enable = true; nvim-cursorline.enable = true; nvim-web-devicons.enable = true; rainbow-delimiters.enable = true; diff --git a/modules/nixos/system/nix-config.nix b/modules/nixos/system/nix-config.nix index 9db6db6..85df7df 100644 --- a/modules/nixos/system/nix-config.nix +++ b/modules/nixos/system/nix-config.nix @@ -1,7 +1,8 @@ -{ config, ... }: +{ config, inputs, ... }: { config = { nixpkgs.config.allowUnfree = true; + nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; nix.settings = { experimental-features = [