1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-18 09:53:22 -07:00

add SynStack function for investigating highlighting

This commit is contained in:
Connor Olding 2022-07-23 10:47:43 -07:00
parent d3d0f54b1c
commit 1797c9e040

View File

@ -372,6 +372,18 @@ vn <silent> & :call GlobalReplace()<cr>
" alias :W to :w, via https://stackoverflow.com/a/3879737
cnoreabbrev <expr> W ((getcmdtype() is# ':' && getcmdline() is# 'W')?('w'):('W'))
" https://stackoverflow.com/a/58244921
fu! SynStack()
for i1 in synstack(line("."), col("."))
let i2 = synIDtrans(i1)
let n1 = synIDattr(i1, "name")
let n2 = synIDattr(i2, "name")
echo n1 "->" n2
endfor
endfunction
map gm :call SynStack()<CR>
" misc {{{1
set list listchars=tab:»·,trail,extends:…,nbsp:‗