-- local map = vim.api.nvim_set_keymap local map = vim.keymap.set local g = vim.g local saga = require("lspsaga") saga.init_lsp_saga() local options = { noremap = true, silent = true } local remap = { noremap = false } g.mapleader = " " map("n", "", ":Telescope find_files", options) map("n", "", ":lua require'telescope.builtin'.live_grep{ cwd = vim.fn.getcwd() }", options) -- map("n", "", ":Telescope command_center", options) map("n", "", "za", remap) -- LSP Functionality map("n", "n", ":lua vim.diagnostic.goto_next()", options) map("n", "p", ":lua vim.diagnostic.goto_prev()", options) map("n", "gD", "lua vim.lsp.buf.declaration()", options) map("n", "gd", "lua vim.lsp.buf.definition()", options) map("n", "gi", "lua vim.lsp.buf.implementation()", options) map("n", "K", "Lspsaga hover_doc", { silent = true }) -- map("n", "o", "LSoutlineToggle", { silent = true }) map("n", "e", "Lspsaga show_cursor_diagnostics", { silent = true }) map("n", "rn", "Lspsaga rename", options) map({ "n", "v" }, "c", "Lspsaga code_action", { silent = true }) map({ "n", "v" }, "gr", "Lspsaga lsp_finder", options) map("n", "t", ":TroubleToggle", remap) -- DAP Functionality map("n", "b", ":lua require('dap').toggle_breakpoint()", options) -- Test Functionality map("n", "tt", ":lua require('neotest').run.run()", options) map("n", "to", ":lua require('neotest').summary.open()", options) map({ "n", "v" }, "+", ":Boole increment", options) map({ "n", "v" }, "-", ":Boole decrement", options) -- Navigate Buffers map("n", "", "h", options) map("n", "", "j", options) map("n", "", "k", options) map("n", "", "l", options) map("n", "1", "1gt", options) map("n", "2", "2gt", options) map("n", "3", "3gt", options) map("n", "4", "4gt", options) map("n", "0", ":tablast", options) map("n", "m", ":lua require('harpoon.mark').add_file()", options) -- Navigate Files map("n", "", ":Telescope harpoon marks", options) -- Handling Splits map("n", "h", ":sp", remap) -- horizontal map("n", "v", ":vs", remap) -- vertical -- Browser like next/previous map("n", "", ":bprevious", options) map("n", "", ":bnext", options) -- Backspace Delete like Browser map("i", "", "dbxi", options) -- Copy visual selection to keyboard map("v", "Y", '"+y', options) map("n", "k", "{", options) map("n", "j", "}", options) -- I dont use macros at the moment, can disable this if i want to -- map('v', 'Q', 'q', {}) -- map('v', 'Q', 'q', {}) -- map('n', 'q', '', {}) -- map('n', 'q', '', {}) -- Move lines vscode style map("n", "", "move +1", options) map("n", "", "move -2", options) map("i", "", "move +1", options) map("i", "", "move -2", options) map("v", "", ":m '>+1gv=gv", options) map("v", "", ":m '<-2gv=gv", options) map("n", "", "YP", options) map("n", "", "Yp", options) -- Faster git merge map("n", "gd", ":Gvdiffsplit!", options) map("n", "gdl", ":diffget //3", options) map("n", "gdh", ":diffget //2", options) -- Find file in NvimTree map("n", "f", ":NvimTreeFindFile", options) map("n", "", ":vsplit", options) map("n", "", ":split", options) -- I aint no weak boy map("n", "", ":echo 'No Left for you'", options) map("n", "", ":echo 'No Right for you'", options) map("n", "", ":echo 'No Up for you'", options) map("n", "", ":echo 'No Down for you'", options) -- Run Requests map("n", "r", ":SnipRun", options) map("v", "r", ":'<,'>SnipRun", options) -- Close on q map("n", "q", ":q", options) map("n", "", ":qall", options) -- Open Nerdtree map("n", "", ":NvimTreeToggle", options) -- Make ctrl+s work map("n", "", ":w", options) map("i", "", ":wi", options)