Created
March 14, 2013 11:34
-
-
Save karthikselva/5160673 to your computer and use it in GitHub Desktop.
Whenever I need to run ruby from VIM I used to exit and run the script and load back VIM. ( Bad )
Then learned to use **:!ruby** which would execute the supplied command in shell and return back. ( Better )
But the below gist would help you run with press of F6 key.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Save the current file and run current ruby script | |
| function! RunRuby() | |
| :w | |
| let name = input('Enter Argument (if any): ') | |
| execute ':!ruby % '.name | |
| endfunc | |
| " Use F6 to trigger a run | |
| map <F6> :call RunRuby()<cr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment