morhetz / gruvbox

Retro groove color scheme for Vim
13.63k stars 1.11k forks source link

need highlight function name in go #297

Open isvicy opened 4 years ago

isvicy commented 4 years ago
Screenshot 2019-09-18 19 40 14

can't distinguish function name and params in go. Both are displayed as white text. Please tell me how can I fix this?

morhetz commented 4 years ago

Could you please try using vim-polyglot package?

isvicy commented 4 years ago

tried on my mac and ubuntu pc, didn't work.

morhetz commented 4 years ago

Is that a golang?

isvicy commented 4 years ago

Yes, it's a golang file. my vimrc:

"-----------------basic config--------------------------"
"set true color for vim
if has("termguicolors")
    " fix bug for vim
    set t_8f=[38;2;%lu;%lu;%lum
    set t_8b=[48;2;%lu;%lu;%lum

    " enable true color
    set termguicolors
endif

set nocompatible
set backspace=indent,eol,start

set rnu
set ruler

set showcmd

set history=1000

set nobackup
set noswapfile

set showmatch

set autoindent
set cindent

syntax enable
syntax on

set ignorecase

set tabstop=4
set shiftwidth=4
set softtabstop=4
set smarttab
set expandtab

"encoding, will try to encode in following sequence
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1

set ff=unix

"check filetype
filetype on
filetype indent on
filetype plugin on
filetype plugin indent on

"-----------------check existence of plug--------------------------"
if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

"-------------------vim-plug-----------------------"
call plug#begin('~/.vim/plugged')

" language
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'sheerun/vim-polyglot'

"nerdtree
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'

" theme、style、syntax highlighting related
Plug 'morhetz/gruvbox'
Plug 'ekalinin/Dockerfile.vim'
Plug 'mhinz/vim-startify'

call plug#end()

let g:go_def_mode = 'gopls'

set background=dark
colorscheme gruvbox

"nerdtree configuration
"open nerdtree automatically when not specify a dir opening vim
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
"close vim when nerdtree is the last window
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
isvicy commented 4 years ago

Any suggestion?

rainzm commented 4 years ago

Hi. See :h g:go_highlight_functions.