added dapui and treesitter textobjects

This commit is contained in:
2025-11-05 14:07:20 +01:00
parent 58c3a6875a
commit 707b616009
2 changed files with 55 additions and 10 deletions
+43 -10
View File
@@ -17,7 +17,6 @@ vim.keymap.set("n", "k", "gk", { noremap = true, silent = true })
vim.keymap.set("v", "j", "gj", { noremap = true, silent = true }) vim.keymap.set("v", "j", "gj", { noremap = true, silent = true })
vim.keymap.set("v", "k", "gk", { noremap = true, silent = true }) vim.keymap.set("v", "k", "gk", { noremap = true, silent = true })
-- VIM OPTIONS END -- -- VIM OPTIONS END --
-- PLUGINS START -- -- PLUGINS START --
@@ -28,6 +27,7 @@ vim.pack.add({
{ src = "https://github.com/echasnovski/mini.pick" }, { src = "https://github.com/echasnovski/mini.pick" },
{ src = "https://github.com/neovim/nvim-lspconfig" }, { src = "https://github.com/neovim/nvim-lspconfig" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter" }, { src = "https://github.com/nvim-treesitter/nvim-treesitter" },
{ src = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects" },
{ src = "https://github.com/Saghen/blink.cmp", version = "v1.6.0", }, { src = "https://github.com/Saghen/blink.cmp", version = "v1.6.0", },
{ src = "https://github.com/mason-org/mason.nvim" }, { src = "https://github.com/mason-org/mason.nvim" },
{ src = "https://github.com/dimitry-ishenko-neovim/lualine-nvim" }, { src = "https://github.com/dimitry-ishenko-neovim/lualine-nvim" },
@@ -40,6 +40,8 @@ vim.pack.add({
{ src = "https://github.com/nvim-tree/nvim-web-devicons" }, { src = "https://github.com/nvim-tree/nvim-web-devicons" },
{ src = "https://github.com/lewis6991/gitsigns.nvim" }, { src = "https://github.com/lewis6991/gitsigns.nvim" },
{ src = "https://github.com/folke/trouble.nvim" }, { src = "https://github.com/folke/trouble.nvim" },
{ src = "https://github.com/rcarriga/nvim-dap-ui", dependencies = { "https://github.com/mfussenegger/nvim-dap", "https://github.com/nvim-neotest/nvim-nio" } },
{ src = "https://github.com/nvim-neotest/nvim-nio" },
}) })
vim.cmd("colorscheme gruvbox") vim.cmd("colorscheme gruvbox")
@@ -53,6 +55,20 @@ require("nvim-treesitter.configs").setup({
auto_install = true, auto_install = true,
highlight = { enable = true }, highlight = { enable = true },
indent = { enable = true }, indent = { enable = true },
textobjects = {
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
},
}) })
require("mason").setup() require("mason").setup()
require("lualine").setup { require("lualine").setup {
@@ -67,6 +83,25 @@ require("trouble").setup()
-- PLUGINS END -- -- PLUGINS END --
-- DAP START --
require("dapui").setup()
local dap, dapui = require("dap"), require("dapui")
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
dapui.close()
end
-- DAP END --
-- LSP START -- -- LSP START --
vim.lsp.enable({ "lua_ls", "ts_ls", "svelte", "tailwindcss", "cssls", "bashls", "rust_analyzer", "clangd", "clang-format", vim.lsp.enable({ "lua_ls", "ts_ls", "svelte", "tailwindcss", "cssls", "bashls", "rust_analyzer", "clangd", "clang-format",
@@ -81,14 +116,6 @@ vim.lsp.config["tinymist"] = {
}, },
} }
vim.lsp.config("jdtls", {
root_dir = vim.fn.getcwd(),
settings = {
java = {
},
},
})
vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd('FileType', {
pattern = 'java', pattern = 'java',
callback = function(args) callback = function(args)
@@ -193,13 +220,19 @@ map.set("n", "<leader>ca", vim.lsp.buf.code_action, { desc = "Code Action" })
map.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "Rename symbol" }) map.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "Rename symbol" })
map.set("n", "<leader>xx", "<cmd>Trouble diagnostics toggle focus=true<cr>", { desc = "Diagnostics (Trouble)" }) map.set("n", "<leader>xx", "<cmd>Trouble diagnostics toggle focus=true<cr>", { desc = "Diagnostics (Trouble)" })
map.set("n", "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0 focus=true<cr>", { desc = "Buffer Diagnostics (Trouble)" }) map.set("n", "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0 focus=true<cr>",
{ desc = "Buffer Diagnostics (Trouble)" })
map.set("n", "<C-f>", ":Pick files<CR>") map.set("n", "<C-f>", ":Pick files<CR>")
map.set("n", "<C-g>", ":Pick grep_live<CR>") map.set("n", "<C-g>", ":Pick grep_live<CR>")
map.set("n", "<C-h>", ":Pick help<CR>") map.set("n", "<C-h>", ":Pick help<CR>")
map.set("n", "<C-e>", ":Oil<CR>") map.set("n", "<C-e>", ":Oil<CR>")
map.set("n", "<leader>duo", dapui.open)
map.set("n", "<leader>duc", dapui.close)
map.set("n", "<leader>dbp", dap.toggle_breakpoint)
map.set("n", "<leader>drc", dap.run_to_cursor)
-- Move to previous/next -- Move to previous/next
map.set('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts) map.set('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
map.set('n', '<A-.>', '<Cmd>BufferNext<CR>', opts) map.set('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
+12
View File
@@ -20,10 +20,22 @@
"mason.nvim": [], "mason.nvim": [],
"mini.pick": [], "mini.pick": [],
"nvim-dap": [], "nvim-dap": [],
"nvim-dap-ui": {
"rev": "cf91d5e",
"src": "https://github.com/rcarriga/nvim-dap-ui"
},
"nvim-jdtls": [], "nvim-jdtls": [],
"nvim-lightbulb": [], "nvim-lightbulb": [],
"nvim-lspconfig": [], "nvim-lspconfig": [],
"nvim-nio": {
"rev": "21f5324",
"src": "https://github.com/nvim-neotest/nvim-nio"
},
"nvim-treesitter": [], "nvim-treesitter": [],
"nvim-treesitter-textobjects": {
"rev": "5ca4aaa",
"src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects"
},
"nvim-web-devicons": { "nvim-web-devicons": {
"rev": "8dcb311", "rev": "8dcb311",
"src": "https://github.com/nvim-tree/nvim-web-devicons" "src": "https://github.com/nvim-tree/nvim-web-devicons"