dotfiles

My dotfiles used for LARBS
Log | Files | Refs | README | LICENSE

commit 29bee71d652cd62190b4934817ee227a6f9340d2
parent fc3aae4235b0f5acb29aa51b9342cd2c4554ad17
Author: Sean Breckenridge <seanbrecke@gmail.com>
Date:   Mon, 16 Dec 2019 05:22:14 -0800

make fzf_bring do what it should do (#434)

also removed a few unnecessary imports
Diffstat:
M.config/ranger/commands.py | 20++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/.config/ranger/commands.py b/.config/ranger/commands.py @@ -6,6 +6,7 @@ # You always need to import ranger.api.commands here to get the Command class: from ranger.api.commands import * +from ranger.core.loader import CommandLoader # A simple command for demonstration purposes follows. #------------------------------------------------------------------------------ @@ -88,6 +89,8 @@ class fzf_select(Command): self.fm.cd(fzf_file) else: self.fm.select_file(fzf_file) + + # fzf_locate class fzf_locate(Command): """ @@ -114,6 +117,7 @@ class fzf_locate(Command): else: self.fm.select_file(fzf_file) + class fzf_bring(Command): """ :fzf_bring @@ -124,6 +128,7 @@ class fzf_bring(Command): """ def execute(self): import subprocess + import shutil if self.quantifier: # match only directories command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \ @@ -136,14 +141,8 @@ class fzf_bring(Command): stdout, stderr = fzf.communicate() if fzf.returncode == 0: fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n')) - if os.path.isdir(fzf_file): - self.fm.cd(fzf_file) - else: - self.fm.select_file(fzf_file) - + shutil.move(fzf_file, self.fm.thisdir.path) -import os -from ranger.core.loader import CommandLoader class compress(Command): def execute(self): @@ -176,11 +175,6 @@ class compress(Command): return ['compress ' + os.path.basename(self.fm.thisdir.path) + ext for ext in extension] - - -import os -from ranger.core.loader import CommandLoader - class extracthere(Command): def execute(self): """ Extract copied files to current directory """ @@ -212,5 +206,3 @@ class extracthere(Command): obj.signal_bind('after', refresh) self.fm.loader.add(obj) - -