Skip to content

Commit 745d3c6

Browse files
committed
chore: update readme for older vim versions
1 parent 04736c7 commit 745d3c6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ This parser extends [tree-sitter-html](https://github.com/tree-sitter/tree-sitte
3232

3333
In the nightly neovim built (or release 0.11.x), the filetype detection for Angular templates is included. It will detect Angular HTML templates, based on it's contents, and set the filetype to `htmlangular`.
3434

35+
### Older versions
36+
3537
If you are using an older version, you must set the filetype yourself.
3638

3739
E.g. mark the file as `htmlangular` if it matches the pattern `*.component.html`:
@@ -46,6 +48,18 @@ vim.filetype.add({
4648
})
4749
```
4850

51+
Next, create a `ftplugin` for `htmlangular` that does the following:
52+
53+
```vim
54+
runtime! ftplugin/html.vim!
55+
```
56+
57+
Or, in lua:
58+
59+
```lua
60+
vim.cmd('runtime! ftplugin/html.vim!')
61+
```
62+
4963
## LSP's or other plugins
5064

5165
You may need to include this new filetype (`htmlangular`) for other plugins, like [LSP](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#angularls) for example:

0 commit comments

Comments
 (0)