Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get color of word under cursor

Tags:

vim

colors

How do i get the color of the word under the cursor?

Working on making my own color schemes and trying to poach others colors without having to look at the source code.

like image 620
user597608 Avatar asked Nov 26 '15 03:11

user597608


1 Answers

:echo synIDattr(synIDtrans(synID(line("."), col("."), 1)), "fg")
  • "fg" foreground color (GUI: color name used to set the color, cterm: color number as a string, term: empty string),
  • "bg" background color (as with "fg").

Read more

  • :help synIDattr()
like image 177
ryuichiro Avatar answered Oct 20 '22 00:10

ryuichiro