{"id":20823035,"url":"https://github.com/madskjeldgaard/fzf-sc","last_synced_at":"2025-08-22T10:34:14.442Z","repository":{"id":37765370,"uuid":"399927357","full_name":"madskjeldgaard/fzf-sc","owner":"madskjeldgaard","description":"Combine the magic of fuzzy searching with the magic of SuperCollider in NeoVim","archived":false,"fork":false,"pushed_at":"2023-07-23T09:16:19.000Z","size":844,"stargazers_count":20,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T12:01:55.418Z","etag":null,"topics":["fzf","neovim","supercollider"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madskjeldgaard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-25T18:57:24.000Z","updated_at":"2024-06-08T15:02:16.000Z","dependencies_parsed_at":"2023-01-29T16:16:47.116Z","dependency_job_id":null,"html_url":"https://github.com/madskjeldgaard/fzf-sc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskjeldgaard%2Ffzf-sc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskjeldgaard%2Ffzf-sc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskjeldgaard%2Ffzf-sc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskjeldgaard%2Ffzf-sc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madskjeldgaard","download_url":"https://codeload.github.com/madskjeldgaard/fzf-sc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252916983,"owners_count":21824870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fzf","neovim","supercollider"],"created_at":"2024-11-17T22:17:07.739Z","updated_at":"2025-05-07T16:45:28.537Z","avatar_url":"https://github.com/madskjeldgaard.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fzf-sc\n\n![Fuzzy scales](assets/fzf-sc-fuzzyscales.gif)\n\nUse the power of [fzf](https://github.com/junegunn/fzf) to get the best out of [SuperCollider](https://supercollider.github.io/):\n\nFuzzy search basically anything in SuperCollider and execute SuperCollider code with the result of that search.\n\n## Requirements\n\n- [nvim-fzf](https://github.com/vijaymarupudi/nvim-fzf)(recommended) \n- [scnvim](https://github.com/davidgranstrom/scnvim)\n- Nvim \u003e= v0.7\n\n## Installation\n\n### packer.nvim\n\n```lua\nuse {\n\t'madskjeldgaard/fzf-sc',\n\trequires = {\n\t\t'vijaymarupudi/nvim-fzf',\n\t\t'davidgranstrom/scnvim'\n\t}\n}\n```\n\n\n### vim-plug\nFor vim-plug users, add this to your init.vim:\n\n`Plug 'madskjeldgaard/fzf-sc'`\n\nThen run `:PlugInstall`.\n\n## Setup\n\nLoad the extension **after** the call to `scnvim.setup`.\n\n```lua\nscnvim.setup{...}\n\nscnvim.load_extension('fzf-sc')\n```\n\n\n### Configuration\n\nfzf-sc may be configured by supplying a table to the setup function in a lua file:\n\n```lua\nscnvim.setup {\n  extensions = {\n    ['fzf-sc'] = {\n      search_plugin = 'nvim-fzf',\n    },\n  }\n}\n```\n\n## Available commands\n`:SCNvimExt fzf-sc.fuzz`\n\nFuzzy search the fuzzy finders. Gets list of all fuzzy search commands. Choose one and execute it.\n\nInvoking the commands directly works like this. An example using the `scales` finder:\n\n```bash\n:SCNvimExt fzf-sc.fuzz play_scales\n```\n\n## Make your own fuzzy finder\n\nTo make your own finder, you need two things: Some supercollider code that generates an array and a callback (can be either SuperCollider or Lua). The callback is a piece of code that takes the result of your choice and does something with it. \n\n\n### Defining a fuzzy finder in SuperCollider\n\nThis plugin comes with a SuperCollider class that makes it easy to define your own custom fuzzy finders. This allows you to add project based or setup specific finders that maybe aren't relevant for everyone but very relevant for you :)\n\n```supercollider\nFZFSC.new(\n\t// The name of your finder. You can invoke it in NeoVim by running the following command in nvim:\n\t// :SCNvimExt fzf-sc.fuzz numberlister\n\t// And additionally, it is available in the main list of finders:\n\t// :SCNvimExt fzf-sc.fuzz\n\tname: \"numberlister\", \n\n\t// A piece of SuperCollider code that returns an array of some things that we can fuzzy find over\n\titemsCode: \"[1,5,2,4,3,9,666]\",\n\n\t// A formatted string containing a piece of SuperCollider code. \n\t// The %s bit will be replaced with the item you chose from the array above.\n\tcallbackFunc: \"\\\"%s\\\".postln\"\n)\n```\n\n### Defining a fuzzy finder in LUA\n\nHere is an example of getting all quarks as input and then installing the chosen item in the return code. The return code is a string where `%s` is replaced with the result of the fuzzy search, eg in the example below it will be the name of the quark the user chooses.\n\nBy adding your finder to `finders.lua`, it will automatically show up when you run `:SCNvimExt fzf-sc.fuzz`.\n\n```lua\nlocal utils = require\"scnvim._extensions.fzf-sc.utils\"\n\nrequire\"scnvim._extensions.fzf-sc.finders\".my_quark_installer = \nfunction()\n\tlocal sc_code = [[Quarks.fetchDirectory; Quarks.all.collect{|q| q.name}]];\n\tlocal supercollider_callback = [[Quarks.install(\"%s\");]];\n\n\tutils.fzf_sc_eval(sc_code, supercollider_callback)\nend\n```\n\n#### Using a lua callback\n\nInstead of using SuperCollider in the callback, it is also possible to pass your choice from the fuzzy list to a lua function and make use of Neovim's lua api.\n\n```lua\nlocal utils = require\"scnvim._extensions.fzf-sc.utils\"\n\nrequire\"scnvim._extensions.fzf-sc.finders\".my_quark_browser = \nfunction()\n\n\t-- Get a list of all quark folders in your system and convert them to full paths\n\tlocal sc_code = [[PathName(Quarks.folder).folders.collect{|folder| folder.fullPath}\n]];\n\n\t-- This callback opens the chosen folder in a new tab\n\tlocal callback = function(val) \n\t\tvim.cmd(\"tabnew \" ..val) \n\tend\n\n\tutils.fzf_sc_eval(sc_code, callback)\nend\n```\n\n### More inspiration \n\nFor more inspiration [see this file](lua/scnvim/_extensions/fzf-sc/finders.lua). \n\n## Contributing a finder\n\nFinders are defined in [this file](lua/scnvim/_extensions/fzf-sc/finders.lua). \n\nIf you feel like contributing a finder, that's where to do it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadskjeldgaard%2Ffzf-sc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadskjeldgaard%2Ffzf-sc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadskjeldgaard%2Ffzf-sc/lists"}