Comments (13)
I´m using this in my init.vim, and it´s working fine for jsx and tsx.
let g:closetag_filenames = '*.html,*.xhtml,*.jsx,*.tsx'
let g:closetag_xhtml_filenames = '*.xhtml,*.jsx,*.tsx'
let g:closetag_filetypes = 'html,js'
let g:closetag_xhtml_filetype = 'xhtml,jsx,tsx'
let g:closetag_emptyTags_caseSensitive = 1
let g:closetag_regions = {
\ 'typescript.tsx': 'jsxRegion,tsxRegion',
\ 'javascript.jsx': 'jsxRegion',
\ }
let g:closetag_shortcut = '>'
from vim-closetag.
For me only works in html files, doesn't work for js and jsx files
from vim-closetag.
In my init.lua this works
vim.cmd([[
let g:closetag_filenames = '*.html,*.xhtml,*.jsx,*.tsx'
let g:closetag_xhtml_filenames = '*.xhtml,*.jsx,*.tsx'
let g:closetag_filetypes = 'html,js'
let g:closetag_xhtml_filetype = 'xhtml,jsx,tsx'
let g:closetag_emptyTags_caseSensitive = 1
let g:closetag_regions = {
\ 'typescript.tsx': 'jsxRegion,tsxRegion',
\ 'javascript.jsx': 'jsxRegion',
\ }
let g:closetag_shortcut = '>'
]])
from vim-closetag.
I also have this issue but with any filetype different than html. I'm currently trying to use this with
eelixir
anderuby
, but it just does not work, don't know why. This is my wholeinit.lua
right now:local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' if not vim.loop.fs_stat(lazypath) then vim.fn.system({ 'git', 'clone', '--filter=blob:none', 'https://github.com/folke/lazy.nvim.git', '--branch=stable', -- latest stable release lazypath, }) end vim.opt.rtp:prepend(lazypath) require('lazy').setup({ { 'alvan/vim-closetag', lazy = false, config = function() vim.cmd("let g:closetag_filetypes='html,eelixir,eruby'") end, }, })
If I manually change the filetype of any file to html, it starts working 😅
I have tried the same configs shown in this thread and it just does not work for any of those filetypes (js, jsx etc), nor it works for erb and eex when I add it to
closetag_filetypes
. I have also tried to add*.erb
and*.eex
toclosetag_filenames
but to no avail. This plugin just suddenly stopped working )):: Which is really sad, since it is a very good plugin!Edit: I have also tried to run the command
:CloseTagEnableBuffer
inside a.eex
file (eelixir filetype), but it still does not activate it.
In lazy, you need to specify these global variables in init
, so this plugin will recognize them when loading.
from vim-closetag.
For me this seems to be the minimal config to get this working Neovim v0.8.3
vim.g.closetag_filetypes = 'html,js,typescriptreact'
vim.g.closetag_emptyTags_caseSensitive = 1
vim.g.closetag_regions = {
['typescript.tsx'] = 'jsxRegion,tsxRegion',
['javascript.jsx'] = 'jsxRegion',
}
from vim-closetag.
I'm using in my init.lua with nvim but some feature is not work. Please help me.
HTML = WORK
JSX = WORK
TSX = NOT WORK !! <<<<
-- set vim options here (vim.<first_key>.<second_key> = value)
options = {
opt = {
-- set to true or false etc.
relativenumber = true, -- sets vim.opt.relativenumber
number = true, -- sets vim.opt.number
spell = false, -- sets vim.opt.spell
signcolumn = "auto", -- sets vim.opt.signcolumn to auto
wrap = false, -- sets vim.opt.wrap
},
g = {
mapleader = " ", -- sets vim.g.mapleader
autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
cmp_enabled = true, -- enable completion at start
autopairs_enabled = true, -- enable autopairs at start
diagnostics_enabled = true, -- enable diagnostics at start
status_diagnostics_enabled = true, -- enable diagnostics in statusline
icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
ui_notifications_enabled = true, -- disable notifications when toggling UI elements
transparent_enabled = true, -- enable transparent background
closetag_filenames = ".html,.xhtml,.phtml",
closetag_xhtml_filenames = ".xhtml,*.{t,j}sx",
closetag_filetypes = "html,xhtml,phtml",
closetag_xhtml_filetypes = "xhtml,{t,j}sx",
closetag_shortcut = ">",
closetag_close_shortcut = ">",
closetag_enable_react_fragment = 1,
},
},
from vim-closetag.
@northnSouth Thanks, I experienced the same problem in TSX files, I had my configs in a .vim file but I tried using your solution and it worked,
from vim-closetag.
I also have this issue but with any filetype different than html. I'm currently trying to use this with eelixir
and eruby
, but it just does not work, don't know why. This is my whole init.lua
right now:
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
{
'alvan/vim-closetag',
lazy = false,
config = function()
vim.cmd("let g:closetag_filetypes='html,eelixir,eruby'")
end,
},
})
If I manually change the filetype of any file to html, it starts working 😅
I have tried the same configs shown in this thread and it just does not work for any of those filetypes (js, jsx etc), nor it works for erb and eex when I add it to closetag_filetypes
. I have also tried to add *.erb
and *.eex
to closetag_filenames
but to no avail. This plugin just suddenly stopped working )):: Which is really sad, since it is a very good plugin!
Edit: I have also tried to run the command :CloseTagEnableBuffer
inside a .eex
file (eelixir filetype), but it still does not activate it.
from vim-closetag.
I´m using this in my init.vim, and it´s working fine for jsx and tsx.
let g:closetag_filenames = '*.html,*.xhtml,*.jsx,*.tsx' let g:closetag_xhtml_filenames = '*.xhtml,*.jsx,*.tsx' let g:closetag_filetypes = 'html,js' let g:closetag_xhtml_filetype = 'xhtml,jsx,tsx' let g:closetag_emptyTags_caseSensitive = 1 let g:closetag_regions = { \ 'typescript.tsx': 'jsxRegion,tsxRegion', \ 'javascript.jsx': 'jsxRegion', \ } let g:closetag_shortcut = '>'
Hi @Hdoc1509 , I'm quite confusing on this configuration. Why remove
\ 'typescriptreact': 'jsxRegion,tsxRegion',
\ 'javascriptreact': 'jsxRegion',
from g:closetag_regions
?
from vim-closetag.
I cannot make the configuration work for all of js/jsx/ts/tsx at the same time.
Could anyone help me?
from vim-closetag.
anyone solve the problem where the the auto close tag is applying outside the region??
from vim-closetag.
Related Issues (20)
- Disabling closing tag in regular Javascript files when outside JSX regions?
- Plugin will not work if "set paste" option is enabled in .vimrc HOT 2
- Use newline CR to put on the next line HOT 4
- Config with file .js HOT 5
- Better autocomplete of self-closing tags HOT 1
- Problem with indentation in js, jsx, ts, tsx files HOT 5
- Overrides previous search highlighting
- Autoformat tags on "Enter" HOT 2
- incorrectly runs on generics in tsx HOT 2
- lagging when spacing inside of a tag
- during installation using Vundle, vim asking for github credentials HOT 1
- Plugin does not working in jsx file HOT 1
- Not working in some jsx component-as-prop case HOT 1
- Not working for typescriptreact and javascriptreact/typescriptreact file types HOT 3
- incorrect cursor positioning for jsx
- Doesn't work in *.php files HOT 1
- delay when I hit space HOT 1
- Closing "p" tag with second ">" doesn't indent new line HOT 1
- D
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-closetag.