{"id":13646172,"url":"https://github.com/oakmac/atom-parinfer","last_synced_at":"2025-07-12T01:06:56.147Z","repository":{"id":2129242,"uuid":"45006855","full_name":"oakmac/atom-parinfer","owner":"oakmac","description":"Parinfer for Atom","archived":false,"fork":false,"pushed_at":"2022-11-01T14:23:20.000Z","size":1844,"stargazers_count":204,"open_issues_count":22,"forks_count":8,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-02T21:13:39.357Z","etag":null,"topics":["atom-plugin","clojure","clojurescript","lisp","parentheses","parinfer"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oakmac.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-27T00:32:59.000Z","updated_at":"2024-05-31T07:42:53.000Z","dependencies_parsed_at":"2023-01-11T16:08:04.433Z","dependency_job_id":null,"html_url":"https://github.com/oakmac/atom-parinfer","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fatom-parinfer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fatom-parinfer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fatom-parinfer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oakmac%2Fatom-parinfer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oakmac","download_url":"https://codeload.github.com/oakmac/atom-parinfer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233327824,"owners_count":18659363,"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":["atom-plugin","clojure","clojurescript","lisp","parentheses","parinfer"],"created_at":"2024-08-02T01:02:49.804Z","updated_at":"2025-01-10T10:19:36.844Z","avatar_url":"https://github.com/oakmac.png","language":"Clojure","funding_links":[],"categories":["Clojure"],"sub_categories":[],"readme":"# Parinfer for Atom\n\nA [Parinfer] package for [Atom].\n\n[Parinfer]:http://shaunlebron.github.io/parinfer/\n[Atom]:https://atom.io/\n\n## What is Parinfer?\n\nParinfer is a text editing mode that can infer Lisp code structure from\nindentation (and vice versa). A detailed explanation of Parinfer can be found\n[here].\n\nPut simply: the goal of Parinfer is to make it so you never have to think about\n\"balancing your parens\" when writing or editing Lisp code. Just indent your code\nas normal and Parinfer will infer the intended paren structure.\n\n[here]:http://shaunlebron.github.io/parinfer/\n\n## Installation\n\n1. Install [Atom]\n1. In Atom, pull up the Settings tab by pressing \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003e,\u003c/kbd\u003e\n   (\u003ckbd\u003eCmd\u003c/kbd\u003e+\u003ckbd\u003e,\u003c/kbd\u003e on Mac) or using the main menu Edit --\u003e\n   Preferences\n1. Click on the Install tab\n1. Search for \"parinfer\" and find this package\n1. Press the Install button :)\n\n## Usage\n\n### File Extensions\n\nOnce the package has been installed, it will automatically load in the\nbackground when you open Atom and watch for file extensions of popular Lisp\nlanguages. The file extensions are [listed here] and can be changed in the\nSettings.\n\n[listed here]:https://github.com/oakmac/atom-parinfer/blob/b167244ea38b35c2d9a00dba76833f06a9bf7367/src-cljs/atom_parinfer/core.cljs#L30-L42\n\n### Opening a File\n\nWhen a file with a recognized extension is first opened, Parinfer runs [Paren\nMode] on the entire file and one of three things will happen (in order of\nlikelihood):\n\n* **The file was unchanged.** You will be automatically dropped into [Indent\n  Mode]. This is the most common scenario once you start using Parinfer\n  regularly.\n* **Paren Mode changed the file.** You will be prompted to apply the changes\n  (recommended) and then dropped into Indent Mode. This is common the first time\n  you use Parinfer on a file.\n* **Paren Mode failed.** This scenario is uncommon and almost certainly means\n  you have unbalanced parens in your file (ie: it will not compile). A prompt\n  will show and you will be dropped into Paren Mode in order to fix the syntax\n  problem.\n\nRunning Paren Mode is a necessary first step before Indent Mode can be safely\nturned on. See [Fixing existing files] for more information.\n\nIf you do not want to be prompted when opening a new file, the prompts can be\ndisabled in the Settings.\n\nPlease be aware that - depending on the indentation and formatting in your Lisp\nfiles - this initial processing may result in a large diff the first time it\nhappens. Once you start using Indent Mode regularly, this initial processing is\nunlikely to result in a large diff (or any diff at all). You may even discover\nthat applying Paren Mode to a file can result in [catching very hard-to-find\nbugs] in your existing code! As usual, developers are responsible for reviewing\ntheir diffs before a code commit :)\n\nIf you want to convert a project over to Parinfer-compatible indentation, please\ncheck out the [Parlinter] project.\n\n[Paren Mode]:http://shaunlebron.github.io/parinfer/#paren-mode\n[Indent Mode]:http://shaunlebron.github.io/parinfer/#indent-mode\n[Fixing existing files]:http://shaunlebron.github.io/parinfer/#fixing-existing-files\n[catching very hard-to-find bugs]:https://github.com/oakmac/atom-parinfer/commit/d4b49ec2636fd0530f3f2fbca9924db6c97d3a8f\n[Parlinter]:https://github.com/shaunlebron/parlinter\n\n### Hotkeys and Status Bar\n\n|  Command              | Windows/Linux                                 | Mac                                          |\n|-----------------------|----------------------------------------------:|----------------------------------------------|\n| Turn on / Toggle Mode | \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003e(\u003c/kbd\u003e | \u003ckbd\u003eCmd\u003c/kbd\u003e+\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003e(\u003c/kbd\u003e |\n| Turn off              | \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003e)\u003c/kbd\u003e | \u003ckbd\u003eCmd\u003c/kbd\u003e+\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003e)\u003c/kbd\u003e |\n\nThe status bar will indicate which mode you are in or show nothing if Parinfer\nis turned off.\n\nIf you are in Paren Mode and Parinfer detects unbalanced parens (ie: code that\nwill not compile), the status bar text will be red. Note that this will never\nhappen in Indent Mode because Parinfer ensures that parens are always balanced.\nAlso note that there is a [known bug] with this feature due to the \"parent\nexpression\" hack explained below.\n\n[known bug]:https://github.com/oakmac/atom-parinfer/issues/32\n\n## Known Limitations\n\nThis extension uses a hack for performance reasons that may act oddly in certain\ncircumstances. It assumes that an open paren followed by an alpha character -\nie: regex `^\\([a-zA-Z]` - at the start of a line is the beginning of a new\n\"parent expression\" and tells the Parinfer algorithm to start analyzing from\nthere until the next line that matches the same regex. Most of the time this is\nprobably a correct assumption, but might break inside multi-line strings or\nother non-standard circumstances. This is tracked at [Issue #9]; please add to\nthat if you experience problems.\n\nInterestingly, [Shaun] discovered that this hack is not new. Someone else used\nthe same approach [36 years ago] :)\n\n[Issue #9]:https://github.com/oakmac/atom-parinfer/issues/9\n[Shaun]:https://github.com/shaunlebron/\n[36 years ago]:images/zwei-top-level-expression-hack.png\n\n## Plugin Development Setup\n\nInstall [Leiningen].\n\n```sh\n# clone this repo to your homedir\ncd ~\ngit clone https://github.com/oakmac/atom-parinfer.git\n\n# symlink the repo to the Atom packages folder\nln -s ~/atom-parinfer ~/.atom/packages/parinfer\n\n# compile CLJS files\nlein cljsbuild auto\n```\n\nThen run Atom on a Lisp file.  Some development notes:\n\n- `View \u003e Developer \u003e Reload Window` (to reload plugin changes)\n- `View \u003e Developer \u003e Toggle Developer Tools` (to see console)\n\n[Leiningen]:http://leiningen.org\n\n## License\n\n[ISC License](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foakmac%2Fatom-parinfer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foakmac%2Fatom-parinfer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foakmac%2Fatom-parinfer/lists"}