HPR1091: Useful Vim Plugins




Hacker Public Radio show

Summary: Useful Vim Plugins Dave Morriss Last Updated: 2012-10-06 I started learning vi a long time ago when I first encountered Unix systems. In those days you could usually count on a system having vi (or at a pinch, when the system would only boot into single user mode, ed). Learning Emacs did't seem like a good choice since it wasn't usually available on the systems I was administering. I dont 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. 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 http://www.installationwiki.com/Installing_Vim_Scripts. NERDTree Author: Marty Grenfell Version: 4.2.0 Updated: 2011-12-28 URL: http://www.vim.org/scripts/script.php?script_id=1658 This plugin provides a file browser within Vim/gVim. A particular directory is opened by typing :NERDTree somedir. A tree is displayed in a window which can be scrolled and traversed to find files to edit. In case you're interested, the colour theme I use in gVim is "Murphy". Type :h NERD_tree for the large and comprehensive help file. I prefer to use NERDTree in gVim and not in Vim. To achieve this I have the following in my ~/.vimrc " 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 Bash-support Author: Fritz Mehner Version: 3.10 Updated: 2012-06-01 URL: http://vim.sourceforge.net/scripts/script.php?script_id=365 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. From the Help text: 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. The plugin can be used from the menu or by typing short-cut sequences such as ct 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. Perl-support Author: Fritz Mehner Version: 5.1 Updated: 2012-06-01 URL: http://ww