ecosse3 / nvim

A non-minimal Neovim config built to work most efficiently with Frontend Development
GNU General Public License v3.0
1.21k stars 109 forks source link

Support For ReactJS - Auto Close Tag #83

Closed FoxNQ99 closed 2 years ago

FoxNQ99 commented 2 years ago

hello, thank you for this project, this project helped me a lot . i want to add plugin https://github.com/alvan/vim-closetag but i dont know how to add a plug, can you help me?, i use JS and TypeScript , thank you very much

alfredosdpiii commented 2 years ago

Go to the lua folder and edit plugins.lua file and instead of Plugin 'alvan/vim-closetag' use use 'alvan/vim-closetag'

ecosse3 commented 2 years ago

I'll consider adding a similar plugin but for now, CMP suggestion for a closing tag with LSP is enough for me when working daily. Auto closing tags sometimes can be annoying when you don't want to close them immediately.

You should check nvim-ts-autotag instead of vim-closetag.

d0t15t commented 2 years ago

CMP suggestion for a closing tag with LSP is enough for me when working daily.

Could you please elaborate on this? The only suggestions I'm getting are seen below, but probably I'm not understanding something.

image

ecosse3 commented 2 years ago

@d0t15t That's correct. You can enable in config.lua:

completion = {
  select_first_on_enter = true
},

so in that case closing tag will be automatically selected. Then you just press enter to close it. I consider using auto closing tag more annoying than useful in most cases so that's why I don't use them. Fell free to add it to your plugins in Ecovim setup.