如何在vim中获取光标下突出显示的组名? [英] How to get group name of highlighting under cursor in vim?

查看:24
本文介绍了如何在vim中获取光标下突出显示的组名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通常会自定义现有的colorscheme 以满足我的需求.

I usually customize existing colorscheme to meet my needs.

如果我能得到光标下的语法组名称,它会对我有很大帮助,就像 Firebug 但在维姆.我想知道怎么做.

If I could get the syntax group name under cursor, it would help me a lot, just like Firebug but in Vim. I'd like to know how to do it.

推荐答案

当我做同样的事情时,网上有这个功能:

There is this function that was floating around the web when I was doing the same thing:

function! SynStack()
  if !exists("*synstack")
    return
  endif
  echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc

这篇关于如何在vim中获取光标下突出显示的组名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆