In vim mode I cannot indent text to the right
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
In neovim I tested that I can indent text to the right by pressing > followed by motion. So entering >G should indent all the lines from the current line to the right. But in Zed, all that happens is the motion is registered. So >G takes you to the end of the file without any indentation.
https://github.com/zed-industries/zed/assets/6380138/a3361525-88a9-4b0e-80c1-ef2e79d9976f
Environment
Zed: v0.127.3 (Zed) OS: macOS 14.4.0 Memory: 24 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.
No response
Similarly, indentation with other motion keys simply don't work. For example I would expect 5> to ident the line(s) 5 times in visual mode.
This makes it really tedious to indent multiple lines, multiple times, without resorting to the ⌘] key bind.
(not sure if this should be a separate issue or not, but it seems closely related)
Currently >> is hard-coded to "indent current line". we should make > in normal mode push an indent operator onto the stack and handle this more like vim's other operators.
I'd be happy to pair with anyone on this https://calendly.com/conradirwin/pairing
If it's ok with you Conrad, I would like to join on Saturday April 13, just to see how you solve this. I am pretty new to both Rust and vim though.
I just wanted to create a new issue but I think this is probably the same underlying root cause?
If you make a multi-line indentation in visual mode and the try to repeat it using ., instead of re-indenting the same block, the block from your new cursor position will get indented.
Happy to provide videos, etc. if needed.
Yup, that's the same bug. . records the previous visual selection - so if > worked as an operator it would work.
Similarly, indentation with other motion keys simply don't work. For example I would expect
5>to ident the line(s) 5 times in visual mode.This makes it really tedious to indent multiple lines, multiple times, without resorting to the
⌘]key bind.(not sure if this should be a separate issue or not, but it seems closely related)
I've run into this as well.