Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
532 views
in Technique[技术] by (71.8m points)

vim - Software Requirements for Code Creation / Editor with RSI Type Symptoms (unusable fingers)

I do know and have read the appropriate topics section for this site. I have seen various topics about RSI, posture etc closed as being off topic and referred to another site/section. I think however that my question will be worded such that it comes under the "Software Requirements" section as I am looking for input on specific types as well as configuration of software for some very specific medical issues I have.

This is not a topic about prevention of RSI, it is just the closest I can put in a title that people will understand off the bat. I may have already answered my question just by asking it, but in case there is something I have not thought of, the medical and other problems are:

  1. I have a surgically repaired right (dominant hand) index finger following the removal of a benign tumor growth. This growth had clamped the tendon for some 18+ months before it was discovered and excised in 2012. I can use the finger "flat handed" such as for typing English (this email for example) but actions which have me move towards a grip are painful, writing with a pen or using a mouse or touch pad for example. I can use the mouse but not for anywhere near a days work.

  2. I have numbness and pain of an as yet unknown cause in both forearms and little fingers. Repeated fanning of my hands or use of the little fingers makes these very painful which presents obvious problems in using modifier keys when writing code. Even using the ring fingers instead pushes out too much.

  3. Whilst not able to work at the moment my most likely avenue of return is still to my previous job. There is a very limited amount of work I do from home as the primary client insists that you work from their premises and more importantly use their equipment. I do not think I could use any custom equipment (beyond accessories, such as a trackball) even if I offered to pay for it myself, we as a team are greatly removed from Corporate IT Admin. So at best I can be expecting an i3/i5 laptop with 8GB of RAM. I probably could swag/provide an external monitor in addition to the laptop display. We do have admin access to the OS but I cannot be putting native Linux on it or anything, and even if I could I need the corporate communication and meeting tools from Windows.

  4. (edited in). Herniated lumbar disc causing nerve pain in both legs. Again I am working on this from a physical standpoint but for the purpose of this question will assume my current condition is permanent, which precludes pedals or other use of my legs for the purpose of character entry.

So I cannot use a mouse or touch pad (not sure about ball). Cannot use modifier keys and need to work on a Win 7 corporate laptop of the same kind that a business/sales manager might get, albeit with admin access. Primary type of work is LAMP stack although there are also other technologies such as Java, C++ and Python.

I had seen the voice coding by Tavis Rudd (here: http://www.youtube.com/watch?v=8SkdfdXWYaI) which would be an option from home but not the open plan client office. The idea did get me thinking however that my solution may lie in the use of something like emacs with remapped bindings. I probably could get a laptop powerful enough to run a minimalist X11 desktop (say maybe Fluxbox) under Oracle VM or something. Or I could install and use Cygwin.

I never did use full blown IDEs, but never used emacs beyond trivial tasks either. My go to for work would be scite and some xterm shells. It may have improved but I found IDEs a bit sluggish on the laptops we got. I know the IDEs as well as scite will be extensible, the latter under lua, but I suspect emacs will offer more in terms of existing extensions for multiple languages as well as task such as repository work or other access to servers etc (most of which would be *nix).

I am still working on physical investigation and rehab but for the moment am assuming these limitations are here to stay. What would be most helpful here is some indication from those more familiar with emacs or IDEs such as Eclipse or NetBeans, that the software is fit for my purpose, before I go and start learning to use it, which I would have to do (unpaid) before returning to work, needing to hit the ground at least 80% of where I was before.

Such that I can try and avoid any brick walls down the line which I did not foresee. My gut reaction as the first thing to be doing is "learn emacs" as it would be a useful skill in my area regardless, although if there is something else more suited to the primary goal I would do that.

Many thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Default Emacs bindings make heavy use of modifier keys; however there are alternatives to the defaults, without necessarily requiring you to manually customise all the bindings.

Vi/Vim may be a good choice of alternative editor, as rather than using modifier keys to initiate commands, you switch between "insert mode" (in which the keys you type produce text), and "command mode" (in which the keys you type trigger editing commands), so you would rarely (if ever?) need to hold multiple keys at the same time.

Emacs may still be desirable, though. An advantage of Emacs is the degree to which it can integrate with many other processes and applications, thus giving you a familiar keyboard interface to many activities besides editing text. I would say this is far more the case under Unix than Windows, but I'm sure there are still benefits.

There are also ways to use the Vi approach within Emacs, which may be an even better answer. I understand that the evil-mode package ("extensible vi layer for Emacs") is the most comprehensive approach to using vi-style bindings in Emacs.

I'm not a vi user myself, so I'll leave it to others to provide details.

Keeping with the modal editing approach, God Mode gives you Vi-like modal separation, but using the familiar Emacs key sequences (follow the link to make better sense of that statement). The author says "You'll find that this mode comes surprisingly naturally and that you already know how to run your existing Emacs commands."

Leaving modal editing aside, packages such as ErgoEmacs endeavour to provide friendlier keybindings than the defaults, and may be useful.

A custom approach I read about (used by Xah Lee) was to dedicate certain keys as prefix bindings through which everything else could be accessed without modifiers. This is simple for some kinds of binding, and requires effort in other cases (probably in most cases, realistically).

For example, a great many bindings start with the prefix C-x (ctrl+x), but it's possible to assign that entire prefix to a sequence which doesn't require a modifier. e.g.: (global-set-key (kbd "<f6> x") 'Control-X-prefix) would allow you to type F6 followed by x instead of holding down Ctrl while typing x.

Other similar reassignments will not be so trivial, but it's all possible.

More generally (and so perhaps more usefully; certainly with less customisation) you can send any modified key using custom (and thus potentially modifier-free) sequences.

The event-apply-*-modifier functions (for shift, control, meta (your Alt key), super, hyper, & alt (not your Alt key)) are the trick to doing this. When called, they read the next key from the user, and then apply the required modifier to that key, passing the result through as if it had been typed using the real modifier key.

The following would use the number keys on the keypad to represent all the modifier keys. You could then type the sequence C-xC-b as 1x1b.

(define-key function-key-map (kbd "<kp-1>") 'event-apply-control-modifier)
(define-key function-key-map (kbd "<kp-2>") 'event-apply-meta-modifier)
(define-key function-key-map (kbd "<kp-3>") 'event-apply-super-modifier)
(define-key function-key-map (kbd "<kp-4>") 'event-apply-shift-modifier)
(define-key function-key-map (kbd "<kp-5>") 'event-apply-hyper-modifier)
(define-key function-key-map (kbd "<kp-6>") 'event-apply-alt-modifier)

You'd need to do some extra work to enable you to combine multiple modifiers for a single key, but it's possible.

The elisp manual page on Modifying and Translating Input Events is also relevant:
C-hig (elisp) Event Mod RET

A completely different approach would be to use foot pedals (or some other input device; e.g.: http://xkeys.com/xkeys.php) to enable you to use the modifier keys as intended, without the need to rebind anything at all.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...