Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign M-s o to the Quick Search command, which is like Emacs' occur #1912

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,17 @@ Alt key is mapped to the Meta prefix (`M`) by default and you can configure for

### Search Commands

| Command | Desc |
| ------------------------------------ | ------------------------------------------------------------------ |
| `C-s` | Incremental search forward (isearch-forward). |
| `C-r` | Incremental search backward (isearch-backward). |
| `C-M-s` | Begin incremental regexp search (isearch-forward-regexp). |
| `C-M-r` | Begin reverse incremental regexp search (isearch-backward-regexp). |
| `M-S-5` (`M-%` with US keyboard) | Replace (query-replace) |
| `C-M-S-5` (`C-M-%` with US keyboard) | Replace with regexp (query-replace-regexp) |
| `C-M-n` | Add selection to next find match |
| `C-M-p` | Add selection to previous find match |
| Command | Desc |
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------- |
| `C-s` | Incremental search forward (isearch-forward). |
| `C-r` | Incremental search backward (isearch-backward). |
| `C-M-s` | Begin incremental regexp search (isearch-forward-regexp). |
| `C-M-r` | Begin reverse incremental regexp search (isearch-backward-regexp). |
| `M-S-5` (`M-%` with US keyboard) | Replace (query-replace) |
| `C-M-S-5` (`C-M-%` with US keyboard) | Replace with regexp (query-replace-regexp) |
| `C-M-n` | Add selection to next find match |
| `C-M-p` | Add selection to previous find match |
| `M-s o` | Open [Quick Search](https://code.visualstudio.com/updates/v1_89#_quick-search), which is like Emacs' `occur` command. |

### Edit commands

Expand Down
6 changes: 6 additions & 0 deletions keybindings.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@
],
"command": ""
},
// VSCode's quick search is like Emacs' Occur mode. Quick search is available since VSCode 1.89 (https://code.visualstudio.com/updates/v1_89#_quick-search).
{
"key": "meta+s o",
"command": "workbench.action.quickTextSearch",
"when": "editorFocus"
},
// addSelectionToNext/PreviousFindMatch
{
"key": "ctrl+meta+n",
Expand Down
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"url": "https://github.com/whitphx/vscode-emacs-mcx"
},
"engines": {
"vscode": "^1.63.0"
"vscode": "^1.89.0"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: workbench.action.quickTextSearch was introduced in 1.89: https://code.visualstudio.com/updates/v1_89#_quick-search

},
"categories": [
"Other",
Expand Down Expand Up @@ -3059,6 +3059,17 @@
"command": "",
"when": "isWindows && replaceInputFocussed && !isComposing"
},
{
"key": "alt+s o",
"command": "workbench.action.quickTextSearch",
"when": "editorFocus && !config.emacs-mcx.useMetaPrefixMacCmd"
},
{
"key": "alt+s o",
"mac": "cmd+s o",
"command": "workbench.action.quickTextSearch",
"when": "editorFocus && config.emacs-mcx.useMetaPrefixMacCmd"
},
{
"key": "ctrl+alt+n",
"command": "emacs-mcx.addSelectionToNextFindMatch",
Expand Down