big nvim updates

This commit is contained in:
Vivian 2024-03-19 10:14:30 +01:00
parent 636e23deb7
commit 5eefa66896
4 changed files with 112 additions and 61 deletions

View file

@ -1,3 +1,3 @@
{ ... }: { { ... }: {
imports = [ ./catppuccin.nix ./nvim.nix ./riff.nix ./vscode.nix ./git.nix ./rust.nix ]; imports = [ ./catppuccin.nix ./nvim ./riff.nix ./vscode.nix ./git.nix ./rust.nix ];
} }

View file

@ -3,6 +3,7 @@ let cfg = config.programs.v.nvim;
in with lib; { in with lib; {
options.programs.v.nvim = { enable = mkEnableOption "nvim"; }; options.programs.v.nvim = { enable = mkEnableOption "nvim"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ fd ];
programs.nixvim = { programs.nixvim = {
enable = true; enable = true;
package = pkgs.neovim-unwrapped; package = pkgs.neovim-unwrapped;
@ -13,14 +14,13 @@ in with lib; {
options.number = true; options.number = true;
clipboard = { providers.wl-copy.enable = true; }; clipboard.providers.wl-copy.enable = true;
keymaps = [ keymaps = [
{ {
mode = "n"; mode = "n";
key = "<leader>ff"; key = "<leader>ff";
action = "require('telescope.builtin').find_files"; action = ":Telescope file_browser<CR>";
lua = true;
} }
{ {
mode = "n"; mode = "n";
@ -28,6 +28,11 @@ in with lib; {
action = "require('telescope.builtin').live_grep"; action = "require('telescope.builtin').live_grep";
lua = true; lua = true;
} }
{
mode = "n";
key = "<leader>fb";
action = ":Telescope file_browser<CR>";
}
{ {
mode = "n"; mode = "n";
key = "<C-_>"; key = "<C-_>";
@ -48,12 +53,6 @@ in with lib; {
''; '';
lua = true; lua = true;
} }
{
mode = "n";
key = "g=";
action = "vim.lsp.buf.format";
lua = true;
}
{ {
mode = "n"; mode = "n";
key = "t"; key = "t";
@ -75,6 +74,7 @@ in with lib; {
key = "<S-C-Tab>"; key = "<S-C-Tab>";
action = ":bp<CR>"; action = ":bp<CR>";
} }
# Change Indenting
{ {
mode = "n"; mode = "n";
key = "<S-Tab>"; key = "<S-Tab>";
@ -90,14 +90,36 @@ in with lib; {
key = "<S-Tab>"; key = "<S-Tab>";
action = "<gv"; action = "<gv";
} }
# Neotest
{
mode = "n";
key = "<leader>nr";
lua = true;
action = "require('neotest').run.run";
}
{
mode = "n";
key = "<leader>no";
lua = true;
action = "require('neotest').output.open";
}
{
mode = "n";
key = "<leader>ns";
lua = true;
action = "require('neotest').run.stop";
}
{
mode = "n";
key = "<leader>nf";
lua = true;
action = "function() require('neotest').run.run(vim.fn.expand('%')) end";
}
]; ];
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
FixCursorHold-nvim FixCursorHold-nvim
plenary-nvim nvim-web-devicons
neotest
neotest-plenary
neotest-rust
]; ];
colorschemes.catppuccin = { colorschemes.catppuccin = {
@ -105,21 +127,32 @@ in with lib; {
flavour = "frappe"; flavour = "frappe";
}; };
extraConfigLua = '' extraConfigLua = "";
require("neotest").setup({
adapters = {
require("neotest-plenary"),
require("neotest-rust") {
args = { "--no-capture" },
}
},
})
'';
plugins = { plugins = {
bufferline.enable = true; bufferline.enable = true;
nix.enable = true; nix.enable = true;
luasnip.enable = true; luasnip.enable = true;
typst-vim.enable = true;
fidget = {
enable = true;
progress = {
ignoreDoneAlready = true;
ignore = [ "ltex" ];
};
notification = {
overrideVimNotify = true;
# group_seperator = "";
};
};
neotest = {
enable = true;
adapters.plenary.enable = true;
adapters.rust = {
enable = true;
settings.args = [ "--no-capture" ];
};
};
treesitter = { treesitter = {
enable = true; enable = true;
nixGrammars = true; nixGrammars = true;
@ -134,12 +167,31 @@ in with lib; {
}; };
telescope = { telescope = {
enable = true; enable = true;
extensions.file_browser = {
enable = true;
hijackNetrw = true;
};
extensions.fzf-native.enable = true; extensions.fzf-native.enable = true;
extensions.fzf-native.fuzzy = true; extensions.fzf-native.fuzzy = true;
}; };
comment-nvim = { enable = true; }; comment-nvim = { enable = true; };
lsp = { lsp = {
enable = true; enable = true;
keymaps = {
lspBuf = {
K = "hover";
gD = "references";
gd = "definition";
gi = "implementation";
gt = "type_definition";
"g=" = "format";
};
diagnostic = {
"<leader>j" = "goto_next";
"<leader>k" = "goto_prev";
};
};
servers = { servers = {
nil_ls.enable = true; nil_ls.enable = true;
dockerls.enable = true; dockerls.enable = true;

72
flake.lock generated
View file

@ -710,11 +710,11 @@
"systems": "systems_6" "systems": "systems_6"
}, },
"locked": { "locked": {
"lastModified": 1709126324, "lastModified": 1710146030,
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "d465f4819400de7c8d874d50b982301f28a84605", "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -897,11 +897,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1710714957, "lastModified": 1710820906,
"narHash": "sha256-eZCxuF58YWgaJMMRrn8oRkwRhxooe5kBS/s2wRVr9PA=", "narHash": "sha256-2bNMraoRB4pdw/HtxgYTFeMhEekBZeQ53/a8xkqpbZc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "7b3fca5adcf6c709874a8f2e0c364fe9c58db989", "rev": "022464438a85450abb23d93b91aa82e0addd71fb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -918,11 +918,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1710281778, "lastModified": 1710714957,
"narHash": "sha256-bvWr9vvBrAxb44kHM3H3cY/uQg+4pYP1BM/Nu3e/7V8=", "narHash": "sha256-eZCxuF58YWgaJMMRrn8oRkwRhxooe5kBS/s2wRVr9PA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "49a266d2ca59df8a03249550e73a54626181b65d", "rev": "7b3fca5adcf6c709874a8f2e0c364fe9c58db989",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -944,11 +944,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1710171982, "lastModified": 1710754079,
"narHash": "sha256-WFMB+Yohcvego1/vOtaq+MJ8Wvp5meOANfNifg26Ie4=", "narHash": "sha256-i2GEmGDjFP8K86x5OcH0JbCoYZqLW5H+P866pVTSxU4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "lanzaboote", "repo": "lanzaboote",
"rev": "19ad7fd5724f30868748b8156ff25be838cd2bc5", "rev": "67dbf85b7c35b5e0be476facf1b360b791e4a3ae",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1018,11 +1018,11 @@
"spectrum": "spectrum" "spectrum": "spectrum"
}, },
"locked": { "locked": {
"lastModified": 1710327053, "lastModified": 1710760349,
"narHash": "sha256-5S3jnObtWfXlTx00KzsPwpJtDoyfa1WpZnCrWnxovcw=", "narHash": "sha256-yqGeSnAB3Yeg02jtitzSGIuE21kq7+pWAdeGK3F9/cY=",
"owner": "astro", "owner": "astro",
"repo": "microvm.nix", "repo": "microvm.nix",
"rev": "d535b9b6c9f6612e323d4504660ebbdcd1bd79bd", "rev": "0e2223d8fd459725850bd9aff7e9d68ec329769a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1101,11 +1101,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1710281379, "lastModified": 1710717205,
"narHash": "sha256-uFo9hxt982L3nFJeweW4Gip2esiGrIQlbvEGrNTh4AY=", "narHash": "sha256-Wf3gHh5uV6W1TV/A8X8QJf99a5ypDSugY4sNtdJDe0A=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "d9ea313bc4851670dc99c5cc979cb79750e7d670", "rev": "bcc8afd06e237df060c85bad6af7128e05fd61a3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1168,11 +1168,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1710622004, "lastModified": 1710783728,
"narHash": "sha256-6zR642tXcZzzk3C8BHxlCrR0yh8z8zMXLiuXpWDIpX0=", "narHash": "sha256-eIsfu3c9JUBgm3cURSKTXLEI9Dlk1azo+MWKZVqrmkc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "968952f950a59dee9ed1e8799dda38c6dfa1bad3", "rev": "1e679b9a9970780cd5d4dfe755a74a8f96d33388",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1393,11 +1393,11 @@
}, },
"nixpkgs_7": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1710716398, "lastModified": 1710803033,
"narHash": "sha256-HfuWX+8cykZsLWw2Kj6AbN1l6ZH8yB7vxjOKD8C0008=", "narHash": "sha256-7sRXMRZPHUbHY9n3unU5/2SxT50MH9uJAFr1vkjiQYc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ca0de94ebb9a7c06447285310777567afd0053aa", "rev": "c2f60aeadc7af3f832c1ffa86bae06518d227fbf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1408,11 +1408,11 @@
}, },
"nixpkgs_8": { "nixpkgs_8": {
"locked": { "locked": {
"lastModified": 1710272261, "lastModified": 1710631334,
"narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", "narHash": "sha256-rL5LSYd85kplL5othxK5lmAtjyMOBg390sGBTb3LRMM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2", "rev": "c75037bbf9093a2acb617804ee46320d6d1fea5a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1449,11 +1449,11 @@
"pre-commit-hooks": "pre-commit-hooks" "pre-commit-hooks": "pre-commit-hooks"
}, },
"locked": { "locked": {
"lastModified": 1710634405, "lastModified": 1710799652,
"narHash": "sha256-e+EHQGqqjpvkln6vYmiAcafFKbTaze3XF7DEjDZyXGY=", "narHash": "sha256-TWX1slRN1IQcalrY64ltQUpVhbxGnT0PaIHqNcC0VtY=",
"owner": "pta2002", "owner": "pta2002",
"repo": "nixvim", "repo": "nixvim",
"rev": "939530edca29b44e65d8bd606ef3485346510ebe", "rev": "975f1ca526e37c9cb9c646399f03613ea77f5ec2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1464,11 +1464,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1710750753, "lastModified": 1710833135,
"narHash": "sha256-MQ5haKyTNKAFTw3oDaShLHiECiD5DVV4HfmzN3l77Yk=", "narHash": "sha256-vtF350PUNgnQpVSy0EPS5uwza8gIFpaIx9dDk14EWI4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "05351320d5ece2eb43cbd991edd4d1f56f5ca17f", "rev": "cee2a9bfe726df39af812591e8b17e8a2f319bd5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1671,11 +1671,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1710036830, "lastModified": 1710641527,
"narHash": "sha256-pnV4gO3N/7/GzyRSKTRlSfS/19KJiPSvYcL4apnSkoQ=", "narHash": "sha256-R9JZEevtSyg7++LEryYJRrfyEe45azJxmu2k9VezEW0=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "d09dac6a63a2ac4b74ac2ecdc19acd8c46c2da2c", "rev": "50db54295d3922a3b7a40d580b84d75150b36c34",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -106,7 +106,6 @@ in {
kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; }; kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; };
}; };
services = { services = {
gnome.gnome-keyring.enable = true; gnome.gnome-keyring.enable = true;
udisks2.enable = true; udisks2.enable = true;