-- Keymaps vim.g.mapleader = " " vim.keymap.set('n', '', vim.cmd.UndotreeToggle) vim.keymap.set('n', 'p', [["_dP]]) vim.keymap.set('n', 'fa', vim.lsp.buf.format) vim.keymap.set('n', 'm', ":Mason") vim.keymap.set('n', 'e', ':Explore', { noremap = false, silent = true }) vim.keymap.set('n', 'le', ':Lexplore', { noremap = false, silent = true }) vim.keymap.set('n', 'l', ':Neotree', { noremap = false, silent = true }) -- Move lines while in visual mode vim.keymap.set('v', '', ':m \'>+1gv=gv', { noremap = true }) vim.keymap.set('v', '', ':m \'<-2gv=gv', { noremap = true }) -- Move lines while in normal mode vim.keymap.set('n', '', ':m .+1==', { noremap = true }) vim.keymap.set('n', '', ':m .-2==', { noremap = true }) -- Move line in edit mode vim.keymap.set('i', '', ':m .+1==gi', { noremap = true }) vim.keymap.set('i', '', ':m .-2==gi', { noremap = true }) -- Simplified split navigation vim.keymap.set('n', '', '') vim.keymap.set('n', '', '') vim.keymap.set('n', '', '') vim.keymap.set('n', '', '') -- Diagnostics ! vim.keymap.set('n', '', function() require('trouble').toggle('diagnostics') end) vim.keymap.set('n', 'd', function() vim.diagnostic.open_float() end) vim.keymap.set('n', 'dn', function() vim.diagnostic.goto_next() end) vim.keymap.set('n', 'dp', function() vim.diagnostic.goto_prev() end) vim.keymap.set('n', 'ca', function() vim.lsp.buf.code_action() end) -- Debugging vim.keymap.set('n', 'b', function() require('dap').toggle_breakpoint() end) vim.keymap.set('n', '', function() print("Start debug session") require('dap').continue() end) vim.keymap.set('n', '', function() require('dap').step_over() end) vim.keymap.set('n', '', function() require('dap').step_into() end) vim.keymap.set('n', '=', ":Gen Generate") -- Easily hit escape in terminal mode. vim.keymap.set("t", "", "") -- Open a terminal at the bottom of the screen with a fixed height. vim.keymap.set("n", ",st", function() vim.cmd.new() vim.cmd.wincmd "J" vim.api.nvim_win_set_height(0, 12) vim.wo.winfixheight = true vim.cmd.term() end) -- Open quickfix list vim.keymap.set("n", "", "cnextzz") vim.keymap.set("n", "", "cprevzz") -- Go to next in location list vim.keymap.set("n", "k", "lnextzz") vim.keymap.set("n", "j", "lprevzz") -- Highlight on yank vim.api.nvim_create_autocmd("TextYankPost", { desc = "Highlight when yanking text ", group = vim.api.nvim_create_augroup('barink', { clear = true }), callback = function() vim.highlight.on_yank() end })