Add notification/alert as part of the keymap. #6480
-
I'm new to Helix and I really enjoy working with it so far. I prefer its keymappings over Vim's but unfortunately, muscle memory kicks in, and sometimes it's hard to remember how to achieve something in Helix. For this reason, I remapped the # The default way of going to the end of the line with Helix is: gl
"$" = "goto_line_end" This is convenient because when I forget the "idiomatic Helix" binding, I can quickly achieve what I want, but I'd like to slowly train myself to switch to the Helix approach. What I'd love to do with my new, advanced mapping is:
In pseudo code: "$" = ["goto_line_end", "display-toast-message: next time use gl to go to the end of the line", "bell-sound"] If you have trouble understanding what I want: I'd like to write myself a "Helix Key Promoter" helper (similarly to IntelliJ's Key Promoter) that helps me learn the Helix way of doing things. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think I got something that's reasonably good: 0 = ["goto_line_start", ":run-shell-command echo 'helix-hint(gh): use gh to go to the start of the line'"] I'll keep refining this to make it more "announcement-like" and easier to read. It's a bit inconvenient that I need to hit |
Beta Was this translation helpful? Give feedback.
-
You can use the ASCII box drawing characters to build the outline, as well as emojis. I wrote a simple Dart program (similar possible with shell, if you don't have Dart installed) that takes the first word as command, and the rest as explanation and displays it in a box within Helix: void main(List<String> args) {
final cm = args[0];
final rest = args.sublist(1).join(' ');
print('┌────┬─' + '─' * cm.length + '─┬─' + '─' * rest.length + '─┐');
print('│ 🧬 │ $cm │ $rest │');
print('└────┴─' + '─' * cm.length + '─┴─' + '─' * rest.length + '─┘');
} With the following config: # The default way of going to the start of the line with Helix is: gh
0 = ["goto_line_start", ":sh dart ~/helix_trainer.dart gh go to line start"]
# The default way of going to the end of the line with Helix is: gl
"$" = ["goto_line_end", ":sh dart ~/helix_trainer.dart gl go to line end"]
# The default way of going to the first non-blank char in line with Helix is: gs
"^" = ["goto_first_nonwhitespace", ":sh dart ~/helix_trainer.dart gs go to first non-blank in line"] This is how it looks like: Screen.Recording.2023-03-29.at.21.10.34.mov |
Beta Was this translation helpful? Give feedback.
You can use the ASCII box drawing characters to build the outline, as well as emojis.
I wrote a simple Dart program (similar possible with shell, if you don't have Dart installed) that takes the first word as command, and the rest as explanation and displays it in a box within Helix:
With the following config: