Skip to content

Make mappings simpler and abstract #493

Open

Description

@przepompownia

There is still no abstracion that prevents from direct binding physical keys to actions. Vdebug still forces the user to overwrite existing physical mappings by default (from g:vdebug_keymap_defaults). For example, I lose nmap <F12> this way after running vdebug although the piece of (Python) code to keep old mapping seems to exist.

I would like to hide mapping of low-level operations behind an abstraction. For example

nmap <Plug>(vdebug-run) :python3 debugger.run()<CR>

does not overwrite any existing user mapping. The user would then have to create some custom mapping like

nnoremap <F5> <Plug>(vdebug-run)

We could also provide the old-style mapping to keep backward compatibility (and provide such physical mappings that can be disabled with one setting).

In this case, we can check the code used to store / restore mappings as long as we need it.

The cheapest, non-perfect way could be to add

let g:vdebug_keymap_defaults = {
\    'run' : '<Plug>(vdebug-run)',
" ...

and keep the old hardcoded mapping to allow the user to select the old set.

Now, without changing any line of Vdebug code, we can also replace all default physical keymaps by abstract at the user side:

let g:vdebug_keymap['run'] = '<Plug>(vdebug-run)'

but it should be provided by Vdebug.

Activity

  1. lucc commented on Nov 16, 2020

    @lucc
    Contributor

    Related to #323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions