From 9ae165fa0d8cd1ecc433026642484c167c3e0b88 Mon Sep 17 00:00:00 2001 From: "Simen A. W. Olsen" Date: Sat, 23 Aug 2025 10:40:16 +0200 Subject: update plugins setup --- lua/simenandre/plugins/ai.lua | 12 ++++++ lua/simenandre/plugins/copilot.lua | 3 -- lua/simenandre/plugins/lsp.lua | 26 ++++++++++++- lua/simenandre/plugins/telescope.lua | 21 +++++++--- lua/simenandre/plugins/treesitter.lua | 72 ++++++++++++++++++++--------------- 5 files changed, 94 insertions(+), 40 deletions(-) create mode 100644 lua/simenandre/plugins/ai.lua delete mode 100644 lua/simenandre/plugins/copilot.lua (limited to 'lua') diff --git a/lua/simenandre/plugins/ai.lua b/lua/simenandre/plugins/ai.lua new file mode 100644 index 0000000..3d66fb6 --- /dev/null +++ b/lua/simenandre/plugins/ai.lua @@ -0,0 +1,12 @@ +return { + "github/copilot.vim", + { + "greggh/claude-code.nvim", + dependencies = { + "nvim-lua/plenary.nvim", -- Required for git operations + }, + config = function() + require("claude-code").setup() + end, + }, +} diff --git a/lua/simenandre/plugins/copilot.lua b/lua/simenandre/plugins/copilot.lua deleted file mode 100644 index 0cf3a34..0000000 --- a/lua/simenandre/plugins/copilot.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "github/copilot.vim", -} diff --git a/lua/simenandre/plugins/lsp.lua b/lua/simenandre/plugins/lsp.lua index 4f81fb9..8853310 100644 --- a/lua/simenandre/plugins/lsp.lua +++ b/lua/simenandre/plugins/lsp.lua @@ -26,6 +26,9 @@ return { -- Allows extra capabilities provided by nvim-cmp "saghen/blink.cmp", }, + opts = { + inlay_hints = { enabled = true }, + }, config = function() -- Brief aside: **What is LSP?** -- @@ -170,7 +173,23 @@ return { -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { -- clangd = {}, - gopls = {}, + gopls = { + settings = { + gopls = { + symbolMatcher = "fuzzy", + symbolStyle = "dynamic", + hints = { + rangeVariableTypes = true, + parameterNames = true, + constantValues = true, + assignVariableTypes = true, + compositeLiteralFields = true, + compositeLiteralTypes = true, + functionTypeParameters = true, + }, + }, + }, + }, zls = { root_dir = require("lspconfig.util").root_pattern(".git", "build.zig", "zls.json"), settings = { @@ -191,6 +210,7 @@ return { -- But for many setups, the LSP (`ts_ls`) will work just fine ts_ls = {}, -- + astro = {}, lua_ls = { -- cmd = {...}, @@ -198,6 +218,10 @@ return { -- capabilities = {}, settings = { Lua = { + hint = { + enable = true, -- necessary + }, + enable_inlay_hints = true, completion = { callSnippet = "Replace", }, diff --git a/lua/simenandre/plugins/telescope.lua b/lua/simenandre/plugins/telescope.lua index 4df7e62..313a4ed 100644 --- a/lua/simenandre/plugins/telescope.lua +++ b/lua/simenandre/plugins/telescope.lua @@ -49,11 +49,19 @@ return { -- You can put your default mappings / updates / etc. in here -- All the info you're looking for is in `:help telescope.setup()` -- - -- defaults = { - -- mappings = { - -- i = { [''] = 'to_fuzzy_refine' }, - -- }, - -- }, + defaults = { + mappings = { + n = { + [""] = require("telescope.actions").delete_buffer, + [""] = require("telescope.actions").delete_buffer, + }, -- n + i = { + [""] = "which_key", + [""] = require("telescope.actions").delete_buffer, + [""] = require("telescope.actions").delete_buffer, + }, -- i + }, + }, -- pickers = {} extensions = { ["ui-select"] = { @@ -72,6 +80,9 @@ return { vim.keymap.set("n", "sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" }) vim.keymap.set("n", "sf", builtin.find_files, { desc = "[S]earch [F]iles" }) vim.keymap.set("n", "ss", builtin.builtin, { desc = "[S]earch [S]elect Telescope" }) + + vim.keymap.set("n", "st", builtin.treesitter, { desc = "[S]earch [T]reesitter" }) + vim.keymap.set("n", "sw", builtin.grep_string, { desc = "[S]earch current [W]ord" }) vim.keymap.set("n", "sg", builtin.live_grep, { desc = "[S]earch by [G]rep" }) vim.keymap.set("n", "sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" }) diff --git a/lua/simenandre/plugins/treesitter.lua b/lua/simenandre/plugins/treesitter.lua index 4a8ac11..77f617d 100644 --- a/lua/simenandre/plugins/treesitter.lua +++ b/lua/simenandre/plugins/treesitter.lua @@ -4,36 +4,46 @@ return { build = ":TSUpdate", main = "nvim-treesitter.configs", -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - opts = { - ensure_installed = { - "bash", - "c", - "diff", - "html", - "lua", - "luadoc", - "markdown", - "markdown_inline", - "query", - "vim", - "vimdoc", - }, - -- Autoinstall languages that are not installed - auto_install = true, - highlight = { - enable = true, - -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. - -- If you are experiencing weird indenting issues, add the language to - -- the list of additional_vim_regex_highlighting and disabled languages for indent. - additional_vim_regex_highlighting = { "ruby" }, - }, - indent = { enable = true, disable = { "ruby" } }, - }, - -- There are additional nvim-treesitter modules that you can use to interact - -- with nvim-treesitter. You should go explore a few and see what interests you: - -- - -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` - -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context - -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "bash", + "ssh_config", + "c", + "diff", + "html", + "css", + "gitcommit", + "gitignore", + "lua", + "luadoc", + "go", + "json", + "javascript", + "rust", + "zig", + "yaml", + "toml", + "tsx", + "typescript", + "markdown", + "markdown_inline", + "query", + "vim", + "vimdoc", + "astro", + }, + -- Autoinstall languages that are not installed + auto_install = true, + highlight = { + enable = true, + -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. + -- If you are experiencing weird indenting issues, add the language to + -- the list of additional_vim_regex_highlighting and disabled languages for indent. + additional_vim_regex_highlighting = { "ruby" }, + }, + indent = { enable = true, disable = { "ruby" } }, + }) + end, }, } -- cgit v1.3.1