sponsor Vim development Vim logo Vim Book Ad

vim-forrestgump : Run code inline and on-the-fly in vim. Inspired by TextMate's ⌘R.

 script karma  Rating 13/4, Downloaded by 361    Comments, bugs, improvements  Vim wiki

created by
Henrik Lissner
script type
One thing I miss from textmate? ⌘R and ⌥⌘R.

The former would run the current script and display output in a separate window. The latter would run selected code (or the current line).

This simple plugin aims to mimic that.

The following interpreters should work out of the box (and can be changed to your liking):

let g:forrestgumps = {
    "php":           ["php", "<?php "],
    "python":      ["python"],
    "ruby":          ["ruby"],
    "perl":           ["perl"],
    "javascript": ["node"],
    "coffee":       ["coffee"],
    "sh":             ["sh"],

    " Example:
    "&filetype":   ["/usr/bin/&filetype", "Prepend this to code"]


    nmap <leader>r      Run entire file (doesn't have to be saved)
    vmap <leader>r      Run current or selected line(s)
install details
Unzip the tarball, and put the files into their respective ~/.vim/* folders. Alternatively, I'd recommend Vundle (https://github.com/gmarik/vundle), then all you'd need is:

    Bundle "hlissner/vim-forrestgump"

Then restart and run:


rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim-forrestgump.tar.gz 1.0.2 2013-03-17 7.0 Henrik Lissner - Add shebang detection
vim-forrestgump.tar.gz 1.0.1 2013-03-09 7.0 Henrik Lissner Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo