diff --git a/init.lua b/init.lua index b19bb9a2..56cbab79 100644 --- a/init.lua +++ b/init.lua @@ -614,7 +614,7 @@ require('lazy').setup({ -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { - -- clangd = {}, + clangd = {}, gopls = {}, pyright = {}, rust_analyzer = {}, @@ -714,6 +714,7 @@ require('lazy').setup({ -- You can use 'stop_after_first' to run the first available formatter from the list -- javascript = { "prettierd", "prettier", stop_after_first = true }, proto = { 'buf' }, + cpp = { 'clang-format' }, }, }, }, diff --git a/lua/custom/plugins/clangd.lua b/lua/custom/plugins/clangd.lua new file mode 100644 index 00000000..95026b7c --- /dev/null +++ b/lua/custom/plugins/clangd.lua @@ -0,0 +1,12 @@ +return { + { + 'neovim/nvim-lspconfig', + opts = { + setup = { + clangd = function(_, opts) + opts.capabilities.offsetEncoding = { 'utf-16' } + end, + }, + }, + }, +} diff --git a/lua/custom/plugins/neotest.lua b/lua/custom/plugins/neotest.lua new file mode 100644 index 00000000..92b5972a --- /dev/null +++ b/lua/custom/plugins/neotest.lua @@ -0,0 +1,92 @@ +return { + 'nvim-neotest/neotest', + dependencies = { + 'nvim-neotest/nvim-nio', + 'nvim-lua/plenary.nvim', + 'antoinemadec/FixCursorHold.nvim', + 'nvim-treesitter/nvim-treesitter', + 'nvim-neotest/neotest-python', + 'nvim-neotest/neotest-plenary', + 'nvim-neotest/neotest-vim-test', + }, + config = function() + require('neotest').setup { + adapters = { + require 'neotest-python' { + dap = { justMyCode = false }, + runner = 'pytest', + }, + require 'neotest-plenary', + -- require 'neotest-vim-test' { + -- ignore_file_types = { 'python', 'vim', 'lua' }, + -- }, + }, + } + end, + keys = { + { 't', '', desc = '+test' }, + { + 'tt', + function() + require('neotest').run.run(vim.fn.expand '%') + end, + desc = 'Run File', + }, + { + 'tT', + function() + require('neotest').run.run(vim.uv.cwd()) + end, + desc = 'Run All Test Files', + }, + { + 'tr', + function() + require('neotest').run.run() + end, + desc = 'Run Nearest', + }, + { + 'tl', + function() + require('neotest').run.run_last() + end, + desc = 'Run Last', + }, + { + 'ts', + function() + require('neotest').summary.toggle() + end, + desc = 'Toggle Summary', + }, + { + 'to', + function() + require('neotest').output.open { enter = true, auto_close = true } + end, + desc = 'Show Output', + }, + { + 'tO', + function() + require('neotest').output_panel.toggle() + end, + desc = 'Toggle Output Panel', + }, + { + 'tS', + function() + require('neotest').run.stop() + end, + desc = 'Stop', + }, + { + 'tw', + function() + require('neotest').watch.toggle(vim.fn.expand '%') + end, + desc = 'Toggle Watch', + }, + }, +}