From 593752ff28068f2628a2cdc37de6d590456c87f2 Mon Sep 17 00:00:00 2001 From: htom Date: Sat, 29 Nov 2025 20:03:13 +0100 Subject: [PATCH] added plugins --- lua/kickstart/plugins/debug.lua | 63 ++++++++++++++++++++++++----- lua/kickstart/plugins/lspconfig.lua | 29 +++++++++++++ lua/lazy-plugins.lua | 5 +-- 3 files changed, 84 insertions(+), 13 deletions(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 8e332bf..3c92243 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -81,6 +81,49 @@ return { local dap = require 'dap' local dapui = require 'dapui' + dap.adapters['rust-gdb'] = { + type = 'executable', + command = 'rust-gdb', + args = { '--interpreter=dap', '--eval-command', 'set print pretty on' }, + } + + dap.configurations.rust = { + { + name = 'Launch', + type = 'rust-gdb', + request = 'launch', + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + args = {}, -- provide arguments if needed + cwd = '${workspaceFolder}', + stopAtBeginningOfMainSubprogram = false, + }, + { + name = 'Select and attach to process', + type = 'rust-gdb', + request = 'attach', + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + pid = function() + local name = vim.fn.input 'Executable name (filter): ' + return require('dap.utils').pick_process { filter = name } + end, + cwd = '${workspaceFolder}', + }, + { + name = 'Attach to gdbserver :1234', + type = 'rust-gdb', + request = 'attach', + target = 'localhost:1234', + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = '${workspaceFolder}', + }, + } + require('mason-nvim-dap').setup { -- Makes a best effort to setup the various debuggers with -- reasonable debug configurations @@ -121,16 +164,16 @@ return { } -- Change breakpoint icons - -- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) - -- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) - -- local breakpoint_icons = vim.g.have_nerd_font - -- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } - -- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } - -- for type, icon in pairs(breakpoint_icons) do - -- local tp = 'Dap' .. type - -- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' - -- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) - -- end + vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) + vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) + local breakpoint_icons = vim.g.have_nerd_font + and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } + or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } + for type, icon in pairs(breakpoint_icons) do + local tp = 'Dap' .. type + local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' + vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) + end dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.before.event_terminated['dapui_config'] = dapui.close diff --git a/lua/kickstart/plugins/lspconfig.lua b/lua/kickstart/plugins/lspconfig.lua index 780ada6..6b157cf 100644 --- a/lua/kickstart/plugins/lspconfig.lua +++ b/lua/kickstart/plugins/lspconfig.lua @@ -257,6 +257,34 @@ return { vim.lsp.config(server_name, server_config) end + vim.lsp.config['emmet-language-server'] = { + opts = { + filetypes = { 'css', 'eruby', 'html', 'javascript', 'javascriptreact', 'less', 'sass', 'scss', 'pug', 'typescriptreact' }, + -- Read more about this options in the [vscode docs](https://code.visualstudio.com/docs/editor/emmet#_emmet-configuration). + -- **Note:** only the options listed in the table are supported. + init_options = { + ---@type table + includeLanguages = {}, + --- @type string[] + excludeLanguages = {}, + --- @type string[] + extensionsPath = {}, + --- @type table [Emmet Docs](https://docs.emmet.io/customization/preferences/) + preferences = {}, + --- @type boolean Defaults to `true` + showAbbreviationSuggestions = true, + --- @type "always" | "never" Defaults to `"always"` + showExpandedAbbreviation = 'always', + --- @type boolean Defaults to `false` + showSuggestionsAsSnippets = false, + --- @type table [Emmet Docs](https://docs.emmet.io/customization/syntax-profiles/) + syntaxProfiles = {}, + --- @type table [Emmet Docs](https://docs.emmet.io/customization/snippets/#variables) + variables = {}, + }, + }, + } + -- Ensure the servers and tools above are installed -- -- To check the current status of installed tools and/or manually install @@ -286,6 +314,7 @@ return { 'css-variables-language-server', 'cssmodules-language-server', 'delve', + 'emmet-language-server', 'goimports-reviser', 'golangci-lint', 'golangci-lint-langserver', diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index d877130..32aa117 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -54,11 +54,10 @@ require('lazy').setup({ -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug', + require 'kickstart.plugins.debug', -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.autopairs', -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config.