-- ┌────────────────────────┐ -- │ ▗ │ -- │▛▚▀▖▝▀▖▛▀▖▛▀▖▄ ▛▀▖▞▀▌▞▀▘│ -- │▌▐ ▌▞▀▌▙▄▘▙▄▘▐ ▌ ▌▚▄▌▝▀▖│ -- │▘▝ ▘▝▀▘▌ ▌ ▀▘▘ ▘▗▄▘▀▀ │ -- └────────────────────────┘ -- brute force deasciify everything vim.keymap.set("n", "tc", "TurkishDeasciifyForce()", { expr = true }) vim.keymap.set("n", "tctc", "TurkishDeasciifyForce() .. '_'", { expr = true }) vim.keymap.set("x", "tc", "TurkishDeasciifyForce()", { expr = true }) -- use turkish-mode to selectively deasciify vim.keymap.set("n", "tr", "TurkishDeasciify()", {expr = true}) vim.keymap.set("n", "trtr", "TurkishDeasciify() .. '_'", {expr = true}) vim.keymap.set("x", "tr", "TurkishDeasciify()", {expr = true}) -- ascii everything vim.keymap.set("n", "rt", "TurkishAsciify()", {expr = true}) vim.keymap.set("n", "rtrt", "TurkishAsciify() .. '_'", {expr = true}) vim.keymap.set("x", "rt", "TurkishAsciify()", {expr = true}) -- https://stackoverflow.com/questions/4256697/vim-search-and-highlight-but-do-not-jump -- search & highlight but do not jump vim.keymap.set("n", "*", ":keepjumps normal! mi*`i") vim.keymap.set("n", "#", ":keepjumps normal! mi#`i") -- save file as sudo on files that require root permission vim.keymap.set("c", "w!!", 'execute "silent! write !sudo tee % >/dev/null" edit!', { silent = false }) -- replace ex mode with gq (format lines) vim.keymap.set('n', 'Q', 'gq') -- set formatprg to sentences, for prose vim.keymap.set('n', 'fp', ":set formatprg=~/.local/bin/sentences", { silent = false }) -- replace all is aliased to S. vim.keymap.set('n', 'S', ':%s//g', { silent = false }) vim.keymap.set('v', 'S', ':s//g', { silent = false }) -- jump to buffer vim.keymap.set('n', 'b', ':ls:b') -- up and down are more logical with g.. vim.keymap.set('n', 'k', '(v:count == 0 ? "gk" : "k")', { expr = true }) vim.keymap.set('n', 'j', '(v:count == 0 ? "gj" : "j")', { expr = true }) vim.keymap.set('i', '', 'gka') vim.keymap.set('i', '', 'gja') -- space used to toggle folds, now it's x (because x is d) vim.keymap.set('n', '', '"_x') -- separate cut and delete vim.keymap.set('n', 'x', 'd') vim.keymap.set('x', 'x', 'd') vim.keymap.set('n', 'xx', 'dd') vim.keymap.set('n', 'X', 'D') -- change into pwd of current directory vim.keymap.set('n', 'cd', ':lcd %:p:h:pwd') -- call CreatePaper on word below cursor vim.keymap.set('n', 'np', 'gewi[[/papers/Ea]]bb:call CreatePaper(expand(""))') -- link paper vim.keymap.set('n', 'lp', 'gewi[[/papers/Ea]]') -- call CreateReference on word below cursor vim.keymap.set('n', 'nr', ':call CreateReference(expand(""))') -- create a new note vim.keymap.set('n', 'nn', ':call CreateNote()') -- :%% to get current file path vim.keymap.set('c', '%%', "getcmdtype() == ':' ? expand('%:h').'/' : '%%'", { expr = true, silent = false }) -- reselect visual selection after indent vim.keymap.set('v', '>', '>gv') vim.keymap.set('v', '<', '(YoinkPaste_p)') vim.keymap.set('n', 'P', '(YoinkPaste_P)') -- substitute from yank vim.keymap.set('n', 'ys', '(SubversiveSubstitute)') vim.keymap.set('n', 'yss', '(SubversiveSubstituteLine)') vim.keymap.set('n', 'yS', '(SubversiveSubstituteToEndOfLine)') -- substitute over range vim.keymap.set('n', 's', '(SubversiveSubstituteRange)') vim.keymap.set('x', 's', '(SubversiveSubstituteRange)') vim.keymap.set('n', 'ss', '(SubversiveSubstituteWordRange)') -- subvert over range vim.keymap.set('n', 's', '(SubversiveSubvertRange)') vim.keymap.set('x', 's', '(SubversiveSubvertRange)') vim.keymap.set('n', 'ss', '(SubversiveSubvertWordRange)') -- iterate over yank list vim.keymap.set('n', '', '(YoinkPostPasteSwapBack)') vim.keymap.set('n', '', '(YoinkPostPasteSwapForward)') -- checkmarks on vimwiki vim.keymap.set('n', 'v', 'VimwikiToggleListItem') -- add/increase header level vim.keymap.set('n', 'a', 'VimwikiAddHeaderLevel') -- vim-test bindings vim.keymap.set('n', 't', ':TestNearest') vim.keymap.set('n', 't', ':TestFile') vim.keymap.set('n', 't', ':TestSuite') vim.keymap.set('n', 't', ':TestLast') vim.keymap.set('n', 't', ':TestVisit') -- telescope bindings vim.keymap.set('n', 'ff', "lua require('telescope.builtin').find_files()") vim.keymap.set('n', 'fg', "lua require('telescope.builtin').live_grep()") vim.keymap.set('n', 'fb', "lua require('telescope.builtin').buffers()") vim.keymap.set('n', 'fh', "lua require('telescope.builtin').help_tags()") -- vista vim.keymap.set('n', '', ":Vista focus") vim.keymap.set('n', '', ":Vista finder") -- nvim tree mappings vim.keymap.set('n', 'vt', ':NvimTreeToggle') vim.keymap.set('n', 'vr', ':NvimTreeRefresh') vim.keymap.set('n', 'vs', ':NvimTreeFindFile') -- dial.nvim mappings local opts = { noremap=true, silent=true } vim.keymap.set("n", "", require("dial.map").inc_normal(), opts) vim.keymap.set("n", "", require("dial.map").dec_normal(), opts) vim.keymap.set("v", "", require("dial.map").inc_visual(), opts) vim.keymap.set("v", "", require("dial.map").dec_visual(), opts) vim.keymap.set("v", "g", require("dial.map").inc_gvisual(), opts) vim.keymap.set("v", "g", require("dial.map").dec_gvisual(), opts) -- leap.nvim mappings vim.keymap.set('n', '`', '(leap-forward)', opts) vim.keymap.set('n', '`', '(leap-backward)', opts) vim.keymap.set('v', '`', '(leap-forward)', opts) vim.keymap.set('v', '`', '(leap-backward)', opts) -- barbar.nvim mappings local opts = { noremap = true, silent = true } -- move to previous/next vim.keymap.set('n', '', 'BufferPrevious', opts) vim.keymap.set('n', '', 'BufferNext', opts) -- re-order to previous/next vim.keymap.set('n', '', 'BufferMovePrevious', opts) vim.keymap.set('n', '', 'BufferMoveNext', opts) -- goto buffer in position... vim.keymap.set('n', '', 'BufferGoto 1', opts) vim.keymap.set('n', '', 'BufferGoto 2', opts) vim.keymap.set('n', '', 'BufferGoto 3', opts) vim.keymap.set('n', '', 'BufferGoto 4', opts) vim.keymap.set('n', '', 'BufferGoto 5', opts) vim.keymap.set('n', '', 'BufferGoto 6', opts) vim.keymap.set('n', '', 'BufferGoto 7', opts) vim.keymap.set('n', '', 'BufferGoto 8', opts) vim.keymap.set('n', '', 'BufferGoto 9', opts) vim.keymap.set('n', '', 'BufferLast', opts) -- pin/unpin buffer vim.keymap.set('n', '', 'BufferPin', opts) -- close buffer vim.keymap.set('n', '', 'BufferClose', opts) -- magic buffer-picking mode vim.keymap.set('n', 'dg', 'BufferPick', opts) -- sort automatically by... vim.keymap.set('n', 'db', 'BufferOrderByBufferNumber', opts) vim.keymap.set('n', 'dd', 'BufferOrderByDirectory', opts) vim.keymap.set('n', 'dl', 'BufferOrderByLanguage', opts) vim.keymap.set('n', 'dw', 'BufferOrderByWindowNumber', opts) -- }}} plug mappings --