生活随笔
收集整理的這篇文章主要介紹了
secureCRT vscode配环境记录
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
20220713
使用secureCRT鏈接遠(yuǎn)程服務(wù)器時(shí),在用到vim中含有中文的情況時(shí)出現(xiàn)亂碼,并且只要一編輯就會(huì)出現(xiàn)亂碼
使用 https://blog.csdn.net/sinat_30603081/article/details/124821038 的方法依次對(duì)于文件的格式進(jìn)行修改,但是還是無法解決,最后發(fā)現(xiàn)是secureCRT的session格式的設(shè)置問題
最終的解決方法
Options -> session Options -> appearance -> character encoding 修改為UTF-8后解決該問題
20220718
1、配置golong本地開發(fā)環(huán)境,修改vim的時(shí)候/etc/profile是一個(gè)只讀文件,想要export幾個(gè)路徑。
方法:輸入 w !sudo tee % 后,在輸入q退出,在打開文件時(shí),文件已經(jīng)被修改
20220720
1、go環(huán)境配置鏈接:https://blog.csdn.net/qq_44847649/article/details/123048329
配置云服務(wù)器中的golong環(huán)境遇到的問題:
INSTALL ALL之后會(huì)出現(xiàn)安裝失敗的問題,這是因?yàn)閲?guó)內(nèi)墻的原因,解決方法如下:
在終端中執(zhí)行如下指令,然后關(guān)閉vscode重新打開,在執(zhí)行install后,安裝成功!
go
env -w
GO111MODULE=on
go
env -w
GOPROXY=https://proxy.golang.com.cn,direct
2、git 安裝
centos 7.0 git安裝: yum install git
查看git是否安裝成功:git --version
20220728
1、vscode的golang環(huán)境無法跳轉(zhuǎn)的問題
借鑒于: https://www.cnblogs.com/senberhu/p/15737504.html
首先,需要安裝好 go 插件,插件市場(chǎng)搜索go,選一個(gè)即可安裝。
然后,需要安裝 go 的工具包。在 vscode 中,輸入快捷鍵:command(ctrl) + shift + p,在彈出的窗口中,輸入:go:install/Update Tools,回車后,選擇所有插件(勾一下全選),點(diǎn)擊確認(rèn),進(jìn)行安裝(設(shè)置GOPROXY)。
接下來,在項(xiàng)目的 settings.json 文件中添加配置:
"go.goroot": "D:\\Go",
"go.gopath": "D:\\gopath",//第三方庫代碼提示
"go.inferGopath": true,
"go.formatTool": "goreturns",//自動(dòng)完成未導(dǎo)入的包
"go.autocompleteUnimportedPackages": true,
"go.gocodePackageLookupMode": "go",
"go.gotoSymbol.includeImports": true,
"go.docsTool": "gogetdoc",
"go.useCodeSnippetsOnFunctionSuggest": true,
"go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
"go.useLanguageServer": true,
"[go]": { "editor.formatOnSave": true,
"editor.codeActionsOnSave": { "source.organizeImports": true,
}, // Optional: Disable snippets, as they conflict with completion ranking.
"editor.snippetSuggestions": "none",
},
"[go.mod]": { "editor.formatOnSave": true,
"editor.codeActionsOnSave": { "source.organizeImports": true,
},
},
"go.trace.server": "verbose",
"gopls": { // Add parameter placeholders when completing a function.
"usePlaceholders": false, // If true,
enable additional analyses with staticcheck. // Warning: This will significantly increase memory usage.
"staticcheck": false,
},
"go.languageServerFlags": [ "-remote=auto",
"-logfile=auto",
"-debug=:0",
"-rpc.trace",
],
首選項(xiàng)-設(shè)置 去掉 Use Language Server
2、golang語言在使用ssh遠(yuǎn)程連接服務(wù)時(shí),出現(xiàn)“golang unrecognized import path “golang.org/x/crypto””的錯(cuò)誤
這是由于國(guó)內(nèi)上網(wǎng)眾所周知的原因,用代理的方式解決:
[root@test rttys
]
[root@test rttys
]
[root@test rttys
]
go: downloading golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4
go: extracting golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4
go: finding github.com/dwdcth/consoleEx v0.0.0-20180521133551-f56f6eb78b76
go: finding github.com/gorilla/websocket v1.4.1
go: finding github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c
go: finding github.com/json-iterator/go v1.1.9
go: finding github.com/kylelemons/go-gypsy v0.0.0-20160905020020-08cad365cd28
go: finding github.com/mattn/go-colorable v0.1.4
go: finding github.com/rakyll/statik v0.1.7
go: finding golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4
go: finding github.com/rs/zerolog v1.18.0
go: finding github.com/mattn/go-isatty v0.0.8
go: finding golang.org/x/sys v0.0.0-20190412213103-97732733099d
go: finding github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421
go: finding github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
如果沒有g(shù)o.mod,需要?jiǎng)?chuàng)建go.mod文件,并將以下的信息拷入到該文件中:
[root@test rttys
]
module github.com/zhaojh329/rttysgo
1.14require
(github.com/dwdcth/consoleEx v0.0.0-20180521133551-f56f6eb78b76github.com/gorilla/websocket v1.4.1github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19cgithub.com/json-iterator/go v1.1.9github.com/kylelemons/go-gypsy v0.0.0-20160905020020-08cad365cd28github.com/mattn/go-colorable v0.1.4github.com/rakyll/statik v0.1.7github.com/rs/zerolog v1.18.0golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4
)
總結(jié)
以上是生活随笔為你收集整理的secureCRT vscode配环境记录的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。