local opts = { noremap = true, silent = true } local map = vim.api.nvim_set_keymap map("", "", "", opts) vim.g.mapleader = " " vim.g.maplocalleader = " " -- Window Navigation without needing first map("n", "", "h", opts) map("n", "", "j", opts) map("n", "", "k", opts) map("n", "", "l", opts) -- Stay in visual mode when indenting map("v", "<", "", ">gv", opts) -- Resize with C-arrow map("n", "", "resize -2", opts) map("n", "", "resize +2", opts) map("n", "", "vertical resize -2", opts) map("n", "", "vertical resize +2", opts) -- Close context menus map('n', 'w', 'cclose', opts) -- Navigate buffers map("n", "", "bnext", opts) map("n", "", "bprevious", opts) map("n", "q", "Bdelete!", opts) -- NvimTree map('n', 'e', 'NvimTreeToggle', opts) map('n', 'o', 'NvimTreeFocus', opts) -- Comment map('n', '/', 'lua require(\'Comment.api\').toggle_current_linewise()', opts) map('v', '/', 'lua require(\'Comment.api\').toggle_linewise_op(vim.fn.visualmode())', opts) -- Telescope (See also configs/telescope.lua) map("n", "ff", "Telescope find_files", opts) map("n", "fw", "Telescope live_grep", opts) map("n", "fb", "Telescope buffers", opts) map("n", "fh", "Telescope help_tags", opts) map("n", "fo", "Telescope oldfiles", opts) -- This wasn't working for some reason in astrovim map("n", "gt", "Telescope git_status", opts) map("n", "gc", "Telescope git_commits", opts) -- Lspsaga (See also configs/lspsaga.lua) map("n", "K", "Lspsaga hover_doc", opts) map("n", "gl", "Lspsaga show_line_diagnostics", opts) map("n", "gj", "Lspsaga diagnostic_jump_next", opts) map("n", "gk", "Lspsaga diagnostic_jump_prev", opts) map("n", "gs", "Lspsaga signature_help", opts) map("n", "gpd", "Lspsaga preview_definition", opts) map("i", "", "Lspsaga signature_help", opts) map("n", "la", "Lspsaga code_action", opts) map("n", "lr", "Lspsaga rename", opts) map("n", "", "lua require('lspsaga.action').smart_scroll_with_saga(-1)", opts) map("n", "", "lua require('lspsaga.action').smart_scroll_with_saga(1)", opts) -- LSP (See also configs/lsp-installer.lua) -- vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) -- vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "lua vim.lsp.buf.definition()", opts) -- vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "lua vim.lsp.buf.implementation()", opts) -- vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) -- vim.api.nvim_buf_set_keymap(bufnr, "n", "go", "lua vim.diagnostic.open_float()", opts) -- vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", 'lua vim.diagnostic.goto_prev({ border = "rounded" })', opts) -- vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", 'lua vim.diagnostic.goto_next({ border = "rounded" })', opts) -- vim.api.nvim_buf_set_keymap(bufnr, "n", "p", "lua vim.diagnostic.setloclist()", opts)