Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)

share|improve this question

I did answer your question on SO:

However, for remote files (you may have to add a pattern to an autocommand that will match external filenames).

share|improve this answer

with % you can get info about file, example:

echo expand('%:p:h')
share|improve this answer
Could you provide some explanation about what your code does? You've only explained %... – Tom Wijsman Jul 12 '12 at 20:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.