lots more changes
This commit is contained in:
parent
546f7bc997
commit
14475e11a0
9 changed files with 621 additions and 215 deletions
.config
.local
|
@ -42,133 +42,133 @@
|
||||||
|
|
||||||
# file types (with matching order)
|
# file types (with matching order)
|
||||||
ln 01;36 # LINK
|
ln 01;36 # LINK
|
||||||
or 31;01 # ORPHAN
|
or 01;31 # ORPHAN
|
||||||
tw 34 # STICKY_OTHER_WRITABLE
|
tw 01;34 # STICKY_OTHER_WRITABLE
|
||||||
ow 34 # OTHER_WRITABLE
|
ow 01;34 # OTHER_WRITABLE
|
||||||
st 01;34 # STICKY
|
st 34 # STICKY
|
||||||
di 01;34 # DIR
|
di 01;34 # DIR
|
||||||
pi 33 # FIFO
|
pi 33 # FIFO
|
||||||
so 01;35 # SOCK
|
so 35 # SOCK
|
||||||
bd 33;01 # BLK
|
bd 33 # BLK
|
||||||
cd 33;01 # CHR
|
cd 33 # CHR
|
||||||
su 01;32 # SETUID
|
su 32 # SETUID
|
||||||
sg 01;32 # SETGID
|
sg 32 # SETGID
|
||||||
ex 01;32 # EXEC
|
ex 32 # EXEC
|
||||||
fi 00 # FILE
|
fi 00 # FILE
|
||||||
|
|
||||||
# archives or compressed (dircolors defaults)
|
# archives or compressed (dircolors defaults)
|
||||||
*.tar 01;31
|
*.tar 33
|
||||||
*.tgz 01;31
|
*.tgz 33
|
||||||
*.arc 01;31
|
*.arc 33
|
||||||
*.arj 01;31
|
*.arj 33
|
||||||
*.taz 01;31
|
*.taz 33
|
||||||
*.lha 01;31
|
*.lha 33
|
||||||
*.lz4 01;31
|
*.lz4 33
|
||||||
*.lzh 01;31
|
*.lzh 33
|
||||||
*.lzma 01;31
|
*.lzma 33
|
||||||
*.tlz 01;31
|
*.tlz 33
|
||||||
*.txz 01;31
|
*.txz 33
|
||||||
*.tzo 01;31
|
*.tzo 33
|
||||||
*.t7z 01;31
|
*.t7z 33
|
||||||
*.zip 01;31
|
*.zip 33
|
||||||
*.z 01;31
|
*.z 33
|
||||||
*.dz 01;31
|
*.dz 33
|
||||||
*.gz 01;31
|
*.gz 33
|
||||||
*.lrz 01;31
|
*.lrz 33
|
||||||
*.lz 01;31
|
*.lz 33
|
||||||
*.lzo 01;31
|
*.lzo 33
|
||||||
*.xz 01;31
|
*.xz 33
|
||||||
*.zst 01;31
|
*.zst 33
|
||||||
*.tzst 01;31
|
*.tzst 33
|
||||||
*.bz2 01;31
|
*.bz2 33
|
||||||
*.bz 01;31
|
*.bz 33
|
||||||
*.tbz 01;31
|
*.tbz 33
|
||||||
*.tbz2 01;31
|
*.tbz2 33
|
||||||
*.tz 01;31
|
*.tz 33
|
||||||
*.deb 01;31
|
*.deb 33
|
||||||
*.rpm 01;31
|
*.rpm 33
|
||||||
*.jar 01;31
|
*.jar 33
|
||||||
*.war 01;31
|
*.war 33
|
||||||
*.ear 01;31
|
*.ear 33
|
||||||
*.sar 01;31
|
*.sar 33
|
||||||
*.rar 01;31
|
*.rar 33
|
||||||
*.alz 01;31
|
*.alz 33
|
||||||
*.ace 01;31
|
*.ace 33
|
||||||
*.zoo 01;31
|
*.zoo 33
|
||||||
*.cpio 01;31
|
*.cpio 33
|
||||||
*.7z 01;31
|
*.7z 33
|
||||||
*.rz 01;31
|
*.rz 33
|
||||||
*.cab 01;31
|
*.cab 33
|
||||||
*.wim 01;31
|
*.wim 33
|
||||||
*.swm 01;31
|
*.swm 33
|
||||||
*.dwm 01;31
|
*.dwm 33
|
||||||
*.esd 01;31
|
*.esd 33
|
||||||
|
|
||||||
# image formats (dircolors defaults)
|
# image formats (dircolors defaults)
|
||||||
*.jpg 01;35
|
*.jpg 35
|
||||||
*.jpeg 01;35
|
*.jpeg 35
|
||||||
*.mjpg 01;35
|
*.mjpg 35
|
||||||
*.mjpeg 01;35
|
*.mjpeg 35
|
||||||
*.gif 01;35
|
*.gif 35
|
||||||
*.bmp 01;35
|
*.bmp 35
|
||||||
*.pbm 01;35
|
*.pbm 35
|
||||||
*.pgm 01;35
|
*.pgm 35
|
||||||
*.ppm 01;35
|
*.ppm 35
|
||||||
*.tga 01;35
|
*.tga 35
|
||||||
*.xbm 01;35
|
*.xbm 35
|
||||||
*.xpm 01;35
|
*.xpm 35
|
||||||
*.tif 01;35
|
*.tif 35
|
||||||
*.tiff 01;35
|
*.tiff 35
|
||||||
*.png 01;35
|
*.png 35
|
||||||
*.svg 01;35
|
*.svg 35
|
||||||
*.svgz 01;35
|
*.svgz 35
|
||||||
*.mng 01;35
|
*.mng 35
|
||||||
*.pcx 01;35
|
*.pcx 35
|
||||||
*.mov 01;35
|
*.mov 35
|
||||||
*.mpg 01;35
|
*.mpg 35
|
||||||
*.mpeg 01;35
|
*.mpeg 35
|
||||||
*.m2v 01;35
|
*.m2v 35
|
||||||
*.mkv 01;35
|
*.mkv 35
|
||||||
*.webm 01;35
|
*.webm 35
|
||||||
*.ogm 01;35
|
*.ogm 35
|
||||||
*.mp4 01;35
|
*.mp4 35
|
||||||
*.m4v 01;35
|
*.m4v 35
|
||||||
*.mp4v 01;35
|
*.mp4v 35
|
||||||
*.vob 01;35
|
*.vob 35
|
||||||
*.qt 01;35
|
*.qt 35
|
||||||
*.nuv 01;35
|
*.nuv 35
|
||||||
*.wmv 01;35
|
*.wmv 35
|
||||||
*.asf 01;35
|
*.asf 35
|
||||||
*.rm 01;35
|
*.rm 35
|
||||||
*.rmvb 01;35
|
*.rmvb 35
|
||||||
*.flc 01;35
|
*.flc 35
|
||||||
*.avi 01;35
|
*.avi 35
|
||||||
*.fli 01;35
|
*.fli 35
|
||||||
*.flv 01;35
|
*.flv 35
|
||||||
*.gl 01;35
|
*.gl 35
|
||||||
*.dl 01;35
|
*.dl 35
|
||||||
*.xcf 01;35
|
*.xcf 35
|
||||||
*.xwd 01;35
|
*.xwd 35
|
||||||
*.yuv 01;35
|
*.yuv 35
|
||||||
*.cgm 01;35
|
*.cgm 35
|
||||||
*.emf 01;35
|
*.emf 35
|
||||||
*.ogv 01;35
|
*.ogv 35
|
||||||
*.ogx 01;35
|
*.ogx 35
|
||||||
|
|
||||||
# audio formats (dircolors defaults)
|
# audio formats (dircolors defaults)
|
||||||
*.aac 00;36
|
*.aac 36
|
||||||
*.au 00;36
|
*.au 36
|
||||||
*.flac 00;36
|
*.flac 36
|
||||||
*.m4a 00;36
|
*.m4a 36
|
||||||
*.mid 00;36
|
*.mid 36
|
||||||
*.midi 00;36
|
*.midi 36
|
||||||
*.mka 00;36
|
*.mka 36
|
||||||
*.mp3 00;36
|
*.mp3 36
|
||||||
*.mpc 00;36
|
*.mpc 36
|
||||||
*.ogg 00;36
|
*.ogg 36
|
||||||
*.ra 00;36
|
*.ra 36
|
||||||
*.wav 00;36
|
*.wav 36
|
||||||
*.oga 00;36
|
*.oga 36
|
||||||
*.opus 00;36
|
*.opus 36
|
||||||
*.spx 00;36
|
*.spx 36
|
||||||
*.xspf 00;36
|
*.xspf 36
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 095ee2b3e307403d385b10764d7001dca6935fd7
|
Subproject commit 8a9db82da650a3087ea93e609b64f1e69be7ee2a
|
|
@ -66,6 +66,7 @@ export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"
|
||||||
export STOW_DIR="$XDG_DATA_HOME/stow"
|
export STOW_DIR="$XDG_DATA_HOME/stow"
|
||||||
export DOTS_DIR="$STOW_DIR/dots"
|
export DOTS_DIR="$STOW_DIR/dots"
|
||||||
|
|
||||||
|
export WORKON_HOME="$HOME/.local/share/virtualenv"
|
||||||
export ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump"
|
export ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump"
|
||||||
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config"
|
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config"
|
||||||
export GTK2_RC_FILES="$XDG_CONFIG_HOME/.config}/gtk-2.0/gtkrc-2.0"
|
export GTK2_RC_FILES="$XDG_CONFIG_HOME/.config}/gtk-2.0/gtkrc-2.0"
|
||||||
|
|
|
@ -7,7 +7,6 @@ source $ZDOTDIR/configs/aliases
|
||||||
[ -r $ZDOTDIR/configs/host-setup ] && source $ZDOTDIR/configs/host-setup
|
[ -r $ZDOTDIR/configs/host-setup ] && source $ZDOTDIR/configs/host-setup
|
||||||
|
|
||||||
source $ZDOTDIR/plugins/fzf/bindings.zsh
|
source $ZDOTDIR/plugins/fzf/bindings.zsh
|
||||||
source $ZDOTDIR/plugins/autopyenv/autopyenv.zsh
|
|
||||||
source $ZDOTDIR/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
|
source $ZDOTDIR/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
|
||||||
|
|
||||||
for f in $ZDOTDIR/configs/autogenerated/*; do
|
for f in $ZDOTDIR/configs/autogenerated/*; do
|
||||||
|
|
193
.config/zsh/completions/_kubectl
Normal file
193
.config/zsh/completions/_kubectl
Normal file
|
@ -0,0 +1,193 @@
|
||||||
|
#compdef kubectl
|
||||||
|
compdef _kubectl kubectl
|
||||||
|
|
||||||
|
# Copyright 2016 The Kubernetes Authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#compdef _kubectl kubectl
|
||||||
|
|
||||||
|
# zsh completion for kubectl -*- shell-script -*-
|
||||||
|
|
||||||
|
__kubectl_debug()
|
||||||
|
{
|
||||||
|
local file="$BASH_COMP_DEBUG_FILE"
|
||||||
|
if [[ -n ${file} ]]; then
|
||||||
|
echo "$*" >> "${file}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_kubectl()
|
||||||
|
{
|
||||||
|
local shellCompDirectiveError=1
|
||||||
|
local shellCompDirectiveNoSpace=2
|
||||||
|
local shellCompDirectiveNoFileComp=4
|
||||||
|
local shellCompDirectiveFilterFileExt=8
|
||||||
|
local shellCompDirectiveFilterDirs=16
|
||||||
|
|
||||||
|
local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace
|
||||||
|
local -a completions
|
||||||
|
|
||||||
|
__kubectl_debug "\n========= starting completion logic =========="
|
||||||
|
__kubectl_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}"
|
||||||
|
|
||||||
|
# The user could have moved the cursor backwards on the command-line.
|
||||||
|
# We need to trigger completion from the $CURRENT location, so we need
|
||||||
|
# to truncate the command-line ($words) up to the $CURRENT location.
|
||||||
|
# (We cannot use $CURSOR as its value does not work when a command is an alias.)
|
||||||
|
words=("${=words[1,CURRENT]}")
|
||||||
|
__kubectl_debug "Truncated words[*]: ${words[*]},"
|
||||||
|
|
||||||
|
lastParam=${words[-1]}
|
||||||
|
lastChar=${lastParam[-1]}
|
||||||
|
__kubectl_debug "lastParam: ${lastParam}, lastChar: ${lastChar}"
|
||||||
|
|
||||||
|
# For zsh, when completing a flag with an = (e.g., kubectl -n=<TAB>)
|
||||||
|
# completions must be prefixed with the flag
|
||||||
|
setopt local_options BASH_REMATCH
|
||||||
|
if [[ "${lastParam}" =~ '-.*=' ]]; then
|
||||||
|
# We are dealing with a flag with an =
|
||||||
|
flagPrefix="-P ${BASH_REMATCH}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prepare the command to obtain completions
|
||||||
|
requestComp="${words[1]} __complete ${words[2,-1]}"
|
||||||
|
if [ "${lastChar}" = "" ]; then
|
||||||
|
# If the last parameter is complete (there is a space following it)
|
||||||
|
# We add an extra empty parameter so we can indicate this to the go completion code.
|
||||||
|
__kubectl_debug "Adding extra empty parameter"
|
||||||
|
requestComp="${requestComp} \"\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
__kubectl_debug "About to call: eval ${requestComp}"
|
||||||
|
|
||||||
|
# Use eval to handle any environment variables and such
|
||||||
|
out=$(eval ${requestComp} 2>/dev/null)
|
||||||
|
__kubectl_debug "completion output: ${out}"
|
||||||
|
|
||||||
|
# Extract the directive integer following a : from the last line
|
||||||
|
local lastLine
|
||||||
|
while IFS='\n' read -r line; do
|
||||||
|
lastLine=${line}
|
||||||
|
done < <(printf "%s\n" "${out[@]}")
|
||||||
|
__kubectl_debug "last line: ${lastLine}"
|
||||||
|
|
||||||
|
if [ "${lastLine[1]}" = : ]; then
|
||||||
|
directive=${lastLine[2,-1]}
|
||||||
|
# Remove the directive including the : and the newline
|
||||||
|
local suffix
|
||||||
|
(( suffix=${#lastLine}+2))
|
||||||
|
out=${out[1,-$suffix]}
|
||||||
|
else
|
||||||
|
# There is no directive specified. Leave $out as is.
|
||||||
|
__kubectl_debug "No directive found. Setting do default"
|
||||||
|
directive=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
__kubectl_debug "directive: ${directive}"
|
||||||
|
__kubectl_debug "completions: ${out}"
|
||||||
|
__kubectl_debug "flagPrefix: ${flagPrefix}"
|
||||||
|
|
||||||
|
if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then
|
||||||
|
__kubectl_debug "Completion received error. Ignoring completions."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
while IFS='\n' read -r comp; do
|
||||||
|
if [ -n "$comp" ]; then
|
||||||
|
# If requested, completions are returned with a description.
|
||||||
|
# The description is preceded by a TAB character.
|
||||||
|
# For zsh's _describe, we need to use a : instead of a TAB.
|
||||||
|
# We first need to escape any : as part of the completion itself.
|
||||||
|
comp=${comp//:/\\:}
|
||||||
|
|
||||||
|
local tab=$(printf '\t')
|
||||||
|
comp=${comp//$tab/:}
|
||||||
|
|
||||||
|
__kubectl_debug "Adding completion: ${comp}"
|
||||||
|
completions+=${comp}
|
||||||
|
lastComp=$comp
|
||||||
|
fi
|
||||||
|
done < <(printf "%s\n" "${out[@]}")
|
||||||
|
|
||||||
|
if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then
|
||||||
|
__kubectl_debug "Activating nospace."
|
||||||
|
noSpace="-S ''"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
|
||||||
|
# File extension filtering
|
||||||
|
local filteringCmd
|
||||||
|
filteringCmd='_files'
|
||||||
|
for filter in ${completions[@]}; do
|
||||||
|
if [ ${filter[1]} != '*' ]; then
|
||||||
|
# zsh requires a glob pattern to do file filtering
|
||||||
|
filter="\*.$filter"
|
||||||
|
fi
|
||||||
|
filteringCmd+=" -g $filter"
|
||||||
|
done
|
||||||
|
filteringCmd+=" ${flagPrefix}"
|
||||||
|
|
||||||
|
__kubectl_debug "File filtering command: $filteringCmd"
|
||||||
|
_arguments '*:filename:'"$filteringCmd"
|
||||||
|
elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then
|
||||||
|
# File completion for directories only
|
||||||
|
local subdir
|
||||||
|
subdir="${completions[1]}"
|
||||||
|
if [ -n "$subdir" ]; then
|
||||||
|
__kubectl_debug "Listing directories in $subdir"
|
||||||
|
pushd "${subdir}" >/dev/null 2>&1
|
||||||
|
else
|
||||||
|
__kubectl_debug "Listing directories in ."
|
||||||
|
fi
|
||||||
|
|
||||||
|
local result
|
||||||
|
_arguments '*:dirname:_files -/'" ${flagPrefix}"
|
||||||
|
result=$?
|
||||||
|
if [ -n "$subdir" ]; then
|
||||||
|
popd >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
return $result
|
||||||
|
else
|
||||||
|
__kubectl_debug "Calling _describe"
|
||||||
|
if eval _describe "completions" completions $flagPrefix $noSpace; then
|
||||||
|
__kubectl_debug "_describe found some completions"
|
||||||
|
|
||||||
|
# Return the success of having called _describe
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
__kubectl_debug "_describe did not find completions."
|
||||||
|
__kubectl_debug "Checking if we should do file completion."
|
||||||
|
if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then
|
||||||
|
__kubectl_debug "deactivating file completion"
|
||||||
|
|
||||||
|
# We must return an error code here to let zsh know that there were no
|
||||||
|
# completions found by _describe; this is what will trigger other
|
||||||
|
# matching algorithms to attempt to find completions.
|
||||||
|
# For example zsh can match letters in the middle of words.
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
# Perform file completion
|
||||||
|
__kubectl_debug "Activating file completion"
|
||||||
|
|
||||||
|
# We must return the result of this command, so it must be the
|
||||||
|
# last command, or else we must store its result to return it.
|
||||||
|
_arguments '*:filename:_files'" ${flagPrefix}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# don't run the completion function when being source-ed or eval-ed
|
||||||
|
if [ "$funcstack[1]" = "_kubectl" ]; then
|
||||||
|
_kubectl
|
||||||
|
fi
|
212
.config/zsh/completions/_pv-migrate
Normal file
212
.config/zsh/completions/_pv-migrate
Normal file
|
@ -0,0 +1,212 @@
|
||||||
|
#compdef pv-migrate
|
||||||
|
compdef _pv-migrate pv-migrate
|
||||||
|
|
||||||
|
# zsh completion for pv-migrate -*- shell-script -*-
|
||||||
|
|
||||||
|
__pv-migrate_debug()
|
||||||
|
{
|
||||||
|
local file="$BASH_COMP_DEBUG_FILE"
|
||||||
|
if [[ -n ${file} ]]; then
|
||||||
|
echo "$*" >> "${file}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_pv-migrate()
|
||||||
|
{
|
||||||
|
local shellCompDirectiveError=1
|
||||||
|
local shellCompDirectiveNoSpace=2
|
||||||
|
local shellCompDirectiveNoFileComp=4
|
||||||
|
local shellCompDirectiveFilterFileExt=8
|
||||||
|
local shellCompDirectiveFilterDirs=16
|
||||||
|
local shellCompDirectiveKeepOrder=32
|
||||||
|
|
||||||
|
local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder
|
||||||
|
local -a completions
|
||||||
|
|
||||||
|
__pv-migrate_debug "\n========= starting completion logic =========="
|
||||||
|
__pv-migrate_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}"
|
||||||
|
|
||||||
|
# The user could have moved the cursor backwards on the command-line.
|
||||||
|
# We need to trigger completion from the $CURRENT location, so we need
|
||||||
|
# to truncate the command-line ($words) up to the $CURRENT location.
|
||||||
|
# (We cannot use $CURSOR as its value does not work when a command is an alias.)
|
||||||
|
words=("${=words[1,CURRENT]}")
|
||||||
|
__pv-migrate_debug "Truncated words[*]: ${words[*]},"
|
||||||
|
|
||||||
|
lastParam=${words[-1]}
|
||||||
|
lastChar=${lastParam[-1]}
|
||||||
|
__pv-migrate_debug "lastParam: ${lastParam}, lastChar: ${lastChar}"
|
||||||
|
|
||||||
|
# For zsh, when completing a flag with an = (e.g., pv-migrate -n=<TAB>)
|
||||||
|
# completions must be prefixed with the flag
|
||||||
|
setopt local_options BASH_REMATCH
|
||||||
|
if [[ "${lastParam}" =~ '-.*=' ]]; then
|
||||||
|
# We are dealing with a flag with an =
|
||||||
|
flagPrefix="-P ${BASH_REMATCH}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prepare the command to obtain completions
|
||||||
|
requestComp="${words[1]} __complete ${words[2,-1]}"
|
||||||
|
if [ "${lastChar}" = "" ]; then
|
||||||
|
# If the last parameter is complete (there is a space following it)
|
||||||
|
# We add an extra empty parameter so we can indicate this to the go completion code.
|
||||||
|
__pv-migrate_debug "Adding extra empty parameter"
|
||||||
|
requestComp="${requestComp} \"\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
__pv-migrate_debug "About to call: eval ${requestComp}"
|
||||||
|
|
||||||
|
# Use eval to handle any environment variables and such
|
||||||
|
out=$(eval ${requestComp} 2>/dev/null)
|
||||||
|
__pv-migrate_debug "completion output: ${out}"
|
||||||
|
|
||||||
|
# Extract the directive integer following a : from the last line
|
||||||
|
local lastLine
|
||||||
|
while IFS='\n' read -r line; do
|
||||||
|
lastLine=${line}
|
||||||
|
done < <(printf "%s\n" "${out[@]}")
|
||||||
|
__pv-migrate_debug "last line: ${lastLine}"
|
||||||
|
|
||||||
|
if [ "${lastLine[1]}" = : ]; then
|
||||||
|
directive=${lastLine[2,-1]}
|
||||||
|
# Remove the directive including the : and the newline
|
||||||
|
local suffix
|
||||||
|
(( suffix=${#lastLine}+2))
|
||||||
|
out=${out[1,-$suffix]}
|
||||||
|
else
|
||||||
|
# There is no directive specified. Leave $out as is.
|
||||||
|
__pv-migrate_debug "No directive found. Setting do default"
|
||||||
|
directive=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
__pv-migrate_debug "directive: ${directive}"
|
||||||
|
__pv-migrate_debug "completions: ${out}"
|
||||||
|
__pv-migrate_debug "flagPrefix: ${flagPrefix}"
|
||||||
|
|
||||||
|
if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then
|
||||||
|
__pv-migrate_debug "Completion received error. Ignoring completions."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
local activeHelpMarker="_activeHelp_ "
|
||||||
|
local endIndex=${#activeHelpMarker}
|
||||||
|
local startIndex=$((${#activeHelpMarker}+1))
|
||||||
|
local hasActiveHelp=0
|
||||||
|
while IFS='\n' read -r comp; do
|
||||||
|
# Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker)
|
||||||
|
if [ "${comp[1,$endIndex]}" = "$activeHelpMarker" ];then
|
||||||
|
__pv-migrate_debug "ActiveHelp found: $comp"
|
||||||
|
comp="${comp[$startIndex,-1]}"
|
||||||
|
if [ -n "$comp" ]; then
|
||||||
|
compadd -x "${comp}"
|
||||||
|
__pv-migrate_debug "ActiveHelp will need delimiter"
|
||||||
|
hasActiveHelp=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$comp" ]; then
|
||||||
|
# If requested, completions are returned with a description.
|
||||||
|
# The description is preceded by a TAB character.
|
||||||
|
# For zsh's _describe, we need to use a : instead of a TAB.
|
||||||
|
# We first need to escape any : as part of the completion itself.
|
||||||
|
comp=${comp//:/\\:}
|
||||||
|
|
||||||
|
local tab="$(printf '\t')"
|
||||||
|
comp=${comp//$tab/:}
|
||||||
|
|
||||||
|
__pv-migrate_debug "Adding completion: ${comp}"
|
||||||
|
completions+=${comp}
|
||||||
|
lastComp=$comp
|
||||||
|
fi
|
||||||
|
done < <(printf "%s\n" "${out[@]}")
|
||||||
|
|
||||||
|
# Add a delimiter after the activeHelp statements, but only if:
|
||||||
|
# - there are completions following the activeHelp statements, or
|
||||||
|
# - file completion will be performed (so there will be choices after the activeHelp)
|
||||||
|
if [ $hasActiveHelp -eq 1 ]; then
|
||||||
|
if [ ${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then
|
||||||
|
__pv-migrate_debug "Adding activeHelp delimiter"
|
||||||
|
compadd -x "--"
|
||||||
|
hasActiveHelp=0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then
|
||||||
|
__pv-migrate_debug "Activating nospace."
|
||||||
|
noSpace="-S ''"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then
|
||||||
|
__pv-migrate_debug "Activating keep order."
|
||||||
|
keepOrder="-V"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
|
||||||
|
# File extension filtering
|
||||||
|
local filteringCmd
|
||||||
|
filteringCmd='_files'
|
||||||
|
for filter in ${completions[@]}; do
|
||||||
|
if [ ${filter[1]} != '*' ]; then
|
||||||
|
# zsh requires a glob pattern to do file filtering
|
||||||
|
filter="\*.$filter"
|
||||||
|
fi
|
||||||
|
filteringCmd+=" -g $filter"
|
||||||
|
done
|
||||||
|
filteringCmd+=" ${flagPrefix}"
|
||||||
|
|
||||||
|
__pv-migrate_debug "File filtering command: $filteringCmd"
|
||||||
|
_arguments '*:filename:'"$filteringCmd"
|
||||||
|
elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then
|
||||||
|
# File completion for directories only
|
||||||
|
local subdir
|
||||||
|
subdir="${completions[1]}"
|
||||||
|
if [ -n "$subdir" ]; then
|
||||||
|
__pv-migrate_debug "Listing directories in $subdir"
|
||||||
|
pushd "${subdir}" >/dev/null 2>&1
|
||||||
|
else
|
||||||
|
__pv-migrate_debug "Listing directories in ."
|
||||||
|
fi
|
||||||
|
|
||||||
|
local result
|
||||||
|
_arguments '*:dirname:_files -/'" ${flagPrefix}"
|
||||||
|
result=$?
|
||||||
|
if [ -n "$subdir" ]; then
|
||||||
|
popd >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
return $result
|
||||||
|
else
|
||||||
|
__pv-migrate_debug "Calling _describe"
|
||||||
|
if eval _describe $keepOrder "completions" completions $flagPrefix $noSpace; then
|
||||||
|
__pv-migrate_debug "_describe found some completions"
|
||||||
|
|
||||||
|
# Return the success of having called _describe
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
__pv-migrate_debug "_describe did not find completions."
|
||||||
|
__pv-migrate_debug "Checking if we should do file completion."
|
||||||
|
if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then
|
||||||
|
__pv-migrate_debug "deactivating file completion"
|
||||||
|
|
||||||
|
# We must return an error code here to let zsh know that there were no
|
||||||
|
# completions found by _describe; this is what will trigger other
|
||||||
|
# matching algorithms to attempt to find completions.
|
||||||
|
# For example zsh can match letters in the middle of words.
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
# Perform file completion
|
||||||
|
__pv-migrate_debug "Activating file completion"
|
||||||
|
|
||||||
|
# We must return the result of this command, so it must be the
|
||||||
|
# last command, or else we must store its result to return it.
|
||||||
|
_arguments '*:filename:_files'" ${flagPrefix}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# don't run the completion function when being source-ed or eval-ed
|
||||||
|
if [ "$funcstack[1]" = "_pv-migrate" ]; then
|
||||||
|
_pv-migrate
|
||||||
|
fi
|
|
@ -1,34 +0,0 @@
|
||||||
# vim:set ft=zsh
|
|
||||||
pydirs="${PYENVS_DIR:-$XDG_DATA_HOME/virtualenv}"
|
|
||||||
function chpwd_activate(){
|
|
||||||
[[ "$(pwd)" == "/" ]] && return 0
|
|
||||||
for pydir in $(ls $pydirs); do
|
|
||||||
if [[ "$(pwd | sed -e 's|/|~|g' | cut -c2-)" =~ "^${pydir}$" ]] || [[ "r-$(pwd | sed -e 's|/|~|g' | cut -c2-)" =~ "^${pydir}(~.+)?$" ]]; then
|
|
||||||
if [ "x$VIRTUAL_ENV" != "x$pydirs/$pydir" ]; then
|
|
||||||
source "$pydirs/$pydir/bin/activate"
|
|
||||||
fi
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [ "x$VIRTUAL_ENV" != "x" ]; then
|
|
||||||
deactivate
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function venv(){
|
|
||||||
[[ "$(pwd)" == "/" ]] && echo "Cannot create venv at root" && return 1
|
|
||||||
[[ "$(pwd)" != "/" ]] && envdir=$(pwd | sed -e 's|/|~|g' | cut -c2-)
|
|
||||||
[[ "$1" == "-r" ]] && envdir="r-$envdir" # create a venv that will be activated for all subdirectories as well
|
|
||||||
if [ ! -e "$pydirs/${envdir}" ]; then
|
|
||||||
echo "Creating python venv for ${envdir}.."
|
|
||||||
mkdir "$pydirs" -p
|
|
||||||
python3 -m venv "$pydirs/${envdir}"
|
|
||||||
echo "Activating virtual env ${envdir}"
|
|
||||||
source "$pydirs/${envdir}/bin/activate"
|
|
||||||
else
|
|
||||||
echo "A venv for this path already exists"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
autoload -U add-zsh-hook
|
|
||||||
add-zsh-hook chpwd chpwd_activate
|
|
|
@ -1,64 +1,99 @@
|
||||||
:root{
|
/* ---------------------------------------------------------------------------------------- */
|
||||||
--uc-toolbox-rotation: 85deg; /* Scale between 0 and 90 to determine the hitbox to unhide the toolbar */
|
/* Autohide entire top bar */
|
||||||
|
/* ---------------------------------------------------------------------------------------- */
|
||||||
|
/* :root{ */
|
||||||
|
/* --uc-toolbox-rotation: 85deg; /* Scale between 0 and 90 to determine the hitbox to unhide the toolbar */ */
|
||||||
|
/* } */
|
||||||
|
/**/
|
||||||
|
/* :root[sizemode="maximized"]{ */
|
||||||
|
/* --uc-toolbox-rotation: 88.5deg; */
|
||||||
|
/* } */
|
||||||
|
/**/
|
||||||
|
/* :root[sizemode="fullscreen"], */
|
||||||
|
/* #navigator-toolbox[inFullscreen]{ margin-top: 0 !important; } */
|
||||||
|
/**/
|
||||||
|
/* #navigator-toolbox{ */
|
||||||
|
/* position: fixed !important; */
|
||||||
|
/* display: block; */
|
||||||
|
/* background-color: var(--lwt-accent-color,black) !important; */
|
||||||
|
/* transform-origin: top; */
|
||||||
|
/* transform: rotateX(var(--uc-toolbox-rotation)); */
|
||||||
|
/* opacity: 0; */
|
||||||
|
/* line-height: 0; */
|
||||||
|
/* z-index: 1; */
|
||||||
|
/* pointer-events: none; */
|
||||||
|
/* } */
|
||||||
|
/**/
|
||||||
|
/**/
|
||||||
|
/* /* #mainPopupSet:hover ~ box > toolbox, */ */
|
||||||
|
/* #navigator-toolbox:hover, */
|
||||||
|
/* #navigator-toolbox:focus-within{ */
|
||||||
|
/* transform: rotateX(0); */
|
||||||
|
/* opacity: 1; */
|
||||||
|
/* } */
|
||||||
|
/**/
|
||||||
|
/* #navigator-toolbox > *{ line-height: normal; pointer-events: auto } */
|
||||||
|
/**/
|
||||||
|
/* #navigator-toolbox, */
|
||||||
|
/* #navigator-toolbox > *{ */
|
||||||
|
/* width: 100vw; */
|
||||||
|
/* -moz-appearance: none !important; */
|
||||||
|
/* } */
|
||||||
|
/**/
|
||||||
|
/* :root:not([sessionrestored]) #navigator-toolbox{ transform:none !important } */
|
||||||
|
/**/
|
||||||
|
/* :root[customizing] #navigator-toolbox{ */
|
||||||
|
/* position: relative !important; */
|
||||||
|
/* transform: none !important; */
|
||||||
|
/* opacity: 1 !important; */
|
||||||
|
/* } */
|
||||||
|
/**/
|
||||||
|
/* #navigator-toolbox[inFullscreen] > #PersonalToolbar, */
|
||||||
|
/* #PersonalToolbar[collapsed="true"]{ display: none } */
|
||||||
|
/**/
|
||||||
|
/* /* Uncomment the following for compatibility with tabs_on_bottom.css - this isn't well tested though */ */
|
||||||
|
/* /* #navigator-toolbox{ flex-direction: column; display: flex; } */ */
|
||||||
|
/* /* #titlebar{ order: 2 } */ */
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------------------------- */
|
||||||
|
/* Autohide main toolbar bar */
|
||||||
|
/* ---------------------------------------------------------------------------------------- */
|
||||||
|
:root{ --uc-navbar-transform: -40px }
|
||||||
|
:root[uidensity="compact"]{ --uc-navbar-transform: -34px }
|
||||||
|
|
||||||
|
#navigator-toolbox > div{ display: contents; }
|
||||||
|
:root[sessionrestored] :where(#nav-bar,#PersonalToolbar,#tab-notification-deck,.global-notificationbox){
|
||||||
|
transform: translateY(var(--uc-navbar-transform))
|
||||||
}
|
}
|
||||||
|
:root:is([customizing],[chromehidden*="toolbar"]) :where(#nav-bar,#PersonalToolbar,#tab-notification-deck,.global-notificationbox){
|
||||||
:root[sizemode="maximized"]{
|
|
||||||
--uc-toolbox-rotation: 88.5deg;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[sizemode="fullscreen"],
|
|
||||||
#navigator-toolbox[inFullscreen]{ margin-top: 0 !important; }
|
|
||||||
|
|
||||||
#navigator-toolbox{
|
|
||||||
position: fixed !important;
|
|
||||||
display: block;
|
|
||||||
background-color: var(--lwt-accent-color,black) !important;
|
|
||||||
transform-origin: top;
|
|
||||||
transform: rotateX(var(--uc-toolbox-rotation));
|
|
||||||
opacity: 0;
|
|
||||||
line-height: 0;
|
|
||||||
z-index: 1;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#mainPopupSet:hover ~ box > toolbox,
|
|
||||||
/* Uncomment the above line to make toolbar visible if some popup is hovered */
|
|
||||||
#navigator-toolbox:hover,
|
|
||||||
#navigator-toolbox:focus-within{
|
|
||||||
transform: rotateX(0);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#navigator-toolbox > *{ line-height: normal; pointer-events: auto }
|
|
||||||
|
|
||||||
#navigator-toolbox,
|
|
||||||
#navigator-toolbox > *{
|
|
||||||
width: 100vw;
|
|
||||||
-moz-appearance: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* These two exist for oneliner compatibility */
|
|
||||||
#nav-bar{ width: var(--uc-navigationbar-width,100vw) }
|
|
||||||
#TabsToolbar{ width: calc(100vw - var(--uc-navigationbar-width,0px)) }
|
|
||||||
|
|
||||||
/* Don't apply transform before window has been fully created */
|
|
||||||
:root:not([sessionrestored]) #navigator-toolbox{ transform:none !important }
|
|
||||||
|
|
||||||
:root[customizing] #navigator-toolbox{
|
|
||||||
position: relative !important;
|
|
||||||
transform: none !important;
|
transform: none !important;
|
||||||
opacity: 1 !important;
|
opacity: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#navigator-toolbox[inFullscreen] > #PersonalToolbar,
|
#nav-bar:not([customizing]){
|
||||||
#PersonalToolbar[collapsed="true"]{ display: none }
|
opacity: 0;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
#TabsToolbar{ position: relative; z-index: 3 }
|
||||||
|
|
||||||
/* Uncomment this if tabs toolbar is hidden with hide_tabs_toolbar.css */
|
/* Show when toolbox is focused, like when urlbar has received focus */
|
||||||
/*#titlebar{ margin-bottom: -9px }*/
|
#navigator-toolbox:focus-within > .browser-toolbar{
|
||||||
|
transform: translateY(0);
|
||||||
|
opacity: 1;
|
||||||
|
transition-delay: 0s !important;
|
||||||
|
}
|
||||||
|
/* Show when toolbox is hovered */
|
||||||
|
#titlebar:hover ~ .browser-toolbar,
|
||||||
|
#nav-bar:hover,
|
||||||
|
#nav-bar:hover + #PersonalToolbar{
|
||||||
|
transform: translateY(0);
|
||||||
|
opacity: 1;
|
||||||
|
transition-delay: 0s !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* Uncomment the following for compatibility with tabs_on_bottom.css - this isn't well tested though */
|
/* Bookmarks toolbar needs so extra rules */
|
||||||
/*
|
#PersonalToolbar{ position: relative; z-index: 1 }
|
||||||
#navigator-toolbox{ flex-direction: column; display: flex; }
|
|
||||||
#titlebar{ order: 2 }
|
/* Move up the content view */
|
||||||
*/
|
:root[sessionrestored]:not([inFullscreen]) > body > #browser{ margin-top: var(--uc-navbar-transform); }
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit a82dbeed9037b866b5fa2fa1e473d84d97edff29
|
Subproject commit 22e85e82576d5948cc2e2f874eeab4c5ff38cb54
|
Loading…
Add table
Add a link
Reference in a new issue