windwp / nvim-ts-autotag

Use treesitter to auto close and auto rename html tag
MIT License
1.69k stars 90 forks source link

does not work auto close tag #34

Closed ShiChenCong closed 3 years ago

ShiChenCong commented 3 years ago

does not work here is my minimum config

init.vim
  Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
  Plug 'windwp/nvim-ts-autotag'
after/plugin/autotag.rc.lua
  require'nvim-treesitter.configs'.setup {
  autotag = {
    enable = true,
  }
}
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(
    vim.lsp.diagnostic.on_publish_diagnostics,
    {
        underline = true,
        virtual_text = {
            spacing = 5,
            severity_limit = 'Warning',
        },
        update_in_insert = true,
    }
)
require('nvim-ts-autotag').setup()

when i type > after <div, does not auto add </div>, below is tsx file image

windwp commented 3 years ago

check nvim treesitter readme and makesure you install language

ShiChenCong commented 2 years ago

@windwp thankyou for awesome plugin! for anyone meet this problem, you may forget to :TSInstall <language_to_install>, install your language, eg: :TSInstall tsx