Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing highlighted groups in vim-go to fix issue in nord colorscheme. #3152

Closed
hoenirvili opened this issue Feb 8, 2021 · 1 comment
Closed

Comments

@hoenirvili
Copy link

hoenirvili commented Feb 8, 2021

What did you do? (required: The issue will be closed when not provided)

I installed vim-go along my favorite colorscheme nord.

After further investigations I come to the conclusion that nord-vim does not use the highlight groups that vim-go exposes in syntax.vim file. 've taken matters to my own hands and tried coming up with a solution, still there are some things that are missing like I want to target " and ; but looks like vim-go does not exposes this in syntax.vim.

Can anyone please point me to the right direction how to achieve this in order to uncomment this and solve the last remaining issues to make nord-vim colosrcheme consistent with other versions like the one visual studio nord colorscheme extensions is behaving on Go code?

I've tried writing my own syn match ones but without any luck I don't know that much vim-script and I have limited time to work on this.

What did you expect to happen?

To have the same color scheme appearance like the one nord-vim advertises.

What happened instead?

I had a lot of inconsistencies in how the syntax was highlighted even if I provided all the necessary vim-go configs.
The discussion of things that are wrong can be found here on the nord-vim issue that I just created.

Configuration (MUST fill this out):

vim-go version: 1.24

vimrc you used to reproduce:

vimrc
call plug#begin('~/.config/nvim/plugged')
...
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
...
Plug 'arcticicestudio/nord-vim'
...
call plug#end()

...
let &t_8f = "<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "<Esc>[48;2;%lu;%lu;%lum"
if exists('+termguicolors')
set termguicolors
endif

"go-vim
let g:go_def_reuse_buffer=1
let g:go_test_timeout='5s'
let g:go_updatetime=100
let g:go_fmt_command="goreturns"
let g:go_doc_max_height=40
let g:go_list_type="quickfix"
let g:go_def_mapping_enabled=0
let g:go_gopls_enabled=0
let g:go_auto_type_info = 0
let g:go_fmt_autosave = 1
let g:go_mod_fmt_autosave = 1
let g:go_addtags_skip_unexported = 1
let g:go_statusline_duration = 200
let g:go_echo_go_info = 0
let g:go_decls_mode = 'fzf'
let g:go_code_completion_enabled = 0
let g:go_asmfmt_autosave = 1

"go-vim syntax highlighting
let g:go_highlight_operators = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_generate_tags = 1

Vim version (first three lines from :version):

NVIM v0.5.0-dev+1069-g02a966386
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Go version (go version):

go version go1.15.6 linux/amd64

Go environment

go env Output:
GO111MODULE=""
GOARCH="amd64"
GOBIN="/home/frelsari/go/bin"
GOCACHE="/home/frelsari/.cache/go-build"
GOENV="/home/frelsari/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/frelsari/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/frelsari/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build100840794=/tmp/go-build -gno-record-gcc-switches"

gopls version

gopls version Output:
golang.org/x/tools/gopls v0.6.5
    golang.org/x/tools/[email protected] h1:kLt9rD/dWtVdvc8LmdcxagDFih6zxYXREpKSYYZu5KE=

@bhcleek
Copy link
Collaborator

bhcleek commented Feb 8, 2021

I'm not sure what nord-vim is doing, but I can tell you generally that Vim-go links its highlight groups to the Vim provided highlight groups by default, so any color scheme that uses the Vim defined highlight groups to define its highlighting should work just fine. Instead of unlinking highlight groups that Vim-go creates, I'd think that the right solution would be for nord-vim to set the highlighting appropriately for the groups that Vim defines.

@bhcleek bhcleek closed this as completed Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants