From owner-svn-doc-all@FreeBSD.ORG Wed Jul 24 23:52:06 2013 Return-Path: Delivered-To: svn-doc-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0322A5B0; Wed, 24 Jul 2013 23:52:06 +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 E403D2208; Wed, 24 Jul 2013 23:52:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6ONq5Xp064051; Wed, 24 Jul 2013 23:52:05 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6ONq5nY064050; Wed, 24 Jul 2013 23:52:05 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201307242352.r6ONq5nY064050@svn.freebsd.org> From: Warren Block Date: Wed, 24 Jul 2013 23:52:05 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r42426 - 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-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire doc trees \(except for " user" , " projects" , and " translations" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 23:52:06 -0000 Author: wblock Date: Wed Jul 24 23:52:05 2013 New Revision: 42426 URL: http://svnweb.freebsd.org/changeset/doc/42426 Log: Simplify and improve the nano config section. Modified: head/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml Modified: head/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml Wed Jul 24 20:07:50 2013 (r42425) +++ head/en_US.ISO8859-1/books/fdp-primer/editor-config/chapter.xml Wed Jul 24 23:52:05 2013 (r42426) @@ -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: - - &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 + Add these lines to the new ~/.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 +