views:

137

answers:

3

Hi all,

About half year ago I decided to improve my programming efficiency, so I learned touch-typing and moved to Vim. All is fine and I feel myself much better than before. However there is a question that annoys me all that time: how should I touch-type IDENTIFIERS_WRITTEN_IN_CAPS?

  • If I will use shifts by all rules, I would have to switch hands very often. Trying to type GOOGLE in this case is a challenge.
  • If I will use just left shift holding it all the time, I would lose the physical memory of the left hand and wouldn't be able to find keys blindly.
  • If I use caps lock, I have to remember to release it. Forgetting this in Vim will lead to apocalypses in command mode. Furthermore, many remap caps lock to something else like Esc or keyboard layout switching.

How do you touch-typists deal with SQL, Makefiles, Win API, DirectX and all that stuff that requires printing in caps?

+6  A: 

I just keep left shift pressed with my pinky finger and type normally, it doesn't seem to affect my left hand's ability to find keys. I very rarely use caps lock.

However, most of the identifiers are completed by Vim's insert mode completion, so actual typing is not that much: usually IDENTIFIERS_WRITTEN_IN_CAPS is just ID+<keyword_completion_key>

kemp
Probably worth noting that tab is not the default completion key for future searchers.
Randy Morris
Good point Randy, updated.
kemp
+5  A: 

In Vim you may try something like this:

In command mode type

:imap <Leader>u <ESC>bgUwwi

Now, in insert mode you can type it lowercase, then (also in insert mode) press <Leader>u (Leader is \ by default) and it gets uppercase, e.g.:

identifiers_written_in_caps\u

gets transformed into

IDENTIFIERS_WRITTEN_IN_CAPS
d.m
Also, as kemp already said, you can use keyword completion, and with `:set ignorecase` you may even type the first letters lowercase.
d.m
In this case I'm left without autocompletion however
nailxx
Well, if you use autocompletion you shouldn't bother typing long identifiers in caps since you actually type just a few letters if them. :)
d.m
A: 

I personally just type the first letters and then press <Ctrl>-P and start using autocompletion :)

(Sadly, I've never become very proficient at touch-typing because I always use autocompletion, both in vim and in bash).

ninjalj