thefuck
thefuck copied to clipboard
correct uppercase fuckups
I'd like to set a custom rule so that when I accidentally type
CD MNT/C
it suggests:
cd mnt/c
is that feasible?
something like this? (put in ~/.config/thefuck/rules
)
Anyone have ideas how to make this work? I been messing with the baseline @romangraef gave and also trying my own methodology and to no avail. I"m doing this for a capstone project and I'd really like to get this working. It's a super neat project and I want to contribute something to it.
How about sharing your methodology? 🙂
What if match
would return True
when there's any character in script
that can be converted to lowercase?
I can suggest code if you'd like.
Hey @RVALLER, I posted this snippet about 5 years ago, I'd imagine there have been changes in the way rules work. I haven't been using this tool for a while, (and neither have i been using my rule in that time), therefore i wouldn't know about how to fix it either. However i don't think matching on a single uppercase character is the best way to go about it. Looking at my past code, lowercasing everything probably wasn't too smart, the least one could do would be swapping the case (lower->upper AND upper -> lower) and a bit of a more smarter approach would maybe be analyzing the users keyboard layout / mappings (however that one seems like it would be platform dependent). Im sorry i cant be of help with this anymore.