2

I am used to using diw in vim to delete a word when the curser is in the middle of the word. How can I do the same in helix editor?

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441

3 Answers3

5

miwd

Helix has that highlight first approach, so basically all the motions are the same but relative to that/those selected token/s.

Mezdelex
  • 66
  • 1
  • 2
2

bed: select back to word start, select until word end, delete

Alt-up or Alt-o, d: expand selection (scope), then delete

(ebd works the same as bed)

CainKellye
  • 1,475
  • 1
  • 10
  • 10
1

open your helix editor (e.g ~/.config/helix/config.toml)

and add some config:

[key.normal]
"d"."i"."w" = [
"move_char_right", "move_prev_word_start", "move_next_word_end", "yank_main_selection_to_clipboard", "delete_selection_noyank", ]

and save/apply:
:w
:config-reload

my helix key setting:
https://github.com/TinyProbe/config_tinyprobe/blob/master/config.toml