vim.g.mapleader = " " vim.g.maplocalleader = "\\" local map = vim.api.nvim_set_keymap local opts = { noremap = true, silent = true } map('n', 'd', '"_d', opts) map('v', 'd', '"_d', opts) -- Update plugins map('n', 'u', ':PackerSync', opts) -- New file map('n', 'n', 'enew', opts) -- Resize splits map('n', '', ':vertical resize -3', opts) map('n', '', ':vertical resize +3', opts) map('n', '', ':resize +3', opts) map('n', '', ':resize -3', opts) -- Nvim-tree.lua map('n', 'e', ':NvimTreeToggle', opts) map('n', 'f', ':NvimTreeFindFile', opts) -- Toggleterm map('n', 't', ':ToggleTerm size=50 direction=vertical', opts) map('n', 'T', ':ToggleTerm size=10 direction=horizontal', opts) -- barbar mappings map('n', '', ':BufferPrevious', opts) map('n', '', ':BufferNext', opts) map('n', '', ':BufferMovePrevious', opts) map('n', '>', ' :BufferMoveNext', opts) map('n', '', ':BufferGoto 1', opts) map('n', '', ':BufferGoto 2', opts) map('n', '', ':BufferGoto 3', opts) map('n', '', ':BufferGoto 4', opts) map('n', '', ':BufferGoto 5', opts) map('n', '', ':BufferGoto 6', opts) map('n', '', ':BufferGoto 7', opts) map('n', '', ':BufferGoto 8', opts) map('n', '', ':BufferGoto 9', opts) map('n', '', ':BufferLast', opts) map('n', '', ':BufferClose', opts) -- Compile a C file map('n', 'c', ':w:!gcc % -o %:r && ./%:r:botright 15split | term ./%:r:startinsert', opts)