Skip to content

Instantly share code, notes, and snippets.

@fmind
Created May 25, 2024 06:04
Show Gist options
  • Save fmind/be8f968848f8dfd5e6f82d5496d508fc to your computer and use it in GitHub Desktop.
Save fmind/be8f968848f8dfd5e6f82d5496d508fc to your computer and use it in GitHub Desktop.
IDX
# To learn more about how to use Nix to configure your environment
# see: https://developers.google.com/idx/guides/customize-idx-env
{ pkgs, ... }: {
# Which nixpkgs channel to use.
channel = "stable-23.11"; # or "unstable"
# Use https://search.nixos.org/packages to find packages
packages = [
# pkgs.go
pkgs.python311
pkgs.python311Packages.pip
# pkgs.nodejs_20
# pkgs.nodePackages.nodemon
];
# Sets environment variables in the workspace
env = {};
idx = {
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
extensions = [
"vscodevim.vim"
"ms-python.python"
"ms-toolsai.jupyter"
"streetsidesoftware.code-spell-checker"
];
# Enable previews
previews = {
enable = true;
previews = {
# web = {
# # Example: run "npm run dev" with PORT set to IDX's defined port for previews,
# # and show it in IDX's web preview panel
# command = ["npm" "run" "dev"];
# manager = "web";
# env = {
# # Environment variables to set for your server
# PORT = "$PORT";
# };
# };
};
};
# Workspace lifecycle hooks
workspace = {
# Runs when a workspace is first created
onCreate = {
# Example: install JS dependencies from NPM
venv-pip-install = "python -m venv .venv && pip intall -r requirements.txt";
};
# Runs when the workspace is (re)started
onStart = {
# Example: start a background task to watch and re-build backend code
# watch-backend = "npm run watch-backend";
};
};
};
}
[
// ACTIONS
{
"key": "alt+a",
"command": "workbench.action.showAllSymbols"
},
{
"key": "alt+b",
"command": "workbench.action.navigateBack"
},
{
"key": "alt+c",
"command": "aichat.prompt"
},
{
"key": "alt+d",
"command": "workbench.view.debug"
},
{
"key": "alt+e",
"command": "workbench.view.explorer"
},
{
"key": "alt+f",
"command": "workbench.action.navigateForward"
},
{
"key": "alt+g",
"command": "workbench.view.scm"
},
{
"key": "alt+h",
"command": "workbench.action.focusLeftGroup"
},
{
"key": "alt+i",
"command": "inlineChat.start"
},
{
"key": "alt+j",
"command": "workbench.action.previousEditor"
},
{
"key": "alt+k",
"command": "workbench.action.nextEditor"
},
{
"key": "alt+l",
"command": "workbench.action.focusRightGroup"
},
{
"key": "alt+m",
"command": "workbench.action.toggleMaximizeEditorGroup"
},
{
"key": "alt+n",
"command": "workbench.action.focusBelowGroup"
},
{
"key": "alt+o",
"command": "aichat.actionsMenu"
},
{
"key": "alt+p",
"command": "workbench.action.focusAboveGroup"
},
{
"key": "alt+q",
"command": "workbench.action.showCommands"
},
{
"key": "alt+r",
"command": "extension.invokeTask"
},
{
"key": "alt+s",
"command": "workbench.action.gotoSymbol"
},
{
"key": "alt+u",
"command": "outline.focus"
},
{
"key": "alt+t",
"command": "workbench.panel.testResults.view.focus"
},
{
"key": "alt+v",
"command": "workbench.action.output.toggleOutput"
},
{
"key": "alt+w",
"command": "workbench.action.toggleEditorWidths"
},
{
"key": "alt+x",
"command": "workbench.view.extension.test"
},
{
"key": "alt+y",
"command": "workbench.debug.action.toggleRepl"
},
{
"key": "alt+z",
"command": "workbench.actions.view.problems"
},
{
"key": "alt+-",
"command": "workbench.action.terminal.runRecentCommand"
},
{
"key": "alt+=",
"command": "workbench.action.toggleMaximizedPanel"
},
{
"key": "alt+,",
"command": "workbench.action.terminal.new"
},
{
"key": "alt+.",
"command": "workbench.action.terminal.splitInActiveWorkspace"
},
{
"key": "alt+/",
"command": "workbench.action.newGroupRight"
},
{
"key": "alt+space",
"command": "editor.action.inlineSuggest.trigger"
},
// DISABLED
{
"key": "cmd+enter",
"command": "-editor.action.insertLineAfter",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+enter",
"command": "-github.copilot.generate",
"when": "editorTextFocus && github.copilot.activated"
},
{
"key": "cmd+b",
"command": "-markdown.extension.editing.toggleBold",
"when": "editorTextFocus && !editorReadonly && editorLangId =~ /^markdown$|^rmd$|^quarto$/"
},
{
"key": "ctrl+b",
"command": "-markdown.extension.editing.toggleBold",
"when": "editorTextFocus && !editorReadonly && editorLangId =~ /^markdown$|^rmd$|^quarto$/"
},
// JUPYTER
{
"key": "n",
"command": "notebook.cell.insertMarkdownCellBelow",
"when": "notebookEditorFocused && !inputFocus"
},
{
"key": "p",
"command": "notebook.cell.insertMarkdownCellAbove",
"when": "notebookEditorFocused && !inputFocus"
},
// POPUPS
{
"key": "alt+h",
"command": "file-browser.stepOut",
"when": "inFileBrowser"
},
{
"key": "alt+l",
"command": "file-browser.stepIn",
"when": "inFileBrowser"
},
{
"key": "alt+h",
"command": "list.collapse",
"when": "listFocus && !inputFocus"
},
{
"key": "alt+l",
"command": "list.expand",
"when": "listFocus && !inputFocus"
},
{
"key": "alt+j",
"command": "list.focusDown",
"when": "listFocus && !inputFocus"
},
{
"key": "alt+k",
"command": "list.focusUp",
"when": "listFocus && !inputFocus"
},
{
"key": "alt+j",
"command": "workbench.action.quickOpenSelectNext",
"when": "inQuickOpen"
},
{
"key": "alt+k",
"command": "workbench.action.quickOpenSelectPrevious",
"when": "inQuickOpen"
},
{
"key": "alt+j",
"command": "selectNextSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "alt+k",
"command": "selectPrevSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "alt+l",
"command": "acceptSelectedSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "alt+j",
"command": "showNextParameterHint",
"when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
},
{
"key": "alt+k",
"command": "showPrevParameterHint",
"when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
},
// TERMINALS
{
"key": "alt+;",
"when": "!terminalFocus",
"command": "terminal.focus"
},
{
"key": "alt+;",
"when": "terminalFocus",
"command": "workbench.action.focusLastEditorGroup"
},
{
"key": "alt+shift+;",
"command": "workbench.action.terminal.rename"
},
{
"key": "alt+'",
"command": "workbench.action.terminal.runSelectedText"
},
{
"key": "alt+shift+'",
"command": "workbench.action.terminal.runActiveFile"
},
{
"key": "alt+shift+]",
"command": "workbench.action.terminal.focusNext",
},
{
"key": "alt+shift+[",
"command": "workbench.action.terminal.focusPrevious",
},
{
"key": "alt+]",
"command": "workbench.action.terminal.focusNextPane",
"when": "terminalFocus"
},
{
"key": "alt+[",
"command": "workbench.action.terminal.focusPreviousPane",
"when": "terminalFocus"
},
// VIM
{
"key": "cmd+d",
"command": "extension.vim_ctrl+d",
"when": "editorTextFocus && vim.active && vim.use<C-d> && !inDebugRepl"
},
{
"key": "cmd+u",
"command": "extension.vim_ctrl+u",
"when": "editorTextFocus && vim.active && vim.use<C-u> && !inDebugRepl"
},
]
{
"cSpell.enabled": true,
"cSpell.enabledLanguageIds": [
"markdown"
],
"cSpell.language": "en-US",
"editor.acceptSuggestionOnEnter": "off",
"editor.bracketPairColorization.enabled": true,
"editor.cursorBlinking": "solid",
"editor.cursorSmoothCaretAnimation": "on",
"editor.cursorSurroundingLines": 15,
"editor.fontFamily": "'Fira Code', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 14,
"editor.formatOnPaste": true,
"editor.inlineSuggest.enabled": true,
"editor.lineHeight": 20,
"editor.minimap.enabled": false,
"editor.occurrencesHighlight": false,
"editor.renderLineHighlight": "none",
"editor.renderWhitespace": "trailing",
"editor.semanticHighlighting.enabled": true,
"editor.smoothScrolling": true,
"editor.suggestSelection": "first",
"editor.tabCompletion": "on",
"editor.wordWrap": "on",
"explorer.autoReveal": false,
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"files.autoSave": "onFocusChange",
"files.defaultLanguage": "python",
"files.insertFinalNewline": true,
"files.simpleDialog.enable": true,
"files.trimTrailingWhitespace": true,
"git.autofetch": true,
"git.confirmSync": false,
"git.enableSmartCommit": true,
"git.openRepositoryInParentFolders": "never",
"github.gitProtocol": "ssh",
"http.proxySupport": "off",
"jupyter.askForKernelRestart": false,
"jupyter.debugJustMyCode": false,
"jupyter.interactiveWindow.creationMode": "perFile",
"jupyter.interactiveWindow.textEditor.executeSelection": true,
"jupyter.runStartupCommands": [
"%load_ext autoreload",
"%autoreload 2"
],
"output.smartScroll.enabled": false,
"security.workspace.trust.untrustedFiles": "open",
"task.problemMatchers.neverPrompt": true,
"terminal.integrated.localEchoEnabled": "off",
"terminal.integrated.localEchoLatencyThreshold": -1,
"terminal.integrated.shellIntegration.enabled": true,
"terminal.integrated.smoothScrolling": true,
"testing.automaticallyOpenPeekView": "never",
"testing.followRunningTest": false,
"testing.openTesting": "openOnTestFailure",
"vim.camelCaseMotion.enable": true,
"vim.changeWordIncludesWhitespace": true,
"vim.easymotion": true,
"vim.foldfix": true,
"vim.gdefault": true,
"vim.highlightedyank.enable": true,
"vim.hlsearch": true,
"vim.incsearch": true,
"vim.leader": "<space>",
"vim.replaceWithRegister": true,
"vim.smartRelativeLine": true,
"vim.sneak": true,
"vim.useCtrlKeys": false,
"vim.useSystemClipboard": true,
"vim.visualstar": true,
"vim.handleKeys": {
"<C-d>": true,
"<C-u>": true
},
"vim.insertModeKeyBindingsNonRecursive": [],
"vim.normalModeKeyBindingsNonRecursive": [
{ "before": [ "g", "l" ], "commands": [ ":nohl" ] },
{ "before": [ "j" ], "after": [ "g", "j" ], "when": "editorLangId == markdown" },
{ "before": [ "k" ], "after": [ "g", "k" ], "when": "editorLangId == markdown" },
],
"vim.visualModeKeyBindingsNonRecursive": [
{ "before": [ "g", "l" ], "commands": [ ":nohl" ] },
{ "before": [ "j" ], "after": [ "g", "j" ], "when": "editorLangId == markdown" },
{ "before": [ "k" ], "after": [ "g", "k" ], "when": "editorLangId == markdown" },
],
"window.commandCenter": true,
"workbench.editor.enablePreview": false,
"workbench.editor.focusRecentEditorAfterClose": false,
"workbench.editor.wrapTabs": true,
"workbench.list.smoothScrolling": true,
"zenMode.fullScreen": false,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment