emmet-vim icon indicating copy to clipboard operation
emmet-vim copied to clipboard

custom snippets doesn't work

Open ViOrise opened this issue 6 years ago • 6 comments

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

image

ViOrise avatar Jan 03 '19 05:01 ViOrise

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

mattn avatar May 23 '19 09:05 mattn

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.

sergbotan avatar Oct 31 '20 13:10 sergbotan

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

choncou avatar Nov 16 '20 13:11 choncou

What is your &filetype?

mattn avatar Nov 16 '20 13:11 mattn

What is your &filetype?

@mattn eruby.

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

choncou avatar Nov 16 '20 13:11 choncou

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</img:1> UPDATE: Using vim I had this error message: E117: Unknown function: webapi#json#decode

Rz-Rz avatar Nov 28 '21 20:11 Rz-Rz