Enhancements to Shell and Vim Productivity
danielmiessler.com
danielmiessler.com
Tried this and gave it up. Your shell may be (somewhat) vi compatible but the applications you use mostly are not so you'll have to break out of the vi mindset at all sorts of inopportune moments. That, and modal editing, while perfectly alright for text editing, maps rather lousily to command line operations. You're much better off getting used to some basic Emacs-style key bindings that work consistently across a wide number of applications (including OS X text fields, IIRC).
But that way I am also able to hit ESC and do a / for a search, like within vim, which I am much more used to than a search in emacs. I found that way combines the best of both worlds.
I'm not convinced that powerful editing is necessary for the command line, but familiar shortcuts for beginning/end seem very useful.
So here's tip 9:
Use a nice Linux or similar machine with a pleasant to use clicky keyboard and a mouse which allows text highlight and middle click paste.
I never saw the appeal of Linux. Yes, it's free, and I can buy a cheap PC to run it on but why would I do that? My Macbook Pro has the best keyboard I've ever used (the 2008 "pro keyboard", not the chicklet keys Apple uses these days) and the trackpad is better than ALL trackpads out there. Seriously, Apple knows how to make trackpads. And on top of that, OS X is as much Unix as Ubuntu or any other distribution of Linux and I can do whatever work I would have done on Linux on my mac. If I don't have a command line tool, I just use homebrew to install it or build it from source if homebrew doesn't have that formula. And you know what I get including those nice things? The wealth of awesome OS X apps, like Textmate, Keynote, iTerm, Kaleidoscope, QuickSilver/Alfred, XCode, Pixelmator, Time Machine etc that are available. So I ask you, why would I use a Linux machine when OS X is supremely better in almost every way?
2) A trackpad can NEVER replace a regular mouse with scrollwheel and many buttons. Maybe the apple.com website triggers your emotions. But the following website triggers mine: http://www.razerzone.com/gaming-mice
3) OS X may be supremely better for you, but not every person is the same, you may be their target audience, other people are not and, gasp, may actually prefer a different design philosophy.
4) Being free or cheap is not usually a reason why one runs Linux on a PC. Can you imagine someone can actually prefer something, independent of cost?
5) Mac OS X has apps. Other OSes also have apps. They all have their selection of awesome apps. Usually one prefers the ones they're used to I guess.
2. Sure, I never said it could replace a mouse. Only, I rarely ever use a mouse because I don't want to carry around a mouse just for middle click when I can use a Modifier key + single click to achieve the same thing. I also use my keyboard more, even to switch between applications and rearranging my windows using a Window Manager app like Slate. I also never said Apple's website triggers any of my emotions so I don't know where you got that from. I just said Apple has the best trackpads around and you can actually not use a mouse if you don't want to since Apple's trackpad is so good. Also, a Mac app called "BetterTouchTool" further enhances the track pad so you can do almost anything with trackpad gestures, something you really can't do easily on Linux.
3. Yeah, that was just my opinion. I wasn't speaking on behalf of other people.
4. Okay, got it. Many of my friends use that as a reason when I ask them why they run Linux though. They say it's cheap and they don't want to pay $2000 for a Mac which is fair enough. They just want a Unix machine and they can run Ubuntu on a VirtualBox without paying a cent.
This may be heavily opinionated, I know, but like I said, the reason Linux never appealed to me is because I can run Linux apps on the Mac since open source usually means I can run it on different platforms. Take any linux app, and I can bet 99% of the time, it's also available on the mac and I can further bet 80% of the time, there's an alternative on the Mac which is better (in my opinion). The truth of the matter is, there are many Mac exclusive apps that are far better than anything available on other platforms. This is just my opinion, that's all. You may view it differently than me, that's okay!
I disagree. I find the multi-touch trackpad on my MacBook Air much better to use than a mouse.
Less effort, good accuracy, great multi-touch controls like two fingers for scrolling, pinch in-out for zooming, three-finger swipe for 'back' on the browser.
4) Being free or cheap is not usually a reason why one runs Linux on a PC.
It's a reason that's often cited as being in its favour.
A long time ago, OS2 was better at running Windows apps than Windows was. The same is true for OS X running Linux ..
Nice list of things to try, I don't use vim but I've been putting off doing 3 of them (caps remap, iTerm and zsh).
However, as a Mac user, all of the Cocoa text widgets more or less support emacs keybindings, so having a working knowledge of basic emacs movement commands has been very useful.
The emacs bash/readline keybindings also have a really neat trick that the vi bindings don't -- keyboard macros!
Ctrl-( to start recording, Ctrl-) to stop, and Ctrl-x to execute.
Don't remap "jj" to escape. Remap "jk" instead. All of the same benefits, plus one more - if you get into the habit of nervously hitting "jk" all the time, as most people do in vim, using "jk" means your cursos stays in place. On the other hand, "jj" means your cursor will move.
However, it is useful some of the time. Since viins is pretty useless by default, you can spice it up by setting custom bindings (e.g. copy emacs') and get the best of both worlds. Furthermore, this may be helpful: http://www.bewatermyfriend.org/media/vi-mode.zsh
So there's not really an extra key, you get both benefits :).
For example if you're into quality switches, rated for 50 millions keypresses and providing a better tactile feedback than the typical $5 chinese mass-produced keyboard, you may want to shell out $250 to buy an Happy Hacking Pro 2 or a Realforce keyboard using Topre switches (you can have very good Cherry MX based boards for way less than that that said).
Some of these keyboards, like the HHKB Pro 2, don't even have Caps Lock. They have Control in place of Caps Lock.
So "Do people really not use caps lock?" is not the correct question. The correct question is: "Do programmers who touch-type and who spent time figuring out which keyboard switch they like really not use caps lock?" and then the answers becomes "yeah, most really don't use caps lock because Ctrl is so much more useful and so easier to use when it's located where caps lock typically is. To the point that companies building $$$ keyboard for that market don't even bother selling keyboard with caps lock" : )
"CLOCKS_PER_SEC" should be "CLO" and then auto-complete anyway. Regarding NSString, that's keypress, keyrelease (turning capslock on), 'n' 's' 's', keypress, keyrelease (turning capslock off). Doing it without capslock is keypress (shift), 'n' 's' 's', keyrelease. Which IMHO is faster but YMMV.
People touch-typing are alternating Shifts when needed when typing all-caps or typing lowercase and uppercasing the whole word using some vi(m)/emacs magic shortcut anyway ; )
Another upside to this is that people will gradually stop asking to use your laptop 'for just a minute'.
For whatever the reason though, capslock/escape remapping is not one of those changes for me. Working on a machine that doesn't have that is absolutely crippling; it takes a great deal of effort to not constantly hit capslock.
My solution is to only use my own computers. Mileage may vary. ;)
A mapping I've been using for years. I'm pretty sure between this and Ctrl-c, I never hit escape in Vim anymore.
This will turn on vi mode for anything that uses the readline library (there's a good chance your favorite database command line uses it and any other apps that also use the readline library)