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

[Suggestion] Automatic digit-argument for programer-dvorak, vim style #42

Open
akater opened this issue Mar 2, 2018 · 1 comment
Open

Comments

@akater
Copy link
Contributor

akater commented Mar 2, 2018

You have not yet mapped digits for programer-dvorak layout. In programer-dvorak, digit keys are shifted, and it looks like you avoid mapping shifted keys overall. This could be used to an advantage:

(define-key xah-fly-key-map [?0] 'digit-argument)
[…]
(define-key xah-fly-key-map [?9] 'digit-argument)

would turn digits into prefix argument triggers, much like in Vim, if I understand Vim setup correctly. However, negative arguments won't be supported this way. There is a way to handle negative arguments (see below) but it's a little hackish, so I'm not sure it won't break things established in your package, or in Emacs, or even if it could be considered an outright bad Emacs style. But you could add this straightforward positive digit argument support for programer-dvorak right away. I think it would be a good decision.

Now, to the hack:

(define-key xah-fly-key-map [?0] 'universal-argument)
(define-key xah-fly-key-map [?1] 'digit-argument)
[…]
(define-key xah-fly-key-map [?9] 'digit-argument)

I don't see what could go wrong here, and have enabled this for myself. This way, negative arguments are supported, and plain universal-argument flag is supported as well. So it looks very nice at first glance. But I rarely (never?) use universal arguments anyway, and thus I don't think any test reports on this would come from me in near future.

@akater
Copy link
Contributor Author

akater commented Mar 2, 2018

If it turns out the hack is OK, and thus one can safely remap C-u, which resides at quite sweet a spot in dvorak and dvp (and even in qwerty), I'd say this leads to a really significant advantage for dvp users.

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

1 participant