-- source file everytime it changes vim.cmd([[ augroup user_keymaps autocmd! autocmd BufWritePost keymaps.lua source augroup end ]]) local function nnoremap(key, command) vim.api.nvim_set_keymap("n",key,command, { noremap = true }) end vim.g.mapleader = " " vim.g.maplocalleader = " " -- Move around windows nnoremap("", "h") nnoremap("", "j") nnoremap("", "k") nnoremap("", "l") -- Switch buffers nnoremap("", ":TablineBufferNext") nnoremap("", ":TablineBufferPrevious") -- fugitive nnoremap("G", ":tab G") -- telescope nnoremap("ff", "Telescope find_files theme=dropdown") nnoremap("fb", "Telescope buffers theme=dropdown") nnoremap("fg", "Telescope git_files theme=dropdown") -- terminal function _G.set_terminal_keymaps() local opts = {noremap = true} vim.api.nvim_buf_set_keymap(0, 't', '', [[]], opts) vim.api.nvim_buf_set_keymap(0, 't', '', [[h]], opts) vim.api.nvim_buf_set_keymap(0, 't', '', [[j]], opts) vim.api.nvim_buf_set_keymap(0, 't', '', [[k]], opts) vim.api.nvim_buf_set_keymap(0, 't', '', [[l]], opts) end vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')