From 59340e713d31d7b3491e085fb585dd9a4c34290e Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Tue, 31 Dec 2024 20:45:02 -0500 Subject: [PATCH] AutoYADM commit: 2024-12-31 20:45:02 --- .config/nvim/lazyvim.json | 1 - .config/nvim/lua/plugins/go.lua | 126 ++++++++++++++++++++++++++++++++ .config/tmux/tmux.conf | 70 +++++++++--------- 3 files changed, 161 insertions(+), 36 deletions(-) create mode 100644 .config/nvim/lua/plugins/go.lua diff --git a/.config/nvim/lazyvim.json b/.config/nvim/lazyvim.json index d0ed0efa..a2248dfc 100644 --- a/.config/nvim/lazyvim.json +++ b/.config/nvim/lazyvim.json @@ -16,7 +16,6 @@ "lazyvim.plugins.extras.lang.clangd", "lazyvim.plugins.extras.lang.cmake", "lazyvim.plugins.extras.lang.docker", - "lazyvim.plugins.extras.lang.go", "lazyvim.plugins.extras.lang.java", "lazyvim.plugins.extras.lang.json", "lazyvim.plugins.extras.lang.nushell", diff --git a/.config/nvim/lua/plugins/go.lua b/.config/nvim/lua/plugins/go.lua new file mode 100644 index 00000000..5aecc185 --- /dev/null +++ b/.config/nvim/lua/plugins/go.lua @@ -0,0 +1,126 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + opts = { ensure_installed = { "go", "gomod", "gowork", "gosum" } }, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + gopls = { + settings = { + gopls = { + gofumpt = true, + codelenses = { + gc_details = false, + generate = true, + regenerate_cgo = true, + run_govulncheck = true, + test = true, + tidy = true, + upgrade_dependency = true, + vendor = true, + }, + hints = { + assignVariableTypes = true, + compositeLiteralFields = true, + compositeLiteralTypes = true, + constantValues = true, + functionTypeParameters = true, + parameterNames = true, + rangeVariableTypes = true, + }, + analyses = { + fieldalignment = true, + nilness = true, + unusedparams = true, + unusedwrite = true, + useany = true, + }, + usePlaceholders = true, + completeUnimported = true, + staticcheck = true, + directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" }, + semanticTokens = true, + }, + }, + }, + }, + setup = { + gopls = function(_, opts) + -- workaround for gopls not supporting semanticTokensProvider + -- https://github.com/golang/go/issues/54531#issuecomment-1464982242 + LazyVim.lsp.on_attach(function(client, _) + if not client.server_capabilities.semanticTokensProvider then + local semantic = client.config.capabilities.textDocument.semanticTokens + client.server_capabilities.semanticTokensProvider = { + full = true, + legend = { + tokenTypes = semantic.tokenTypes, + tokenModifiers = semantic.tokenModifiers, + }, + range = true, + } + end + end, "gopls") + -- end workaround + end, + }, + }, + }, + { + "williamboman/mason.nvim", + opts = { ensure_installed = { "goimports", "gofumpt", "gomodifytags", "impl" } }, + }, + { + "fredrikaverpil/neotest-golang", + }, + { + "echasnovski/mini.icons", + opts = { + file = { + [".go-version"] = { glyph = "", hl = "MiniIconsBlue" }, + }, + filetype = { + gotmpl = { glyph = "󰟓", hl = "MiniIconsGrey" }, + }, + }, + }, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + go = { "goimports", "gofumpt" }, + }, + }, + }, + { + "mfussenegger/nvim-dap", + dependencies = { + { + "williamboman/mason.nvim", + opts = { ensure_installed = { "delve" } }, + }, + { + "leoluz/nvim-dap-go", + opts = {}, + }, + }, + }, + { + "nvim-neotest/neotest", + dependencies = { + "fredrikaverpil/neotest-golang", + }, + opts = { + adapters = { + ["neotest-golang"] = { + -- Here we can set options for neotest-golang, e.g. + -- go_test_args = { "-v", "-race", "-count=1", "-timeout=60s" }, + dap_go_enabled = true, -- requires leoluz/nvim-dap-go + }, + }, + }, + }, +} diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index b659213d..b3a52c71 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -50,46 +50,46 @@ set -g bell-action none ### PLUGINS # plugin manager -# set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tpm' # sensible defaults -# set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-sensible' # better yank -# set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'tmux-plugins/tmux-yank' # pretty minimal status -# set -g @plugin 'niksingh710/minimal-tmux-status' +set -g @plugin 'niksingh710/minimal-tmux-status' # Theme Settings -# set -g @minimal-tmux-use-arrow false -# set -g @minimal-tmux-status "top" -# set -g @minimal-tmux-right true -# set -g @minimal-tmux-justify "centre" -# set -g @minimal-tmux-bg "#933737" -# set -g @minimal-tmux-fg "#000000" -# -# set -g @plugin 'tmux-plugins/tmux-resurrect' -# set -g @resurrect-strategy-nvim 'session' -# set -g @plugin 'tmux-plugins/tmux-continuum' -# set -g @continuum-boot 'on' +set -g @minimal-tmux-use-arrow false +set -g @minimal-tmux-status "top" +set -g @minimal-tmux-right true +set -g @minimal-tmux-justify "centre" +set -g @minimal-tmux-bg "#933737" +set -g @minimal-tmux-fg "#000000" -# # Awesome Tmux -# # note: prefix + Tab to trigger -# set -g @plugin 'laktak/extrakto' -# # prefix + ?: keybindings help -# set -g @plugin 'lost-melody/tmux-command-palette' -# # easymotion -# set -g @plugin 'ddzero2c/tmux-easymotion' -# set -g @easymotion-key 's' -# -# # prefix + T -# set -g @plugin '27medkamal/tmux-session-wizard' -# # prefix + g -# set -g @plugin 'sturob/tmux-teleport' -# -# # Prefix f to open main fzf -# # Prefix C-w to open window switcher -# TMUX_FZF_LAUNCH_KEY="C-f" -# set -g @plugin 'sainnhe/tmux-fzf' -# bind-key C-w run-shell -b "/home/fic/.config/tmux/plugins/tmux-fzf/scripts/window.sh switch" +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @resurrect-strategy-nvim 'session' +set -g @plugin 'tmux-plugins/tmux-continuum' +set -g @continuum-boot 'on' + +# Awesome Tmux +# note: prefix + Tab to trigger +set -g @plugin 'laktak/extrakto' +# prefix + ?: keybindings help +set -g @plugin 'lost-melody/tmux-command-palette' +# easymotion +set -g @plugin 'ddzero2c/tmux-easymotion' +set -g @easymotion-key 's' + +# prefix + T +set -g @plugin '27medkamal/tmux-session-wizard' +# prefix + g +set -g @plugin 'sturob/tmux-teleport' + +# Prefix f to open main fzf +# Prefix C-w to open window switcher +TMUX_FZF_LAUNCH_KEY="C-f" +set -g @plugin 'sainnhe/tmux-fzf' +bind-key C-w run-shell -b "/home/fic/.config/tmux/plugins/tmux-fzf/scripts/window.sh switch" # TODO: # https://github.com/whame/tmux-modal @@ -176,4 +176,4 @@ bind c new-window -c "" # WARN: This line must come last! -# run '/usr/share/tmux-plugin-manager/tpm' +run '~/.tmux/plugins/tpm/tpm'