[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-nano] prevent nano from opening large files
From: |
Benno Schulenberg |
Subject: |
Re: [Help-nano] prevent nano from opening large files |
Date: |
Thu, 19 Jun 2014 10:11:12 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 |
Hello Frank,
On 2014-06-12 09:18, Frank Schwenk wrote:
> i just made a huge mess as i had a large file open with "less" and
> by pressing "v" accidentially i started the edit mode, which in
> this case started nano.
>
> Is it possible to prevent nano from opening large files?
> (.nanorc, environment)
You can't stop nano from opening any files that you give it, but you
can prevent 'less' from calling nano directly. You could set the
environment variable EDITOR or VISUAL or LESSEDIT (see man less) to
the name of a script, and let this little script check the size of
the file and from this size let it decide whether to open it or to
print "No no".
Cheers,
Benno