local keymap = vim.api.nvim_set_keymap local NORMAL = 'n' local INSERT = 'i' local VISUAL = 'v' local COMMAND = 'c' keymap(NORMAL, '', ':bnext', { noremap = true }) keymap(NORMAL, '', ':bprev', { noremap = true }) keymap(INSERT, '', ':bnext', { noremap = true }) keymap(INSERT, '', ':bprev', { noremap = true }) keymap(NORMAL, 'ss', ':source ~/.config/nvim/init.lua', { noremap = true }) keymap(NORMAL, 'sc', ':source %', { noremap = true }) keymap(NORMAL, 'w', ':w', { noremap = true }) keymap(VISUAL, 'y', '"+y', { noremap = true }) keymap(NORMAL, 'q', ':bd', { noremap = true }) keymap(NORMAL, 'qq', ':qall', { noremap = true }) keymap(NORMAL, 'ne', ':e %:h', { noremap = true }) keymap(NORMAL, '', ':w', { noremap = true }) keymap(INSERT, '', ':wa', { noremap = true }) keymap(NORMAL, 'h', 'h', { noremap = true }) keymap(NORMAL, 'j', 'j', { noremap = true }) keymap(NORMAL, 'k', 'k', { noremap = true }) keymap(NORMAL, 'l', 'l', { noremap = true }) keymap(NORMAL, 'oo', 'o', { noremap = true }) keymap(NORMAL, '', ':noh', { noremap = true }) keymap(NORMAL, '', ':Telescope find_files follow=true', { noremap = true }) keymap(NORMAL, 'ts', ':Telescope live_grep', { noremap = true }) keymap(NORMAL, 'tt', ':Telescope file_browser path=%:p:h', { noremap = true }) keymap(NORMAL, 'tb', ':Telescope buffers', { noremap = true }) keymap(NORMAL, 'gc', ':Telescope git_branches', { noremap = true }) keymap(NORMAL, 'gr', ':Telescope lsp_references', { noremap = true }) keymap(NORMAL, 'gds', ':Telescope lsp_document_symbols', { noremap = true }) keymap(NORMAL, 'gs', ':Git', { noremap = true }) keymap(NORMAL, 'gp', ':Git push', { noremap = true }) keymap(NORMAL, 'gg', ':Git pull', { noremap = true }) keymap(NORMAL, 'gb', ':Git blame', { noremap = true }) keymap(NORMAL, 'gl', ':Git log', { noremap = true }) keymap(NORMAL, 'gpr', ':!gpr', { noremap = true }) keymap(NORMAL, 'cn', ':cnext', { noremap = true }) keymap(NORMAL, 'cp', ':cprev', { noremap = true }) -- command mode keymap(COMMAND, '', '', { noremap = true }) keymap(COMMAND, '', '', { noremap = true }) keymap(COMMAND, '', '', { noremap = true }) keymap(COMMAND, '', '', { noremap = true }) keymap(COMMAND, '', '', { noremap = true }) keymap(COMMAND, '', '', { noremap = true }) keymap(COMMAND, '', '', { noremap = true })