Comments (6)
Very interestingly, just after I finished writing the previous message I decided to test the same snippet in an XML file and it indented correctly, so it definitely is specific to Vim's indentation of HTML.
from minisnip.
Yes, this is related to how Vim indents HTML. If you write it by hand, you get the following behaviour:
<div>
test|
<div>
test
</div|
<div>
test
</div>|
Notice how closing tag was re-indented after finishing it with >
.
When you enter it via your snippet, the rule is not triggered since <<{}>>
and </<{~1}>>
aren't matching pair.
from minisnip.
Ah, that makes sense. Any idea why it does still work in XML files?
from minisnip.
Indentation for XML is implemented differently, because all XML tags need to have a closing tag, while in HTML not all of them. Thus when Vim sees any closing tag in XML, it just decreases the indent; while in HTML needs to check whether you are closing <li>
or the <ul>
above it.
from minisnip.
Alright, I see.
from minisnip.
Yeah, unfortunately, I don't see any straightforward way to fix the problem.
from minisnip.
Related Issues (20)
- Expanding from an autocmd HOT 1
- Expanding snippet jumps to placeholder outside of snippet template HOT 4
- replacing placeholders deletes placeholder
- Creating more than one snippet for the same filetype fails.
- Forward & Backlash in snippet value do not expand reference snippet properly HOT 6
- snippet
- <C-x><C-u> opens split window as preview HOT 4
- Problems with expanding HOT 9
- no snippet with that name HOT 3
- Unknown function: miniSnip#trigger HOT 9
- Odd comment character placement when fo+=r
- Strange placeholder behavior
- Unexpected indent on last line of snippet HOT 2
- Expansion without file snippet HOT 2
- Hope minisnip add selection region HOT 4
- After latest commit (11bc4fd), snippet name is left behind after expanding HOT 1
- Snippets that contain an indent do not expand to spaces when `'expandtab'` is set HOT 2
- When expanding <tab>'s, `'smarttab'` is not respected HOT 2
- Placeholder value with ampersand causes subsequent values to append instead of replace
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 minisnip.