mtth / scratch.vim

Unobtrusive scratch window
MIT License
395 stars 32 forks source link

Open the scratch window into a system command #20

Closed andreiglingeanu closed 8 years ago

andreiglingeanu commented 8 years ago

I've set my filetype to javascript and tried to load execute the scratch window with node, like this: !node %. It tried to open the __Scratch__ file. Is there a way to make it open the file specified in g:scratch_persistence_file?

Let me know if I can help with a pull request, I don't know where to look for a solution.

mtth commented 8 years ago

Hey, thanks for the offer! You should already be able to do what you want by changing your command to:

:execute '!node ' . g:scratch_persistence_file

In most cases, you can also run it without having a backing underlying file at all (streaming the file via stdin instead):

:w !node

Does either solution address your use-case?

andreiglingeanu commented 8 years ago

@mtth Huh, didn't know about the second way of doing it.

Thank you, that looks like a solution to me!