feat: remap updates

This commit is contained in:
2024-06-25 01:17:39 +03:00
parent 762c67b6aa
commit b89756c50e
2 changed files with 30 additions and 7 deletions

View File

@@ -46,7 +46,7 @@ return {
-- Magic buffer-picking mode
vim.keymap.set('n', '<C-p>', '<Cmd>BufferPick<CR>')
-- Sort automatically by...
vim.keymap.set('n', '<leader>bb', '<Cmd>BufferOrderByBufferNumber<CR>')
vim.keymap.set('n', '<leader>bn', '<Cmd>BufferOrderByBufferNumber<CR>')
vim.keymap.set('n', '<leader>bd', '<Cmd>BufferOrderByDirectory<CR>')
vim.keymap.set('n', '<leader>bl', '<Cmd>BufferOrderByLanguage<CR>')
vim.keymap.set('n', '<leader>bw', '<Cmd>BufferOrderByWindowNumber<CR>')

View File

@@ -18,6 +18,7 @@ return {
-- Add your own debuggers here
'leoluz/nvim-dap-go',
'mfussenegger/nvim-dap-python',
'nvim-neotest/nvim-nio'
},
config = function()
@@ -47,6 +48,25 @@ return {
dap.configurations.typescript = dap.configurations.javascript
dap.configurations.typescriptreact = dap.configurations.javascript
dap.configurations.javascriptreact = dap.configurations.javascript
local function get_python_path()
if vim.env.VIRTUAL_ENV then
return vim.env.VIRTUAL_ENV .. "/bin/python"
end
return vim.fn.exepath("python3") or vim.fn.exepath("python") or "python"
end
local python_path = get_python_path()
dap.test_runner = "pytest"
dap.configurations.python = {
{
type = "python",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = vim.fn.getcwd(),
pythonPath = python_path,
},
}
require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with
@@ -70,10 +90,10 @@ return {
vim.keymap.set('n', '<F7>', dap.step_over, { desc = 'Debug: Step Over' })
vim.keymap.set('n', '<F8>', dap.step_into, { desc = 'Debug: Step Into' })
vim.keymap.set('n', '<F9>', dap.step_out, { desc = 'Debug: Step Out' })
vim.keymap.set('n', '<leader>bb', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' })
vim.keymap.set('n', '<leader>BB', function()
vim.keymap.set('n', '<leader>bb', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint', })
vim.keymap.set('n', '<leader>bc', function()
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
end, { desc = 'Debug: Set Breakpoint' })
end, { desc = 'Debug: Set Conditional Breakpoint' })
-- Dap UI setup
-- For more information, see |:help nvim-dap-ui|
@@ -101,10 +121,13 @@ return {
vim.keymap.set('n', '<F10>', dapui.toggle, { desc = 'Debug: See last session result.' })
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close
-- dap.listeners.before.event_terminated['dapui_config'] = dapui.close
-- dap.listeners.before.event_exited['dapui_config'] = dapui.close
-- Install golang specific config
-- golang
require('dap-go').setup()
-- python
require("dap-python").setup(python_path)
end,
}