1 # This plugin adds opened files to `fasd`
3 from __future__
import (absolute_import
, division
, print_function
)
8 from ranger
.ext
.spawn
import check_output
11 HOOK_INIT_OLD
= ranger
.api
.hook_init
16 for fobj
in fm
.thistab
.get_selection():
18 check_output(['fasd', '--add', fobj
.path
])
19 except subprocess
.CalledProcessError
:
21 fm
.signal_bind('execute.before', fasd_add
)
22 return HOOK_INIT_OLD(fm
)
25 ranger
.api
.hook_init
= hook_init