Format operators and delimiters as you type, using tree-sitter.
TBA.
// Without opfmt:
foo+=123*fn('abc',{ bar:[4,5] });
// With opfmt:
foo += 123 * fn('abc', { bar: [4, 5] });
Install nvim-treesitter.
require('nvim-treesitter.configs').setup {
opfmt = {
enable = true,
},
}
- ecma
- javascript
- jsx
- typescript
- tsx
- lua
- toml
- vim
- proto
- Describe motivation
- Make a simple movie
- Write down goals and non-goals
- Comparison with other formatters?
- Features
- Merge two consecutive operators if applicable
- Support has_child? query
- Bugfixes
- Fix a bug regarding match_case node in vim