How do you reflect on the current sytax cursor scale?

I am trying to create a bit of functionality that will only occur when the cursor is in double quotation marks in a ruby ​​file.

How to check if the cursor is in this syntax?

+4
source share
2 answers

This will return the current syntax group.

function! SyntaxItem() return synIDattr(synID(line("."),col("."),1),"name") endfunction 

From: http://vim.wikia.com/wiki/Showing_syntax_highlight_group_in_statusline
Also see: http://vim.wikia.com/wiki/Identify_the_syntax_highlighting_group_used_at_the_cursor

+3
source

Everything is built on the basis of fragments of functions that Andy gave you. After that, we can create more complex functions and commands.

This is what I did with my file map plugin . Here are a few usage examples:

NTN.

0
source

All Articles