Konqueror and Vim 7 as IDE

First off, see Viva Vim 7! (installing on Ubuntu Dapper) .

Second off, see Konqueror with Midnight Commander theme on Ubuntu . Now we're all on the same page, with Konqueror (in all its variations) and Vim 7 installed.

Also assumed here is the installation of the ExuberantCtags package, so that ctags can be generated for ruby, php, python, perl, and a host of other languages (see ExuberantCtags) as well as the C language. On my Ubuntu box installation was straightforward with Synaptic.

The main interest here is using (and remembering how to use in between actual programming bouts: different projects hook you on different tool sets) Vim 7 as a lightweight alternative to Eclipse.

That may sound like a mouthful, but we'll see it is not an exaggeration.

First off, see Viva Vim 7! (installing on Ubuntu Dapper) .

Second off, see Konqueror with Midnight Commander theme on Ubuntu . Now we're all on the same page, with Konqueror (in all its variations) and Vim 7 installed.

Also assumed here is the installation of the ExuberantCtags package, so that ctags can be generated for ruby, php, python, perl, and a host of other languages (see ExuberantCtags) as well as the C language. On my Ubuntu box installation was straightforward with Synaptic.

The main interest here is using (and remembering how to use in between actual programming bouts: different projects hook you on different tool sets) Vim 7 as a lightweight alternative to Eclipse.

That may sound like a mouthful, but we'll see it is not an exaggeration.

Now, taking Ruby as an example (as we shall see, you can confine your configuration to language specific files by placing a ruby.vim or php.vim in your own ~/.vim/ftplugin (as configuration replacement for system wide /usr/share/vim/vim70/ftplugin ) or ~/.vim/after/ftplugin (as additional configuration) ) let's see the steps to take to get a usable but lightweight IDE going.

First, take all the necessary steps outlined in the Ruby Garden Vim Ruby Support article.

As a variation, instead of making a ~/.vimrc file only (which would affect all Vim use), I put the following into ~/.vimrc:

set nocompatible      " We're running Vim, not Vi!
syntax on " Enable syntax highlighting
filetype on " Enable filetype detection
filetype indent on " Enable filetype-specific indenting
filetype plugin on " Enable filetype-specific plugins

Then I created a ~/.vim/after/ftplugin/ruby.vim file, as follows:

set tabstop=2
set shiftwidth=2
set expandtab

set hidden

:map <F2> :bnext!<CR>
:imap <F2> <ESC>:bnext!<CR>
:colo peachpuff
set foldmethod=syntax

That set the stage for passing the installation test outlined in the above Ruby Graden article. That is, editing a Ruby file in Vim 7, you will have:

  • Syntax highlighting
  • automatic, smart indenting
  • Intellisense-like autocompletion
  • compiler plugins for Ruby, eRuby and Test::Unit

Similarly, a similar ~/.vim/after/ftplugin/php.vim file as follows:

:colo blue

set expandtab
set tabstop=2 shiftwidth=2 softtabstop=2
set autoindent

set foldmethod=indent

The second main thing you want from an IDE is to be able to jump to referenced classes, functions and other entities in other files, and to be able to see an outline of class elements, like methods, attributes, functions (a built-in class or module browser).

Enter the VimTaglist plugin.

Specifically, the How to Use Vim with Rails page explains how to use ExuberantCtags with VimTaglist to make a Vim Ruby IDE.

Vim 7 as IDEVim 7 as IDEThis is a screenshot of the results so far, based on the Konqueror file browser in "Midnight Commander" mode, with php and ruby files open.

[To do: Add section on jumping from file to file exploring source based on ctags indexing.]

If you feel like going crazy with color schemes, check out the color sampler pack (all 140 color schemes on the Vim scripts website); you can choose by taking a look at the color scheme browser pages .