nushell / reedline

A feature-rich line editor - powering Nushell
https://docs.rs/reedline/
MIT License
549 stars 154 forks source link

how to write config.nu to make a new keybinding to go from vi_normal to vi_insert #815

Open scubacabra opened 3 months ago

scubacabra commented 3 months ago

Question

i use colmak-dh for my keyboard layout

i bound the keys on my home row m | n | e | i to left | down | up | right

everything works great but i lost how to go into vi_insert from vi_normal (it is i by default)?

i am on a mac, so i had karabiner remap Ctrl + Space to send an Insert keypress, hoping that would work. I can see that Insert is sent from keybindings listen but it does not switch to vi_insert -- it stays on vi_normal

from perusing some issues it seems that this is hardcoded in reedline, correct?

is this something i will have to ask over there to see if they can fix it upstream or is there another way to configure it in the config.nu file?

Additional context and details

nushell version: 0.96.1

fdncred commented 3 months ago

I think it's hard coded

https://github.com/nushell/reedline/blob/e064b645193ef7438927af991483ab6fae7b6235/src/edit_mode/vi/command.rs#L22-L26

scubacabra commented 3 months ago

thanks for pointing me to the file, i will ask them about adding the Insert key to trigger the switch to vi_insert

fdncred commented 3 months ago

I can just move it to the reedline repo.