I am trying to execute some custom settings based on the directory on startup. For this I am trying:
autocmd VimEnter /path/to/dir/* :source /custom.vim
When I now execute:
cd /path/to/dir
vim
I would expect the config to have been loaded. This does not seem to work. However, this works:
autocmd VimEnter * :source /custom.vim
Is there a way to load a config once on startup based on the directory that vim was started in?
Note: I am aware of Applying settings to a directory tree only but would prefer to make it work this way.
if getcwd() =~# '/some/.*/path' | ...– B Layer Sep 29 '21 at 13:44~according to help – Maxim Kim Sep 29 '21 at 13:45if getcwd() == expand('~/temp') | source my.vim | endif– eclipse Sep 29 '21 at 13:50