3

I am aware of Ctrl+L on bash terminal (using it on Ubuntu) which clears the screen by applying appropriate scrolling on bash terminal.

After learning that the terminal is by default set to emacs mode and that I have been using vim on the rest of my programming life, I wanted to shift to vi editing mode on terminal by using: set -o vi.

But it seems there is a learning curve here too. Here is my simple question:

How to clear the terminal in vi mode?

On a parallel note, am I right if I assume that every (at least the most used) command in emacs mode has equivalents in vi mode?

Clarification of similarity:

There seems to be a similar question -- Is there any way to enable Ctrl+L to clear screen when 'set -o vi' is set? Which asks to force Ctrl+l as well to work in vi mode.

But clearly, it doesn't clarify whether is an existing/default way of clear-screen operation, in vi mode!! So, I reckon its a different question.

P.S. : Update:

As @Gilles pointed out, the Ctrl+L seem to work in command mode of vi style editing. That means we have two possible ways to clear the screen of a terminal in vi mode:

  1. From the default insert-mode, we should press Esc to move to command-mode and then use Ctrl+L.

  2. Use the answers in Is there any way to enable Ctrl+L to clear screen when 'set -o vi' is set? to get Ctrl+L working directly in insert-mode

My current question requests to explain any method other than the two, possibly native to insert-mode.

  • I don't understand the question. Ctrl+L works in vi mode as well. but by default only in command mode. The other question explains how to make it work in insert mode as well. So what's left? – Gilles 'SO- stop being evil' May 27 '15 at 22:14
  • Thanks for the response, @Gilles! I just want to know whatever is available in vi mode **by default**.. without any hassle of modifying it to something like Ctrl+L. Is n't that different from what is asked in other [question](http://unix.stackexchange.com/questions/104094/is-there-any-way-to-enable-ctrll-to-clear-screen-when-set-o-vi-is-set?lq=1)? :( – Loves Probability May 29 '15 at 12:34
  • Ctrl+L *is* available in vi command mode by default. Nothing is available in vi insert mode by default. Ok, the other question only states that it isn't Ctrl+L, not that there isn't another binding, but do we really need another question just to state that there isn't another binding? – Gilles 'SO- stop being evil' May 29 '15 at 13:49
  • @Gilles Ctrl+L is indeed available for command mode it seems, as I just verify on my Ubuntu 14.04LTS. But how can one know that there is *nothing else* from an answer dedicated to make Ctrl+L work for insert mode!! Please don't see the how big/small my question is, rather I request you to see just whether the question has an available answer or not. Also, I request you to please post your response as an answer so that others can upvote and discuss. – Loves Probability May 29 '15 at 13:56
  • There, it's explicitly stated in the question now. We've wasted far more time on this than it would have taken for you to read the manual. – Gilles 'SO- stop being evil' May 29 '15 at 14:14
  • @Gilles Can you point me the manual please? – Loves Probability May 29 '15 at 14:16

0 Answers0