A Ranger plugin/script collection that adds cross support for macos Finder and mpv player. Uses Finder to preview virtually anything, the rest depends on quicklook plugins you use. Or mpv player for instant playback of video files and image previews.
- Follow selection in Finder. Useful with Gallery view mode (Command+4 in Finder).
- Reveals selected file from active Finder window to Ranger.
- Reveals selected files from Ranger to Finder.
- Toggle synced red tag on selection in Finder and Ranger.
- Toggle instant playback or image preview through mpv.
- Synced playback of selected video files (up to 4) through mpv.
- Add the contents of commands.py to your
~/.config/ranger/commands.py
file. - Copy fplug.py and termplug.py to ~/.config/ranger/plugins
- Copy executables to somewhere in the $PATH(If you don't know: /usr/local/bin/).
- Install dependencies:
brew install tag mpv iterm2
(If you are using another terminal application, then change iterm in the scripts to desired manually.) - Copy setting for mpv from mpv.conf to
~/.config/mpv/mpv.conf
- Add key maps to your
~/.config/ranger/rc.conf
- Grant permissions in
System Settings > Privacy & Security > Accessibility
toiTerm
andosascript
map <Space> findger # Toggle followed file preview through Finder
map <alt>/ finder_show # Show selected files in Finder
map <alt>? finder_get # Go to path of the front Finder window
map ' red_tag # Mark file red in ranger and Finder
map <a-i> finder_info %f # Open Finder's file info on selection
map p findger_mpv # Toggle instant video playback / Image previews with mpv
map ms shell mpv-play-synced %p # Play in sync up to 4 selected video files
Todo: Add better cross support for Finder's color tags.
Inspired by termplug