From 69d4af68da3c07dce6ca6354ce8309d42fcc9ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 2 Mar 2024 22:29:52 +0100 Subject: [PATCH] fix(nvim): Single file plugin config --- nvim/default.nix | 2 +- nvim/plugins/default.nix | 157 --------------------------------------- 2 files changed, 1 insertion(+), 158 deletions(-) delete mode 100644 nvim/plugins/default.nix diff --git a/nvim/default.nix b/nvim/default.nix index 8295bb7..80fc235 100644 --- a/nvim/default.nix +++ b/nvim/default.nix @@ -37,7 +37,7 @@ in options.smartcase = true; # Unless it has a capital letter # Enable local configuration :h 'exrc' options.exrc = true; # safe since nvim 0.9 - plugins = import ./plugins; + plugins = import ./plugins.nix { inherit lib; }; keymaps = import ./mappings.nix; inherit (import ./augroups.nix) autoGroups autoCmd; extraPlugins = diff --git a/nvim/plugins/default.nix b/nvim/plugins/default.nix deleted file mode 100644 index fb0d974..0000000 --- a/nvim/plugins/default.nix +++ /dev/null @@ -1,157 +0,0 @@ -{ - cmp-buffer.enable = true; - cmp-clippy.enable = true; - cmp-cmdline.enable = true; - cmp-nvim-lsp.enable = true; - cmp-nvim-lsp-document-symbol.enable = true; - cmp-nvim-lsp-signature-help.enable = true; - cmp-path.enable = true; - cmp-rg.enable = true; - cmp-spell.enable = true; - cmp-treesitter.enable = true; - cmp-zsh.enable = true; - conform-nvim = { - enable = true; - formattersByFt = { - "_" = [ "trim_whitespace" ]; - c = [ "clang_format" ]; - cpp = [ "clang_format" ]; - lua = [ "stylua" ]; - nix = [ "nixpkgs_fmt" ]; - rust = [ "rustfmt" ]; - sh = [ "shfmt" ]; - toml = [ "taplo" ]; - yaml = [ "yamlfmt" ]; - zig = [ "zigfmt" ]; - }; - }; - gitsigns.enable = true; - lsp = { - enable = true; - servers = { - bashls.enable = true; - clangd.enable = true; - html.enable = true; - jsonls.enable = true; - nil.enable = true; - pyright.enable = true; - rnix-lsp.enable = true; - ruff-lsp.enable = true; - taplo.enable = true; - texlab.enable = true; - typos-lsp.enable = true; - typst-lsp.enable = true; - }; - }; - lspkind.enable = true; - lualine = { - enable = true; - theme = "gruvbox"; - sections = { - lualine_a = [{ name = "mode"; }]; - lualine_b = [{ name = "filename"; } { name = "branch"; }]; - lualine_y = [{ name = "encoding"; } { name = "fileformat"; } { name = "filetype"; }]; - lualine_z = [{ name = "location"; }]; - }; - }; - luasnip = { - enable = true; - extraConfig = { update_events = "TextChanged,TextChangedI"; }; - }; - nvim-cmp = { - enable = true; - # Snippets - snippet.expand = "luasnip"; - # Completion Sources - sources = [ - { name = "buffer"; groupIndex = 3; } - { name = "calc"; groupIndex = 2; } - { name = "conventionalcommits"; groupIndex = 1; } - { name = "crates"; groupIndex = 1; } - { name = "luasnip"; groupIndex = 1; } - { name = "nvim_lsp"; groupIndex = 1; } - { name = "nvim_lsp_document_symbol"; groupIndex = 1; } - { name = "nvim_lsp_signature_help"; groupIndex = 1; } - { name = "path"; groupIndex = 2; } - { name = "spell"; groupIndex = 2; } - { name = "treesitter"; groupIndex = 2; } - { name = "zsh"; groupIndex = 1; } - ]; - # Menu Icons - formatting.format = "require('lspkind').cmp_format { mode = 'symbol', maxwidth = 50 }"; - mappingPresets = [ "insert" ]; - mapping = { - "" = { - modes = [ "i" "s" ]; - action = '' - function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif require("luasnip").expand_or_jumpable() then - require("luasnip").expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end - ''; - }; - "" = { - modes = [ "i" "s" ]; - action = '' - function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif require("luasnip").jumpable(-1) then - require("luasnip").jump(-1) - else - fallback() - end - end - ''; - }; - "" = '' - cmp.mapping(function(fallback) - if require("luasnip").choice_active() then - require("luasnip").next_choice() - else - fallback() - end - end) - ''; - "" = "cmp.mapping.scroll_docs(-4)"; - "" = "cmp.mapping.scroll_docs(4)"; - "" = "cmp.mapping.complete {}"; - "" = "cmp.mapping.close()"; - "" = "cmp.mapping.confirm { select = true }"; - }; - }; - nvim-colorizer = { - enable = true; - userDefaultOptions = { - names = false; # disable named colors (i.e. red) - mode = "virtualtext"; - }; - }; - rustaceannvim.enable = true; - telescope.enable = true; - treesitter = { - enable = true; - indent = true; - incrementalSelection.enable = true; - }; - treesitter-context.enable = true; - trouble = { - enable = true; - autoClose = true; - }; - lint = { - enable = true; - lintersByFt = { - rust = [ "typos" ]; - latex = [ "chktex" "typos" ]; - markdown = [ "typos" ]; - }; - }; -}