Vieb
Vieb copied to clipboard
Add backwards searching
Checklist
- [x] I searched the
:helpdocumentation using/for helpful information - [x] I have read the frequently asked questions
- [x] I did not find any similar issues in the issue tracker
Addition or change
Vim has ? to search backwards which modifies the behavior of n and N to go in the opposite direction. It would be nice if this was also a part of Vieb.
Alternatives considered
You can always use N instead of n and vice versa.
Hey I want to work on this issue if no one else is working on it. Since I don't have much experience with electron, kindly suggest me where to look in the code for this issue.
Thanks for this nice project that actually feels vim-like.
Vieb has most of it's code in app/renderer, files of interest for this issue are:
actions.jsall functions will be exposed as an action inside Vieb (if exported at the end of the file). This is where the nextSearchMatch action is also stored, which should be modified to optionally search backwards if started using?, which means thetoSearchModeaction also needs work (or a separate one for entering search in reverse). To implement this in a similar way to Vim, we should only modify the direction if search mode is quit usinguseEnteredDataand not withtoNormalMode. These are all function/actions inside this file you might want to check the implementation for before starting with any coding.input.jscontains all input handling, including a list of default mappings, to which?should be added.settings.jsnot sure if needed, but this is in charge of managing user settings.
I think that's most if not all the files you will need to edit for this issue, all of which are inside the app/renderer folder. Hopefully you can figure it out with this, if not just ask, so most of all: Good luck!
Implemented in https://github.com/Jelmerro/Vieb/commit/5dab8e03e4f4468dd0980bc004d618b6fb0db796.