diff options
-rw-r--r-- | documentation/content/en/books/fdp-primer/editor-config/_index.adoc | 53 |
1 files changed, 41 insertions, 12 deletions
diff --git a/documentation/content/en/books/fdp-primer/editor-config/_index.adoc b/documentation/content/en/books/fdp-primer/editor-config/_index.adoc index 3c865efb2b..d034d87737 100644 --- a/documentation/content/en/books/fdp-primer/editor-config/_index.adoc +++ b/documentation/content/en/books/fdp-primer/editor-config/_index.adoc @@ -191,17 +191,48 @@ Install from package:editors/nano[] or package:editors/nano-devel[]. [[editor-config-nano-config]] === Configuration -Copy the sample XML syntax highlight file to the user's home directory: - -[source,shell] -.... -% cp /usr/local/share/nano/xml.nanorc ~/.nanorc -.... - -Use an editor to replace the lines in the [.filename]#~/.nanorc# `syntax "xml"` block with these rules: +Currently there is no adoc/asciidoc syntax highlight file with nano distribution. So let's create one from scratch and use an editor to create new file or add lines in the [.filename]#~/.nanorc# with these contents: .... -syntax "xml" "\.([jrs]html?|xml|xslt?)$" +syntax "asciidoc" "\.(adoc|asc|asciidoc)$" +# main header +color red "^====+$" +# h1 +color red "^==[[:space:]].*$" +color red "^----+$" +# h2 +color magenta "^===[[:space:]].*$" +color magenta "^~~~~+$" +# h4 +color green "^====[[:space:]].*$" +color green "^\^\^\^\^+$" +# h5 +color brightblue "^=====[[:space:]].*$" +color brightblue "^\+\+\+\++$" +# attributes +color brightgreen ":.*:" +color brightred "\{[a-z0-9]*\}" +color red "\\\{[a-z0-9]*\}" +color red "\+\+\+\{[a-z0-9]*\}\+\+\+" +# Paragraph Title +color yellow "^\..*$" +# source +color magenta "^\[(source,.+|NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]" +# Other markup +color yellow ".*[[:space:]]\+$" +color yellow "_[^_]+_" +color yellow "\*[^\*]+\*" +color yellow "\+[^\+]+\+" +color yellow "`[^`]+`" +color yellow "\^[^\^]+\^" +color yellow "~[^~]+~" +color yellow "'[^']+'" +color cyan "`{1,2}[^']+'{1,2}" +# bullets +color brightmagenta "^[[:space:]]*[\*\.-]{1,5}[[:space:]]" +# anchors +color brightwhite "\[\[.*\]\]" +color brightwhite "<<.*>>" # trailing whitespace color ,blue "[[:space:]]+$" # multiples of eight spaces at the start a line @@ -211,8 +242,6 @@ color ,blue "^([TAB]*[ ]{8})+" 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: @@ -229,7 +258,7 @@ Specify additional helpful options when running the editor: [source,shell] .... -% nano -AKipwz -r 70 -T8 _index.adoc +% nano -AKipwz -T8 _index.adoc .... Users of man:csh[1] can define an alias in [.filename]#~/.cshrc# to automate these options: |