local map = require("core.utils").map -- general map("n", "", "write!") map("i", "jk", "") map("n", "h", "nohlsearch") map("n", "/", "(comment_toggle_current_linewise)") --- buffers map("n", "", "bp!") map("n", "", "bn!") map("n", "c", "bdelete!") map("n", "q", "quit!") map("n", "w", "write!") -- select in pupup by C-j & C-k map("i", "", 'pumvisible() ? "\\" : "\\"', true) map("i", "", 'pumvisible() ? "\\" : "\\"', true) map("c", "", 'pumvisible() ? "\\" : "\\"', true) map("c", "", 'pumvisible() ? "\\" : "\\"', true) -- window navigation and resize map("n", "", "wincmd h") map("n", "", "wincmd j") map("n", "", "wincmd k") map("n", "", "wincmd l") map("n", "", "vertical resize -2") map("n", "", "resize +2") map("n", "resize -1") map("n", "", "vertical resize +2") -- move strings map("i", "", ":m .+1==gi") map("i", "", ":m .-2==gi") map("v", "K", ":move '<-2gv-gv") map("v", "J", ":move '>+1gv-gv") map("n", "", ":m .+1==") map("n", "", ":m .-2==") -- plugins map("n", "e", "NvimTreeToggle") map("n", "ps", "PackerSync") -- telescope map("n", "f", "Telescope find_files") map("n", "b", "Telescope buffers") map("n", "sr", "Telescope oldfiles") map("n", "sb", "Telescope git_branches") map("n", "st", "Telescope live_grep") map("n", "sp", "Telescope projects") -- git map("n", "gg", "Neogit") map("n", "gs", "lua require[[gitsigns]].stage_hunk()") map("n", "gr", "lua require[[gitsigns]].reset_hunk()") map("n", "gp", "lua require[[gitsigns]].preview_hunk()") -- lsp map("n", "la", "lua vim.lsp.buf.code_action()") map("n", "lr", "lua vim.lsp.buf.rename()") map("n", "lf", "lua vim.lsp.buf.format {async = true}") map("n", "ls", "Telescope lsp_document_symbols") map("n", "lj", "lua vim.diagnostic.goto_next()") map("n", "lk", "lua vim.diagnostic.goto_prev()")