diff --git a/config.nix b/config.nix index e606821..cb63a39 100644 --- a/config.nix +++ b/config.nix @@ -4,6 +4,7 @@ ./plugins/theme.nix ./plugins/completion.nix ./plugins/lsp.nix + ./plugins/treesitter.nix ./plugins/formatter.nix ./plugins/statusline.nix ./plugins/git.nix diff --git a/plugins/completion.nix b/plugins/completion.nix index 1481df6..b5a4ad5 100644 --- a/plugins/completion.nix +++ b/plugins/completion.nix @@ -1,29 +1,14 @@ {...}: { - vim = { - autocomplete.nvim-cmp = { - enable = true; - mappings = { - complete = ""; - close = ""; - scrollDocsUp = ""; - scrollDocsDown = ""; - confirm = ""; - next = ""; - previous = ""; - }; + vim.autocomplete.blink-cmp = { + enable = true; + mappings = { + complete = ""; + close = ""; + scrollDocsUp = ""; + scrollDocsDown = ""; + confirm = ""; + next = ""; + previous = ""; }; - - snippets.luasnip.enable = true; - - luaConfigRC.luasnip-keymaps = '' - vim.keymap.set({"i", "s"}, "", function() - local ls = require("luasnip") - if ls.expand_or_jumpable() then ls.expand_or_jump() end - end, {silent = true}) - vim.keymap.set({"i", "s"}, "", function() - local ls = require("luasnip") - if ls.jumpable(-1) then ls.jump(-1) end - end, {silent = true}) - ''; }; } diff --git a/plugins/lsp.nix b/plugins/lsp.nix index f19e3a4..ea68bab 100644 --- a/plugins/lsp.nix +++ b/plugins/lsp.nix @@ -53,8 +53,6 @@ keymaps = [ {key = "ls"; mode = ["n"]; lua = true; action = "function() Snacks.picker.lsp_symbols() end"; desc = "Document Symbols";} {key = "lS"; mode = ["n"]; lua = true; action = "function() Snacks.picker.lsp_workspace_symbols() end"; desc = "Workspace Symbols";} - {key = "la"; mode = ["n"]; lua = true; action = "function() vim.lsp.buf.code_action() end"; desc = "Code Actions";} - {key = "K"; mode = ["n"]; lua = true; action = "function() vim.lsp.buf.hover() end"; desc = "Hover Docs";} {key = "lR"; mode = ["n"]; action = "LspRestart"; desc = "Restart LSP";} ]; }; diff --git a/plugins/snacks.nix b/plugins/snacks.nix index d66ba37..0481258 100644 --- a/plugins/snacks.nix +++ b/plugins/snacks.nix @@ -6,6 +6,7 @@ lazygit.enable = true; rename.enable = true; picker.enable = true; + scroll.enable = true; dashboard = { enable = true; diff --git a/plugins/treesitter.nix b/plugins/treesitter.nix new file mode 100644 index 0000000..8fddb0c --- /dev/null +++ b/plugins/treesitter.nix @@ -0,0 +1,27 @@ +{...}: { + vim.treesitter.textobjects = { + enable = true; + setupOpts = { + select = { + enable = true; + lookahead = true; + keymaps = { + "af" = "@function.outer"; + "if" = "@function.inner"; + "ac" = "@class.outer"; + "ic" = "@class.inner"; + "aa" = "@parameter.outer"; + "ia" = "@parameter.inner"; + }; + }; + move = { + enable = true; + set_jumps = true; + goto_next_start."]f" = "@function.outer"; + goto_previous_start."[f" = "@function.outer"; + goto_next_end."]F" = "@function.outer"; + goto_previous_end."[F" = "@function.outer"; + }; + }; + }; +}