Skip to content

Configuration

Lyle Lowry edited this page Jun 24, 2020 · 1 revision

Minecraft Version

This plugin has the amazing ability to change to a different Minecraft version on-the-fly. If you put the version anywhere in the header, the plugin will change to that version the next time the file reloads (using :e or :sy on). You can also put :let g:mcversion='[version]' in your .vimrc to set the default version. If no version is specified, the most recent release will be used. The options for the version are:

  • latest: the latest snapshot that has been released, no matter what kind, including experimental snapshots.
  • The name of a specific snapshot. Examples include: 18w43a, 1.14.3p3, 1.14.3Pre3, 1.15.2, 1.16, combat4, 1.16rc1.
  • Any combination of release, candidate (as in release candidate), prerelease, snapshot, and experimental.
    • Specifying snapshot means any snapshot that is of the form YYwWWn (eg 18w43b).
    • snapshot and prerelease only mean themselves, and do not imply any other type.
    • The latest snapshot that is one of the specified types will be chosen.
    • Example: release candidate prerelease snapshot will go with the latest main-track snapshot (so will r c p s).

Versions are not case-sensitive, and keywords follow vim's "only need the first part" standard. For example, p, Pre, and pReReLeAsE all mean the same thing. Lastly, if you put the version in the header, it must be the name of a snapshot, not a keyword such as latest.

Colors

Vim has a system to set the highlighting for most languages at once. For example, you can set the highlighting for comments and it will apply to any language whether it's C, Python, Assembly, or (with this plugin) mcfunction. However, beyond errors, comments, and messages for chat (messages highlight as strings), mcfunction is far too different from other languages to use this feature. So if you would like to change the color scheme, you will need to navigate to the plugin's directory and edit ./syntax/mcfunctoin/highlight.vim. After you do so, make sure to run git commit -a so that your changes will be saved upon update (which happens fairly often, in fact weekly during snapshot season). If you would like to return to the plugin's default highlighting, run git reset --hard origin/master (while in the plugin's directory).

Optimizations

This plugin makes vim take noticeably longer to start up (thankfully only when loading a .mcfunction file), so some parts may be skipped to speed things up. It's recommended you leave these on unless your computer is really slow.

  • g:mcEnableBuiltinIDs - Minecraft has thousands of builtins including blocks, items, entities, sounds, gamerules, advancements, and many more. As such, it can take a moment to load a file as the plugin must read thousands of lines (~1330 as of 1.16, more than half of the entire plugin's syntax definitions) to know what builtins to highlight. Default 1 (Highlight builtins).
  • g:mcEnableBuiltinJSON - Use the JSON syntax highlighting that comes with vim. If you get some error about json, or you just want it to load like 2% faster, try putting let g:mcEnableBuiltinJSON=0 in your .vimrc. Default 1 (Use the json highlighting that comes with vim).

Other options

  • g:mcEnableMP - Enable multiplayer commands. Don't count on these being perfectly reliable as I have not had any way of testing them. Default 0 (Don't highlight multiplayer commands). You also need to be using 1.14.4-pre4 or higher, and set the function-permission-level to 3 or 4.
  • g:IllegalNames - Relax the restrictions on player names to allow for illegal names. Default none (Only allow legal names). Can be none, all, or any combination of:
    • short - allow names shorter than 3 characters (recommended if your datapack uses CarpetMod)
    • long - allow names longer than 16 characters
    • symbol - allow illegal symbols
  • g:mcDebugging - Enable certain commands for debugging porpoises. Default 0 (Don't debug dolphins).
Clone this wiki locally