Debian – How to force ranger to edit html files

debianfile managementranger

I am using ranger and every time I try to edit an HTML file ranger will open that file with the browser instead of editing it with Vim.

How can I force ranger to edit HTML instead of loading them in my browser?

Best Answer

  • You don't need to edit the configuration for this. Just press r and then select your editor.

    By default this will be 2 | ${VISUAL:-$EDITOR} -- "$@", so you'd just press 2 and then Enter (assuming that $VISUAL or $EDITOR are set to your preferred editor).

    See Krv Perera's answer if you'd like to change the default ("0") program in rifle.conf.

  • Related Question