J
J
JZorkiy2019-02-21 01:29:55
vim
JZorkiy, 2019-02-21 01:29:55

vim. Is it possible to open a file under the cursor in an adjacent window?

Vim is divided into 2 windows. The left one has the current directory open (:e .) and the cursor is hovering over the name of a file in that directory. If you press ENTER, this file will open in the same (left) window. How to make it open in the right window, and the list of files would remain in the left one?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2019-02-21
@JZorkiy

How to make it open in the right window, and the list of files would remain in the left one?

You can execute let g:netrw_preview = 1and click on the file of interest pinstead of ENTER. In this case, the preview window for the file under the cursor will open to the right of the list of files, and the cursor will remain in the left window. The next click pwill replace the content of the preview with the file under the cursor.
In addition p, there is v. And besides, F1in the list of files opens help on the topic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question