Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make mappings simpler and abstract #493

Open
przepompownia opened this issue Nov 15, 2020 · 1 comment
Open

Make mappings simpler and abstract #493

przepompownia opened this issue Nov 15, 2020 · 1 comment

Comments

@przepompownia
Copy link
Contributor

przepompownia commented Nov 15, 2020

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.

@lucc
Copy link
Contributor

lucc commented Nov 16, 2020

Related to #323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants