Skip to content

Implement "operate-and-get-next (C-o)" #416

@mgalgs

Description

@mgalgs

One useful feature in bash is to go back in history, find a command you want to execute, and execute it, loading the next command. This is useful for repeating sequences of related commands that are often repeated together. It's bound to C-o in bash and zsh (and probably others).

You can see how it works in bash by running:

$ echo "going to tmp"
$ cd /tmp
$ echo "hello, world"

then hit C-p C-p C-p C-o C-o C-o (for a grand total of 6 keystrokes) to run those same three commands again.

Here's the description from BASH(1):

     operate-and-get-next (C-o)
          Accept  the current  line for  execution and  fetch the
          next line relative to the current line from the history
          for editing.  Any argument is ignored.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions