Embed run command lang highlight and LSP with Neovim and otter.nvim #3952
EricDriussi
started this conversation in
Show and tell
Replies: 1 comment
-
seems fit for a neovim cookbook |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wrote a couple of lines to get treesitter to highlight the code in the run command and used otter.nvim to get full LSP support for it as well (autocompletion, diagnostics, the whole thing):
Here a non-mise toml file is shown on the right to show it only affects
mise.toml
files.For those interested, I added a couple of treesitter toml injections:
And configured otter.nvim like so:
The injections set the lang to
bash
for one-liners and multi-line commands with no shebang. If it's multi-line and has a shebang, get the lang set in the shebang.This can of course be extended to support the
shell
property (currently ignored).I'm happy to add this to the docs if it's of any help/interest.
Beta Was this translation helpful? Give feedback.
All reactions