mirror of
https://github.com/chenasraf/dotfiles.git
synced 2026-05-18 01:29:06 +00:00
feat: remap updates
This commit is contained in:
@@ -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>')
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user