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