Live data from Hacker News

Quick tip for developers who use OS X

news.ycombinator.com

171–180 of 406 posts

Re: Quick tip for developers who use OS X

#171
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.

Sweet! To take it to the next level:

pbpaste |sed 's/FIND/REPLACE/g' | pbcopy

Maybe make this into a script you can run from alfred. ;)

Also if you want to have access to pbcopy remotely, try this:

http://evolvingweb.ca/blog/exposing-your-clipboard-over-ssh

Re: Quick tip for developers who use OS X

#176
post #106

Earlier quoted context omitted.

C-a : beginning line, C-e end line, alt+f forward word (unless system shortcut for file menu), alt+b back word, C-k kill line, C-b back char, C-f forward char. At least in my current setup, C-w yank and C-y paste works as well. Immensely helpful. Sometimes at+left/right does forward/ back word depending on the terminal emu. Note most of these keystrokes are valid in nano as well.

More: - C-u to kill (cut) from current location to beginning of the line - C-k to kill (cut) from current location to end of line - C-w to kill (cut) from current location to beginning of word - C-y to paste (copied / cut) lines - C-l to clear screen (I use the shit out of this) - Ctrl + shift + '-' (holding ctrl, shift, minus at the same time), for undo. That is it. EDIT: Damn it, I didn't realize I was saying a bun…

Just wanted to note:

C-u kills from cursor to start of line.

C-w kills from cursor to start of previous word. M-d is its friendly forward sibling.

Re: Quick tip for developers who use OS X

#178

Earlier quoted context omitted.

More: - C-u to kill (cut) from current location to beginning of the line - C-k to kill (cut) from current location to end of line - C-w to kill (cut) from current location to beginning of word - C-y to paste (copied / cut) lines - C-l to clear screen (I use the shit out of this) - Ctrl + shift + '-' (holding ctrl, shift, minus at the same time), for undo. That is it. EDIT: Damn it, I didn't realize I was saying a bun…

Just wanted to note: C-u kills from cursor to start of line. C-w kills from cursor to start of previous word. M-d is its friendly forward sibling.

Thanks! fixed.

I never noticed C-u was from cursor. I tend to use it mostly from the end of the line.

Re: Quick tip for developers who use OS X

#179
post #81

Two more tips: * Ctrl-a to go to beginning of line * Ctrl-e to go to end of line

Because crappy Macs have no Home/End keys (or they don't work as such).

ctrl-arrow (which breaks with Lion's Spaces default keys), or shift Home/End in Terminal.

It's not that Macs are crappy, they just have different key bindings. I regularly work with Macs, Windows, and Linux for development and I've just learned to use the different key mappings.

I don't think I'm quite as proficient in any one system because of that, though. For example, I have avoided learning the Emacs key bindings for use in Mac/Terminal. (I don't want to try to remember TWO bindings for Mac, plus I learned vim first so usually avoid Emacs.)

Re: Quick tip for developers who use OS X

#180
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.

Quite a lot of OS X applications support pasting with matching style (Cmd+Shift+V), which does exactly the same thing.
Post reply on HN