BoxLang Neovim Plugin
Vim syntax highlighting for BoxLang - a dynamic JVM language and runtime. This plugin provides comprehensive syntax support for BoxLang script files (.bx, .bxs) and template files (.bxm), including mo
Vim syntax highlighting for BoxLang - a dynamic JVM language and runtime.
📖 Overview

This plugin provides comprehensive syntax highlighting for BoxLang script files (.bx, .bxs) and template files (.bxm). It includes support for:
Script Syntax - Pure BoxLang script with modern language features
Template Syntax - Markup-based BoxLang with
bx:tags and HTMLCross-Syntax Embedding - Template islands in script files and
<bx:script>blocks in templates
✨ Features
BoxLang Script Syntax (.bx, .bxs)
Modern Keywords:
class,interface,assert,final,package,abstract,staticControl Flow:
if,else,for,while,do,switch,case,try,catch,finallyOperators:
Standard:
+,-,*,/,%,^,&,&&,||,!Comparison:
==,!=,<>,>,<,>=,<=Strict equality:
===,!==Elvis operator:
?:Bitwise (BoxLang-specific):
b|,b&,b^,b~,b<<,b>>,b>>>
Functions:
Arrow functions:
=>Lambda functions:
->Static BIF references:
::
Annotations:
@name(...)with complex parameter supportString Interpolation:
#expression#within stringsComments:
//,/* */,/** */(JavaDoc-style)Component Islands: Triple backtick template blocks embedded in script
Data Structures: Arrays, structs, queries
Scopes:
variables,local,arguments,request,session,application,server, etc.
BoxLang Template Syntax (.bxm)
HTML Support: Custom lightweight HTML syntax highlighting
Multi-color support: Distinct colors for special tags (
html,head,body,script,style,link) vs standard tagsDOCTYPEhighlightingFull HTML comments support
<!-- -->Integration within BoxLang tags
bx: Tags: Native BoxLang component tags
Control flow:
<bx:if>,<bx:elseif>,<bx:else>,<bx:for>,<bx:while>,<bx:switch>,<bx:case>Output:
<bx:output>Functions:
<bx:function>,<bx:argument>,<bx:return>Error handling:
<bx:try>,<bx:catch>,<bx:finally>,<bx:throw>,<bx:rethrow>Components:
<bx:component>,<bx:interface>,<bx:property>Utility:
<bx:set>,<bx:include>,<bx:import>,<bx:param>Advanced:
<bx:lock>,<bx:thread>,<bx:transaction>,<bx:abort>,<bx:exit>
Expression Interpolation:
#expression#in text and attributesTemplate Comments:
<!--- ... --->Embedded Script:
<bx:script>blocks with full script syntax highlightingCode Folding: Automatic folding for tag regions
⚡ Installation
Using lazy.nvim (Lua)
Add this to your plugin configuration (e.g., lua/plugins/boxlang.lua):
Using vim-plug
Add to your .vimrc or init.vim:
Then run:
Using Vundle
Add to your .vimrc:
Then run:
Using Pathogen
Manual Installation
Clone this repository:
Copy the files to your vim runtime directory:
NeoVim
For NeoVim, use the same installation methods but replace ~/.vim with:
Linux/macOS:
~/.config/nvimWindows:
~/AppData/Local/nvim
📄 File Extensions
The plugin automatically detects and applies syntax highlighting based on file extensions:
.bx- BoxLang script class/component files → Usesboxlangsyntax.bxs- BoxLang script files (executable) → Usesboxlangsyntax.bxm- BoxLang template/markup files → UsesboxlangTemplatesyntax
⚙️ Manual Filetype Setting
If automatic detection doesn't work, you can manually set the filetype:
Or add to your file:
🎨 Syntax Highlighting Examples
Script Example (.bx, .bxs)
Template Example (.bxm)
🚀 BoxLang-Specific Features
This syntax file is specifically designed for BoxLang, not CFML/ColdFusion. Key differences:
Uses
bx:prefix for tags (notcf)Highlights
classkeyword (BoxLang native, vs CFML'scomponent)Supports bitwise operators (
b|,b&,b^,b~,b<<,b>>,b>>>)Strict equality operators (
===,!==)Arrow functions (
=>) and lambda functions (->)assertstatementcastasoperatorModern keywords:
final,package,interfaceas first-class
A separate CFML syntax file is available for ColdFusion compatibility mode.
🎨 Customization
You can customize the highlighting by adding to your .vimrc:
📁 Code Folding
The syntax files include folding support for major code blocks:
Folds are automatically created for:
Classes and interfaces
Functions
Control structures (
if,for,while,switch,try)Tag regions in templates
🔧 Troubleshooting
Syntax highlighting not working
Verify filetype is set correctly:
Check if syntax is enabled:
Reload the syntax file:
Colors look wrong
Ensure your color scheme supports the standard vim highlight groups. You can test with a built-in scheme:
🤝 Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Make your changes
Test with various BoxLang files
Submit a pull request
Last updated
Was this helpful?
