Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

SLIME-like support for running Vim with iTerm2

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 plugin
Octocat-spinner-32 scripts
Octocat-spinner-32 README.md
README.md

iSlime2.vim

SLIME-like support for running vim with iTerm2

What is it?

For the video-inclined watch it here.

It lets you send commands from Vim to an iTerm2 session. This is handy if you need to run a command repeatedly (like a test) and want to see the output. This is especially nice in text-mode Vim, but it works fine from MacVim's GUI too.

It works by using AppleScript to switch to the next iTerm2 Pane (using Cmd+]), writing the appropriate text then switching back (using Cmd+[).

Installation

Include with Vundle, Pathogen or drop the project files into your ~/.vim directory. I use and test this with Vundle.

Caveats

At the moment rather than support all the possible testing methods I have <leader>ft try to run script/test against the current file and <leader>fT pass the current file as path:line_number. I'll include a contrib directory with various testing tools in the near future but for now a simple script/test for Rails would be:

#!/bin/sh
ruby -Itest "$@"

Of course this wouldn't support focused unit testing. More on that to come soon.

If you're using rspec, focused testing works just fine, like so:

#!/bin/sh
rspec "$@"

Usage

For any commands

  • ISlime2 echo hi mom - runs "echo hi mom"
  • <leader>ff - re-runs the last run command
  • <leader>fp - equivalent to hitting up then enter in the terminal

For testing

  • <leader>ft - runs script/test path/to/current/file
  • <leader>fT - runs script/test path/to/current/file:line_number

For REPLs

  • <leader>cc - sends the current paragraph (using vip) or selection to the terminal
  • <leader>cf - sends the whole file to the terminal

Other helpers

  • <leader>fr - runs rake
  • <leader>fd - runs script/deliver which I use to merge to master and deploy to staging

Contributions

Are welcome! Pull request to your heart's content. I'd love to turn this into a general purpose development tool.

License

Copyright © Mat Schaffer. Distributed under the same terms as Vim itself. See :help license.

Thanks

Something went wrong with that request. Please try again.