Vim opens a new folder instead of the existing file with `set enc = utf-8` enabled

When I open a file with vim or gvim from a console in Windows that is in a subdirectory (for example, gvim subdir/file ), it creates a new file in subdir\subdir\file , saying "subdir\file" [New DIRECTORY] instead opening an existing file with subdir\file . Gvim directory issue

This happens since I added the following line to my vimrc:

 set enc=utf-8 

Is it possible to open and create files in UTF-8 mode on Windows without this problem? You can also see my vimrc file .

Thanks for any help.

+4
source share
1 answer

Change the order of the autochdir and encoding options in your vimrc. Install encoding first, then autochdir

 set enc=utf-8 set autochdir 

An explanation can be found here.

+6
source

Source: https://habr.com/ru/post/1332212/


All Articles