2024-03-26 11:51:53 +00:00
|
|
|
-- Keymaps
|
|
|
|
vim.g.mapleader = " "
|
|
|
|
|
|
|
|
vim.keymap.set('n', '<leader><F8>', vim.cmd.UndotreeToggle)
|
|
|
|
vim.keymap.set('n', '<leader>p', [["_dP]])
|
|
|
|
vim.keymap.set('n', '<leader>fa', vim.lsp.buf.format)
|
|
|
|
vim.keymap.set('n', '<leader>m', ":Mason<CR>")
|
2024-03-26 16:06:54 +00:00
|
|
|
vim.keymap.set('n', '<leader>e',':Explore<CR>', {noremap = false, silent=true})
|
|
|
|
vim.keymap.set('n', '<leader>le',':Lexplore<CR>', {noremap = false, silent=true})
|
2024-07-15 19:58:28 +00:00
|
|
|
vim.keymap.set('n', '<leader>l', ':Neotree<CR>', {noremap = false, silent= true})
|
2024-03-26 16:48:06 +00:00
|
|
|
-- Move lines while in visual mode
|
2024-04-03 19:05:46 +00:00
|
|
|
vim.keymap.set('v', '<A-S-j>', ':m \'>+1<CR>gv=gv', {noremap = true})
|
|
|
|
vim.keymap.set('v', '<A-S-k>', ':m \'<-2<CR>gv=gv', {noremap = true})
|
2024-03-30 21:11:26 +00:00
|
|
|
|
2024-03-26 16:48:06 +00:00
|
|
|
-- Move lines while in normal mode
|
2024-04-03 19:05:46 +00:00
|
|
|
vim.keymap.set('n', '<A-S-j>', ':m .+1<CR>==', {noremap = true})
|
|
|
|
vim.keymap.set('n', '<A-S-k>', ':m .-2<CR>==', {noremap = true})
|
2024-03-30 21:11:26 +00:00
|
|
|
|
2024-03-26 16:48:06 +00:00
|
|
|
-- Move line in edit mode
|
|
|
|
vim.keymap.set('i', '<A-j>', ':m .+1<CR>==gi', {noremap = true})
|
|
|
|
vim.keymap.set('i', '<A-k>', ':m .-2<CR>==gi', {noremap = true})
|
2024-03-30 21:11:26 +00:00
|
|
|
|
|
|
|
-- Diagnostics !
|
|
|
|
vim.keymap.set('n', '<C-T>', function() require('trouble').toggle() end )
|
2024-04-06 20:45:06 +00:00
|
|
|
vim.keymap.set('n', '<leader>d', function () vim.diagnostic.open_float() end )
|
2024-03-30 21:11:26 +00:00
|
|
|
vim.keymap.set('n', '<leader>dn', function () vim.diagnostic.goto_next() end )
|
|
|
|
vim.keymap.set('n', '<leader>dp', function () vim.diagnostic.goto_prev() end )
|
2024-07-15 19:58:28 +00:00
|
|
|
vim.keymap.set('n', '<C-d>', function () vim.lsp.buf.code_action() end)
|
2024-03-30 21:11:26 +00:00
|
|
|
-- Debugging
|
|
|
|
vim.keymap.set('n', '<leader>sb', function () require('dap').toggle_breakpoint() end )
|
|
|
|
vim.keymap.set('n', '<leader>db', function () require('dapui').toggle() end )
|
2024-03-31 20:30:23 +00:00
|
|
|
vim.keymap.set('n', '<F5>', function () print("Start debug session" ) require('dap').continue() end )
|
|
|
|
vim.keymap.set('n', '<F6>', function () require('dap').step_over() end )
|
|
|
|
vim.keymap.set('n', '<F7>', function () require('dap').step_into() end )
|
2024-03-30 21:11:26 +00:00
|
|
|
|
2024-04-04 20:39:20 +00:00
|
|
|
vim.keymap.set('n', '<leader>=',":Gen Generate<CR>")
|