diff options
Diffstat (limited to 'config/nvim/lua')
| -rw-r--r-- | config/nvim/lua/lsp.lua | 21 | ||||
| -rw-r--r-- | config/nvim/lua/plugins.lua | 207 |
2 files changed, 200 insertions, 28 deletions
diff --git a/config/nvim/lua/lsp.lua b/config/nvim/lua/lsp.lua index 2c2cbf2..9838887 100644 --- a/config/nvim/lua/lsp.lua +++ b/config/nvim/lua/lsp.lua @@ -116,6 +116,27 @@ vim.lsp.config('sourcekit', { }) vim.lsp.enable('sourcekit') +-- RUBY ------------------------------------------------------------------------ +vim.lsp.config('ruby', { + cmd = function(dispatchers, config) + return vim.lsp.rpc.start( + { 'mise x -- ruby-lsp' }, + dispatchers, + config and config.root_dir and { cwd = config.cmd_cwd or config.root_dir } + ) + end, + filetypes = { 'ruby', 'eruby' }, + root_markers = { 'Gemfile', '.git' }, + init_options = { + formatter = 'auto', + }, + reuse_client = function(client, config) + config.cmd_cwd = config.root_dir + return client.config.cmd_cwd == config.cmd_cwd + end, +}) +vim.lsp.enable('ruby') + -- Enable inlay hints for Rust when LSP attaches vim.api.nvim_create_autocmd('LspAttach', { callback = function(args) diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index ef68eee..7958eab 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -1,5 +1,3 @@ -vim.g.mapleader = ' ' -vim.g.maplocalleader = ';' local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' if not vim.loop.fs_stat(lazypath) then vim.fn.system({ 'git', @@ -59,7 +57,7 @@ require('lazy').setup({ 'ARM9/snes-syntax-vim', 'https://git.sr.ht/~torresjrjr/gemini.vim', - --'Debugging + -- Debugging & Testing { 'rcarriga/nvim-dap-ui', dependencies = { @@ -67,6 +65,27 @@ require('lazy').setup({ 'nvim-neotest/nvim-nio' } }, + { + "nvim-neotest/neotest", + dependencies = { + "nvim-neotest/nvim-nio", + "nvim-lua/plenary.nvim", + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter", + + -- The test runners + "olimorris/neotest-rspec", + "rouge8/neotest-rust", + }, + config = function() + require("neotest").setup({ + adapters = { + require("neotest-rspec"), + require("neotest-rust") + }, + }) + end, + }, -- Editing 'RRethy/nvim-treesitter-endwise', @@ -80,6 +99,137 @@ require('lazy').setup({ 'danymat/neogen', config = true }, + { + "chentoast/marks.nvim", + event = "VeryLazy", + opts = {}, + }, + { + 'code-biscuits/nvim-biscuits', + dependencies = { + 'nvim-treesitter/nvim-treesitter', + }, + opts = {} + }, + { + "nvim-treesitter/nvim-treesitter-textobjects", + branch = "main", + init = function() + -- vim.g.no_plugin_maps = true + end, + config = function() + require("nvim-treesitter-textobjects").setup { + select = { + lookahead = true, + set_jumps = true, + }, + } + + -- Text Objects + vim.keymap.set({ "x", "o" }, "am", function() + require "nvim-treesitter-textobjects.select".select_textobject("@function.outer", "textobjects") + end) + vim.keymap.set({ "x", "o" }, "im", function() + require "nvim-treesitter-textobjects.select".select_textobject("@function.inner", "textobjects") + end) + vim.keymap.set({ "x", "o" }, "ac", function() + require "nvim-treesitter-textobjects.select".select_textobject("@class.outer", "textobjects") + end) + vim.keymap.set({ "x", "o" }, "ic", function() + require "nvim-treesitter-textobjects.select".select_textobject("@class.inner", "textobjects") + end) + + vim.keymap.set({ "x", "o" }, "as", function() + require "nvim-treesitter-textobjects.select".select_textobject("@local.scope", "locals") + end) + + vim.keymap.set({ "x", "o" }, "aa", function() + require "nvim-treesitter-textobjects.select".select_textobject("@parameter.outer", "textobjects") + end) + vim.keymap.set({ "x", "o" }, "ia", function() + require "nvim-treesitter-textobjects.select".select_textobject("@parameter.inner", "textobjects") + end) + + -- Moves + vim.keymap.set({ "n", "x", "o" }, "]m", function() + require("nvim-treesitter-textobjects.move").goto_next_start("@function.outer", "textobjects") + end) + vim.keymap.set({ "n", "x", "o" }, "]]", function() + require("nvim-treesitter-textobjects.move").goto_next_start("@class.outer", "textobjects") + end) + + vim.keymap.set({ "n", "x", "o" }, "]o", function() + require("nvim-treesitter-textobjects.move").goto_next_start({"@loop.inner", "@loop.outer"}, "textobjects") + end) + + vim.keymap.set({ "n", "x", "o" }, "]s", function() + require("nvim-treesitter-textobjects.move").goto_next_start("@local.scope", "locals") + end) + vim.keymap.set({ "n", "x", "o" }, "]z", function() + require("nvim-treesitter-textobjects.move").goto_next_start("@fold", "folds") + end) + + vim.keymap.set({ "n", "x", "o" }, "]k", function() + require("nvim-treesitter-textobjects.move").goto_next_start("@conditional.outer", "textobjects") + end) + vim.keymap.set({ "n", "x", "o" }, "]K", function() + require("nvim-treesitter-textobjects.move").goto_next_end("@conditional.outer", "textobjects") + end) + + vim.keymap.set({ "n", "x", "o" }, "]M", function() + require("nvim-treesitter-textobjects.move").goto_next_end("@function.outer", "textobjects") + end) + vim.keymap.set({ "n", "x", "o" }, "][", function() + require("nvim-treesitter-textobjects.move").goto_next_end("@class.outer", "textobjects") + end) + + vim.keymap.set({ "n", "x", "o" }, "]a", function() + require("nvim-treesitter-textobjects.move").goto_next_start("@parameter.inner", "textobjects") + end) + + vim.keymap.set({ "n", "x", "o" }, "[m", function() + require("nvim-treesitter-textobjects.move").goto_previous_start("@function.outer", "textobjects") + end) + vim.keymap.set({ "n", "x", "o" }, "[[", function() + require("nvim-treesitter-textobjects.move").goto_previous_start("@class.outer", "textobjects") + end) + + vim.keymap.set({ "n", "x", "o" }, "[M", function() + require("nvim-treesitter-textobjects.move").goto_previous_end("@function.outer", "textobjects") + end) + vim.keymap.set({ "n", "x", "o" }, "[]", function() + require("nvim-treesitter-textobjects.move").goto_previous_end("@class.outer", "textobjects") + end) + vim.keymap.set({ "n", "x", "o" }, "[o", function() + require("nvim-treesitter-textobjects.move").goto_previous_start({"@loop.inner", "@loop.outer"}, "textobjects") + end) + vim.keymap.set({ "n", "x", "o" }, "[s", function() + require("nvim-treesitter-textobjects.move").goto_previous_start("@local.scope", "locals") + end) + vim.keymap.set({ "n", "x", "o" }, "[z", function() + require("nvim-treesitter-textobjects.move").goto_previous_start("@fold", "folds") + end) + + vim.keymap.set({ "n", "x", "o" }, "[k", function() + require("nvim-treesitter-textobjects.move").goto_previous_start("@conditional.outer", "textobjects") + end) + vim.keymap.set({ "n", "x", "o" }, "[K", function() + require("nvim-treesitter-textobjects.move").goto_previous_end("@conditional.outer", "textobjects") + end) + vim.keymap.set({ "n", "x", "o" }, "[a", function() + require("nvim-treesitter-textobjects.move").goto_previous_start("@parameter.inner", "textobjects") + end) + + end, + }, + { + "kylechui/nvim-surround", + event = "VeryLazy", + -- Optional: See `:h nvim-surround.configuration` and `:h nvim-surround.setup` for details + config = function() + require("nvim-surround").setup() + end + }, -- Treesitter { @@ -129,6 +279,7 @@ require('lazy').setup({ -- Tools 'mbbill/undotree', 'milkypostman/vim-togglelist', + { 'nvim-mini/mini.icons', version = false }, { "3rd/image.nvim", build = false, @@ -164,33 +315,33 @@ require('lazy').setup({ 'nvim-neorg/tree-sitter-norg-meta', }, opts = { - load = { - ["core.defaults"] = {}, - ["core.concealer"] = {}, - ["core.pivot"] = {}, - ["core.latex.renderer"] = {}, - ["core.journal"] = { - config = { - journal_folder = "periodic/daily", - strategy = "flat", - template_name = "../../templates/daily.norg", - workspace = "brain", - }, - }, - ["core.dirman"] = { - config = { - workspaces = { - brain = "~/brain", + load = { + ["core.defaults"] = {}, + ["core.concealer"] = {}, + ["core.pivot"] = {}, + ["core.latex.renderer"] = {}, + ["core.journal"] = { + config = { + journal_folder = "periodic/daily", + strategy = "flat", + template_name = "../../templates/daily.norg", + workspace = "brain", + }, + }, + ["core.dirman"] = { + config = { + workspaces = { + brain = "~/brain", + }, + default_workspace = "brain", + } + }, + ["external.interim-ls"] = {}, + ["core.completion"] = { + config = { engine = { module_name = "external.lsp-completion" } }, }, - default_workspace = "brain", } - }, - ["external.interim-ls"] = {}, - ["core.completion"] = { - config = { engine = { module_name = "external.lsp-completion" } }, - }, - } -} + } }, { "michaelb/sniprun", |