Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default behavior when cheat a subdirectory #585

Open
lengyijun opened this issue Aug 28, 2020 · 8 comments
Open

Default behavior when cheat a subdirectory #585

lengyijun opened this issue Aug 28, 2020 · 8 comments

Comments

@lengyijun
Copy link

# structure in cheat directory
golang/index
golang/loop
cheat golang/index    # open golang/index
cheat golang/loop     # open golang/loop
cheat golang           # open golang/index by default

It's useful to arrange programming language's cheatsheet

@chrisallenlane
Copy link
Member

That's an interesting idea. I see how this could be useful.

Let me experiment a bit with this. I'll update the ticket when I have more information.

Thanks.

@lengyijun
Copy link
Author

lengyijun commented Aug 30, 2020

Thx. I have another idea about this:

# structure in cheat directory
golang/golang
golang/loop
cheat golang/golang   # open golang/golang
cheat golang/loop     # open golang/loop
cheat golang          # open golang/golang by default

I have implemented it in #586

@SinRoot
Copy link

SinRoot commented Sep 25, 2020

Both ideas are good. But, I think, first variant is easier to implement.
@chrisallenlane, are you need to help with realization? I don't write on Go, but I think it not a very hard in this case. Or we can request help in community.

@SinRoot
Copy link

SinRoot commented Sep 25, 2020

An update to this enhancement:
Recursive going deep. I mean:

cheat golang 		# open golang/index
cheat golang/loop 	# open golang/loop if this a file
# if golang/loop is directory open golang/loop/index

In this case we can create a tree of cheatsheets. Example:

cheat tar/create/compressed
cheat tar/create/bz2

@chrisallenlane
Copy link
Member

@chrisallenlane, are you need to help with realization? I don't write on Go, but I think it not a very hard in this case. Or we can request help in community.

I don't think there's a huge amount of work here. It needs to be considered alongside #548, though, so I'll probably implement both of those features simultaneously.

I should be able to handle this solo, but I appreciate the offer to marshal some help. I'm just a bit time-crunched at present. I should be able to get to this sometime around mid-October. I'll update this thread as I make progress.

@srafi1
Copy link

srafi1 commented Oct 23, 2020

This sounds like an interesting idea. @chrisallenlane if you're still time-crunched can I step in to work on this issue?

@chrisallenlane
Copy link
Member

@srafi1, thanks for the offer, but I should be able to get to this this week. It's probably best that I take this on myself - we have like 3 open tickets that are all going to impact each other. 🙂

@dece
Copy link

dece commented Mar 12, 2024

Hi there, sorry for the bump but any plans for this feature? Right now it feels a bit weird to have to choose between having subdirectories or a single big sheet.

To complete OP's examples, if you have a bunch of Bash cheats, you may want to put them in in bash directory so that you can split between cheat bash/getopts, cheat bash/arrays, cheat bash/dicts, whatever, but it becomes awkward to put general bash cheats such as special arguments $*, $@, or last command tokens !!, !$ in dedicated named sheet like cheat bash/arguments and cheat bash/tokens, where it would feel more natural to get them with cheat bash.

Unfortunately I don't know Go and wouldn't know how to write the MR 😭

By the way thank you for this neat little tool, been using it daily since 2019 now, aliased it to c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants