Run a sublime plugin from the command line? - sublimetext2

how can I run a sublime plugin from the command line?
I have read of a subl --command but it seems to be for osx and i'm on windows. http://www.sublimetext.com/docs/2/osx_command_line.html I see nothing there to call a plugin, and the commands don't seem to work for sublime_text.exe
i'm on Windows, with sublime_text.exe

Sublime Text plugins do not offer command line interfaces.
Many times Sublime Text plugins wrap an external command (csslint, jshint, etc.) which is run as a subprocess by the plugin. Because your question does not specify which plugin you want to run it is impossible to tell whether or not this plugin is based on an external program.
I'd rather suggest you to ask your question in more sense "How do I solve problem X from the command line" as it sounds you are approaching the problem from the wrong angle.

Related

Sublime Text 3 - Sublime Linter 3 - Why isn't "HTML Tidy" working?

I'm a brand new coder trying to wean myself off of the Codecademy web environment. I'm using Sublime Text 3 in tandem with Sublime Linter 3 in order to approximate the real-time error-checking to which I've become accustomed from Codecademy's site.
I know that each linter needs to be installed separately in ST3 and I've successfully integrated "csslint" and "jshint". Both work properly.
Now, I'm trying to get an html linter to error-check my html code and I can only seem to find "HTML Tidy", which I have installed via package control. Unlike the aforementioned linters, which simply require a pre-defined command line string for input at terminal, online tutorials have me installing "HTML tidy" via a winrar executable.
Now I am regrouping and would greatly appreciate any feedback you can provide that might move me incrementally closer to having a working HTML linter. I am using a windows xp computer. Many kind thanks for your help.
According to the Installation Instructions for the plugin, there is a Windows binary for Tidy available here.
For some background, Tidy is a command line tool that comes pre-installed with Mac and Linux but not Windows. Downloading the binary mentioned here and placing it in your path will allow it to be run. To check where it should be placed, run echo %path% from the command line.
Once that is there it will work. To see the available arguments to be run with Tidy, run tidy -help from the command line. These arguments can be added to "args" linter settings.
Just copy tiny.exe to folder C:\Windows\System32\, and restart ST3.

How to compile source file

I really love Sublime Text 2 and I want to use it for Software programming.
The problem is that our source files are stored on a Linux server and we all work using PuTTy to connect and Vim to edit the code. We can compile the source by executing a command in PuTTy.
I want to use Sublime Text 2 for coding (the folders in Linux are mounted on our Windows system so the files can be opened in Windows). But whenever I want to compile, I have to open PuTTy and compile manually which asks a lot of time. Can I automate this somehow? Like if I push a button (F8 for example) then PuTTy opens, connects to the Linux server with SSH goes to the correct folder and compiles the source file. Is this possible?
Thanks for any help!
Sublime Build Systems can be used to launch a process like this.
I'm not sure if you can automate anything using putty. But the fork named ExtraPutty allows this: it is scriptable using Lua, an you can launch a script from command line.
If you arefamiliar with Javascript, another alternative would be to use Grunt + a module like SSH2 to automate you compilation process, then launch it from a Sublime build system. The ssh module does not allow interactive commands to be scripted, so I recommend you to use SSH2.
There are many other options; pick the one with which you're the more confortable, then use Sublime Build system to launch it.

Hart'ls Ruby Tutorial - Subl Gemfile not recognized

I'm brand new to Ruby and Rails, so sorry if this is a totally ridiculous question. The tutorial book that I'm reading says that I should be able to launch a Gemfile in Sublime Text directly from the command prompt using the subl Gemfile command. When I try this, I get an error that says "subl is not recognized as an internal or external command, operable program, or batch file".
I am in the right directory where the Gemfile is located.
Ruby is definitely installed and I am using the command prompt with Ruby and Rails.
i have the sublime text 2 and i added the path as i found,but no solution.i even tried :sublime_text Gemfile
i have tried so many different solutions but no result.
i'm using windows
Thank you in advance
the reason it isn't working isn't a rails question, it is because you haven't set up sublime to work using the command "subl" in your terminal. Try these commands. If you wish to understand the error better, just type in any gibberish into the terminal. It will tell you a similar thing.
sudomkdir /usr/local
sudomkdir /usr/local/bin
sudo ln-s/Applications/Sublime\Text\2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
EDIT
Sublime Text from Command Line (Win7)
https://teamtreehouse.com/forum/sublime-text-command-line-shortcut-windows
https://teamtreehouse.com/forum/ruby-on-rails-subl-command-not-found
Otherwise, you can refer to this
subl is Mac only.
For Windows, you need to add C:\Program Files (x86)\Sublime Text 2 to your Environment path,
This will work on Windows 7:
Right click My Computer, Properties, then Advanced System Settings, then Environment Variables.. Go down to System Variables, and edit PATH, you'll need to add the Path to Sublime.
Then you should be able to run sublime_text my-file from the command line. (Since the .exe is called sublime_text.exe

Run linux command within sublime plugin

I am currently writing a simple plugin for Sublime Text 2 to make a shortcut, running pdflatex program with my opened file as an option.
So there is a question: is there any way to run linux command from sublime? I haven't found appropriate function in Plugin API Reference.

Send Text to REPL Using SublimeREPL and Sublime Text 2

I'm having trouble getting started with SublimeREPL. I have a python program, and can start a python interpreter inside of SublimeText2.
However, I would like to use either the Eval In Repl and Transfer to Repl features, but they don't seem to do anything. How do I associate a repl with my file in sublime text 2 so these will work?
History
To be honest eval for python never worked reliably. It was plagued with strange compilation errors (mainly caused by whitespace/blank lines) and dozens of unnecessary ">>> " prompts showing up during evaluation.
My attempt to fix it using temporary files was only moderately successful and broke down completely with the ability to run remote Pythons over ssh: http://www.youtube.com/watch?v=zodAqBvKQm0
Now
However it seems that I've finally cracked it :) (with a surprisingly short solution that feels hacky but AFAICT should be orders of magnitude more reliable than the previous one, link for the curious: https://github.com/wuub/SublimeREPL/blob/master/text_transfer.py#L43)
Howto
Install SublimeREPL 1.2.0 (released +- 10 minutes ago)
Run Python REPL (any one you wish, w/ or w/o virtualenv)
Focus a file you wish to evaluate
Tools -> SublimeREPL -> Eval in REPL -> File or [Ctrl+, f]
Play with other options (line evaluation should be useful, you only need one cursor in each line you wish to eval, try [Ctrl+Alt+<down-arrow>])
...
Profit! :)
I had the same problem, namely SublimeREPL wouldn't evaluate a file or selected lines. Amazingly this worked:
Remove REPL (Preferences-> Package Control -> Remove package)
Quit and restart Sublime Text
Install REPL (Preferences-> Package Control -> Install package)
Quit and restart Sublime Text
Voila!