Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is difference between :o and :e in vim when using these command to load a file into the buffer?

Tags:

vim

vi

I was watching an online tutorial by tutsplus , during one of the lessons, the teacher started to move between buffers using :bn :bn :b#, but he forget to mention how to load files into the buffer before talking about navigating between the buffers, I searched and find that using:e filename or :o filename would load a file into the buffer.

So, what is the difference , I can't understand the document explanation provide within vim.

like image 615
Eren Bay Avatar asked Jan 03 '23 03:01

Eren Bay


1 Answers

The difference is that you shouldn't use :o, which is a useless artefact of vi compatibility, and use :e (or one of its alternative) instead.

From :help :o:

Vim does not support open mode, since it's not really useful.  For those
situations where ":open" would start open mode Vim will leave Ex mode, which
allows executing the same commands, but updates the whole screen instead of
only one line.

Just… forget that command even exists.

FWIW, even the vi specification is pretty vague about what open mode is and does.

like image 179
romainl Avatar answered Jan 14 '23 10:01

romainl