local map = vim.keymap.set vim.cmd[[source $XDG_CONFIG_HOME/vim/keybindings.vim]] vim.api.nvim_create_autocmd('LspAttach', { callback = function(args) -- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') local lspbuf = vim.lsp.buf local bufopts = { noremap=true, buffer=args.buf } map({'n', 'v'}, '', lspbuf.code_action, bufopts) map('n', 'gD', lspbuf.declaration, bufopts) map('n', 'gd', lspbuf.definition, bufopts) map('n', 'K', lspbuf.hover, bufopts) map('n', 'gi', lspbuf.implementation, bufopts) map('n', 'D', lspbuf.type_definition, bufopts) map('n', 'rn', lspbuf.rename, bufopts) map('n', 'ca', lspbuf.code_action, bufopts) map('n', 'gr', lspbuf.references, bufopts) map('n', 'f', function() lspbuf.format { async = true } end, bufopts) end }) function file_mv_helper() vim.cmd('normal! 0i"A"0y$A p0imv j0') end -- general map("n", "ec", ":edit $XDG_CONFIG_HOME/nvim/init.lua") map("n", "sc", ":source $XDG_CONFIG_HOME/nvim/init.lua") -- nvim-dap map("n", "dd", ":lua require'dap'.continue()") map("n", "de", ":lua require'dap'.terminate() | :lua require'dap'.close()") map("n", "dl", ":lua require'dap'.step_into()") map("n", "dj", ":lua require'dap'.step_over()") map("n", "dk", ":lua require'dap'.step_out()") map("n", "dr", ":lua require'dap'.restart()") -- nvim-dap-ui map("n", "du", ":lua require'dapui'.toggle()") map("n", "drc", ":lua require'dap'.RunToCursor()") map("n", "db" , ":lua require'dap'.toggle_breakpoint()") map("n", "dcb", ":lua require'dap'.ToggleConditionalBreakpoint()") -- map("n", "dc", ":call GotoWindow(require'dap'.session_windows.code)") -- map("n", "dt", ":call GotoWindow(require'dap'.session_windows.tagpage)") -- map("n", "dv", ":call GotoWindow(require'dap'.session_windows.variables)") -- map("n", "dw", ":call GotoWindow(require'dap'.session_windows.watches)") -- map("n", "ds", ":call GotoWindow(require'dap'.session_windows.stack_trace)") -- map("n", "do", ":call GotoWindow(require'dap'.session_windows.output)") -- map("n", "dtcb", ":call vimspector#CleanLineBreakpoint()") -- neovim diagnostics map("n", "sd", ":lua vim.diagnostic.open_float()")