Repository navigation
Vi Normal movement key rebind break the visual/select mode. #1007
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Platform and Terminal
fastfetch
-` ***@***
.o+` ------------------------
`ooo/ OS: Arch Linux x86_64
`+oooo: Kernel: Linux 6.18.5-arch1-1
`+oooooo: Uptime: 5 hours
-+oooooo+: Packages: 1591 (pacman), 5 (flatpak-system), 10 (flatpak-user)
`/:-:++oooo+: Shell: nushell 0.109.1
`/++++/+++++++: Display (LC49G95T): 5120x1440 in 49", 240 Hz [External]
`/++++++++++++++: DE: COSMIC 1.0.0
`/+++ooooooooooooo/` WM: cosmic-comp (Wayland)
./ooosssso++osssssso+` Cursor: Adwaita
.oossssso-````/ossssss+` Terminal: cosmic-term 0.1.0
-osssssso. :ssssssso. Terminal Font: Noto Sans Mono (14px)
:osssssss/ osssso+++. CPU: AMD Ryzen 5 7600X (12) @ 5.46 GHz
/ossssssss/ +ssssooo/- GPU 1: AMD Radeon RX 7900 XTX [Discrete]
`/ossssso+/:- -:/+osssso+- GPU 2: AMD Raphael [Integrated]
`+sso+:-` `.-/+oso: Memory: 12.96 GiB / 30.50 GiB (42%)
`++:. `-/+/ Swap: 20.00 KiB / 15.25 GiB (0%)
.` `/ Disk (/): 57.02 GiB / 97.87 GiB (58%) - ext4
Disk (/home): 478.00 GiB / 1.69 TiB (28%) - ext4
Disk (/run/media/***/***): 43.93 MiB / 14.70 GiB (0%) - vfat [External]
Local IP (eno1): ***.***.***.***/24
Locale: en_US.UTF-8
When rebinding the vi-normal mode movement keys (hjkl) to (ijkl), the "visual mode" does not work anymore.
Indeed pressing v and then moving left and right does not select anymore.
Steps to reproduce
In your config.nu, use these keybindings.
Keybindings
$env.config.keybindings ++= [{
name: Vi_Insert
modifier: none
keycode: char_h
mode: vi_normal
event: {
send: vichangemode
mode: insert
}
}]
$env.config.keybindings ++= [{
name: Vi_Insert_Line_Start
modifier: shift
keycode: char_h
mode: vi_normal
event: [{
edit: movetolinestart
}
{
send: vichangemode
mode: insert
}]
}]
$env.config.keybindings ++= [{
name: moveUp
modifier: none
keycode: char_i
mode: vi_normal
event: {
send: up
}
}]
$env.config.keybindings ++= [{
name: moveDown
modifier: none
keycode: char_k
mode: vi_normal
event: {
send: down
}
}]
$env.config.keybindings ++= [{
name: moveLeft
modifier: none
keycode: char_j
mode: vi_normal
event: {
edit: moveleft
}
}]
$env.config.keybindings ++= [{
name: moveRight
modifier: none
keycode: char_l
mode: vi_normal
event: {
edit: moveright
}
}]
I went through the docs and did not find anything about v or the visual mode.
By the way, the ViChangeMode mode: insert was also something I had to guess. I also did not find it in the docs.
Am I missing something?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
fdncred commentedon Jan 14, 2026
Sounds like a bug
Juhan280 commentedon Apr 15, 2026
The way it is implemented right now (as far as I understand),
moveleftwill never selecet andmoveleft truewill always select. Kinda like emacs where shift+left will select and just left will not.The way reedline currently handle vi mode, it converts vi commands and motions into reedline events. But reedline event is generic as in it doesn't know if it was vi or emacs mode.
So I think, we either need to expose the underlying vi stuff or re-architecture it to make it work nicely.