Doing something with the numeric keypad - keyboard

I, like most people, don't use the numeric keypad on my keyboard much and they seem to me to be a complete waste of otherwise perfectly good eighteen keys.
I was wondering if there was something cool that could be done with them - I've heard of some people controlling their mouse pointer using the 2, 4, 6 and 8 keys, but that does seem very practical to me.
Any ideas?

Low tech solution:
Remove the keys (easy with a pencil) so the key won't exceed the border, then you could glue a piece of wood over it and get a cup holder.

I use my keypad keys for adding, subtracting, multiplication, division, numerical data entry, etc. Now I'm going to use my CTRL, SHIFT, and W keys together to try and figure out what this has to do with programming...

Why not create a custom keyboard layout?
Real languages often have special characters you could put there.
Alternately if you use APL you could put their 'unique' characters in there.

Try using AutoHotKey http://www.autohotkey.com/, and setting up some hotkeys for common tasks that you perform, for example:
Opening my computer
Opening your data folders
Opening web browser
Copying as plain text
Sleeping the computer
Etc.

Related

Why are h,j,k,l recommended over using arrow keys for vim?

I am a vim user (not a beginner not advanced). I use the arrow keys.
I have repeatedly read that it is highly recommended to use the h,j,k,l keys for increased productivity.
I have tried to use them but I can not see how they help in being more productive.
Because if I am to use the h,j,k,l keys to move up/down/right/left I need to press the ESC first to exit the insert mode.
But that defeats the purpose doesn't it? Since the original idea is that you don't need to move your fingers away.
If I am to press ESC I might as well be using the arrow keys and save a keystroke.
Perhaps I am doing something wrong here?
Old terminal keyboards like the ADM-3A terminal didn't have arrow keys.
The keyboard layout looked like this and it already had the arrows for hjkl. (By the way, also note the relation between ~ and Home key)
I think it is mainly for historical reasons that vim still uses it (and many are used to it). Perhaps also because many sysadmins are nostalgic about stuff from the 70/80's, and because they can brag about how they can type faster (like typing is the cause of slow coding...).
The distinguishing feature of vi / Vim is that it's mode-based. That means:
you only stay in insert mode for short bursts of typing
in the other modes (mostly normal mode), you have all key [combinations] available for powerful editing commands (which are highly regular in Vim, and can be combined to great effect)
So, it's crucial that you can switch modes easily. For many users, that means remapping the Esc key to a more convenient location (replacing Caps Lock or Ctrl). Then, using H J K L for navigation (note those are only the basics, and it's often better to use more specific motions like w or f{char}) is quicker, because your fingers can stay on the home row (assuming you're a touch typist, which you should invest in if you spend considerable time with a computer). The cursor keys are located so far off that switching there takes too much time (using the mouse is even worse), and isn't good for your wrists, neither.
The problem with the arrows is not that they are too far: the problem is that they only allow you to move character-by-character and line-by-line. And guess what? That is exactly what hjkl do. The only benefit of hjkl over the arrows is that it saves that slight movement of the arm to and from the arrows. Whether you think that benefit is worth the trouble is your call. In my opinion, it isn't.
hjkl are only marginally better than the arrows while Vim's more advanced motions, bBeEwWfFtT,;/?^$ and so on, offer a huge advantage over the arrows and hjkl.
FWIW, I use the arrows for small movements, in normal and insert mode, and the advanced motions above for larger motions.
mouse-using sucker everyone laughs at: (move)↓↓↓↓↓↓↓↓↓↓→→→→→(move)
hjkl-obsessed hipster: jjjjjjjjjjlllll
efficient vimmer: /fo<CR>
h, j, k, and l are on the home row. If you move your hand to use the arrow keys, you have to readjust when you're done with the arrow keys. This is only a problem for touch typists (which everyone back in the day was).
If you like using the arrow keys, by all means, use them. There is one advantage I see over hjkl: arrow keys work in insert mode. Others prefer to move their fingers only minimally. That's a good argument if you are a touch typist and need to type lots of text. At least for me, my thinking is always slower than my editing, so typing speed and minimal finger movement are not so much an issue to me.
In the end, it's a pretty subjective matter. Use what works for you but try to look around and extend your horizon now and then.
h j k l are a stepping stone to more powerful features. Do you really think that left, right, up, down is as advanced as moving the cursor gets in the 21st Century (or 1976)?
Please note that arrow keys are not recorded while using "q" macros, and bring a lot of sheanigans when you are using some esoteric options because arrows interrupt them. The idea with vim is to end up using composable actions as often as possible and arrows are not.
Besides it doesn't make much of a difference anyway. I had the same strule as a kid switching arrows for WASD, once you get used to it it's just another way, closer to where your hand already is.
And it's not just vim, you would not believe how convenient it is to go the extra mile and learn the terminal shortcuts for movement, copy-paste, history, etc. My laptop's arrows broke last year and I couldn't find the time to solve the issue (Amazon reach the space, but not the island where I live). It was a blessing. Now I rarely use arrows anymore, because ctrl-p/ctrl-n/ctrl-b/ctrl-f/etc. it's just more ergonomic. I just lay my hands on top of the keyboard and don't move them anymore. Ironically now the fartest I move my hands from standard position is to press ESC, wich happens quite often in vim.
A few times I've heard "wait, your terminal/editor can do what!?" when doing fancy things with public. Probably their toolset can do it too, but they haven't go the extra mile of truly learning them. Trust me, it's worthwhile to do so. These tools have been designed this way for a reason.

Inefficiency in Vim

I consider myself somewhat familiar with Vim,
hate the arrow keys (let alone the mouse),
regularly look up tips and plugins to get the most out of this tool,
use it daily to manage my cloud servers, etc.
However, I always find myself doing the same mistakes probably inherited from the GUI-world:
too often switching to visual mode to see what piece of code I'm about to manipulate,
undoing changes to retrieve lost statements because I forget to utilize registers (and pasting code on temporary lines just to grab it after other edits),
relying on Ctrl-C & Ctrl-V when working with operating system's clipboard,
keep pressing j button to browse through lengthy files to find certain functions.
Probably my Hungarian keyboard layout prevents me from being faster as most of the special characters (/, [, etc.) are only available as a key combination (with Shift or Alt Gr).
Given this specific situation, what pieces of advice could you give me? Have you faced similar bad habits when you were a Vim-novice? I'd like to see my productivity skyrocket (who wouldn't?). Thanks in advance.
I've found a simple, effective strategy. Choose one action, one task or one set of keys that you think is unnecessarily slow. Figure out a better way of doing this using the vim manual or googling or a plugin etc. Force yourself to use this every time. Rinse, and repeat. The path to efficiency is one-by-one elimination of the slow parts.
I'd also recommend just reading the vim manual from time to time - even if you don't remember everything, knowing something's out there is very helpful.
This probably applies well beyond vim, but
something that worked for me was finding a specific feature that I knew would
be more efficient and concentrate on using that for a week or two.
Just one feature at a time, and possibly using it excessively.
After a couple of weeks it becomes automatic and you can move on to the
next thing.
I learn programming tricks the same way. eg. I'll have a month of using lambda expressions for everything, then a month of mapping and filtering.
(not on production code though)
Probably my Hungarian keyboard layout prevents me from being faster as most of the special > characters (/, [, etc.) are only available as a key combination (with Shift or Alt Gr).
I'm sitting in front of german keyboards all day long and know this problem very well. Some keyboard layouts are simply not very suited for programming / using vim. I think its safe to assume that most programming languages and keyboard shortcuts were designed with the us-layout in mind.
My advice: reset your keyboard layout to us-english and practive touch-typing on that layout (typing without looking at the keys). It won't matter that the keyboard labels are wrong and you'll be much more comfortable using vim hotkeys.
The only problem that still remains for me is to produce language specific characters (german umlauts such as ä,ö,ü) wich i assume will also be a problem for hungarian. For that I use a combination of vim-digraphs, linux window manager digraph-key and windows layout-switching hotkeys.
just keep using it. The more you use it, the better you become at it. VIM isn't too bad. The main thing is you just have to remember that it isn't always in edit mode.

Do any laser keyboards allow you to move around keys to your liking?

The lack of uniformity of the pgup print screen arrows etc is getting on my nerves. I am wondering if any of the laser keyboards would make me a more efficient keyboarder by allowing me to adjust those keys and make fewer mistakes in programs, emails, and administrative tasks.
I think you are stating that you'd like to go from a physical keyboard to a laser keyboard to improve your typing skills. As well, the only laser keyboard I have experience with had an odd layout that completley lacked the "pgup print screen arrows etc" which you complained about being non-standard, as well as having keys squished into a trapezoid.
I believe you will find it impossible to touch type on a laser keyboard. Typing requires tactile feedback to know where your fingers are at all times.
A better solution to your problem is probably to pick a standard keyboard layout and use it everywhere you can. Personally, I use upwards of four different keyboard daily, but they are all almost the same. My pet peeve with keyboards is the location of the \ key which tends to move around.
I like to use vi-style keybindings, so I wouldn't miss the keys outside of the main "block" of keys on a standard 101 keyboard.
I'm not sure what a laser keyboard is, but the Ergodex DX1 lets you move the keys around. Very useful for some things, but I doubt that typing would be one of them.
I believe that if you're planning to use that a lot, if you don't have a "good touch/feeling" keyboard, you will have problems mostly with your hands... Ergonomacy is very important specially if your working lots of hours in front of your computer. Have you imagined what it is like introducing 5000 words in a day without having the smooth and pleasing feature of the keys suspension!? imagine typing 5000 words all day long knocking your fingertips all day long in a wooden table. That's got to hurt!

How do I get my hands on a Dvorak keyboard?

I've always assumed that before I can use the Dvorak layout I need to purchase a Dvorak keyboard. But I can't find one on Amazon. Is it simply a matter of popping the keys off a Qwerty keyboard and moving them around?
To help you learn your way around the keyboard layout, you can physically rearrange the keys on your Qwerty keyboard. Or you can simply re-label the keys with stickers. I personally learned to type using the Dvorak layout without re-labeling or re-arranging keys, and found that it was not difficult.
Most modern OSes allow you to remap any keyboard to the Dvorak layout.
Windows XP/Vista: you can set
your mappings through Control
Panel->Regional and Language
Options->Languages->Details....
Mac OSX: System Preferences -> International -> Input Menu (thanks jmah)
Ubuntu: System -> Preferences -> Keyboard, Layouts Tab, Add..., Select the Devorak layout of your choice and optionaly set as default. You can then right-click your panel, select "Add to panel" and choose keyboard indicator. You can then switch between layouts. (Thanks Vagnerr)
If you are a touch typer, you will benefit greatly from the Dvorak layout.
The way I taught myself Dvorak as a touch typer was to tape a small copy of the layout to my monitor. Then I practiced typing by looking at the copy instead of the keys.
That was six years ago. I still use stardard Qwerty keyboards, but I haven't looked at what the keys says since I first learned to touch type 20 years ago.
You could go with Das Keyboard Ultimate, which has no letters on the keys. You will become a touch Dvorak typist in no time flat. Or you could wimp out and put labels on the keys.
I learned Dvorak by changing the layout using the OS. I printed out a keyboard layout and taped it below my monitor so I could refer to it without looking down at the keys.
Later, once I learned where the keys were, I printed out stickers and put them on the keys caps.
To this day, I just rely on the OS layout switching to get Dvorak.
I tried to rearrange the letters once, on some keyboards it doesn't work. Since the letters are different in shape based on the row they are in.
Well if you have a fat wallet then an Optimus Keyboard would give you Dvorak(and qwerty and azerty and any combination!)
You can just rearrange your keys on your current keyboard and change the layout.
Here is the key layout:
I'm not seeing the image, so here is the direct link.
If you're going to rearrange the physical keyboard, go for a Model M with removable key caps.
Switchable between qwerty and Dvorak: DvortyBoard
Cheap, but you need the OS to remap the keys: Hooleon
Don't get a dvorak keyboard. Non-touch-typing dvorak is as bad for your wrists, and as slow, as non-touch-typing qwerty. There is absolutely no point. You want to get out of that habit.
Change the layout in your OS and learn not to rely on looking at the keyboard. If anything, pop off the keycaps and put them back in randomly. If you absolutely must buy new hardware, get a Das Keyboard or any other blank keyboard.
I got two of these (one for work and one for home), and I love them:
http://matias.ca/dvorak/
It's also switchable via a button to Qwerty, as a concession to your colleagues who may need to type on it.
My only complaint is a very minor one: after 4 years, some of the labels started to fade or scratch off.
If you're just learning Dvorak, good luck. The best thing I did is switch to it 100% of the time. When I was switching back to Qwerty for speed, all I did was scramble my brain. Dvorak will be slower while you're on the learning curve, but it's well worth it. A lot less stress on the fingers in the long run, and after 12 years, I actually type faster on Dvorak than I ever did on Qwerty.
Best way to practice: open a book or magazine and copy some paragraphs in Dvorak. If you find a tricky paragraph, type it out two or three times until the patterns start to become muscle memory.
Good luck!
You'll have trouble getting the keys to fit (perhaps you could just draw over them) but yeah, you should be able to switch layout within the OS.
I don't know how much you are prepared to invest, but I think the Optimus Maximus keyboard from Art Lebedev Studios would be a good choice, since you can switch keyboard layout quite easily and no need for the key pop-up.
On most PC keyboards the keys have in each row have a different shape. The tops of the keycaps are at a different angle. This provides a slight front-to-back curvature of the top surface of the keys. (You can see this if you peer at the keys from the side).
If you go moving keys between rows, the tops of the keys will not line up... the keyboard will look strange and feel "bumpy" and uneven. Not good for touch typing.
Solutions:
A flat keyboard - a few manufacturers produce keyboards where all the keycaps are the same shape. Apple and Sun keyboards are like this, and I think most Logitech keyboards too... But be careful of the new Apple aluminium keyboard -- it may be harder to remove the keycaps safely.
Also, you are best starting with a US QWERTY keyboard. Other national layouts have some different keys, and you won't be able to get standard Dvorak by re-arranging.
You could try getting a custom keyboard from Unicomp. They offer an IBM buckling spring style keyboard called the "Customizer 104/105" that is available in many different languages, including US-Dvorak if you ask for it. I have purchased a couple of keyboards from this company and the quality is top notch. If you want a new buckling spring keyboard, this is the only company that I am aware of that offers them.
This keyboard is hardwired so you don't have any of the issues that you would have if you switch the keyboard layout in the OS - like your log-in key map being different than your account key map, or problems with remoting into another computer.
Unicomp Keyboards
You can just change the layout in your OS. It actually would be better not to get a Dvorak keyboard so you can learn Dvorak without being dependent on looking at the keys. A great typing tutor to help you learn is Stamina Typing Tutor (just google it), which has an on screen keyboard so you don't have to look at your keys. And when you aren't just practicing you can print out the Dvorak layout from Google images and refer to that as you type. If you really want to get a hardwired keyboard search Matias Dvorak on Amazon. That's the only keyboard I could find on Amazon that was Dvorak, and it has a button to switch between Qwerty and Dvorak. I would not rearrange your keys though since most OS's don't switch to Dvorak until the user logs in.

Is it worth swapping Ctrl and Caps Lock for windows users that don't use Emacs

I've been aware of Steve Yegge's advice to swap Ctrl and Caps Lock for a while now, although I don't use Emacs. I've just tried swapping them over as an experiment and I'm finding it difficult to adjust. There are several shortcuts that are second nature to me now and I hadn't realised quite how ingrained they are in how I use the keyboard.
In particular, I keep going to the old Ctrl key for Ctrl+Z (undo), and for cut, copy & paste operations (Ctrl+ X, C and V). Experimenting with going from the home position to Ctrl+Z I don't know which finger to put on Z, as it feels awkward with either my ring, middle or index finger. Is this something I'll get used to the same way I've got used to the original position and I should just give it time or is this arrangement not suited to windows keyboard shortcuts.
I'd be interested to hear from people who have successfully made the transition as well as those who have tried it and move back, but particularly from people who were doing it on windows.
Will it lead to any improvement in my typing speed or comfort when typing.
Do you have any tips for finger positions or typing training to speed up the transition.
I actually don't swap control and caps and just make caps ANOTHER control key. I can't think of a single time in my life when I have ever hit caps-lock on purpose, so I haven't missed it.
That way, you get used to using it, but if you slip up and use the old control, things still work. It's worked out very well for me.
There's a .reg file to do this here.
I've done it for quite a while now, and it's natural to me, even though I'm not an Emacs user either (I'm in the Vim camp of that particular war :) ). In fact, it's so natural that moving to other machines (coworkers, family members, etc.) causes me grief because Ctrl isn't where it 'ought' to be.
For emacs ctrl should be at caps lock - for vim the escape key should be on the caps lock. I really feel that the caps lock button should be renamed "free parking" and OSes should make a system tray utility to quickly change the free parking button from escape, to control, to anything you need to type over and over again.
I ended up taking the advice in Zach's answer, but I also made Caps Lock behave as an ESC key if it was held and released on it's own using the AutoHotKey script in this gist: CapsLockCtrlEscape.ahk
I also bound Ctrl+Shift+Caps Lock to Caps Lock for the rare occasions when I might need it using this AutoHotKey script:
#IfWinActive
^+Capslock::Capslock ; make CTRL+SHIFT+Caps-Lock the Caps Lock toggle
return
I switched the Caps Lock and Ctrl keys a couple of months ago and after the initial learning period, ~ 1 week, my biggest problem is when I use a computer that hasn't switched the keys.
I first did some registry hack but I can't remember where I found the information on how to do it. Now I'm using a small utility called Remapkey which is included in the Windows Server 2003 Resource Kit Tools even though I think I'm using an older version.
I had no problem making the transition. I use keyboards with both configurations without issue. Perhaps having it as a hardware solution (and the labels properly printed) makes it easier than doing it through software and having to remember how each machine/keyboard is setup.
I think what's best to put on caps depends on your physical keyboard.
At home I type on a Kinesis Ergo Elan where my ctrl keys are under my thumbs, along with 2*alt, space, enter, backspace, delete, pgup, pgdn, home and end; the rest of the keyboard is fairly normally laid out, except the board is split.
With the ctrl keys ready at hand, it really makes the most sense to put escape on caps lock (and caps lock on esc, for the few times I need it). Even if you're an emacser, hey... it doubles as a spare "prefix alt key", and you probably ask your browser to stop what it's doing a few times every day.
On the other hand, if I'm typing on my laptop where the lower left corner key is Fn rather than ctrl (ffs...) and I can't hold down shift+ctrl with one finger, it might make sense to put ctrl on caps (such that I can hold them with a single finger). At least if you're not a vi'er, or you don't mind the escape key being further away (or have some crazy system).
What's really interesting is putting some funky key on shift+shift (yep, both shift keys). This can be done with xmodmap fairly straightforwardly; I put my compose key there. If you don't need compose, you may want to put something else (like, say, esc).
Copy the following code into a file called caps-ctrl-swap.reg, execute the file, agree to allow registry to be changed, log out and back in and your caps-lock and left-ctrl keys will be swapped. I've used this script for whatever version of Windows was current in 2005 and every version in between. I needed it today since Windows 10 updated overnight and it still works great.
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00,00,00,00,00

Resources