From 5aae64e50e4d4d54784c8a3c477d86101531ff44 Mon Sep 17 00:00:00 2001 From: Tovi Jaeschke-Rogers Date: Thu, 6 Jun 2024 19:09:08 +0930 Subject: [PATCH] feat: update go lsp --- .../nvim/lua/tovi/plugins/lsp/lspconfig.lua | 27 +++++++++++-------- .zshrc | 5 ++-- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.config/nvim/lua/tovi/plugins/lsp/lspconfig.lua b/.config/nvim/lua/tovi/plugins/lsp/lspconfig.lua index 405fb6a..8122823 100644 --- a/.config/nvim/lua/tovi/plugins/lsp/lspconfig.lua +++ b/.config/nvim/lua/tovi/plugins/lsp/lspconfig.lua @@ -204,17 +204,22 @@ return { } }) - -- configure python server - lspconfig["pyright"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure python server - lspconfig["gopls"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) + lspconfig.gopls.setup { + on_attach = on_attach, + capabilities = capabilities, + cmd = {"gopls"}, + filetypes = { "go", "gomod", "gowork", "gotmpl" }, + root_dir = util.root_pattern("go.work", "go.mod", ".git"), + settings = { + gopls = { + completeUnimported = true, + usePlaceholders = true, + analyses = { + unusedparams = true, + }, + }, + }, + } -- configure lua server (with special settings) lspconfig["lua_ls"].setup({ diff --git a/.zshrc b/.zshrc index 5f3fb6d..aca0bf5 100644 --- a/.zshrc +++ b/.zshrc @@ -68,7 +68,6 @@ HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history HISTSIZE=99999999 SAVEHIST=$HISTSIZE -export PATH="~/.local/bin/:$PATH" if [[ $(uname) == 'Darwin' ]]; then fi @@ -92,8 +91,6 @@ export FNM_NODE_DIST_MIRROR="https://nodejs.org/dist" export FNM_ARCH="x64" rehash -# export PHPCS_STANDARD=~/.config/phpcs.xml - if [[ $(uname) == 'Darwin' ]]; then export HOMEBREW_NO_AUTO_UPDATE=1 @@ -103,6 +100,8 @@ if [[ $(uname) == 'Darwin' ]]; then eval "$(rbenv init - zsh)" fi +export PATH="${HOME}/.local/bin/:${HOME}/go/bin:${PATH}" + source <(fzf --zsh) export NVM_DIR="$HOME/.nvm"