diff --git a/flake.lock b/flake.lock index e332e43..4b9d2b9 100644 --- a/flake.lock +++ b/flake.lock @@ -9,11 +9,11 @@ ] }, "locked": { - "lastModified": 1713532798, - "narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=", + "lastModified": 1717408969, + "narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=", "owner": "numtide", "repo": "devshell", - "rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40", + "rev": "1ebbe68d57457c8cae98145410b164b5477761f4", "type": "github" }, "original": { @@ -36,22 +36,6 @@ "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" } }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -60,11 +44,11 @@ ] }, "locked": { - "lastModified": 1715865404, - "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", + "lastModified": 1719877454, + "narHash": "sha256-g5N1yyOSsPNiOlFfkuI/wcUjmtah+nxdImJqrSATjOU=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", + "rev": "4e3583423212f9303aa1a6337f8dffb415920e4f", "type": "github" }, "original": { @@ -73,21 +57,6 @@ "type": "github" } }, - "flake-root": { - "locked": { - "lastModified": 1713493429, - "narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=", - "owner": "srid", - "repo": "flake-root", - "rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd", - "type": "github" - }, - "original": { - "owner": "srid", - "repo": "flake-root", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" @@ -106,11 +75,41 @@ "type": "github" } }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "nixvim", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719259945, + "narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ "nixvim", - "pre-commit-hooks", + "git-hooks", "nixpkgs" ] }, @@ -136,11 +135,11 @@ ] }, "locked": { - "lastModified": 1716457508, - "narHash": "sha256-ZxzffLuWRyuMrkVVq7wastNUqeO0HJL9xqfY1QsYaqo=", + "lastModified": 1719827439, + "narHash": "sha256-tneHOIv1lEavZ0vQ+rgz67LPNCgOZVByYki3OkSshFU=", "owner": "nix-community", "repo": "home-manager", - "rev": "850cb322046ef1a268449cf1ceda5fd24d930b05", + "rev": "59ce796b2563e19821361abbe2067c3bb4143a7d", "type": "github" }, "original": { @@ -157,11 +156,11 @@ ] }, "locked": { - "lastModified": 1716511055, - "narHash": "sha256-5Fe/DGgvMhPEMl9VdVxv3zvwRcwNDmW5eRJ0gk72w7U=", + "lastModified": 1719845423, + "narHash": "sha256-ZLHDmWAsHQQKnmfyhYSHJDlt8Wfjv6SQhl2qek42O7A=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "0bea8222f6e83247dd13b055d83e64bce02ee532", + "rev": "ec12b88104d6c117871fad55e931addac4626756", "type": "github" }, "original": { @@ -194,11 +193,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1716509168, - "narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=", + "lastModified": 1720542800, + "narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "bfb7a882678e518398ce9a31a881538679f6f092", + "rev": "feb2849fdeb70028c70d73b848214b00d324a497", "type": "github" }, "original": { @@ -213,21 +212,20 @@ "devshell": "devshell", "flake-compat": "flake-compat", "flake-parts": "flake-parts", - "flake-root": "flake-root", + "git-hooks": "git-hooks", "home-manager": "home-manager", "nix-darwin": "nix-darwin", "nixpkgs": [ "nixpkgs" ], - "pre-commit-hooks": "pre-commit-hooks", "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1716759197, - "narHash": "sha256-I4r9krPVUl1b70VbC8j8xDQ2mDBoGCx8tH9CExiJMd8=", + "lastModified": 1720864742, + "narHash": "sha256-NVkF91eZPav7zbcMR+7mUzOdMKgIEBJSwtFU2rv1OpY=", "owner": "nix-community", "repo": "nixvim", - "rev": "ba293d36403c39c22dbb9a928f9af4d0df54b79f", + "rev": "195978e6272702ea5d6e9b837d083c411dc5d688", "type": "github" }, "original": { @@ -268,33 +266,6 @@ "type": "gitlab" } }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat_2", - "gitignore": "gitignore", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ], - "nixpkgs-stable": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1716213921, - "narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { "nix-formatter-pack": "nix-formatter-pack", @@ -325,11 +296,11 @@ ] }, "locked": { - "lastModified": 1715940852, - "narHash": "sha256-wJqHMg/K6X3JGAE9YLM0LsuKrKb4XiBeVaoeMNlReZg=", + "lastModified": 1719887753, + "narHash": "sha256-p0B2r98UtZzRDM5miGRafL4h7TwGRC4DII+XXHDHqek=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "2fba33a182602b9d49f0b2440513e5ee091d838b", + "rev": "bdb6355009562d8f9313d9460c0d3860f525bc6c", "type": "github" }, "original": { diff --git a/plugins/arrow.nix b/plugins/arrow.nix new file mode 100644 index 0000000..6e7401c --- /dev/null +++ b/plugins/arrow.nix @@ -0,0 +1,16 @@ +{ icons, pkgs, ... }: +{ + opts.enable = true; + + extra = { + packages = [ pkgs.vimPlugins.arrow-nvim ]; + + config = '' + require('arrow').setup({ + show_icons = true, + leader_key = ';', -- Recommended to be a single key + buffer_leader_key = 'm', -- Per Buffer Mappings + }) + ''; + }; +} diff --git a/plugins/comment.nix b/plugins/comment.nix index 44a327e..d9b9608 100644 --- a/plugins/comment.nix +++ b/plugins/comment.nix @@ -7,4 +7,19 @@ _: enable = true; settings.pre_hook = "require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook()"; }; + + keymaps = [ + { + key = "/"; + action = "(comment_toggle_linewise_current)"; + options.desc = "Toggle comment line"; + mode = "n"; + } + { + key = "/"; + action = "(comment_toggle_linewise_visual)"; + options.desc = "Toggle comment line"; + mode = "v"; + } + ]; } diff --git a/plugins/guess-indent.nix b/plugins/guess-indent.nix index 63b70dc..d1e19bf 100644 --- a/plugins/guess-indent.nix +++ b/plugins/guess-indent.nix @@ -8,7 +8,7 @@ # https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/configs/guess-indent.lua config = '' require("guess-indent").setup({}) - vim.cmd.lua { args = { "require('guess-indent').set_from_buffer('auto_cmd')" }, mods = { silent = true } } + vim.cmd.lua { args = { "require('guess-indent').set_from_buffer()" }, mods = { silent = true } } ''; }; } diff --git a/plugins/lsp.nix b/plugins/lsp.nix index ebea72f..1c8b15f 100644 --- a/plugins/lsp.nix +++ b/plugins/lsp.nix @@ -32,7 +32,26 @@ action = "code_action"; desc = "LSP code action"; }; - + "lr" = { + action = "rename"; + desc = "Rename current symbol"; + }; + "lR" = { + action = "rename"; + desc = "Search references"; + }; + "lh" = { + action = "signature_help"; + desc = "Signature help"; + }; + "lG" = { + action = "workspace_symbol"; + desc = "Search workspace symbols"; + }; + "gK" = { + action = "signature_help"; + desc = "Signature help"; + }; gd = { action = "definition"; desc = "Go to definition"; @@ -80,25 +99,25 @@ # Load all servers definitions servers = { - ansiblels.enable = true; bashls.enable = true; cssls.enable = true; docker-compose-language-service.enable = true; dockerls.enable = true; - eslint.enable = true; - gopls.enable = true; helm-ls.enable = true; html.enable = true; - java-language-server.enable = true; jsonls.enable = true; lua-ls.enable = true; nginx-language-server.enable = true; nixd.enable = true; pyright.enable = true; - sqls.enable = true; - terraformls.enable = true; - tsserver.enable = true; yamlls.enable = true; + clangd.enable = true; + marksman.enable = true; + texlab.enable = true; + + java-language-server.enable = false; + zls.enable = false; + rust-analyzer.enable = false; typos-lsp = { enable = true; diff --git a/plugins/luasnip.nix b/plugins/luasnip.nix index 4701491..613d852 100644 --- a/plugins/luasnip.nix +++ b/plugins/luasnip.nix @@ -1,3 +1,9 @@ _:{ - opts.enable = true; + opts = { + enable = true; + + fromLua = [ + { paths = "~/.config/snippets/"; } + ]; + }; } diff --git a/plugins/oil.nix b/plugins/oil.nix index f7ed885..fdb0f46 100644 --- a/plugins/oil.nix +++ b/plugins/oil.nix @@ -1,3 +1,18 @@ _: { opts.enable = true; + + keymaps = [ + { + key = "O"; + action = "function() require('oil').toggle_float() end"; + options.desc = "Toggle oil floating window"; + mode = "n"; + } + { + key = "to"; + action = "function() require('oil').toggle_float() end"; + options.desc = "Toggle oil floating window"; + mode = "n"; + } + ]; } diff --git a/plugins/otter.nix b/plugins/otter.nix new file mode 100644 index 0000000..4701491 --- /dev/null +++ b/plugins/otter.nix @@ -0,0 +1,3 @@ +_:{ + opts.enable = true; +} diff --git a/plugins/telescope.nix b/plugins/telescope.nix index faa4d37..d15a11b 100644 --- a/plugins/telescope.nix +++ b/plugins/telescope.nix @@ -36,15 +36,15 @@ # │ └────────────────────────────────────────┘ │ # └──────────────────────────────────────────────────┘ extraConfigLuaPre = '' - local TelescopeWithTheme = function(fn, args, extension) + local telescopeWithArgs = function(fn, args, extension) args.layout_config = { anchor = "N", mirror = true, width = 0.8, } - + if fn == "keymaps" or fn == "registers" then args.layout_config.height = function(_, _, max_lines) return max_lines end end - + local args_with_theme = require("telescope.themes").get_dropdown(args) if extension ~= "" then @@ -55,7 +55,7 @@ end ''; - # Use root keymaps to allow usage of custom TelescopeWithTheme function + # Use root keymaps to allow usage of custom telescopeWithArgs function keymaps = let mkTelescopeKeymap = @@ -68,7 +68,7 @@ }: { inherit key mode; - action.__raw = "function() TelescopeWithTheme('${fn}', ${helpers.toLuaObject args}, '${builtins.toString extension}') end"; + action.__raw = "function() telescopeWithArgs('${fn}', ${helpers.toLuaObject args}, '${builtins.toString extension}') end"; options = { inherit desc; }; }; in @@ -108,7 +108,7 @@ fn = "live_grep"; } { - desc = "Find help tags"; + desc = "Find help"; key = "fh"; fn = "help_tags"; } @@ -129,14 +129,33 @@ } { desc = "Find word under cursor"; - key = "fw"; + key = "f*"; fn = "grep_string"; } { desc = "Search references"; - key = "gr"; + key = "lR"; fn = "lsp_references"; } + { + desc = "Find marks"; + key = "f'"; + fn = "marks"; + } + { + desc = "Find commands"; + key = "fC"; + fn = "commands"; + } + { + desc = "Find themes"; + key = "ft"; + fn = "colortheme"; + args = { + enable_preview = true; + ignore_builtins = true; + }; + } ]; }; } diff --git a/plugins/treesitter.nix b/plugins/treesitter.nix index ddb4fc5..d88603b 100644 --- a/plugins/treesitter.nix +++ b/plugins/treesitter.nix @@ -8,12 +8,12 @@ enable = true; # Enable treesitter based indentation (use '=' to auto-indent) - indent = true; + settings.indent.enable = true; # Workaround to enable incremental selection without setting default keymaps (keymaps are set globally) # This is needed in order to set custom descriptions and avoid to have multiple keymaps # See https://github.com/nix-community/nixvim/issues/1506 - moduleConfig.incremental_selection = { + settings.incremental_selection = { enable = true; keymaps = lib.mkForce { }; };