Pawn language settings for Sublime Text 3. Copied from C++ but with Pawn language and SA:MP specific modifications.
- Total 13K
- Win 12K
- OS X 236
- Linux 346
|Aug 25||Aug 24||Aug 23||Aug 22||Aug 21||Aug 20||Aug 19||Aug 18||Aug 17||Aug 16||Aug 15||Aug 14||Aug 13||Aug 12||Aug 11||Aug 10||Aug 9||Aug 8||Aug 7||Aug 6||Aug 5||Aug 4||Aug 3||Aug 2||Aug 1||Jul 31||Jul 30||Jul 29||Jul 28||Jul 27||Jul 26||Jul 25||Jul 24||Jul 23||Jul 22||Jul 21||Jul 20||Jul 19||Jul 18||Jul 17||Jul 16||Jul 15||Jul 14||Jul 13||Jul 12||Jul 11|
Pawn Tools for Sublime Text
Sublime Text is an extremely feature-rich and customisable plain-text editor. It's customisability is powered by Python scripting and there are a huge amount of extensions available. Sublime Text gives you an amazing toolset tailored to speeding up your writing workflow whether that is code, articles or just quick notes. (Example: I wrote this entire article in Sublime using an Evernote + Markdown extension)
Here's a quick overview of my five favourite features.
Multiple selection By far my favourite feature. Place as many carets as you want, select as much text as you want. Hold the CTRL button and tap the LMB to place a caret. Or click-drag MMB to select a 'rectangle' of text. CTRL+D will select the next instance of whatever text you have selected and ALT+F3 instantly selects every instance.
A zoomed out version of your code that you can use to scroll around. Very handy for large files.
Snippets are templates of commonly used phrases that you can trigger by typing a
certain set of characters. For instance, I can type
ALS and all the code for
an ALS hook will be inserted. Then I can tap TAB to cycle through each editable
part of the template (prefix, function name and parameters)
Convert to tabs, tab size, encoding and syntax buttons Okay, not exactly unique to Sublime but all handily placed at the bottom right. I code with tabs, but a lot of the time I need to push somewhere that only accepts spaces so conversion is useful.
Everything is JSON, Python or XML. Settings and key bindings are all stored in JSON format files and can be overwritten with user specific sets of settings. As soon as a change is made, Sublime reloads the settings and updates before your eyes! Extension scripts are written in Python and can expand the editor a lot.
Download and install Sublime Text for your operating system on the official site.
The software is available for free evaluation without any restrictions or hindrance aside from a small message box that pops up when saving sometimes. I encourage you support the development of this software if possible though!
Pawn Language Plugin
I created a Pawn language pack for sublime text which includes a ton of useful stuff such as a build configuration, syntax highlighting (modified C syntax) and snippets for common Pawn/SA:MP boilerplate code.
You can quickly install this if you have
Package Control installed. Simply open the Command
Palette with CTRL+Shift+P, type
Package Control: Install Package:
Once the list has loaded, search for the
Pawn Syntax package and hit enter:
Now the package is installed, you need to generate a build configuration so that
Sublime Text can talk to
pawncc - the Pawn compiler. If you came from Pawno,
the compiler is located in the Pawno directory and it's named
You can also install manually by getting the source from GitHub and dropping
files from the repo into the
Data\Packages\Pawn-Syntax\ directory which is
located either in your Documents, AppData or Program Files directory for Sublime
If you use sampctl you don't need to do any of
sampctl package init and select
Sublime Text as your preferred
editor, a build configuration will be automatically generated for you.
If you came from Pawno, follow these instructions to get set up.
To set up the Pawn compiler, open
Preferences > Package Settings > Pawn Compiler Settings > Build Settings
Type the path to your Pawn compiler in the input panel that pops up, example:
The file will be automatically named and prompt to be saved, save it in
Data\Packages\User (the save window may automatically open here anyway).
The file that's generated is a
.sublime-build file and I'll go through each
line explaining what it means here.
cmd: is the command to pass. You can include compiler flags such as
-Z+in their own argument strings after this.
fileregex: is a regex used to parse error/warning output. This allows you to double-click errors/warnings to jump directly to the file and line.
workingdir: is the path to the directory where
pawncc.exeis stored. This is the string that's set by your input.
The Pawn Syntax package includes auto-complete files for all SA:MP natives as well as a lot of popular libraries.
Key bindings are stored in JSON format inside
.sublime-keymap files. There are
default key bindings, user key bindings and package specific key binds which
conveniently overwrite each other in that reverse order.
In the Pawn Syntax package, I've included a small set of key bindings some of which emulate Pawno and others I just find useful:
f3: Find next
f4: Find previous
ctrl+r: Open the output panel (where warnings and errors appear)
f5: Compile the current file
pause: Cancels compilation (very useful if you realise you forgot something just after compiling!)
See this page for a list of contributors to this project.