Comments (6)
Hi @jackkinsella
Do you have any suggestion for this feature?
Currently you can use :CloseTagDisableBuffer
to temporarily disable the completion function.
from vim-closetag.
I guess the approach would be to define a g:closetag_emptyTags
setting that can be used within .vimrc, the contents of which then gets appended to the internal b:closetag_emptyTags
.
I've never done any vim scripting before, so I wouldn't be able to do this without diving in pretty deep. But if I get a spare Saturday I might give it a shot.
from vim-closetag.
Hi @jackkinsella
The problem is, per your requirement, the b:closetag_emptyTags
depends on the filetype you are editing like jsx, so it won't be a good idea that just add a global variable to define it.
And also, I am not sure if you can define a full list of all empty tags for jsx or not.
Because from your demo code, I saw you are typing <any>
tag.
from vim-closetag.
I realised that my first message was a bit vague so I'll just clarify for anyone else reading the thread: I meant that in JSX/flow you sometimes literally type <any>
and <*>
i.e. both "any" and "*" are the actual tag names that need to be input, as opposed to placeholders/regexes for patterns of tags.
But, clarification aside, you are right @alvan, there are other tags necessary and adding them all one-by-one could be tedious.
Perhaps another, more general solution would be some keyword shortcut that closes the first tag without adding a second parallel closing tag. For example, imagine I have typed
<any|
where | represents my cursor position. It would be cool if I could type some shortcut (e.g. <c->>
if possible ) to end up with <any>
.
from vim-closetag.
@jackkinsella
I've added a new shortcut for this let g:closetag_close_shortcut = '<leader>>'
,
you can try it and feel free to config it by yourself.
from vim-closetag.
Works perfectly! Thanks a million. I'll update the readme for you and make a pull-request.
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
- Autoclose dosent work on jsx and tsx HOT 13
- 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.