diff --git a/nvim/coc-settings.json b/nvim/coc-settings.json index 4f40571..c565b68 100644 --- a/nvim/coc-settings.json +++ b/nvim/coc-settings.json @@ -3,5 +3,33 @@ "git.changedSign.text": "▐", "git.removedSign.text": "▐", "git.topRemovedSign.text": "▐", - "git.changeRemovedSign.text": "▐" + "git.changeRemovedSign.text": "▐", + "suggest.noselect": false, + "diagnostic.errorSign": "✘", + "diagnostic.warningSign": "⚠", + "diagnostic.infoSign": "🛈", + "diagnostic.checkCurrentLine": true, + "coc.preferences.formatOnSaveFiletypes": [ + "javascript", + "html", + "json", + "css", + "scss", + "go" + ], + "coc.preferences.hoverTarget": "float", + "languageserver": { + "golang": { + "command": "gopls", + "rootPatterns": [ + "go.mod" + ], + "filetypes": [ + "go" + ] + } + }, + "go.goplsOptions": { + "staticcheck": true + } } diff --git a/nvim/colors b/nvim/colors index 1653165..d5452a7 100644 --- a/nvim/colors +++ b/nvim/colors @@ -18,16 +18,20 @@ function! s:sonokai_custom() abort " the fourth parameter is for UI highlighting which is optional, " and the last parameter is for `guisp` which is also optional. " See `autoload/sonokai.vim` for the format of `l:palette`. - call sonokai#highlight('LineNr', l:palette.grey, l:palette.bg1) - call sonokai#highlight('SignColumn', l:palette.fg, l:palette.bg1) - call sonokai#highlight('VertSplit', l:palette.bg1, l:palette.none) - call sonokai#highlight('Terminal', l:palette.fg, l:palette.bg1) + call sonokai#highlight('BlueSign', l:palette.blue, l:palette.bg1) call sonokai#highlight('CocGitAddedSign', l:palette.green, l:palette.bg1) + call sonokai#highlight('CocGitChangeRemovedSign', l:palette.purple, l:palette.bg1) call sonokai#highlight('CocGitChangedSign', l:palette.blue, l:palette.bg1) call sonokai#highlight('CocGitRemovedSign', l:palette.red, l:palette.bg1) call sonokai#highlight('CocGitTopRemovedSign', l:palette.red, l:palette.bg1) - call sonokai#highlight('CocGitChangeRemovedSign', l:palette.purple, l:palette.bg1) call sonokai#highlight('GitCommitTemplateTag', l:palette.orange, l:palette.none) + call sonokai#highlight('GreenSign', l:palette.green, l:palette.bg1) + call sonokai#highlight('LineNr', l:palette.grey, l:palette.bg1) + call sonokai#highlight('RedSign', l:palette.red, l:palette.bg1) + call sonokai#highlight('SignColumn', l:palette.fg, l:palette.bg1) + call sonokai#highlight('Terminal', l:palette.fg, l:palette.bg1) + call sonokai#highlight('VertSplit', l:palette.bg1, l:palette.none) + call sonokai#highlight('YellowSign', l:palette.yellow, l:palette.bg1) endfunction augroup CustomColors diff --git a/nvim/golang b/nvim/golang new file mode 100644 index 0000000..3f7c737 --- /dev/null +++ b/nvim/golang @@ -0,0 +1,22 @@ +" disable all linters as that is taken care of by coc.nvim +let g:go_diagnostics_enabled = 0 +let g:go_metalinter_enabled = [] + +" don't jump to errors after metalinter is invoked +let g:go_jump_to_error = 0 + +" run go imports on file save +let g:go_fmt_command = "goimports" + +" automatically highlight variable your cursor is on +let g:go_auto_sameids = 0 + +" syntax highlighting +let g:go_highlight_types = 1 +let g:go_highlight_fields = 1 +let g:go_highlight_functions = 1 +let g:go_highlight_function_calls = 1 +let g:go_highlight_operators = 1 +let g:go_highlight_extra_types = 1 +let g:go_highlight_build_constraints = 1 +let g:go_highlight_generate_tags = 1 diff --git a/nvim/plugins b/nvim/plugins index 5518763..2ceae8d 100644 --- a/nvim/plugins +++ b/nvim/plugins @@ -2,6 +2,7 @@ Plug 'cespare/vim-toml' Plug 'mileszs/ack.vim' Plug 'tpope/vim-fugitive' +Plug 'fatih/vim-go' Plug 'tpope/vim-projectionist' Plug 'tpope/vim-rails' Plug 'tpope/vim-surround' diff --git a/vimrc b/vimrc index eb793a6..83e5a35 100644 --- a/vimrc +++ b/vimrc @@ -95,6 +95,11 @@ if filereadable(expand("~/.config/nvim/test")) source ~/.config/nvim/test endif +" Golang setup +if filereadable(expand("~/.config/nvim/golang")) + source ~/.config/nvim/golang +endif + " Color setup if filereadable(expand("~/.config/nvim/colors")) source ~/.config/nvim/colors