views:

4562

answers:

15

I have a bad habit of using the cursor keys of my keyboard to navigate source code. It's something I've done for 15 years and .

This of course means that my navigating speed is limited by the speed of the keyboard. On both Vista and OS X (I dual boot a MacBook), I hate my key repeat rate turned all the way up. But in Visual Studio, and other apps, the rate is still much slower than I would prefer.

How can I make the key repeat rate faster in Visual Studio and other text editors?

+3  A: 

I don't know how to accelerate beyond the limit, but I know how to skip further in a single press. My knowledge is only in Windows, as I have no Mac to do this in. Ctrl + Arrow skips a word, and depending on the editor it may just skip to the next section of whitespace. You can also use Ctrl + Shift + Arrow to select a word in any direction.

The Wicked Flea
Yep, I use these too. Just hoping to go even faster. Thanks.
Frank Krueger
+1  A: 

On Mac, it's option-arrow to skip a word and option+shit+arrow to select. Command+arrow skips to the end or beginning of a line or the end or beginning of a document. There are also the page up, page down, home and end keys ;) Holding shift selects with those too.

SoloBold
Yep. I'm just hoping to go even faster sometimes. :-)
Frank Krueger
+3  A: 

I do like to work on the keyboard alone. Why? Because when you use the mouse you have to grab it. A time loss.

On the other hand sometimes it seems that every application has it's own keyboard type-rates built in. Not to speak from BIOS-properties or OS-settings. So I gathered shortkeys which can be pretty fast (i.e. you are faster typing ctrl-right(arrow)-right-right than keeping your finger on the right(arrow) key :).

Here are some keyboard shortcuts I find most valuable (works on Windows, I am not sure about OSX):

ctrl-right: Go to the end of the previous/the next word (stated before)
ctrl-left:  Go to the beginning of the previous/the word before (stated before)
ctrl-up:    Go to the beginning of this paragraph 
            (or to the next paragraph over this)
ctrl-down:  Go to the end of this paragraph 
            (or to the next paragraph after this)
ctrl-pos1:  Go to the beginning of the file
ctrl-end:   Go to the end of the file

All these may be combined with the shift-key, so that the text is selected while doing so. Now let's go for more weird stuff:

alt-esc:     Get the actual application into the background
ctrl-esc:    This is like pressing the "start-button" in Windows: You can
             navigate with arrow keys or shortcuts to start programs from here
ctrl-l:      While using Firefos this accesses the URL-entry-field to simply
             type URLs (does not work on stackoverflow :)
ctrl-tab,
ctrl-pageup  
ctrl-pagedwn Navigate through tabs (even in your development environment)

So these are the most used shortcuts I need while programming.

Georgi
+1  A: 

Don't navigate character-by-character.

In Vim (see ViEmu for Visual Studio):

  • bw -- prev/next word
  • () -- prev/next sentence (full stop-delimited text)
  • {} -- prev/next paragraph (blank-line delimited sections of text)
  • /? -- move the cursor to the prev/next occurence the text found (w/ set incsearch)

Moreover, each of the movements takes a number as prefix that lets you specify how many times to repeat the command, e.g.:

  • 20j -- jump 20 lines down
  • 3} -- three paragraphs down
  • 4w -- move 4 words forward
  • 40G -- move to (absolute) line number 40

There are most likely equivalent ways to navigate through text in your editor. If not, you should consider switching to a better one.

Mikael Jansson
+1  A: 

Don't take this the wrong way, but wouldn't it be more effective to learn how to navigate in a more targeted way? Such as incremental search (CTRL+I) in Visual Studio. What about class view or the Members drop-down in VS? There are shortcut sheets available here.

Mitch Wheat
+5  A: 

For Windows, open regedit.exe and navigate to HKEY_CURRENT_USER\Control Panel\Keyboard. Change KeyboardSpeed to your liking.

Jake
Does this even work? MSDN states that the maximum value is 31, and you can already set it to that normally in Control Panel.
CyberShadow
A: 

Well, it might be obvious, but:

  • For horizontal navigation, Home (line start), End (line end), Ctrl-Left (word left), Ctrl-Right (word right) work in all editors I know

  • For vertical navigation, Page Up, Page Down, Ctrl-Home (text start), Ctrl-End (text end) do too

Also (on a side note), I would like to force my Backspace and Delete keys to non-repeat, so that the only way to delete (or replace) text would be to first mark it, then delete it (or type the replacement text).

ΤΖΩΤΖΙΟΥ
+5  A: 

On Mac OS X, open the Global Preferences plist

open ~/Library/Preferences/.GlobalPreferences.plist

Then change the KeyRepeat field. Smaller numbers will speed up your cursor rate. The settings dialog will only set it to a minimum of 2, so if you go to 0 or 1, you'll get a faster cursor.

I had to reboot for this to take effect.

hyperlogic
For those of you without BBEdit or TextWrangler (which supposedly can edit binary plist files natively -- I haven't tried it since I don't have those editors), if the global plist file appears to be gibberish, first convert it to xml and then edit it, then convert it back like I had to do. See http://discussions.apple.com/thread.jspa?messageID=8359699
Eddified
+3  A: 

For what it's worth, Visual Assist has an option to double your effective key movements in Visual Studio which I use all the time.

Yeah works a treat.
Max Howell
+2  A: 

I'm using KeyboardKing on my PC. It's freeware and it can increase the repeat rate up to 200 which is quite enough. I recommend to set the process priority to High for even smoother moves and less "repeat locks" which happen sometime and are very annoying. With high priority, it works perfectly.

No one understands why we navigate by arrows. It's funny.

+2  A: 

As mentioned above, on Mac OSX internally there are two parameters dealing with the keyboard repeat rate: "KeyRepeat" and "InitialKeyRepeat". Normally they are controlled from the System Preferences, where they are referred to as "Key Repeat Rate" and "Delay Until Repeat".

Ranges available from System Preferences are as following

InitialKeyRepeat 
|--------------|-----------------|
off (30000)    long (120)        short (25)  

KeyRepeat 
|-------------------------------|
slow (120)                      fast (2)  
0.5 char/s                      33 char/s

The numerical values seem to be a 15 ms multipliers. Fortunately, they can be set beyond the predefined limits in the "GlobalPreferences.plist". I found the following values most convenient for myself:

InitialKeyRepeat = 15 --> 225 ms
KeyRepeat = 1         -->  15 ms or 66 chars/s
exinocactus
A: 

Hello, just cameacross thissite by coincidence,I have a problem with my space bar, andIdon't know whats causingit, it keepsmissing keys when Itype fast, and sometimes creates2 spaces when Ionlyneed one. And this isn't a joke post btw,so if you have an actualway of fixingit, you cancontact me on [email protected]

I've tried fixing thedelay ratesbut it doesn't seem towork, and cleaning hasalready been tried, I've also formatted, and checked forviruses, but still nofix.

jonnyb
Jonny, please go to superuser.com and post just what you told me. We don't use email, but post your question and check back on it once and a while.
Frank Krueger
+2  A: 

For OSX, the kernel extension KeyRemap4MacBook will allow you to fine tune all sorts of keyboard parameters, among which the key repeat rate (I set mine to 15 ms, works nice).

David
I used this method and set my keyrepeat to 20ms and it's much better now.
Eddified
+1  A: 

Many times I want to center a function in my window. Scrolling is the only way. Also, Ctrl-left/right can still be slow in code where there are a lot of non-word characters. I use keyboardking also. It has a couple of isssues for me though. One, it sometimes uses the default speed instead of the actual value I set. The other is sometimes it ignores the initial delay. I still find it very useful though. They said 4 years ago they would release the source in 6 months... :(

Ok, on the suggestion of someone that modified HCU\...\Keyboard Response, this works well for me.

[HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response]
"AutoRepeatDelay"="250"
"AutoRepeatRate"="13"
"BounceTime"="0"
"DelayBeforeAcceptance"="6"
"Flags"="59"

Windows standard AutoRepeat delay. 13 ms (77 char/sec) repeat rate. flags turns on FilterKeys?

chuckf
A: 

Thanks guys, keyboard response settings did the trick!

David