Vim Shell

Configuration
The following command maps -return to executing the current line in the shell. " mark position, execute line, jump back to original position :nmap  mZ:exe "r!" . getline('.')'Z

Usage
The output of the command is pasted into Vim. If you don't want the output, just press 'u' to undo. date         <- press -return Sun Jul 12 11:33:17 CEST 2009 This kind of editor / shell is a throwback to old school computers like the Commodore 64 or the Acorn Electron, where the editor and shell were integrated. However, obviously Vim is superior due to better editing facilities and unlimited space for command history. This cute example requires SSH: ssh server.com df -h        <- press -return Filesystem           Size  Used Avail Use% Mounted on /dev/sda3              73G   16G   54G  22% / udev                  10M  164K  9.9M   2% /dev shm                  500M     0  500M   0% /dev/shm /dev/sda1             38M   30M  6.9M  82% /boot Mapping the command to  like on the old school computers is not a good idea, as this will break the q: command-line window.

Configuration
The following command maps r to evaluating the current line using Ruby. Note that Vim needs Ruby support to be compiled in for this to work (i.e. +ruby): :nmap r :ruby b=VIM::Buffer.current;b.append(b.line_number,eval(b.line).to_s)

Usage
Using Ruby as a calculator is very handy: 2**24        <- press r 16777216 You can include Math: include Math <- press r cos(PI)      <- press r -1.0