creton32 5 months ago
parent
commit
c7245e346a
  1. 18
      .gitmodules
  2. 2
      audio/.config/alsa/asoundrc
  3. 8
      audio/.config/mpd/mpd.conf
  4. 6
      audio/.config/ncmpcpp/bindings
  5. 2
      audio/.config/ncmpcpp/config
  6. 27
      bin/.local/bin/al
  7. 22
      bin/.local/bin/ro
  8. 17
      bin/.local/bin/wt
  9. 2
      browser/.config/tridactyl/tridactylrc
  10. BIN
      browser/.mozilla/firefox/profile/bookmarks.html
  11. 3
      browser/.mozilla/firefox/profile/chrome/userChrome/tab.css
  12. 19
      desktop/.config/polybar/config.ini
  13. 4
      input/.config/sxhkd/sxhkdrc
  14. BIN
      reader/.config/newsboat/urls
  15. 375
      term/.config/zsh/plugins/zsh-interactive-cd/LICENSE
  16. 15
      term/.config/zsh/plugins/zsh-interactive-cd/README.md
  17. BIN
      term/.config/zsh/plugins/zsh-interactive-cd/demo.gif
  18. 168
      term/.config/zsh/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh
  19. 15
      term/.config/zsh/plugins/zsh-syntax-highlighting/.editorconfig
  20. 1
      term/.config/zsh/plugins/zsh-syntax-highlighting/.gitattributes
  21. 3
      term/.config/zsh/plugins/zsh-syntax-highlighting/.gitignore
  22. 1
      term/.config/zsh/plugins/zsh-syntax-highlighting/.revision-hash
  23. 55
      term/.config/zsh/plugins/zsh-syntax-highlighting/.travis.yml
  24. 1
      term/.config/zsh/plugins/zsh-syntax-highlighting/.version
  25. 23
      term/.config/zsh/plugins/zsh-syntax-highlighting/COPYING.md
  26. 83
      term/.config/zsh/plugins/zsh-syntax-highlighting/HACKING.md
  27. 127
      term/.config/zsh/plugins/zsh-syntax-highlighting/INSTALL.md
  28. 64
      term/.config/zsh/plugins/zsh-syntax-highlighting/Makefile
  29. 85
      term/.config/zsh/plugins/zsh-syntax-highlighting/README.md
  30. 765
      term/.config/zsh/plugins/zsh-syntax-highlighting/changelog.md
  31. 115
      term/.config/zsh/plugins/zsh-syntax-highlighting/docs/highlighters.md
  32. 31
      term/.config/zsh/plugins/zsh-syntax-highlighting/docs/highlighters/brackets.md
  33. 24
      term/.config/zsh/plugins/zsh-syntax-highlighting/docs/highlighters/cursor.md
  34. 24
      term/.config/zsh/plugins/zsh-syntax-highlighting/docs/highlighters/line.md
  35. 120
      term/.config/zsh/plugins/zsh-syntax-highlighting/docs/highlighters/main.md
  36. 24
      term/.config/zsh/plugins/zsh-syntax-highlighting/docs/highlighters/pattern.md
  37. 30
      term/.config/zsh/plugins/zsh-syntax-highlighting/docs/highlighters/regexp.md
  38. 25
      term/.config/zsh/plugins/zsh-syntax-highlighting/docs/highlighters/root.md
  39. 8
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/README.md
  40. 1
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/README.md
  41. 106
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/brackets-highlighter.zsh
  42. 36
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/test-data/cursor-matchingbracket-line-finish.zsh
  43. 47
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/test-data/cursor-matchingbracket.zsh
  44. 33
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/test-data/empty-styles.zsh
  45. 53
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/test-data/loop-styles.zsh
  46. 42
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/test-data/mismatch-patentheses.zsh
  47. 42
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/test-data/near-quotes.zsh
  48. 45
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/test-data/nested-parentheses.zsh
  49. 34
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/test-data/only-error.zsh
  50. 34
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/test-data/quoted-patentheses.zsh
  51. 42
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/test-data/simple-parentheses.zsh
  52. 41
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/test-data/unclosed-patentheses.zsh
  53. 40
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/brackets/test-data/unclosed-patentheses2.zsh
  54. 1
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/cursor/README.md
  55. 47
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/cursor/cursor-highlighter.zsh
  56. 1
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/line/README.md
  57. 44
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/line/line-highlighter.zsh
  58. 1
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/README.md
  59. 1711
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/main-highlighter.zsh
  60. 35
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/abspath-in-command-position1.zsh
  61. 36
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/abspath-in-command-position1b.zsh
  62. 35
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/abspath-in-command-position2.zsh
  63. 37
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/abspath-in-command-position3.zsh
  64. 38
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/abspath-in-command-position3b.zsh
  65. 35
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/abspath-in-command-position4.zsh
  66. 35
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/abspath-in-command-position5.zsh
  67. 38
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-assignment1.zsh
  68. 35
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-basic.zsh
  69. 37
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-command-substitution.zsh
  70. 37
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-comment1.zsh
  71. 37
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-comment2.zsh
  72. 38
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-complex.zsh
  73. 38
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-empty.zsh
  74. 36
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-eponymous1.zsh
  75. 36
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-eponymous2.zsh
  76. 43
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-in-cmdsubst.zsh
  77. 44
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-loop.zsh
  78. 35
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-loop2.zsh
  79. 43
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-nested-precommand.zsh
  80. 40
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-nested.zsh
  81. 38
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-parameter.zsh
  82. 42
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-precommand-option-argument1.zsh
  83. 42
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-precommand-option-argument2.zsh
  84. 42
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-precommand-option-argument3.zsh
  85. 42
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-precommand-option-argument4.zsh
  86. 39
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-quoted.zsh
  87. 38
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-redirect.zsh
  88. 38
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-self.zsh
  89. 36
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-to-dir.zsh
  90. 37
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-to-dir1b.zsh
  91. 37
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-unknown-token1.zsh
  92. 37
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias-unknown-token2.zsh
  93. 53
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/alias.zsh
  94. 41
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/always1.zsh
  95. 43
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/always2.zsh
  96. 43
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/always3.zsh
  97. 44
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/anonymous-function.zsh
  98. 35
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/arg0-colon.zsh
  99. 46
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/arith-cmdsubst-mess.zsh
  100. 37
      term/.config/zsh/plugins/zsh-syntax-highlighting/highlighters/main/test-data/arith1.zsh

18
.gitmodules

@ -1,18 +0,0 @@
[submodule "zsh/.config/zsh/themes/common"]
path = zsh/.config/zsh/themes/common
url = https://github.com/jackharrisonsherlock/common
branch = master
[submodule "zsh/.config/zsh/plugins/zsh-syntax-highlighting"]
path = zsh/.config/zsh/plugins/zsh-syntax-highlighting
url = https://github.com/zsh-users/zsh-syntax-highlighting
branch = master
[submodule "zsh/.config/zsh/plugins/zsh-you-should-use"]
path = zsh/.config/zsh/plugins/zsh-you-should-use
url = https://github.com/michaelaquilina/zsh-you-should-use
branch = master
[submodule "tmux/.config/tmux/plugins/tmux-current-pane-hostname"]
path = tmux/.config/tmux/plugins/tmux-current-pane-hostname
url = https://github.com/soyuka/tmux-current-pane-hostname
[submodule "zsh/.config/zsh/plugins/zsh-interactive-cd"]
path = zsh/.config/zsh/plugins/zsh-interactive-cd
url = https://github.com/changyuheng/zsh-interactive-cd

2
audio/.config/alsa/asoundrc

@ -17,7 +17,7 @@ ctl.!default {
strings [ "ctl."
{ @func getenv
vars [ ALSA_DEFAULT_CTL ]
default "secondary"
default secondary
}
]
}

8
audio/.config/mpd/mpd.conf

@ -21,10 +21,10 @@ state_file "~/.local/share/mpd/state"
sticker_file "~/.local/share/mpd/sticker.sql"
# Audio output
#audio_output {
# type "alsa"
# name "default"
#}
audio_output {
type "alsa"
name "default"
}
audio_output {
type "alsa"

6
audio/.config/ncmpcpp/bindings

@ -14,3 +14,9 @@ def_key "s"
shuffle
def_key "p"
add_item_to_playlist
def_key "d"
delete_playlist_items
def_key "d"
delete_browser_items
def_key "d"
delete_stored_playlist

2
audio/.config/ncmpcpp/config

@ -77,7 +77,7 @@ state_flags_color = blue
active_window_border = blue
lines_scrolled = 2
allow_for_physical_item_deletion = no
allow_for_physical_item_deletion = yes
screen_switcher_mode = playlist, browser
execute_on_song_change = "~/.config/ncmpcpp/art"

27
bin/.local/bin/al

@ -139,43 +139,56 @@ in_src() {
mic_volume="$(amixer sget 'Headset Mic Boost' | awk -F ":" 'END{print $2}' | awk '{print $2}' | tr -d '[]')"
mic_level="$(amixer sget 'Headset Mic Boost' | awk -F ":" 'END{print $2}' | cut -c2)"
cap_volume="$(amixer sget 'Capture' | awk -F ":" 'END{print $2}' | awk '{print $3}' | tr -d '[]')"
# Externall sound card with i/o aux
# External sound card with i/o aux
elif amixer -q sget 'Mic' 2>/dev/null; then
mic_volume="$(amixer sget Mic | awk -F'[][]' 'END{print $2}' )"
fi
case "$2" in
--vol-up)
if [ "$(amixer -c0 cget name='Capture Source' | awk -F '=' 'END{print $2}')" -eq 0 ]; then
if [ "$(amixer -q cget name='Capture Source' | awk -F '=' 'END{print $2}')" -eq 0 ]; then
case "$mic_level" in
0) amixer sset 'Headset Mic Boost' 1 >/dev/null ;;
1) amixer sset 'Headset Mic Boost' 2 >/dev/null ;;
2) amixer sset 'Headset Mic Boost' 3 >/dev/null ;;
esac
elif amixer -q sget 'Mic' 2>/dev/null; then
amixer sset 'Mic' 5%+
else
amixer sset 'Capture' 5%+
fi
;;
--vol-down)
if [ "$(amixer -c0 cget name='Capture Source' | awk -F '=' 'END{print $2}')" -eq 0 ]; then
if [ "$(amixer cget name='Capture Source' | awk -F '=' 'END{print $2}')" -eq 0 ]; then
case "$mic_level" in
3) amixer sset 'Headset Mic Boost' 2 >/dev/null ;;
2) amixer sset 'Headset Mic Boost' 1 >/dev/null ;;
1) amixer sset 'Headset Mic Boost' 0 >/dev/null ;;
esac
elif amixer -q sget 'Mic' 2>/dev/null; then
amixer sset 'Mic' 5%-
else
amixer sset 'Capture' 5%-
fi
;;
--toggle)
if [ "$(amixer -c0 cget name='Capture Source' | awk -F '=' 'END{print $2}')" -eq 0 ]; then
amixer -c0 cset name='Capture Source' 'Internal Mic' >/dev/null
if [ "$(amixer cget name='Capture Source' | awk -F '=' 'END{print $2}')" -eq 0 ]; then
amixer cset name='Capture Source' 'Internal Mic' >/dev/null
else
amixer -c0 cset name='Capture Source' 'Headset Mic' >/dev/null
amixer cset name='Capture Source' 'Headset Mic' >/dev/null
fi
;;
--mute)
if [ "$(amixer cget name='Capture Source' | awk -F '=' 'END{print $2}')" -eq 1 ]; then
amixer cset name='Capture Switch' toggle
elif [ "$(amixer cget name='Capture Source' | awk -F '=' 'END{print $2}')" -eq 0 ]; then
amixer cset name='Headset Mic Playback Switch' toggle
elif amixer -q sget 'Mic' 2>/dev/null; then
amixer sset 'Mic' toggle
fi
;;
*)
if [ "$(amixer -c0 cget name='Capture Source' | awk -F '=' 'END{print $2}')" -eq 0 ]; then
if amixer -q sget 'Mic' 2>/dev/null || [ "$(amixer cget name='Capture Source' | awk -F '=' 'END{print $2}')" -eq 0 ]; then
echo "%{T3}%{T-} %{T4}$mic_volume%{T-}"
else
echo "%{T3}%{T-} %{T4}$cap_volume%{T-}"

22
bin/.local/bin/ro

@ -7,6 +7,28 @@ binds_help() {
rofi -dmenu -i -markup-rows -no-show-icons -width 1000 -lines 15 -yoffset 40
}
tmux_sessions() {
active_sessions="$(tmux list-session -F '#S')"
selected_session="$(printf '%s\n' $active_sessions | rofi -dmenu -p "Select tmux session: ")"
is_active_session=true
n_sessions=$(printf '%s\n' $active_sessions | wc -l)
counter=0
for session in $active_sessions; do
if [ "$selected_session" != "$session" ]; then
counter=$((counter + 1))
fi
done
if [ "$n_sessions" -eq "$counter" ]; then
rofi-sensible-terminal -e tmux new-session -s "$selected_session" &
elif [ -z "$selected_session" ]; then
echo "Cancel"
else
rofi-sensible-terminal -e tmux attach -t "$selected_session"
fi
}
case "$1" in
-sxhkd) binds_help ;;
--tmux) tmux_sessions ;;
esac

17
bin/.local/bin/wt

@ -0,0 +1,17 @@
#!/bin/sh
get_location() {
# Use Mozilla's geolocation API to get more precise location
location=$(curl -sf "https://location.services.mozilla.com/v1/geolocate?key=geoclue" | jq .location)
lat="$(echo $location | jq .lat)"
lng="$(echo $location | jq .lng)"
# wttr.in to get the current weather
# v2 API only supports terminal use for the moment
weather=$(curl -s "v2d.wttr.in/$lat,$lng?format=%c%t\n")
echo "$weather"
}
case "$1" in
--get) get_location ;;
esac

2
browser/.config/tridactyl/tridactylrc

@ -13,7 +13,7 @@ command source_rc composite fillcmdline_tmp 1000 \
"
" Autocmds
"
au BeforeRequest https://www.reddit.com/* (details) => { \
au BeforeRequest https://*.reddit.com/* (details) => { \
let url = new URL(details.url); \
url.hostname = "teddit.net"; \
return { redirectUrl: url + "" }; \

BIN
browser/.mozilla/firefox/profile/bookmarks.html

Binary file not shown.

3
browser/.mozilla/firefox/profile/chrome/userChrome/tab.css

@ -70,11 +70,10 @@
background: var(--secondary-bg) !important;
border-radius: 40px;
}
/* TODO: find out how to display icon on different color when there's only one tab opened */
.tabbrowser-tab[first-visible-tab="true"][last-visible-tab="true"] .tab-icon-image,
.tabbrowser-tab[first-visible-tab="true"][last-visible-tab="true"] .tab-icon-pending,
.tabbrowser-tab[first-visible-tab="true"][last-visible-tab="true"] .tab-icon-sound,
.tabbrowser-tab[selected="true"] .tab-throbber
.tabbrowser-tab[first-visible-tab="true"][last-visible-tab="true"] .tab-throbber
{
fill: var(--main-fg) !important;
}

19
desktop/.config/polybar/config.ini

@ -40,9 +40,10 @@ font-2 = "Iosevka Nerd Font:size=7.5;2"
font-3 = "Iosevka Custom:size=8;2"
font-4 = "icomoon:size=13;3"
font-5 = "icomoon:size=10;3"
font-6 = "Twemoji"
modules-left = acc-start launcher acc-right bspwm title end start-float mpd end
modules-right = start input alsa_toggle vpn alsa_input bluetooth wm_preset mail pkgs end-float start volume battery xkeyboard network date acc-left powermenu acc-end
modules-right = start input alsa_toggle vpn audio_input bluetooth wm_preset mail pkgs weather end-float start volume battery xkeyboard network date acc-left powermenu acc-end
spacing = 0
dim-value = 1.0
@ -207,7 +208,7 @@ format-online-background = ${color.bground}
format-online-foreground = ${color.fground}
format-online-padding = 1
format-online-font = 2
format-online = "<icon-prev> <icon-seekb> <toggle> <icon-seekf> <icon-next> <icon-stop> <icon-single> <icon-repeat> <label-song> <label-time> <bar-progress>"
format-online = "<icon-prev> <icon-seekb> <toggle> <icon-seekf> <icon-next> <icon-stop> <icon-single> <icon-repeat> <label-song> <label-time> %{A4:playerctl position 15+:}%{A5:playerctl position 15-:}<bar-progress>%{A}%{A}"
label-song = "%artist:0:10:...% - %title:0:10:...%"
label-song-maxlen = 50
label-song-ellipsis = true
@ -287,10 +288,11 @@ format-foreground = ${color.fground}
format-padding = 1
interval = 1
[module/alsa_input]
[module/audio_input]
type = custom/script
exec = al -in --get
click-left = al -in --toggle
click-right = al -in --mute
scroll-up = al -in --vol-up
scroll-down = al -in --vol-down
label = %output%
@ -423,6 +425,15 @@ animation-discharging-9 = 
animation-discharging-10 =
animation-discharging-framerate = 750
[module/weather]
type = custom/script
exec = wt --get
label = %output%
format-background = ${color.bground}
format-foreground = ${color.fground}
format-padding = 1
format-font = 4
[module/date]
type = internal/date
interval = 1.0
@ -488,7 +499,7 @@ format-disconnected-padding = 1
label-connected = "%{A1:iwctl_reconnect disconnect:}%essid%%{A}"
label-connected-font = 4
label-disconnected = "%{A1:iwctl_reconnect connect:}睊 Disconnected%{A}"
label-disconnected = "%{A1:iwctl_reconnect connect:}睊%{A}"
label-disconnected-font = 4
ramp-signal-0 =

4
input/.config/sxhkd/sxhkdrc

@ -7,8 +7,8 @@ super + {space,backslash}
rofi -show {drun,file-browser -file-browser-dir ~/documents/books}
# Browser
super + {_,shift +}u
{_,ALSA_DEVICE=7} firefox
super + u
firefox
# Make sxhkd reload its configuration files
super + r

BIN
reader/.config/newsboat/urls

Binary file not shown.

375
term/.config/zsh/plugins/zsh-interactive-cd/LICENSE

@ -1,375 +0,0 @@
Copyright 2017-2018 Henry Chang
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

15
term/.config/zsh/plugins/zsh-interactive-cd/README.md

@ -1,15 +0,0 @@
# zsh-interactive-cd
## Demo
![demo](demo.gif)
## Installation
1. Install [fzf](https://github.com/junegunn/fzf) by following its [installation instruction](https://github.com/junegunn/fzf#installation).
2. Source `zsh-interactive-cd.plugin.zsh` in `.zshrc`.
## Usage
Press tab for completion as usual, it'll launch fzf automatically. Check fzf’s [readme](https://github.com/junegunn/fzf#search-syntax) for more search syntax usage.

BIN
term/.config/zsh/plugins/zsh-interactive-cd/demo.gif

Binary file not shown.

Before

Width: 800  |  Height: 489  |  Size: 1.4 MiB

168
term/.config/zsh/plugins/zsh-interactive-cd/zsh-interactive-cd.plugin.zsh

@ -1,168 +0,0 @@
#!/usr/bin/env zsh
#
# Copyright 2017-2018 Henry Chang
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
__zic_fzf_prog() {
[ -n "$TMUX_PANE" ] && [ "${FZF_TMUX:-0}" != 0 ] && [ ${LINES:-40} -gt 15 ] \
&& echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf"
}
__zic_matched_subdir_list() {
local dir length seg starts_with_dir
if [[ "$1" == */ ]]; then
dir="$1"
if [[ "$dir" != / ]]; then
dir="${dir: : -1}"
fi
length=$(echo -n "$dir" | wc -c)
if [ "$dir" = "/" ]; then
length=0
fi
find -L "$dir" -mindepth 1 -maxdepth 1 -type d 2>/dev/null \
| cut -b $(( ${length} + 2 ))- | command sed '/^$/d' | while read -r line; do
if [[ "${line[1]}" == "." ]]; then
continue
fi
echo "$line"
done
else
dir=$(dirname -- "$1")
length=$(echo -n "$dir" | wc -c)
if [ "$dir" = "/" ]; then
length=0
fi
seg=$(basename -- "$1")
starts_with_dir=$( \
find -L "$dir" -mindepth 1 -maxdepth 1 -type d \
2>/dev/null | cut -b $(( ${length} + 2 ))- | command sed '/^$/d' \
| while read -r line; do
if [[ "${seg[1]}" != "." && "${line[1]}" == "." ]]; then
continue
fi
if [[ "$line" == "$seg"* ]]; then
echo "$line"
fi
done
)
if [ -n "$starts_with_dir" ]; then
echo "$starts_with_dir"
else
find -L "$dir" -mindepth 1 -maxdepth 1 -type d \
2>/dev/null | cut -b $(( ${length} + 2 ))- | command sed '/^$/d' \
| while read -r line; do
if [[ "${seg[1]}" != "." && "${line[1]}" == "." ]]; then
continue
fi
if [[ "$line" == *"$seg"* ]]; then
echo "$line"
fi
done
fi
fi
}
__zic_fzf_bindings() {
autoload is-at-least
fzf=$(__zic_fzf_prog)
if $(is-at-least '0.21.0' $(${fzf} --version)); then
echo 'shift-tab:up,tab:down,bspace:backward-delete-char/eof'
else
echo 'shift-tab:up,tab:down'
fi
}
_zic_list_generator() {
__zic_matched_subdir_list "${(Q)@[-1]}" | sort
}
_zic_complete() {
setopt localoptions nonomatch
local l matches fzf tokens base
l=$(_zic_list_generator $@)
if [ -z "$l" ]; then
zle ${__zic_default_completion:-expand-or-complete}
return
fi
fzf=$(__zic_fzf_prog)
fzf_bindings=$(__zic_fzf_bindings)
if [ $(echo $l | wc -l) -eq 1 ]; then
matches=${(q)l}
else
matches=$(echo $l \
| FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} \
--reverse $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS \
--bind '${fzf_bindings}'" ${=fzf} \
| while read -r item; do
echo -n "${(q)item} "
done)
fi
matches=${matches% }
if [ -n "$matches" ]; then
tokens=(${(z)LBUFFER})
base="${(Q)@[-1]}"
if [[ "$base" != */ ]]; then
if [[ "$base" == */* ]]; then
base="$(dirname -- "$base")"
if [[ ${base[-1]} != / ]]; then
base="$base/"
fi
else
base=""
fi
fi
LBUFFER="${tokens[1]} "
if [ -n "$base" ]; then
base="${(q)base}"
if [ "${tokens[2][1]}" = "~" ]; then
base="${base/#$HOME/~}"
fi
LBUFFER="${LBUFFER}${base}"
fi
LBUFFER="${LBUFFER}${matches}/"
fi
zle redisplay
typeset -f zle-line-init >/dev/null && zle zle-line-init
}
zic-completion() {
setopt localoptions noshwordsplit noksh_arrays noposixbuiltins
local tokens cmd
tokens=(${(z)LBUFFER})
cmd=${tokens[1]}
if [[ "$LBUFFER" =~ "^\ *cd$" ]]; then
zle ${__zic_default_completion:-expand-or-complete}
elif [ "$cmd" = cd ]; then
_zic_complete ${tokens[2,${#tokens}]/#\~/$HOME}
else
zle ${__zic_default_completion:-expand-or-complete}
fi
}
[ -z "$__zic_default_completion" ] && {
binding=$(bindkey '^I')
# $binding[(s: :w)2]
# The command substitution and following word splitting to determine the
# default zle widget for ^I formerly only works if the IFS parameter contains
# a space via $binding[(w)2]. Now it specifically splits at spaces, regardless
# of IFS.
[[ $binding =~ 'undefined-key' ]] || __zic_default_completion=$binding[(s: :w)2]
unset binding
}
zle -N zic-completion
if [ -z $zic_custom_binding ]; then
zic_custom_binding='^I'
fi
bindkey "${zic_custom_binding}" zic-completion

15
term/.config/zsh/plugins/zsh-syntax-highlighting/.editorconfig

@ -1,15 +0,0 @@
# Top-most editorconfig file
root = true
[*]
end_of_line = lf
tab_width = 2
indent_size = 2
indent_style = space
[Makefile]
tab_width = 8
indent_size = 8
indent_style = tab

1
term/.config/zsh/plugins/zsh-syntax-highlighting/.gitattributes

@ -1 +0,0 @@
.revision-hash export-subst

3
term/.config/zsh/plugins/zsh-syntax-highlighting/.gitignore

@ -1,3 +0,0 @@
*.zwc*
.pc/
docs/all.md

1
term/.config/zsh/plugins/zsh-syntax-highlighting/.revision-hash

@ -1 +0,0 @@
$Format:%H$

55
term/.config/zsh/plugins/zsh-syntax-highlighting/.travis.yml

@ -1,55 +0,0 @@
language: generic
sudo: required
env:
- ZSH=master
- ZSH=5.7.1
- ZSH=5.7
- ZSH=5.6.2
- ZSH=5.6.1
- ZSH=5.6
- ZSH=5.5.1
- ZSH=5.5
- ZSH=5.4.2
- ZSH=5.4.1
- ZSH=5.4
- ZSH=5.3.1
- ZSH=5.3
- ZSH=5.2
- ZSH=5.1.1
- ZSH=5.1
- ZSH=5.0.8
- ZSH=5.0.7
- ZSH=5.0.6
- ZSH=5.0.5
- ZSH=5.0.4
- ZSH=5.0.3
- ZSH=5.0.2
- ZSH=5.0.1
- ZSH=5.0.0
- ZSH=4.3.17
- ZSH=4.3.16
- ZSH=4.3.15
- ZSH=4.3.14
- ZSH=4.3.13
- ZSH=4.3.12
- ZSH=4.3.11
script: docker run -v $PWD:/work -w /work zshusers/zsh:${ZSH} /bin/sh -c 'install_packages make procps bsdmainutils && make test'
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/367e241cdea60cb2070b
on_success: change
on_failure: always
on_start: never
irc:
channels:
- "chat.freenode.net#zsh-syntax-highlighting"
on_success: change
on_failure: always
on_start: never
use_notice: true
template:
- "%{repository}/%{branch}#%{build_number}: %{message} Changes : %{compare_url} | Build : %{build_url}"

1
term/.config/zsh/plugins/zsh-syntax-highlighting/.version

@ -1 +0,0 @@
0.7.2-dev

23
term/.config/zsh/plugins/zsh-syntax-highlighting/COPYING.md

@ -1,23 +0,0 @@
Copyright (c) 2010-2020 zsh-syntax-highlighting contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
may be used to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

83
term/.config/zsh/plugins/zsh-syntax-highlighting/HACKING.md

@ -1,83 +0,0 @@
Hacking on zsh-syntax-highlighting itself
=========================================
This document includes information for people working on z-sy-h itself: on the
core driver (`zsh-syntax-highlighting.zsh`), on the highlighters in the
distribution, and on the test suite. It does not target third-party
highlighter authors (although they may find it an interesting read).
The `main` highlighter
----------------------
The following function `pz` is useful when working on the `main` highlighting:
```zsh
pq() {
(( $#argv )) || return 0
print -r -l -- ${(qqqq)argv}
}
pz() {
local arg
for arg; do
pq ${(z)arg}
done
}
```
It prints, for each argument, its token breakdown, similar to how the main
loop of the `main` highlighter sees it.
Testing the `brackets` highlighter
----------------------------------
Since the test harness empties `ZSH_HIGHLIGHT_STYLES` and the `brackets`
highlighter interrogates `ZSH_HIGHLIGHT_STYLES` to determine how to highlight,
tests must set the `bracket-level-#` keys themselves. For example:
```zsh
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
BUFFER='echo ({x})'
expected_region_highlight=(
"6 6 bracket-level-1" # (
"7 7 bracket-level-2" # {
"9 9 bracket-level-2" # }
"10 10 bracket-level-1" # )
)
```
Testing the `pattern` and `regexp` highlighters
-----------------------------------------------
Because the `pattern` and `regexp` highlighters modifies `region_highlight`
directly instead of using `_zsh_highlight_add_highlight`, the test harness
cannot get the `ZSH_HIGHLIGHT_STYLES` keys. Therefore, when writing tests, use
the style itself as third word (cf. the
[documentation for `expected_region_highlight`](docs/highlighters.md)). For example:
```zsh
ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
BUFFER='rm -rf /'
expected_region_highlight=(
"1 8 fg=white,bold,bg=red" # rm -rf /
)
```
Miscellany
----------
If you work on the driver (`zsh-syntax-highlighting.zsh`), you may find the following zstyle useful:
```zsh
zstyle ':completion:*:*:*:*:globbed-files' ignored-patterns {'*/',}zsh-syntax-highlighting.plugin.zsh
```
IRC channel
-----------
We're on #zsh-syntax-highlighting on freenode.

127
term/.config/zsh/plugins/zsh-syntax-highlighting/INSTALL.md

@ -1,127 +0,0 @@
How to install
--------------
### Using packages
* Arch Linux: [community/zsh-syntax-highlighting][arch-package] / [AUR/zsh-syntax-highlighting-git][AUR-package]
* Debian: `zsh-syntax-highlighting` package [in `stretch`][debian-package] (or in [OBS repository][obs-repository])
* Fedora: [zsh-syntax-highlighting package][fedora-package-alt] in Fedora 24+ (or in [OBS repository][obs-repository])
* FreeBSD: `pkg install zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][freebsd-port])
* Gentoo: [mv overlay][gentoo-overlay]
* Mac OS X / Homebrew: [brew install zsh-syntax-highlighting][brew-package]
* Ubuntu: `zsh-syntax-highlighting` package [in Xenial][ubuntu-package] (or in [OBS repository][obs-repository])
* RHEL / CentOS / Scientific Linux: `zsh-syntax-highlighting` package in [OBS repository][obs-repository]
* openSUSE / SLE: `zsh-syntax-highlighting` package in [OBS repository][obs-repository]
* Void Linux: `zsh-syntax-highlighting package` [in XBPS][void-package]
[arch-package]: https://www.archlinux.org/packages/zsh-syntax-highlighting
[AUR-package]: https://aur.archlinux.org/packages/zsh-syntax-highlighting-git
[debian-package]: https://packages.debian.org/zsh-syntax-highlighting
[freebsd-port]: http://www.freshports.org/textproc/zsh-syntax-highlighting/
[gentoo-overlay]: http://gpo.zugaina.org/app-shells/zsh-syntax-highlighting
[brew-package]: https://github.com/Homebrew/homebrew-core/blob/master/Formula/zsh-syntax-highlighting.rb
[ubuntu-package]: https://launchpad.net/ubuntu/+source/zsh-syntax-highlighting
[fedora-package]: https://apps.fedoraproject.org/packages/zsh-syntax-highlighting
[fedora-package-alt]: https://bodhi.fedoraproject.org/updates/?packages=zsh-syntax-highlighting
[obs-repository]: https://software.opensuse.org//download.html?project=shells%3Azsh-users%3Azsh-syntax-highlighting&package=zsh-syntax-highlighting
[void-package]: https://github.com/void-linux/void-packages/tree/master/srcpkgs/zsh-syntax-highlighting
See also [repology's cross-distro index](https://repology.org/metapackage/zsh-syntax-highlighting/versions)
### In your ~/.zshrc
Simply clone this repository and source the script:
```zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
```
Then, enable syntax highlighting in the current interactive shell:
```zsh
source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
```
If `git` is not installed, download and extract a snapshot of the latest
development tree from:
```
https://github.com/zsh-users/zsh-syntax-highlighting/archive/master.tar.gz
```
Note the `source` command must be **at the end** of `~/.zshrc`.
### With a plugin manager
Note that `zsh-syntax-highlighting` must be the last plugin sourced.
The zsh-syntax-highlighting authors recommend manual installation over the use
of a framework or plugin manager.
This list is incomplete as there are too many
[frameworks / plugin managers][framework-list] to list them all here.
[framework-list]: https://github.com/unixorn/awesome-zsh-plugins#frameworks
#### [Antigen](https://github.com/zsh-users/antigen)
Add `antigen bundle zsh-users/zsh-syntax-highlighting` as the last bundle in
your `.zshrc`.
#### [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)
1. Clone this repository in oh-my-zsh's plugins directory:
```zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
```
2. Activate the plugin in `~/.zshrc`:
```zsh
plugins=( [plugins...] zsh-syntax-highlighting)
```
3. Restart zsh (such as by opening a new instance of your terminal emulator).
#### [Prezto](https://github.com/sorin-ionescu/prezto)
Zsh-syntax-highlighting is included with Prezto. See the
[Prezto documentation][prezto-docs] to enable and configure highlighters.
[prezto-docs]: https://github.com/sorin-ionescu/prezto/tree/master/modules/syntax-highlighting
#### [zgen](https://github.com/tarjoilija/zgen)
Add `zgen load zsh-users/zsh-syntax-highlighting` to the end of your `.zshrc`.
#### [zplug](https://github.com/zplug/zplug)
Add `zplug "zsh-users/zsh-syntax-highlighting", defer:2` to your `.zshrc`.
#### [zplugin](https://github.com/psprint/zplugin)
Add `zplugin load zsh-users/zsh-syntax-highlighting` to the end of your
`.zshrc`.
### System-wide installation
Any of the above methods is suitable for a single-user installation,
which requires no special privileges. If, however, you desire to install
zsh-syntax-highlighting system-wide, you may do so by running
```zsh
make install
```
and directing your users to add
```zsh
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
```
to their `.zshrc`s.

64
term/.config/zsh/plugins/zsh-syntax-highlighting/Makefile

@ -1,64 +0,0 @@
NAME=zsh-syntax-highlighting
INSTALL?=install -c
PREFIX?=/usr/local
SHARE_DIR?=$(DESTDIR)$(PREFIX)/share/$(NAME)
DOC_DIR?=$(DESTDIR)$(PREFIX)/share/doc/$(NAME)
ZSH?=zsh # zsh binary to run tests with
all:
cd docs && \
cp highlighters.md all.md && \
printf '\n\nIndividual highlighters documentation\n=====================================' >> all.md && \
for doc in highlighters/*.md; do printf '\n\n'; cat "$$doc"; done >> all.md
install: all
$(INSTALL) -d $(SHARE_DIR)
$(INSTALL) -d $(DOC_DIR)
cp .version zsh-syntax-highlighting.zsh $(SHARE_DIR)
cp COPYING.md README.md changelog.md $(DOC_DIR)
sed -e '1s/ .*//' -e '/^\[build-status-[a-z]*\]: /d' < README.md > $(DOC_DIR)/README.md
if [ x"true" = x"`git rev-parse --is-inside-work-tree 2>/dev/null`" ]; then \
git rev-parse HEAD; \
else \
cat .revision-hash; \
fi > $(SHARE_DIR)/.revision-hash
:
# The [ -e ] check below is to because sh evaluates this with (the moral
# equivalent of) NONOMATCH in effect, and highlighters/*.zsh has no matches.
for dirname in highlighters highlighters/*/ ; do \
$(INSTALL) -d $(SHARE_DIR)/"$$dirname"; \
for fname in "$$dirname"/*.zsh ; do [ -e "$$fname" ] && cp "$$fname" $(SHARE_DIR)"/$$dirname"; done; \
done
cp -R docs/* $(DOC_DIR)
clean:
rm -f docs/all.md
test:
@$(ZSH) -fc 'echo ZSH_PATCHLEVEL=$$ZSH_PATCHLEVEL'
@result=0; \
for test in highlighters/*; do \
if [ -d $$test/test-data ]; then \
echo "Running test $${test##*/}"; \
env -i QUIET=$$QUIET $${TERM:+"TERM=$$TERM"} $(ZSH) -f tests/test-highlighting.zsh "$${test##*/}"; \
: $$(( result |= $$? )); \
fi \
done; \
exit $$result
quiet-test:
$(MAKE) test QUIET=y
perf:
@result=0; \
for test in highlighters/*; do \
if [ -d $$test/test-data ]; then \
echo "Running test $${test##*/}"; \
$(ZSH) -f tests/test-perfs.zsh "$${test##*/}"; \
: $$(( result |= $$? )); \
fi \
done; \
exit $$result
.PHONY: all install clean test perf

85
term/.config/zsh/plugins/zsh-syntax-highlighting/README.md

@ -1,85 +0,0 @@
zsh-syntax-highlighting [![Build Status][build-status-image]][build-status-travis]
=======================
**[Fish shell][fish]-like syntax highlighting for [Zsh][zsh].**
*Requirements: zsh 4.3.11+.*
[fish]: http://www.fishshell.com/
[zsh]: http://www.zsh.org/
This package provides syntax highlighting for the shell zsh. It enables
highlighting of commands whilst they are typed at a zsh prompt into an
interactive terminal. This helps in reviewing commands before running
them, particularly in catching syntax errors.
Some examples:
Before: [![Screenshot #1.1](images/before1-smaller.png)](images/before1.png)
<br/>
After:&nbsp; [![Screenshot #1.2](images/after1-smaller.png)](images/after1.png)
Before: [![Screenshot #2.1](images/before2-smaller.png)](images/before2.png)
<br/>
After:&nbsp; [![Screenshot #2.2](images/after2-smaller.png)](images/after2.png)
Before: [![Screenshot #3.1](images/before3-smaller.png)](images/before3.png)
<br/>
After:&nbsp; [![Screenshot #3.2](images/after3-smaller.png)](images/after3.png)
Before: [![Screenshot #4.1](images/before4-smaller.png)](images/before4-smaller.png)
<br/>
After:&nbsp; [![Screenshot #4.2](images/after4-smaller.png)](images/after4-smaller.png)
How to install
--------------
See [INSTALL.md](INSTALL.md).
FAQ
---
### Why must `zsh-syntax-highlighting.zsh` be sourced at the end of the `.zshrc` file?
`zsh-syntax-highlighting.zsh` wraps ZLE widgets. It must be sourced after all
custom widgets have been created (i.e., after all `zle -N` calls and after
running `compinit`). Widgets created later will work, but will not update the
syntax highlighting.
### Does syntax highlighting work during incremental history search?
Highlighting the command line during an incremental history search (by default bound to
to <kbd>Ctrl+R</kbd> in zsh's emacs keymap) requires zsh 5.4 or newer.
Under zsh versions older than 5.4, the zsh-default [underlining][zshzle-Character-Highlighting]
of the matched portion of the buffer remains available, but zsh-syntax-highlighting's
additional highlighting is unavailable. (Those versions of zsh do not provide
enough information to allow computing the highlighting correctly.)
See issues [#288][i288] and [#415][i415] for details.
[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
[i288]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/288
[i415]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/415
### How are new releases announced?
There is currently no "push" announcements channel. However, the following
alternatives exist:
- GitHub's RSS feed of releases: https://github.com/zsh-users/zsh-syntax-highlighting/releases.atom
- An anitya entry: https://release-monitoring.org/project/7552/
How to tweak
------------
Syntax highlighting is done by pluggable highlighter scripts. See the
[documentation on highlighters](docs/highlighters.md) for details and
configuration settings.
[build-status-image]: https://travis-ci.org/zsh-users/zsh-syntax-highlighting.svg?branch=master
[build-status-travis]: https://travis-ci.org/zsh-users/zsh-syntax-highlighting

765
term/.config/zsh/plugins/zsh-syntax-highlighting/changelog.md

@ -1,765 +0,0 @@
# Changes in HEAD
- Redirection operators (e.g., `<` and `>`) are now highlighted by default
[#646]
- Propertly terminate `noglob` scope in try/always blocks
[#577]
- Don't error out when `KSH_ARRAYS` is set in the calling scope
[#622, #689]
- Literal semicolons in array assignments (`foo=( bar ; baz )`) are now
highlighted as errors.
[3ca93f864fb6]
- Command separators in array assignments (`foo=( bar | baz )`) are now
highlighted as errors.
[#651, 81267ca3130c]
- Support parameter elision in command position (e.g., `$foo ls` where `$foo` is unset or empty)
[#667]
- Don't consider the filename in `sudo -e /path/to/file` to be a command position
[#678]
- Don't look up absolute directory names in $cdpath
[2cc2583f8f12, part of #669]
- Fix `exec 2>&1;` being highlighted as an error.
[#676]
- Fix `: $(<*)` being highlighted as globbing.
[#582]
- Fix `cat < *` being highlighting as globbing when the `MULTIOS` option is unset.
[#583]
- Fix `echo >&2` highlighting the `2` as a filename if a file by that name happened to exist
[#694, part of #645]
- Fix `echo >&-` highlighting the `-` as a filename if a file by that name happened to exist
[part of #645]
- Fix `echo >&p` highlighting the `p` as a filename if a file by that name happened to exist
[part of #645]
- Fix `: $((42))` being highlighted as a subshell.
[part of #607]
- Regress highlighting of `: $((ls); (ls))`: is a subshell, but will now be
incorrectly highlighted as an arithmetic expansion.
[#704]
- Fix wrong highlighting of unquoted parameter expansions under zsh 5.2 and older
[e165f18c758e]
- Highlight global aliases
[#700]
- Highlight `: =nosuchcommand' as an error (when the `EQUALS` option hasn't been unset).
[#430]
- Highlight reserved word after assignments as errors (e.g., `foo=bar (ls;)`)
[#461]
- Correctly highlight `[[ foo && bar || baz ]]`.
- Highlight non-executable files in command position correctly (e.g., `% /etc/passwd`)
[#202, #669]
- Highlight directories in command position correctly, including `AUTO_CD` support
[#669]
- Recognize `env` as a precommand (e.g., `env FOO=bar ls`)
- Recognize `strace` as a precommand
- Fix an error message on stderr before every prompt when the `WARN_NESTED_VAR` zsh option is set:
`_zsh_highlight_main__precmd_hook:1: array parameter _zsh_highlight_main__command_type_cache set in enclosing scope in function _zsh_highlight_main__precmd_hook`
[#727, #731]
# Changes in version 0.7.1
- Remove out-of-date information from the 0.7.0 changelog.
# Changes in version 0.7.0
This is a stable bugfix and feature release. Major new features and changes include:
- Add `ZSH_HIGHLIGHT_DIRS_BLACKLIST` to disable "path" and "path prefix"
highlighting for specific directories
[#379]
- Add the "regexp" highlighter, modelled after the pattern highlighter
[4e6f60063f1c]
- When a word uses globbing, only the globbing metacharacters will be highlighted as globbing:
in `: foo*bar`, only the `*` will be blue.
[e48af357532c]
- Highlight pasted quotes (e.g., `: foo"bar"`)
[dc1b2f6fa4bb]
- Highlight command substitutions (`` : `ls` ``, `: $(ls)`)
[c0e64fe13178 and parents, e86f75a840e7, et al]
- Highlight process substitutions (`: >(nl)`, `: <(pwd)`, `: =(git diff)`)
[c0e64fe13178 and parents, e86f75a840e7, et al]
- Highlight command substitutions inside double quotes (``: "`foo`"``)
[f16e858f0c83]
- Highlight many precommands (e.g., `nice`, `stdbuf`, `eatmydata`;
see `$precommand_options` in the source)
- Highlight numeric globs (e.g., `echo /lib<->`)
- Assorted improvements to aliases highlighting
(e.g.,
`alias sudo_u='sudo -u'; sudo_u jrandom ls`,
`alias x=y y=z z=nosuchcommand; x`,
`alias ls='ls -l'; \ls`)
[f3410c5862fc, 57386f30aec8, #544, and many others]
- Highlight some more syntax errors
[dea05e44e671, 298ef6a2fa30]
- New styles: named file descriptors, `RC_QUOTES`, and unclosed quotes (e.g., `echo "foo<CURSOR>`)
[38c794a978cd, 25ae1c01216c, 967335dfc5fd]
- The 'brackets' highlighting no longer treats quotes specially.
[ecdda36ef56f]
Selected bugfixes include:
- Highlight `sudo` correctly when it's not installed
[26a82113b08b]
- Handle some non-default options being set in zshrc
[b07ada1255b7, a2a899b41b8, 972ad197c13d, b3f66fc8748f]
- Fix off-by-one highlighting in vi "visual" mode (vicmd keymap)
[be3882aeb054]
- The 'yank-pop' widget is not wrapped
[#183]
Known issues include:
- A multiline alias that uses a simple command terminator (such as `;`, `|`, `&&`)
before a newline will incorrectly be highlighted as an error. See issue #677
for examples and workarounds.
[#677]
# Changes in version 0.6.0
This is a stable release, featuring bugfixes and minor improvements.
## Performance improvements:
(none)
## Added highlighting of:
- The `isearch` and `suffix` [`$zle_highlight` settings][zshzle-Character-Highlighting].
(79e4d3d12405, 15db71abd0cc, b56ee542d619; requires zsh 5.3 for `$ISEARCHMATCH_ACTIVE` / `$SUFFIX_ACTIVE` support)
[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
- Possible history expansions in double-quoted strings.
(76ea9e1df316)
- Mismatched `if`/`then`/`elif`/`else`/`fi`.
(73cb83270262)
## Fixed highlighting of:
- A comment line followed by a non-comment line.
(#385, 9396ad5c5f9c)
- An unquoted `$*` (expands to the positional parameters).
(237f89ad629f)
- history-incremental-pattern-search-backward under zsh 5.3.1.
(#407, #415, 462779629a0c)
## API changes (for highlighter authors):
(none)
## Developer-visible changes:
- tests: Set the `ALIAS_FUNC_DEF` option for zsh 5.4 compatibility.
(9523d6d49cb3)
## Other changes:
- docs: Added before/after screenshots.
(cd9ec14a65ec..b7e277106b49)
- docs: Link Fedora package.
(3d74aa47e4a7, 5feed23962df)
- docs: Link FreeBSD port.
(626c034c68d7)
- docs: Link OpenSUSE Build Service packages
(#419, dea1fedc7358)
- Prevent user-defined aliases from taking effect in z-sy-h's own code.
(#390, 2dce602727d7, 8d5afe47f774; and #392, #395, b8fa1b9dc954)
- docs: Update zplug installation instructions.
(#399, 4f49c4a35f17)
- Improve "unhandled ZLE widget 'foo'" error message.
(#409, be083d7f3710)
- Fix printing of "failed loading highlighters" error message.
(#426, ad522a091429)
# Changes in version 0.5.0
## Performance improvements:
We thank Sebastian Gniazdowski and "m0viefreak" for significant contributions
in this area.
- Optimize string operations in the `main` (default) highlighter.
(#372/3cb58fd7d7b9, 02229ebd6328, ef4bfe5bcc14, #372/c6b6513ac0d6, #374/15461e7d21c3)
- Command word highlighting: Use the `zsh/parameter` module to avoid forks.
Memoize (cache) the results.
(#298, 3ce01076b521, 2f18ba64e397, 12b879caf7a6; #320, 3b67e656bff5)
- Avoid forks in the driver and in the `root` highlighter.
(b9112aec798a, 38c8fbea2dd2)
## Added highlighting of:
- `pkexec` (a precommand).
(#248, 4f3910cbbaa5)
- Aliases that cannot be defined normally nor invoked normally (highlighted as an error).
(#263 (in part), 28932316cca6)
- Path separators (`/`) — the default behaviour remains to highlight path separators
and path components the same way.
(#136, #260, 6cd39e7c70d3, 9a934d291e7c, f3d3aaa00cc4)
- Assignments to individual positional arguments (`42=foo` to assign to `$42`).
(f4036a09cee3)
- Linewise region (the `visual-line-mode` widget, bound to `V` in zsh's `vi` keymap).
(#267, a7a7f8b42280, ee07588cfd9b)
- Command-lines recalled by `isearch` mode; requires zsh≥5.3.
(#261 (in part); #257; 4ad311ec0a68)
- Command-lines whilst the `IGNORE_BRACES` or `IGNORE_CLOSE_BRACES` option is in effect.
(a8a6384356af, 02807f1826a5)
- Mismatched parentheses and braces (in the `main` highlighter).
(51b9d79c3bb6, 2fabf7ca64b7, a4196eda5e6f, and others)
- Mismatched `do`/`done` keywords.
(b2733a64da93)
- Mismatched `foreach`/`end` keywords.
(#96, 2bb8f0703d8f)
- In Bourne-style function definitions, when the `MULTI_FUNC_DEF` option is set
(which is the default), highlight the first word in the function body as
a command word: `f() { g "$@" }`.
(6f91850a01e1)
- `always` blocks.
(#335, e5782e4ddfb6)
- Command substitutions inside double quotes, `"$(echo foo)"`.
(#139 (in part), c3913e0d8ead)
- Non-alphabetic parameters inside double quotes (`"$$"`, `"$#"`, `"$*"`, `"$@"`, `"$?"`, `"$-"`).
(4afe670f7a1b, 44ef6e38e5a7)
- Command words from future versions of zsh (forward compatibly).
This also adds an `arg0` style that all other command word styles fall back to.
(b4537a972eed, bccc3dc26943)
- Escaped history expansions inside double quotes: `: "\!"`
(28d7056a7a06, et seq)
## Fixed highlighting of:
- Command separator tokens in syntactically-invalid positions.
(09c4114eb980)
- Redirections with a file descriptor number at command word.
(#238 (in part), 73ee7c1f6c4a)
- The `select` prompt, `$PS3`.
(#268, 451665cb2a8b)
- Values of variables in `vared`.
(e500ca246286)
- `!` as an argument (neither a history expansion nor a reserved word).
(4c23a2fd1b90)
- "division by zero" error under the `brackets` highlighter when `$ZSH_HIGHLIGHT_STYLES` is empty.
(f73f3d53d3a6)
- Process substitutions, `<(pwd)` and `>(wc -l)`.
(#302, 6889ff6bd2ad, bfabffbf975c, fc9c892a3f15)