{"id":20327686,"url":"https://github.com/jeancarlomachado/subs","last_synced_at":"2025-08-31T13:39:22.673Z","repository":{"id":148488587,"uuid":"130994275","full_name":"jeanCarloMachado/subs","owner":"jeanCarloMachado","description":"General purpose emmet written in Haskell","archived":false,"fork":false,"pushed_at":"2018-05-12T16:10:14.000Z","size":98,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-13T16:41:53.075Z","etag":null,"topics":["development","efficiency","programming-languages"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/jeanCarloMachado.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-04-25T11:10:42.000Z","updated_at":"2018-06-13T06:03:28.000Z","dependencies_parsed_at":"2023-05-20T07:45:12.368Z","dependency_job_id":null,"html_url":"https://github.com/jeanCarloMachado/subs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jeanCarloMachado/subs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeanCarloMachado%2Fsubs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeanCarloMachado%2Fsubs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeanCarloMachado%2Fsubs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeanCarloMachado%2Fsubs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeanCarloMachado","download_url":"https://codeload.github.com/jeanCarloMachado/subs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeanCarloMachado%2Fsubs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272988783,"owners_count":25026959,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["development","efficiency","programming-languages"],"created_at":"2024-11-14T19:48:29.761Z","updated_at":"2025-08-31T13:39:22.668Z","avatar_url":"https://github.com/jeanCarloMachado.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## subs\n\nThis project aims to reduce the amount of things we type. Specially\nuseful for syntax heavy languages.\n\n![build status](https://travis-ci.org/jeanCarloMachado/subs.svg?branch=master)\n[![Join the chat at https://gitter.im/subs-subs/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/subs-subs/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n\n![example](https://i.imgur.com/HDwTl6V.gif)\n\n\n## Installation:\n\n### Linux\n```sh\nsudo wget -O /usr/local/bin/subs \"http://jeancarlomachado.net/subs\" \\\n\u0026\u0026 sudo chmod +x /usr/local/bin/subs\n```\n\n\n### Other\n\nYou have to compile for your platform, the only requirement is Haskell stack.\n\n```sh\ngit clone git@github.com:jeanCarloMachado/subs.git\ncd subs\nmake\nmake install\n```\n\n\nCreate/copy the config file  into `~/.subsconfig.ini`. [This file](https://raw.githubusercontent.com/jeanCarloMachado/subs/master/EXAMPLE.subsconfig.ini) is the default\none.\n\n\n\n## Usage\n\nAfter having your config just pipe the text to stdin.\n\n```sh\nsubs \u003c\u003c\u003c 'cl Gandalf'\nclass Gandalf\n{\n\n}\n```\n\n\n## Integrations\n\nThe true power of subs comes when you integrate it with your tools.\n\n\n### Vim\n\nFor vim, using Tim Pope's textobject integration is simply a matter of:\n\n```vimscript\nfun! s:Subs(str)\n  let my_filetype = \u0026filetype\n  let out = system('subs -p '.my_filetype, a:str.\"\\n\")\n  return out\nendfunc\ncall MapAction('Subs', '\u003cleader\u003ey')\n```\n\n### Zsh\n\n\n```sh\n# in your .zshrc\nevaluate-snippets-selection () {\n    if [[ $CURSOR -gt $MARK ]]; then\n        start=$MARK\n        end=$(( CURSOR + 1 ))\n    else\n        start=$(( CURSOR + 1 ))\n        end=$MARK\n    fi\n    BUFFER=\"$BUFFER[0,start]$(subs \u003c\u003c\u003c $BUFFER[start+1,end])$BUFFER[end+1,-1]\"\n}\nzle -N evaluate-snippets-selection\nbindkey '^O' evaluate-snippets-selection\n```\n\n\n### Dmenu\n\n```sh\n#!/bin/bash\n# file dmenuSnippets.sh\nkey=$( subs -k | rofi -levenshtein-sort -dmenu -p \"snippet: \")\necho $key\nvalue=$( echo \"$key\" | subs )\n\necho \"$value\"\nmycopy \"$value\"\nnotify-send \"Copied\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeancarlomachado%2Fsubs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeancarlomachado%2Fsubs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeancarlomachado%2Fsubs/lists"}