Logo Questions Linux Laravel Mysql Ubuntu Git Menu

is there a way to exit the modeless vi without closing the window?

As being a beginner, I started learning some new command options about vim and while trying the Modeless vi by typing the command vim -y [name of the file to edit] I didn't found a way to come back to the terminal but closing it.

I know that the command above run vim in insert mode without permiting the command mode but my question is there any way to exit vi while staying in the same terminal?

like image 872
Meninx - メネンックス Avatar asked Mar 15 '23 13:03

Meninx - メネンックス

2 Answers

CTRL-L puts vim back into normal mode. Then :q to quit or :q! to quit without saving.

like image 60
A. Andres Avatar answered Mar 23 '23 21:03

A. Andres

Vim's "easy mode" is a very different beast than regular Vim/Vi. Easy mode goes out of it's way to try and make Vim modeless which is heresy as far as I am concerned.

If you do want to learn some Vim commands then I suggest you take 20 minutes or so and run vimtutor. It will teach you the some basic Vim commands. I would also suggest making a cheat sheet if you are having a hard time remembering the commands or go through vimtutor again. As always the Vim documentation is there via :h.

like image 24
Peter Rincker Avatar answered Mar 23 '23 23:03

Peter Rincker