{"id":20610011,"url":"https://github.com/someok/history-search-multi-word","last_synced_at":"2026-04-22T13:31:19.367Z","repository":{"id":146812094,"uuid":"429428747","full_name":"someok/history-search-multi-word","owner":"someok","description":"由于原作者删库跑路，故备份一份","archived":false,"fork":false,"pushed_at":"2021-11-18T13:11:08.000Z","size":212,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-10T04:57:41.837Z","etag":null,"topics":["omz","omz-plugin","zsh"],"latest_commit_sha":null,"homepage":"","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/someok.png","metadata":{"files":{"readme":"README.md","changelog":"history-search-multi-word","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-18T12:52:27.000Z","updated_at":"2023-01-22T14:26:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"9327138c-b4a4-4732-956f-9bf57b9b58b5","html_url":"https://github.com/someok/history-search-multi-word","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/someok/history-search-multi-word","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/someok%2Fhistory-search-multi-word","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/someok%2Fhistory-search-multi-word/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/someok%2Fhistory-search-multi-word/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/someok%2Fhistory-search-multi-word/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/someok","download_url":"https://codeload.github.com/someok/history-search-multi-word/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/someok%2Fhistory-search-multi-word/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32139078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T13:27:12.868Z","status":"ssl_error","status_checked_at":"2026-04-22T13:26:44.791Z","response_time":58,"last_error":"SSL_read: 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":["omz","omz-plugin","zsh"],"created_at":"2024-11-16T10:15:13.285Z","updated_at":"2026-04-22T13:31:17.469Z","avatar_url":"https://github.com/someok.png","language":"Shell","funding_links":["https://www.paypal.me/ZdharmaInitiative","https://www.patreon.com/psprint"],"categories":[],"sub_categories":[],"readme":"由于 [原作者](https://github.com/zdharma/history-search-multi-word) [删库跑路](https://hk.v2ex.com/t/811747) 了，所以将其最后版本备份了一份。\n\n---\n\n[![License (GPL version 3)](https://img.shields.io/badge/license-GNU%20GPL%20version%203-blue.svg?style=flat-square)](./LICENSE)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](./LICENSE)\n![ZSH 5.0.0](https://img.shields.io/badge/zsh-v5.0.0-orange.svg?style=flat-square)\n\n[![paypal](https://img.shields.io/badge/-Donate-yellow.svg?longCache=true\u0026style=for-the-badge)](https://www.paypal.me/ZdharmaInitiative)\n[![patreon](https://img.shields.io/badge/-Patreon-orange.svg?longCache=true\u0026style=for-the-badge)](https://www.patreon.com/psprint)\n\u003cbr/\u003eYou can request a feature when donating, even fancy or advanced ones get implemented this way. [There are\nreports](DONATIONS.md) about what is being done with the money received.\n\n# Introduction\n\nBinds `Ctrl-R` to a widget that searches for multiple keywords in `AND` fashion.\nIn other words, you can enter multiple words, and history entries that match\nall of them will be found. The entries are syntax highlighted.\n\nVideo – view on [asciinema](https://asciinema.org/a/88954). You can resize the video by pressing `Ctrl-+` or `Cmd-+`.\n\n[![asciicast](https://asciinema.org/a/88954.png)](https://asciinema.org/a/88954)\n\nHSMW has feature called **context viewing** – see all occurrences of a command together\nwith surrounding commands:\n\n[![asciicast](https://asciinema.org/a/155704.png)](https://asciinema.org/a/155704)\n\nSet:\n\n```zsh\n    zstyle :plugin:history-search-multi-word reset-prompt-protect 1\n```\n\nto be able to use `zle reset-prompt` in your e.g. `sched` calls, in presence of\n`zdharma/fast-syntax-highlighting`, `zsh-users/zsh-syntax-highlighting`,\n`zsh-users/zsh-autosuggestions` and other plugins that hook up into Zshell by\noverloading Zle widgets. You could e.g. use `sched` in following way:\n\n```zsh\nPROMPT=%B%F{yellow}%D{%H:%M:%S}%B%b%f\nschedprompt() {\n    zle \u0026\u0026 zle reset-prompt\n    sched +1 schedprompt\n}\n\nzmodload -i zsh/sched\nschedprompt\n```\n\nto refresh the clock in prompt every second. The `reset-prompt-protect` zstyle\nneeds to be set to 1 for correct cooperation with HSMW. Or, you could use `zle\n.reset-prompt` (i.e. with the dot in front) to call the original, not\noverloaded (by F-Sy-H, zsh-autosuggestsions, etc.) `reset-prompt` widget.\n\n# News\n* 14-07-2020\n  - If an `[…]` string will occur in the search query, it'll be interpreted as\n    pattern. So that it's possible to enter as the search query e.g.: `print\n    [\"a-zA-Z0-9_-]` or `print [^[:alpha:]]`, etc.\n\n* 28-10-2019\n  - `^` – if first – matches beginning of the command's string, $ – if last –\n    its end. So that it's possible to enter `'^ls'` and have only commands\n    starting with `ls` matched.\n\n* 25-05-2018\n  - Hash holding paths that shouldn't be grepped (globbed) – blacklist for slow disks, mounts, etc.:\n\n    ```zsh\n    typeset -gA FAST_BLIST_PATTERNS\n    FAST_BLIST_PATTERNS[/mount/nfs1/*]=1\n    FAST_BLIST_PATTERNS[/mount/disk2/*]=1\n    ```\n\n* 13-06-2017\n  - Canceling search doesn't clear entered query. Change to previous behavior via:\n\n    ```zsh\n    zstyle \":plugin:history-search-multi-word\" clear-on-cancel \"yes\"\n    ```\n\n* 12-04-2017\n  - Page size can be relative to screen height, e.g.:\n\n    ```zsh\n    zstyle \":history-search-multi-word\" page-size \"LINES/4\"\n    ```\n\n* 05-04-2017\n  - 17% performance optimization\n\n* 27-01-2017\n  - Input-driven case-sensivity of search – if your query contains capital latin letters, search will be case-sensitive\n\n* 12-11-2016\n  - HSMW can now show context of selected history entry! Just hit `Ctrl-K`, [video](https://asciinema.org/a/92516)\n  - More performance optimizations\n\n* 31-10-2016\n  - Newlines do not disturb the parser anymore, and are also highlighted with a dark color – [video](https://asciinema.org/a/91159)\n\n* 27-10-2016\n  - New optimizations – **30%** speed up of syntax highlighting!\n  - Architectural change – syntax highlighting is now computed rarely, so any possible performance problems are now solved, in advance!\n\n* 24-10-2016\n  - Workaround for Zsh versions like 5.0.2 has been added – **Ctrl-V** and **ESC** cancel search. On such Zsh\n    versions Ctrl-C might not work. Fully problem-free Zsh version will be the upcoming 5.3, where\n    I have together with Zsh Hackers fully fixed the Ctrl-C issue.\n\n* 22-10-2016\n  - Search process has been optimized by 20%! History sizes like 100000 are now supported.\n  - Active history entry can be `underline`, `standout` (i.e. inverse video), `bold`, `bg=blue`, etc. with\n    the new Zstyle `:plugin:history-search-multi-word / active` (see Zstyles section) – [video](https://asciinema.org/a/90214).\n\n* 16-10-2016\n  - More optimizations of syntax highlighting (40% in total for the two days) – new video above.\n\n* 15-10-2016\n  - The compact, already optimized (by me) [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) part has been further optimized by 21%!\n    Also, more tokens are highlighted – variable expressions like `\"${(@)var[1,3]}\"` (when quoted).\n\n* 11-10-2016\n  - Syntax highlighting of history – adapted, fine crafted, **small** part of [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting)\n    to color what `hsmw` shows:\n\n    ![syntax highlighting](http://imagizer.imageshack.us/a/img921/1503/bMAF59.gif)\n\n* 20-09-2016\n  - Keys Page Up and Page Down work and page-wise move along history. Also, `Ctrl-P`, `Ctrl-N`\n    move to previous and next entries.\n\n* 19-09-2016\n  - Better immunity to [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions)\n    and [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) – home,\n    end, left and right cursor keys now work smoothly.\n\n* 25-05-2016\n  - Cooperation with\n    [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions)\n    plugin\n  - Configuration option to set page size, example use:\n\n    ```zsh\n    zstyle \":history-search-multi-word\" page-size \"5\"\n    ```\n\n# Installation\n\n**The plugin is \"standalone\"**, which means that only sourcing it is needed. So to\ninstall, unpack `history-search-multi-word` somewhere and add\n\n```zsh\nsource {where-hsmw-is}/history-search-multi-word.plugin.zsh\n```\n\nto `zshrc`.\n\nIf using a plugin manager, then `Zplugin` is recommended, but you can use any\nother too, and also install with `Oh My Zsh` (by copying directory to\n`~/.oh-my-zsh/custom/plugins`).\n\n\n### [Zplugin](https://github.com/zdharma/zplugin)\n\nAdd `zplugin load zdharma/history-search-multi-word` to your `.zshrc` file.\nZplugin will handle cloning the plugin for you automatically the next time you\nstart zsh.\n\n### Antigen\n\nAdd `antigen bundle zdharma/history-search-multi-word` to your `.zshrc` file.\nAntigen will handle cloning the plugin for you automatically the next time you\nstart zsh. You can also add the plugin to a running zsh with `antigen bundle\nzdharma/history-search-multi-word` for testing before adding it to your\n`.zshrc`.\n\n### Oh-My-Zsh\n\n1. `cd ~/.oh-my-zsh/custom/plugins`\n2. `git clone git@github.com:zdharma/history-search-multi-word.git`\n3. Add `history-search-multi-word` to your plugin list\n\n### Zgen\n\nAdd `zgen load zdharma/history-search-multi-word` to your .zshrc file in the same\nplace you're doing your other `zgen load` calls in.\n\n\n### Arch Linux\n\n1. Install [`zsh-history-search-multi-word-git`](https://aur.archlinux.org/packages/zsh-history-search-multi-word-git/) from the [AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository).\n\n2. Add the following to your `.zshrc`:\n\n    ```sh\n    source /usr/share/zsh/plugins/history-search-multi-word/history-search-multi-word.plugin.zsh\n    ```\n\n3. Start a new terminal session\n\n\n# Customizing\n\n## Zstyles\n\n```zsh\nzstyle \":history-search-multi-word\" page-size \"8\"                      # Number of entries to show (default is $LINES/3)\nzstyle \":history-search-multi-word\" highlight-color \"fg=yellow,bold\"   # Color in which to highlight matched, searched text (default bg=17 on 256-color terminals)\nzstyle \":plugin:history-search-multi-word\" synhl \"yes\"                 # Whether to perform syntax highlighting (default true)\nzstyle \":plugin:history-search-multi-word\" active \"underline\"          # Effect on active history entry. Try: standout, bold, bg=blue (default underline)\nzstyle \":plugin:history-search-multi-word\" check-paths \"yes\"           # Whether to check paths for existence and mark with magenta (default true)\nzstyle \":plugin:history-search-multi-word\" clear-on-cancel \"no\"        # Whether pressing Ctrl-C or ESC should clear entered query\n```\n\n## Syntax highlighting\n\nSyntax highlighting is customized via `HSMW_HIGHLIGHT_STYLES` associative array.\nIt has keys like `reserved-word`, `alias`, `command`, `path`, etc. which are assigned\nwith strings like `fg=blue,bold`, to configure how given elements are to be\ncolored. If you assign this array before or after loading `hsmw` you will change the defaults. Complete list\nof available keys is [at the beginning](https://github.com/zdharma/history-search-multi-word/blob/master/hsmw-highlight#L34-L62)\nof `hsmw-highlight` file. Example `~/.zshrc` addition that sets `path` key –\npaths that exist will be highlighted with background magenta, foreground white, bold:\n\n```zsh\ntypeset -gA HSMW_HIGHLIGHT_STYLES\nHSMW_HIGHLIGHT_STYLES[path]=\"bg=magenta,fg=white,bold\"\n```\n\nFollowing code will enable coloring of options of form \"-o\" and \"--option\", with cyan:\n\n```zsh\ntypeset -gA HSMW_HIGHLIGHT_STYLES\nHSMW_HIGHLIGHT_STYLES[single-hyphen-option]=\"fg=cyan\"\nHSMW_HIGHLIGHT_STYLES[double-hyphen-option]=\"fg=cyan\"\n```\n\nFollowing code will use 256 colors to highlight command separators (like \";\" or \"\u0026\u0026\"):\n\n```zsh\nHSMW_HIGHLIGHT_STYLES[commandseparator]=\"fg=241,bg=17\"\n```\n\n# IRC Channel\n\nChannel `#zplugin@freenode` is a support place for all author's projects. Connect to:\n[chat.freenode.net:6697](ircs://chat.freenode.net:6697/%23zplugin) (SSL) or [chat.freenode.net:6667](irc://chat.freenode.net:6667/%23zplugin)\n and join #zplugin.\n\nFollowing is a quick access via Webchat [![IRC](https://kiwiirc.com/buttons/chat.freenode.net/zplugin.png)](https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomeok%2Fhistory-search-multi-word","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsomeok%2Fhistory-search-multi-word","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomeok%2Fhistory-search-multi-word/lists"}