Nvim: add dap, tshjkl bindings, working gitlinker
This commit is contained in:
@@ -27,8 +27,6 @@ map('n', '<leader>2', '<cmd>set tabstop=2 softtabstop=2 shiftwidth=2<cr>', defau
|
||||
map('n', '<leader>4', '<cmd>set tabstop=4 softtabstop=4 shiftwidth=4<cr>', default_options)
|
||||
map('n', '<leader>8', '<cmd>set tabstop=8 softtabstop=8 shiftwidth=8<cr>', default_options)
|
||||
|
||||
map('n', '<leader><space>', '<cmd>nohlsearch<cr>', default_options)
|
||||
|
||||
-- digraphs
|
||||
map('i', '<C-k>d', '<cmd>lua require("better-digraphs").digraphs("i")<cr>', default_options)
|
||||
|
||||
@@ -101,11 +99,21 @@ map('n', '<C-w>|', "<cmd>WindowsMaximizeHorizontally<cr>", default_options)
|
||||
map('n', '<C-w>=', "<cmd>WindowsEqualize<cr>", default_options)
|
||||
|
||||
-- specs
|
||||
vim.api.nvim_set_keymap('n', 'n', 'n:lua require("specs").show_specs()<CR>', default_options)
|
||||
vim.api.nvim_set_keymap('n', 'N', 'N:lua require("specs").show_specs()<CR>', default_options)
|
||||
vim.api.nvim_set_keymap('n', '<leader>v', ':lua require("specs").show_specs({width = 97, winhl = "Search", delay_ms = 610, inc_ms = 21})<CR>', { noremap = true, silent = true })
|
||||
map('n', 'n', 'n:lua require("specs").show_specs()<CR>', default_options)
|
||||
map('n', 'N', 'N:lua require("specs").show_specs()<CR>', default_options)
|
||||
map('n', '<leader><space>', function()
|
||||
vim.cmd.noh()
|
||||
require("specs").show_specs({width = 97, winhl = "Search", delay_ms = 610, inc_ms = 21})
|
||||
end, default_options)
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<leader>cb', ':lua require("nvim-navbuddy").open()<cr>', default_options)
|
||||
|
||||
-- dap
|
||||
map('v', 'K', '<cmd>lua require("dapui").eval()<cr>', default_options)
|
||||
map('n', '<leader>dc', ':lua require("dap").continue()<cr>', default_options);
|
||||
map('n', '<leader>db', ':lua require("dap").toggle_breakpoint()<cr>', default_options);
|
||||
map('n', '<leader>dB', ':lua require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: "))<cr>', default_options);
|
||||
map('n', '<leader>dn', ':lua require("dap").step_over()<cr>', default_options);
|
||||
map('n', '<leader>di', ':lua require("dap").step_into()<cr>', default_options);
|
||||
map('n', '<leader>do', ':lua require("dap").step_out()<cr>', default_options);
|
||||
map('n', '<leader>dl', ':lua require("dap").run_last()<cr>', default_options);
|
||||
|
||||
@@ -2,5 +2,5 @@ return {
|
||||
'Saecki/crates.nvim',
|
||||
dependencies = 'jose-elias-alvarez/null-ls.nvim',
|
||||
config = true,
|
||||
filetype = { "rust", "toml" }
|
||||
ft = { "rust", "toml" }
|
||||
}
|
||||
|
||||
@@ -1,4 +1,37 @@
|
||||
return {
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
config = true,
|
||||
config = function()
|
||||
require("nvim-dap-virtual-text").setup{
|
||||
enabled = true, -- enable this plugin (the default)
|
||||
enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination)
|
||||
highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText
|
||||
highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables)
|
||||
show_stop_reason = true, -- show stop reason when stopped for exceptions
|
||||
commented = false, -- prefix virtual text with comment string
|
||||
only_first_definition = true, -- only show virtual text at first definition (if there are multiple)
|
||||
all_references = false, -- show virtual text on all all references of the variable (not only definitions)
|
||||
clear_on_continue = false, -- clear virtual text on "continue" (might cause flickering when stepping)
|
||||
--- A callback that determines how a variable is displayed or whether it should be omitted
|
||||
--- @param variable Variable https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable
|
||||
--- @param buf number
|
||||
--- @param stackframe dap.StackFrame https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame
|
||||
--- @param node userdata tree-sitter node identified as variable definition of reference (see `:h tsnode`)
|
||||
--- @param options nvim_dap_virtual_text_options Current options for nvim-dap-virtual-text
|
||||
--- @return string|nil A text how the virtual text should be displayed or nil, if this variable shouldn't be displayed
|
||||
display_callback = function(variable, buf, stackframe, node, options)
|
||||
if options.virt_text_pos == 'inline' then
|
||||
return ' = ' .. variable.value
|
||||
else
|
||||
return variable.name .. ' = ' .. variable.value
|
||||
end
|
||||
end,
|
||||
-- position of virtual text, see `:h nvim_buf_set_extmark()`, default tries to inline the virtual text. Use 'eol' to set to end of line
|
||||
virt_text_pos = vim.fn.has 'nvim-0.10' == 1 and 'inline' or 'eol',
|
||||
|
||||
-- experimental features:
|
||||
all_frames = false, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine.
|
||||
virt_lines = false, -- show virtual lines instead of virtual text (will flicker!)
|
||||
virt_text_win_col = nil -- position the virtual text at a fixed window column (starting from the first text column) ,
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
@@ -3,27 +3,22 @@ return {
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim'
|
||||
},
|
||||
opts = {
|
||||
-- callbacks = {
|
||||
-- ["git.viessmann.com"] = function(url_data)
|
||||
-- local url = require'gitlinker.hosts'.get_base_https_url(url_data)
|
||||
-- if not url_data.file or not url_data.rev then
|
||||
-- return url
|
||||
-- end
|
||||
-- url = url .. "/src/" .. url_data.rev .. "/" .. url_data.file
|
||||
--
|
||||
-- if not url_data.lstart then
|
||||
-- return url
|
||||
-- end
|
||||
-- url = url .. "#lines-" .. url_data.lstart
|
||||
-- if url_data.lend then
|
||||
-- url = url .. ":" .. url_data.lend
|
||||
-- end
|
||||
--
|
||||
-- return url
|
||||
-- end
|
||||
-- },
|
||||
-- default mapping to call url generation with action_callback
|
||||
mappings = "<leader>gl"
|
||||
config = function()
|
||||
require('gitlinker').setup({
|
||||
router = {
|
||||
browse = {
|
||||
-- example: ssh://git@git.viessmann.com:7999/sysfunc/efmclib.git
|
||||
["^git%.viessmann%.com"] = "https://git.viessmann.com/projects/"
|
||||
.. "{_A.USER}/repos/"
|
||||
.. "{_A.REPO}/browse/"
|
||||
.. "{_A.FILE}"
|
||||
.. "#{_A.LSTART}"
|
||||
.. "{(_A.LEND > _A.LSTART and ('-' .. _A.LEND) or '')}",
|
||||
}
|
||||
},
|
||||
debug = true,
|
||||
file_log = true,
|
||||
})
|
||||
end,
|
||||
cmd = "GitLink"
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ return {
|
||||
null_ls.builtins.diagnostics.hadolint,
|
||||
null_ls.builtins.diagnostics.buf,
|
||||
null_ls.builtins.diagnostics.typos,
|
||||
null_ls.builtins.code_actions.proselint,
|
||||
null_ls.builtins.diagnostics.proselint,
|
||||
--null_ls.builtins.code_actions.proselint,
|
||||
--null_ls.builtins.diagnostics.proselint,
|
||||
null_ls.builtins.hover.dictionary,
|
||||
null_ls.builtins.formatting.black},
|
||||
})
|
||||
|
||||
@@ -12,5 +12,5 @@ return {
|
||||
exclude_groups = {}, -- table: groups you don't want to clear
|
||||
})
|
||||
end,
|
||||
cmd = {"TransparentEnable", "TransparentDisable", "TransparentToggle" },
|
||||
--cmd = {"TransparentEnable", "TransparentDisable", "TransparentToggle" },
|
||||
}
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
return {
|
||||
-- meta - v
|
||||
'gsuuon/tshjkl.nvim',
|
||||
setup = true
|
||||
opts = {
|
||||
keymaps = {
|
||||
toggle = '<leader>v',
|
||||
},
|
||||
marks = {
|
||||
parent = {
|
||||
virt_text = { {'h', 'ModeMsg'} },
|
||||
virt_text_pos = 'overlay'
|
||||
},
|
||||
child = {
|
||||
virt_text = { {'l', 'ModeMsg'} },
|
||||
virt_text_pos = 'overlay'
|
||||
},
|
||||
prev = {
|
||||
virt_text = { {'k', 'ModeMsg'} },
|
||||
virt_text_pos = 'overlay'
|
||||
},
|
||||
next = {
|
||||
virt_text = { {'j', 'ModeMsg'} },
|
||||
virt_text_pos = 'overlay'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user