mattn / emmet-vim

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

How to fix “E492: Not an editor command: EmmetInstall”? #451

Open inikolaesku opened 5 years ago

inikolaesku commented 5 years ago

I have installed emmet-vim and all worked good. When I added this in vimrc:

let g:user_emmet_install_global = 0 autocmd FileType html,css EmmetInstall there appeared next error:

Error detected while processing FileType Auto commands for "html": E492: Not an editor command: EmmetInstall There is my vimrc:

" If using a dark background within the editing area and syntax highlighting " turn on this option as well "set background=dark

" Uncomment the following to have Vim jump to the last position when " reopening a file "if has("autocmd") " au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif "endif

" Uncomment the following to have Vim load indentation rules and plugins " according to the detected filetype. "if has("autocmd") " filetype plugin indent on "endif

" The following are commented out as they cause vim to behave a lot " differently from regular Vi. They are highly recommended though. "set showcmd " Show (partial) command in status line. "set showmatch " Show matching brackets. "set ignorecase " Do case insensitive matching "set smartcase " Do smart case matching "set incsearch " Incremental search "set autowrite " Automatically save before commands like :next and :make "set hidden " Hide buffers when they are abandoned "set mouse=a " Enable mouse usage (all modes)

" Source a global configuration file if available if filereadable("/etc/vim/vimrc.local") source /etc/vim/vimrc.local endif

let g:user_emmet_install_global = 0 autocmd FileType html,css EmmetInstall

widgetii commented 5 years ago

Had the same problem. It seems that autocmd with EmmetInstall issued before actual vim-emmet loading so it lead to error. In my case I moved autocmd line below the 'call plug#end()' line (I use VimPlug) and error message disappered

igorcmelo commented 3 years ago

Thats is also happening with me, but I am not using any plugin manager so I don't know if that is the cause

mattn commented 3 years ago

What plugin manager do you use?

jmcantrell commented 2 years ago

I, too, have let g:user_emmet_install_global = 0, but I have EmmetInstall in various ftplugin files for the file types I'm using emmet for.

Do you happen to be using neovim, because I noticed that I get this error now in neovim, but not vim.

FarikunAziz commented 1 year ago

just like this

Screenshot_2023-06-04_23-46-05