From c4dcddc1cd17e7e0909471703f3526170db0f475 Mon Sep 17 00:00:00 2001 From: vladislav doster <10052309+vladdoster@users.noreply.github.com> Date: Sat, 15 Apr 2023 23:46:10 -0500 Subject: [PATCH] feat: add lint gh action workflow (#9) --- .github/workflows/lint.yml | 15 ++++++++++ CHANGELOG.md | 45 +++++++++++++----------------- README.md | 57 +++++++++++++++++--------------------- 3 files changed, 61 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..b883403 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,15 @@ +name: Lint + +on: + pull_request: + branches: [main, master] + push: + branches: [main, master] + tags: ["v*.*.*"] + workflow_dispatch: + +jobs: + commit: + uses: zdharma-continuum/.github/.github/workflows/commit-job.yml@main + lint: + uses: zdharma-continuum/.github/.github/workflows/lint-job.yml@main diff --git a/CHANGELOG.md b/CHANGELOG.md index 26dfe0f..8d1e222 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,12 @@ ## 14-07-2020 -- If an `[…]` string will occur in the search query, it'll be interpreted as pattern. So that it's - possible to enter as the search query e.g.: `print ["a-zA-Z0-9_-]` or `print [^[:alpha:]]`, etc. +- If an `[…]` string will occur in the search query, it'll be interpreted as pattern. So that it's possible to enter as + the search query e.g.: `print ["a-zA-Z0-9_-]` or `print [^[:alpha:]]`, etc. ## 28-10-2019 -- `^` – if first – matches beginning of the command's string, $ – if last – its end. So that it's - possible to enter `'^ls'` and have only commands starting with `ls` matched. +- `^` – if first – matches beginning of the command's string, $ – if last – its end. So that it's possible to enter + `'^ls'` and have only commands starting with `ls` matched. ## 25-05-2018 @@ -40,13 +40,11 @@ ## 27-01-2017 -- Input-driven case-sensivity of search – if your query contains capital latin letters, search will - be case-sensitive +- Input-driven case-sensivity of search – if your query contains capital latin letters, search will be case-sensitive ## 12-11-2016 -- HSMW can now show context of selected history entry! Just hit `Ctrl-K`, - [video](https://asciinema.org/a/92516) +- HSMW can now show context of selected history entry! Just hit `Ctrl-K`, [video](https://asciinema.org/a/92516) - More performance optimizations ## 31-10-2016 @@ -57,21 +55,20 @@ ## 27-10-2016 - New optimizations – **30%** speed up of syntax highlighting! -- Architectural change – syntax highlighting is now computed rarely, so any possible performance - problems are now solved, in advance! +- Architectural change – syntax highlighting is now computed rarely, so any possible performance problems are now + solved, in advance! ## 24-10-2016 -- Workaround for Zsh versions like 5.0.2 has been added – **Ctrl-V** and **ESC** cancel search. On - such Zsh versions Ctrl-C might not work. Fully problem-free Zsh version will be the upcoming 5.3, - where I have together with Zsh Hackers fully fixed the Ctrl-C issue. +- Workaround for Zsh versions like 5.0.2 has been added – **Ctrl-V** and **ESC** cancel search. On such Zsh versions + Ctrl-C might not work. Fully problem-free Zsh version will be the upcoming 5.3, where I have together with Zsh Hackers + fully fixed the Ctrl-C issue. ## 22-10-2016 - Search process has been optimized by 20%! History sizes like 100000 are now supported. -- Active history entry can be `underline`, `standout` (i.e. inverse video), `bold`, `bg=blue`, etc. - with the new Zstyle `:plugin:history-search-multi-word / active` (see Zstyles section) – - [video](https://asciinema.org/a/90214). +- Active history entry can be `underline`, `standout` (i.e. inverse video), `bold`, `bg=blue`, etc. with the new Zstyle + `:plugin:history-search-multi-word / active` (see Zstyles section) – [video](https://asciinema.org/a/90214). ## 16-10-2016 @@ -79,29 +76,27 @@ ## 15-10-2016 -- The compact, already optimized (by me) - [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) part has been - further optimized by 21%! Also, more tokens are highlighted – variable expressions like +- The compact, already optimized (by me) [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) + part has been further optimized by 21%! Also, more tokens are highlighted – variable expressions like `"${(@)var[1,3]}"` (when quoted). ## 11-10-2016 - Syntax highlighting of history – adapted, fine crafted, **small** part of - [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) to color what - `hsmw` shows: + [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) to color what `hsmw` shows: ![syntax highlighting](http://imagizer.imageshack.us/a/img921/1503/bMAF59.gif) ## 20-09-2016 -- Keys Page Up and Page Down work and page-wise move along history. Also, `Ctrl-P`, `Ctrl-N` move to - previous and next entries. +- Keys Page Up and Page Down work and page-wise move along history. Also, `Ctrl-P`, `Ctrl-N` move to previous and next + entries. ## 19-09-2016 - Better immunity to [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) and - [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) – home, end, left - and right cursor keys now work smoothly. + [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) – home, end, left and right cursor + keys now work smoothly. ## 25-05-2016 diff --git a/README.md b/README.md index 96b5bab..bf69fc5 100644 --- a/README.md +++ b/README.md @@ -3,16 +3,15 @@ [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Gitter](https://img.shields.io/gitter/room/zdharma-continuum/zinit.svg?style=flat-square)](https://gitter.im/zdharma-continuum/zinit) -Binds `Ctrl-R` to a widget that searches for multiple keywords in an `AND` fashion. In other words, you -can enter multiple words, and history entries that match all of them are returned. Additionally, search matches are syntax highlighted. +Binds `Ctrl-R` to a widget that searches for multiple keywords in an `AND` fashion. In other words, you can enter +multiple words, and history entries that match all of them are returned. Additionally, search matches are syntax +highlighted. -Video – view on [asciinema](https://asciinema.org/a/88954). You can resize the video by pressing -`Ctrl-+` or `Cmd-+`. +Video – view on [asciinema](https://asciinema.org/a/88954). You can resize the video by pressing `Ctrl-+` or `Cmd-+`. [![asciicast](https://asciinema.org/a/88954.png)](https://asciinema.org/a/88954) -HSMW has a feature called **context viewing** – see all occurrences of a command together with -surrounding commands: +HSMW has a feature called **context viewing** – see all occurrences of a command together with surrounding commands: [![asciicast](https://asciinema.org/a/155704.png)](https://asciinema.org/a/155704) @@ -22,9 +21,9 @@ Set: zstyle :plugin:history-search-multi-word reset-prompt-protect 1 ``` -In order to use `zle reset-prompt` in function calls (e.g. `sched`) in addition to plugins that hook up into Zshell by overloading Zle -widgets (e.g., `fast-syntax-highlighting`, `zsh-syntax-highlighting`, -`zsh-autosuggestions`), use `sched` : +In order to use `zle reset-prompt` in function calls (e.g. `sched`) in addition to plugins that hook up into Zshell by +overloading Zle widgets (e.g., `fast-syntax-highlighting`, `zsh-syntax-highlighting`, `zsh-autosuggestions`), use +`sched` : ```bash PROMPT=%B%F{yellow}%D{%H:%M:%S}%B%b%f @@ -37,23 +36,22 @@ zmodload -i zsh/sched schedprompt ``` -To refresh the clock in prompt every second. The `reset-prompt-protect` zstyle should be `1` -for proper cooperation with HSMW. Or, you could use `zle .reset-prompt` (i.e., with the dot in -front) to call the original, not overloaded (e.g., F-Sy-H, zsh-autosuggestions, etc.) `reset-prompt` widget. +To refresh the clock in prompt every second. The `reset-prompt-protect` zstyle should be `1` for proper cooperation with +HSMW. Or, you could use `zle .reset-prompt` (i.e., with the dot in front) to call the original, not overloaded (e.g., +F-Sy-H, zsh-autosuggestions, etc.) `reset-prompt` widget. ## Installation The plugin is **plugin manager agnostic**. -To install, clone the `history-search-multi-word` repository and add the following snippet to your -`.zshrc` +To install, clone the `history-search-multi-word` repository and add the following snippet to your `.zshrc` ```bash source /history-search-multi-word.plugin.zsh ``` -If using a plugin manager, then `Zinit` is recommended, but you can use any other too, and also -install with `Oh My Zsh` (by copying the directory to `~/.oh-my-zsh/custom/plugins`). +If using a plugin manager, then `Zinit` is recommended, but you can use any other too, and also install with `Oh My Zsh` +(by copying the directory to `~/.oh-my-zsh/custom/plugins`). ### [Zinit](https://github.com/zdharma-continuum/zinit) @@ -67,10 +65,9 @@ Zinit will automatically handle cloning the plugin for you the next time you sta ### Antigen -Add `antigen bundle zdharma-continuum/history-search-multi-word` to your `.zshrc` file. Antigen will -automatically handle cloning the plugin for you the next time you start zsh. You can also add the -plugin to a running zsh with `antigen bundle zdharma-continuum/history-search-multi-word` for -testing before adding it to your `.zshrc`. +Add `antigen bundle zdharma-continuum/history-search-multi-word` to your `.zshrc` file. Antigen will automatically +handle cloning the plugin for you the next time you start zsh. You can also add the plugin to a running zsh with +`antigen bundle zdharma-continuum/history-search-multi-word` for testing before adding it to your `.zshrc`. ### Oh-My-Zsh @@ -84,8 +81,7 @@ testing before adding it to your `.zshrc`. zgen load zdharma-continuum/history-search-multi-word ``` -to your .zshrc file in the same place -you're doing your other `zgen load` calls in. +to your .zshrc file in the same place you're doing your other `zgen load` calls in. ### [Sheldon](https://github.com/rossmacarthur/sheldon) @@ -103,8 +99,7 @@ bindkey "^R" history-search-multi-word ### Arch Linux -1. Install - [`zsh-history-search-multi-word-git`](https://aur.archlinux.org/packages/zsh-history-search-multi-word-git/) +1. 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). 1. Add the following to your `.zshrc` @@ -128,13 +123,13 @@ zstyle ":plugin:history-search-multi-word" synhl "yes" # Whether t ### Syntax highlighting -Syntax highlighting is customized via `HSMW_HIGHLIGHT_STYLES` associative array. It has keys like -`reserved-word`, `alias`, `command`, `path`, etc., which are assigned with strings like -`fg=blue,bold` to configure how given elements are to be colored. If you assign this array before -or after loading `hsmw`, you will change the defaults. The complete list of available keys is -[at the beginning](https://github.com/zdharma-continuum/history-search-multi-word/blob/master/hsmw-highlight#L34-L62) -of `hsmw-highlight` file. Example `~/.zshrc` addition that sets `path` key – paths that exist will -be highlighted with background magenta, foreground white, bold: +Syntax highlighting is customized via `HSMW_HIGHLIGHT_STYLES` associative array. It has keys like `reserved-word`, +`alias`, `command`, `path`, etc., which are assigned with strings like `fg=blue,bold` to configure how given elements +are to be colored. If you assign this array before or after loading `hsmw`, you will change the defaults. The complete +list of available keys is +[at the beginning](https://github.com/zdharma-continuum/history-search-multi-word/blob/master/hsmw-highlight#L34-L62) of +`hsmw-highlight` file. Example `~/.zshrc` addition that sets `path` key – paths that exist will be highlighted with +background magenta, foreground white, bold: ```bash typeset -gA HSMW_HIGHLIGHT_STYLES