{"id":18654493,"url":"https://github.com/z-shell/zsh-cmd-architect","last_synced_at":"2025-04-11T17:31:19.204Z","repository":{"id":103554347,"uuid":"425840654","full_name":"z-shell/zsh-cmd-architect","owner":"z-shell","description":"⚙️  Zsh Command Architect ","archived":false,"fork":false,"pushed_at":"2025-03-23T13:17:02.000Z","size":81,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T14:24:29.311Z","etag":null,"topics":["command-line-tool","history-management","zsh","zsh-plugins"],"latest_commit_sha":null,"homepage":"https://wiki.zshell.dev/ecosystem/plugins/zsh-cmd-architect","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/z-shell.png","metadata":{"files":{"readme":"docs/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":"2021-11-08T13:05:38.000Z","updated_at":"2025-03-23T13:17:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"ae48e469-1df5-4218-8a3d-7301ec65d137","html_url":"https://github.com/z-shell/zsh-cmd-architect","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-shell%2Fzsh-cmd-architect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-shell%2Fzsh-cmd-architect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-shell%2Fzsh-cmd-architect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z-shell%2Fzsh-cmd-architect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/z-shell","download_url":"https://codeload.github.com/z-shell/zsh-cmd-architect/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248449727,"owners_count":21105551,"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":["command-line-tool","history-management","zsh","zsh-plugins"],"created_at":"2024-11-07T07:15:34.941Z","updated_at":"2025-04-11T17:31:19.186Z","avatar_url":"https://github.com/z-shell.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://github.com/z-shell/zi\"\u003e\n    \u003cimg align=\"center\" src=\"https://github.com/z-shell/zi/raw/main/docs/images/logo.png\" alt=\"Logo\" width=\"60px\" height=\"60px\" /\u003e\n  \u003c/a\u003e ❮ Zsh Command Architect ❯\n\u003c/h1\u003e\n\u003ch2 align=\"center\"\u003e\n  \u003cp\u003e\u003csamp\u003e\u003ccode\u003eZCA\u003c/code\u003e\u003c/samp\u003e allows to copy segments of commands in history, rearrange segments of current command, delete segments of current command. \u003c/p\u003e\n  \u003cp\u003eThis way user glues command from parts without using a mouse.\u003c/p\u003e\u003cp\u003e Advanced history search (multi word, without duplicate lines) allows to quickly find the parts.\u003c/p\u003e\n\u003c/h2\u003e\n\u003c!-- \u003cp\u003e\u003cimg align=\"center\" src=\"https://raw.githubusercontent.com/z-shell/z-a-rust/main/docs/images/annex-rust.gif\" alt=\"Zi annex rust\" width=\"100%\" height=\"auto\" /\u003e\u003c/p\u003e --\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![🐧 Test sh (Linux)](https://github.com/z-shell/zsh-cmd-architect/actions/workflows/test-sh.yml/badge.svg)](https://github.com/z-shell/zsh-cmd-architect/actions/workflows/test-sh.yml) [![✅ Zsh](https://github.com/z-shell/zsh-cmd-architect/actions/workflows/zsh-n.yml/badge.svg)](https://github.com/z-shell/zsh-cmd-architect/actions/workflows/zsh-n.yml)\n\n\u003c/div\u003e\n\n## 💡 Wiki: [ZCA](https://wiki.zshell.dev/ecosystem/plugins/zsh-cmd-architect) - [Plugins](https://wiki.zshell.dev/ecosystem/category/%EF%B8%8F-plugins)\n\n| Keys                                                                                        | Description                                                                       |\n| ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |\n| \u003ckbd\u003e\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eT\u003c/kbd\u003e\u003c/kbd\u003e                                                     | Start Zsh Command Architect (Zshell binding)                                      |\n| \u003ckbd\u003eEnter\u003c/kbd\u003e                                                                            | Delete selected segment (command window) or add selected segment (history window) |\n| \u003ckbd\u003e[\u003c/kbd\u003e or \u003ckbd\u003e]\u003c/kbd\u003e                                                                | Move active segment (when in command window)                                      |\n| \u003ckbd\u003e\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eleft\u003c/kbd\u003e\u003c/kbd\u003e or \u003ckbd\u003e\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eright\u003c/kbd\u003e\u003c/kbd\u003e | Move active segment (when in command window)                                      |\n| \u003ckbd\u003eTab\u003c/kbd\u003e                                                                              | Switch between the two available windows                                          |\n| \u003ckbd\u003eg\u003c/kbd\u003e, \u003ckbd\u003eG\u003c/kbd\u003e                                                                  | Beginning and end of the list                                                     |\n| \u003ckbd\u003e/\u003c/kbd\u003e                                                                                | Start incremental search                                                          |\n| \u003ckbd\u003eEsc\u003c/kbd\u003e                                                                              | Exit incremental search, clearing filter                                          |\n| \u003ckbd\u003e\u003c\u003c/kbd\u003e,\u003ckbd\u003e\u003e\u003c/kbd\u003e, \u003ckbd\u003e{\u003c/kbd\u003e,\u003ckbd\u003e}\u003c/kbd\u003e                                        | Horizontal scroll                                                                 |\n| \u003ckbd\u003e\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eL\u003c/kbd\u003e\u003c/kbd\u003e                                                     | Redraw of whole display                                                           |\n| \u003ckbd\u003e\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eO\u003c/kbd\u003e\u003c/kbd\u003e, \u003ckbd\u003eo\u003c/kbd\u003e                                       | Enter uniq mode (no duplicate lines)                                              |\n| \u003ckbd\u003e\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eW\u003c/kbd\u003e\u003c/kbd\u003e                                                     | (in incremental search) - delete whole word                                       |\n| \u003ckbd\u003e\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eK\u003c/kbd\u003e\u003c/kbd\u003e                                                     | (in incremental search) - delete whole line                                       |\n| \u003ckbd\u003e\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eD\u003c/kbd\u003e\u003c/kbd\u003e, \u003ckbd\u003e\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eU\u003c/kbd\u003e\u003c/kbd\u003e            | Half page up or down                                                              |\n| \u003ckbd\u003e\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eP\u003c/kbd\u003e\u003c/kbd\u003e, \u003ckbd\u003e\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eN\u003c/kbd\u003e\u003c/kbd\u003e            | Previous and next (also done with vim's \u003ckbd\u003ej\u003c/kbd\u003e,\u003ckbd\u003ek\u003c/kbd\u003e)                |\n\n## Installation\n\n### [Zi](https://github.com/z-shell/zi)\n\nAdd `zi load z-shell/zsh-cmd-architect` to `.zshrc`.\n\n### Zgen\n\nAdd `zgen load z-shell/zsh-cmd-architect` to `.zshrc` and issue a `zgen reset` (this assumes that there is a proper `zgen save` construct in `.zshrc`).\n\n### Antigen\n\nAdd `antigen bundle z-shell/zsh-cmd-architect@main` to `.zshrc`. There also should be `antigen apply`.\n\n### Standalone\n\n```sh\nsh -c \"$(curl -fsSL https://raw.githubusercontent.com/z-shell/zsh-cmd-architect/main/doc/install.sh)\"\n```\n\nTo update run the command again.\n\n`ZCA` will be installed at `~/.config/zca/zsh-cmd-architect`, config files will be copied to `~/.config/zca`. `.zshrc` will be updated with code snippet at the bottom.\n\n\u003e After installing and reloading shell give `ZCA` a quick try with \u003ckbd\u003e\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eT\u003c/kbd\u003e\u003c/kbd\u003e.\n\n#### Manual\n\nAfter extracting `ZCA` to `{some-directory}` add following two lines to `~/.zshrc`:\n\n```shell\nfpath+=( {some-directory} )\nsource \"{some-directory}/zsh-cmd-architect.plugin.zsh\"\n```\n\nAs you can see, no plugin manager is needed to use the `*.plugin.zsh`\nfile. The above two lines of code are all that almost **all** plugin\nmanagers do. In fact, what's actually needed is only:\n\n```shell\nsource \"{some-directory}/zsh-cmd-architect.plugin.zsh\"\n```\n\n`ZCA` detects if it is used by **any** plugin manager and can\nhandle `$fpath` update by itself.\n\n#### Single File\n\nRunning script `doc/generate_single_file` will create single-file version of `ZCA`.\n\nIt can be sourced from `.zshrc`.\n\n\u003e **Note:**\n\u003e\n\u003e - Don't forget about configuration files (copy them to `~/.config/zca`).\n\n## Performance\n\n`ZCA` is fastest with `Zsh` before `5.0.6` and starting from `5.2`\n\n\u003cdetails\u003e\n\u003csummary\u003eFixing tmux, screen and linux vt\u003c/summary\u003e\n\nIf `TERM=screen-256color` (often a case for `tmux` and `screen` sessions) then\n`ncv` terminfo capability will have `2`nd bit set. This in general means that\nunderline won't work. To fix this by creating your own `ncv=0`-equipped\nterminfo file, run:\n\n```shell\n{ infocmp -x screen-256color; printf '\\t%s\\n' 'ncv@,'; } \u003e /tmp/t \u0026\u0026 tic -x /tmp/t\n```\n\nA file will be created in directory `~/.terminfo` and will be automatically\nused, `tmux` and `screen` will work. Similar is for Linux virtual terminal:\n\n```shell\n{ infocmp -x linux; printf '\\t%s\\n' 'ncv@,'; } \u003e /tmp/t \u0026\u0026 tic -x /tmp/t\n```\n\nIt will not display underline properly, but will instead highlight by a color,\nwhich is quite nice. The same will not work for FreeBSD's vt, `ZCA` will detect\nif that vt is used and will revert to highlighting elements via `reverse` mode.\n\n\u003c/details\u003e\n\n\u003chr /\u003e\n\n\u003e Also check out [Zsh Navigation Tools](https://github.com/z-shell/zsh-navigation-tools) and [Zsh Editing Workbench](https://github.com/z-shell/zsh-editing-workbench)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz-shell%2Fzsh-cmd-architect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fz-shell%2Fzsh-cmd-architect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz-shell%2Fzsh-cmd-architect/lists"}