I have this part of code:
function! Test()
echom synIDattr(synID(line('.'), col('.'), 1), 'name')
endfunction
autocmd TextChangedI <buffer> call Test()
I expected that every time I change some stuff the current "type" would be printed out. For example, if I'm in a commentary line of vim, I'd expect to see that at the bottom: vimLineComment
. But nothing pops up.
If I enter
:echom synIDattr(synID(line('.'), col('.'), 1), 'name')
I'm getting my expected output. What am I doing wrong?
I've also tried this (which was written in :h synIDattr
):
echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "name")
But it also doesn't work inside my Test()
function:
function! Test()
echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "name")
endfunction
autocmd TextChangedI <buffer> call Test()
If I insert echom "Test"
I'm getting Test
at the bottom everytime if I enter something. What am I doing wrong?
endif
in a function. Cursor beforeendif
: success, cursor afterendif
: nothing. Which makes sense. – B Layer Jan 24 at 0:16