commit
40eb4a99d0
4
init.lua
4
init.lua
|
@ -282,8 +282,9 @@ require('lazy').setup({
|
||||||
|
|
||||||
-- Document existing key chains
|
-- Document existing key chains
|
||||||
require('which-key').register {
|
require('which-key').register {
|
||||||
|
['<leader>b'] = { name = '[B]uffer', _ = 'which_key_ignore' },
|
||||||
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
||||||
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
|
['<leader>d'] = { name = '[D]ebugger', _ = 'which_key_ignore' },
|
||||||
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
||||||
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
||||||
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
||||||
|
@ -560,6 +561,7 @@ require('lazy').setup({
|
||||||
pyright = {},
|
pyright = {},
|
||||||
ruff = {},
|
ruff = {},
|
||||||
taplo = {}, -- LSP for toml files
|
taplo = {}, -- LSP for toml files
|
||||||
|
debugpy = {},
|
||||||
-- rust_analyzer = {},
|
-- rust_analyzer = {},
|
||||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||||
--
|
--
|
||||||
|
|
|
@ -12,11 +12,11 @@ vim.keymap.set('i', '<C-s>', function()
|
||||||
vim.cmd.w()
|
vim.cmd.w()
|
||||||
end, { desc = '[S]ave file' })
|
end, { desc = '[S]ave file' })
|
||||||
|
|
||||||
|
|
||||||
-- mappings barbar
|
-- mappings barbar
|
||||||
|
|
||||||
local map = vim.api.nvim_set_keymap
|
local map = vim.api.nvim_set_keymap
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
-- Move to previous/next
|
-- Move to previous/next
|
||||||
map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
|
map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
|
||||||
map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
|
map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
|
||||||
|
@ -41,6 +41,9 @@ map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts)
|
||||||
-- Wipeout buffer
|
-- Wipeout buffer
|
||||||
-- :BufferWipeout
|
-- :BufferWipeout
|
||||||
-- Close commands
|
-- Close commands
|
||||||
|
map('n', '<leader>bcab', '<Cmd>BufferCloseAllButCurrent<CR>', opts)
|
||||||
|
map('n', '<leader>bcab', '<Cmd>BufferCloseAllButPinned<CR>', opts)
|
||||||
|
map('n', '<leader>bcar', '<Cmd>BufferCloseBuffersRight<CR>', opts)
|
||||||
-- :BufferCloseAllButCurrent
|
-- :BufferCloseAllButCurrent
|
||||||
-- :BufferCloseAllButPinned
|
-- :BufferCloseAllButPinned
|
||||||
-- :BufferCloseAllButCurrentOrPinned
|
-- :BufferCloseAllButCurrentOrPinned
|
||||||
|
@ -49,8 +52,8 @@ map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts)
|
||||||
-- Magic buffer-picking mode
|
-- Magic buffer-picking mode
|
||||||
map('n', '<C-p>', '<Cmd>BufferPick<CR>', opts)
|
map('n', '<C-p>', '<Cmd>BufferPick<CR>', opts)
|
||||||
-- Sort automatically by...
|
-- Sort automatically by...
|
||||||
map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts)
|
map('n', '<leader>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts)
|
||||||
map('n', '<Space>bn', '<Cmd>BufferOrderByName<CR>', opts)
|
map('n', '<leader>bn', '<Cmd>BufferOrderByName<CR>', opts)
|
||||||
map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts)
|
map('n', '<leader>bd', '<Cmd>BufferOrderByDirectory<CR>', opts)
|
||||||
map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts)
|
map('n', '<leader>bl', '<Cmd>BufferOrderByLanguage<CR>', opts)
|
||||||
map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts)
|
map('n', '<leader>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts)
|
|
@ -23,7 +23,7 @@ return {
|
||||||
|
|
||||||
-- Add your own debuggers here
|
-- Add your own debuggers here
|
||||||
'leoluz/nvim-dap-go',
|
'leoluz/nvim-dap-go',
|
||||||
'mfussenegger/nvim-dap-python'
|
'mfussenegger/nvim-dap-python',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local dap = require 'dap'
|
local dap = require 'dap'
|
||||||
|
@ -42,8 +42,7 @@ return {
|
||||||
-- online, please don't ask me how to install them :)
|
-- online, please don't ask me how to install them :)
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
-- Update this to ensure that you have the debuggers for the langs you want
|
-- Update this to ensure that you have the debuggers for the langs you want
|
||||||
'delve',
|
'python',
|
||||||
'debugpy'
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,10 +51,11 @@ return {
|
||||||
vim.keymap.set('n', '<F1>', dap.step_into, { desc = 'Debug: Step Into' })
|
vim.keymap.set('n', '<F1>', dap.step_into, { desc = 'Debug: Step Into' })
|
||||||
vim.keymap.set('n', '<F2>', dap.step_over, { desc = 'Debug: Step Over' })
|
vim.keymap.set('n', '<F2>', dap.step_over, { desc = 'Debug: Step Over' })
|
||||||
vim.keymap.set('n', '<F3>', dap.step_out, { desc = 'Debug: Step Out' })
|
vim.keymap.set('n', '<F3>', dap.step_out, { desc = 'Debug: Step Out' })
|
||||||
vim.keymap.set('n', '<leader>b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' })
|
vim.keymap.set('n', '<leader>db', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' })
|
||||||
vim.keymap.set('n', '<leader>B', function()
|
vim.keymap.set('n', '<F9>', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' })
|
||||||
|
vim.keymap.set('n', '<leader>dB', function()
|
||||||
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
||||||
end, { desc = 'Debug: Set Breakpoint' })
|
end, { desc = 'Debug: Set Breakpoint condition' })
|
||||||
|
|
||||||
-- Dap UI setup
|
-- Dap UI setup
|
||||||
-- For more information, see |:help nvim-dap-ui|
|
-- For more information, see |:help nvim-dap-ui|
|
||||||
|
@ -78,6 +78,8 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
-- Load launch.json
|
||||||
|
require('dap.ext.vscode').load_launchjs()
|
||||||
|
|
||||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||||
vim.keymap.set('n', '<F7>', dapui.toggle, { desc = 'Debug: See last session result.' })
|
vim.keymap.set('n', '<F7>', dapui.toggle, { desc = 'Debug: See last session result.' })
|
||||||
|
@ -85,10 +87,12 @@ return {
|
||||||
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
||||||
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
||||||
dap.listeners.before.event_exited['dapui_config'] = dapui.close
|
dap.listeners.before.event_exited['dapui_config'] = dapui.close
|
||||||
local debugpyPythonPath = require("mason-registry").get_package("debugpy"):get_install_path() .. "/venv/bin/python3"
|
|
||||||
|
|
||||||
-- Install golang specific config
|
-- Install golang specific config
|
||||||
require('dap-go').setup()
|
require('dap-go').setup()
|
||||||
require("dap-python").setup(debugpyPythonPath, {})
|
-- Install python specific config
|
||||||
|
local debugpyPythonPath = "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
|
||||||
|
require('dap-python').setup(debugpyPythonPath)
|
||||||
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue