{"id":17003813,"url":"https://github.com/cldwalker/lightning","last_synced_at":"2025-03-17T09:30:59.254Z","repository":{"id":476896,"uuid":"102271","full_name":"cldwalker/lightning","owner":"cldwalker","description":"Speed for your shell and the commandline","archived":false,"fork":false,"pushed_at":"2019-07-14T04:39:35.000Z","size":1064,"stargazers_count":74,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-11T06:46:50.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://tagaholic.me/lightning/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cldwalker.png","metadata":{"files":{"readme":"README.rdoc","changelog":"CHANGELOG.rdoc","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-01-06T22:22:23.000Z","updated_at":"2022-02-13T05:47:24.000Z","dependencies_parsed_at":"2022-07-07T16:30:35.006Z","dependency_job_id":null,"html_url":"https://github.com/cldwalker/lightning","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldwalker%2Flightning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldwalker%2Flightning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldwalker%2Flightning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldwalker%2Flightning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cldwalker","download_url":"https://codeload.github.com/cldwalker/lightning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858929,"owners_count":20359260,"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":[],"created_at":"2024-10-14T04:32:44.950Z","updated_at":"2025-03-17T09:30:58.926Z","avatar_url":"https://github.com/cldwalker.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"== Description\nLightning is a commandline framework that lets users wrap commands with shell functions that are\nable to refer to any filesystem path by its basename. To achieve this, a group of paths to be\ntranslated are defined with shell globs. These shell globs, known as a lightning _bolt_, are then\napplied to commands to produce functions. In addition to translating basenames to full paths,\nlightning _functions_ can autocomplete these basenames, resolve conflicts if they have the same\nname, leave any non-basename arguments untouched, and autocomplete directories above and below a\nbasename. To make bolts shareable between users and functions easier to create, lightning has\n_generators_. A _generator_ generates filesystem-specific globs for a bolt. Lightning comes with\nsome default generators. Users can make their own generators with generator plugins placed under\n~/.lightning/generators/.\n\n== Intro\nLightning generates shell functions which can interpret paths by their basenames. So instead of carpal-typing\n\n  $ less /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/irb.rb\n\njust type\n\n  $ less-ruby irb.rb\n\nless-ruby is a lightning function which wraps `less` with the ability to refer to system ruby files\nby their basenames. Being a lightning function, it can also autocomplete system ruby files:\n\n  # 1112 available system ruby files\n  $ less-ruby [TAB]\n  Display all 1112 possibilities? (y or n)\n\n  $ less-ruby a[TAB]\n  abbrev.rb                  abstract.rb                abstract_index_builder.rb\n  $ less-ruby abb[TAB]\n  $ less-ruby abbrev.rb\n  # Pages /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/abbrev.rb ...\n\n  # Autocompletion works regardless of the number of arguments\n  $ less-ruby -I abbrev.rb y[TAB]\n  yaml.rb      yamlnode.rb  ypath.rb\n  $ less-ruby -I abbrev.rb yp[TAB]\n  $ less-ruby -I abbrev.rb ypath.rb\n  # Pages /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/abbrev.rb and\n    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml/ypath.rb ...\n\nAnd here's the one-liner that creates this function:\n\n  $ lightning function create less ruby \u0026\u0026 lightning-reload\n\n== Install\n\nInstall with rubygems:\n  $ gem install lightning\n  $ gem install yard # if you want lightning's documentation generated correctly\n\nIf you've installed with rubygems and `time lightning` takes longer than 0.05 seconds, I *strongly\nrecommend* installing with ruby 1.9.3. Your startup time directly effects your autocompletion speed with\nlightning.\n\nOnce lightning is installed, we need to do a one-time setup:\n\n  # To see available install options\n  $ lightning install -h\n\n  # Installs lightning's core files and sources the needed lightning functions\n  $ lightning install \u0026\u0026 source ~/.lightning/functions.sh\n  Created ~/.lightningrc\n  Created ~/.lightning/functions.sh\n\n  # To have lightning's functionality loaded when your shell starts up\n  echo source ~/.lightning/functions.sh \u003e\u003e ~/.bashrc\n  # or for zsh\n  echo source ~/.lightning/functions.sh \u003e\u003e ~/.zshrc\n\nTo install and view lightning's man page:\n\n  # If installed with rip, man pages are automatically installed\n  $ man lightning\n\n  # If installed with rubygems\n  $ gem install gem-man\n  $ gem man lightning\n\n== Bugs/Issues\nPlease report them {on github}[http://github.com/cldwalker/lightning/issues].\n\n== Limitations\n* Completions that are a directory above or below a basename don't work for zsh.\n* Only bash and zsh shells are supported. Patches are welcome to support other shells.\n\n== Credits\n* ryanb's dotfiles inspired tinkering with autocompletion in ruby:\n  http://github.com/ryanb/dotfiles/blob/master/bash/completion_scripts/project_completion\n* defunkt's rip, http://github.com/defunkt/rip, was influential in designing plugins\n* Bug fixes: ljsc\n\n== Links\n* http://tagaholic.me/2010/04/08/lightning-speed-for-your-shell.html\n* http://tagaholic.me/2010/04/09/lightning-speed-for-the-user.html\n\n== Todo\n* Possible aliasing of paths per function, bolt or global\n* Possible irb builder using bond\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldwalker%2Flightning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcldwalker%2Flightning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldwalker%2Flightning/lists"}