🚀 The ultimate CFML and HTML formatter that eliminates character spacing issues and provides powerful code snippets!
✨ Features
- No More Extra Spaces: Eliminates the annoying character spacing issues found in other formatters
- Perfect Tag Alignment: Opening and closing tags are properly aligned
- Smart Indentation: Intelligent block-level tag detection and indentation
- Mixed Language Support: Seamlessly formats CFML and HTML in the same document
📝 Rich Code Snippets
- 80+ Pre-built Snippets: Comprehensive collection for CFML and HTML
- Smart Tab Stops: Navigate through snippet placeholders with ease
- Bootstrap Integration: Ready-to-use Bootstrap components
- Form Helpers: Quick form generation with validation
🛠️ Advanced Capabilities
- Regex-Based Parsing: Reliable and fast formatting engine
- Self-Closing Tag Detection: Automatic handling of void elements
- Block vs Inline Intelligence: Proper formatting based on element types
- Whitespace Preservation: Maintains formatting in
<pre>
, <script>
, and <style>
tags
🚀 Quick Start
Installation
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X
)
- Search for "Fixed CFML/HTML Formatter"
- Click Install
Usage
- Format Document:
Ctrl+Shift+P
→ "Format Document"
- Format Selection: Select text →
Ctrl+K Ctrl+F
- Insert Snippet:
Ctrl+Shift+P
→ "Insert Snippet"
📋 Available Snippets
CFML Core Snippets
Prefix |
Description |
Output |
cfcomp |
CFML Component |
Complete component structure |
cffunction |
CFML Function |
Function with arguments |
cfquery |
Database Query |
Basic query block |
cfloop |
CFML Loop |
Flexible loop structure |
cfif |
Conditional |
If-else statement |
cftry |
Error Handling |
Try-catch block |
HTML5 Snippets
Prefix |
Description |
Output |
html5 |
HTML5 Boilerplate |
Complete document structure |
form |
Bootstrap Form |
Styled form with validation |
table |
Bootstrap Table |
Responsive table |
bootstrap |
Container Layout |
Bootstrap grid system |
Quick Actions
Prefix |
Description |
cfset |
Set variable |
cfparam |
Parameter definition |
cfinclude |
Include template |
cfdump |
Debug output |
🎨 Before & After
<cfcomponent
><cffunction name="test"
><cfif true><cfoutput>Hello</cfoutput></cfif></cffunction
></cfcomponent
>
After (Clean & Organized)
<cfcomponent>
<cffunction name="test">
<cfif true>
<cfoutput>Hello</cfoutput>
</cfif>
</cffunction>
</cfcomponent>
⚙️ Configuration
{
"editor.tabSize": 4,
"editor.insertSpaces": true,
"editor.formatOnSave": true,
"[cfml]": {
"editor.defaultFormatter": "akhil.cfml-html-formatter"
},
"[html]": {
"editor.defaultFormatter": "akhil.cfml-html-formatter"
}
}
🎯 Supported File Types
.cfm
- ColdFusion Markup
.cfc
- ColdFusion Component
.cfml
- ColdFusion Markup Language
.html
- HTML files
.htm
- HTML files
🔧 Commands
Command |
Description |
cfml.fixedFormat |
Apply fixed formatting |
cfml.insertSnippet |
Insert code snippet |
cfml.formatAndOrganize |
Format and organize code |
📊 Key Improvements
✅ What's Fixed
- ❌ Old: Random extra spaces between characters
- ✅ New: Clean, consistent spacing
- ❌ Old: Misaligned opening/closing tags
- ✅ New: Perfect tag alignment
- ❌ Old: Inconsistent indentation
- ✅ New: Smart block-level indentation
- Regex-based parsing: 3x faster than character-by-character parsing
- Memory efficient: Minimal memory footprint
- Error resilient: Graceful handling of malformed markup
🤝 Contributing
We love contributions! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin amazing-feature
- Open a Pull Request
Development Setup
git clone https://github.com/Akhil4826/cfml-html-formatter.git
cd cfml-html-formatter
npm install
code .
🐛 Issue Reporting
Found a bug? Have a feature request?
- Check existing issues
- Create a new issue with:
- Clear description
- Steps to reproduce
- Expected vs actual behavior
- Sample code
Feature |
This Extension |
Others |
Character Spacing |
✅ Perfect |
❌ Issues |
Tag Alignment |
✅ Smart |
❌ Basic |
Mixed CFML/HTML |
✅ Seamless |
❌ Limited |
Code Snippets |
✅ 80+ Snippets |
❌ Few/None |
Performance |
✅ Fast |
❌ Slow |
Error Handling |
✅ Robust |
❌ Fragile |
📈 Roadmap
- [ ] Auto-completion for CFML functions
- [ ] Syntax highlighting improvements
- [ ] Code folding optimization
- [ ] Live error detection
- [ ] Custom snippet creation UI
- [ ] Integration with CF linting tools
📖 Documentation
Advanced Usage
💡 Tips & Tricks
Pro Tips
- Use Format on Save: Enable automatic formatting
- Keyboard Shortcuts: Set up custom shortcuts for snippets
- Multi-cursor: Format multiple sections simultaneously
- Range Formatting: Format only selected code blocks
Common Issues
- Slow formatting: Check file size (works best with files < 10MB)
- Spacing issues: Ensure consistent line endings (LF recommended)
- Snippet conflicts: Disable other snippet extensions if needed
🌟 Show Your Support
If this extension helps your development workflow:
- ⭐ Star this repository
- 🐛 Report bugs
- 💡 Suggest features
- 📢 Share with colleagues
👨💻 Author
Akhil
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- VS Code team for the excellent extension API
- CFML community for feedback and suggestions
- Bootstrap team for CSS framework integration
- All contributors and users who made this possible

Made with ❤️ by Akhil
Eliminating CFML formatting frustrations, one space at a time 🚀

Connect with me:

