[Tutorial] PAWN for SA-MP in Sublime Text 2
#1

PAWN for Sublime Text
http://www.sublimetext.com/

EDIT: Southclaw's work is more complete, I suggest using that.

Description
This adds syntax highlighter for pawn language (.pwn and .inc files) and samp function and define auto completion.

Files
Download the neccessarry files. Setup
  1. Download sublime text 2 (skip this step if you already have it)
  2. Open user package folder by going to Sublime text 2 -> Preferences -> Browse Packages... -> User (see images 1 and 2)
  3. Drop the just downloaded files into User folder.
  4. Restart Sublime Text 2.
  5. In case it doesnt automatically detect .pwn files, go to Sublime text 2 -> View - Syntax - Pawn (see image 3)
Image 1:

Image 2:

Image 3:



Compiling
This was written by Conroy (source).

Open up Sublime Text 2 and go to Tools -> Build System -> New Build System...

Use the following build code:
Код:
{
	"cmd": ["${project_path:${folder}}/pawno/pawncc.exe", "$file_name", "-;+", "-v2", "-d3", "-\\)+"],
	"working_dir": "${file_path}",
	"file_regex": "^([^\\.]+\\.pwn)\\((\\d+)\\)() : (.*)$",
	"variants": [
		{
			"cmd": ["${project_path:${folder}}/pawno/pawncc.exe", "$file_name", "-;+", "-v2", "-d3", "-\\)+", "-l"],
			"working_dir": "${file_path}",
			"name": "Preprocessed output"
		},
		{
			"cmd": ["${project_path:${folder}}/pawno/pawncc.exe", "$file_name", "-;+", "-v2", "-d3", "-\\)+", "-a"],
			"working_dir": "${file_path}",
			"name": "P-code output"
		}
	]
}
Build code provided by user Misuir. (source, github)


Of course you need to replace the path

Save this file and close Sublime Text 2

Now navigate to AppData/Roaming/Sublime Text 2/Packages/User

Open up the .sublime-keymap file based on your operating system

Enter the following (this example is for the Windows file):
Код:
[
	{ "keys": ["f5"], "command": "build" }
]
You can change f5 to another key if you wish

Save and reopen Sublime Text 2

Now go to Tools -> Build System

Click on the name of the build you created

You can now compile your scripts by pressing the button you assigned, enjoy...

Additional Notes
If you witness any bugs, please let me know by replying in this topic.
Reply


Messages In This Thread
PAWN for SA-MP in Sublime Text 2 - by Macluawn - 23.06.2013, 23:12
Re: PAWN for SA-MP in Sublime Text 2 - by PaulDinam - 24.06.2013, 00:56
Re: PAWN for SA-MP in Sublime Text 2 - by Cameryn - 24.06.2013, 05:26
Re: PAWN for SA-MP in Sublime Text 2 - by StreetGT - 24.06.2013, 12:39
Re: PAWN for SA-MP in Sublime Text 2 - by Macluawn - 24.06.2013, 12:56
Re: PAWN for SA-MP in Sublime Text 2 - by dipsnark - 23.07.2013, 18:44
Re: PAWN for SA-MP in Sublime Text 2 - by Aprezt - 23.07.2013, 21:23
Re : PAWN for SA-MP in Sublime Text 2 - by Garwan50 - 24.07.2013, 00:05
Re : PAWN for SA-MP in Sublime Text 2 - by Garwan50 - 24.07.2013, 00:28
Re: PAWN for SA-MP in Sublime Text 2 - by Micius - 24.07.2013, 09:06
Re : PAWN for SA-MP in Sublime Text 2 - by Garwan50 - 25.07.2013, 15:39
Re : PAWN for SA-MP in Sublime Text 2 - by Garwan50 - 28.07.2013, 00:15
Re : PAWN for SA-MP in Sublime Text 2 - by Garwan50 - 30.07.2013, 02:33
Re: PAWN for SA-MP in Sublime Text 2 - by JusstinRoller - 30.07.2013, 04:25
Re: PAWN for SA-MP in Sublime Text 2 - by JusstinRoller - 30.07.2013, 07:11
Re : PAWN for SA-MP in Sublime Text 2 - by Garwan50 - 30.07.2013, 15:24
Re : PAWN for SA-MP in Sublime Text 2 - by Garwan50 - 30.07.2013, 15:51
Re: PAWN for SA-MP in Sublime Text 2 - by Macluawn - 30.07.2013, 20:25
Re: PAWN for SA-MP in Sublime Text 2 - by Binx - 31.07.2013, 15:15
Re: PAWN for SA-MP in Sublime Text 2 - by Misiur - 09.10.2013, 10:52
Re: PAWN for SA-MP in Sublime Text 2 - by iFiras - 09.10.2013, 11:13
Re: PAWN for SA-MP in Sublime Text 2 - by Memorex™ - 14.10.2013, 23:19
Re: PAWN for SA-MP in Sublime Text 2 - by rafikk - 25.10.2013, 20:40
Re: PAWN for SA-MP in Sublime Text 2 - by rafikk - 29.10.2013, 16:15
Re: PAWN for SA-MP in Sublime Text 2 - by manoc - 30.10.2013, 05:53
Re: PAWN for SA-MP in Sublime Text 2 - by PaulDinam - 30.10.2013, 15:14
Re: PAWN for SA-MP in Sublime Text 2 - by Misiur - 03.11.2013, 18:08
Re: PAWN for SA-MP in Sublime Text 2 - by Vanter - 04.02.2014, 12:48
Respuesta: Re: PAWN for SA-MP in Sublime Text 2 - by TheChaoz - 04.02.2014, 13:17
Re: PAWN for SA-MP in Sublime Text 2 - by Guest4390857394857 - 30.04.2014, 17:52
Re: PAWN for SA-MP in Sublime Text 2 - by Joey^ - 24.07.2014, 12:51
Re: PAWN for SA-MP in Sublime Text 2 - by Macluawn - 15.08.2014, 20:54
Re: PAWN for SA-MP in Sublime Text 2 - by M134Minigun - 13.10.2014, 13:10
Re: PAWN for SA-MP in Sublime Text 2 - by FuznesS - 21.10.2014, 16:20
Re: PAWN for SA-MP in Sublime Text 2 - by DeViL_GSB - 23.10.2014, 05:05
Re: PAWN for SA-MP in Sublime Text 2 - by welderlourenco - 08.12.2014, 19:14
Re: PAWN for SA-MP in Sublime Text 2 - by CoaPsyFactor - 30.05.2015, 22:13
Re: PAWN for SA-MP in Sublime Text 2 - by CharCoast - 08.06.2015, 22:43
Re: PAWN for SA-MP in Sublime Text 2 - by sakang - 12.06.2015, 12:48
Respuesta: PAWN for SA-MP in Sublime Text 2 - by Dreyfuz - 15.08.2015, 03:04

Forum Jump:


Users browsing this thread: 1 Guest(s)