vim-maktaba icon indicating copy to clipboard operation
vim-maktaba copied to clipboard

Implement keymapping helpers

Open dbarnett opened this issue 5 years ago • 1 comments

Implements maktaba helpers for programmatically managing vim key mappings (as in the :map command) in maktaba#keymapping# and maktaba#keymappingspec#.

Usage examples:

call maktaba#keymapping#Map(',=b', ':FormatCode<CR>', 'n')
call maktaba#keymappingspec#Spec(',=b', ':FormatCode<CR>', 'n')
    \.WithArgs(['<silent>', <buffer>']).Map()

See keymapping.vroom and :help maktaba.KeyMapping for details.

Resolves #221.

dbarnett avatar Mar 23 '20 19:03 dbarnett

I'd held off on merging this PR for a while because

  1. The "full" implementation was surprisingly complex (vs. the simpler hack I originally found https://github.com/dbarnett/dotfiles/blob/8c9dc859db/.vimrc#L310) and I was hoping to find ways to reduce the scope a bit, and
  2. I'd seen a few quirks in the meantime while trying it out that I was hoping to troubleshoot further.

I'm still looking into those, but went ahead and submitted some fixes and resolved review comments while I'm looking at it.

dbarnett avatar Nov 08 '20 05:11 dbarnett