Skip to content

creasty/opfmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opfmt

Format operators and delimiters as you type, using tree-sitter.

Motivation

TBA.

// Without opfmt:
foo+=123*fn('abc',{ bar:[4,5] });

// With opfmt:
foo += 123 * fn('abc', { bar: [4, 5] });

Quick start

Install nvim-treesitter.

require('nvim-treesitter.configs').setup {
  opfmt = {
    enable = true,
  },
}

Supported languages

  • ecma
    • javascript
    • jsx
    • typescript
    • tsx
  • lua
  • toml
  • vim
  • proto

Todo

  • 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

About

[Experimental] Format operators and delimiters as you type, using tree-sitter

Topics

Resources

License

Stars

Watchers

Forks