![How do I specify custom settings for vim based on file path](https://linux22.com/image/1290778/How%20do%20I%20specify%20custom%20settings%20for%20vim%20based%20on%20file%20path.png)
More specifically, I want to disable backup and swap file creation in vim, but only when opening/editing files that are on a specific remote volume or a specific folder.
So, how do I go about disabling/enabling a set of options when opening a file in a specific location (not depending on the filetype)
答案1
I did answer your question on SO: https://stackoverflow.com/questions/456792/vim-apply-settings-on-files-in-directory/456889#456889
However, for remote files (you may have to add a pattern to an autocommand that will match external filenames).
答案2
with %
you can get info about file, example:
echo expand('%:p:h')