Browse files

Last pass over Display chapter before release.

  • Loading branch information...
1 parent 530e4f7 commit f014b2110e91e48e14b93406b238583e07f6c97f @runpaint committed May 1, 2009
View
6 TODO
@@ -35,3 +35,9 @@ INDENTING LINES
* smarttab
DIFF
* Screenshots
+COLOUR SCHEMES
+ * Screenshots
+STATUS LINE
+ * Screenshot
+PRINTING
+ * Write?
View
63 text/display/01_working_with_long_lines.html
@@ -0,0 +1,63 @@
+<h3 id="working-with-long-lines">Working with Long Lines</h3>
+
+<h4>Problem</h4>
+
+<p>Your file contains lines which are too long to fit on the screen. You find
+it hard to edit and view.</p>
+
+<h4>Solution</h4>
+
+<p>The <tt>:set wrap</tt> command, which should be on by default, changes how
+long lines are displayed. Once they reach the right margin they are broken,
+and continued on the line below. (To disable this behaviour: <tt>:set
+ nowrap</tt>).</p>
+
+<p><tt>wrap</tt> only changes the way the lines are displayed, however; the
+file will not be changed. It inserts <i>soft</i> line breaks.</p>
+
+<p>This means that a file containing two particularly long lines may be
+represented by Vim as having 5 lines, for example, after wrapping. If you try
+to navigate this file using the <a href="#basic-navigation">basic movement
+ commands</a> <kbd>j</kbd> would move between the two logical lines, rather
+than the <i>screen lines</i>. The solution is to prefix the movement commands
+with <kbd>g</kbd>, so <kbd>gj</kbd> moves down one screen line.</p>
+
+<p>If using <tt>wrap</tt>, you can specify what point the line should be
+broken by executing <tt>:set linebreak</tt>. This uses the value of
+<tt>breakat</tt> to decide where to break the line. To change the characters
+used modify <tt>breakat</tt>.</p>
+
+<p>You can use <tt>:set textwidth=<var>width</var></tt> to enforce a maximum
+line length, after which the text is broken with a "hard" line break. Vim
+breaks at white space, so lines may be shorter than <tt>width</tt>. To
+reformat existing text according to this preference either select them
+visually and hit <kbd>gq</kbd> or, in <i>Normal</i> mode, you can reformat the
+current paragraph with <kbd>gqap</kbd>.</p>
+
+<h4>Discussion</h4>
+
+<p>In general, you'll be better off using <i>hard</i> line breaks with
+<i>textwidth</i>. This removes the need to differentiate between logical lines
+and screen lines, and means that the file will display reasonably in any
+editor, even if it doesn't wrap long lines.</p>
+
+<p>Traditionally, text file lines are kept under 80 characters. This is
+mainly a holdover from the days of terminals whose displays were limited in
+this way, but is still customary in many programming languages and e-mail. To
+enforce this restriction just <tt>:set textwidth=80</tt>.</p>
+
+<p>There's another way to insert hard line breaks without specifying a maximum
+line length. It is called <tt>wrapmargin</tt> and wraps lines relative to the
+width of the terminal window. For example, <tt>:set wrapmargin=4</tt> means
+that when a line is more than four characters away from the right-hand margin,
+it is broken. This approach is more flexible than <tt>textwidth</tt>, but has
+the disadvantage of producing files which will display poorly on smaller
+displays or when the screen is split between multiple files. Especially if
+you're sharing the files you produce with others, I suggest the use of
+<tt>textwidth</tt> instead.</p>
+
+<blockquote class="tip">
+ <p><tt>textwidth</tt> takes precedence over <tt>wrapmargin</tt>. For
+ <tt>wrapmargin</tt> to take effect <tt>textwidth</tt> must be zero, as it
+ is by default.</p>
+</blockquote>
View
34 text/display/02_displaying_line_numbers.html
@@ -0,0 +1,34 @@
+<h3 id="displaying-line-numbers">Displaying Line Numbers</h3>
+
+<h4>Problem</h4>
+
+<p>You want to see each line's number alongside it. For example, if you’re
+writing a program, error messages frequently reference line numbers.</p>
+
+<h4>Solution</h4>
+
+<p>Use <tt>:set number</tt> to enable line numbering. If you're using a small
+monitor, you may want to disable them: <tt>:set nonumber</tt>.</p>
+
+<h4>Discussion</h4>
+
+<p>Even if you're not programming, line numbers can still be useful. For
+example, if you’re collaborating on a file with other people, they may mention
+specific lines, which you can then jump to with <tt>:<var>number</var></tt>.
+If you’re <a href="#working-with-long-lines">wrapping long lines</a>, the line
+number can be used to differentiate the beginning of the line from the point
+at which it has been wrapped.</p>
+
+<p>By default the number column is at least 4 characters wide, regardless of
+how many lines the file has. To change this minimum width use <tt>:set
+ numberwidth=<var>width</var></tt>.</p>
+
+<p>The line numbers are only displayed when you’re viewing the file with Vim;
+the actual file isn't modified. If you'd like it to be, and you have the
+<tt>cat</tt> command on your system, you can execute <tt>:%!cat -n %</tt>.
+This filters the entire file through <tt>cat</tt> and prepends the number to
+each line.</p>
+
+<p>Lastly, if you'd like to see the line numbers when you print the file
+without permanently changing its contents: <tt>:set
+ printoptions=number:y</tt>.</p>
View
57 text/display/03_changing_the_colour_scheme.html
@@ -0,0 +1,57 @@
+<h3 id="changing-colour-scheme">Chaging the Colour Scheme</h3>
+
+<h4>Problem</h4>
+
+<p>You don't like the colours Vim uses; you want to change them.</p>
+
+<p>For example, you've found a colour scheme you like better, so want to
+instruct Vim to use it. Or, you find that the current colour scheme makes text
+hard to read so want to find a more suitable one.</p>
+
+<h4>Solution</h4>
+
+<p>To browse existing colour schemes enter <tt>:colourscheme</tt>, then hit
+<kbd>&lt;Tab&gt;</kbd> to cycle through the installed schemes. If you find one
+that you like hit <kbd>&lt;Enter&gt;</kbd> to apply it.</p>
+
+<h4>Discussion</h4>
+
+<p>A colour scheme is a set of rules controlling how different elements of the
+interface appear. Vim is distributed with a selection of colour schemes, but
+you can also download new ones, as explained in the sidebar.</p>
+
+<blockquote class="tip">
+ <p>The <a href="http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/">Vim
+ Color Scheme Test</a> is a a gallery of colour schemes along with their
+ names. Browse through it to select a theme you like, then follow the
+ instructions below to install it.</p>
+</blockquote>
+
+<blockquote class="callout">
+ <h5>Installing Colour Schemes</h5>
+
+ <ol>
+ <li>Browse the available colour schemes at <a
+ href="http://www.vim.org/scripts/script_search_results.php?script_type=color+scheme">Vim.org</a>
+ and download any that you like.</li>
+ <li>Create a <tt>$VIM/colors</tt>, e.g. <tt>mkdir -p ~/.vim/colors</tt> on
+ POSIX systems.</li>
+ <li>Copy the <tt>.vim</tt> file you downloaded in step one to the
+ <tt>colors</tt> directory you just created.</li>
+ <li>Open <tt>vim</tt> then execute <tt>:colorscheme <var>name</var></tt>,
+ where <var>name</var> is that of the file you downloaded without the
+ <tt>.vim</tt> extension.</li>
+ <li>If you want to use this colour scheme permanently add <tt>colorscheme
+ <var>name</var></tt> to your <a
+ href="#configuring-vim"><tt>vimrc</tt></a>; otherwise repeat these steps
+ with a different colour scheme.</li>
+ </ol>
+</blockquote>
+
+<p>Before you change your color scheme you may like to make a note of what
+you're using at the moment. You can find the name of the current scheme with
+<tt>:echo
+ g:colors_name</tt>.</p>
+
+<p>To change a specific aspect of a colour scheme you can <a
+ href="#redefining-highlight-groups">redefine a highlight group</a>.</p>
View
78 text/display/04_changing_the_status_line.html
@@ -0,0 +1,78 @@
+<h3 id="changing-status-line">Changing the Status Line</h3>
+
+<h4>Problem</h4>
+
+<p>You don't like the way the status line looks or would prefer if it displayed
+different types of information.</p>
+
+<p>For example, you work with files created on different operating systems, so
+you'd like the file format (e.g. <i>unix</i>, <i>MS-Windows</i>, or
+<i>mac</i>) to be displayed along the bottom of the screen.</p>
+
+<h4>Solution</h4>
+
+<p>Use the <tt>:set statusline</tt> command along with a format string. The format
+string is the text you want displayed interspersed with variable names
+corresponding to the types of information you want included.</p>
+
+<blockquote class="tip">
+ <p>By default Vim hides the status line. To show it: <tt>:set
+ laststatus=2</tt>.</p>
+</blockquote>
+
+<p>For example, to display the file format you could use <tt>:set
+ statusline=%{&amp;ff}</tt>. You can surround this with arbitrary text, for example:
+<tt>:set statusline=format:\ %{&amp;ff}</tt>.</p>
+
+<p>Here are some common variables the status line can display:</p>
+
+<table>
+ <tr><th>Name</th> <th>Description</th></tr>
+ <tr><td><tt>b</tt></td><td>Value of byte under cursor.</td></tr>
+ <tr><td><tt>c</tt></td><td>Column number.</td></tr>
+ <tr><td><tt>l</tt></td><td>Line number.</td></tr>
+ <tr><td><tt>r</tt></td><td>Displays <tt>[RO]</tt> if file is read only.</td></tr>
+ <tr><td><tt>t</tt></td><td>File name (as opposed to file path)</td></tr>
+ <tr><td><tt>y</tt></td><td>File content type, e.g. <tt>[ruby]</tt> or
+ <tt>[latex]</tt>.</td></tr>
+ <tr><td><tt>\&amp;ff</tt></td><td>File format, e.g. <tt>unix</tt>, <tt>mac</tt>,
+ <tt>dos</tt>.</td></tr>
+</table>
+
+<p>Variable names are prefixed with a percentage sign (<tt>%</tt>). Spaces,
+bars (<tt>|</tt>), and other special characters need to be backslash
+escaped.</p>
+
+<p>Here's a longer example:</p>
+
+<pre><code>
+:set statusline=%t\ %y\ format:\ %{&amp;ff};\ [%c,%l]
+</code></pre>
+
+<p>Sample output: <samp>.vimrc [vim] format: unix [2,3]</samp>.</p>
+
+<h4>Discussion</h4>
+
+<p>You may have noted that the syntax for displaying the file format was
+different from the other variables. The <i>%{}</i> syntax evaluates the
+expression contained within the braces and displays the result.</p>
+
+<p>For example, to display the name of the current colour scheme:
+<tt>%{g:colors_name}</tt> (example output: <samp>morning</samp>). Or the
+current language: <tt>%{v:lang}</tt> (example output:
+<samp>en_GB.UTF-8</samp>). Here we are simply displaying the value of Vim
+internal variables. (See <tt>:let</tt> for a list).</p>
+
+<p>The reason <tt>%{&amp;ff}</tt> works is because <tt>ff</tt> is the Vim
+option for getting/setting the file format, and the <tt>&amp;</tt> prefix is
+used for referring to options. The value of any option can be displayed in
+this way.</p>
+
+<p>You can even call a function in this way. For example, to show the last
+modification time of the current file:</p>
+
+<pre><code>
+\%{strftime(\"\%c\",getftime(expand(\"\%\%\")))}
+</code></pre>
+
+<p>Sample output: <samp>Fri 01 May 2009 19:26:07 BST</samp></p>
View
98 text/display/05_redefining_highlight_groups.html
@@ -0,0 +1,98 @@
+<h3 id="redefining-highlight-groups">Redefining Highlight Groups</h3>
+
+<h4>Problem</h4>
+
+<p>You want to change the colours of specific elements of the display. For
+example, you want text to be white on a black background.</p>
+
+<h4>Solution</h4>
+
+<p>Use the <tt>:highight <var>group</var> <var>definition</var></tt> command.</p>
+
+<p>A <i>highlight group</i> (<var>group</var>) is an element of the display
+whose colours can be customised. Some of the default highlight groups are:</p>
+
+<p><span class="todo">Is a list the right way to present this?</span></p>
+
+<dl>
+ <dt><i>Cursor</i></dt>
+ <dd>Character under the cursor.</dd>
+ <dt><i>ErrorMsg</i></dt>
+ <dd>Command line error messages.</dd>
+ <dt><i>Normal</i></dt>
+ <dd>Normal text.</dd>
+ <dt><i>Visual</i></dt>
+ <dd>Text selected under Visual mode.</dd>
+</dl>
+
+<p>The <var>definition</var> is a list of key-value pairs. For example, the
+following sets the terminal foreground colour to black and
+the terminal background colour to yellow: </p>
+
+<pre><code>
+:highlight Normal ctermfg=black ctermbg=yellow
+</code></pre>
+
+<p>These are some common arguments:</p>
+
+<dl>
+ <dt><i>ctermfg</i></dt>
+ <dd>Terminal foreground colour.</dd>
+ <dt><i>ctermbg</i></dt>
+ <dd>Terminal background colour.</dd>
+ <dt><i>term</i></dt>
+ <dd>Terminal font style, e.g. <i>bold</i>, <i>italic</i>,
+ <i>underline</i>.</dd>
+ <dt><i>guifg</i></dt>
+ <dd>GUI foreground colour.</dd>
+ <dt><i>guibg</i></dt>
+ <dd>GUI background colour.</dd>
+</dl>
+
+<p>Apart from <i>term</i>, these arguments take a colour name or number as a
+value. Recognised colour names include <i>black</i>, <i>brown</i>,
+<i>grey</i>, <i>blue</i>, <i>green</i>, <i>cyan</i>, <i>magenta</i>,
+<i>yellow</i>, and <i>white</i>.</p>
+
+<p>The arguments that are not supplied retain their previous values. For
+example, <tt>:highlight Normal\ ctermbg=white</tt> changes the background
+colour to <i>white</i>, but keeps the previous foreground colour.</p>
+
+<p>Let's look at some examples:</p>
+
+<ul>
+ <li><tt>:highlight Visual term=bold</tt> - Text that has been selected using
+ <i>Visual</i> mode is rendered in bold.</li>
+ <li><tt>:highlight Comment ctermfg=grey ctermbg=white term=bold</tt> -
+ Comments are rendered in bold, grey text.</li>
+</ul>
+
+<h4>Discussion</h4>
+
+<p>Normally you'll select a <a href="#changing-colour-scheme">colour
+ scheme</a>, and not define highlighting groups at all. Occasionally, though,
+you want more control over colours or need to edit a syntax file. That's
+where the <tt>:highlight</tt> command comes in.</p>
+
+<p>Before you change highlight groups you may like to check their current
+values. You can do this with <tt>:highlight <var>group</var></tt>. To view
+all current settings use <tt>:highlight</tt>.</p>
+
+<blockquote class="callout">
+
+ <h5 id="defining-highlight-group">Defining a Highlight Group</h5>
+
+ <p>You can define your own highlight group by using the <tt>:highlight</tt>
+ command as described above with a group name of your choice. To select what is
+ highlighted you use <tt>:match <var>group</var>
+ /<var>pattern</var>/</tt>. For example:</p>
+
+ <pre><code>
+ :highlight Elephant ctermbg=grey ctermfg=white
+ :match Elephant /\celephant/
+ </code></pre>
+
+ <p>This renders all occurrences of the word <i>elephant</i>, regardless of
+ case due to the <tt>\c</tt> escape, in white on grey.
+
+</blockquote>
View
34 text/display/changing_the_colour_scheme.html
@@ -1,34 +0,0 @@
-<h3>Chaging the Colour Scheme</h3>
-
-<h4>Problem</h4>
-
-<p>You don't like the colours Vim uses; you want to change them.</p>
-
-<p>For example, you've found a colour scheme you like better, so want to instruct
-Vim to use it. Or, you find that the current colour scheme makes text hard to
-read so want to find a better one.</p>
-
-<h4>Solution</h4>
-
-<p>To change to a new colour scheme execute <kbd>:colorscheme <var>name</var></kbd>.</p>
-
-<p>To browse existing colour schemes enter <kbd>:colourscheme</kbd>, then hit
-<kbd>&lt;Tab&gt;</kbd> to cycle through the installed schemes. If you find one that you like hit
-<kbd>&lt;Enter&gt;</kbd> to apply it.</p>
-
-<h4>Discussion</h4>
-
-<p>A colour scheme is a set of rules controlling how different elements of the
-interface appear. Vim is distributed with a selection of colour schemes, but
-you can also download new ones <span class="todo">link recipe</span>, or create your own
-<span class="todo">link recipe</span>.</p>
-
-<p><span class="todo">some screenshots illustrating different colour schemes along with their
-names</span></p>
-
-<p>Before you change your color scheme you may like to make a note of what you're
-using at the moment. You can find the name of the current scheme with <kbd>:echo
- g:colors_name</kbd>.</p>
-
-<p>To change a specific aspect of a colour scheme you can redefine a highlight
-group <span class="footnote">Recipe: sec:re-highlight</span>.</p>
View
70 text/display/changing_the_status_line.html
@@ -1,70 +0,0 @@
-<h3>Changing the Status Line</h3>
-
-<h4>Problem</h4>
-
-<p>You don't like the way the status line looks or would prefer if it displayed
-different types of information.</p>
-
-<p>For example, you work with files created on different operating systems, so
-you'd like the file format (e.g. <i>unix</i>, <i>MS-Windows</i>, or
-<i>mac</i>) to be displayed along the bottom of the screen.</p>
-
-<h4>Solution</h4>
-
-<p>Use the <kbd>:set statusline</kbd> command along with a format string. The format
-string is the text you want displayed interspersed with variable names
-corresponding to the types of information you want included.</p>
-
-<p>For example, to display the file format you could use <kbd>:set
-statusline=\%{\&amp;ff}}. You can surround this with arbitrary text, for example:
-<kbd>:set statusline=format:\ \%{\&amp;ff}</kbd>.</p>
-
-<p><span class="todo">screenshot of this status line</span></p>
-
-<p><span class="todo">check terminology. What do we call the format specifiers?</span></p>
-
-<p>Here are some common variables the status line can display:</p>
-
-<table>
- <tr><th>Name</th> <th>Description</th></tr>
- <tr><td><i>b</i></td><td>Value of byte under cursor.</td></tr>
- <tr><td><i>c</i></td><td>Column number.</td></tr>
- <tr><td><i>l</i></td><td>Line number.</td></tr>
- <tr><td><i>r</i></td><td>Displays <i>[RO]</i> if file is read only.</td></tr>
- <tr><td><i>t</i></td><td>File name (as opposed to file path)</td></tr>
- <tr><td><i>y</i></td><td>File content type, e.g. <i>[ruby]</i> or
- <i>[latex]</i>.</td></tr>
- <tr><td><i>\&amp;ff</i></td><td>File format, e.g. <i>unix</i>, <i>mac</i>,
- <i>dos</i>.</td></tr>
-</table>
-
-<p>Variable names are prefixed with a percentage sign (<i>\%</i>). Spaces, bars
-(<i>|</i>), and other special characters <span class="todo">What special
-characters?</span> need to be backslash escaped.</p>
-
-<p>Here's a longer example: <kbd>:set statusline=\%t\ \%y\ format:\
- \%{\&amp;ff};\ [\%c,\%l]</kbd>. Sample output: <samp>.vimrc [vim] format: unix
-[2,3]</samp>.</p>
-
-<p>By default Vim hides the status line. To show it: <kbd>:set
- laststatus=2</kbd>..</p>
-
-<h4>Discussion</h4>
-
-<p>You may have noted that the syntax for displaying the file format was
-different from the other variables. The <i>\%{}</i> syntax evaluates the expression
-contained within the braces and displays the result.</p>
-
-<p>For example, to display the name of the current colour scheme:
-<kbd>\%{g:colors_name}</kbd> (example output: <i>morning</i>). Or the current
-language: <kbd>\%{v:lang}</kbd> (example output: <samp>en_GB.UTF-8</samp>). Here we
-are simply displaying the value of Vim internal variables. (See <kbd>:let</kbd>
-for a list).</p>
-
-<p>The reason <kbd>\%{\&amp;ff}</kbd> works is because <i>ff</i> is the Vim option for
-getting/setting the file format, and the <i>\&amp;</i> prefix is used for referring to
-options. The value of any option can be displayed in this way.</p>
-
-<p>You can even call a function <span class="todo">link recipe</span> in this
-way. For example, to show the last modification time of the current file:
-<kbd>\%{strftime(\"\%c\",getftime(expand(\"\%\%\")))}</kbd>.</p>
View
30 text/display/displaying_line_numbers.html
@@ -1,30 +0,0 @@
-<h3>Displaying Line Numbers</h3>
-
-<h4>Problem</h4>
-
-<p>You want to see each line’s number alongside it. For example, if you’re writing a program, error messages frequently reference line numbers.</p>
-
-<h4>Solution</h4>
-
-<p>Use <kbd>:set number</kbd> to enable line numbering. If you're using a small
-monitor, you may want to disable them: <kbd>:set nonumber</kbd>.</p>
-
-<h4>Discussion</h4>
-
-<p>Even if you're not programming, line numbers can still be useful. For
-example, if you’re collaborating on a file with other people, they may mention
-specific lines, which you can then jump to with <kbd>:<var>number</var></kbd>.
-If you’re wrapping long lines <span class='fn'>Recipe 4.7</span>, the line number can be used to differentiate the beginning of the line from the point at which it’s been wrapped.</p>
-
-<p>By default the number column is at least 4 characters wide, regardless of how
-many lines the file has. To change this minimumn width use <kbd>:set
- numberwidth=<var>width</var></kbd>.</p>
-
-<p>The line numbers are only displayed when you’re viewing the file with Vim;
-the actual file isn’t modified. If you'd like it to be, and you have the
-<tt>cat</tt> command on your system, you can execute <kbd>:%!cat -n %</kbd>.
-This filters the entire file through <tt>cat</tt> and prepends the number to
-each line.</p>
-
-<p>Lastly, if you’d like to see the line numbers when you print the file without
-permenantly changing its contents: <kbd>:set printoptions=number:y</kbd>.</p>
View
101 text/display/redefining_highlight_groups.html
@@ -1,101 +0,0 @@
-<h3>Redefining Highlight Groups</h3>
-
-<p><span class="label">sec:re-highlight</span></p>
-
-<h4>Problem</h4>
-
-<p>You want to change the colours of specific elements of the display. For
-example, you want text to be white on a black background.</p>
-
-<h4>Solution</h4>
-
-<p>Use the <kbd>:highight <var>group</var> <var>definition</var></kbd> command.</p>
-
-<p>A <i>highlight group</i> is an element of the display whose colours can be
-customised. Some of the default highlight groups are:</p>
-
-<p><span class="todo">Is a list the right way to present this?</span></p>
-
-<dl>
- <dt><i>Cursor</i></dt>
- <dd>Character under the cursor.</dd>
- <dt><i>ErrorMsg</i></dt>
- <dd>Command line error messages.</dd>
- <dt><i>Normal</i></dt>
- <dd>Normal text.</dd>
- <dt><i>Visual</i></dt>
- <dd>Text selected under Visual mode.</dd>
-</dl>
-
-<p><span class="todo">Explain how to create your own group - just create a name?</span></p>
-
-<p>The <i>definition</i> is a list of key-value pairs. For example, <kbd>:highlight Normal
-ctermfg=black ctermbg=yellow</kbd> sets the terminal foreground colour to black and
-the terminal background colour to yellow. </p>
-
-<p>These are some common arguments:</p>
-
-<dl>
- <dt><i>ctermfg</i></dt>
- <dd>Terminal foreground colour.</dd>
- <dt><i>ctermbg</i></dt>
- <dd>Terminal background colour.</dd>
- <dt><i>term</i></dt>
- <dd>Terminal font style, e.g. <i>bold</i>, <i>italic</i>,
- <i>underline</i>.</dd>
- <dt><i>guifg</i></dt>
- <dd>GUI foreground colour.</dd>
- <dt><i>guibg</i></dt>
- <dd>GUI background colour.</dd>
-</dl>
-
-<p><span class="todo">Check: does 'underline' work on the terminal?</span>
-Apart from <i>term</i>, these arguments take a colour name or number as a value.
-Recognised colour names include <i>black</i>, <i>brown</i>, <i>grey</i>,
-<i>blue</i>, <i>green</i>, <i>cyan</i>, <i>magenta</i>,
-<i>yellow</i>, and <i>white</i>. <span class="todo">See :help ... for the full
- list?</span></p>
-
-<p>The arguments that are not supplied retain their previous values. For example,
-<kbd>:highlight Normal\ ctermbg=white</kbd> changes the background colour to
-<i>white</i>, but keeps the previous foreground colour.</p>
-
-<p><span class="todo">These examples are all a bit boring; jazz them
- up?</span></p>
-
-<p>Let's look at some examples:</p>
-
-<ul>
- <li><kbd>:highlight Visual term=bold</kbd> - Text that has been selected using
- Visual mode is rendered in bold.</li>
- <li><kbd>:highlight Comment ctermfg=grey ctermbg=white term=bold</kbd> -
- Comments are rendered in bold, grey text.</li>
-</ul>
-
-<h4>Discussion</h4>
-
-<p>Normally you'll select a colour scheme <span
- class="footnote">Recipe:~\ref{sec:colour-scheme}</span>, and not define
-highlighting groups at all. Ocassionally, though, you want more control over
-colours or need to edit a syntax file. That's where the <kbd>:highlight</kbd> command
-comes in.</p>
-
-<p><span class="todo">This leading paragraph builds up, but then we don't deliver. Either
- add more here or delete it.</span></p>
-
-<p>Before you change highlight groups you may like to check their current values.
-You can do this with <kbd>:highlight <var>group</var></kbd>. To view all current settings use
-<kbd>:highlight</kbd>.</p>
-
-<div class="callout">
-
-<h5>Defining a Highlight Group</h5>
-
-You can define your own highlight group by using the <kbd>highlight</kbd> command as described above with a group name of your choice. To select what is highlighted you use <kbd>:match <var>group</var> /<var>pattern</var>/</kbd>.
-
-For example: <kbd>:highlight Elephant ctermbg=grey ctermfg=white</kbd>,
-<kbd>:match Elephant /\celephant/</kbd>. This renders all occurrences of the word <i>elephant</i>, regardless of case due to the <kbd>\c</kbd> escape, in white on grey.
-
-</div>
-
-<p><span class="todo">We have been inconsistent in italicising colour names; what's right?</span></p>
View
0 ...d/creating_menus_and_toolbar_buttons.html → ...i/creating_menus_and_toolbar_buttons.html
File renamed without changes.
View
0 ...nsorted/creating_regular_expressions.html → ...arching/creating_regular_expressions.html
File renamed without changes.
View
0 text/unsorted/using_templates.html → text/typing/using_templates.html
File renamed without changes.
View
62 text/unsorted/working_with_long_lines.html
@@ -1,62 +0,0 @@
-<h3>Working with Long Lines</h3>
-
-<h4>Problem</h4>
-
-<p>Your file contains lines which are too long to fit on the screen. You find it
-hard to edit and view.</p>
-
-<h4>Solution</h4>
-
-<p>The <tt>:set wrap</tt> command, which should be on by default, changes how
-long lines are displayed. Once they reach the right margin they are broken,
-and continued on the line below. (To disable this behaviour: <tt>:set
-nowrap</tt>).</p>
-
-<p><tt>wrap</tt> only changes the way the lines are displayed, however; the file
-will not be changed. It inserts 'soft' line breaks.</p>
-
-<p>This means that a file containing two particularly long lines may be
-represented by Vim as having 5 lines, for example, after wrapping. If you try
-to navigate this file using the basic movement commands <span
-class="todo">link recipe</span> <kbd>j</kbd> would move between the two
-logical lines, rather than the 'screen lines'. The solution is to prefix the
-movement commands with <kbd>g</kbd>, so <kbd>gj</kbd> moves down one 'screen
-line'. <span class="todo">line-numbered screenshot illustrating this</span></p>
-
-<p>If using <tt>wrap</tt>, you can specify what point the line should be broken
-by executing <tt>:set linebreak</tt>. This uses the value of <tt>breakat</tt>
-to decide where to break the line. To change the characters used modify
-<tt>breakat</tt>.</p>
-
-<p>You can use <tt>:set textwidth=<var>width</var></tt> to enforce a maximum line
-length, after which the text is broken with a "hard" line break. Vim breaks at
-white space, so lines may be shorter than <tt>width</tt>. To reformat existing
-text according to this preference see <span class="todo">link Formatting
-Paragraphs</span></p>
-
-<h4>Discussion</h4>
-
-<p>In general, you'll be better off using "hard" line breaks with
-<i>textwidth</i>. This removes the need to differentiate between logical lines
-and 'screen lines', and means that the file will display reasonably in any
-editor, even if it doesn't wrap long lines.</p>
-
-<p>Traditionally, text file lines are kept under 80 characters. This is mainly a
-holdover from the days of terminals whose displays were limited in this way,
-but is still customary in many programming languages and e-mail. To enforce
-this restriction just <tt>:set textwidth=80</tt>.</p>
-
-<p>There's another way to insert hard line breaks without specifying a maximum
-line length. It is called <tt>wrapmargin</tt> and wraps lines relative to the
-width of the terminal window. For example, <tt>:set wrapmargin=4</tt> means
-that when a line is more than four characters away from the right-hand margin,
-it is broken. This approach is more flexible than <tt>textwidth</tt>, but has
-the disadvantage of producing files which will display poorly on smaller
-displays or when the screen is split between multiple files. Especially if
-you're sharing the files you produce with others, I suggest the use of
-<tt>textwidth</tt> instead.</p>
-
-<div class="tip"> <tt>textwidth</tt> takes precedence over
-<tt>wrapmargin</tt>. For <tt>wrapmargin</tt> to take effect
-<tt>textwidth</tt> must be zero, as it is by default.
-</div>

0 comments on commit f014b21

Please sign in to comment.