Ubuntu18.04安装终端文件管理器ranger


linux环境下终端的文件管理器ranger的安装:

github下载地址:

https://github.com/ranger/ranger

安装:

pip install ranger-fm

启动ranger:

配置初始化:

ranger --copy-config=all

安装代码高亮组件:

sudo apt install highlight

安装图片预览的浏览器:

sudo apt install w3m-img

安装HTML预览组件:

sudo apt install w3m

安装窗口动态渲染组件:

sudo apt install compton

PDF文件预览组件安装:

 sudo apt install poppler-utils

 修改预览配置文件:

~/.config/ranger/scope.sh

        ## PDF
        application/pdf)
            pdftoppm -f 1 -l 1 \
                     -scale-to-x "${DEFAULT_SIZE%x*}" \
                     -scale-to-y -1 \
                     -singlefile \
                     -jpeg -tiffcompression jpeg \
                     -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \
                && exit 6 || exit 1;;

修改配置文件:

~/.config/ranger/rc.conf

显示git的文件状态:

# Be aware of version control systems and display information.

set vcs_aware true

设置图片预览:

# Use one of the supported image preview protocols

set preview_images true

set preview_images_method w3m

===============================================================

ranger官方给出的使用指南:

https://github.com/ranger/ranger/wiki/Official-user-guide

===============================================================