<h1>Useful Vim Plugins</h1>
 <p>I started learning <code>vi</code> a long time ago when I first encountered Unix systems. In those days you could usually count on a system having <code>vi</code> (or at a pinch, when the system would only boot into single user mode, <code>ed</code>). Learning Emacs didn't seem like a good choice since it wasn't usually available on the systems I was administering.</p>
 <p>I don't remember when I changed to Vim, but for many years I have used it (actually gVim) as an IDE (Integrated Development Environment), particularly for writing Bash and Perl scripts.</p>
 <p>In these notes I have listed some of the plugins I use to enhance Vim and gVim's functionality. If you have never made enhancements to this editor, here's a site with a very good tutorial on how to install plugins <a href="https://www.installationwiki.com/Installing_Vim_Scripts">https://www.installationwiki.com/Installing_Vim_Scripts</a>.</p>
 <hr />
 <p><strong><u>NERDTree</u></strong></p>
 <ul>
  <li>Author: Marty Grenfell</li>
  <li>Version: 4.2.0</li>
  <li>Updated: 2011-12-28</li>
  <li>URL: <a href="https://www.vim.org/scripts/script.php?script_id=1658">https://www.vim.org/scripts/script.php?script_id=1658</a></li>
 </ul>
 <p>This plugin provides a file browser within Vim/gVim. A particular directory is opened by typing <strong><code>:NERDTree somedir</code></strong>. A tree is displayed in a window which can be scrolled and traversed to find files to edit.</p>
 <p><a href="https://www.hackerpublicradio.org/eps/hpr1091/NERDTree.png"><img align="middle" alt="" border="0" src="https://www.hackerpublicradio.org/eps/hpr1091/thumb.NERDTree.png" /></a></p>
 <p>In case you're interested, the colour theme I use in gVim is "Murphy".</p>
 <p>Type <strong><code>:h NERD_tree</code></strong> for the large and comprehensive help file.</p>
 <p>I prefer to use NERDTree in gVim and not in Vim. To achieve this I have the following in my ~/.vimrc</p><pre>
  " NERDTree settings (only in GUI mode)
  if has("gui_running")
      let NERDTreeRoot = '~'
      let NERDTreeIgnore = ['\~$', '\.swp$']
      let NERDTreeShowHidden = 1
      let NERDTreeShowBookmarks = 1
      let NERDTreeChDirMode = 2
  else
      let loaded_nerd_tree = 1
  endif
</pre><hr />
 <p><strong><u>Bash-support</u></strong></p>
 <ul>
  <li>Author: Fritz Mehner</li>
  <li>Version: 3.10</li>
  <li>Updated: 2012-06-01</li>
  <li>URL: <a href="https://vim.sourceforge.net/scripts/script.php?script_id=365">https://vim.sourceforge.net/scripts/script.php?script_id=365</a></li>
 </ul>
 <p>This one provides a Bash scripting IDE for Vim and gVim. I find it most usable in gVim where it offers a comprehensive set of menus which you can see in the example.</p>
 <p>From the Help text:</p><pre>
  It is written to considerably speed up writing code in a consistent style.
  This is done by inserting complete statements, comments, idioms, and code
  snippets. Syntax checking, running a script, starting a debugger can be done
  with a keystroke. There are many additional hints and options which can
  improve speed and comfort when writing shell scripts.
</pre><p><a href="https://www.hackerpublicradio.org/eps/hpr1091/Bash-support.png"><img align="middle" alt="" border="0" src="https://www.hackerpublicradio.org/eps/hpr1091/thumb.Bash-support.png" /></a></p>
 <p>The plugin can be used from the menu or by typing short-cut sequences such as <strong><code>\ct</code></strong> which inserts the current date and time at the cursor position. It's an amazingly detailed package that's well worth dedicating the time to learn if you often write Bash scripts.</p>
 <hr />
 <p><strong><u>Perl-support</u></strong></p>
 <ul>
  <li>Author: Fritz Mehner</li>
  <li>Version: 5.1</li>
  <li>Updated: 2012-06-01</li>
  <li>URL: <a href="https://www.vim.org/scripts/script.php?script_id=556">https://www.vim.org/scripts/script.php?script_id=556</a></li>
 </ul>
 <p>This plugin provides a Perl scripting IDE for Vim and gVim. As with the Bash plugin from the same author I find it most useful from gVim where the menus can be used to perform a wide range of actions.</p>
 <p>Again, you can use it to insert statements, boilerplate text and comments, in a similar way to the Bash plugin. You can also get regular expression help, check, run and debug the script</p>
 <p>Two of the functions I find particularly useful are <strong><code>perltidy</code></strong> and <strong><code>perlcritic</code></strong>. Perltidy will reformat your Perl script, and Perlcritic will critique it according to the rules based on <i>Damian Conway's</i> book <strong>Perl Best Practices</strong>.</p>
 <p><a href="https://www.hackerpublicradio.org/eps/hpr1091/Perl-support_critic.png"><img align="middle" alt="" border="0" src="https://www.hackerpublicradio.org/eps/hpr1091/thumb.Perl-support_critic.png" /></a></p>
 <p>Note the lower window showing the various problems detected by perlcritic.</p>
 <p>If you are a <code>C</code> or <code>C++</code> programmer Fritz Mehner also provides a plugin for these languages <a href="https://www.vim.org/scripts/script.php?script_id=213">here</a>.</p>
 <hr />
 <p><strong><u>manpageview</u></strong></p>
 <ul>
  <li>Author: Charles E. Campbell, Jr.</li>
  <li>Version: v24</li>
  <li>Updated: 2011-01-03</li>
  <li>URL: <a href="https://www.drchip.org/astronaut/vim/index.html#MANPAGEVIEW">https://www.drchip.org/astronaut/vim/index.html#MANPAGEVIEW</a></li>
 </ul>
 <p>This is a man page viewer for use within Vim. Use <strong><code>:Man topic</code></strong> or press <strong><code>K</code></strong> on a keyword. Can view perl, php and python help.</p>
 <p>This is a great way to view man pages, with the ability to search and cut and paste the contents.</p>
 <hr />
 <p><strong><u>Surround</u></strong></p>
 <ul>
  <li>Author: Tim Pope</li>
  <li>Version: 1.90</li>
  <li>Updated: 2010-03-06</li>
  <li>URL: <a href="https://www.vim.org/scripts/script.php?script_id=1697">https://www.vim.org/scripts/script.php?script_id=1697</a></li>
 </ul>
 <p>The plugin provides mappings to easily delete, change and add "surroundings" such as quotes, braces and parentheses.</p>
 <p>The following extract from the Help text should make this clearer:</p><pre>
  Consider the following examples.  An asterisk (*) is used to denote the cursor
  position.
  
    Old text                  Command     New text
    "Hello *world!"           ds"         Hello world!
    [123+4*56]/2              cs])        (123+456)/2
    "Look ma, I'm *HTML!"     cs"&lt;q&gt;      &lt;q&gt;Look ma, I'm HTML!&lt;/q&gt;
    if *x&gt;3 {                 ysW(        if ( x&gt;3 ) {
    my $str = *whee!;         vlllls'     my $str = 'whee!';
</pre><hr />
 <p><strong><u>Fugitive</u></strong></p>
 <ul>
  <li>Author: Tim Pope</li>
  <li>Version: 1.2</li>
  <li>Updated: 2011-04-29</li>
  <li>URL: <a href="https://www.vim.org/scripts/script.php?script_id=2975">https://www.vim.org/scripts/script.php?script_id=2975</a></li>
 </ul>
 <p>A very powerful interface to git.</p>
 <p><a href="https://www.hackerpublicradio.org/eps/hpr1091/Fugitive.png"><img align="middle" alt="" border="0" src="https://www.hackerpublicradio.org/eps/hpr1091/thumb.Fugitive.png" /></a></p>
 <p>The image shows the result of the <strong><code>:Gstatus</code></strong> command which is equivalent to typing <strong><code>git status</code></strong> on the command line.</p>
 <hr />
 <p><strong><u>Taglist</u></strong></p>
 <ul>
  <li>Author: Yegappan Lakshmanan</li>
  <li>Version: 4.5</li>
  <li>Updated: 2007-09-21</li>
  <li>URL: <a href="https://www.vim.org/scripts/script.php?script_id=273">https://www.vim.org/scripts/script.php?script_id=273</a></li>
 </ul>
 <p>This plugin provides source code browsing by listing tags (functions, classes, structures, variables, etc.). The list is in a window in Vim or in a menu in gVim.</p>
 <p>The plugin makes us of the <u>Exuberant Ctags</u> utility to index tags in a source file. I believe that most Linux distributions ship with this utility, but if not it seems to be easily available in repositories.</p>
 <p><a href="https://www.hackerpublicradio.org/eps/hpr1091/Taglist_window.png"><img align="middle" alt="" border="0" src="https://www.hackerpublicradio.org/eps/hpr1091/thumb.Taglist_window.png" /></a></p>
 <p>The image shows gVim with the tag list in a window. I find the menu in gVim more useful myself.</p>
 <hr />
 <p><strong><u>Supertab</u></strong></p>
 <ul>
  <li>Author: Eric Van Dewoestine</li>
  <li>Version: 2.0</li>
  <li>Updated: 2012-06-01</li>
  <li>URL: <a href="https://www.vim.org/scripts/script.php?script_id=1643">https://www.vim.org/scripts/script.php?script_id=1643</a></li>
 </ul>
 <p>Provides insert completion functionality using the Tab key.</p>
 <p><a href="https://www.hackerpublicradio.org/eps/hpr1091/Supertab.png"><img align="middle" alt="" border="0" src="https://www.hackerpublicradio.org/eps/hpr1091/thumb.Supertab.png" /></a></p>
 <p>The example shows a Perl script where the choice being made from the list offered by Supertab is <strong><code>uptodate</code></strong>. Note also that manpageview is being used to view the manpage for the <strong><code>CPAN</code></strong> module.</p>
 <p>It has taken me a while to learn <u>not</u> to use the Tab key to enter TAB characters but to use CTRL-Tab instead. However, I have decided that the advantages of redefining the Tab key in this way outweigh the disadvantages. You might not agree!</p>