diff --git a/lib/mkNeovim.nix b/lib/mkNeovim.nix index c0e0c70..d638598 100644 --- a/lib/mkNeovim.nix +++ b/lib/mkNeovim.nix @@ -10,16 +10,18 @@ let userDir = ../users + "/${user}"; userConfig = import (userDir + "/user.nix"); -in -(inputs.nvf.lib.neovimConfiguration { - inherit pkgs; - modules = builtins.filter (f: f != null) [ - (../users + ("/" + user + "/vim.nix")) - ../modules/neovim - ]; - extraSpecialArgs = { - inherit host; - flake = self; - user = userConfig; + + config = inputs.nvf.lib.neovimConfiguration { + inherit pkgs; + modules = builtins.filter (f: f != null) [ + (../users + ("/" + user + "/vim.nix")) + ../modules/neovim + ]; + extraSpecialArgs = { + inherit host; + flake = self; + user = userConfig; + }; }; -}).neovim +in +config.neovim // { input = config; } diff --git a/modules/neovim/blink-cmp.nix b/modules/neovim/blink-cmp.nix new file mode 100644 index 0000000..1b186a4 --- /dev/null +++ b/modules/neovim/blink-cmp.nix @@ -0,0 +1,32 @@ +{ ... }: +{ + vim.autocomplete.blink-cmp = { + enable = true; + mappings = { + close = null; + complete = null; + confirm = null; + next = null; + previous = null; + scrollDocsDown = null; + scrollDocsUp = null; + }; + setupOpts = { + keymap = { + preset = "super-tab"; + }; + completion = { + ghost_text.enabled = false; + list.selection.preselect = true; + trigger = { + show_in_snippet = true; + }; + }; + signature.enabled = true; + }; + sourcePlugins = { + ripgrep.enable = true; + }; + friendly-snippets.enable = true; + }; +} diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index 5d9d90e..9d73ffb 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -9,6 +9,7 @@ ./formatter.nix ./keybind.nix ./options.nix + ./blink-cmp.nix ]; # based on default options from upstream: # https://github.com/NotAShelf/nvf/blob/main/configuration.nix @@ -22,12 +23,10 @@ extraLuaFiles = [ ./commands/FullscreenTerm.lua ./commands/SmartQuit.lua + + ./extra.lua ]; - - theme = { - enable = true; - }; - + theme.enable = true; visuals = { # notification system # https://github.com/j-hui/fidget.nvim @@ -110,8 +109,6 @@ clang.enable = true; css.enable = true; html.enable = true; - lua.enable = true; - markdown.enable = true; nix.enable = true; python.enable = true; rust.crates.enable = true; @@ -119,6 +116,8 @@ ts.enable = true; zig.enable = true; # sort-lines: off + + nix.lsp.servers = "nixd"; }; filetree.neo-tree = { enable = true; @@ -149,36 +148,6 @@ }; }; }; - autocomplete.blink-cmp = { - enable = true; - mappings = { - close = null; - complete = null; - confirm = null; - next = null; - previous = null; - scrollDocsDown = null; - scrollDocsUp = null; - }; - setupOpts = { - keymap = { - preset = "super-tab"; - }; - completion = { - ghost_text.enabled = false; - list.selection.preselect = true; - trigger = { - show_in_snippet = true; - }; - accept.auto_brackets.enabled = true; - }; - signature.enabled = true; - }; - sourcePlugins = { - ripgrep.enable = true; - }; - friendly-snippets.enable = true; - }; statusline = { lualine = { enable = true; diff --git a/modules/neovim/extra.lua b/modules/neovim/extra.lua new file mode 100644 index 0000000..8c91ba4 --- /dev/null +++ b/modules/neovim/extra.lua @@ -0,0 +1,2 @@ +-- not sure how to add this in nix +require("fzf-lua").register_ui_select() diff --git a/modules/neovim/keybind.nix b/modules/neovim/keybind.nix index bcb6b2e..a57c35d 100644 --- a/modules/neovim/keybind.nix +++ b/modules/neovim/keybind.nix @@ -35,7 +35,7 @@ in # lsp code-action = keyCmd "n" "ca" - "FzfLua lsp_code_actions winopts.height=8 winopts.width=50 winopts.backdrop=100 winopts.title=false winopts.preview.title=false winopts.row=1 winopts.preview.hidden=true"; + "FzfLua lsp_code_actions winopts.height=8 winopts.width=50 winopts.backdrop=100 winopts.title=false winopts.preview.title=false winopts.row=1 winopts.preview.hidden=true silent=true"; # subtle nice features visual-dedent = keyRemap "v" "<" "