3 ms·
1. Names should be optional - as in, you can name a snippet, but not all snippets need to have a name. 2. Having a different shortcut key for every snippet wou
by victorhooi 12y ago
1. Names should be optional - as in, you can name a snippet, but not all snippets need to have a name.
2. Having a different shortcut key for every snippet would probably become unwieldy quite quickly.
Your idea about having a shortcut to popup a window is quite neat - I'd definitely want to have shortcut windows to navigate through and paste the snippets. The problem I see with this is, it breaks up your workflow, and it won't feel instant.
One way I've seen others do it is your (c) - for example, in Dash, each snippet has an abbreviation. If you type that abbreviation in, then press the backtick (`), it will auto-expand it to the snippet.
One thing I noticed about Dash is, sometimes it can seem a bit slow to delete your existing abbreviation, and replace it with the snippet - the author mentioned this is something to do with non-accessibility aps on OSX. (In this case, it was the Chrome Browser). I'm not sure if there's a way around it.
Can you think of any other ways of selecting/pasting a snippet?
- sdegutis 12y agoAccessibility APIs may indeed be the limiting factor in this situation. The only way that I can currently see making this work is by manually sending "Cmd-C" and "Cmd-V" signals to copy/paste selections. Pasting a snippet would in fact just overwrite your clipboard with the contents of the snippet and then send the keyboard signal "Cmd-V" to paste it as if you did it yourself. It's hacky, but if you're okay with it ruining your clipboard on both save-snippet and paste-snippet actions, then it shouldn't be a problem. Option C is actually not much different from option A. In option C, it watches what you just typed, and finds the snippet with that name. But in option A, it pops up a window and lets you type the name, and selects one that matches (by substring comparison), and filters/selects it as you type. So actually not only is option A easier to write than option C, but it's easier for you to use also. Anyway, I'll open-source it and do all the work in this github project: https://github.com/sdegutis/osx-snip https://github.com/sdegutis/osx-snip Donations would be appreciated, but gittip is weekly whereas I would prefer one-time donations only. And I don't know of any other service that does one-time tips/donations, so just don't worry about it.
- victorhooi 12y agoHmm, yeah, I guess I'm ok with it blowing away the clipboard - however, probably don't make it the default, and warn users when they turn it on that it's a side-effect. But you'd still need to delete the abbreviation text they used to trigger it right? Well, unless we went with option (a) and the popup. Hmm, I see what you're saying with (a) - it actually could work pretty well, as long as it was fast and responsive, and seemed seamless. Yes, happy to do a one-time dontation. Have you considered doing a Magic Backlog like these guys? http://robomongo.org/backlog http://robomongo.org/backlog
- sdegutis 12y agoYeah, option A can indeed be fast, responsive, and seem seamless. So let's do that. Hadn't seen http://robomongo.org/backlog http://robomongo.org/backlog before, thanks for the link. Let's move further discussion to the project's issues page: https://github.com/sdegutis/osx-snip/issues https://github.com/sdegutis/osx-snip/issues
- sdegutis 12y agoHow strongly is Gist a requirement? Dropbox integration is dead simple: I write the files into ~/.osx-snip/ and you just symlink ~/Dropbox/yourface/osx-snip to ~/.osx-snip/ and everything's pretty automatic at that point.
- victorhooi 12y agoGist integration is pretty important. Firstly, it makes the sharing thing a lot easier. You can fork Gists from other people, which would be nice for a team - that's the main reason for my particular use case. Secondly, it handles version control and multiple revisions very well. Sure, Dropbox has versions, but I believe it drops them after 30 days, you have no control over when it takes a snapshot, and you don't get pretty diffs on the website. It's basically not really designed specifically for doing version control on text files (or snippets).
- sdegutis 12y agoIn that case, how will it work with gists that have multiple files? Should it just assume that each "snippet"-gist only contains one file, where the name of the file is the name of the snippet, and ignore gists that contain multiple files? This seems the most intuitive way to go. EDIT: lets move discussion to the project's issues page: https://github.com/sdegutis/osx-snip/issues https://github.com/sdegutis/osx-snip/issues