dap
This commit is contained in:
parent
b84724fe2c
commit
8531fab65b
7 changed files with 120 additions and 68 deletions
|
|
@ -47,10 +47,17 @@ map { 'n', '<s-tab>', '<cmd>:NnnExplorer %:p:h<CR>', noremap = true, silent = tr
|
||||||
|
|
||||||
-- plugins - terminal
|
-- plugins - terminal
|
||||||
map {"n", "<leader>gg", "<cmd>lua _lazygit_toggle()<CR>", {noremap = true, silent = true}}
|
map {"n", "<leader>gg", "<cmd>lua _lazygit_toggle()<CR>", {noremap = true, silent = true}}
|
||||||
map {"n", "<leader>gp", "<cmd>lua _pipeline_toggle()<CR>", {noremap = true, silent = true}}
|
map {"n", "<leader>gl", "<cmd>lua _glab_toggle()<CR>", {noremap = true, silent = true}}
|
||||||
|
map {"n", "<leader>gh", "<cmd>lua _ghub_toggle()<CR>", {noremap = true, silent = true}}
|
||||||
|
|
||||||
-- diagnostic
|
-- diagnostic
|
||||||
map {"n", "<leader>e", "<cmd>lua require\'telescope.builtin\'.lsp_diagnostics{}<CR>", { noremap = true, silent = true}}
|
map {"n", "<leader>e", "<cmd>lua require\'telescope.builtin\'.lsp_diagnostics{}<CR>", { noremap = true, silent = true}}
|
||||||
map {"n", "<leader>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", { noremap = true, silent = true}}
|
map {"n", "<leader>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", { noremap = true, silent = true}}
|
||||||
map {"n", "]g", "<cmd>lua vim.diagnostic.goto_next()<CR>", { noremap = true, silent = true}}
|
map {"n", "]g", "<cmd>lua vim.diagnostic.goto_next()<CR>", { noremap = true, silent = true}}
|
||||||
map {"n", "[g", "<cmd>lua vim.diagnostic.goto_prev()<CR>", { noremap = true, silent = true}}
|
map {"n", "[g", "<cmd>lua vim.diagnostic.goto_prev()<CR>", { noremap = true, silent = true}}
|
||||||
|
-- dap
|
||||||
|
map {"n", "<leader>db", "<cmd>lua require'dap'.toggle_breakpoint()<CR>", { noremap = true, silent = true}}
|
||||||
|
map {"n", "<leader>du", "<cmd>lua require'dapui'.toggle()<CR>", { noremap = true, silent = true}}
|
||||||
|
map {"n", "<leader>dc", "<cmd>lua require'dap'.continue()<CR>", { noremap = true, silent = true}}
|
||||||
|
map {"n", "<leader>dr", "<cmd>lua require'dap'.repl.open()<CR>", { noremap = true, silent = true}}
|
||||||
|
map {"n", "<leader>di", "<cmd>lua require'dap'.step_into()<CR>", { noremap = true, silent = true}}
|
||||||
|
|
|
||||||
25
hm-imports/nvim/config/lua/plugin/dap.lua
Normal file
25
hm-imports/nvim/config/lua/plugin/dap.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
local dap = require('dap')
|
||||||
|
dap.adapters.coreclr = {
|
||||||
|
type = 'executable',
|
||||||
|
command = '/nix/var/nix/profiles/per-user/ragon/home-manager/home-path/bin/netcoredbg', -- TODO this is a gross hack, please fix
|
||||||
|
args = {'--interpreter=vscode'}
|
||||||
|
}
|
||||||
|
dap.configurations.cs = {
|
||||||
|
{
|
||||||
|
type = "coreclr",
|
||||||
|
name = "launch - netcoredbg",
|
||||||
|
request = "launch",
|
||||||
|
program = function()
|
||||||
|
return vim.fn.input('Path to dll', vim.fn.getcwd() .. '/bin/Debug/', 'file')
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "coreclr",
|
||||||
|
name = "attach - netcoredbg",
|
||||||
|
mode = "local",
|
||||||
|
request = "attach",
|
||||||
|
processId = require("dap.utils").pick_process,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
require'dapui'.setup {}
|
||||||
|
|
@ -2,28 +2,28 @@ local lspconfig = require 'lspconfig'
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
-- lsp keymaps
|
-- lsp keymaps
|
||||||
local lsp_attach_keymappings = {
|
local lsp_attach_keymappings = {
|
||||||
['gD'] = 'vim.lsp.buf.declaration()',
|
['gD'] = 'vim.lsp.buf.declaration()',
|
||||||
['gd'] = 'vim.lsp.buf.definition()',
|
['gd'] = 'vim.lsp.buf.definition()',
|
||||||
['K'] = 'vim.lsp.buf.hover()',
|
['K'] = 'vim.lsp.buf.hover()',
|
||||||
['gi'] = 'vim.lsp.buf.implementation()',
|
['gi'] = 'require\'telescope.builtin\'.lsp_implementations()',
|
||||||
['<C-k>'] = 'vim.lsp.buf.signature_help()',
|
['<localleader>k'] = 'vim.lsp.buf.signature_help()',
|
||||||
['<leader>wa'] = 'vim.lsp.buf.add_workspace_folder()',
|
['<leader>wa'] = 'vim.lsp.buf.add_workspace_folder()',
|
||||||
['<leader>wr'] = 'vim.lsp.buf.remove_workspace_folder()',
|
['<leader>wr'] = 'vim.lsp.buf.remove_workspace_folder()',
|
||||||
['<leader>ws'] = 'vim.lsp.buf.workspace_symbol()',
|
['<leader>ws'] = 'require\'telescope.builtin\'.lsp_workspace_symbols()',
|
||||||
['<leader>wl'] = 'print(vim.inspect(vim.lsp.buf.list_workspace_folders()))',
|
['<leader>wl'] = 'print(vim.inspect(vim.lsp.buf.list_workspace_folders()))',
|
||||||
['<leader>D'] = 'vim.lsp.buf.type_definition()',
|
['<leader>D'] = 'require\'telescope.builtin\'.lsp_type_definitions()',
|
||||||
['<leader>rn'] = 'vim.lsp.buf.rename()',
|
['<leader>rn'] = 'vim.lsp.buf.rename()',
|
||||||
['<leader>ca'] = 'vim.lsp.buf.code_action()',
|
['<leader>ca'] = 'vim.lsp.buf.code_action()',
|
||||||
['gr'] = 'vim.lsp.buf.references()',
|
['gr'] = 'require\'telescope.builtin\'.lsp_references()',
|
||||||
['<leader>f'] = 'vim.lsp.buf.format()'
|
['<leader>f'] = 'vim.lsp.buf.format()'
|
||||||
}
|
}
|
||||||
local buf_nnoremap_lua = function(bufnr, keys, command)
|
local buf_nnoremap_lua = function(bufnr, keys, command)
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', keys, '<cmd>lua ' .. command .. '<CR>', { noremap = true, silent = true })
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', keys, '<cmd>lua ' .. command .. '<CR>', { noremap = true, silent = true })
|
||||||
end
|
end
|
||||||
local on_lsp_attach = function(_, bufnr)
|
local on_lsp_attach = function(_, bufnr)
|
||||||
-- Enable completion triggered by <c-x><c-o>:
|
-- Enable completion triggered by <c-x><c-o>:
|
||||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
for key, cmd in pairs(lsp_attach_keymappings) do buf_nnoremap_lua(bufnr, key, cmd) end
|
for key, cmd in pairs(lsp_attach_keymappings) do buf_nnoremap_lua(bufnr, key, cmd) end
|
||||||
end
|
end
|
||||||
|
|
||||||
lspconfig.gopls.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
lspconfig.gopls.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
|
|
@ -33,15 +33,15 @@ lspconfig.nil_ls.setup { capabilities = capabilities, on_attach = on_lsp_attach
|
||||||
lspconfig.terraformls.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
lspconfig.terraformls.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
lspconfig.tsserver.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
lspconfig.tsserver.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
lspconfig.vimls.setup {
|
lspconfig.vimls.setup {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_lsp_attach,
|
on_attach = on_lsp_attach,
|
||||||
isNeovim = true,
|
isNeovim = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
lspconfig.csharp_ls.setup {
|
lspconfig.csharp_ls.setup {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_lsp_attach,
|
on_attach = on_lsp_attach,
|
||||||
cmd = {vim.env.HOME .. "/.dotnet/tools/csharp-ls"},
|
cmd = { vim.env.HOME .. "/.dotnet/tools/csharp-ls" },
|
||||||
}
|
}
|
||||||
lspconfig.ltex.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
lspconfig.ltex.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
-- start vscode included language servers
|
-- start vscode included language servers
|
||||||
|
|
@ -51,52 +51,54 @@ lspconfig.cssls.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
lspconfig.jsonls.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
lspconfig.jsonls.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
-- end vscode included language servers
|
-- end vscode included language servers
|
||||||
lspconfig.texlab.setup { capabilities = capabilities, on_attach = on_lsp_attach, settings = { texlab = {
|
lspconfig.texlab.setup { capabilities = capabilities, on_attach = on_lsp_attach, settings = { texlab = {
|
||||||
build = {
|
build = {
|
||||||
executable = "tectonic",
|
executable = "tectonic",
|
||||||
args = { "%f", "--keep-logs", "--synctex"},
|
args = { "%f", "--keep-logs", "--synctex" },
|
||||||
onSave = true,
|
onSave = true,
|
||||||
forwardSearchAfter = true,
|
forwardSearchAfter = true,
|
||||||
},
|
},
|
||||||
chktex = { onOpenAndSave = true, },
|
chktex = { onOpenAndSave = true, },
|
||||||
forwardSearch = {
|
forwardSearch = {
|
||||||
executable = "/Applications/Skim.app/Contents/SharedSupport/displayline",
|
executable = "/Applications/Skim.app/Contents/SharedSupport/displayline",
|
||||||
args = {"-r", "-d", "%l","%p","%f"},
|
args = { "-r", "-d", "%l", "%p", "%f" },
|
||||||
},
|
},
|
||||||
}} }
|
} } }
|
||||||
lspconfig.sumneko_lua.setup {
|
lspconfig.sumneko_lua.setup {
|
||||||
capabilities = capabilities, on_attach = on_lsp_attach,
|
capabilities = capabilities, on_attach = on_lsp_attach,
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
runtime = {
|
runtime = {
|
||||||
version = 'LuaJIT'
|
version = 'LuaJIT'
|
||||||
},
|
},
|
||||||
diagnostics = { globals = { 'vim' } },
|
diagnostics = { globals = { 'vim' } },
|
||||||
workspace = {
|
workspace = {
|
||||||
-- Make the LSP aware of Neovim runtime files:
|
-- Make the LSP aware of Neovim runtime files:
|
||||||
checkThirdParty = false,
|
checkThirdParty = false,
|
||||||
library = vim.api.nvim_get_runtime_file('', true)
|
library = vim.api.nvim_get_runtime_file('', true)
|
||||||
},
|
},
|
||||||
format = {
|
format = {
|
||||||
enable = true,
|
enable = true,
|
||||||
defaultConfig = {
|
defaultConfig = {
|
||||||
indent_style = 'space',
|
indent_style = 'space',
|
||||||
indent_size = '2',
|
indent_size = '2',
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local rt = require("rust-tools")
|
local rt = require("rust-tools")
|
||||||
rt.setup({
|
rt.setup({
|
||||||
tools = {
|
tools = {
|
||||||
inlay_hints = {
|
inlay_hints = {
|
||||||
auto = true,
|
auto = true,
|
||||||
},
|
|
||||||
},
|
|
||||||
server = {
|
|
||||||
capabilities = capabilities, on_attach = on_lsp_attach,
|
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
server = {
|
||||||
|
capabilities = capabilities, on_attach = on_lsp_attach,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
local ft = require('flutter-tools')
|
||||||
|
ft.setup {}
|
||||||
|
|
|
||||||
|
|
@ -8,4 +8,5 @@ telescope.setup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
telescope.load_extension('ui-select')
|
telescope.load_extension('ui-select')
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,22 @@ function _lazygit_toggle()
|
||||||
lazygit:toggle()
|
lazygit:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
local pipeline = Terminal:new {
|
local glab = Terminal:new {
|
||||||
cmd = "glab ci view",
|
cmd = "glab ci view",
|
||||||
hidden = true,
|
hidden = true,
|
||||||
direction = 'float'
|
direction = 'float'
|
||||||
}
|
}
|
||||||
|
|
||||||
function _pipeline_toggle()
|
function _glab_toggle()
|
||||||
pipeline:toggle()
|
glab:toggle()
|
||||||
|
end
|
||||||
|
|
||||||
|
local ghub = Terminal:new {
|
||||||
|
cmd = "gh run view",
|
||||||
|
hidden = true,
|
||||||
|
direction = 'float'
|
||||||
|
}
|
||||||
|
|
||||||
|
function _ghub_toggle()
|
||||||
|
ghub:toggle()
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -51,5 +51,6 @@ require('plugin.noice')
|
||||||
require('plugin.telescope')
|
require('plugin.telescope')
|
||||||
require('plugin.cmp')
|
require('plugin.cmp')
|
||||||
require('plugin.lsp')
|
require('plugin.lsp')
|
||||||
|
require('plugin.dap')
|
||||||
require('plugin.lualine')
|
require('plugin.lualine')
|
||||||
require('plugin.gitsigns')
|
require('plugin.gitsigns')
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
# embedded terminal
|
# embedded terminal
|
||||||
lazygit
|
lazygit
|
||||||
glab
|
glab
|
||||||
|
gh
|
||||||
|
|
||||||
# language servers
|
# language servers
|
||||||
nil # nix
|
nil # nix
|
||||||
|
|
@ -26,7 +27,8 @@
|
||||||
rustc
|
rustc
|
||||||
rustfmt
|
rustfmt
|
||||||
rust-analyzer
|
rust-analyzer
|
||||||
|
# c# debugging
|
||||||
|
(pkgs.writeShellScriptBin "netcoredbg" ''exec ${pkgs.unstable.netcoredbg}/bin/netcoredbg "$@"'') # don't fill $path with dlls
|
||||||
|
|
||||||
# other stuff
|
# other stuff
|
||||||
neovim-remote
|
neovim-remote
|
||||||
|
|
@ -79,8 +81,11 @@
|
||||||
|
|
||||||
# completion
|
# completion
|
||||||
nvim-lspconfig # lsp
|
nvim-lspconfig # lsp
|
||||||
vimspector # dap
|
nvim-dap # dap
|
||||||
|
nvim-dap-ui # dap stuffzies
|
||||||
|
nvim-dap-go
|
||||||
pkgs.unstable.vimPlugins.rust-tools-nvim # rust special sauce
|
pkgs.unstable.vimPlugins.rust-tools-nvim # rust special sauce
|
||||||
|
pkgs.unstable.vimPlugins.flutter-tools-nvim
|
||||||
# completion - nvim-cmp
|
# completion - nvim-cmp
|
||||||
cmp-nvim-lsp
|
cmp-nvim-lsp
|
||||||
cmp-buffer
|
cmp-buffer
|
||||||
|
|
@ -91,6 +96,7 @@
|
||||||
# completion-snippets
|
# completion-snippets
|
||||||
luasnip
|
luasnip
|
||||||
cmp_luasnip
|
cmp_luasnip
|
||||||
|
friendly-snippets # some premade snippets
|
||||||
|
|
||||||
|
|
||||||
toggleterm-nvim # embed terminals (for lazygit,...)
|
toggleterm-nvim # embed terminals (for lazygit,...)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue