[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ranger-users] Size a factor in selecting a viewer/editor?

From: niku
Subject: Re: [Ranger-users] Size a factor in selecting a viewer/editor?
Date: Thu, 21 Nov 2013 15:09:02 +0530
User-agent: Mutt/1.5.21 (2010-09-15)

Ranger opens the file in the text editor when it “knows” that it is a
text file. It knows this by checking if the output of the following
command starts with a ‘text’ (e.g., if it is ‘text/plain’).
        file --mime-type -Lb "$path"

So check the output of the previous command for the odd file. You
probably have some binary control characters in the file, so the
output of the previous command is something other than text/*. 

The command is mentioned in data/scope.sh. The test is mentioned in

On Wed, Nov 20, 2013 at 05:07:21PM -0800, Gary Johnson wrote:
> I often use ranger to browse log files and type 'l' when I want to
> open the currently-selected one in vim.  Today I did that and was
> presented with an ":open_with " prompt.  Puzzled, I selected a log
> file with the same name but in a different directory and it opened
> without the prompt.  The only thing I can see that is special about
> the file that raised the prompt is its size:  it's over 16 MB
> whereas the files that opened without the prompt were all 2.4 MB or
> less.
> Is there some threshold file size over which ranger prompts for the
> editor/viewer?  Can that threshold be changed?
> Thanks,
> Gary

reply via email to

[Prev in Thread] Current Thread [Next in Thread]