In all GUI text editors, web browsers and IDE’s you can move a cursor:

  • left/right arrows - move by char;
  • ctrl+left/right - move by word;
  • home/end - move to start/end of line.

Add Shift to any of above combination and everything you jumped through now is selected and you can: Ctrl+C, Ctrl+X,Delete to copy/cut/delete selection.

Also, you can Ctrl+Delete and Ctrl+Backspace to delete a next/previous word.

Also, you can Ctrl+Home/End to jump to start of first line or end of last line.

I want this to work when I type in a command in my Terminal.

Is it possible in Linux? It’s a vanilla experience in Windows+Powershell, thanks to default PSReadlLine extension. It works both in conhost.exe and in Windows Terminal, but doesn’t work in WT + cmd.exe, which makes me think it’s PSReadLine which is responsible for this technological perfection.

“But you can’t copy with Ctrl+C, it’s…” - You can. When something is selected It copies selection to clipboard, otherwise it sends SIGINT.

I’m not bound to any distro or terminal application, but right now I don’t see these incredible text editing techniques working even in Ubuntu+Powershell+PSReadLine, to say nothing about the Bash. I’ve tried installing WezTerm, but it doesn’t have text selection either, at least by default. And I’m inclined to think it has nothing to do with terminal emulators at all, since it works in conhost.exe+Powershell.

  • brax@sh.itjust.works
    link
    fedilink
    arrow-up
    2
    arrow-down
    2
    ·
    2 days ago
    • ctrl + left/right move by word

    I will forever hate the way vim moves by the start of the word and not the end of the word… The number of times I want to remove the last letter/s of a word at the end of a line and end up on the next line is too damn high.

    Also, don’t forget about ctrl + w to delete a full word.

      • brax@sh.itjust.works
        link
        fedilink
        arrow-up
        3
        ·
        2 days ago

        The problem is that I don’t think any of those work in Insert mode, and I hope I’m about to be proven wrong lol

    • Ignot@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      2 days ago

      It’s two clicks, but b then e takes you to the end of the previous word in neo/vi/m

      • brax@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        ·
        2 days ago

        Might have to set a custom keybind for that one to chain ctrl+right/ctrl+left to throw a :b e after

        Thx for the protip… Now all I need to do is learn how to quit it. 🤣

          • brax@sh.itjust.works
            link
            fedilink
            arrow-up
            3
            ·
            2 days ago

            Q q quit Quit QUIT x ex exit EXIT Exit EX X Leave leave LEAVE T terminate TERMINATE. SEND HELP

            Oh sorry, just pasting my vim window