diff --git a/.config/nvim/lua/core/mappings.lua b/.config/nvim/lua/core/mappings.lua index edca8ac..f93735e 100644 --- a/.config/nvim/lua/core/mappings.lua +++ b/.config/nvim/lua/core/mappings.lua @@ -27,8 +27,6 @@ map('n', '2', 'set tabstop=2 softtabstop=2 shiftwidth=2', defau map('n', '4', 'set tabstop=4 softtabstop=4 shiftwidth=4', default_options) map('n', '8', 'set tabstop=8 softtabstop=8 shiftwidth=8', default_options) -map('n', '', 'nohlsearch', default_options) - -- digraphs map('i', 'd', 'lua require("better-digraphs").digraphs("i")', default_options) @@ -101,11 +99,21 @@ map('n', '|', "WindowsMaximizeHorizontally", default_options) map('n', '=', "WindowsEqualize", default_options) -- specs -vim.api.nvim_set_keymap('n', 'n', 'n:lua require("specs").show_specs()', default_options) -vim.api.nvim_set_keymap('n', 'N', 'N:lua require("specs").show_specs()', default_options) -vim.api.nvim_set_keymap('n', 'v', ':lua require("specs").show_specs({width = 97, winhl = "Search", delay_ms = 610, inc_ms = 21})', { noremap = true, silent = true }) +map('n', 'n', 'n:lua require("specs").show_specs()', default_options) +map('n', 'N', 'N:lua require("specs").show_specs()', default_options) +map('n', '', 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', 'cb', ':lua require("nvim-navbuddy").open()', default_options) -- dap map('v', 'K', 'lua require("dapui").eval()', default_options) +map('n', 'dc', ':lua require("dap").continue()', default_options); +map('n', 'db', ':lua require("dap").toggle_breakpoint()', default_options); +map('n', 'dB', ':lua require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: "))', default_options); +map('n', 'dn', ':lua require("dap").step_over()', default_options); +map('n', 'di', ':lua require("dap").step_into()', default_options); +map('n', 'do', ':lua require("dap").step_out()', default_options); +map('n', 'dl', ':lua require("dap").run_last()', default_options); diff --git a/.config/nvim/lua/plugins/crates.lua b/.config/nvim/lua/plugins/crates.lua index fb4ffed..eeb0691 100644 --- a/.config/nvim/lua/plugins/crates.lua +++ b/.config/nvim/lua/plugins/crates.lua @@ -2,5 +2,5 @@ return { 'Saecki/crates.nvim', dependencies = 'jose-elias-alvarez/null-ls.nvim', config = true, - filetype = { "rust", "toml" } + ft = { "rust", "toml" } } diff --git a/.config/nvim/lua/plugins/dap-virtual-text.lua b/.config/nvim/lua/plugins/dap-virtual-text.lua index c8f7a20..18ad53c 100644 --- a/.config/nvim/lua/plugins/dap-virtual-text.lua +++ b/.config/nvim/lua/plugins/dap-virtual-text.lua @@ -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 } diff --git a/.config/nvim/lua/plugins/gitlinker.lua b/.config/nvim/lua/plugins/gitlinker.lua index 2e23908..3aa71b4 100644 --- a/.config/nvim/lua/plugins/gitlinker.lua +++ b/.config/nvim/lua/plugins/gitlinker.lua @@ -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 = "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" } diff --git a/.config/nvim/lua/plugins/null.lua b/.config/nvim/lua/plugins/null.lua index a3d4862..9fdf270 100644 --- a/.config/nvim/lua/plugins/null.lua +++ b/.config/nvim/lua/plugins/null.lua @@ -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}, }) diff --git a/.config/nvim/lua/plugins/transparent.lua b/.config/nvim/lua/plugins/transparent.lua index 58ceccc..0a6c6c4 100644 --- a/.config/nvim/lua/plugins/transparent.lua +++ b/.config/nvim/lua/plugins/transparent.lua @@ -12,5 +12,5 @@ return { exclude_groups = {}, -- table: groups you don't want to clear }) end, - cmd = {"TransparentEnable", "TransparentDisable", "TransparentToggle" }, + --cmd = {"TransparentEnable", "TransparentDisable", "TransparentToggle" }, } diff --git a/.config/nvim/lua/plugins/tshjkl.lua b/.config/nvim/lua/plugins/tshjkl.lua index 99d936c..0f52851 100644 --- a/.config/nvim/lua/plugins/tshjkl.lua +++ b/.config/nvim/lua/plugins/tshjkl.lua @@ -1,5 +1,27 @@ return { -- meta - v 'gsuuon/tshjkl.nvim', - setup = true + opts = { + keymaps = { + toggle = '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' + } + } + } }