experiment: Move keep_primary_selection to ,

imgbot
Blaž Hrastnik 3 years ago
parent a958d34bfb
commit 9ea9e779b2

@ -86,6 +86,7 @@
| `Alt-s` | Split selection on newlines | `split_selection_on_newline` | | `Alt-s` | Split selection on newlines | `split_selection_on_newline` |
| `;` | Collapse selection onto a single cursor | `collapse_selection` | | `;` | Collapse selection onto a single cursor | `collapse_selection` |
| `Alt-;` | Flip selection cursor and anchor | `flip_selections` | | `Alt-;` | Flip selection cursor and anchor | `flip_selections` |
| `,` | Keep only the primary selection | `keep_primary_selection` |
| `C` | Copy selection onto the next line | `copy_selection_on_next_line` | | `C` | Copy selection onto the next line | `copy_selection_on_next_line` |
| `Alt-C` | Copy selection onto the previous line | `copy_selection_on_prev_line` | | `Alt-C` | Copy selection onto the previous line | `copy_selection_on_prev_line` |
| `(` | Rotate main selection forward | `rotate_selections_backward` | | `(` | Rotate main selection forward | `rotate_selections_backward` |
@ -99,7 +100,6 @@
| `J` | Join lines inside selection | `join_selections` | | `J` | Join lines inside selection | `join_selections` |
| `K` | Keep selections matching the regex TODO: overlapped by hover help | `keep_selections` | | `K` | Keep selections matching the regex TODO: overlapped by hover help | `keep_selections` |
| `$` | Pipe each selection into shell command, keep selections where command returned 0 | `shell_keep_pipe` | | `$` | Pipe each selection into shell command, keep selections where command returned 0 | `shell_keep_pipe` |
| `Space` | Keep only the primary selection TODO: overlapped by space mode | `keep_primary_selection` |
| `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` | | `Ctrl-c` | Comment/uncomment the selections | `toggle_comments` |
### Search ### Search
@ -200,7 +200,6 @@ This layer is a kludge of mappings, mostly pickers.
| `a` | Apply code action | `code_action` | | `a` | Apply code action | `code_action` |
| `'` | Open last fuzzy picker | `last_picker` | | `'` | Open last fuzzy picker | `last_picker` |
| `w` | Enter [window mode](#window-mode) | N/A | | `w` | Enter [window mode](#window-mode) | N/A |
| `space` | Keep primary selection TODO: it's here because space mode replaced it | `keep_primary_selection` |
| `p` | Paste system clipboard after selections | `paste_clipboard_after` | | `p` | Paste system clipboard after selections | `paste_clipboard_after` |
| `P` | Paste system clipboard before selections | `paste_clipboard_before` | | `P` | Paste system clipboard before selections | `paste_clipboard_before` |
| `y` | Join and yank selections to clipboard | `yank_joined_to_clipboard` | | `y` | Join and yank selections to clipboard | `yank_joined_to_clipboard` |

@ -2825,6 +2825,10 @@ fn open_above(cx: &mut Context) {
fn normal_mode(cx: &mut Context) { fn normal_mode(cx: &mut Context) {
let (view, doc) = current!(cx.editor); let (view, doc) = current!(cx.editor);
if doc.mode == Mode::Normal {
return;
}
doc.mode = Mode::Normal; doc.mode = Mode::Normal;
doc.append_changes_to_history(view.id); doc.append_changes_to_history(view.id);

@ -436,7 +436,6 @@ impl Default for Keymaps {
"A" => append_to_line, "A" => append_to_line,
"o" => open_below, "o" => open_below,
"O" => open_above, "O" => open_above,
// [<space> ]<space> equivalents too (add blank new line, no edit)
"d" => delete_selection, "d" => delete_selection,
// TODO: also delete without yanking // TODO: also delete without yanking
@ -500,8 +499,7 @@ impl Default for Keymaps {
"K" => keep_selections, "K" => keep_selections,
// TODO: and another method for inverse // TODO: and another method for inverse
// TODO: clashes with space mode "," => keep_primary_selection,
"space" => keep_primary_selection,
// "q" => record_macro, // "q" => record_macro,
// "Q" => replay_macro, // "Q" => replay_macro,
@ -554,7 +552,6 @@ impl Default for Keymaps {
"p" => paste_clipboard_after, "p" => paste_clipboard_after,
"P" => paste_clipboard_before, "P" => paste_clipboard_before,
"R" => replace_selections_with_clipboard, "R" => replace_selections_with_clipboard,
"space" => keep_primary_selection,
"/" => global_search, "/" => global_search,
}, },
"z" => { "View" "z" => { "View"

Loading…
Cancel
Save