[
  // Navigation
  {
    "key": "ctrl-h",
    "command": "workbench.action.navigateLeft"
  },
  {
    "key": "ctrl-l",
    "command": "workbench.action.navigateRight"
  },
  {
    "key": "ctrl-k",
    "command": "workbench.action.navigateUp"
  },
  {
    "key": "ctrl-j",
    "command": "workbench.action.navigateDown"
  },
  {
    "key": "space ,",
    "command": "workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup",
    "when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus) && !terminalFocus && !inQuickOpen"
  },
  {
    "key": "space e",
    "command": "runCommands",
    "args": {
      "commands": [
        "workbench.action.toggleSidebarVisibility",
        "workbench.files.action.focusFilesExplorer"
      ]
    },
    "when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus) && !sideBarFocus && !terminalFocus && !inQuickOpen"
  },
  {
    "key": "space e",
    "command": "runCommands",
    "args": {
      "commands": [
        "workbench.action.toggleSidebarVisibility",
        "workbench.action.focusActiveEditorGroup"
      ]
    },
    "when": "vim.mode=='Normal'&&sideBarFocus && !inputFocus && !terminalFocus && !inQuickOpen"
  },
  {
    "key": "space e",
    "command": "workbench.action.toggleSidebarVisibility",
    "when": "vim.mode == 'Normal' && editorTextFocus && foldersViewVisible && !terminalFocus && !inQuickOpen",
  },
  {
    "key": "space w",
    "command": "workbench.action.files.save",
    "when": "vim.mode == 'Normal' && !editorTextFocus && !terminalFocus && !inQuickOpen"
  },
  {
    "key": "tab",
    "command": "workbench.action.nextEditorInGroup",
    "when": "(vim.mode == 'Normal' || vim.mode == 'Visual') && editorTextFocus"
  },
  {
    "key": "shift-tab",
    "command": "workbench.action.previousEditorInGroup",
    "when": "(vim.mode == 'Normal' || vim.mode == 'Visual') && (editorTextFocus"
  },
  {
    "key": "shift-j",
    "command": "editor.action.moveLinesDownAction",
    "when": "vim.mode != 'Insert' && editorTextFocus"
  },
  {
    "key": "shift-k",
    "command": "editor.action.moveLinesUpAction",
    "when": "vim.mode != 'Insert' && editorTextFocus"
  },
  {
    "key": "shift-k",
    "command": "editor.action.showHover",
    "when": "vim.mode == 'Normal' && editorTextFocus"
  },
  {
    "key": "space c a",
    "command": "editor.action.codeAction",
    "when": "vim.mode == 'Normal' && editorTextFocus && !terminalFocus && !inQuickOpen"
  },
  {
    "key": "space c r",
    "command": "editor.action.rename",
    "when": "vim.mode == 'Normal' && editorTextFocus && !terminalFocus && !inQuickOpen"
  },
  {
    "key": "space c s",
    "command": "workbench.action.gotoSymbol",
    "when": "vim.mode == 'Normal' && editorTextFocus && !terminalFocus && !inQuickOpen"
  },
  {
    "key": "space b d",
    "command": "workbench.action.closeActiveEditor",
    "when": "vim.mode == 'Normal' && editorTextFocus && !terminalFocus && !inQuickOpen"
  },
  {
    "key": "space g d",
    "command": "editor.action.revealDefinition",
    "when": "vim.mode == 'Normal' && editorTextFocus && !terminalFocus && !inQuickOpen"
  },
  {
    "key": "space g r",
    "command": "editor.action.goToReferences",
    "when": "vim.mode == 'Normal' && editorTextFocus && !terminalFocus && !inQuickOpen"
  },
  {
    "key": "space g i",
    "command": "editor.action.goToImplementation",
    "when": "vim.mode == 'Normal' && editorTextFocus && !terminalFocus && !inQuickOpen"
  },
  {
    "key": "space /",
    "command": "workbench.action.findInFiles",
    "when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus) && !terminalFocus && !inQuickOpen"
  },
  {
    "key": "space f f",
    "command": "workbench.action.quickOpen",
    "when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus) && !terminalFocus && !inQuickOpen"
  },
  {
    "key": "space g g",
    "command": "runCommands",
    "args": {
      "commands": ["workbench.view.scm", "workbench.scm.focus"]
    },
    "when": "vim.mode == 'Normal' && (editorTextFocus || !inputFocus) && !terminalFocus && !inQuickOpen",
  },
  {
    "key": "ctrl-n",
    "command": "editor.action.addSelectionToNextFindMatch",
    "when": "(vim.mode == 'Normal' || vim.mode == 'Visual') && (editorTextFocus || !inputFocus)"
  },

  // File Explorer
  {
    "key": "r",
    "command": "renameFile",
    "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
  },
  {
    "key": "y y",
    "command": "filesExplorer.copy",
    "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
  },
  {
    "key": "p",
    "command": "filesExplorer.paste",
    "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
  },
  {
    "key": "x",
    "command": "filesExplorer.cut",
    "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
  },
  {
    "key": "d d",
    "command": "deleteFile",
    "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
  },
  {
    "key": "a",
    "command": "explorer.newFile",
    "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
  },
  {
    "key": "shift-a",
    "command": "explorer.newFolder",
    "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
  },
  {
    "key": "s",
    "command": "explorer.openToSide",
    "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
  },
  {
    "key": "shift-s",
    "command": "runCommands",
    "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus",
    "args": {
      "commands": [
        "workbench.action.splitEditorDown",
        "explorer.openAndPassFocus",
        "workbench.action.closeOtherEditors"
      ]
    }
  },
  {
    "key": "enter",
    "command": "explorer.openAndPassFocus",
    "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceIsFolder && !inputFocus"
  },
  {
    "key": "enter",
    "command": "list.toggleExpand",
    "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && explorerResourceIsFolder && !inputFocus"
  } 
]