Entering "vi mode" in gnome-terminal
I use ssh -X user@IP
to connect to an Ubuntu Server which has had gnome-terminal
installed on it.
When inside gnome-terminal
, occasionally I accidentally hit a key combination and the terminal behaves differently. I think I have entered "vi mode". As an example, after I have hit this mysterious combination, I can press - and the font size of the terminal gets smaller.
I have to press ESC to get back into the normal mode.
Can anyone tell me what key combination I may have hit, and provide links or useful hints for the things I might be able to do with "vi mode"?
I have tried searching Google but haven't found anything particularly good - most pages refer to "vi mode" inside vi.
For information, I am using a French AZERTY keyboard, and the key combination I think I hit is AltGr+- (on AZERTY keyboards the number keys provide punctuation unless Shift is pressed - the key I am pressing has the 6 on it), so that I can get the |
character.
Usually vi
mode is set in bash with set -o vi
.
By default, and contrary to the editor itself, you will be in insert
mode.
You can hit ESC and i to move between insert and command mode.
When you enter a line in vi mode, you are already placed in `insertion' mode, as if you had typed an "i". Pressing ESC switches you into "command" mode, where you can edit the text of the line with the standard vi movement keys, move to previous history lines with "k" and subsequent lines with "j" and so forth.
(from linuxselfhelp )
To go to the default mode, use set -o emacs
.
According to this question , you can toggle out of emacs mode (and back) with Meta+Ctrl+J . But I can't get that to work on my keyboard (perhaps because I'm not sure what Meta is mapped to).
Here's a link with some editing commands : hyperex.org : vi mode .
Here's another link to a cheat-sheet type reference : catonmat.net .