Skip to main content

Remap “:” to “,” to enter vim commands more quickly

  • Entering command mode frequently, makes Shift-; a lot of work
  • Remembering ;/, pair for forward/backward through f/t searches is less intuitive than n/N pair for forward backward through / searches
  • Swap , and : in normal and visual mode solves both problems
    • Command mode quick to enter with single , press
    • ;/: pair matches n/N pair when navigating through f and t results
  1. In init.lua:
vim.keymap.set({ 'n', 'v' }, ',', ':') -- enter command mode with ,
vim.keymap.set({ 'n', 'v' }, ':', ',') -- walk backward through f and t results using : (similar to n/N for / results)
-- also remap g; and g, ?