diff options
author | Mikael Magnusson <mikachu@gmail.com> | 2015-09-06 22:25:21 +0200 |
---|---|---|
committer | Mikael Magnusson <mikachu@gmail.com> | 2015-09-27 02:28:41 +0200 |
commit | 72f7f904e8734c2ee73b77e35e60ecb86148bc60 (patch) | |
tree | 3ffa1b53e5fe68ca59dedfe356e69a7d9ded4eae /Src/Zle/iwidgets.list | |
parent | 8ab150a867ff9ab87d2efdf5cfce919614f2ddbb (diff) | |
download | zsh-mikachu/redrawhook.tar.gz zsh-mikachu/redrawhook.tar.xz zsh-mikachu/redrawhook.zip |
Add match-bracket widget that takes a position and/or parameter to store result, and does no weird vi stuff mikachu/redrawhook
I use this in my zle-line-pre-redraw hook, local -a hackcol=(red cyan) local mpos cpos off for off in 0 1; do (( cpos = CURSOR - off )) if (( cpos >= 0 )) && zle .match-bracket $cpos mpos; then region_highlight+=("$((cpos)) $((cpos+1)) bold,bg=${hackcol[2]},fg=black" "$((mpos)) $((mpos+1)) bold,bg=${hackcol[1]},fg=black") break fi done
Diffstat (limited to 'Src/Zle/iwidgets.list')
-rw-r--r-- | Src/Zle/iwidgets.list | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Src/Zle/iwidgets.list b/Src/Zle/iwidgets.list index 2b2654c5d..183d75c17 100644 --- a/Src/Zle/iwidgets.list +++ b/Src/Zle/iwidgets.list @@ -83,6 +83,7 @@ "list-choices", listchoices, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL | ZLE_ISCOMP "list-expand", listexpand, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL "magic-space", magicspace, ZLE_KEEPSUFFIX | ZLE_MENUCMP +"match-bracket", matchbracket, ZLE_KEEPSUFFIX | ZLE_MENUCMP "menu-complete", menucomplete, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_ISCOMP "menu-expand-or-complete", menuexpandorcomplete, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_ISCOMP "neg-argument", negargument, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL | ZLE_NOTCOMMAND |