-- map the key (sequence) to a command local function map(mode, lhs, rhs, opts) local options = { noremap = true } if opts then options = vim.tbl_extend("force", options, opts) end vim.api.nvim_set_keymap(mode, lhs, rhs, options) end -- format map('n', 'f', ':w:Format') -- open terminal map("n", "ott", ":ToggleTerm") map("n", "otf", ":ToggleTerm direction=float") map("n", "otv", ":ToggleTerm direction=vertical") -- exit terminal mode map("t", "", "") -- open tree map("n", "op", ":NvimTreeToggle") -- telescope map("n", "to", ":Telescope") map("n", "tf", ":Telescope find_files") map("n", "tg", ":Telescope live_grep") -- copilot map('i', '', 'copilot#Accept("")', {expr=true, silent=true}) -- neogit / git related map('n', 'gg', ':Neogit') map('n', 'gb', ':Gitsigns blame_line') map('n', 'gs', ':Gitsigns stage_hunk') -- symbols outline map("n", "os", ":SymbolsOutline") -- leap map("n", "", ":lua require('leap').leap {}") map("n", "", ":lua require('leap').leap { backward = true }") -- pollen map("i", "", "◊") map("i", "", "λ") -- colorscheme toggle -- map("n", "", ":let ayucolor=\"dark\":colorscheme ayu") -- map("n", "", ":let ayucolor=\"light\":colorscheme ayu") map("n", "", ":colorscheme catppuccin-mocha") map("n", "", ":colorscheme catppuccin-latte") -- horizontal scrolling map("n", "", "zl") map("n", "", "zh") -- bufferline map("n", "", ":BufferLineCycleNext") map("n", "", ":BufferLineCyclePrev") map("n", "", ":BufferLineMoveNext") map("n", "", ":BufferLineMovePrev") map("n", "bd", ":bd") -- trouble map("n", "od", ":TroubleToggle") -- workspaces map("n", "pp", ":Telescope workspaces theme=dropdown") map("n", "pa", ":WorkspacesAdd ") -- relative line numbers map("n", "", ":set relativenumber!")