Lurker News
OSX Terminal: hold option and click a position in the current line to move your cursor to that position. #yearslost

Comments (395) 107 threads

Show all comments

Showing thread 16 of 107

mikeroher6 replies#
Two more tips:

* Ctrl-a to go to beginning of line
* Ctrl-e to go to end of line

koenigdavidmj2 replies#
A lot of the Emacs shortcuts work in OS X (most of the system) as well as on Linux (bash and other users of readline).
mikeroher2 replies#
I use Vim and was unaware that this shortcut existed. Are there any other Emacs shortcuts which are useful in OSX?
65a1 reply#
Ctrl-K kill to end of line,

so Ctrl-A Ctrl-K will clear a given field

Fishkins#
And you can Ctrl-Y to paste the line you killed. This is a separate copy/paste buffer from the normal Cmd-C one, which can be nice.
coliveira1 reply#
If you do "set -o vi" you can also use vi shortcuts, such as ESC-j,k to go up/down the history, 0 to go to the beginning of the line, etc.

Continue this thread — 1 reply

lr1 reply#
The basic Emacs key-bindings should work in all Cocoa apps. For instance, the URL bar of your web browser, while text editing in just about any editor (maybe even in Office, but I have not tired in a while), etc. Basically, anywhere you have a cursor, the basic line-editing key bindings should work.

So, in practical terms, this means you have 1 + n clipboards[1]. The main global GUI clipboard (using the command key), and then an app-specific clipboard (using the control key with Emacs bindings). As a developer, it is extremely helpful to have two clipboards in TextMate, for instance.
[1] Technically, the clipboard in OS X maintains a history (not sure what the limit is), but the OS X GUI only exposes the last cut/copied item.

eddieh2 replies#
defaults write -g NSTextKillRingSize -string 4

Continue this thread — 2 replies

zampano3 replies#
A couple more:

* ⌘ + ` (tilde key) to switch between different windows of your current application
* ⌘ + l (lowercase L) in most web browsers to highlight the address bar

netghost#
I'm always telling people about ⌘ + `, it makes navigating windows on OSX so easy.
virtualwhys#
The former is the one thing I missed the most from my OSX days...until I got a tiling WW setup (i3).

Woohoo, love me some Linux, let choice reign ;-)

sandipc#
to piggyback off of this... (not sure if this is in the thread already)

⌘ + ` to switch between different windows of current application
⌘ + SHIFT + ` to switch between different windows of current application (reverse order)
same for the general application switcher:
⌘ + TAB to switch between different windows of current application
⌘ + SHIFT + TAB to switch between different windows of current application (reverse order)

EnSabanNur#
This was life changing when a co-worker showed me this last year.
panzi2 replies#
Because crappy Macs have no Home/End keys (or they don't work as such).
webjprgm1 reply#
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.)

panzi2 replies#
ctrl-arrow jumps to the next word boundary under Linux.

Yes, other systems have other key bindings, but why do common things like jumping to the begin/end of a line need a key combination? And why aren't the characters written onto the keys? Every time I have to type some code on a Mac I have to press all the keys in order to find { } [ ] etc. At leas I learned not to quit the terminal when I want to enter a @ by now. Whose brilliant idea was that?

Continue this thread — 2 replies

ggreer2 replies#
On most macs, Fn + left/right arrow are home/end. Fn + up/down are pageup/pagedown.
panzi2 replies#
Fn... urgh. I hate these crippled laptop keyboards (and tiny neck pain inducing laptop monitors).

Continue this thread — 2 replies

72deluxe#
Not sure if I have it set up differently but mine is Cmd-Left or Cmd-Right to move to the beginning of a line...? Easier to reach than fn (I'm using a real wired BIG Apple keyboard, the RSI inducing one...)
actf1 reply#
I love how osx supports emacs key-bindings by default for any text field.

I miss this feature a lot when I switch back to windows. I find myself pressing ctrl-n in my browser's address bar, expecting to view my URL history, and instead I get a new windows.
If anyone knows of a way to get similar functionality in windows, I would love to hear about it!

mariusmg#
Cltr + D to focus on address bar. Alt + down arrow to view history.