ranger-users
[Top][All Lists]
Advanced

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

Re: [Ranger-users] Suggestion for added command


From: Hut
Subject: Re: [Ranger-users] Suggestion for added command
Date: Sun, 14 Sep 2014 11:34:24 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

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



reply via email to

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