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 fe96dd4c32..0823ef1401 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 @@ -1,134 +1,135 @@ Editor Configuration Adjusting text editor configuration can make working on document files quicker and easier, and help documents conform to FDP guidelines. <application>Vim</application> Install from editors/vim or editors/vim-lite. Edit ~/.vimrc, adding these lines: augroup sgmledit autocmd FileType sgml set formatoptions=cq2l " Special formatting options autocmd FileType sgml set textwidth=70 " Wrap lines at 70 columns autocmd FileType sgml set shiftwidth=2 " Automatically indent autocmd FileType sgml set softtabstop=2 " Tab key indents 2 spaces autocmd FileType sgml set tabstop=8 " Replace 8 spaces with a tab autocmd FileType sgml set autoindent " Automatic indentation augroup END <application>Emacs</application> Install from editors/emacs or editors/xemacs. Edit ~/.emacs, adding these lines: (defun local-sgml-mode-hook (setq fill-column 70 indent-tabs-mode nil next-line-add-newlines nil standard-indent 4 sgml-indent-data t) (auto-fill-mode t) (setq sgml-catalog-files '("/usr/local/share/xml/catalog"))) (add-hook 'psgml-mode-hook '(lambda () (local-psgml-mode-hook))) <application>nano</application> Install from editors/nano or editors/nano-devel. Configuration Copy the sample XML syntax highlight file to the user's home directory: &prompt.user; cp /usr/local/share/nano/xml.nanorc ~/.nanorc Add these lines to the new ~/.nanorc. - # trailing whitespace + syntax "xml" "\.([jrs]html?|xml|xslt?)$" +# 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: &prompt.user; nano -AKipwz -r 70 -T8 chapter.xml Users of &man.csh.1; can define an alias in ~/.cshrc to automate these options: alias nano "nano -AKipwz -r 70 -T8" After the alias is defined, the options will be added automatically: &prompt.user; nano chapter.xml