tidalcycles / vim-tidal

Vim plugin for TidalCycles
MIT License
223 stars 56 forks source link

Dirt-Samples dictionary completion #14

Closed davidgranstrom closed 7 years ago

davidgranstrom commented 7 years ago

Hi!

This PR enables dictionary completion for SuperDirt samples.

It adds a new command :TidalGenerateCompletions that generates a file which contains a list of all the SuperDirt sample folders, and sets that file to be used for dictionary completion in vim. This provides a convenient way to find, and cycle through, available samples using ^x^k (and auto-completion of samples if the user has such a plugin installed)

The TidalGenerateCompletions command will use the default installation paths for SuperCollider quarks to find the sample files. It is also possible to override this behaviour by supplying a path to the command pointing to another sample folder.

I have tested this on OS X 10.9.5, and I have provided a path for linux where I believe the samples are installed. I'm not sure if this plugin works on windows (?), but if that is the case it should be easy to add a samples path for windows as well.

I have kept the commit history as it is for easier reviewing, but I could squash everything into a single commit if you are interested in merging this feature.

munshkr commented 7 years ago

This is great! I just tried it on linux, it works all right. Thanks a lot :) I think it's possible to squash and merge this PR from here (Github), let me know if you prefer to do it yourself.

davidgranstrom commented 7 years ago

Thanks :) Great to hear that it is working on linux as well!

I just squashed the commits, so you can merge this at your convenience. Also, thank you for writing and maintaining this plugin! 👍

b1tfl0w commented 4 years ago

This should be mentioned in the readme becouse it wasn't so obvious. After reading this I've added imap <F8> <c-x><c-k> in ftplugin/tidal.vim