feat: support toggle for spider motion#76
feat: support toggle for spider motion#76sumit-sahrawat wants to merge 3 commits intochrisgrieser:mainfrom
Conversation
|
That's not really a problem statement. Why would you want to toggle the softer motions? They are either supposed to replace the original motions or as additional motions you can map to other keys. I don't see why a user would want to only temporarily use spider motions in a way that justifies such a toggle. |
|
I felt that it could be a bit annoying when working with codebases that have large multi-word camel/pascal cased identifiers. I wanted to try this out but didn't want to have it always be on, so I went with a toggle similar to the other features in LazyVim. |
|
@chrisgrieser I can create a wrapper over |
|
Yeah, I feel like this is so specific that it makes more sense as something in a personal config. As an implementation tip: you can simplify the toggling by using |
Problem statement
This PR adds helper functions to toggle spider motion.
Proposed solution
We add the following methods:
require("spider").toggle()to toggle off/onrequire("spider").is_enabled()to get the current stateThe state is stored as
require("spider.config").globalOptions.enabledwhich is initially set to true. The initial state can be overridden by passing is torequire("spider").setup({ enabled = ... )AI usage disclosure
I'm not that well versed with lua + nvim. The initial version was generated by AI but I did multiple iterations manually afterwards.
I've also tested it extensively locally. Using this as a keybind with the forked version:
Checklist
camelCaseconvention.README.mdhas been updated for any new or modified functionality(the
.txtfile is auto-generated and does not need to be modified).