return function() local map = vim.api.nvim_set_keymap local opts = { noremap = true, silent = true } vim.g.mapleader = ' ' map('n', '', '"zdd"zp', opts) -- Move line down map('n', '', '"zdd"zkP', opts) -- Move line up map('i', '', '', opts) -- return to normalcy map('n', '', ':q', opts) -- c-d to close file map('i', '', 'coc#pum#visible() ? coc#pum#next(1) : "\\"', {noremap = true, silent = true, expr = true}) -- next item in coc list map('i', '', 'coc#pum#visible() ? coc#pum#prev(1) : "\\"', {noremap = true, silent = true, expr = true}) -- prev item in coc list map('n', '', '(coc-rename)', opts) -- rename map('n', '', 'TagbarToggle', opts) -- show ctags vim.keymap.set('n', 'zR', require('ufo').openAllFolds) -- ufo vim.keymap.set('n', 'zM', require('ufo').closeAllFolds) -- ufo vim.keymap.set('t', '', '') -- close term vim.keymap.set('n', '', function() vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * 0.9 end) vim.keymap.set('n', '', function() vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * 1.1 end) vim.g.tagbar_map_showproto = '' -- remove tagbar space bar conflict -- whichkey local wk = require('whichkey_setup') wk.config{ hide_statusline = true, default_keymap_settings = { silent=true, noremap=true, }, default_mode='n' } wk.register_keymap('leader', { s = { name = '+jump', d = {'(coc-definition)', 'definition'}, r = {'(coc-references)', 'references'}, t = {'(coc-type-definition)', 'type definition'}, s = {'BLines', 'fzf current buffer'}, S = {'Lines', 'fzf all buffers'}, }, nt = {'NERDTreeToggle', 'nerdtree'}, -- originally nt rc = {'tabedit $MYVIMRCNERDTree ~/.config/nvim/', 'nvim config'}, -- originally rc c = { name = '+appearance', d = {'set background=dark', 'dark'}, l = {'set background=light', 'light'}, }, e = {'CocDiagnostics', 'errors'}, h = {'call CocActionAsync("doHover")', 'hover'}, q = { name = "+modify", q = {'(coc-fix-current)', 'quick fix'}, c = {'(coc-codeaction-selected)', 'code actions'}, }, l = { name = '+latex', c = {'VimtexCompile', 'toggle compile'}, }, b = { name = '+buffer', m = {'h', 'left'}, n = {'j', 'down'}, e = {'k', 'up'}, i = {'l', 'right'}, M = {'H', 'move left'}, N = {'J', 'move down'}, E = {'K', 'move up'}, I = {'L', 'move right'}, t = {'Telescope buffers', 'goto fuzzy'}, }, }) end