VSCode
属性设置
{
"sublimeTextKeymap.promptV3Features": true,
"editor.snippetSuggestions": "top",
"go.lintTool": "gometalinter",
"gitlens.advanced.messages": {
"suppressCommitHasNoPreviousCommitWarning": false,
"suppressCommitNotFoundWarning": false,
"suppressFileNotUnderSourceControlWarning": false,
"suppressGitVersionWarning": false,
"suppressLineUncommittedWarning": false,
"suppressNoRepositoryWarning": false,
"suppressUpdateNotice": false,
"suppressWelcomeNotice": true
},
"window.zoomLevel": -1,
"go.gotoSymbol.includeImports": true,
"go.lintOnSave": "file",
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"go.lintFlags": [
"-min_confidence=.8"
],
"editor.minimap.enabled": false,
"workbench.startupEditor": "newUntitledFile",
"editor.multiCursorModifier": "alt",
"search.useIgnoreFiles": false,
"gitlens.remotes": [],
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"scm.diffDecorations": "gutter",
"gitlens.advanced.repositorySearchDepth": 3,
"gitlens.advanced.similarityThreshold": 1,
"[html]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"files.associations": {
"*.proto": "proto3"
},
"go.formatTool": "goimports",
"go.useLanguageServer": true,
"go.useGoProxyToCheckForToolUpdates": false,
"gulp.autoDetect": "on",
"window.menuBarVisibility": "toggle",
"workbench.activityBar.visible": true
}
快捷键设置
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+t",
"command": "-workbench.action.showAllSymbols"
},
{
"key": "ctrl+t",
"command": "editor.action.transpose"
},
{
"key": "alt+p",
"command": "workbench.action.openWorkspace"
},
{
"key": "alt+f5",
"command": "-workbench.action.editor.nextChange",
"when": "editorTextFocus"
},
{
"key": "ctrl+j",
"command": "workbench.action.editor.previousChange",
"when": "editorTextFocus"
},
{
"key": "shift+alt+f5",
"command": "-workbench.action.editor.previousChange",
"when": "editorTextFocus"
},
{
"key": "ctrl+k ctrl+m",
"command": "workbench.action.toggleMultiCursorModifier"
},
{
"key": "ctrl+j",
"command": "-editor.action.joinLines",
"when": "editorTextFocus"
},
{
"key": "ctrl+j",
"command": "-workbench.action.togglePanel"
}
]
GOLand
此备份是基于 Visual Studio keymap 设置出来的自定义的快捷键。(2020年5月23日)
整合了自己常用的一些快捷命令,包含一些 sublime 的。
其中 ctrl t
来源于 sublime text 的 transpose 命令。这里是用 Macro 的方式定义出来的。
<keymap version="1" name="custom" parent="Visual Studio">
<action id="ChangesView.Diff" />
<action id="CloseActiveTab" />
<action id="CloseContent">
<keyboard-shortcut first-keystroke="ctrl w" />
</action>
<action id="CompareTwoFiles" />
<action id="Console.Execute.Multiline" />
<action id="Console.Jdbc.Execute" />
<action id="Console.TableResult.CloneRow" />
<action id="Console.TableResult.CompareCells" />
<action id="Console.TableResult.FindInGrid">
<keyboard-shortcut first-keystroke="alt f3" />
</action>
<action id="Console.TableResult.SetNull" />
<action id="Console.TableResult.Submit" />
<action id="DatabaseView.CopyAction" />
<action id="Diff.ApplyLeftSide" />
<action id="Diff.ApplyRightSide" />
<action id="Diff.NextChange" />
<action id="Diff.PrevChange" />
<action id="Diff.ShowDiff" />
<action id="Diff.ShowSettingsPopup" />
<action id="DirDiffMenu.SynchronizeDiff.All" />
<action id="EditorChooseLookupItemCompleteStatement" />
<action id="EditorCompleteStatement">
<keyboard-shortcut first-keystroke="ctrl alt enter" />
</action>
<action id="EditorDuplicate" />
<action id="EditorLookupDown" />
<action id="EditorLookupUp" />
<action id="EditorNextWordInDifferentHumpsMode">
<keyboard-shortcut first-keystroke="alt right" />
</action>
<action id="EditorNextWordInDifferentHumpsModeWithSelection">
<keyboard-shortcut first-keystroke="shift alt right" />
</action>
<action id="EditorPreviousWordInDifferentHumpsMode">
<keyboard-shortcut first-keystroke="alt left" />
</action>
<action id="EditorPreviousWordInDifferentHumpsModeWithSelection">
<keyboard-shortcut first-keystroke="shift alt left" />
</action>
<action id="EditorScrollDown" />
<action id="EditorScrollUp" />
<action id="EditorSelectWord" />
<action id="EditorSplitLine" />
<action id="EditorStartNewLine">
<keyboard-shortcut first-keystroke="ctrl enter" />
</action>
<action id="EditorStartNewLineBefore">
<keyboard-shortcut first-keystroke="shift ctrl enter" />
</action>
<action id="EditorToggleColumnMode" />
<action id="FileChooser.GotoDesktop" />
<action id="FileChooser.NewFolder">
<keyboard-shortcut first-keystroke="alt insert" />
</action>
<action id="Find">
<keyboard-shortcut first-keystroke="alt f3" />
</action>
<action id="FindModal">
<keyboard-shortcut first-keystroke="ctrl f" />
</action>
<action id="Generate">
<keyboard-shortcut first-keystroke="alt insert" />
</action>
<action id="GotoTest" />
<action id="Images.ShowThumbnails" />
<action id="Inline" />
<action id="Macro.transpose">
<keyboard-shortcut first-keystroke="ctrl t" />
</action>
<action id="MethodOverloadSwitchDown" />
<action id="MethodOverloadSwitchUp" />
<action id="MoveLineDown">
<keyboard-shortcut first-keystroke="ctrl down" />
</action>
<action id="MoveLineUp">
<keyboard-shortcut first-keystroke="ctrl up" />
</action>
<action id="NewDir">
<keyboard-shortcut first-keystroke="ctrl alt n" />
</action>
<action id="NewFile">
<keyboard-shortcut first-keystroke="ctrl n" />
</action>
<action id="NextEditorTab" />
<action id="NextTab" />
<action id="PreviousEditorTab" />
<action id="PreviousTab" />
<action id="Print" />
<action id="QuickActionPopup" />
<action id="ReopenClosedTab">
<keyboard-shortcut first-keystroke="shift ctrl t" />
</action>
<action id="RunDashboard.CopyConfiguration" />
<action id="RunDashboard.ShowConfigurations" />
<action id="SearchEverywhere.NavigateToNextGroup">
<keyboard-shortcut first-keystroke="page_down" />
</action>
<action id="SearchEverywhere.NavigateToPrevGroup">
<keyboard-shortcut first-keystroke="page_up" />
</action>
<action id="SelectAllOccurrences" />
<action id="SelectNextOccurrence">
<keyboard-shortcut first-keystroke="ctrl d" />
</action>
<action id="SendEOF" />
<action id="ShowFilePath">
<keyboard-shortcut first-keystroke="ctrl alt 0" />
</action>
<action id="Uml.ShowDiff" />
<action id="UnselectPreviousOccurrence">
<keyboard-shortcut first-keystroke="shift ctrl d" />
</action>
<action id="Vcs.Log.GoToRef">
<keyboard-shortcut first-keystroke="alt f3" />
</action>
<action id="Vcs.UpdateProject" />
<action id="ViewSource" />
<action id="XDebugger.CopyWatch" />
<action id="openAssertEqualsDiff" />
</keymap>
Git
[alias]
l = log
c = checkout
b = branch
s = status
d = diff
g = log --graph --all
[core]
pager = less
pager = less -x --mouse
[pager]
branch = false
[diff]
tool = vimdiff
如果想让 diff/log/branch 命令界面成全视窗阅读时,设置下环境变量: export LESS=-r
(设置在 .bashrc 中)。
说明,pager 是用在显示 diff、log、branch 时设置是否分页显示。
默认用 less 工具,支持分页,但默认需要用 Enter 和 上下键 来实现滚动,而不支持鼠标滑轮滚动。
设置pager = less -c --mouse
后可实现鼠标滑轮滚动,但又不支持鼠标选中文本了。
设置环境变量export LESS=-r
后不需要设置 less 其他参数就既可以实现鼠标滚动,又可以鼠标选中文本了。
-c
实现先清屏再输出,--mouse
实现鼠标操作,-r
输出 raw 控制字符。
设置 git diff 显示代码中的中文字符:
git config --global core.quotepath false # 显示 status 编码
git config --global gui.encoding utf-8 # 图形界面编码
git config --global i18n.commit.encoding utf-8 # 提交信息编码
git config --global i18n.logoutputencoding utf-8 # 输出 log 编码
export LESSCHARSET=utf-8
GitHub 的访问
WindowPowerShell
自定义命令或命令别名(alias)
# ~\Documents\WindowsPowerShell> vim .\profile.ps1
Import-Module 'D:\Program Files\posh-git\src\posh-git.psd1'
function cdHome {cd $HOME}
function cdShell {cd C:\Users\{xxxx}\Documents\WindowsPowerShell}
function catWithCn($a) {get-content -encoding utf8 $a} # cat 支持中文
$env:LESS="-r"
Set-Alias -Name home -Value cdHome
Set-Alias -Name shell -Value cdShell
Set-Alias -Name l -Value ls
Set-Alias -Name catt -Value catWithCn # 中文输出文件内容
vim 不支持中文问题
# C:\Users\{xxxxxxxxxx}> vim .\.vimrc
set termencoding=utf-8
set encoding=utf8
set fileencodings=utf8,ucs-bom,gbk,cp936,gb2312,gb18030
网友评论