Skip to content

Instantly share code, notes, and snippets.

@filipebarcos
Created October 28, 2012 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filipebarcos/3967567 to your computer and use it in GitHub Desktop.
Save filipebarcos/3967567 to your computer and use it in GitHub Desktop.
Create an Automator Services to open files and folder on VIM
on run {input, parameters}
tell application "Terminal"
activate
if (the (count of the window) = 0) or ¬
(the busy of window 1 = true) then
tell application "System Events"
keystroke "n" using command down
end tell
end if
do script "vim \"" & (POSIX path of (input as string)) & "\"" in window 1
end tell
return input
end run

If you use VIM you are like me, uses VIM as IDE, this workflow can be useful for you. I create an workflow using Automator to open the selected folder on Finder to be opened using VIM.

  1. Go to Automator and create a new Service
  2. Go to Actions/Utilities and select "Run Apple Script"
  3. On Services options, select the following options:
    1. Service receiver selected FOLDER AND FILES in FINDER.APP
  4. Copy the following apple script and save it.
  5. Voila! Test it and be happy ;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment