{"id":19798570,"url":"https://github.com/seb0xff/double-click-to-edit","last_synced_at":"2026-04-08T20:03:00.751Z","repository":{"id":233923820,"uuid":"788038534","full_name":"seb0xff/double-click-to-edit","owner":"seb0xff","description":"Easy to configure terminal-based text editors launcher template for macOS","archived":false,"fork":false,"pushed_at":"2024-12-25T22:07:22.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-29T17:48:09.507Z","etag":null,"topics":["alacritty","emacs","iterm2","kitty","macos","nano","neovim","terminal","terminal-app","text-editor","vim"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-4-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seb0xff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2024-04-17T16:57:04.000Z","updated_at":"2024-12-25T22:04:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"828598bc-7e07-435e-942c-5a4bb6918370","html_url":"https://github.com/seb0xff/double-click-to-edit","commit_stats":null,"previous_names":["sebastianpilarz/double-click-to-edit","seb0xff/double-click-to-edit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/seb0xff/double-click-to-edit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seb0xff%2Fdouble-click-to-edit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seb0xff%2Fdouble-click-to-edit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seb0xff%2Fdouble-click-to-edit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seb0xff%2Fdouble-click-to-edit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seb0xff","download_url":"https://codeload.github.com/seb0xff/double-click-to-edit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seb0xff%2Fdouble-click-to-edit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31571601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["alacritty","emacs","iterm2","kitty","macos","nano","neovim","terminal","terminal-app","text-editor","vim"],"created_at":"2024-11-12T07:30:20.798Z","updated_at":"2026-04-08T20:03:00.725Z","avatar_url":"https://github.com/seb0xff.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Double Click To Edit\n\n**Motivation**\nI came from Linux where to open a file in your favorite editor you just create a `.desktop` file. On macOS you usually have to write a script using AppleScript or JXA. It requires some knowledge of the system API. To save time to others \u0026 myself and make it more normalized I created this general purpose template that will make the process simple and straightforward.\n\n**At the moment tested with:**\n\n- [x] kitty\n- [ ] iTerm2\n- [ ] Terminal.app\n- [ ] Alacritty\n- [x] Neovim\n- [x] Vim\n- [ ] Emacs\n- [ ] Nano\n\nBy default it opens the editor in a new terminal window, and multiple files are handled by the editor itself.\n\nThese behaviors can be customized by editing the configuration file.\nThe following things can be customized:\n\n- the way it opens the editor:\n  - new terminal window\n  - new terminal tab\n- the way it handles multiple files:\n  - editor tabs\n  - terminal tabs\n  - new terminal windows\n\nIf the terminal supports the launcher controls it via the terminal API, otherwise it uses the fallback method which is just using keyboard shortcuts as if the user typed them. They can be customized.\n\n\u003e [!NOTE]\n\u003e The fallback method is not that reliable, but it works in most cases.\n\n## Configuration\n\n\u003e [!NOTE]\n\u003e There are plans to add a configuration script that will help with the configuration, but for now, you have to do it manually.\n\n1. Install\n\n- [jxa-builder](https://github.com/seb0xff/jxa-builder) _(my other project that will help compiling and installing the launcher)_\n- (optional) [duti](https://github.com/moretension/duti) make the output app the default editor for most of text files\n\n2. Clone the repository\n3. cd into the repository\n4. Open the [src/index.js](src/index.js) file. You'll see the following code snippet:\n\n```javascript\n/////////////////////////////////////////////////////////////\n\nconst options = {\n  // \"newTab\" | \"newWindow\"\n  howToOpenEditor: \"newWindow\",\n  // \"terminalTab\" | \"terminalWindow\" | \"editorTab\"\n  howToHandleMultipleFiles: \"editorTab\",\n  // e.g. kitty | iTerm | Terminal | Hyper | Alacritty\n  terminal: \"kitty\",\n  // terminal | default\n  actionRecipe: \"terminal\",\n  // actionRecipe: \"default\",\n  defaultActionRecipeKeystrokes: {\n    // e.g. \"control+shift+t\" | \"option+n\" | null | undefined\n    openNewTerminalWindow: \"command+n\",\n    openNewTerminalTab: \"command+t\",\n  },\n};\n// e.g. \"nvim\" | \"vim\" | \"vi\" | \"nano\" | \"emacs\"\nconst editor = \"nvim\";\nconst homePath = ph.homeDirectory();\nconst configPath = homePath + \"/.config\";\nconst configFolderName = editor.toLowerCase() + \"-launcher\";\nconst optionsFileName = \"options.json\";\n\n/////////////////////////////////////////////////////////////\n```\n\n5. Here you can modify launched editor, defaults, and where to store the configuration file.\n\n\u003e [!TIP]\n\u003e Generally, the only things you need to change here are `terminal` and `editor`\n\u003e But if you're interested the other options are explained below:\n\n**Properties:**\n\n- The `options` object contains the default configuration that you can customized via config file.\n  - The `howToOpenEditor` is the way the editor will be opened.\n  - The `howToHandleMultipleFiles` is the way the launcher will handle multiple files.\n  - The `terminal` is the terminal that will be used to open the editor.\n  - The `actionRecipe` is the way the launcher will control the terminal. The terminal API or the default fallback method.\n  - The `defaultActionRecipeKeystrokes` are the keystrokes that the launcher will use to control the terminal.\n- The constants below won't be available in the config file, so if you want to change them do it now.\n- The `editor` is the editor that will be used to open the file (it's the command that you would use in the terminal).\n- The `configPath` is the path to the configuration folder. Other popular locations on macOS are `~/Library/Preferences` and `~/Library/Application Support`.\n- The `configFolderName` is the name of the configuration folder.\n- The `optionsFileName` is the name of the configuration file.\n\n6. Save and close the file\n7. To add custom icon you will need it in `icns` format. Place it in the root of the repository and name it `icon.icns` If you have a pn\n8. Now before compilation open the [package.json](package.json) file and in the `jxa` object change the `appName` to the name you want to give to the app.\n\n```json\n  \"jxa\":{\n    \"appName\": \"Double Click to Edit\",\n    \"compMode\": \"app\",\n    \"depsInstallMode\": \"app\"\n  }\n```\n\n9. Save and close the file\n10. Now you can compile and install\n\n```bash\njxa-builder build \u0026\u0026 jxa-builder install\n```\n\n11. (optional) Make the app the default one for text files\n\n```bash\n./src/set_default_text_editor.sh \u003capp_name\u003e\n```\n\n## Notes\n\n**`kitty`**\n\nif you're using kitty you'll need to enable the remote control in the configuration file. Add the following line to the `~/.config/kitty/kitty.conf` file:\n\n```bash\nallow_remote_control yes\n```\n\nAnd in the same directory create a file named `macos-launch-services-cmdline` with the following content:\n\n```bash\n--listen-on=unix:/tmp/mykitty --single-instance\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseb0xff%2Fdouble-click-to-edit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseb0xff%2Fdouble-click-to-edit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseb0xff%2Fdouble-click-to-edit/lists"}