dominikh / go-mode.el

Emacs mode for the Go programming language
BSD 3-Clause "New" or "Revised" License
1.38k stars 211 forks source link

Add more syntax highlight #348

Closed glepnir closed 4 years ago

glepnir commented 4 years ago

This is a compare vim with emacs,seems like missed some highlight on emacs. image

muirdm commented 4 years ago

I prefer go-mode because it differentiates fields from method calls (but even that doesn't seem very useful). Why is it useful to highlight all fields? What face should be used? We aren't likely to add new syntax highlighting simply to keep highlighting parity with other editors.

Here is how you can add similar highlighting yourself (rerun go-mode after evaluating below code):

(font-lock-add-keywords 'go-mode
                        `((,(concat "\\.\\(" go-identifier-regexp "\\)") 1 'font-lock-function-name-face)))
glepnir commented 4 years ago

Ok, i got it.