Skip to content

Instantly share code, notes, and snippets.

@zhongxiang117
Last active November 28, 2023 06:03
Show Gist options
  • Save zhongxiang117/a88e57bd58e317dbb6a60aa37ca3b20f to your computer and use it in GitHub Desktop.
Save zhongxiang117/a88e57bd58e317dbb6a60aa37ca3b20f to your computer and use it in GitHub Desktop.
VScode Sync
{"lastUpload":"2023-11-28T06:03:00.633Z","extensionVersion":"v3.4.3"}
[
{
"key": "f5",
"command": "-workbench.action.debug.start",
"when": "!inDebugMode"
},
{
"key": "f5",
"command": "code-runner.run"
},
{
"key": "ctrl+alt+n",
"command": "-code-runner.run"
},
{
"key": "ctrl+u",
"command": "-cursorUndo",
"when": "textInputFocus"
},
{
"key": "ctrl+e",
"command": "-workbench.action.quickOpen"
},
{
"key": "ctrl+e",
"command": "-workbench.action.quickOpenNavigateNextInFilePicker",
"when": "inFilesPicker && inQuickOpen"
},
{
"key": "ctrl+right",
"command": "-cursorWordEndRight",
"when": "textInputFocus"
},
{
"key": "ctrl+e",
"command": "cursorLineEnd"
},
{
"key": "ctrl+w",
"command": "-workbench.action.closeWindow",
"when": "!editorIsOpen && !multipleEditorGroups"
},
{
"key": "ctrl+w",
"command": "deleteWordLeft",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+backspace",
"command": "-deleteWordLeft",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+b",
"command": "-workbench.action.toggleSidebarVisibility"
},
{
"key": "shift+delete",
"command": "-deleteFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "ctrl+shift+k",
"command": "-editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "shift+backspace",
"command": "-deleteLeft",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+u",
"command": "deleteAllLeft"
},
{
"key": "shift+enter",
"command": "-jupyter.runcurrentcelladvance",
"when": "editorTextFocus && jupyter.featureenabled && jupyter.hascodecells && !editorHasSelection"
},
{
"key": "shift+enter",
"command": "-jupyter.execSelectionInteractive",
"when": "editorTextFocus && jupyter.featureenabled && jupyter.ownsSelection && !findInputFocussed && !replaceInputFocussed && editorLangId == 'python'"
},
{
"key": "shift+enter",
"command": "-python.execSelectionInTerminal",
"when": "editorTextFocus && !findInputFocussed && !python.datascience.ownsSelection && !replaceInputFocussed && editorLangId == 'python'"
},
{
"key": "ctrl+enter",
"command": "-jupyter.runcurrentcell",
"when": "editorTextFocus && jupyter.featureenabled && jupyter.hascodecells && !editorHasSelection"
},
{
"key": "ctrl+shift+q ctrl+shift+q",
"command": "editor.action.inspectTMScopes"
},
{
"key": "ctrl+shift+q",
"command": "closeReferenceSearchEditor",
"when": "inReferenceSearchEditor && !config.editor.stablePeek"
},
{
"key": "escape",
"command": "-closeReferenceSearchEditor",
"when": "inReferenceSearchEditor && !config.editor.stablePeek"
},
{
"key": "ctrl+l",
"command": "-editor.action.clipboardCutAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+d",
"command": "-editor.action.copyLinesDownAction"
},
{
"key": "ctrl+shift+l",
"command": "-editor.action.deleteLines",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+l",
"command": "-liquid.formatDocument",
"when": "editorTextFocus"
},
{
"key": "alt+q",
"command": "bookmarks.toggle",
"when": "editorTextFocus"
},
{
"key": "ctrl+alt+k",
"command": "-bookmarks.toggle",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+a",
"command": "-editor.action.blockComment",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+a",
"command": "expand_region",
"when": "editorTextFocus"
},
{
"key": "ctrl+w",
"command": "-expand_region",
"when": "editorTextFocus"
},
{
"key": "ctrl+w",
"command": "-workbench.action.closeActiveEditor"
},
{
"key": "ctrl+w",
"command": "-editor.action.addSelectionToNextFindMatch"
},
{
"key": "ctrl+w",
"command": "-workbench.action.closeGroup",
"when": "activeEditorGroupEmpty && multipleEditorGroups"
},
{
"key": "f11",
"command": "-workbench.action.toggleFullScreen"
},
{
"key": "f11",
"command": "-workbench.action.debug.stepInto",
"when": "debugState != 'inactive'"
},
{
"key": "shift+f11",
"command": "-workbench.action.debug.stepOut",
"when": "debugState == 'stopped'"
},
{
"key": "ctrl+q",
"command": "-workbench.action.quit"
},
{
"key": "ctrl+2",
"command": "-workbench.action.focusSecondEditorGroup"
},
{
"key": "alt+w",
"command": "-toggleSearchEditorWholeWord",
"when": "inSearchEditor && searchInputBoxFocus"
},
{
"key": "alt+w",
"command": "-workbench.action.terminal.toggleFindWholeWord",
"when": "terminalFindFocused && terminalHasBeenCreated || terminalFindFocused && terminalProcessSupported || terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "alt+w",
"command": "-toggleFindWholeWord",
"when": "editorFocus"
},
{
"key": "alt+w",
"command": "-toggleSearchWholeWord",
"when": "searchViewletFocus"
},
{
"key": "ctrl+enter",
"command": "-editor.action.insertLineBefore",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+m",
"command": "-markdown.extension.editing.toggleMath",
"when": "editorTextFocus && !editorReadonly && editorLangId == 'markdown'"
},
{
"key": "ctrl+m",
"command": "-editor.action.toggleTabFocusMode"
},
{
"key": "ctrl+m",
"command": "editor.action.addCommentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+k ctrl+c",
"command": "-editor.action.addCommentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+m",
"command": "-workbench.actions.view.problems",
"when": "workbench.panel.markers.view.active"
},
{
"key": "ctrl+shift+m",
"command": "editor.action.removeCommentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+k ctrl+u",
"command": "-editor.action.removeCommentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+f11",
"command": "-workbench.action.debug.stepIntoTarget",
"when": "inDebugMode && stepIntoTargetsSupported && debugState == 'stopped'"
},
{
"key": "f11",
"command": "-extension.node-debug.startWithStopOnEntry",
"when": "!inDebugMode && activeViewlet == 'workbench.view.debug' && debugConfigurationType == 'node' || !inDebugMode && activeViewlet == 'workbench.view.debug' && debugConfigurationType == 'pwa-extensionHost' || !inDebugMode && activeViewlet == 'workbench.view.debug' && debugConfigurationType == 'pwa-node'"
},
{
"key": "ctrl+shift+f5",
"command": "-workbench.action.debug.restart",
"when": "inDebugMode"
},
{
"key": "shift+f5",
"command": "-cmake.launchTarget",
"when": "cmake:enableFullFeatureSet && !cmake:hideDebugCommand && !inDebugMode"
},
{
"key": "ctrl+f5",
"command": "-cmake.debugTarget",
"when": "cmake:enableFullFeatureSet && inCMakeProject && !cmake:hideDebugCommand && !inDebugMode"
},
{
"key": "f10",
"command": "-extension.node-debug.startWithStopOnEntry",
"when": "!inDebugMode && debugConfigurationType == 'node' || !inDebugMode && debugConfigurationType == 'pwa-extensionHost' || !inDebugMode && debugConfigurationType == 'pwa-node'"
},
{
"key": "ctrl+f10",
"command": "-editor.debug.action.runToCursor",
"when": "inDebugMode"
},
{
"key": "ctrl+k ctrl+i",
"command": "-editor.debug.action.showDebugHover",
"when": "editorTextFocus && inDebugMode"
},
{
"key": "ctrl+pagedown",
"command": "-workbench.action.debug.nextConsole",
"when": "inDebugRepl"
},
{
"key": "ctrl+pageup",
"command": "-workbench.action.debug.prevConsole",
"when": "inDebugRepl"
},
{
"key": "shift+f9",
"command": "-editor.debug.action.toggleInlineBreakpoint",
"when": "editorTextFocus"
},
{
"key": "ctrl+f5",
"command": "-workbench.action.debug.run",
"when": "debuggersAvailable && debugState != 'initializing'"
},
{
"key": "f11",
"command": "workbench.action.debug.stepInto"
},
{
"key": "enter",
"command": "acceptSelectedSuggestion",
"when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus"
},
{
"key": "ctrl+alt+space",
"command": "-toggleSuggestionFocus",
"when": "suggestWidgetVisible && textInputFocus"
},
{
"key": "shift+tab",
"command": "-acceptAlternativeSelectedSuggestion",
"when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus"
},
{
"key": "shift+tab",
"command": "-insertPrevSuggestion",
"when": "hasOtherSuggestions && textInputFocus && !inSnippetMode && !suggestWidgetVisible && config.editor.tabCompletion == 'on'"
},
// {
// "key": "tab",
// "command": "-insertNextSuggestion",
// "when": "hasOtherSuggestions && textInputFocus && !inSnippetMode && !suggestWidgetVisible && config.editor.tabCompletion == 'on'"
// },
{
"key": "ctrl+i",
"command": "-toggleSuggestionDetails",
"when": "suggestWidgetVisible && textInputFocus"
},
{
"key": "shift+enter",
"command": "-acceptAlternativeSelectedSuggestion",
"when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus"
},
{
"key": "ctrl+down",
"command": "-selectNextSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "ctrl+up",
"command": "-selectPrevSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
// {
// "key": "tab",
// "command": "selectNextSuggestion",
// "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
// }
]
{
"editor.fontSize": 14,
"editor.suggestSelection": "first",
"editor.insertSpaces": true,
"editor.minimap.enabled": true,
"editor.renderWhitespace": "all",
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true,
},
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.fixAll.eslint": false
},
"workbench.colorCustomizations": {
"editor.lineHighlightBackground": "#333333",
"activityBar.activeBackground": "#1b9c9c",
"breadcrumb.background": "#1a3a3d",
"badge.background": "#6f9408",
"tab.activeBackground": "#30795a",
},
"workbench.tree.renderIndentGuides": "always",
"workbench.tree.indent": 20,
"workbench.editor.titleScrollbarSizing": "large",
// File Association
"files.associations": {
"*.csh": "shellscript",
"*.liquid": "liquid",
},
"python.defaultInterpreterPath": "/home/xiang/Applications/miniconda3core/bin/python3",
//code file map
"code-runner.executorMap":{
"fortran": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && ./$fileNameWithoutExt",
"java": "cd $dir && javac $fileName && CLASSPATH=$CLASSPATH:$workspaceRoot; java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"python": "cd $dir && python3 $fileName",
},
//matlab
//"matlab.matlabpath": "/usr/local/MATLAB/R2016b/bin/matlab",
//"matlab.mlintpath": "/usr/local/MATLAB/R2016b/bin/glnxa64/mlint",
"[FortranFreeForm]": {
"editor.tabSize": 2,
"editor.rulers": [80,120],
},
"[FortranFixedForm]": {
"editor.tabSize": 3,
"editor.rulers": [5,6,72,80],
"editor.guides.indentation": false,
},
"[python]": {
"editor.rulers": [80,100,120],
},
// indenticator -- extension
"indenticator.width": 1,
"indenticator.color.dark": "#ff0000",
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features",
"editor.formatOnSave": false,
},
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features",
"editor.suggest.insertMode": "replace",
"editor.tabSize": 2,
},
"[cuda-cpp]": {
"editor.wordBasedSuggestions": false,
"editor.suggest.insertMode": "replace",
"editor.semanticHighlighting.enabled": true,
"outline.showConstants": false,
},
"workbench.iconTheme": "vscode-icons",
"explorer.confirmDelete": false,
"update.mode": "manual",
"extensions.autoCheckUpdates": false,
"extensions.autoUpdate": false,
"vsicons.dontShowNewVersionMessage": true,
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
},
"outline.showVariables": false,
"outline.showProperties": false,
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs":"active",
// title bar setting
"window.title": "${activeEditorLong}",
"code-eol.style": {"color": "#fbb613", "opacity":0.3, },
"[ruby]": {
"editor.suggest.insertMode": "replace",
"editor.tabSize": 2,
},
"notebook.displayOrder": [
"image/png",
"text/plain"
],
// set all default end-of-line ending to return
"files.eol": "\n",
"diffEditor.ignoreTrimWhitespace": false,
"update.showReleaseNotes": false,
"html.format.enable": false,
"liquid.format": true,
"hediet.vscode-drawio.theme": "min",
"jupyter.logging.level": "error",
"gitlens.hovers.currentLine.over": "line",
"sync.gist": "a88e57bd58e317dbb6a60aa37ca3b20f",
"sync.autoUpload": false,
"sync.autoDownload": false,
"sync.removeExtensions": false,
"sync.syncExtensions": false,
"security.workspace.trust.enabled": false,
"open-in-browser.default": "google-chrome",
"terminal.integrated.env.linux": {"PYTHONPATH": "${workspaceFolder}:${env:PYTHONPATH}"},
"python.languageServer": "Pylance",
"python.pylanceLspNotebooksEnabled": true,
"python.analysis.autoImportCompletions": false,
"redhat.telemetry.enabled": false,
"bookmarks.saveBookmarksInProject": true, // extremely important, fuck!
"cmake.configureOnOpen": false,
"extensions.ignoreRecommendations": true,
"terminal.integrated.inheritEnv": false,
"files.autoGuessEncoding": true,
"cSpell.enableFiletypes": [
"!python"
],
"notebook.cellToolbarLocation": {
"default": "right",
"jupyter-notebook": "left"
},
"jupyter.askForKernelRestart": false,
"workbench.editor.untitled.hint": "hidden",
}
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
//{snippetName}: It is displayed via IntelliSense if no description is provided.
//{prefix}: defines one or more trigger words that display the snippet in IntelliSense.
// Substring matching is performed on prefixes, so in this case,
// "fc" could match "for-const".
// if is left empty or omitted, the snippet gets applied to all languages
//{scope}: languages
//{body}: is one or more lines of content, which will be joined as multiple lines upon insertion.
// Newlines and embedded tabs will be formatted according to the context
// in which the snippet is inserted.
//{description}: is an optional description of the snippet displayed by IntelliSense.
// link for code snippet variables
// https://code.visualstudio.com/docs/editor/userdefinedsnippets
"html-snippets": {
"scope": "html",
"prefix": ["xx-html",],
"body": ["<!DOCTYPE html>","<html>","","<head>",
"\t<meta charset=\"utf-8\">","\t<link></link>",
"</head>","","","<body>","\t<h1></h1>","\t<p></p>",
"\t<div></div>","\t<script></script>","</body>","",
"</html>",
],
"description": "html-snippets",
},
"BOM": {
"scope": "shellscript, python",
"prefix": ["xx-BOM",],
"body": ["# -*- coding: utf-8 -*-","",],
"description": "Byte Order Mark (useless)",
},
"features":{
"scope": "python",
"prefix": ["xx-features-version",],
"body": [
"","FEATURES = ["," 'version 0.1.0 : Start',","]","",
"VERSION = FEATURES[-1].split()[1]","__version__ = VERSION","",
],
},
"argparse": {
"scope": "python",
"prefix": ["xx-argparse",],
"body": [
"","import sys","import argparse","",
"def parsecmd():"," parser = argparse.ArgumentParser(",
" formatter_class=argparse.RawDescriptionHelpFormatter,",
" usage=f\"\"\"","PROGRAM {VERSION}. General Usage:","",
" 1. explanation"," >>> script","\"\"\","," allow_abbrev=False,",
" ),"," parser.add_argument("," '-v','--version',",
" action='version',"," version=VERSION"," )",
" parser.add_argument("," '-f','--file',"," dest='file',",
" help='input file'"," )",
" g = parser.add_argument_group('options for development or miscellaneous')",
" g.add_argument("," '--show_supported_ftypes',",
" action='store_true',"," help='show supported file output types',",
" )"," parser.add_argument("," '--features',",
" action='store_true',"," help='show development features'",
" )",""," if len(sys.argv) == 1:"," parser.print_help()",
" return"," w = parser.parse_args(sys.argv[1:])"," if w.features:",
" for i in FEATURES: print(i)"," return","","",
],
"description": "Full",
},
"fortran77-demo": {
"scope": "fortran_fixed-form, fortran",
"prefix": ["xx-fortran77",],
"body": [" program HelloWorld"," implicit none","c",
"c implicit rule: first char of the name is I,J,K,L,M,N",
"c then the data type is integer, otherwise it is real",
"c","c all type-declarations have in at the very beginning",
"c besides, the return function type also should be defined",
" integer i, n, sum, calc_sum"," real r",
"c format"," r = 1.0"," write(*,*) ''",
" write(*,999) 'Use format =', r","c call subroutine",
" write(*,*) ''"," call hello","c read input",
" write(*,*) ''"," write (*,*) 'Input integer?'",
" read (*,*) n","c call function"," write(*,*) ''",
" sum = calc_sum(n)"," write (*,*) '<Use Func> sum = ', sum",
"c do-loop"," write(*,*) ''"," sum = 0"," do i = 1, n",
" sum = sum + i"," enddo",
" write (*,*) '<Use Do-1> sum = ', sum",
"c another do-loop"," write(*,*) ''"," sum = 0",
" do 10 i = 1, n, 1"," sum = sum + i"," 10 continue",
" write (*,*) '<Use Do-2> sum = ', sum",
"c", "c format","c A - text string",
"c D - double precision numbers, exponent notation",
"c E - real numbers, exponent notation",
"c F - real numbers, fixed point format",
"c I - integer", "c X - horizontal skip (space)",
"c / - vertical skip (newline)",
"999 format (A,F6.3)"," end","","",
"c calculate i + (i+1) +(i+2) + ... n",
"c return value is the function name",
" integer function calc_sum(n)",
" implicit none"," integer i, n"," i = 1",
" calc_sum = 0","c one line logical"," if (n.eq.0) return",
"c goto"," 1 if (i.lt.n+1) then"," calc_sum = calc_sum + i",
" i = i + 1"," goto 1"," end if"," return",
" end","",""," subroutine hello"," implicit none",
" character*32 text"," text = 'subroutine: Hello World'",
" write (*,*) text"," end",
],
},
"java": {
"scope": "java,",
"prefix": ["xx-java",],
"body": ["class FreshJuiceEnum {", " enum FreshJuiceSize { SMALL, MEDIUM, LARGE }",
" FreshJuiceSize size;", "}", "",
"public class $TM_FILENAME_BASE {", " int varAge;",
"", " public $TM_FILENAME_BASE (String name) {",
" /* This constructor has one parameter, name */",
" System.out.println(\"Name chosen is : \" + name );", " }", "",
" public void setAge(int age) {", " varAge = age;", " }", "",
" public int getAge() {",
" System.out.println(\"age is : \" + varAge );",
" return varAge;", " }", "",
" public static void main(String []args) {",
" FreshJuiceEnum juice = new FreshJuiceEnum();",
" juice.size = FreshJuiceEnum.FreshJuiceSize.MEDIUM;",
" System.out.println(\"Size: \" + juice.size);", "",
" /* Object creation */",
" $TM_FILENAME_BASE myObj = new $TM_FILENAME_BASE(\"Tom\");", "",
" /* Call class method */", " myObj.setAge(2);", "",
" if (myObj.varAge == 10) {",
" System.out.println(\"if-statement : good\");",
" /* if it has else, no need new line */", " } else {",
" System.out.println(\"if-statement : bad\");", " }", "",
" /* Call another class method */", " myObj.getAge();", "",
" /* You can access instance variable as follows as well */",
" System.out.println(\"Variable Value : \" + myObj.varAge );", " }",
"}", "/*",
"Note: samePackage diffPackage diffPackage",
"# thisClass (childClass & otherClass) (childClass) (otherClass)",
"public visible visible visible visible",
"protected visible visible visible invisible",
"default visible visible invisible invisible",
"private visible invisible invisible invisible",
"*/", "", "", "",
],
},
"document": {
"scope": "markdown,",
"prefix": ["xx-document",],
"body": ["A very good document [`${1:alt}`](${2:link})","","```note",
"in case of any errors, here is a backup file: [`${3:alt}`](${4:link})",
"","All rights belong to the author that link shows.","",
"Also, in here I express my great gratitude to OP for such a helpful and useful document!",
"```",
],
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment