mattn / mattn/emmet-vim

Override default_attributes

Open
#331 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
6.5k
Forks
414
PR merge metrics
No merged PRs in 30d

Description

At the moment I can set default attribute for specific element using:

let g:user_emmet_settings  = {
\  'html': { 
\    'quote_char': '',
\    'default_attributes': {
\      'div': {'id': ''},
\    },
\   },
\}

However if for elements with defaults defined such as label that has the for attribute set, when trying to reset this so label won't add the for attribute with:

let g:user_emmet_settings  = {
\  'html': { 
\    'quote_char': '',
\    'default_attributes': {
\      'label': {},
\    },
\   },
\}

Unfortunately does not seem to work since when expanding label still prints the for attribute even though I have reseted within g:user_emmet_settings.

Is there anyway to reset/override the default attributes?

Thanks in advance.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the default attribute definition for label in autoload/emmet.vim, linked in the issue, and compare it with how g:user_emmet_settings is merged. Reproduce the label expansion using the shown Vim configuration. Done means an empty label override prevents the default for attribute while preserving other configured defaults.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, vim
Domain
tooling, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.