Live data from Hacker News

Quick tip for developers who use OS X

news.ycombinator.com

31–40 of 406 posts

Re: Quick tip for developers who use OS X

#32
post #28

Useful when copy/pasting things to share with other people in email and such: $ pbpaste | pbcopy takes the current contents of the copy/paste buffer and removes color/font/background color rich formatting and puts just plain text back into the paste buffer. And of course pbcopy and pbpaste are also very useful on their own.

You can also use shift-option-cmd-v to directly paste without markup :)

Re: Quick tip for developers who use OS X

#34
post #24

OK, so for vim users with zsh: bindkey -v Now be happy, hit and, use ^ and $ but also f t and also ,;. You can copy/paste with dd, Y, etc...

Fyi, bash also has vi-mode (set -o vi).

bash uses GNU readline, while ZSH has it's own readline. IIRC the Emacs-/Vi-modes in bash are support from readline. (this is also why you configure some of these things via .inputrc for Bash rather than .bashrc).

Re: Quick tip for developers who use OS X

#37
post #23

Osx terminal uses almost all of the emacs movement keys by default. Ctrl-a and ctrl-e are useful but I find the meta movement keys to be the most helpful. (usually alt or ESC) Meta-f jump forward a word Meta-b jump backwards a word

It's not emacs, it's GNU Readline (or likely some BSD readline given apple and the GPL) http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html . The shortcuts also work in every text field in the OS.

IIRC, someone mentioned to me once that bash doesn't link against libreadline, but uses libreadline (the source is directly in the Bash repo), so it's possible that it's using GNU readline, while Apple's libreadline is a BSD flavour.

Re: Quick tip for developers who use OS X

#38

A new one for me I accidentally found the other day.. If you use Spotlight to find something and then want to see the file in Finder, Cmd+click the item in the Spotlight dropdown. Edited from Cmd+shift+click due to note in child comment :-)

isn't it just Cmd+click ?
Post reply on HN