Skip to content

giucal/open-in-vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

open-in-vim.js

This is a macOS automation script meant to be incorporated in an Automator workflow or application. It opens the provided files inside Vim in a new iTerm2 window.

It uses JXA, JavaScript for Automation, an equally obscure and badly documented feature as AppleScript automation.

How to use

  • Open Automator and choose to create an application.
  • Drag the the "Run JavaScript" action in the workflow.
  • Replace the existing boilerplate code with the script.
  • Save the application (as, say, "Vim").

The application can be launched, dragged on, and bound to file types.

How to hack

If you're curious about how this script could be extended, open the Script Editor app and have a look at iTerm's "dictionary":

  • File > Open Dictionary...;
  • Choose iTerm.app;
  • Change the language from AppleScript to JavaScript in the upper menu.

To test this script:

sh test.sh ...

Note that it takes absolute paths!

About

Open files within iTerm/Vim

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published