3

I asked a similar question on webmasters.stackexchange.com and was directed here.

How do I format code in Bluefish HTML editor? There's auto-indenting, that's easy enough to find. Is there a button I can click after selecting all the text? Because I sure can't seem to find it.

Tianxiang Xiong
  • 167
  • 2
  • 2
  • 5

1 Answers1

3

For html files I could find this functionality under Tools -> Filters -> Tidy HTML. Notice that you need HTML Tidy installed1. I personally prefer to also have the file auto-indented: Edit -> Preferences -> External filters -> Tidy XML: |tidy -i|.

Additionally, for xml files you can add a new "Tidy XML" label with corresponding command |tidy -xml -i|.


1 In Gentoo: sudo emerge -v app-text/htmltidy; in Debian, sudo apt-get install tidy; in Fedora, I would guess sudo yum install tidy?

Alberto
  • 210
  • 2
  • 8
  • The above Bluefish command is similar to typing the command `tidy -im file.html` in a bash shell, outside of Bluefish. Just mentioning this as the builtin filter gave an error for me. – Roland Oct 08 '16 at 15:10
  • my new, default installation of bluefish (on ubuntu 17.04) used `perltidy` as the html tidy tool, requiring it to be installed first, rather than html tidy, which I did already have installed. It does seem to depend on which menu option one is actually invoking; some use `tidy`, some `perltidy`(viewing the preferences "external filters" shows which tools need to be used) – michael Dec 11 '17 at 11:42