diff --git a/configuration.nix b/configuration.nix index 6b3b2f3..3d01b41 100644 --- a/configuration.nix +++ b/configuration.nix @@ -4,7 +4,7 @@ ./hardware-configuration.nix ./easyroam.nix ./stylix.nix - ./nixvim.nix + ./nixvim/nixvim.nix ]; boot.loader.systemd-boot.enable = true; diff --git a/home/home.nix b/home/home.nix index fdfb729..03350ab 100644 --- a/home/home.nix +++ b/home/home.nix @@ -9,7 +9,6 @@ imports = [ ./stylix.nix inputs.nixcord.homeModules.nixcord - inputs.nixvim.homeModules.nixvim ]; # Home Manager needs a bit of information about you and the # paths it should manage. diff --git a/nixvim/keymaps.nix b/nixvim/keymaps.nix new file mode 100644 index 0000000..0609ab5 --- /dev/null +++ b/nixvim/keymaps.nix @@ -0,0 +1,29 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + programs.nixvim = { + keymaps = [ + { + key = ""; + action = " lua vim.lsp.buf.format() "; + } + { + key = "t"; + action = " terminal "; + } + { + key = ""; + action = ""; + mode = "t"; + } + { + key = ""; + action = " lua bdelete! "; + } + ]; + }; +} diff --git a/nixvim/nixvim.nix b/nixvim/nixvim.nix new file mode 100644 index 0000000..63c405c --- /dev/null +++ b/nixvim/nixvim.nix @@ -0,0 +1,59 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + imports = [ + ./plugins.nix + ./keymaps.nix + ]; + programs.nixvim = { + enable = true; + extraConfigLuaPost = '' + local map = vim.keymap.set + for i = 1, 10 do + map('n', '', ' LualineBuffersJump! ' .. i .. '') + end + ''; + opts = { + relativenumber = true; + tabstop = 8; + shiftwidth = 8; + expandtab = true; + swapfile = false; + }; + extraPackages = with pkgs; [ + nixfmt + ]; + lsp = { + inlayHints.enable = true; + servers = { + clangd.enable = true; + qmlls.enable = true; + lua-language-server.enable = true; + rust_analyzer.enable = true; + nixd = { + enable = true; + config = { + formatting = { + command = "nixfmt"; + }; + }; + }; + }; + }; + globals = { + mapleader = " "; + }; + diagnostic = { + settings = { + virtual_text = { + spacing = 4; + source = true; + }; + }; + }; + }; +} diff --git a/nixvim.nix b/nixvim/plugins.nix similarity index 51% rename from nixvim.nix rename to nixvim/plugins.nix index fcbe839..9d07e42 100644 --- a/nixvim.nix +++ b/nixvim/plugins.nix @@ -1,45 +1,11 @@ { - config, lib, + config, pkgs, ... }: { programs.nixvim = { - enable = true; - extraConfigLuaPost = '' - local map = vim.keymap.set - for i = 1, 10 do - map('n', '', ' LualineBuffersJump! ' .. i .. '') - end - ''; - opts = { - relativenumber = true; - tabstop = 8; - shiftwidth = 8; - expandtab = true; - swapfile = false; - }; - extraPackages = with pkgs; [ - nixfmt - ]; - lsp = { - inlayHints.enable = true; - servers = { - clangd.enable = true; - qmlls.enable = true; - lua-language-server.enable = true; - rust_analyzer.enable = true; - nixd = { - enable = true; - config = { - formatting = { - command = "nixfmt"; - }; - }; - }; - }; - }; plugins = { lspconfig.enable = true; blink-cmp = { @@ -102,35 +68,6 @@ }; }; }; - globals = { - mapleader = " "; - }; - diagnostic = { - settings = { - virtual_text = { - spacing = 4; - source = true; - }; - }; - }; - keymaps = [ - { - key = ""; - action = " lua vim.lsp.buf.format() "; - } - { - key = "t"; - action = " terminal "; - } - { - key = ""; - action = ""; - mode = "t"; - } - { - key = ""; - action = " lua bdelete! "; - } - ]; }; + }