Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exit Ex mode in vim (typing :visual does not work)

Tags:

vim

I don't know how to exit Ex mode in vim. I think I tipped something that is still open and don't know how to close it:

<uments/LeWagon/Teacher_Lessons theory.rb                                                                                                                                            
Entering Ex mode.  Type "visual" to go to Normal mode.
:w
"theory.rb" 22L, 472C written
:i
:w
:q
visual
:visual
visual
^W^W^W^W^K^W
kj^W
exit
:exit
:visual
visual

Thanks

like image 401
AlbertMunichMar Avatar asked Oct 04 '18 22:10

AlbertMunichMar


People also ask

How do I exit EX mode?

The ex mode is an extension of command mode. To get into it, press Esc and then : (the colon). The cursor will go to the bottom of the screen at a colon prompt. Write your file by entering :w and quit by entering :q .

How Force Quit Vim?

TL;DR – How to Exit Vim If you didn't make any changes, type :q and press Enter / return. If you made some changes and would like to keep them, type :wq and press Enter / return. If you made some changes and would rather discard them, type :q! and press Enter / return.

How do I exit vim in terminal?

You can press the Esc key. Type SHIFT Z Z to save and exit. Type SHIFT Z Q to exit without saving.

How do I exit VI in github?

More Command Options to Quit Vim:q – exit Vim. :q! – exit Vim and discard any changes. :wq – saves the changes, and exits Vim.


1 Answers

You got into insert mode inside Ex mode with :i, so you need to leave it with a line containing only a period:

.

Then :visual will work.

In other words: Enter . Enter v i s u a l Enter. ^C should also work, i.e. Ctrl+C v i Enter.

like image 156
Ry- Avatar answered Oct 20 '22 08:10

Ry-