diff --git a/dot_config/nvim/after/plugin/lsp.lua.tmpl b/dot_config/nvim/after/plugin/lsp.lua.tmpl index 534e008..c3343a0 100644 --- a/dot_config/nvim/after/plugin/lsp.lua.tmpl +++ b/dot_config/nvim/after/plugin/lsp.lua.tmpl @@ -74,6 +74,13 @@ vim.lsp.handlers["workspace/diagnostic/refresh"] = function(_, _, ctx) return true end +vim.api.nvim_create_autocmd('BufWritePre', { + pattern = '*.go', + callback = function() + vim.lsp.buf.code_action({ context = { only = { 'source.organizeImports' } }, apply = true }) + end +}) + require("lsp-format").setup {} {{- if ne .chezmoi.os "openbsd" }} @@ -131,7 +138,21 @@ require('mason-lspconfig').setup_handlers({ } } }) - end + end, + ['gopls'] = function() + lsp.gopls.setup({ + settings = { + gopls = { + analyses = { + unusedparams = true, + unusedvariable = true, + shadow = true + }, + staticcheck = true, + }, + } + }) + end, }) {{- else }} local on_attach = function(client) diff --git a/dot_config/nvim/init.lua.tmpl b/dot_config/nvim/init.lua.tmpl index d7867da..9ead286 100644 --- a/dot_config/nvim/init.lua.tmpl +++ b/dot_config/nvim/init.lua.tmpl @@ -110,7 +110,6 @@ require('toggleterm').setup({ }) require("gruvbox").setup { - italic = false, contrast = "hard" } diff --git a/dot_tmux.conf.tmpl b/dot_tmux.conf.tmpl index aab2243..fc0bcd9 100644 --- a/dot_tmux.conf.tmpl +++ b/dot_tmux.conf.tmpl @@ -47,7 +47,8 @@ set -g display-time 4000 set -g status-interval 5 # upgrade $TERM -set -g default-terminal "{{ .term }}" +set -g default-terminal "screen-256color" +set-option -sa terminal-features ',{{ .term }}:RGB' # emacs key bindings in tmux command prompt (prefix + :) are better than # vi keys, even for vim users diff --git a/dot_vimrc.tmpl b/dot_vimrc.tmpl index 8dc341b..0c63bfd 100644 --- a/dot_vimrc.tmpl +++ b/dot_vimrc.tmpl @@ -9,8 +9,6 @@ let maplocalleader = "\\" map let g:elite_mode=1 -source ~/.vim/local.vim - " Plugins {{ "{{{" }} call plug#begin('~/.vim/plugged') "########### @@ -400,7 +398,6 @@ set thesaurus=~/.vim/thesaurus/english.txt set spellfile=~/.vim/spell/en.utf8.add set spelllang=en_us -set diffopt+=algorithm:patience set diffopt+=vertical " hi SpellBad gui=underline guifg=red cterm=underline ctermfg=red "{{ "}}}" }} diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl index 02f83ad..ad18165 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc.tmpl @@ -73,8 +73,8 @@ alias bkp-etc='doas restic -r /mnt/nfs/BSD/restic-repo --verbose backup /etc' alias bkp-list='doas restic -r /mnt/nfs/BSD/restic-repo snapshots' {{- else }} source $HOME/perl5/perlbrew/etc/bashrc -export PATH=$HOME/local/bin:$GOPATH/bin:$HOME/.cargo/bin:$HOME/.symfony/bin:$PATH -{{- if eq .chezmoi.hostname "rohan" }} +export PATH=$HOME/local/bin:$GOPATH/bin:$PATH +{{- if eq .chezmoi.arch "arm64" }} export PATH=/opt/homebrew/bin:$PATH {{- else }} export PATH=/usr/local/opt/sqlite/bin:/usr/local/opt/ruby/bin:/usr/local/opt/mariadb@10.4/bin:$PATH