summary refs log tree commit diff stats
path: root/user/settings/neovim.nix
diff options
context:
space:
mode:
Diffstat (limited to 'user/settings/neovim.nix')
-rw-r--r--user/settings/neovim.nix143
1 files changed, 97 insertions, 46 deletions
diff --git a/user/settings/neovim.nix b/user/settings/neovim.nix
index dcee5fde..d04de0b8 100644
--- a/user/settings/neovim.nix
+++ b/user/settings/neovim.nix
@@ -1,58 +1,109 @@
-{ pkgs
+{ config
 , ...
-}: {
-  programs.neovim = {
+}:
+let
+  nixvim = import <nixvim>;
+in
+{
+  imports = [
+    nixvim.homeManagerModules.nixvim
+  ];
+
+  programs.nixvim = {
     enable = true;
     defaultEditor = true;
+
+    nixpkgs.config = config.nixpkgs.config;
+
     viAlias = true;
     vimAlias = true;
     vimdiffAlias = true;
-    withNodeJs = true;
-    plugins = with pkgs.vimPlugins; [
-      commentary
-      conjure
-      coc-git
-      coc-json
-      coc-yaml
-      direnv-vim
-      (nvim-treesitter.withPlugins (
-        plugins: with plugins; [
-          nix
-        ]
-      ))
-      telescope-nvim
-      telescope-fzf-native-nvim
-      vim-polyglot
-      vim-tridactyl
-      vim-surround
-    ];
-    extraLuaConfig = builtins.readFile ../nvim/init.lua;
-    coc = {
-      enable = true;
-      settings = {
-        "json.enable" = true;
-        languageserver = {
-          nix = {
-            command = "${pkgs.nil}/bin/nil";
-            filetypes = [ "nix" ];
-            rootPatterns = [ "flake.nix" ];
-            settings = {
-              coc.preferences.formatOnSaveFiletypes = [ "nix" ];
-              links.tooltip = true;
-              semanticTokens = {
-                filetypes = [ "nix" ];
-              };
-              nil = {
-                formatting.command = [ "nixpkgs-fmt" ];
-                nix.flake.autoArchive = true;
-              };
-            };
+
+    # withRuby = false;
+
+    clipboard.register = "unnamed";
+    opts = {
+      autoindent = true;
+      number = true;
+      relativenumber = true;
+      shiftwidth = 2;
+      background = "light";
+    };
+    globals.mapleader = ",";
+
+    colorscheme = "shine";
+
+    performance = {
+      byteCompileLua = {
+        enable = true;
+        nvimRuntime = true;
+        plugins = true;
+      };
+    };
+
+    plugins = {
+      blink-cmp = {
+        enable = true;
+        settings = {
+          keymap.preset = "super-tab";
+        };
+      };
+
+      mini = {
+        enable = true;
+        mockDevIcons = true;
+        modules.icons = {
+          style = "glyph";
+        };
+        modules.basics = { };
+      };
+
+      lsp = {
+        enable = true;
+        keymaps = {
+          lspBuf = {
+            gD = "references";
+            gd = "definition";
+            gi = "implementation";
+            gt = "type_definition";
           };
-          lua = {
-            command = "${pkgs.lua-language-server}/bin/lua-language-server";
-            filetypes = [ "lua" ];
+        };
+      };
+
+      direnv.enable = true;
+      friendly-snippets.enable = true;
+      nvim-snippets = {
+        enable = true;
+        settings.friendly_snippets = true;
+        luaConfig.post = ''
+          local capabilities = vim.lsp.protocol.make_client_capabilities()
+          capabilities.textDocument.completion.completionItem.snippetSupport = true
+
+          require'lspconfig'.cssls.setup {
+            capabilities = capabilities,
+          }
+        '';
+      };
+      nvim-surround.enable = true;
+      telescope = {
+        enable = true;
+        keymaps = {
+          "<leader>ff" = "find_files";
+          "<leader>fg" = "live_grep";
+          "<leader>bb" = "buffers";
+          "<leader>pf" = "git_files";
+          "<leader>fh" = "help_tags";
+        };
+        settings = {
+          mappings = {
+            i = {
+              "<C-h>" = "which_key";
+            };
           };
         };
+        extensions = {
+          fzf-native.enable = true;
+        };
       };
     };
   };