ranger-users
[Top][All Lists]
Advanced

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

Re: Re: Re: Re: Re: [Ranger-users] is there a way to quickly "mark" by p


From: David Woodfall
Subject: Re: Re: Re: Re: Re: [Ranger-users] is there a way to quickly "mark" by pattern?
Date: Thu, 29 Apr 2010 01:41:46 +0100
User-agent: Mutt/1.5.19 (2009-01-05)

On (22:09 28/04/10), Roman Z. <address@hidden> put forth the proposition:
Well I just tried using the recode app but it doesn't change anything.
How would I go about specifying that in ~/mail all files should be
opened with mutt?

If ranger recognizes the filetype as "mail/<something>", you
could use:

        if f.filetype.startswith('mail'):

If it doesn't,.. you could check for the directory, yeah.

        import os.path
        if f.path.startswith(os.path.expanduser('~/mail')):

Yeah it seems my mboxes are seen as many different things with file so
I'm using the ~/mail idea for now.



By the way I also tried to implement a ':file' command, not very
successfully, to print filetype, but I'll make a new thread about that.

class file(Command):
        def execute(self):
                current_file = self.fm.env.cf
                self.fm.notify(current_file.filetype)

Great this works fine.

Many thanks. I am gradually learning python as I go it seems :)

you could also simply run this command:
:eval fm.env.cf.filetype



--
Don't look back, the lemmings are gaining on you.

Attachment: pgpNKskG0e9ki.pgp
Description: PGP signature


reply via email to

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