I'm writing a VimL function that needs to behave differently for different filetypes. I know I can use &filetype to detect that, but my issue is with files that have embedded languages. Let's say I have this:
<html>
<head>
<style>
div {
text-color: red;
}
</style>
</head>
<body>
<div>Some text</div>
</body>
</html>
If the cursor is inside the style tag, I want to know that I'm dealing with CSS. Is this possible?
zSmapping. Poor man's mapping:nnoremap zS :echo join(reverse(map(synstack(line('.'), col('.')), 'synIDattr(v:val,"name")')),' ')<cr>– Peter Rincker Mar 24 '17 at 21:27ftdefined for it to work (for example in a syntax highlighted file) – laktak Jan 13 '23 at 19:48