mattn / emmet-vim

emmet for vim: http://emmet.io/
http://mattn.github.io/emmet-vim
MIT License
6.41k stars 411 forks source link

custom snippets doesn't work #443

Open ViOrise opened 5 years ago

ViOrise commented 5 years ago

Added custom snippets but them doesn't work correctly in html when i pushing emmet key button:

image

mattn commented 5 years ago

I can't reproduce this. Where the section did you put the html:55 ? It should be html or *.

sergbotan commented 3 years ago

I have a similar issue. In my snippets_custom.json there's: "doc": "html[lang=${lang}]>(head>meta[charset=${charset}]+meta:vp+title{${1:Document}})+body" It expands to . Webapi is installed. let g:user_emmet_settings = webapi#json#decode(join(readfile(expand('~/snippets_custom.json')), "\n"))

MacOS, tmux, Vim8.2.

choncou commented 3 years ago

Was anyone able to figure this out ? I have a similar issue, even though :echo g:user_emmet_settings outputs my json file

mattn commented 3 years ago

What is your &filetype?

choncou commented 3 years ago

What is your &filetype?

@mattn eruby.

Edit: I still have the issue when my &filetype is html

Rz-Rz commented 2 years ago

FIX UPDATE: I fixed all my problems by using Pathogen, it seems to add properly the web api to the run time, something that native vim or plug-vim didn't do properly.

I have a similar issue: This is my custom snippet file:

 {
  "html": {
    "snippets": {
              "img:1": "img[width height loading='lazy']"
    }
  },
  "css": {
    "snippets": {
    }
  }
}

In my nvim.init: Plug 'mattn/webapi-vim' ... let g:user_emmet_settings = webapi#json#decode(join(readfile(expand('~/.config/nvim/plug-config/snippets_custom.json')), "\n"))

And I get </img:1> UPDATE: Using vim I had this error message: E117: Unknown function: webapi#json#decode