Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

there are plenty of things missing from Helix, but it does support multiple carets via `copy_selection_on_next_line`


Unfortunately, not on INS mode. I can't be editing one line, then quickly create 5 new carets on the lines below, jump to the end of the line and add something, like you can with Sublime.


As an aside, this is a modal editor, so you're supposed to quickly switch modes

But you can also do it in the INS mode but sandwitching the commands in mode shifts, for example, these should work in the INS mode part of your config

  [keys.insert]
  'C-j'   = ['normal_mode','copy_selection_on_next_line','insert_mode'] # Copy selection onto the next     line (add cursor ↓)

  'C-k'   = ['normal_mode','copy_selection_on_prev_line','insert_mode'] # Copy selection onto the previous line (add cursor ↑)


Ah, interesting. That does work, thank you. How would you implement the (Ctrl|CMD) + D feature from Sublime?


I'd wait until the open issue to select words and another one to allow more command composability are closed with PRs :)

Meanwhile you could use something like this (if you already have the word selected as you might likely have since Helix selects by default, then delete the first two command that expand your selection to a word like in Sublime)

    '*'   = ['select_mode'       #
      ,   'move_prev_word_start' #
      ,   'move_next_word_end'   #
      ,   'search_selection'     #
      ,   'extend_search_next'   #
      ,   'exit_select_mode'     #
      ]                          # = find_under_expand


Thank you, this is enlightening.


A better alternative more closely matching Sublime by limiting search to word boundaries

    '*'        = ['select_mode'            # = find_under_expand
      ,         'move_next_word_end'       # 1st since word_start command might select previous word
      ,         'move_prev_word_start'     #
      ,         'search_selection'         #
      ,         'make_search_word_bounded' #
      ,         'extend_search_next'       #
      ,         'insert_mode'              #
      ]        #


Hah! You're on a roll, thanks. Using this daily and trying to get used to Helix. :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: