News for hackers. Stuff that matters.
Re:From Mac to Linux – the setup I've grown to love by JulianWasTaken on Sunday August 25, 2019 @07:10AM (#20792321)
In 2019 you still cannot get a decent macOS-like modifier key setup on Linux where OS-keys are mapped to Super (e.g. Super-C being copy) and such that Control works like it does on macOS, so I still always find these kinds of articles nice but you're in for lots of surprises if you try to switch.

And I say this as someone with both macOS and Linux laptops that I work from, but because of the above and other similar things I think you're always up for disappointment if you expect to get Linux to be exactly like macOS.

Re:From Mac to Linux – the setup I've grown to love by sandGorgon on Sunday August 25, 2019 @09:35AM (#20792874)
All Linux and Windows OS follow the IBM CUA standard (https://en.wikipedia.org/wiki/IBM_Common_User_Access).

All of them honor Ctrl+Insert for copy and Shift+Insert for paste. This will work on browsers, editors , shells, etc. FYI this will also work on Windows XP cmd.

Linux has its own set of standards that has evolved to work on keyboards that do not have the super modifier (e.g. in India), but has far more consistency built into it that the Mac

Re:From Mac to Linux – the setup I've grown to love by maratc on Sunday August 25, 2019 @04:20PM (#20795312)
The problem with the Insert key is it's nowhere to be found on 99% of the laptops, thus rendering the IBM CUA standard moot.
Re:From Mac to Linux – the setup I've grown to love by sandGorgon on Monday August 26, 2019 @01:31AM (#20797650)
Actually it's the other way. 99% of laptops have an insert key.

MacBook and it's wannabes (xiaomi,etc) are the only ones that dont.

Re:From Mac to Linux – the setup I've grown to love by maratc on Monday August 26, 2019 @05:05AM (#20798340)
This way or another, the IBM standard was authored in 1980s with major IBM systems (mainly MS-DOS and OS/2) in mind, and it has not aged nicely. Windows mostly went its own way. Keys like F1-F10, PrtScn, PgUp/PgDn have never been easy to find or use on laptops (or anywhere except 101-key keyboards). Start or Win modifier key, on the contrary, is universal, but Linux ignores it for the most part.

The only consistent system around is Mac OS X, where Cmd-C is universal copy, Ctrl-C stops the current program in terminal, Cmd-V is universal paste, Ctrl-V opens a vertical block in Vim, Ctrl-A goes to the beginning of the line, and Cmd-A selects all. This works anywhere, from browser to terminal.

Re:From Mac to Linux – the setup I've grown to love by sandGorgon on Monday August 26, 2019 @05:09AM (#20798348)
i have a Dell XPS 13 - its smaller than a macbook air. It has an insert key.

Whether you like it or not is your prerogative entirely. However, it is not true that Linux and Windows dont have a standard. They do. And the keys are universal (where universal has a different connotation to your usecase - we are talking non-Western countries and hardware that includes weird little keyboard to debug airplane display units)

You are fully entitled your choice+opinion whether you prefer a different one.

Re:From Mac to Linux – the setup I've grown to love by maratc on Monday August 26, 2019 @05:19AM (#20798383)
> Linux and Windows [do] have a standard.

The nice thing about standards is that you have so many to choose from.

This of course says nothing about whether this particular standard fits you. For me, having to keep a flag in mind whether I'm working in a terminal application (with one set of shortcuts), or GUI application (with a different set of shortcuts), is not acceptable, if I can have a setup where the same set works everywhere.

Re:From Mac to Linux – the setup I've grown to love by walshemj on Sunday August 25, 2019 @07:47PM (#20796435)
I just looked down at my Dell lap top and found the insert key with no problem
Re:From Mac to Linux – the setup I've grown to love by zapzupnz on Sunday August 25, 2019 @09:25PM (#20796830)
> It works for me!
Re:From Mac to Linux – the setup I've grown to love by jay_kyburz on Sunday August 25, 2019 @06:24PM (#20796013)
I've been using windows for 30 years and didn't know about Ctrl and Shift-Insert
Re:From Mac to Linux – the setup I've grown to love by brightball on Sunday August 25, 2019 @07:26AM (#20792368)
Why not just get used to the default CTRL + SHIFT + C instead of Super + C for use in the terminal?

When I switched over from Mac my initial thought was “get this working like my Mac”. After about a day that changed to “learn the Linux way.”

Switched 2 years ago and the only thing I miss after 10 years on OSX is OmniGraffle.

Re:From Mac to Linux – the setup I've grown to love by bitwize on Sunday August 25, 2019 @02:40PM (#20794669)
Because Ctrl is for sending control codes, Command is for issuing commands. You need to have one keystroke that means "copy", "paste", "print", help, etc. everywhere in the system.

Only macOS gets this right.

Re:From Mac to Linux – the setup I've grown to love by lightbulbjim on Monday August 26, 2019 @05:28PM (#20803974)
Isn’t Ctrl+UpArrow the default Mission Control shortcut?

I too prefer the MacOS copy/paste shortcuts, but I find that MacOS and Mac apps mix up Ctrl/Cmd just like other systems.

Re:From Mac to Linux – the setup I've grown to love by glandium on Sunday August 25, 2019 @07:54AM (#20792445)
What's annoying with Ctrl+Shift+C is that it's not the same as other applications, where it's Ctrl+C.

On Mac it's Command+C everywhere.

Re:From Mac to Linux – the setup I've grown to love by guntars on Sunday August 25, 2019 @08:54AM (#20792694)
This is my gripe too, as someone who’s recently switched back to Linux after a 10 year OSX hiatus. My current Linux system is designed and developed by thousands of developers who were just trying to get their stuff working for them, each of them working on a small piece. OSX has a lot more consistency because it was decreed by a few UX designers, alas, that is the price you pay for flexibility.
Re:From Mac to Linux – the setup I've grown to love by ageofwant on Sunday August 25, 2019 @09:55AM (#20792971)
You apply the consistency, you degree what you want. People decide to use Linux and still expect to be told what they want. Decide what you want and make it so, Linux is fundamentally a user-centric system and for it to work best it needs a creative guiding force in the middle: you, the user.
Re:From Mac to Linux – the setup I've grown to love by zapzupnz on Sunday August 25, 2019 @09:33PM (#20796857)
I'm not sure this really addresses the point. macOS manages to have both user-configurability for keyboard shortcuts and consistency out of the box.

On macOS, you can also define consistent keyboard shortcuts universally and per-application. This is achieved via a very simple interface in System Preferences -> Keyboards -> Shortcuts. This will apply to all applications because they must all respect and populate the macOS menu bar, the mechanism through which keyboard shortcuts and processed and thus made modifiable. Easy, friendly, user-centric.

But on Linux? Good luck. Between all the various user interface libraries with their own mechanisms for defining and modifying keyboard shortcuts, not to mention those apps that hardcode the shortcuts in order to avoid the utter mess of the mixed desktop environments that so many users are forced to use in order to get certain jobs done.

In this sense, Linux is not a user-centric system because nobody who makes a distribution, even the better ones, gives a toss about the user; it's all about the developer's manifestos and freedoms long before it's ever about the user. The average user who just wants to work, not sit there slaving over a billion different and wildly inconsistent configuration file formats each in different locations, who just wants the damned Copy command to require the same two-finger salute in one program as another, is resolutely not the one being catered for.

Linux distributions are just as opinionated as Windows and macOS; DIY distros are utterly irrelevant to the vast majority of people, including the HN crowd who, just like the technically illiterate we sometimes hold our noses up to, also have lives to live.

Re:From Mac to Linux – the setup I've grown to love by rzzzt on Sunday August 25, 2019 @09:42AM (#20792909)
Selecting text immediately copies it to the clipboard, and middle mouse button pastes. I think this works across terminal implementations.
Re:From Mac to Linux – the setup I've grown to love by lokedhs on Sunday August 25, 2019 @12:26PM (#20793818)
Just to nitpick. Selecting copies to the primary selection, not the clipboard. These are two separate places where data is stored.

Usually, pressing Control-c will copy the content of the primary selection to the clipboard.

Re:From Mac to Linux – the setup I've grown to love by rzzzt on Sunday August 25, 2019 @12:45PM (#20793920)
Ooh, I didn't know that. Thanks!
Re:From Mac to Linux – the setup I've grown to love by ufo on Sunday August 25, 2019 @08:38AM (#20792622)
On GNOME terminal you can remap the copy and paste commands to Ctrl+C and Ctrl+V. If you do this, you can use Ctrl+Shift+C to stop a running command.

I think some other terminal emulators might also let you do this.

Re:From Mac to Linux – the setup I've grown to love by ukj on Sunday August 25, 2019 @07:42AM (#20792414)
That gets your hand away from home row.

I have gone the other way. One of the thumb-buttons on my Ergodox EZ is"Super + C" makro. The other is "Super + V".

One-thumb copy/paste.

Re:From Mac to Linux – the setup I've grown to love by cycloptic on Sunday August 25, 2019 @07:32AM (#20792393)

  setxkbmap -option ctrl:swap_lwin_lctl -option ctrl:swap_rwin_rctl
Re:From Mac to Linux – the setup I've grown to love by shpx on Sunday August 25, 2019 @09:18AM (#20792790)
It's not as simple as swapping the keys. On macOS you use the "win key" for system shortcuts but you can also use the Ctrl key for emacs-style movement systemwide.

For example I can type Ctrl-b while editing the URL in the browser omnibar to move the cursor back a character or alt-b to move it back a word, just like you can in the terminal and then use "Win"-b to bookmark a page.

And your command changes the keys you use for moving the cursor in the terminal.

Re:From Mac to Linux – the setup I've grown to love by jbverschoor on Sunday August 25, 2019 @09:31AM (#20792848)
Yeah mac keybindings are pretty awesome, and there's a lot of not so obvious shortcts (keyboardwise, but also GUI)
Re:From Mac to Linux – the setup I've grown to love by cycloptic on Sunday August 25, 2019 @10:30AM (#20793169)
In GTK2 and 3, you can switch to the emacs key theme and then edit the files in /usr/share/themes/Emacs/ to have meta instead of ctrl. Alternatively, use a key rebinding daemon like https://github.com/snyball/Hawck to rebind the specific keys globally. Long-term I don't think this is worth it though because the programs are not built to support it like they are on a native Cocoa environment. You kind of just have to suck it up and get used to different key bindings in different environments.
Re:From Mac to Linux – the setup I've grown to love by shpx on Sunday August 25, 2019 @03:58PM (#20795134)
No one wants to fiddle with keybindings. Occasionally using Ctrl-c in the terminal (which forces me to redo my text selection or worse) or Ctrl-Shift-c in the browser (which brings up the dev tools that I have to close with Ctrl-Shift-i) is just the cost of using Linux.

MacOS's system is a better system that will never be adopted because there no will (just suck it up as you say), market pressure or authority that would impose it.

Re:From Mac to Linux – the setup I've grown to love by squiggleblaz on Monday August 26, 2019 @02:40AM (#20797899)
Well, that's not the cost of using Linux. It's one possible cost. I haven't ever done either because I use the primary selection (select is automatically copied, middle click dumps it at the pointer).

And when I can't or don't want to do that, I right click and choose Copy.

If I want to use another operating system - Windows or MacOS, it drives me batty that I have to keep going around copy pasting things.

I tend to agree with you that having a difference between Ctrl and Command is nice. But it doesn't actually solve the problem - it works _because_ MacOS is a minority, the last holdout.

In your web browser, Cmd-A will select all the available text but Ctrl-A will move your cursor to the start of the line. In your terminal, perhaps Cmd-A will select all the visible text but Ctrl-A will increment the number under the pointer (since you're running VIM in it).

If the Meta key hadn't died of death and Linux developers had kept expecting it to be around, there could also be clashes between Cmd and Meta.

Re:From Mac to Linux – the setup I've grown to love by cycloptic on Sunday August 25, 2019 @10:50PM (#20797099)
You (yes you) could patch the toolkits to do what you want right now, all the code is free and open source. But if you lack the will to do it, and see it as unimportant in the grand scheme of things... well maybe that's an indicator that the keybindings really aren't that much better and are mostly up to a matter of taste. I personally don't really care much for "market authorities" trying to force me to do things.
Re:From Mac to Linux – the setup I've grown to love by kps on Sunday August 25, 2019 @04:59PM (#20795546)
The one that gets me every day is ^W — erase word — against the handful of programs that refuse to let me configure that away from ‘close window’ (I'm looking at you, Chrome).
Re:From Mac to Linux – the setup I've grown to love by kps on Sunday August 25, 2019 @05:01PM (#20795554)
Is there any window manager that will automatically apply XKB options per-window?
Re:From Mac to Linux – the setup I've grown to love by cycloptic on Monday August 26, 2019 @07:40AM (#20798966)
You should be able to do that by scripting the focus event with xdotool, no window manager needed.
Re:From Mac to Linux – the setup I've grown to love by mandarg on Sunday August 25, 2019 @07:06PM (#20796226)
This has been my experience exactly.

I switched from Linux to OSX/MacOS around eight years ago, and the better and (to me) more intuitive modifier keys have been one of the features that have kept me there; along with the convenience of Emacs/Readline keybindings for text editing everywhere.

Getting keybindings to work the same way in Linux currently involves a Rube Goldberg setup of GTK3 key themes [1] and AutoKey [2] for me, and some things still don't work right (Super-W closing a single tab in Firefox/Chrome, etc.) Also, it looks like key themes are going away in GTK4 [3].

The Hawck daemon cited elsewhere in the conversation looks promising, maybe that'll work better.

[1] http://shallowsky.com/blog/linux/gtk3-emacs-key-theme.html

[2] https://github.com/autokey/autokey

[3] https://gitlab.gnome.org/GNOME/gtk/issues/1669

Re:From Mac to Linux – the setup I've grown to love by gricjeh on Monday August 26, 2019 @05:01PM (#20803728)
It’s weird to me to use Super to close a tab rather than for the desktop environment. Super is very consistent on my DE of choice: it’s not for application specific keyboard shortcuts, but for keyboard shortcuts of the window manager. That way there are never any collisions and things are easy to remember.
Re:From Mac to Linux – the setup I've grown to love by aplaice on Monday August 26, 2019 @06:48AM (#20798732)
> Super-W closing a single tab in Firefox

If, in about:config, you set ui.key.accelKey to 91, then Super-W will close a single tab (and Super-T will open a single tab etc.). This obviously won't work in Chromium, though.

Re:From Mac to Linux – the setup I've grown to love by elcritch on Sunday August 25, 2019 @02:31PM (#20794616)
I just installed Pop OS!, and while not perfect, it sets a lot of default super keys which you can turn off and set the super variants in Gnome shell, etc. Unfortunately I still haven't gotten emacs-like ctrl-a to work by default, though I've tried. Especially in Firefox which doesn't seem to follow any Gtk settings.
Re:From Mac to Linux – the setup I've grown to love by lightbulbjim on Monday August 26, 2019 @05:55PM (#20804184)
Gnome has an “enable Emacs key bindings” option which will enable readline shortcuts. Can’t remember whether it’s in settings or the tweak tool.
Re:From Mac to Linux – the setup I've grown to love by mellett68 on Monday August 26, 2019 @09:37AM (#20799757)
Interesting to read this. The reason I didn't get on with macOS is the extra modifier keys.

It was a relief when I didn't have to use a mac for work anymore.