As some of you may recall from earlier posts of mine I have
cerebral palsy, and Vim's character-sequence commands are a great
help to me to overcome my motor disability. However there are as
we all know commands which use ctrl and shift key combinations.
Hitherto I've been reasonably able to use such commands and to
type (initial) caps in insert mode without using capslock. Since
a month, however, I have a muscle inflammation in my right
shoulder which to a large extent has deprived me of the use of my
right hand, since working with it for any extended time (more
than one hour or so) causes considerable pain which endures for
hours, and I have been told that this will take four to six
months to heal! So now I'm looking for some clever mappings to
relieve me of having to use the shift and ctrl keys, and
hopefully also the alt key entirely. I'm thinking of adding
something like the following to my .vimrc:
for num in range(char2nr("a"),char2nr("z"))
let char = nr2char(num)
exe printf("map <F3>%s <S-%s>", char, char)
exe printf("map <F3><F3>%s <C-%s>", char, char)
exe printf("map <F3><F3><F3>%s <S-C-%s>", char, char)
for key in ["i", "c"]
exe printf(":%smap <F4>%s %s", key, char, toupper(char))
endfor
endfor
My first question: is there some way to 'intercept' existing
mappings like `<S-{some-char}>{some-key}...` so that I can use
some combination of single-key presses instead of
`<S-{some- char}>` without remapping every `<S-{some-char}>{some-key}...`
mapping individually?
My second question: the same for shift+key outside the A-Z range,
or alt+key combinations, since on my Swedish kblayout e.g. `>` is
a shifted keystroke, and all of `{ } [ ]` are alted keystrokes.
Can I do that in some elegant way which will work even if I
change kblayout, or will I have to e.g. make a dictionary with
all non-a-z `'{unshifted-char}': '{shifted-char},'` mappings on
my specific layout, and similarly for alt+key mappings and
skift+alt+key mappings and loop through them?
BTW I've found that I can't get the sticky-keys feature of GNOME
to work, inside or outside Vim. :-(
/bpj
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thursday, November 27, 2014
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment