Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/frontend/account/keyboard-shortcuts.ts
Views: 687
import { defineMessage } from "react-intl";12import { IntlMessage } from "@cocalc/frontend/i18n";34export default function keyboardShortcuts(5isMacOS: boolean,6): Readonly<{ command: IntlMessage; shortcut: string }[]> {7return [8//'Next file tab' : 'control+]' # temporarily disabled since broken in many ways9//'Previous file tab' : 'control+['10{11command: defineMessage({12id: "account.keyboard-shortcuts.shortcut.run-code",13defaultMessage: "Build project / run code",14}),15shortcut: isMacOS ? "shift+enter; option+T" : "shift+enter; alt+T",16},17{18command: defineMessage({19id: "account.keyboard-shortcuts.shortcut.force-build",20defaultMessage: "Force build project",21}),22shortcut: isMacOS23? "shift+option+enter; shift+option+T"24: "shift+alt+enter; shift+alt+T",25},26{27command: defineMessage({28id: "account.keyboard-shortcuts.shortcut.forward-inverse-search",29defaultMessage: "LaTeX and markdown forward and inverse search",30}),31shortcut: isMacOS ? "⌘+enter" : "alt+enter",32},33{34command: defineMessage({35id: "account.keyboard-shortcuts.shortcut.make-text-smaller",36defaultMessage: "Make text smaller",37}),38shortcut: "control+<",39},40{41command: defineMessage({42id: "account.keyboard-shortcuts.shortcut.make-text-larger",4344defaultMessage: "Make text larger",45}),46shortcut: "control+>",47},48{49command: defineMessage({50id: "account.keyboard-shortcuts.shortcut.toggle-comment",51defaultMessage: "Toggle commenting selection",52}),53shortcut: "control+/",54},55{56command: defineMessage({57id: "account.keyboard-shortcuts.shortcut.goto",58defaultMessage: "Go to line",59}),60shortcut: isMacOS ? "⌘+L" : "control+L",61},62{63command: defineMessage({64id: "account.keyboard-shortcuts.shortcut.find",65defaultMessage: "Find",66}),67shortcut: isMacOS ? "⌘+F" : "control+F",68},69{70command: defineMessage({71id: "account.keyboard-shortcuts.shortcut.find-next",72defaultMessage: "Find next",73}),74shortcut: isMacOS ? "⌘+G" : "control+G",75},76{77command: defineMessage({78id: "account.keyboard-shortcuts.shortcut.replace",79defaultMessage: "Replace",80}),81shortcut: isMacOS ? "⌘+H" : "control+H",82},83{84command: defineMessage({85id: "account.keyboard-shortcuts.shortcut.fold-unfold",86defaultMessage: "Fold/unfold selected code",87}),88shortcut: "control+Q",89},90{91command: defineMessage({92id: "account.keyboard-shortcuts.shortcut.fill-paragraph",93defaultMessage: "Fill paragraph (like in Emacs)",94}),95shortcut: isMacOS ? "option+Q" : "alt+Q",96},97{98command: defineMessage({99id: "account.keyboard-shortcuts.shortcut.shift-text-right",100defaultMessage: "Shift selected text right",101}),102shortcut: "tab",103},104{105command: defineMessage({106id: "account.keyboard-shortcuts.shortcut.shift-text-left",107defaultMessage: "Shift selected text left",108}),109shortcut: "shift+tab",110},111{112command: defineMessage({113id: "account.keyboard-shortcuts.shortcut.split-view-sagews",114defaultMessage: "Split view in Sage worksheet",115}),116shortcut: "shift+control+I",117},118{119command: defineMessage({120id: "account.keyboard-shortcuts.shortcut.autoindent",121defaultMessage: "Autoindent selection",122}),123shortcut: "control+'",124},125{126command: defineMessage({127id: "account.keyboard-shortcuts.shortcut.format-code",128defaultMessage: "Format code (use Prettier, etc)",129}),130shortcut: isMacOS ? "⌘+shift+F" : "control+shift+F",131},132{133command: defineMessage({134id: "account.keyboard-shortcuts.shortcut.multiple-cursors",135defaultMessage: "Create multiple cursors",136}),137shortcut: isMacOS ? "⌘+click" : "control+click",138},139{140command: defineMessage({141id: "account.keyboard-shortcuts.shortcut.latex-autocomplete",142defaultMessage: "LaTeX (etc) simple autocomplete",143}),144shortcut: isMacOS ? "option+space" : "control+space",145},146{147command: defineMessage({148id: "account.keyboard-shortcuts.shortcut.sage-autocomplete",149defaultMessage: "Sage autocomplete",150}),151shortcut: "tab",152},153{154command: defineMessage({155id: "account.keyboard-shortcuts.shortcut.split-cell",156defaultMessage: "Split cell in Sage worksheet",157}),158shortcut: "control+;",159},160] as const;161}162163164