How do I specify custom settings for vim based on file path

5

1

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)

Roland Tepp

Posted 2011-09-28T07:46:15.093

Reputation: 231

Answers

2

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).

Luc Hermitte

Posted 2011-09-28T07:46:15.093

Reputation: 1 575

-1

with % you can get info about file, example:

echo expand('%:p:h')

juanpablo

Posted 2011-09-28T07:46:15.093

Reputation: 5 216

Could you provide some explanation about what your code does? You've only explained %... – Tamara Wijsman – 2012-07-12T20:55:31.953