ranger-users
[Top][All Lists]
Advanced

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

Re: [Ranger-users] clip file with mapping


From: Michael Longval
Subject: Re: [Ranger-users] clip file with mapping
Date: Tue, 16 Sep 2014 00:39:57 -0400

Yup good idea, 

:map yc clip %f

Works for me. 

Thanks.

Mike
On Sep 14, 2014, at 12:00 PM, address@hidden wrote:

> Send Ranger-users mailing list submissions to
>       address@hidden
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>       https://lists.nongnu.org/mailman/listinfo/ranger-users
> or, via email, send a message with subject or body 'help' to
>       address@hidden
> 
> You can reach the person managing the list at
>       address@hidden
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Ranger-users digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: Suggestion for added command (Hut)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sun, 14 Sep 2014 11:34:24 +0200
> From: Hut <address@hidden>
> To: address@hidden
> Subject: Re: [Ranger-users] Suggestion for added command
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset=utf-8
> 
> A simple key binding would be cooler in my opinion.  Something like
> 
> map yc cat %f | xsel -i
> 
> or for mac:
> 
> map yc cat %f | pbcopy
> 
> I wonder if xsel or xclip work on mac as well
> 
> On Fri, Sep 12, 2014 at 12:56:51PM -0400, Michael Longval wrote:
>> Hi there.
>> 
>> Enjoying ?ranger? very much. 
>> Integrates well with my MacOS/Homebrew/Vim/zsh/tmux stack.
>> 
>> I added a command to my .config/ranger/commands.py file:
>> 
>> from subprocess import call
>> 
>> class clip(Command):
>>    """:clip
>> 
>>    Copy the contents of file to Mac clipboard using /usr/bin/pbcopy
>>    """
>>    def execute(self):
>>        theFile = self.fm.thisfile.path
>>        theCommand = "cat " + theFile + " | /usr/bin/pbcopy"
>>        call(theCommand, shell=True)
>> 
>>    def tab(self):
>>        return self._tab_directory_content()
>> 
>> I know that this only works on MacOS, I guess that someone could just add a 
>> version for ?xclip?.
>> 
>> Thanks again for a great program.
>> 
>> Mike
>> address@hidden
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> Ranger-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/ranger-users
> 
> 
> End of Ranger-users Digest, Vol 47, Issue 2
> *******************************************




reply via email to

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