Live data from Hacker News

Enhancements to Shell and Vim Productivity

danielmiessler.com

51–60 of 62 posts

Re: Enhancements to Shell and Vim Productivity

#51
post #40

Why is this article so Mac oriented? 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.

You know I don't really get this sentiment. And I just think people hate on the Mac because they want to. 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…

1) The article has a title making it seem like it's unix shell tips straight from the unix master, then instead is advising to use certain Mac programs.

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.

Re: Enhancements to Shell and Vim Productivity

#52
post #43

Earlier quoted context omitted.

What I did, for example, was that I enabled vi-mode in my shell but also re-enabled some emacs-keybindings like CTRL-E and CTRL-A for ending and beginning of a command because I learned them like a lifetime ago when I first got used to the shell without even knowing they were emacs-keybindings. 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…

I use vi-mode in my shell but the end/beginning Vi commands (A,I,0,$,etc) are the only ones I find myself using regularly. I also use c[motion] and d[motion] on occasion, but that is pretty much it. I'm not convinced that powerful editing is necessary for the command line, but familiar shortcuts for beginning/end seem very useful.

There are absolutely times that powerful editing is mandatory at the command line; I am skeptical that there are times when powerful editing at the command line is necessary but pulling the line into your $EDITOR (v in vi-mode, ctrl-x ctrl-e in emacs-mode) is not the best way to deal with it.

Re: Enhancements to Shell and Vim Productivity

#53

Why is this article so Mac oriented? 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.

Only one of the tips is Mac specific, unless I'm missing something...

Re: Enhancements to Shell and Vim Productivity

#54
post #18

One small suggestion (I make this every time vim comes up): 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.

Hah, I thought I was the only one doing the stupid "jk" thing.

Re: Enhancements to Shell and Vim Productivity

#55
post #40

Earlier quoted context omitted.

You know I don't really get this sentiment. And I just think people hate on the Mac because they want to. 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…

1) The article has a title making it seem like it's unix shell tips straight from the unix master, then instead is advising to use certain Mac programs. 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 ever…

1. There's only ONE tip out of 9 that tells the user to use iTerm over the default Terminal. I don't agree with many of the tips here and I wouldn't use them to "enhance" my workflow but you have to critique the article on what it actually says, not what it's geared towards. You can't just say "why is this geared towards OS X?" because that's not a valid criticism.

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!

Re: Enhancements to Shell and Vim Productivity

#56
post #23

Earlier quoted context omitted.

In OSX at least, there's a way you can make Caps Lock behave as Ctrl when used as a modifier key, or Esc when pressed alone. Way better than adding an extra keystroke to every time you want to hit Esc.

Do you happen to know a resource that explains how you do this?

[deleted]

Re: Enhancements to Shell and Vim Productivity

#57
post #28
post #23

Earlier quoted context omitted.

Do you happen to know a resource that explains how you do this?

The way I do it is: map caps lock to Ctrl in System Preferences, then download this tool[1]. The setting you are looking for is 'Control_L to Control_L'. When you hold Control it acts as a modifier but if you tap it, it acts as escape. [1] http://pqrs.org/macosx/keyremap4macbook/

More details can be found in the ctrl/escape section in:

http://stevelosh.com/blog/2012/10/a-modern-space-cadet/

Re: Enhancements to Shell and Vim Productivity

#58
post #18

One small suggestion (I make this every time vim comes up): 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.

I was going to suggest mapping both jf and fj to escape so you could mash the two keys at the same time without worrying about order, but jk and kj would work as well

Re: Enhancements to Shell and Vim Productivity

#59
post #43

Earlier quoted context omitted.

I use vi-mode in my shell but the end/beginning Vi commands (A,I,0,$,etc) are the only ones I find myself using regularly. I also use c[motion] and d[motion] on occasion, but that is pretty much it. I'm not convinced that powerful editing is necessary for the command line, but familiar shortcuts for beginning/end seem very useful.

There are absolutely times that powerful editing is mandatory at the command line; I am skeptical that there are times when powerful editing at the command line is necessary but pulling the line into your $EDITOR (v in vi-mode, ctrl-x ctrl-e in emacs-mode) is not the best way to deal with it.

but it's not about powerful editing alone. it's about nice things that are just in your fingertips, say using 'df ' to delete a --long-argument=/a/very/long/path from a command...

Re: Enhancements to Shell and Vim Productivity

#60
post #59

Earlier quoted context omitted.

There are absolutely times that powerful editing is mandatory at the command line; I am skeptical that there are times when powerful editing at the command line is necessary but pulling the line into your $EDITOR (v in vi-mode, ctrl-x ctrl-e in emacs-mode) is not the best way to deal with it.

but it's not about powerful editing alone. it's about nice things that are just in your fingertips, say using 'df ' to delete a --long-argument=/a/very/long/path from a command...

fair enough
Post reply on HN