commit
						40eb4a99d0
					
				
							
								
								
									
										4
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										4
									
								
								init.lua
								
								
								
								
							|  | @ -282,8 +282,9 @@ require('lazy').setup({ | |||
| 
 | ||||
|       -- Document existing key chains | ||||
|       require('which-key').register { | ||||
|         ['<leader>b'] = { name = '[B]uffer', _ = '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>s'] = { name = '[S]earch', _ = 'which_key_ignore' }, | ||||
|         ['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, | ||||
|  | @ -560,6 +561,7 @@ require('lazy').setup({ | |||
|         pyright = {}, | ||||
|         ruff = {}, | ||||
|         taplo = {}, -- LSP for toml files | ||||
|         debugpy = {}, | ||||
|         -- rust_analyzer = {}, | ||||
|         -- ... 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() | ||||
| end, { desc = '[S]ave file' }) | ||||
| 
 | ||||
| 
 | ||||
| -- mappings barbar | ||||
| 
 | ||||
| local map = vim.api.nvim_set_keymap | ||||
| local opts = { noremap = true, silent = true } | ||||
| 
 | ||||
| -- Move to previous/next | ||||
| map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts) | ||||
| map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts) | ||||
|  | @ -41,6 +41,9 @@ map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts) | |||
| -- Wipeout buffer | ||||
| --                 :BufferWipeout | ||||
| -- 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 | ||||
| --                 :BufferCloseAllButPinned | ||||
| --                 :BufferCloseAllButCurrentOrPinned | ||||
|  | @ -49,8 +52,8 @@ map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts) | |||
| -- Magic buffer-picking mode | ||||
| map('n', '<C-p>', '<Cmd>BufferPick<CR>', opts) | ||||
| -- Sort automatically by... | ||||
| map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts) | ||||
| map('n', '<Space>bn', '<Cmd>BufferOrderByName<CR>', opts) | ||||
| map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts) | ||||
| map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts) | ||||
| map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts) | ||||
| map('n', '<leader>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts) | ||||
| map('n', '<leader>bn', '<Cmd>BufferOrderByName<CR>', opts) | ||||
| map('n', '<leader>bd', '<Cmd>BufferOrderByDirectory<CR>', opts) | ||||
| map('n', '<leader>bl', '<Cmd>BufferOrderByLanguage<CR>', opts) | ||||
| map('n', '<leader>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts) | ||||
|  | @ -23,7 +23,7 @@ return { | |||
| 
 | ||||
|     -- Add your own debuggers here | ||||
|     'leoluz/nvim-dap-go', | ||||
|     'mfussenegger/nvim-dap-python' | ||||
|     'mfussenegger/nvim-dap-python', | ||||
|   }, | ||||
|   config = function() | ||||
|     local dap = require 'dap' | ||||
|  | @ -42,8 +42,7 @@ return { | |||
|       -- online, please don't ask me how to install them :) | ||||
|       ensure_installed = { | ||||
|         -- Update this to ensure that you have the debuggers for the langs you want | ||||
|         'delve', | ||||
|         'debugpy' | ||||
|         'python', | ||||
|       }, | ||||
|     } | ||||
| 
 | ||||
|  | @ -52,10 +51,11 @@ return { | |||
|     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', '<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>B', function() | ||||
|     vim.keymap.set('n', '<leader>db', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) | ||||
|     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: ') | ||||
|     end, { desc = 'Debug: Set Breakpoint' }) | ||||
|     end, { desc = 'Debug: Set Breakpoint condition' }) | ||||
| 
 | ||||
|     -- Dap UI setup | ||||
|     -- 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. | ||||
|     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.before.event_terminated['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 | ||||
|     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, | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue