A minor diff to update the vim patchlevel and a question.

Ag. Hatzimanikas a.hatzim at gmail.com
Tue Mar 6 04:36:58 PST 2007

I made some adjustments which I think it looks a little better than the
last one,so base your comments on this one.

-------------- next part --------------
Index: postlfs/config/vimrc.xml
--- postlfs/config/vimrc.xml	(revision 6656)
+++ postlfs/config/vimrc.xml	(working copy)
@@ -36,10 +36,7 @@
   section you'll find an attempt to enhance this file. At startup,
   <command>vim</command> reads <filename>/etc/vimrc</filename> and
   <filename>~/.vimrc</filename> (i.e., the global <filename>vimrc</filename>
-  and the user-specific one).  Note that this is only true if you compiled
-  <application>vim</application> using LFS-3.1 onwards. Prior to this, the
-  global <filename>vimrc</filename> was
-  <filename>/usr/share/vim/vimrc</filename>.</para>
+  and the user-specific one).</para>
   <para>Here is a slightly expanded <filename>.vimrc</filename> that you can
   put in <filename>~/.vimrc</filename> to provide user specific effects. Of
@@ -49,14 +46,54 @@
   users already on the system, such as
   <systemitem class='username'>root</systemitem>. Be sure to set permissions,
   owner, and group if you do copy anything directly from
-  <filename class="directory">/etc/skel</filename>.</para>
+  <filename class="directory">/etc/skel</filename>.
+  </para>
+  <note>
+  <para>
+  There are also a <filename>vimrc_example.vim</filename> and a
+  <filename>gvimrc_example.vim</filename>,located in 
+  <filename class="directory">$VIMRUNTIME</filename> (issue: 
+  <command>echo $VIMRUNTIME</command> inside <command>vim</command> to find out the
+  $VIMRUNTIME directory),which both are good starting points.</para>
+  <para>
+  You can source one of those example vim files,if you put in your <filename>.vimrc</filename>:
+  <screen><literal>runtime vimrc_example.vim</literal></screen>
+  If you do this,keep in mind that some of those options might be also included in our
+  example.</para>
+  </note>
+  <para>Review the following options and comment out those that you don't really need them.
+  </para>
 <screen><literal>" Begin .vimrc
+set autoindent
 set columns=80
+set history=50
+set ruler
+set showcmd
+set wildmenu
 set wrapmargin=8
-set ruler
+if &t_Co > 2 || has("gui_running")
+syntax on
+set hlsearch
+if has("autocmd")
+autocmd BufRead *.txt set tw=78
+autocmd BufEnter * lcd %:p:h
+autocmd BufReadPost *
+\ if line("'\"") > 0 && line ("'\"") <= line("$") |
+\   exe "normal g'\"" |
+\ endif
+if has("gui_running")
+map <S-Insert> <MiddleMouse>
+map! <S-Insert> <MiddleMouse>
+set guifont=DejaVu\ Sans\ Mono\ 12
 " End .vimrc</literal></screen>
   <para>Note that the comment tags are " instead of the more
@@ -80,32 +117,66 @@
       of the backspace option.  It is fairly complex so see <command>:help 'bs'
       </command> for more details.</para>
+    <listitem>
+      <para><option>set background=dark</option>: This tells
+      <command>vim</command> to use colors which look good on a dark
+      background.</para>
+    </listitem>
+    <listitem>
+      <para><option>syntax on</option>: Enables
+      <command>vim</command>'s syntax highlighting.</para>
+    </listitem>
+      <para><option>set autoindent</option>: This makes <command>vim</command> to
+     obtain the indent of the new line from the previous line.
+     <emphasis>Note</emphasis>. The <option>'autoindent'</option> option is reset when the
+     <option>'paste'</option> option is set.</para>
+     </listitem>
+    <listitem>
+      <para><option>set history=50</option>: The number of command-lines that are remembered
+      in the history table. Default are 20.</para>
+    </listitem>
+    <listitem>
       <para><option>set columns=80</option>: This simply sets the
       number of columns used on the screen.</para>
-    <!--
-      <para><option>set background=dark</option>: This tells
-      <command>vim</command> to use colors which look good on a dark
-      background.</para>
+      <para><option>set ruler</option>: This makes <command>vim</command>
+      show the current row and column at the bottom right of the screen.</para>
-    -->
+      <para><option>set showcmd</option>: Show (partial) command in status line.</para>
+    </listitem>
+    <listitem>
+      <para><option>set wildmenu</option>: Make the command line completion to operate in
+       an enhanced mode. Issue <literal>:help wildmenu</literal> to know more about it's usage.</para>
+    </listitem>
+    <listitem>
       <para><option>set wrapmargin=8</option>: This is the number of
       characters from the right window border where wrapping starts.</para>
-    <!--
-      <para><option>syntax on</option>: Enables
-      <command>vim</command>'s syntax highlighting.</para>
+     <para><option>if &t_Co > …</option>: If the number of supported colors in our
+     terminal are more than 2,or <command>vim</command> is running in GUI mode,then:</para>
+     <para>Enable syntax highlighting.
+     Highlight all of the matched text during a search.</para>
-    -->
-      <para><option>set ruler</option>: This makes <command>vim</command>
-      show the current row and column at the bottom right of the screen.</para>
+     <para><option>if has("autocmd") …</option>: If <command>vim</command> compiled with 
+     <option>autocmd</option> support then:</para>
+     <para>For every file with a .txt extension, limit the width of text to 78 characters.
+     Automatically change the current directory to the directory of the current file.
+     Jump to the last cursor position when you are reopening a file.
+     </para>
+    <listitem>
+    <para><option>if has("gui_running") …</option>: If running in GUI mode then:</para>
+    <para>
+    Make shift-insert work like in <command>xterm</command> terminal emulator.
+    Set the desired font, which in our example is the Sans Mono from the DejaVu font family.
+    </para>
+    </listitem>
   <para>More information on the <emphasis>many</emphasis>
@@ -115,5 +186,18 @@
   <command>vim</command> to get the general help, or by typing
   <command>:</command><option>help usr_toc.txt</option> to view
   the User Manual Table of Contents.</para>
+  <para>Another <command>vim</command> command,which might assist you while you are looking for 
+  <emphasis>help</emphasis> in the extended <command>vim</command> documentation,is the internal 
+  <command>grep</command> and particularly the <command>helpgrep</command> command.
+  Issue:
+  <screen><literal>:helpgrep <some pattern></literal></screen>
+  Then you can open a quickfix window to view the results.
+  <screen><literal>:copen</literal></screen>
+  Hit enter on the desired line to jump to the specific help text file.
+  When you are done,you can then close the quickfix window with:
+  <screen><literal>:close</literal></screen>
+  </para>

More information about the blfs-dev mailing list