-- set leader key to space vim.g.mapleader = " " local keymap = vim.keymap -- for conciseness --------------------- -- General Keymaps --------------------- -- use jk to exit insert mode keymap.set("i", "jk", "") -- clear search highlights keymap.set("n", "nh", ":nohl") -- delete single character without copying into register keymap.set("n", "x", '"_x') -- increment/decrement numbers keymap.set("n", "+", "") keymap.set("n", "-", "") -- window management keymap.set("n", "sv", "v") -- split window vertically keymap.set("n", "sh", "s") -- split window horizontally keymap.set("n", "se", "=") -- make split windows equal width & height keymap.set("n", "sx", ":close") -- close current split window keymap.set("n", "to", ":tabnew") -- open new tab keymap.set("n", "tx", ":tabclose") -- close current tab keymap.set("n", "tn", ":tabn") -- go to next tab keymap.set("n", "tp", ":tabp") -- go to previous tab ---------------------- -- Plugin Keybinds ---------------------- -- vim-maximizer keymap.set("n", "sm", ":MaximizerToggle") -- toggle split window maximization -- nvim-tree keymap.set("n", "e", ":NvimTreeToggle") -- toggle file explorer -- telescope keymap.set("n", "ff", "Telescope find_files") -- find files within current working directory, respects .gitignore keymap.set("n", "fs", "Telescope live_grep") -- find string in current working directory as you type keymap.set("n", "fc", "Telescope grep_string") -- find string under cursor in current working directory keymap.set("n", "fb", "Telescope buffers") -- list open buffers in current neovim instance keymap.set("n", "fh", "Telescope help_tags") -- list available help tags -- telescope git commands (not on youtube nvim video) keymap.set("n", "gc", "Telescope git_commits") -- list all git commits (use to checkout) ["gc" for git commits] keymap.set("n", "gfc", "Telescope git_bcommits") -- list git commits for current file/buffer (use to checkout) ["gfc" for git file commits] keymap.set("n", "gb", "Telescope git_branches") -- list git branches (use to checkout) ["gb" for git branch] keymap.set("n", "gs", "Telescope git_status") -- list current changes per file with diff preview ["gs" for git status] -- restart lsp server (not on youtube nvim video) keymap.set("n", "rs", ":LspRestart") -- mapping to restart lsp if necessary