Closed medinLaVie closed 3 years ago
Did you try "CTRL+y" and "," ?
Did you get fix?
i has same problem。on my macbook, os is osx 10.8.5。
in html file input html:5
or div
and pressing ctrl+y+,
but nothing happened change.
here is my vim `runtimepath' :
runtimepath=~/.vim,~/.vim/bundle/emmet-vim,~/.vim/bundle/nerdtree,/usr/share/vim/vimfiles,/usr/share/vim/vim73,/usr/share/vim/vimfiles/after,~/.vim/after
Did you try below?
CTRL+y
,
without CTRL-y
immediatelythanks, mattn. is work it.
@DMK2013 Same cause?
Looks like I have that problem too. I use pathogen and removed all other plugins, tried different "let g:user_emmet_expandabbr_key", tried vim and MacVim and I have no idea what to verify more.
I have:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 16 2013 17:08:20)
MacOS X (unix) version
Included patches: 1-22
Compiled by Homebrew
Huge version with MacVim GUI. Features included (+) or not (-):
+acl +comments +ex_extra +insert_expand +mouse +netbeans_intg +ruby +terminfo +wildignore
+arabic +conceal +extra_search +jumplist +mouseshape +odbeditor +scrollbind +termresponse +wildmenu
+autocmd +cryptv +farsi +keymap +mouse_dec +path_extra +signs +textobjects +windows
+balloon_eval +cscope +file_in_path +langmap -mouse_gpm +perl +smartindent +title +writebackup
+browse +cursorbind +find_in_path +libcall -mouse_jsbterm +persistent_undo -sniff +toolbar -X11
++builtin_terms +cursorshape +float +linebreak +mouse_netterm +postscript +startuptime +transparency -xfontset
+byte_offset +dialog_con_gui +folding +lispindent +mouse_sgr +printer +statusline +user_commands +xim
+cindent +diff -footer +listcmds -mouse_sysmouse +profile -sun_workshop +vertsplit -xsmp
+clientserver +digraphs +fork() +localmap +mouse_urxvt +python +syntax +virtualedit -xterm_clipboard
+clipboard +dnd +fullscreen -lua +mouse_xterm -python3 +tag_binary +visual -xterm_save
+cmdline_compl -ebcdic -gettext +menu +multi_byte +quickfix +tag_old_static +visualextra -xpm
+cmdline_hist +emacs_tags -hangul_input +mksession +multi_lang +reltime -tag_any_white +viminfo
+cmdline_info +eval +iconv +modify_fname -mzscheme +rightleft +tcl +vreplace
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X_UNIX -no-cpp-precomp -g -O2 -U_FORTIFY_SOURCE -
D_FORTIFY_SOURCE=1 -I/System/Library/Frameworks/Tcl.framework/Headers -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_DARWIN_C_SOURCE=1
Linking: clang -L. -L. -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lncurses -liconv -framework Cocoa -fstack-protector -L/usr/loc
al/lib -L/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -framework Python -F/System/Library/Frameworks -framework Tcl -framew
ork CoreFoundation -framework Ruby
:imap shows:
i <D-BS> * <C-U>
i <M-BS> * <C-W>
i <M-Down> * <C-O>}
i <D-Down> * <C-End>
i <M-Up> * <C-O>{
i <D-Up> * <C-Home>
! <M-Right> * <C-Right>
! <D-Right> * <End>
! <M-Left> * <C-Left>
! <D-Left> * <Home>
i <Plug>(EmmetAnchorizeSummary) * <C-R>=emmet#anchorizeURL(1)<CR>
i <Plug>(EmmetAnchorizeURL) * <C-R>=emmet#anchorizeURL(0)<CR>
i <Plug>(EmmetRemoveTag) * <C-R>=emmet#removeTag()<CR>
i <Plug>(EmmetSplitJoinTag) * <Esc>:call emmet#splitJoinTag()<CR>
i <Plug>(EmmetToggleComment) * <C-R>=emmet#toggleComment()<CR>
i <Plug>(EmmetImageSize) * <C-R>=emmet#imageSize()<CR>
i <Plug>(EmmetMovePrev) * <Esc>:call emmet#moveNextPrev(1)<CR>
i <Plug>(EmmetMoveNext) * <Esc>:call emmet#moveNextPrev(0)<CR>
i <Plug>(EmmetBalanceTagOutward) * <Esc>:call emmet#balanceTag(-1)<CR>
i <Plug>(EmmetBalanceTagInward) * <Esc>:call emmet#balanceTag(1)<CR>
i <Plug>(EmmetExpandWord) * <C-R>=emmet#expandAbbr(1,"")<CR>
i <Plug>(EmmetExpandAbbr) * <C-R>=emmet#expandAbbr(0,"")<CR><Right>
i <D-/> <Esc><Plug>NERDCommenterToggle i
i <C-Y>A <Plug>(EmmetAnchorizeSummary)
i <C-Y>a <Plug>(EmmetAnchorizeURL)
i <C-Y>k <Plug>(EmmetRemoveTag)
i <C-Y>j <Plug>(EmmetSplitJoinTag)
i <C-Y>/ <Plug>(EmmetToggleComment)
i <C-Y>i <Plug>(EmmetImageSize)
i <C-Y>N <Plug>(EmmetMovePrev)
i <C-Y>n <Plug>(EmmetMoveNext)
i <C-Y>D <Plug>(EmmetBalanceTagOutward)
i <C-Y>d <Plug>(EmmetBalanceTagInward)
i <C-Y>; <Plug>(EmmetExpandWord)
i <C-Y>, <Plug>(EmmetExpandAbbr)
@bonkey Did you try https://github.com/mattn/emmet-vim/issues/148#issuecomment-25338586 ?
@mattn Yes, of course. But in meantime I tried to type 'C-Y' without any plugins on MacVim and I noticed that it didn't appear in any way, so I changed the leader to C-S:
let g:user_emmet_leader_key = '<c-s>'
and it somewhat worked. Somewhat because it works only with zen notation (EmmetExpandAbbr), but no other macros fire. It just types e.g. '^S/' for EmmetToggleComment.
I have the same problem and your solution works bonkey, thank you!
Hello, none of the above solutions work for me. Here is my vim info: http://pastebin.com/2aNhaNrG Remapping does not work and nothing is displayed in the status bar.
Are you using something other plugins which uses <tab>
key? ex: ultisnips
Your plug-in works perfectly after starting with a fresh configuration. Sorry for the trouble and thanks for your work.
at all, can I close this issue?
Same here, it works. I'm not sure which other plugin caused problem, so
I'll keep on using
I check email a couple times daily; to reach me sooner, you can send me a text message via this page: https://awayfind.com/mascip
On 15 October 2013 12:28, mattn notifications@github.com wrote:
at all, can I close this issue?
— Reply to this email directly or view it on GitHubhttps://github.com/mattn/emmet-vim/issues/148#issuecomment-26326594 .
I've found that timeoutlen=0
was killing this for me. I'm an avid <C-[>
to escape user, and setting this made some things work a little quicker (mainly my status line color function). Commenting this line out of my .vimrc
immediately returned the correct <C-y>,
functionality.
I got it, you need to search the keywords user_emmet_leader_key such as in this line.
let g:user_emmet_leader_key='<C-Z>'
just comment it out and you'll get the default <C-y>,
shortcuts combination for emmet.
It would be better to put something like
" redefine trigger key
let g:user_emmet_leader_key='<C-Z>'
into Readme.md, as the people most likely to redefine that keystroke.
done
I cannot resolve this. CTRL+Y , works. But as soon as I redefine it as suggested let g:user_emmet_leader_key= '<C-Z>'
it actually deletes html:5
I removed ultisnips and retried but cannot get it to work with any other binding other than C-Y, which I can't use practically.
Oh I rebound it to C-E but failed to realise I still needed to press ',' working now
g:user_emmet_leader_key
mean leading key for combination of two key stroke.
first key: CTRL-Y
second key: ,
You can change the first key CTRL-Y
with using g:user_emmet_leader_key
. If you set let g:user_emmet_leader_key = '<c-e>'
, you need to type <c-e>,
for it.
If you want to change the two key stroke as one key stroke, use let user_emmet_expandabbr_key = '<c-e>'
.
I couldn't get Emmet working on macbook using any of the solutions above. However, step-by-step debugging of my .vimrc I discovered that 'set paste' was the culprit.
Commenting out 'set paste' in the .vimrc fixed it for me.
set paste
disable all of key mappings. So you can't use any vim plugins which provide key mappings.
I remember this used to work for me. Now the behavior I'm getting is consistent with this...
:help i_CTRL-y " Insert the character that is above the cursor
If there is nothing above, it inserts nothing and then a ','. Emmet works intermittently in MacVim but not in terminal vim.
By the way, I tried remapping to C-e and C-s but that doesn't seem to help terminal vim.
Thanks @jtmkrueger. That solved my problem, hours wasted for troubleshooting :+1:
@kgust: same here (gvim on windows), have you solved it so far?
@scardine I wasn't able to get it to work like I wanted, so I installed vim-sparkup instead. No complaints so far.
@kgust I owe you a beer for the vim-sparkup tip. :-)
@kgust are you using insertmode
?
Kudos to @jtmkrueger, that's also my issue. In my case, I've got some insert-mode specific autocmd trickery that switches timeoutlen
to 0 only in insert-mode. That utterly defeats emmet's binding approach, since it's impossible to enter the follow-on character after a <C-y>
mapping (e.g. <C-y>,
to expand an emmet abbreviation).
I may see if I can do something horrible like create a wrapper prefix mapping (say, <C-e>
) that resets timeoutlen
to a non-zero value, then restores it when the emmet command is complete? If you hear evil cackling from miles away, you'll know I've succeeded. :smiling_imp:
Followup: AFAICT, it's impossible to create a Vim wrapper function that executes just the prefix of an existing keybinding, e.g. as a kind of passthru: <c-e>{blah} => <c-y>{blah}
. This is because :normal bails if its command argument is incomplete, just as if <esc>
or <C-c>
were pressed.
However, as a tentative workaround, set timeoutlen=100
(vs zero) in insert mode seems to provide a happy medium where the keybinding works but returning to normal mode is still snappy.
I don't understand why you need the trick of fast esc.
@jwhitley I suggest https://github.com/kana/vim-arpeggio to you. :)
@jtmkrueger thanks, commenting out the set timeoutlen=0
fixed my issues. emmet is working in both vim and macvim, both compiled from brew.
your plugin is very usefull for me,thank you for you work
Increasing timeoutlen worked for me.
mattn, thank you for the plug-in.
Newbies may have forgotten that they will need to quit and exit terminal then restart it to complete installation.
you can expand with emmet on insert mode too.
I can't use emmet on insert model, but can in normal model. I user CentosOs7 and vim7
If you installed emmet with vim-plug and somehow emmet is not working, try installing with Vundle. I soloved the issue with this.
If your are installing with Vim-Plug, don't forget to run :PlugInstall
, or whatever the analogous command is for your plugin manager. It may seem obvious, but I forgot to do so and was pulling my hair out for a while trying to figure out why the trigger key wasn't working. 🤦♂️
I was having the same problem _let g:user_emmet_leaderkey wasnt changing my leader key but all i had to do is rerun terminal vim and the new assigned leader key works.
I've found that
timeoutlen=0
was killing this for me. I'm an avid<C-[>
to escape user, and setting this made some things work a little quicker (mainly my status line color function). Commenting this line out of my.vimrc
immediately returned the correct<C-y>,
functionality.
Oh God, how frustrated I was because it doesn't work but just in insert mode, and this was the culprit. Many thanks for this one!
in vimrc set timeoutlen=250, breaks "
even reloading vimrc with :source $MYVIMRC
@jtmkrueger Thanks a lot for your tip!
@mattn Thanks for this excellent plugin. Just wondering if we could include a note/warning in the docs/README regarding the timeoutlen=0
, or any value that is too low for the <C-Y>,
key sequences? This caused me few hours of troubleshooting which just led to nowhere, which could be easily avoided if possible conflicts with timeoutlen
setting was emphasized in the docs.
This issue was filed on Sep 2013 (7 years ago), but still pester lots of people up to now based on the comments here. An improved README could easily prevent this. Having zero or very low timeout value for key sequences is pretty common among Vim/Tmux users. :)
Did you try below?
- Press
CTRL+y
- Press
,
withoutCTRL-y
immediately
Thanks, it works!
Did you try below?
- Press
CTRL+y
- Press
,
withoutCTRL-y
immediately
Thanks bro!
I installed everything according to the instructions. I put the emmet folder under bundle. When I tried sample as
But nothing happens. I tried other emmet shortcuts as well but none of them works.