Run linux command within sublime plugin - sublimetext2

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.

Related

Cannot install Emmet for Notepad++

After I downloaded Notepad++, I installed Plugin Manager and tried to install Emmet. Only "Installation of Emmet failed" I saw after that. I've tried everything. Install different versions of Notepad++ (including x86) and Python Script. Tried to install it manually. Nothing worked.
How can I install Emmet on Nodepad++?
UPD: I have deleted everything from APPDATA and used "Programms and Components" to uninstall Notepad++
Emmet doesn't show up on Notepad++ Plugin Manager window. Maybe it's outdated or not compatible anymore. Anyway, when you manually install Emmet and you still can't see the plugin please follow those steps;
Open Notepad++ and install Python Script plugin (available in Plugin Manager)
Then open plugins folder from Plugins menu and extract emmet-npp.zip into plugins folder.
Note: If it doesn't work, you might need to move EmmetNPP.dll file inside EmmetNPP folder.
Now restart Notepad++ and you should see the Emmet plugin in your Plugins menu.
You have to put the "EmmetNPP.dll" file into the "EmmetNPP" plugin folder, after having extracted both files into the plugins folder in Notepad++. The official GitHub site missed out this step.
I did all of the following to get it working. One or two of these steps might not be required, but after the final step it started working (i.e. it appeared on the Plugins menu without needing to install via Plugins Admin, and Emmet functions correctly via the Plugins -> Emmet dropdown menu. Next step is to setup keyboard shortcuts (i.e. Tab) as described elsewhere).
Plugins Admin -> install Python Script (restart NPP)
Download and extract the NPP plugin from https://emmet.io/download/
Copy the extracted EmmetNPP.dll and the EmmetNPP folder into:
%USER%\AppData\Roaming\Notepad++\plugins\config folder
Copy file EmmetNPP.dll file into:
%USER%\AppData\Roaming\Notepad++\plugins\config\EmmetNPP folder
Copy file EmmetNPP.dll file into:
C:\Program Files (x86)\Notepad++\plugins\EmmetNPP folder
Notes:
a. I am using the 32-bit version of NPP; if you are using the 64-bit version then step 5 should copy the EmmetNPP.dll file into:
C:\Program Files\Notepad++\plugins\EmmetNPP folder
b. After step 4, Emmet still did not appear either in the Plugins dropdown OR in the Plugin Admin tool. After step 5, though, it now appears in the Plugins dropdown and is functional. (Note that I was careful to restart NPP after each of the above steps. Future readers will not need to restart after each step (just keep NPP closed for steps 2-5) - I did so to test at what point it started working.)
Emmet is installed on Notepad++ using the plugin manager (full instructions found on Emmet for Notepad++ GitHub repo). If you have installed a clean Notepad++ (latest version) and have installed the Notepad++ plugin manager, use Plugins > Plugin Manager > Show Plugin Manager menu action and find and install “Emmet” plugin.
If this isn't working for you, the first thing I would do is uninstall Notepad++ and all extensions/modifications you've added to it and start fresh:
Install Notepad++
Install Nodepad++ Plugin Manger
Install Emmet from the Plugin Manager menu

Sublime Text 2's phpfmt plugin is not available anymore?

I was used to the phpfmt plugin for Sublime Text, and I'm not able to install it on a fresh installation : the package controller does not seem to find it anymore.
While waiting for a fix, I tried to copy/paste phpfmt folder from Sublime Text's packages folder to my new laptop, but it doesn't seem to work : on the first launch, the plugin is recognized but its directory is deleted.
How can I manually install this plugin ?
As you can see on the Package Control page you linked, the package only supports Sublime Text 3. There's a post on Y Combinator explaining the original author has deleted his version of the package. There is a guide on how to downgrade the package, but I'm not sure that includes Sublime Text 2.

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.

Run a sublime plugin from the command line?

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.

Bind plugin command to Build System?

I am trying to do a build system with advanced commands.
My build command needed project specific settings, so as I didn't found how to load a project setting in a build command, I wrote a plugin to generate my command, but for now I am only able to access such command through the command palette or using a custom menu field.
Is there a way to use a plugin command in a build system action ?