on master help sign in
commands: % as select_all.
commit30d1b7098f023ea1cf728e6b989599de364f58ab authorBlaž Hrastnik <blaz@mxxn.io> dateTue 9 Feb 2021, 15:39 (6 years ago) parentf2c2fa0
2 files changed+11−1
helix-term/src/commands.rs+9 helix-term/src/keymap.rs+2−1
helix-term/src/commands.rs+9
@@ -284,6 +284,15 @@ pub fn extend_line_down(cx: &mut Context) {
284284 doc.set_selection(selection);
285285}
286286
287+pub fn select_all(cx: &mut Context) {
288+ let doc = cx.doc();
289+
290+ doc.set_selection(Selection::single(
291+ 0,
292+ doc.text().len_chars().saturating_sub(1),
293+ ))
294+}
295+
287296pub fn select_regex(cx: &mut Context) {
288297 let prompt = ui::regex_prompt(cx, "select:".to_string(), |doc, regex| {
289298 let text = &doc.text().slice(..);
helix-term/src/keymap.rs+2−1
@@ -164,7 +164,8 @@ pub fn default() -> Keymaps {
164164 vec![shift!('S')] => commands::split_selection,
165165 vec![key!(';')] => commands::collapse_selection,
166166 // TODO should be alt(;)
167− vec![key!('%')] => commands::flip_selections,
167+ vec![alt!(';')] => commands::flip_selections,
168+ vec![key!('%')] => commands::select_all,
168169 vec![key!('x')] => commands::select_line,
169170 vec![key!('u')] => commands::undo,
170171 vec![shift!('U')] => commands::redo,