Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

(Sorry for bad English.)

Say, when I try to see binary file in less, it ask me a confirmation:

$ less `which less`
"/usr/bin/less" may be a binary file.  See it anyway? 

How to set up vim for the same behavior? Also I want to vim will ask a confirmation when I try to open too big (e.g. >10MB, maybe text) file.

share|improve this question

1 Answer 1

Vim doesn't have such option.

But you can write yourself a wrapper (let's call it vimwarp.sh) which could check the file size & type and ask you to open it anyway)

and if you want to do this nicely, you can write an alias for that command in your .bashrc

alias vim=vimwrap.sh
share|improve this answer
It is dirty solution. Vim has .vimrc and own powerfull language with autocommands, etc. I sure vim able to make all itself. –  Corvus Corax Nov 10 '12 at 18:04

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.