80
submitted 1 day ago by [email protected] to c/[email protected]
top 10 comments
sorted by: hot top new old
[-] [email protected] 2 points 1 day ago* (last edited 1 day ago)

Now I have four ways to get to the begining and end of a command line. I can press Escape,^ or Ctrl+a for the begining of the line, and Escape,$ or Ctrl+e for the end of the line.

Bit suss on the ctrl-A start of line, because vim binding is A for append which is end of line.

[-] [email protected] 2 points 13 hours ago

Control-A and E should work in insert mode. That’s why OP mentions pressing escape before issuing the normal mode ^ and $ commands.

In insert mode, some or most of the EMacs-style shortcuts work.

[-] [email protected] 1 points 20 hours ago

Ctrl a and e are same as bash

[-] [email protected] 8 points 1 day ago

Ctrl +a and Ctrl +e for beginning and end of line are from Emacs.

GNU Readline is what provides them in the bash. There's a bunch of shortcuts worth learning in there!

Most distributions I've tried use Emacs as the default shell binding style, some of the bindings are even available in things like appliance cli's like Cisco IOS and clones.

Bash supports vi mode too, you just have to switch to it.

set -o vi

ZSH uses zle (ZSH Line Editor) instead of Readline, but I assume the Emacs style bindings have been copied over to zle for muscle memory portability. You can switch the keymap in zle,

bindkey -v

or set your own!

[-] [email protected] 1 points 1 day ago

I am aware, explained more in my other comment

[-] [email protected] 4 points 1 day ago

ctrl+a and ctrl+e are from Emacs.

[-] [email protected] 1 points 7 hours ago

Is there an emacs key to 'delete this entire word'?

like if I'm using ls to look for a file, then I want to cat a file, I press up to get the previous command, ctrl+a to go to the beginning of the line and then spam d to delete letters. It's be much better if there was a 'delete until whitespace' button.

[-] [email protected] 2 points 1 day ago

Yes but OP is using vi bindings for line navigation.

[-] [email protected] 1 points 1 day ago

Maybe I'm misunderstanding, but the commands would apply within the zsh, which is a bash alternative, not within the programmes running themselves?

Or are you saying its sus because its illogical/confusing to have opposite uses for tgebsame shirt cut? I can see that as people using a terminal and launching vim would constantly be working against "muscle memory" each time they switch which would be annoying! Being familiar with keyboard shortcuts is what can make terminal based workflows so fast.

[-] [email protected] 0 points 1 day ago* (last edited 1 day ago)

It was a little strange in the "line movement" part they were talking about setting vim navigation on the cmd line and then putting Emacs style as aliases, of which I said it's a bit suss as it's too close to vim append.

this post was submitted on 07 Jun 2025
80 points (97.6% liked)

Linux

54950 readers
602 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS