Live data from Hacker News

Quick tip for developers who use OS X

news.ycombinator.com

391–400 of 406 posts

Re: Quick tip for developers who use OS X

#391

The first thing I do when setting up a new Mac is make the Caps Lock key into another Control key. System Preferences > Keyboard > Modifier Keys Saves lots of awkward pinky-bending.

Is it me or do Mac Caps Lock keys require you to hold them down for close to a second for them to activate? There appears to be some kind of hardware timer in them to work...? I noticed this coming from Windows and Linux on other keyboards where tapping Caps Lock works but on Mac OSX with an Apple keyboard or on a Macbook you have to make a real deliberate effort to keep the key down longer than a nanosecond for it t…

It's not just you. I think it is to prevent accidentally toggling it when going for tab.

Re: Quick tip for developers who use OS X

#393

Earlier quoted context omitted.

Is it any different from C-a C-k ? Both seem to stuff things into the kill ring (or whatever it's called in bash). I guess lots of people leave C-a as the default escape key for screen.

Yea, there's the GNU Screen mapping conflict, and also I rarely use C-k so it's not in my muscle memory.

Makes sense; I use emacs in addition to just the emacs-like readline bindings, so C-u conflicts with "prefix argument". I also nest screen sessions using ^Z as the outer one's escape key and ^O as the inner one's, partly so I can use C-a / ^A.

Re: Quick tip for developers who use OS X

#394
post #292

Earlier quoted context omitted.

"X Window software" hasn't really changed very much in the last couple decades. I use distinct Control, Shift, Meta/Alt, and Hyper keys. The blame lies with "desktop environments", not X. X has plenty of its own problems without getting Gnome's problems heaped on top. Edit: > It's only the this-​is-​finally-​the-​year-​of-​Linux-​on-​the-​desktop crowd slavishly imitating Microsoft's mistakes that screwed it up. Most…

Oh, I agree with you — I perhaps should have written something like “*nix workstation software” rather than “X Window software”. I do use a separate Meta as well, and try to avoid programs that can't be configured to use it (GNOME-aligned ones being the most common). And hey, as far as ‘really shitty reimplementations of Growl’ go, even Apple has one now.

Ah, with that edit I agree, with the caveat that I was never exposed very much to ye olde-school Xe applicationse.

Re: Quick tip for developers who use OS X

#396
post #205

Two more (for Bash) - Ctrl-x, Ctrl-e will pop open your EDITOR so you can edit the command. Saving and closing the editor brings the command back in your terminal and automatically executes it. fc will bring up your EDITOR with the last typed command. (You can use fc -l to see a list of commands)

Genius! That's going to save me so much time. :-) #yearslost

Re: Quick tip for developers who use OS X

#397

Earlier quoted context omitted.

"Paste and match formatting" shouldn't be necessary for most programs, and isn't a platform standard. Yes, it is. https://developer.apple.com/library/mac/documentation/UserEx... says "Table A-2 lists the system-reserved and commonly used keyboard shortcuts mentioned in the rest of this document." Table A-2: contains ../art/ks_option_2x.png ../art/ks_shift_2x.png ../art/ks_command_2x.png V Apply the style of the surro…

OK I didn't know Apple had made that a standard -- so I agree with the GP that it's dumb. If I can't easily type a shortcut with one hand, it shouldn't be a standard shortcut. I'm suggesting the standard paste should behave as expected, not adhere to some literal definition the user doesn't care about. If I copy a passage of text from one document and paste it into another, I generally want it to look like it belongs…

I think implementing "obvious intentional styling" is an AI problem. Suppose you copy a header, click in a normal paragraph, and paste. Keep styling information? Case 2: copy styled text from Keynote, and paste. Keep styling?

Maybe, the logic in a word processor should be to keep character styling, but not paragraph styling, but I think there will be many edge cases (for example, the user might be using the word processor as a document layout package)

I doubt those edge cases can be programmed away; user intervention is required. Microsoft solves that after the paste. That may be the better solution.

Re: Quick tip for developers who use OS X

#398
If you want to invoke a command in the menubar quickly - such as applying filters in Photoshop - hit Cmd + Shift + ?. Thill will bring up the Help Search menu and you can type the name of the menu item you want to invoke. Then just hit Enter and it’s done!

Re: Quick tip for developers who use OS X

#399

As it wasn't mentioned yet: pushd / popd These two commands replace 'cd' and work with a directory stack of different paths. $ pushd tmp # cd to tmp and remember current path / /tmp / $ pwd /tmp $ cd /usr # normal cd to wherever you want... $ pwd /usr $ popd # pop the stck and get back to the previous path / $ pwd / Subsequent pushd will stack multiple paths. It's a built-in of bash and other shells. It works even wi…

You can also use "cd -" to go back to the previous path:

  $ cd /
  $ pwd
  /
  $ cd /tmp
  $ pwd
  /tmp
  $ cd -
  $ pwd
  /
Not the same, of course, but still useful, I think.

Re: Quick tip for developers who use OS X

#400
post #244

Earlier quoted context omitted.

I use these settings in my .inputrc. The get me a few more commands and even the ability to escape using jj. set completion-ignore-case On set bell-style none set editing-mode vi $if mode=vi set keymap vi-command "gg": beginning-of-history "G": end-of-history set keymap vi-insert "jj": vi-movement-mode "\C-p": history-search-backward

I've been wanting to use 'jj' to enter normal mode on the command line for some time. This solution actually didn't work for me, but adding the following to my .zshrc did: bindkey -M viins 'jj' vi-cmd-mode

That is because zsh does not make use of readline. I ran into this issue myself recently, since I use bash on my personal machines and zsh on my work ones.
Post reply on HN