Linux文件管理器ranger
itgoyo opened this issue · comments
详细教程请参考:https://linux.cn/article-1995-1.html#3_3958
Unpack the archive, enter the directory and run ranger:
tar xvf ranger-stable.tar.gz
cd ranger-stable
./ranger.py
If you want to conventionally install it, for example for a multi-user system, you can run this command:
sudo make install
然后终端ranger,即可打开文件管理器
键盘右键->
为打开的意思,浏览图片的时候可以使用改键,来预览图片
详细到底有多酷,可以自己点开此链接观看youtube
<iframe width="560" height="315" src="https://www.youtube.com/embed/nlolvAVqn10" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>配置ranger:
默认如果找不到配置文件,要先执行以下命令
ranger --copy-config=all
在/home/用户名/.config/ranger文件夹下有一系列配置文件。启用文件预览功能,需要先打开rc.conf文件
找到“set use_preview_script”一行,将其值设为“true”。本设置将启用scope.sh脚本,用于各种文件的预览;
找到“set preview_script”一行,将其值设为“~/.config/ranger/scope.sh”,为预览功能指定脚本文件;
找到“set preview_images”一行,将其值设为“true”,本设置启用对图片的预览功能;
找到“set preview_images_method”一行,将其值设为“w3m”,表明是用w3m作为图片预览的工具。
更多详细设置请参考:http://blog.sina.com.cn/s/blog_69e5d8400102wp2k.html
如果在使用w3m
的过程中出现缺少w3mimgdisplay
的时候可以使用一下命令行来安装
sudo apt install w3m-img
In Ranger, you can choose a program to open a file based on its extension. For example, to open a JPEG file with Feh image viewer, add this line at the top of rifle.conf:
ext jpg = feh "$@"
After the specific file associations, I like to have a rule to catch all the rest of the files and open them using xdg-open:
has xdg-open, flag f = xdg-open "$1"
Mac相关的可以参考
https://github.com/johngodlee/ranger_rifle_conf_tut/blob/master/ranger_rifle_conf_mac.md
https://unix.stackexchange.com/questions/219765/open1-in-rifle-conf-for-ranger-on-os-x
https://unix.stackexchange.com/questions/381499/ranger-what-program-is-opening-file