ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

MKB

by KeeMeng ST3

Macro/Keybind Mod Syntax Highlighting for Sublime Text 3/4 (For Minecraft 1.6.2-1.12.2)

Details

Installs

  • Total 174
  • Win 157
  • Mac 14
  • Linux 3
Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5
Windows 2 0 0 1 2 0 1 0 0 0 0 1 1 1 0 11 0 0 0 0 2 0 1 1 0 0 2 0 0 0 0 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

MKB-Syntax-Highlighting

Macro/Keybind Mod Syntax Highlighting for Sublime Text ¾ with Auto Complete and hints

Syntax highlighting & auto complete supports modules from https://spthiel.github.io/Modules/

Also contains an auto indenter made by Federal

Link to Package Control

Join my discord for support/suggestions/bugs.


Introduction:

This package was made to help coding for Macro Keybind Mod easier. To help you, I made auto complete to suggest possible actions and variable to you, and if you hover over the keywords, you can see a description and example of the command, which was taken from MKB docs. (Thanks Gorlem!) It also has an indenter made by Federal, with a fancy indent function too! After making your code, you can also use a linter to find possible bugs, such as missing brackets. To personalize this package, go to the Context Menu or Edit > MKB menu at the top of Sublime Text ¾, and modify Package Settings.

Brief description of the files in the package include:

File                          | Description
MKB.py                        | Is a Python plugin file, which controls all the popups, autocompletes, indenting, and linter.
MKBdocs.css                   | CSS for dark mode on wiki
MKBdocs.json                  | Gorlem's wiki API used for popup hints.
Main.sublime-menu             | JSON file for the menu at the top.
MKB.sublime-syntax            | Is a YAML file, with many regexes and assigning scopes to the text to make them colorful.
Context.sublime-menu          | JSON file for the menu when you right click the screen.
MKB.sublime-settings          | JSON file for the settings to customize the package.
Default.sublime-keymap        | Auto %% when typing one %. 
MKB.sublime-completions       | Is a JSON file, containing specific "triggers", which will activate the auto complete.
MKB.sublime-color-scheme      | Is a json file for the custom colors of the syntax highlighter.
Miscellaneous.tmPreferences   | Helps with toggling comments.
template.sublime-color-scheme | Template to make your own color scheme (You can send it to me too)

Installing using Package Control

1) If you haven't, install Package Control.

2) Open Package Control: Install Package in the command palette, and search for MKB. Install it, and you might need to restart sublime.

3) Change the language from Plain Text to MKB as your language. You can do this by selecting it at the bottom right corner menu. Sometimes you need to show your status bar (View/Show Status Bar). Alternative, you can right click the screen, click MKB > MKB Language

4) You can also click MKB > Package Settings, and personalize the package eg color scheme, indentation and many other

5) Enjoy! If there's anything wrong ask in #•help


Manual installation

1) Install Sublime Text

2) Install Package Dev

3) Download/clone the repository from https://github.com/KeeMeng/MKB-Syntax-Highlighting

4) Add the custom colors from MKB.sublime-color-scheme, into Tools > Packages > Package Development > Edit Current Color Scheme... Paste the entire json contents into the Right Side of the color scheme, the top of the file should say “THEME.sublime-color-scheme — USER”. Read this website for more details.

5) Put all the files from the repository into a MKB folder Path for Mac: /Users/NAME/Library/Application Support/Sublime Text 3/Packages/MKB Path for windows: C:\Users\%USERNAME%\AppData\Roaming\Sublime Text 3\Packages\[MKB Folder here]

6) Change the language from Plain Text to MKB as your language. You can do this by selecting it at the bottom right corner menu. Sometimes you need to show your status bar (View/Show Status Bar)

7) Go to the top menu, and click MKB/Package Settings, and personalize the package!

8) Select MKB as you language by clicking the bottom right box (If it doesn't show go view > show status bar)

9) Enjoy! If there's anything wrong ask in #•help


Usage:

  • When opening a .txt file (can be configured), and the first line is $${, it will automatically change to MKB syntax. But if it doesnt work, then you can go to the bottom right corner, and change Plain Text to MKB syntax. After that, the colors should appear automatically, along with the auto complete functions.
  • To auto complete a statement, the auto complete menu should automatically appear. Press arrow key up or down to scroll through, press enter to auto complete. Then, press tab and jump to the next parameters.
  • Or press CMD/CTRL + Space to see a list of the possible auto completions.
  • You can also press CTRL + SHIFT + Space to open the inbuilt wiki.
  • To indent your code, you can mess with the settings (Indent when you save, or prompt before it indents). Or, if you want to manually indent, right click the screen and press MKB indent.
  • By default, when you hover over a keyword, you will see a popup with information. To manually show the hint, you can press MKB Hint when you right click. Scroll down for examples, or click “Open Wiki” to open the wiki page on your browser (Can be specified).
  • Right click anywhere for some actions, or go to to Edit > MKB in the top main menu.
  • You can also change the color scheme in MKB > Package Settings, as well as other cool settings
  • If you want to make your own color scheme, follow the steps in MKB > Color Scheme

How does it work?

  • The new sublime syntax will recognize the actions, variables, parameters, iterators and many more keywords of the Macro/Keybind Mod (Also the modules from https://spthiel.github.io/Modules + a few others), using regex statements it assigns a scope to the different parts of your script. The scope is then assigned a color in the color scheme file, and then you get custom syntax highlighting! The default scope is source.mkb.
  • The completions file will help you auto complete statements, also showing basic help for the statement when you press tab. This uses the snippet function of sublime text.
  • The popup uses sublime's API and gorlem's API to find the information for the popup.
  • The indenter reads each line, and will automatically put tabs in front of the lines. Fancy indent adds a delay between indenting the lines, to make it look like a wave.
  • The linter reads each line and checks if theres an even number of %% () "" []
  • The variable inserter finds all variables from the script

Settings:

- Which color scheme to use

- Whether or not for the auto complete to be in uppercase

- What character to use as the whitespace for the buffer

- Whether or not indentation should expand compressed lines

- Whether or not to end lines with semicolon ;

- Whether or not to indent script between $${ and }$$

- Whether or not to automatically indent after saving the file

- Whether or not to prompt a message before indenting, only if enable_indent is on

- Whether or not to use fancy indenting. Put “null” for normal indenting, or put a number representing the delay in ms

- Whether or not to show a message telling you indenting finished

- Whether or not to show hints automatically

- Number of lines to show in the pop up, put a big number to show everything

- Whether or not to indent code after linting code

- Whether or not to show a message after linting code

- Whether or not to auto lint code after editing

- Whether or not to show a message after minifying code

- Which browser to use to open the wiki


Extra:

MKBdocs.css: Is a css file to make https://beta.mkb.gorlem.ml/docs/actions have a dark mode. You can use a chrome extension called stylus to change the css.


Others

If there are any bugs, please tell me, or report it in GitHub. My discord is TKM#6228. If there are any suggestions, please tell me too! Join https://discord.gg/m9yfJtb for support/suggestions/bugs.

Example of the syntax highlighter and the auto complete: Example

Credits to:


Useful links