Skip to content

Commit

Permalink
Add a section to README for vim
Browse files Browse the repository at this point in the history
While vim has extensions for using an LSP, there is also the option for
setting the makeprg and then using :make and the quickfix window to go
over syntax errors.
  • Loading branch information
joshdpark authored and kristoff-it committed Sep 12, 2024
1 parent edc9669 commit 93a0fa9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,19 @@ See https://helix-editor.com for more information on how to add new language ser
#### [Flow Control](https://github.com/neurocyte/flow)
Already defaults to using SuperHTML, just add the executable to your `PATH`.

#### Vim
Vim should be able to parse the errors that `superhtml check [PATH]`. This
means that you can use `:make` and the quickfix window to check for syntax
errors.

Set the `makeprg` to the following in your .vimrc:
```
" for any html file, a :make<cr> action will populate the quickfix menu
autocmd filetype html setlocal makeprg=superhtml\ check\ %
" if you want to use gq{motion} to format sections or the whole buffer (with gggqG)
autocmd filetype html setlocal formatprg=superhtml\ fmt\ --stdin
```

#### Other editors
Follow your editor specific intructions on how to define a new Language Server for a given language / file format.

Expand Down

0 comments on commit 93a0fa9

Please sign in to comment.