Skip to content

Commit dbc878f

Browse files
authored
Use system dependent key bindings (marktext#2849)
1 parent 9cb2cbe commit dbc878f

File tree

21 files changed

+916
-262
lines changed

21 files changed

+916
-262
lines changed

docs/KEYBINDINGS.md

Lines changed: 6 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ Here is an example:
1313

1414
## Available modifiers
1515

16-
- `CmdOrCtrl`
1716
- `Cmd` on macOS
17+
- `Option` on macOS
1818
- `Ctrl`
19-
- `Alt`/`AltGr` or `Option` on macOS
2019
- `Shift`
20+
- `Alt` and `AltGr` on Linux and Windows
2121
- `Super` on Linux and Windows
2222

2323
## Available keys
@@ -28,133 +28,8 @@ Here is an example:
2828
- `PageUp` and `PageDown`
2929
- Empty string `""` to unset a accelerator
3030

31-
## Available id's
31+
## Available key bindings
3232

33-
**MarkText menu (macOS only):**
34-
35-
| Id | Default | Description |
36-
| ------------------ | ---------------------------------------------- | --------------------------------------- |
37-
| `mt.hide` | <kbd>Command</kbd>+<kbd>H</kbd> | Hide MarkText |
38-
| `mt.hide-others` | <kbd>Command</kbd>+<kbd>Alt</kbd>+<kbd>H</kbd> | Hide all other windows except MarkText |
39-
| `file.preferences` | <kbd>Command</kbd>+<kbd>,</kbd> | Open settings window |
40-
| `file.quit` | <kbd>Command</kbd>+<kbd>Q</kbd> | Quit MarkText |
41-
42-
**File menu:**
43-
44-
| Id | Default | Description |
45-
|:------------------- | -------------------------------------------------- | ----------------------------------------- |
46-
| `file.new-file` | <kbd>CmdOrCtrl</kbd>+<kbd>N</kbd> | New file |
47-
| `file.new-tab` | <kbd>CmdOrCtrl</kbd>+<kbd>T</kbd> | New tab |
48-
| `file.open-file` | <kbd>CmdOrCtrl</kbd>+<kbd>O</kbd> | Open markdown file |
49-
| `file.open-folder` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>O</kbd> | Open folder |
50-
| `file.save` | <kbd>CmdOrCtrl</kbd>+<kbd>S</kbd> | Save |
51-
| `file.save-as` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>S</kbd> | Save as... |
52-
| `file.print` | - | Print current tab |
53-
| `file.preferences` | <kbd>Ctrl</kbd>+<kbd>,</kbd> | Open settings window (Linux/Windows only) |
54-
| `file.close-tab` | <kbd>CmdOrCtrl</kbd>+<kbd>W</kbd> | Close tab |
55-
| `file.close-window` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>W</kbd> | Close window |
56-
| `file.quit` | <kbd>CmdOrCtrl</kbd>+<kbd>Q</kbd> | Quit MarkText (Linux/Windows only) |
57-
58-
**Edit menu:**
59-
60-
| Id | Default | Description |
61-
|:------------------------ | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
62-
| `edit.undo` | <kbd>CmdOrCtrl</kbd>+<kbd>Z</kbd> | Undo last operation |
63-
| `edit.redo` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>Z</kbd> | Redo last operation |
64-
| `edit.cut` | <kbd>CmdOrCtrl</kbd>+<kbd>X</kbd> | Cut selected text |
65-
| `edit.copy` | <kbd>CmdOrCtrl</kbd>+<kbd>C</kbd> | Copy selected text |
66-
| `edit.paste` | <kbd>CmdOrCtrl</kbd>+<kbd>V</kbd> | Paste text |
67-
| `edit.copy-as-markdown` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>C</kbd> | Copy selected text as markdown |
68-
| `edit.copy-as-plaintext` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>V</kbd> | Copy selected text as plaintext |
69-
| `edit.select-all` | <kbd>CmdOrCtrl</kbd>+<kbd>A</kbd> | Select all text of the document |
70-
| `edit.duplicate` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>P</kbd> | Duplicate the current paragraph |
71-
| `edit.create-paragraph` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>N</kbd> | Create a new paragraph after the current one |
72-
| `edit.delete-paragraph` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd> | Delete current paragraph |
73-
| `edit.find` | <kbd>CmdOrCtrl</kbd>+<kbd>F</kbd> | Find information in the document |
74-
| `edit.find-next` | <kbd>F3</kbd> | Continue the search and find the next match (or <kbd>Cmd</kbd>+<kbd>G</kbd> on macOS) |
75-
| `edit.find-previous` | <kbd>Shift</kbd>+<kbd>F3</kbd> | Continue the search and find the previous match (or <kbd>Shift</kbd>+<kbd>Cmd</kbd>+<kbd>G</kbd> on macOS) |
76-
| `edit.replace` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>F</kbd> | Replace the information with a replacement |
77-
| `edit.find-in-folder` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>F</kbd> | Find files contain the keyword in opend folder |
78-
| `edit.aidou` | <kbd>CmdOrCtrl</kbd>+<kbd>/</kbd> | Show Aidou dialog |
79-
| `edit.screenshot` | <kbd>Command</kbd>+<kbd>Alt</kbd>+<kbd>A</kbd> | Get the screenshot (macOS only) |
80-
81-
**Paragraph menu:**
82-
83-
| Id | Default | Description |
84-
| --------------------------- | -------------------------------------------------- | ------------------------------------------------- |
85-
| `paragraph.heading-1` | <kbd>CmdOrCtrl</kbd>+<kbd>1</kbd> | Set line as heading 1 |
86-
| `paragraph.heading-2` | <kbd>CmdOrCtrl</kbd>+<kbd>2</kbd> | Set line as heading 2 |
87-
| `paragraph.heading-3` | <kbd>CmdOrCtrl</kbd>+<kbd>3</kbd> | Set line as heading 3 |
88-
| `paragraph.heading-4` | <kbd>CmdOrCtrl</kbd>+<kbd>4</kbd> | Set line as heading 4 |
89-
| `paragraph.heading-5` | <kbd>CmdOrCtrl</kbd>+<kbd>5</kbd> | Set line as heading 5 |
90-
| `paragraph.heading-6` | <kbd>CmdOrCtrl</kbd>+<kbd>6</kbd> | Set line as heading 6 |
91-
| `paragraph.upgrade-heading` | <kbd>CmdOrCtrl</kbd>+<kbd>=</kbd> | Upgrade a heading |
92-
| `paragraph.degrade-heading` | <kbd>CmdOrCtrl</kbd>+<kbd>-</kbd> | Degrade a heading |
93-
| `paragraph.table` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>T</kbd> | Insert a table |
94-
| `paragraph.code-fence` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>C</kbd> | Insert a code block |
95-
| `paragraph.quote-block` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>Q</kbd> | Insert a quote block |
96-
| `paragraph.math-formula` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>M</kbd> | Insert a math block |
97-
| `paragraph.html-block` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>J/H</kbd> | Insert a HTML block (`J` on macOS, `H` otherwise) |
98-
| `paragraph.order-list` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>O</kbd> | Insert a ordered list |
99-
| `paragraph.bullet-list` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>U</kbd> | Insert a unordered list |
100-
| `paragraph.task-list` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>X</kbd> | Insert a task list |
101-
| `paragraph.loose-list-item` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>L</kbd> | Convert a list item to a loose list item |
102-
| `paragraph.paragraph` | <kbd>CmdOrCtrl</kbd>+<kbd>0</kbd> | Convert a heading to a paragraph |
103-
| `paragraph.horizontal-line` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>-</kbd> | Add a horizontal line |
104-
| `paragraph.front-matter` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>Y</kbd> | Insert a YAML frontmatter block |
105-
106-
**Format menu:**
107-
108-
| Id | Default | Description |
109-
| --------------------- | -------------------------------------------------- | ------------------------------------------- |
110-
| `format.strong` | <kbd>CmdOrCtrl</kbd>+<kbd>B</kbd> | Set the font of the selected text to bold |
111-
| `format.emphasis` | <kbd>CmdOrCtrl</kbd>+<kbd>I</kbd> | Set the font of the selected text to italic |
112-
| `format.underline` | <kbd>CmdOrCtrl</kbd>+<kbd>U</kbd> | Change the selected text to underline |
113-
| `format.highlight` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>H</kbd> | Highlight the selected text by <mark> tag |
114-
| `format.inline-code` | <kbd>CmdOrCtrl</kbd>+<kbd>`</kbd> | Change the selected text to inline code |
115-
| `format.inline-math` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>M</kbd> | Change the selected text to inline math |
116-
| `format.strike` | <kbd>CmdOrCtrl</kbd>+<kbd>D</kbd> | Strike through the selected text |
117-
| `format.hyperlink` | <kbd>CmdOrCtrl</kbd>+<kbd>L</kbd> | Insert a hyperlink |
118-
| `format.image` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>I</kbd> | Insert a image |
119-
| `format.clear-format` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>R</kbd> | Clear the formatting of the selected text |
120-
121-
**Window menu:**
122-
123-
| Id | Default | Description |
124-
| --------------------------- | --------------------------------- | ------------------------------------------------------------------------------------ |
125-
| `window.minimize` | <kbd>CmdOrCtrl</kbd>+<kbd>M</kbd> | Minimize the window |
126-
| `window.toggle-full-screen` | <kbd>F11</kbd> | Toggle fullscreen mode (or <kbd>Ctrl</kbd>+<kbd>Command</kbd>+<kbd>F</kbd> on macOS) |
127-
128-
**View menu:**
129-
130-
| Id | Default | Description |
131-
| ----------------------- | -------------------------------------------------- | ---------------------------------------- |
132-
| `view.command-palette` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> | Toggle command palette |
133-
| `view.source-code-mode` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>S</kbd> | Switch to source code mode |
134-
| `view.typewriter-mode` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>T</kbd> | Enable typewriter mode |
135-
| `view.focus-mode` | <kbd>CmdOrCtrl</kbd>+<kbd>Shift</kbd>+<kbd>J</kbd> | Enable focus mode |
136-
| `view.toggle-sidebar` | <kbd>CmdOrCtrl</kbd>+<kbd>J</kbd> | Toggle sidebar |
137-
| `view.toggle-tabbar` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>B</kbd> | Toggle tabbar |
138-
| `view.toggle-toc` . | <kbd>CmdOrCtrl</kbd>+<kbd>K</kbd> | Toggle table of contents |
139-
| `view.toggle-dev-tools` | <kbd>CmdOrCtrl</kbd>+<kbd>Alt</kbd>+<kbd>I</kbd> | Toggle developer tools (debug mode only) |
140-
| `view.dev-reload` | <kbd>CmdOrCtrl</kbd>+<kbd>R</kbd> | Reload window (debug mode only) |
141-
142-
**Misc**
143-
144-
| Id | Default | Description |
145-
| ------------------------ | ---------------------------------------------------- | ---------------------------- |
146-
| `tabs.cycle-forward` | <kbd>Ctrl</kbd>+<kbd>Tab</kbd> | Cycle through tabs |
147-
| `tabs.cycle-backward` | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Tab</kbd> | Cycle backwards through tabs |
148-
| `tabs.switch-to-left` | <kbd>CmdOrCtrl</kbd>+<kbd>PageUp</kbd> | Switch tab to the left |
149-
| `tabs.switch-to-right` | <kbd>CmdOrCtrl</kbd>+<kbd>PageDown</kbd> | Switch tab to the right |
150-
| `tabs.switch-to-first` | <kbd>Alt</kbd>+<kbd>1</kbd> | Switch tab to the 1st |
151-
| `tabs.switch-to-second` | <kbd>Alt</kbd>+<kbd>2</kbd> | Switch tab to the 2nd |
152-
| `tabs.switch-to-third` | <kbd>Alt</kbd>+<kbd>3</kbd> | Switch tab to the 3rd |
153-
| `tabs.switch-to-fourth` | <kbd>Alt</kbd>+<kbd>4</kbd> | Switch tab to the 4th |
154-
| `tabs.switch-to-fifth` | <kbd>Alt</kbd>+<kbd>5</kbd> | Switch tab to the 5th |
155-
| `tabs.switch-to-sixth` | <kbd>Alt</kbd>+<kbd>6</kbd> | Switch tab to the 6th |
156-
| `tabs.switch-to-seventh` | <kbd>Alt</kbd>+<kbd>7</kbd> | Switch tab to the 7th |
157-
| `tabs.switch-to-eighth` | <kbd>Alt</kbd>+<kbd>8</kbd> | Switch tab to the 8th |
158-
| `tabs.switch-to-ninth` | <kbd>Alt</kbd>+<kbd>9</kbd> | Switch tab to the 9th |
159-
| `tabs.switch-to-tenth` | <kbd>Alt</kbd>+<kbd>0</kbd> | Switch tab to the 10th |
160-
| `file.quick-open` | <kbd>CmdOrCtrl</kbd>+<kbd>P</kbd> | Open quick open dialog |
33+
- [Key bindings for macOS](KEYBINDINGS_OSX.md)
34+
- [Key bindings for Linux](KEYBINDINGS_LINUX.md)
35+
- [Key bindings for Windows](KEYBINDINGS_WINDOWS.md)

0 commit comments

Comments
 (0)