Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

(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

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 Nov 10 '12 at 18:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .