Improve nvim debugging
This commit is contained in:
parent
34c1c17f41
commit
9351fb8460
@ -2,6 +2,7 @@ require('user.plugins') -- First to install packer
|
|||||||
--require('plugins.nord')
|
--require('plugins.nord')
|
||||||
require('user.settings')
|
require('user.settings')
|
||||||
require('user.keys')
|
require('user.keys')
|
||||||
|
--require('plugins.rust')
|
||||||
require('plugins.lspconfig')
|
require('plugins.lspconfig')
|
||||||
require('plugins.null-ls')
|
require('plugins.null-ls')
|
||||||
require('plugins.cmp')
|
require('plugins.cmp')
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
vim.opt.completeopt = {'menu', 'menuone', 'noselect', 'preview'}
|
vim.opt.completeopt = {'menu', 'menuone', 'noselect', 'preview'}
|
||||||
|
vim.opt.shortmess = vim.opt.shortmess + { c = true}
|
||||||
|
vim.api.nvim_set_option('updatetime', 1000)
|
||||||
|
|
||||||
require('luasnip.loaders.from_vscode').lazy_load()
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
|
|
||||||
@ -17,10 +19,11 @@ cmp.setup({
|
|||||||
{name = 'path'},
|
{name = 'path'},
|
||||||
{name = 'nvim_lsp'},
|
{name = 'nvim_lsp'},
|
||||||
{name = 'nvim_lsp_signature_help'},
|
{name = 'nvim_lsp_signature_help'},
|
||||||
{name = 'buffer'},
|
{name = 'buffer', keyword_length = 2},
|
||||||
{name = 'luasnip'},
|
{name = 'luasnip', keyword_length = 2},
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
documentation = cmp.config.window.bordered()
|
documentation = cmp.config.window.bordered()
|
||||||
},
|
},
|
||||||
formatting = {
|
formatting = {
|
||||||
@ -28,10 +31,10 @@ cmp.setup({
|
|||||||
format = function(entry, item)
|
format = function(entry, item)
|
||||||
local menu_icon = {
|
local menu_icon = {
|
||||||
nvim_lsp = 'λ',
|
nvim_lsp = 'λ',
|
||||||
nvim_lsp_signature_help = 'λ',
|
nvim_lsp_signature_help = 'λ“',
|
||||||
luasnip = '⋗',
|
luasnip = '⋗',
|
||||||
buffer = 'Ω',
|
buffer = 'Ω',
|
||||||
path = '🖫',
|
path = '»',
|
||||||
}
|
}
|
||||||
|
|
||||||
item.menu = menu_icon[entry.source.name]
|
item.menu = menu_icon[entry.source.name]
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
require("dap-vscode-js").setup({
|
require("dap-vscode-js").setup({
|
||||||
-- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node"
|
-- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node"
|
||||||
-- debugger_path = "(runtimedir)/site/pack/packer/opt/vscode-js-debug", -- Path to vscode-js-debug installation.
|
-- debugger_path = "(runtimedir)/site/pack/packer/opt/vscode-js-debug", -- Path to vscode-js-debug installation.
|
||||||
@ -10,8 +8,10 @@ require("dap-vscode-js").setup({
|
|||||||
-- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output.
|
-- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output.
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local dap = require('dap')
|
||||||
|
|
||||||
for _, language in ipairs({ "typescript", "javascript" }) do
|
for _, language in ipairs({ "typescript", "javascript" }) do
|
||||||
require("dap").configurations[language] = {
|
dap.configurations[language] = {
|
||||||
{
|
{
|
||||||
type = "pwa-node",
|
type = "pwa-node",
|
||||||
request = "attach",
|
request = "attach",
|
||||||
@ -22,8 +22,39 @@ for _, language in ipairs({ "typescript", "javascript" }) do
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
dap.adapters.codelldb = {
|
||||||
|
type = 'server',
|
||||||
|
port = "${port}",
|
||||||
|
executable = {
|
||||||
|
command = '/usr/bin/codelldb',
|
||||||
|
args = {"--port", "${port}"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations.rust = {
|
||||||
|
{
|
||||||
|
name = "Rust debug",
|
||||||
|
type = "codelldb",
|
||||||
|
request = "launch",
|
||||||
|
program = function()
|
||||||
|
vim.fn.jobstart('cargo build')
|
||||||
|
-- cargo metadata --no-deps --format-version 1 | jq -r '.target_directory'
|
||||||
|
-- cargo metadata --no-deps --format-version 1 | jq -r '.packages[].targets[] | select( .kind | map(. == "bin") | any ) | .name'
|
||||||
|
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/target/debug/', 'file')
|
||||||
|
end,
|
||||||
|
cwd = '${workspaceFolder}',
|
||||||
|
stopOnEntry = true,
|
||||||
|
showDisassembly = "never",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
local dapui = require('dapui')
|
local dapui = require('dapui')
|
||||||
dapui.setup()
|
dapui.setup()
|
||||||
require("nvim-dap-virtual-text").setup()
|
require("nvim-dap-virtual-text").setup()
|
||||||
|
|
||||||
vim.keymap.set('n', '<Leader>du', dapui.toggle)
|
vim.keymap.set('n', '<Leader>du', dapui.toggle)
|
||||||
|
vim.keymap.set('n', '<Leader>b', dap.toggle_breakpoint)
|
||||||
|
vim.keymap.set('n', '<Leader>c', dap.continue)
|
||||||
|
vim.keymap.set('n', '<Leader>o', dap.step_over)
|
||||||
|
vim.keymap.set('n', '<Leader>i', dap.step_into)
|
||||||
|
vim.keymap.set('n', '<Leader>q', dap.terminate)
|
||||||
|
|||||||
@ -30,7 +30,27 @@ require'lspconfig'.tsserver.setup({
|
|||||||
includeInlayFunctionLikeReturnTypeHints = true,
|
includeInlayFunctionLikeReturnTypeHints = true,
|
||||||
includeInlayEnumMemberValueHints = true,
|
includeInlayEnumMemberValueHints = true,
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
checkOnSave = {
|
||||||
|
command = 'clippy'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
require'lspconfig'.rust_analyzer.setup {
|
||||||
|
settings = {
|
||||||
|
['rust-analyzer'] = {
|
||||||
|
inlayHints = {
|
||||||
|
includeInlayParameterNameHints = 'all',
|
||||||
|
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||||
|
includeInlayFunctionParameterTypeHints = true,
|
||||||
|
includeInlayVariableTypeHints = true,
|
||||||
|
includeInlayPropertyDeclarationTypeHints = true,
|
||||||
|
includeInlayFunctionLikeReturnTypeHints = true,
|
||||||
|
includeInlayEnumMemberValueHints = true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
-- A list of parser names, or "all"
|
-- A list of parser names, or "all"
|
||||||
ensure_installed = { "typescript", "lua", "rust" },
|
ensure_installed = { "typescript", "lua", "rust", "toml" },
|
||||||
|
|
||||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
|
|||||||
@ -90,6 +90,7 @@ return require('packer').startup(function()
|
|||||||
}
|
}
|
||||||
|
|
||||||
use 'mfussenegger/nvim-dap'
|
use 'mfussenegger/nvim-dap'
|
||||||
|
use 'mfussenegger/nvim-jdtls' -- Java
|
||||||
use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap"} }
|
use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap"} }
|
||||||
use { "mxsdev/nvim-dap-vscode-js", requires = {"mfussenegger/nvim-dap"} }
|
use { "mxsdev/nvim-dap-vscode-js", requires = {"mfussenegger/nvim-dap"} }
|
||||||
use {
|
use {
|
||||||
|
|||||||
@ -63,3 +63,6 @@ endfunction
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
vim.cmd[[command! -nargs=* -bang RG call RipgrepFzf(<q-args>, <bang>0)]]
|
vim.cmd[[command! -nargs=* -bang RG call RipgrepFzf(<q-args>, <bang>0)]]
|
||||||
|
|
||||||
|
-- Rust
|
||||||
|
vim.g.rustfmt_autosave = 1
|
||||||
|
|||||||
@ -209,6 +209,11 @@ _G.packer_plugins = {
|
|||||||
path = "/home/patrick/.local/share/nvim/site/pack/packer/start/nvim-dap-vscode-js",
|
path = "/home/patrick/.local/share/nvim/site/pack/packer/start/nvim-dap-vscode-js",
|
||||||
url = "https://github.com/mxsdev/nvim-dap-vscode-js"
|
url = "https://github.com/mxsdev/nvim-dap-vscode-js"
|
||||||
},
|
},
|
||||||
|
["nvim-jdtls"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/patrick/.local/share/nvim/site/pack/packer/start/nvim-jdtls",
|
||||||
|
url = "https://github.com/mfussenegger/nvim-jdtls"
|
||||||
|
},
|
||||||
["nvim-lspconfig"] = {
|
["nvim-lspconfig"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/patrick/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
path = "/home/patrick/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||||
@ -234,6 +239,11 @@ _G.packer_plugins = {
|
|||||||
path = "/home/patrick/.local/share/nvim/site/pack/packer/start/plenary.nvim",
|
path = "/home/patrick/.local/share/nvim/site/pack/packer/start/plenary.nvim",
|
||||||
url = "https://github.com/nvim-lua/plenary.nvim"
|
url = "https://github.com/nvim-lua/plenary.nvim"
|
||||||
},
|
},
|
||||||
|
["rust-tools.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/patrick/.local/share/nvim/site/pack/packer/start/rust-tools.nvim",
|
||||||
|
url = "https://github.com/simrat39/rust-tools.nvim"
|
||||||
|
},
|
||||||
["rust.vim"] = {
|
["rust.vim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/patrick/.local/share/nvim/site/pack/packer/start/rust.vim",
|
path = "/home/patrick/.local/share/nvim/site/pack/packer/start/rust.vim",
|
||||||
|
|||||||
@ -128,13 +128,6 @@
|
|||||||
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
|
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
|
||||||
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
|
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
|
||||||
},
|
},
|
||||||
"custom/headset": {
|
|
||||||
"format": " {}",
|
|
||||||
"on-click": "$HOME/.config/waybar/connect_headset.sh",
|
|
||||||
"interval": 10,
|
|
||||||
"return-type": "json",
|
|
||||||
"exec": "$HOME/.config/waybar/check_headset.sh"
|
|
||||||
},
|
|
||||||
"custom/separator": {
|
"custom/separator": {
|
||||||
"format": "",
|
"format": "",
|
||||||
"tooltip": false
|
"tooltip": false
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 4e2dc2a5065f5e8e67366700f803c733682e8f8c
|
Subproject commit 6cc353def1121c94bc6717dbc6f5a97af41f8e55
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit e91b178ff832b7bcbbf4d99d9f467f63fd1b76b5
|
Subproject commit 25cb91f42d020f675bb0a2ce3fbd3a5d96119efa
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit 60a36d6f7adddfb68d68349dce3081e7d5c4d4ab
|
Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946
|
||||||
9
.zshrc
9
.zshrc
@ -86,7 +86,7 @@ fi
|
|||||||
|
|
||||||
export LANG=en_GB.UTF-8
|
export LANG=en_GB.UTF-8
|
||||||
export LC_CTYPE=en_GB.UTF-8
|
export LC_CTYPE=en_GB.UTF-8
|
||||||
export EDITOR='vim'
|
export EDITOR='nvim'
|
||||||
|
|
||||||
# FZF
|
# FZF
|
||||||
export FZF_DEFAULT_COMMAND='fd --type f'
|
export FZF_DEFAULT_COMMAND='fd --type f'
|
||||||
@ -100,3 +100,10 @@ export _JAVA_AWT_WM_NONREPARENTING=1
|
|||||||
# tabtab source for packages
|
# tabtab source for packages
|
||||||
# uninstall by removing these lines
|
# uninstall by removing these lines
|
||||||
[[ -f ~/.config/tabtab/zsh/__tabtab.zsh ]] && . ~/.config/tabtab/zsh/__tabtab.zsh || true
|
[[ -f ~/.config/tabtab/zsh/__tabtab.zsh ]] && . ~/.config/tabtab/zsh/__tabtab.zsh || true
|
||||||
|
|
||||||
|
# Let GPG know which TTY to send password question to
|
||||||
|
export GPG_TTY=$(tty)
|
||||||
|
|
||||||
|
# Add JBang to environment
|
||||||
|
alias j!=jbang
|
||||||
|
export PATH="$HOME/.jbang/bin:$PATH"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user