--[[ keys.lua ]] -- -- This function takes in four parameters: -- -- mode: the mode you want the key bind to apply to (e.g., insert mode, normal mode, command mode, visual mode). -- sequence: the sequence of keys to press. -- command: the command you want the keypresses to execute. -- options: an optional Lua table of options to configure (e.g., silent or noremap). local map = vim.api.nvim_set_keymap -- remap the key used to leave insert mode map('i', 'jk', '', {}) -- movement mappings map('', '', 'tabr', {}) map('', '', 'tabl', {}) map('', '', 'tabp', {}) map('', '', 'tabn', {}) -- swap between split windows map('n', '', ':wincmd k', {}) map('n', '', ':wincmd j', {}) map('n', '', ':wincmd h', {}) map('n', '', ':wincmd l', {}) -- rewrite tabs to spaces map('' ,'' ,'%retab!' , {}) -- press 'enter' after searching to clear highlighting until the next search map('n', '', ':noh', {noremap = true}) -- copy/paste between vim instances map('v' ,'y' ,':w! ~/.cache/nvim/vitmp' , {}) map('n' ,'p' ,':r ~/.cache/nvim/vitmp' , {}) -- save as sudo map('c', 'w!!', ':w !sudo tee > /dev/null %', {}) -- quickly edit/reload this configuration file map('n', 'gev', ':e $MYVIMRC', {noremap = true}) map('n', 'gsv', ':so $MYVIMRC', {noremap = true}) -- plugin mappings map('', '', ':NvimTreeToggle', {}) map('n', 'l', ':IndentLinesToggle', {}) map('n', 't', ':TagbarToggle', {}) map('n', 'ff', [[:Telescope find_files]], {}) map('n', 'T', ':lua require("FTerm").toggle()', {})