diff --git a/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml b/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml
index 68e5c76ce5..05b02dd575 100644
--- a/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml
+++ b/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml
@@ -84,27 +84,36 @@ augroup END
editors/nano or
editors/nano-devel.
- Configuration:
+
+ Configuration
+
+ Copy the sample XML syntax highlight
+ file to the user's home directory:
&prompt.user; cp /usr/local/share/nano/xml.nanorc ~/.nanorc
- Use printf to add lines to the
- configuration file. Some have embedded Tab
- characters, making this easier than editing the file
- directly:
+ Add these lines to the new ~/.nanorc.
- &prompt.user; printf '# trailing whitespace\n' >> ~/.nanorc
-&prompt.user; printf 'color ,blue "[[:space:]]+$"\n' >> ~/.nanorc
-&prompt.user; printf '# multiples of eight spaces at the start a line\n' >> ~/.nanorc
-&prompt.user; printf '# (after zero or more tabs) should be a tab\n' >> ~/.nanorc
-&prompt.user; printf 'color ,blue "^([\t]*[ ]{8})+"\n' >> ~/.nanorc
-&prompt.user; printf '# tabs after spaces\n' >> ~/.nanorc
-&prompt.user; printf 'color ,yellow "( )+\t"\n' >> ~/.nanorc
-&prompt.user; printf '# lines longer than 70 characters\n' >> ~/.nanorc
-&prompt.user; printf 'color ,red "^(([ ]{2})+|(\t+))*[ ]{1}[^ ]{1}"\n' >> ~/.nanorc
+ # trailing whitespace
+color ,blue "[[:space:]]+$"
+# multiples of eight spaces at the start a line
+# (after zero or more tabs) should be a tab
+color ,blue "^([TAB]*[ ]{8})+"
+# tabs after spaces
+color ,yellow "( )+TAB"
+# highlight indents that have an odd number of spaces
+color ,red "^(([ ]{2})+|(TAB+))*[ ]{1}[^ ]{1}"
+# lines longer than 70 characters
+color ,yellow "^(.{71})|(TAB.{63})|(TAB{2}.{55})|(TAB{3}.{47}).+$"
+ Process the file to create embedded tabs:
+
+ &prompt.user; perl -i'' -pe 's/TAB/\t/g' ~/.nanorc
+
+
+ Use
Specify additional helpful options when running the
- editor.
+ editor:
&prompt.user; nano -AKipwz -r 70 -T8 chapter.xml
@@ -117,5 +126,6 @@ augroup END
automatically:
&prompt.user; nano chapter.xml
+