add gopher

This commit is contained in:
DefectingCat
2024-03-05 08:53:58 +08:00
parent 16e210453b
commit db0ba385a0
5 changed files with 22 additions and 7 deletions

View File

@ -1,4 +1,4 @@
local dap = require "dap" local dap = require("dap")
dap.adapters["pwa-node"] = { dap.adapters["pwa-node"] = {
type = "server", type = "server",
@ -9,7 +9,7 @@ dap.adapters["pwa-node"] = {
}, },
} }
for _, language in ipairs { "typescript", "javascript" } do for _, language in ipairs({ "typescript", "javascript" }) do
dap.configurations[language] = { dap.configurations[language] = {
{ {
type = "pwa-node", type = "pwa-node",

View File

@ -21,7 +21,7 @@ require("mason-lspconfig").setup_handlers({
end, end,
}) })
lspconfig.rust_analyzer.setup({ --[[ lspconfig.rust_analyzer.setup({
on_attach = on_attach, on_attach = on_attach,
capabilities = capabilities, capabilities = capabilities,
settings = { settings = {
@ -69,7 +69,7 @@ lspconfig.rust_analyzer.setup({
allTargets = false, allTargets = false,
}, },
}, },
}) }) ]]
lspconfig.tsserver.setup({ lspconfig.tsserver.setup({
on_attach = on_attach, on_attach = on_attach,

View File

@ -55,7 +55,7 @@ vim.g.rustaceanvim = function()
}, },
}, },
procMacro = { procMacro = {
enable = false, enable = true,
ignored = { ignored = {
["async-trait"] = { "async_trait" }, ["async-trait"] = { "async_trait" },
["napi-derive"] = { "napi" }, ["napi-derive"] = { "napi" },

View File

@ -162,14 +162,14 @@ local plugins = {
require("rust-tools").setup(opts) require("rust-tools").setup(opts)
end, end,
}, ]] }, ]]
--[[ { {
"mrcjkb/rustaceanvim", "mrcjkb/rustaceanvim",
version = "^3", -- Recommended version = "^3", -- Recommended
ft = "rust", ft = "rust",
config = function() config = function()
require("custom.configs.rust") require("custom.configs.rust")
end, end,
}, ]] },
{ {
"saecki/crates.nvim", "saecki/crates.nvim",
ft = { "toml" }, ft = { "toml" },
@ -190,6 +190,18 @@ local plugins = {
vim.g.rustfmt_autosave = 1 vim.g.rustfmt_autosave = 1
end, end,
}, },
-- golang
{
"olexsmir/gopher.nvim",
ft = "go",
config = function(_, opts)
require("gopher").setup(opts)
--[[ require("core.utils").load_mappings("gopher") ]]
end,
build = function()
vim.cmd([[silent! GoInstallDeps]])
end,
},
{ {
"b0o/schemastore.nvim", "b0o/schemastore.nvim",
}, },

View File

@ -24,6 +24,9 @@ if [[ $OSTYPE == "darwin"* ]]; then
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
fi fi
# deno
export DVM_DIR="/Users/xfy/.dvm"
export PATH="$DVM_DIR/bin:$PATH"
# rust # rust
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup