diff --git a/init.lua b/init.lua index a0cf341..b3285fd 100644 --- a/init.lua +++ b/init.lua @@ -87,7 +87,7 @@ local zoom_notification = nil --- "Zoom" by changing gui font size --- @param delta integer -local function zoom(delta) +function _G.zoom(delta) local size = fn.substitute(o.guifont, [[^.*:h\([^:]*\).*$]], [[\1]], '') size = size + delta local guifont = fn.substitute(o.guifont, [[:h\([^:]*\)]], ':h' .. size, '') @@ -134,6 +134,7 @@ do }, ['c'] = {'vert te', 'Terminal (vsplit)'}, ['C'] = {'tab te', 'Terminal (tab)'}, + ['ZD'] = {'bdelete', 'Delete buffer'}, } which_key.register { [''] = {function () @@ -145,9 +146,6 @@ do vim.cmd('nohlsearch|diffupdate|normal! ') end, 'Clear'} } - which_key.register { ['+'] = {zoom_in, "Zoom in"} } - which_key.register { ['-'] = {zoom_out, "Zoom out"} } - if workman then which_key.register { j = {'n', 'Next search match'}, @@ -545,7 +543,7 @@ require'packer'.startup(function(use) -- figure out how to ensure java-test and java-debug-adapter } end} - use {'TimUntersberger/neogit', config = function () + use {'NeogitOrg/neogit', config = function () require'neogit'.setup { disable_context_highlighting = true, integrations = { @@ -657,10 +655,11 @@ require'packer'.startup(function(use) use {'debugloop/telescope-undo.nvim', after = 'telescope.nvim', config = function() require'telescope'.load_extension('undo') end} - use {'nvim-neotest/neotest', requires = {'rcasia/neotest-java'}, config = function() + use {'nvim-neotest/neotest', requires = {'rcasia/neotest-java', 'nvim-neotest/neotest-vim-test'}, config = function() require'neotest'.setup { adapters = { - require'neotest-java' {} + require'neotest-java' {}, + require'neotest-vim-test' {}, } } end} @@ -722,9 +721,10 @@ vim.cmd [[ ---- autopairs ---- vim.g.AutoPairsMultilineClose = 0 +vim.g.AutoPairsMapCR = 0 -- temp workaround vim.g.AutoPairsMapBS = 1 vim.g.AutoPairsCompatibleMaps = 1 - +vim.g.AutoPairsShortcutToggleMultilineClose = '' ---- barbar ---- require'which-key'.register { @@ -1001,6 +1001,9 @@ au('FileType', { callback = function () local ok, jdtls = pcall(require, 'jdtls') if not ok then return end + jdtls.tests = require'jdtls.tests' + jdtls.dap = require'jdtls.dap' + _G.jdt = jdtls local path = vim.fn.stdpath('data') .. '/mason/packages/jdtls' local root_dir = jdtls.setup.find_root({'.git', 'mvnw', 'gradlew'}) @@ -1046,7 +1049,6 @@ au('FileType', { on_attach = function (client, bufnr) on_attach(client, bufnr) jdtls.setup_dap() - jdtls.setup.add_commands() end, } @@ -1176,7 +1178,7 @@ require'symbols-outline'.setup { -- Don't display preview automatically auto_preview = false, -- Don't highlight the hovered item - highlight_hovered_item = false, + highlight_hovered_item = true, -- Width should be in colums, not percent relative_width = false, -- width of the symbols window @@ -1261,6 +1263,7 @@ vim.keymap.set('n', 't', 'NvimTreeFindFile', {desc = 'Nvim Tree ---- treesitter ---- +---@diagnostic disable-next-line: missing-fields require'nvim-treesitter.configs'.setup { -- Configure the nvim-ts-autotag plugin autotag = {