19.12.2011, 00:59
Hi friends,
SublimeText 2 is a powerful text editor, like notepad++ for example, but better, i think.
It's possible to create some plugins with python language.
So, i've created a small script for compile a PAWN script with sublimetext.
How to proceed ?
Step 1 : On the menu >> Tools -> New Plugin...
Step 2 : In the new window, you need to put the script :
Gist : link
You need to replace "C:\path\to\pawncc.exe" by your pawncc.exe path.
Step 3 : Now we need to create the shortcut for execute the compilation.
So : Preferences -> Key Bindings - User and add this line :
Step 4 : Save all!
Now when you want to compile your script, you have just to press ctrl+shift+p
I hope this tutorial can help somebody.
PS : I'm sorry for my english, i'm french so if you see many mistakes i'm sorry. You can correct me, for make my english better!
SublimeText 2 is a powerful text editor, like notepad++ for example, but better, i think.
It's possible to create some plugins with python language.
So, i've created a small script for compile a PAWN script with sublimetext.
How to proceed ?
Step 1 : On the menu >> Tools -> New Plugin...
Step 2 : In the new window, you need to put the script :
PHP код:
import sublime, sublime_plugin
import os
class PawnoCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.window().run_command('pawno_compile')
class PawnoCompileCommand(sublime_plugin.WindowCommand):
def run(self):
filePath = self.window.active_view().file_name()
dirName = os.path.dirname(filePath);
os.system("C:\path\to\pawncc.exe \""+filePath+"\" -D\""+dirName+"\" & pause");
You need to replace "C:\path\to\pawncc.exe" by your pawncc.exe path.
Step 3 : Now we need to create the shortcut for execute the compilation.
So : Preferences -> Key Bindings - User and add this line :
Код:
{ "keys": ["ctrl+shift+p"], "command": "pawno" }
Now when you want to compile your script, you have just to press ctrl+shift+p
I hope this tutorial can help somebody.
PS : I'm sorry for my english, i'm french so if you see many mistakes i'm sorry. You can correct me, for make my english better!