Created
October 15, 2021 19:36
-
-
Save mhartington/4df69ab6138927b218a928b3628a8662 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:expand_html_tab() | |
" try to determine if we're within quotes or tags. | |
" if so, assume we're in an emmet fill area. | |
let line = getline('.') | |
if col('.') < len(line) | |
let line = matchstr(line, '[">][^<"]*\%'.col('.').'c[^>"]*[<"]') | |
if len(line) >= 2 | |
return "\<C-n>" | |
endif | |
endif | |
" expand anything emmet thinks is expandable. | |
if emmet#isExpandable() | |
return emmet#expandAbbrIntelligent("\<tab>") | |
endif | |
" return a regular tab character | |
return "\<tab>" | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment