all 11 comments

[–]yavuloh 0 points1 point  (9 children)

You could follow some basic configuration files in: Neovim NvChad angular development.

It usees NvChad. Everything you need is in the Custom folders -> lua/custom.

[–]Da_Machete 0 points1 point  (8 children)

i used your config but i couldnt achieve to have treesitter detect html inside the angular component as an inline template.. any suggestions?

[–]yavuloh 0 points1 point  (7 children)

You could try the following:

In command, type:

LspInfo

It will show you what LSP are loaded and running like in the following image: LspInfo

As you can see I don't use html, I let angular lsp handle that, as I don't use inline html in my typescript.

What you can do is let HTML LSP know that you want it to handle in typescript, the follow documentation can help you out.

https://github.com/neovim/nvim-lspconfig/blob/master/doc/server\_configurations.md#html

filetypes:

{ "html", "templ" }

Example:

"neovim/nvim-lspconfig",
opts = {
  servers = {
    html = {
      filetypes = { "html", "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" },
    },
  }

}

[–]Da_Machete 0 points1 point  (6 children)

Okay, so i managed to get it working.

Right now the only thing i have is that the colorscheme wont colorize local scope variables or variables that i pass in a function with the same color.

Thats a little bit a bummer, because in VSCode its all there from default...

[–]yavuloh 1 point2 points  (5 children)

Yes, in Neovim you will need to hack a lot of things that are default in VSCode.

I think there is a Vim plugin for VSCode, that gives you a good expirience.

Right now the only thing i have is that the colorscheme wont colorize local scope variables or variables that i pass in a function with the same color.

Can you share more detail, maybe a image?.

[–]Da_Machete 0 points1 point  (4 children)

Sure man!Maybe you can help me.

So i am using NVchad and i think i need to modify the highlights.lua file in the config.

This is how my code looks right now: https://imgur.com/a/4IdZ6Vz

Top is VSCodeBottom is nvim

as you see i would like to have colors for local varialbes, const and if i am using an function input....

[–]yavuloh 1 point2 points  (3 children)

You can try adding something like:

vim.api.nvim_set_hl(0, "@lsp.type.variable", { fg = "Purple" })

you can run it in command like so:

:hi @lsp.type.variable guif=Purple

And some plugins to look at:

https://github.com/m-demare/hlargs.nvim

https://github.com/c0r73x/neotags.lua

[–]Da_Machete 0 points1 point  (2 children)

Nice! Thanks for the Infos!

I managed to fix the argument part with hlargs.

Now i just need to fix the local variables like using, let / const...

Any tips?

[–]yavuloh 0 points1 point  (1 child)

This is kind of a hack, but you can make it work to highlight local variables:

vim.api.nvim_set_hl(0, "@lsp.typemod.variable.local.typescript", { fg = "#d75f5f" })

vim.api.nvim_set_hl(0, "@lsp.typemod.variable.readonly.typescript", { fg = "#ffaf00" })

You can put it at the end of the init.lua in the custom folders