9 ms·
Apropos of the shortcuts here, I always wonder why developers don't go out of their way more often to memorize the Ctrl+C, Ctrl+V, ... shortcuts in use basicall
by hiAndrewQuinn 1y ago
Apropos of the shortcuts here, I always wonder why developers don't go out of their way more often to memorize the Ctrl+C, Ctrl+V, ... shortcuts in use basically everywhere today except the terminal. I believe they stem from the IBM Common User Access (CUA) design standard.
In particular the fact that Ctrl + anything letter-oriented makes something that is word-oriented instead, for example Ctrl + Left Arrow and Ctrl + Right Arrow let you skip word-by-word in documents, and Ctrl + Backspace lets you delete entire words at a time. This feels like it should be way more common knowledge than it is, like how copying and pasting any multiline document into your browser's URL bar will almost certainly format it into a sane single-line format.
- slashdave 1y ago> Ctrl+C, Ctrl+V You mean CMD+C and CMD+V, right?
- smokel 1y agoThere are even developers who do not learn to touch type. Baffles the mind. Making Caps Lock an additional Ctrl, and using Emacs keybindings (supported in nearly every IDE and on many command lines) makes one even more productive, because your hand doesn't have to travel all the way to where the arrow keys are. (A similar thing can be said about Vi keybindings.) It is a strange phenomenon that many people do not wish to invest a few hours to make their lives easier later on.
- croemer 1y agoYeo. I map capslock to Esc and use vi bindings.
- spauldo 1y agoIt baffles my mind that a lot of schools don't even offer keyboarding anymore. I took it in high school, and I was fortunate to be born late enough that being male wasn't a barrier (only girls could take it when my parents were in school) but early enough that they offered it at all. Out of all the skills I learned in high school, it's probably the one I use the most.
- int_19h 1y agoIt takes way more than a few hours to get used to a new setup like that when you're already very proficient in something else (like using arrow keys). As for Caps Lock, some of us have good reasons to have it mapped to something else that needs to be done frequently, e.g. switching keyboard layouts.
- culebron21 1y agoBecause on Ubuntu, they're Ctrl+SHIFT+C/V/X. I've seen Ctrl+C/V not work, and assumed that Bash didn't implement it at all. I've learned the right way casually about 7 years into using Ubuntu.
- tzot 1y agoCtrl-Shift-C/V/X are not implemented in bash; it's the terminal emulator program that handles these. So the default terminal emulator of Ubuntu (gnome-terminal I assume, but ICBW) knows about a “system” clipboard and copies stuff to it and on paste feeds bash with the copied data. If you press Ctrl-Alt-F1 (and F2, F3, depends on your distribution's defaults) you can login and in your login shell, which I understand is bash, Ctrl-Shift-C/V/X have no difference to shiftless Ctrl-C/V/X.
- spauldo 1y agoWhen you press CTRL and a letter or symbol at the terminal, shift doesn't do anything (unless it's required for the symbol, as in CTRL-@). The code that gets sent is the same either way. Emacs users have to be wary when setting custom keybindings because GUI Emacs can see the difference but terminal Emacs can't. Likewise, ALT just sends ESC assuming you're using the standard US keymap.
- financypants 1y agoi use ctrl + <key> quite often but didn't know about ctrl + backspace! Also, I think mac's cmd + shift + left arrow or right arrow work so well.
- kgwxd 1y ago> developers don't go out of their way more often to memorize the Ctrl+C, Ctrl+V I get freaked out enough seeing devs that can't touch type. Now you're telling me there's a large number that also don't know the copy/paste shortcuts!?
- petepete 1y agoAlso the number who click around to position the cursor when they could hold ctrl and skip there in a fraction of the time. Same goes for shift and highlighting.
- vintermann 1y agoThere are old studies from the 70s showing that moving the cursor with mouse is faster than navigation keys. Tog famously claimed that Apple's internal studies consistently showed that mouse felt slower than it actually is, whereas keyboard navigation felt faster.
- hbnjgf 1y agoI guess it depends on the distance. If you are currently typing and need to get to the beginning of the word, obviously it's way faster to navigate using the keyboard than the mouse. If instead you need to navigate somewhere you don't exactly know the location of, scanning and clicking is faster. Then again, if you happen to know the exact location, going there by command is much faster
- fc417fc802 1y agoSelecting text is also a good example where the mouse is faster. One of the few for me. Having to switch modes, move to a line, then move to a character, then repeat that, is quite cumbersome in comparison. I'll take good keyboard controls for pretty much anything else though.
- skydhash 1y ago
- jasonjayr 1y agoEons ago, Ctrl-C was mapped to 'Break' on various terminals, which will halt the running program, and was a useful function. Desktop/GUI's mapped Ctrl-C to (C)opy, since the mnemonic made way more sense, and interrupting a GUI program hard like Break tends to do was not very useful.
- yoz-y 1y agoThis is where I find cmd+c/v better. It just works everywhere. On windows win+v works, not sure if win+c does, it’s been a while.
- bmacho 1y agoWin+c works too on windows. So does ctrl+insert/shift+insert on the terminals I just tested (cmd.exe, microsoft terminal with tabs, git bash, blue powershell terminal). Win+c/win+v looks like a good compromise, using the Windows button for OS/DE commands, instead of application commands.
- fc417fc802 1y agoAlso worth noting that many other ctrl-letter combinations map to signals in the terminal. In all the terminal emulators that I've used shift-ctrl-c & co are mapped by default for clipboard operations.
- 1y ago
- kule 1y ago“Except the Terminal”… Of course in the Mac you have the same shortcut in every app because you use cmd+c/v It really bugged me that by default you use ctrl+shift+c/v on Linux but only in the terminal. Found a lovely feature in kitty term that does the right thing for ctrl+c depending on if you have text selection or not. Works great for me.
- hbnjgf 1y agoUnless you are not using X, selected text us also automatically available for copy using the middle mouse button
- sureglymop 1y agoActually, on macOS you have the same shortcuts as gnu readline in any text editing field. You have these same shortcuts in bash, zsh, the python repl, html form fields, etc. And anything that doesn't use gnu readline can be wrapped in rlwrap. Note that copying and pasting is an exception. Otherwise, navigating words with shortcuts seems to fairly universally use these shortcuts.
- culebron21 1y agoMy experience on MacOS is that every program has different shortcuts regarding text editing. Home/End/PgUp/PgDn on my external keyboard just not working, and if added to system settings, they still don't work in some apps, Ctrl+Left sometimes working sometimes not, etc. And what Ctrl/CMD/Shift keys do together looks very random, no logic in it. Like, Ctrl+Left in Zsh scrolls the entire log to top, rather than move the cursor to the start of the line. I use zsh, slack, Chromium, SublimeText and Zed on Mac.
- kule 1y agoYep, which is really handy. I was specifically talking about copy and paste shortcuts being the same even in the terminal though.
- MangoToupe 1y agoThey're really emacs keybindings that readline adopted if I may be allowed a small amount of pedantry.
- meindnoch 1y agoWhat do you mean? Ctrl+C is SIGINT. Copy is Cmd+C.
- fc417fc802 1y agoWhat's cmd? I've only got ctrl, alt, super, and hyper over here. /s I guess I've also that useless "right click menu" keyboard button that's not even worth repurposing for anything due to the placement making it incredibly awkward to use. I'd be curious to know if anyone here actually uses the ctrl or alt keys that are located on the right.
- int_19h 1y agoThe "right click menu" keyboard button is surprisingly useful if you ever happen to be in a situation where you need to deal with a GUI app without a mouse. Although these days, chances are good that some things will not be accessible at all, because many devs these days just don't care to do even the basics like submitting dialogs on Enter properly. Historically, though, Windows at least was very thorough in making sure that everything GUI could be operated entirely from keyboard. Much of that is still there, just increasingly obscure - e.g. few people know that Alt+Space will open the same menu that you can get by clicking the window icon in the title bar (the one with Maximize, Minimize, Move, Size etc). Even fewer know that when you pick Move or Size from that menu, you can use the arrow keys to move and resize the window.
- orthoxerox 1y agoI used to use them back when Ctrl-Alt-Del was something you had to press daily.
- mkotowski 1y agoMany keyboard layouts use the right alt as the AltGr key for additional characters like language-specific letters or currency symbols (or at least many European ones do). As for the right ctrl, by association with the AltGr, I usually map it as the Compose key.
- mprovost 1y ago
- muixoozie 1y ago> like how copying and pasting any multiline document into your browser's URL bar will almost certainly format it into a sane single-line format. Didn't know that. I learned the other day that one can paste a password into the URL bar and drag it to a password field on the website that's annoyingly blocking paste (on Firefox at least). Probably a bad idea for security reasons (telemetry?). Just found it surprising. Also noticed many crappy sites that block paste will forget to block Ctrl + insert or Ctrl + Shift + v. I usually don't have this problem because the plugin of my password manager usually works..
- diggan 1y ago> Didn't know that. I learned the other day that one can paste a password into the URL bar and drag it to a password field on the website that's annoyingly blocking paste (on Firefox at least). Probably a bad idea for security reasons (telemetry?). You could probably drag it directly from the password manager to the password field, instead of using the URL bar as an intermediate (which indeed is a bad idea as whatever you enter there usually gets sent somewhere).
- enricozb 1y agoSince I do not really use Ctrl-X on the terminal to cut text, I have changed my terminal configs to have Ctrl-X be sigint, and Ctrl-C to be copy. Makes for a nicer experience, also X looks more like a "kill" :)
- adastra22 1y agoThat makes way more sense.
- mixmastamyk 1y agoNice, but eons of muscle memory to retrain. :-/
- physicles 1y agoWow, in 7 years of daily Linux use, I somehow never thought of doing this. Thank you. ~/.bashrc: stty intr ^x ~/.inputrc (at the end): "\C-v": "" # Unbind Ctrl-V ~/.config/terminator/config (in case anyone happens to be using terminator): [keybindings] copy = <Control>C paste = <Control>V
- dotancohen 1y agoI used to do similar bindings, but one mistype of muscle memory on somebody else's box, or in an SSH session, will teach you not to do that. Do you want to be productive on your own snowflake system, or employable?
- kevin_thibedeau 1y agoIBM didn't invent this scheme. Apple Lisa had Cmd+X,C,V. Early Mac apps switched to K,C,V but obviously they switched back at some point.
- scelerat 1y agocmd-K for Cut? I don't ever remember that on the Mac. I remember the lower left row on the US keyboard was always the first four operations from the nearly-ubiquitous Edit menu since day one. Z - Undo X - Cut C - Copy V - Paste Certainly not the flagship apps from Apple. Can you remember an app that did this specifically? I seem to remember even early apps from Microsoft were fairly respectful of the early Mac HIG Early apps frequently also had "Clear" in the Edit menu, which was like Cut except the cleared item didn't go into the system Clipboard
- teddyh 1y ago> IBM didn't invent this scheme. Ctrl-X, Ctrl-C and Ctrl-V isn’t even part of the IBM CUA specification. CUA places the Cut command at Shift-Del, Copy on Ctrl-Insert, and Paste on Shift-Insert.
- jonhohle 1y agoThis has always been one of my favorite aspects of macOS (né OS X). GUI app shortcuts and Terminal control sequences are mutually exclusive where it matters and shared where it’s convenient. I find it very natural to navigate text in any app. I find it surprising that no Linux window manager has taken this approach.
- BiteCode_dev 1y agoMost terminal now accept ctrl + shit C/V as an alternative on linux.
- MangoToupe 1y agoThey could also not use Ctrl for gui keybindings and join the 21st century
- mixmastamyk 1y agoVery rare to have a Mac keyboard with Cmd on it on a PC. Only common on a Mac with Linux. There it can be reprogrammed but yes, should be better.
- int_19h 1y agoIf you connect an Apple keyboard to a PC, you'll find out that Cmd is the same as the Win key.
- mixmastamyk 1y agoIC, though the Win key has useful shortcuts assigned as well. But I suppose they could be sacrificed and/or remapped.
- rz2k 1y agoIt started with “System Software” or “Mac OS” (as opposed to “macOS”), since it was an advantage of using terminal software like ZTerm on the pre-OS X operating system. You could select and copy text without unintentionally sending a break.
- cxr 1y ago> I always wonder why developers don't go out of their way more often to memorize the Ctrl+C, Ctrl+V, ... shortcuts in use basically everywhere What developer doesn't have these shortcuts memorized? It sounds like you're living in some bizarro world.
- skydhash 1y agoI know devs that still right click for copy and paste.
- cxr 1y agoI don't know what function the word "still" is intended to perform in this sentence. I, too, copy and paste using the context menu—sometimes, i.e.: when it is most appropriate and/or convenient to do so. But the question is: what developers don't know about the standard keyboard shortcuts for copy and paste? Do they exist in any statistically significant numbers? ("There exists X" is not a very meaningful contribution if the Xs involved are something like 0.01% and are outnumbered by the number of programmers who write all their code on their mobile phone or whose version control strategy is to inscribe all their programs on a Tic Tac or a grain of rice or who think that Commodore 64-inspired homegrown operating systems are specially positioned to reveal the Word of God and offer protection against being pursued and persecuted by the CIA. Or are these some special breed of 9-to-5 darkmatter programmers who aren't going to show up on the radar, anyway?)
- jayd16 1y agoIts safer in an unfamiliar terminal than accidentally killing the app with Ctrl-c.
- 3eb7988a1663 1y agoI also criss cross enough different terminals and systems that I never know if it is Ctrl-C or Ctrl-Shift-C. Same with paste.
- 1y ago
- MangoToupe 1y agoOh so IBM is to blame for the worst keybindings imaginable
- layer8 1y agoThe CUA bindings for Cut, Copy, Paste are actually Shift+Delete, Control+Insert, Shift+Insert. Microsoft adopted the X/C/V shortcuts from the Macintosh for Windows 3.0 (replacing Command by Control; Alt was already used for invoking menus and the like), in addition to the existing CUA shortcuts (which are still supported and used today).