question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
randy3kcommented, May 19, 2018

By the way, in iPython 6, I need

from IPython import get_ipython

ip = get_ipython()
registry = ip.pt_cli.application.key_bindings_registry

handler = next(kb.handler for kb in registry.key_bindings if kb.handler.__name__ == "newline_autoindent")
registry.remove_binding(handler)
1reaction
mgalgscommented, May 15, 2018

For IPython it works, if they remove the custom binding for Control-O that they have.

For any future searchers, here’s how you can remove IPython’s Control-O handler so that you can get this Control-O goodness:

~/.ipython/profile_default/startup/20-keyboard.py:

from IPython import get_ipython
from IPython.terminal.shortcuts import newline_with_copy_margin


ip = get_ipython()
registry = ip.pt_cli.application.key_bindings_registry

registry.remove_binding(newline_with_copy_margin)
Read more comments on GitHub >

github_iconTop Results From Across the Web

getNext() Linked List - java - Stack Overflow
I am trying to take in a text file and store it into a linked list and I'm trying to access the third...
Read more >
Get Next Work feature | Pega Academy
Using the Get Next Work feature, your application can select the next assignment for a user. By choosing the best, most appropriate assignment...
Read more >
Product 1 – getNEXT
Managing, producing, review, approval and delivering content is easier than ever. With Content Suite's collaborative workflows, marketing, advertising, ...
Read more >
About us - IT Consultants in Melbourne and Sydney - getNEXT
getNEXT is an IT consulting company in Melbourne and Sydney specialising in enriching the value of technology, content and communication. Contact us today!...
Read more >
Free SNMP MIB Browser – ManageEngine Free Tools'
SNMP MIB browser is a complete tool for SNMP operation such as GET, Trap, Walk, GETNEXT and Set. You can also add and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found