From owner-svn-doc-head@FreeBSD.ORG Mon Jul 22 19:55:26 2013 Return-Path: Delivered-To: svn-doc-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D8144356; Mon, 22 Jul 2013 19:55:26 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB18C2167; Mon, 22 Jul 2013 19:55:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6MJtQgP097540; Mon, 22 Jul 2013 19:55:26 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6MJtQFI097536; Mon, 22 Jul 2013 19:55:26 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201307221955.r6MJtQFI097536@svn.freebsd.org> From: Warren Block Date: Mon, 22 Jul 2013 19:55:25 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r42381 - in head/en_US.ISO8859-1/books/fdp-primer: . editor-config X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jul 2013 19:55:26 -0000 Author: wblock Date: Mon Jul 22 19:55:25 2013 New Revision: 42381 URL: http://svnweb.freebsd.org/changeset/doc/42381 Log: Add an editor configuration chapter that shows helpful configurations for specific editors. Other editor configuration content will be moved to this chapter. Added: head/en_US.ISO8859-1/books/fdp-primer/editor-config/ head/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml (contents, props changed) Modified: head/en_US.ISO8859-1/books/fdp-primer/Makefile head/en_US.ISO8859-1/books/fdp-primer/book.xml head/en_US.ISO8859-1/books/fdp-primer/chapters.ent Modified: head/en_US.ISO8859-1/books/fdp-primer/Makefile ============================================================================== --- head/en_US.ISO8859-1/books/fdp-primer/Makefile Mon Jul 22 17:45:47 2013 (r42380) +++ head/en_US.ISO8859-1/books/fdp-primer/Makefile Mon Jul 22 19:55:25 2013 (r42381) @@ -33,6 +33,7 @@ SRCS+= stylesheets/chapter.xml SRCS+= translations/chapter.xml SRCS+= writing-style/chapter.xml SRCS+= psgml-mode/chapter.xml +SRCS+= editor-config/chapter.xml SRCS+= see-also/chapter.xml SRCS+= examples/appendix.xml Modified: head/en_US.ISO8859-1/books/fdp-primer/book.xml ============================================================================== --- head/en_US.ISO8859-1/books/fdp-primer/book.xml Mon Jul 22 17:45:47 2013 (r42380) +++ head/en_US.ISO8859-1/books/fdp-primer/book.xml Mon Jul 22 19:55:25 2013 (r42381) @@ -261,6 +261,7 @@ The time is 09:18 &chap.translations; &chap.writing-style; &chap.psgml-mode; + &chap.editor-config; &chap.see-also; &app.examples; Modified: head/en_US.ISO8859-1/books/fdp-primer/chapters.ent ============================================================================== --- head/en_US.ISO8859-1/books/fdp-primer/chapters.ent Mon Jul 22 17:45:47 2013 (r42380) +++ head/en_US.ISO8859-1/books/fdp-primer/chapters.ent Mon Jul 22 19:55:25 2013 (r42381) @@ -23,6 +23,7 @@ + Added: head/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml Mon Jul 22 19:55:25 2013 (r42381) @@ -0,0 +1,121 @@ + + + + + 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: + + &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: + + &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 + + 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 + +