mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
46 lines
1.2 KiB
Bash
46 lines
1.2 KiB
Bash
typeset -U path cdpath fpath manpath
|
|
for profile in ${(z)NIX_PROFILES}; do
|
|
fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions)
|
|
done
|
|
|
|
HELPDIR="@zsh@/share/zsh/$ZSH_VERSION/help"
|
|
|
|
autoload -U compinit && compinit
|
|
# History options should be set in .zshrc and after oh-my-zsh sourcing.
|
|
# See https://github.com/nix-community/home-manager/issues/177.
|
|
HISTSIZE="10000"
|
|
SAVEHIST="10000"
|
|
|
|
HISTFILE="/home/hm-user/.zsh_history"
|
|
mkdir -p "$(dirname "$HISTFILE")"
|
|
|
|
setopt HIST_FCNTL_LOCK
|
|
unsetopt APPEND_HISTORY
|
|
setopt HIST_IGNORE_DUPS
|
|
unsetopt HIST_IGNORE_ALL_DUPS
|
|
unsetopt HIST_SAVE_NO_DUPS
|
|
unsetopt HIST_FIND_NO_DUPS
|
|
setopt HIST_IGNORE_SPACE
|
|
unsetopt HIST_EXPIRE_DUPS_FIRST
|
|
setopt SHARE_HISTORY
|
|
unsetopt EXTENDED_HISTORY
|
|
|
|
|
|
|
|
|
|
yt() {
|
|
if [ "$#" -eq 0 ] || [ "$#" -gt 2 ]; then
|
|
echo "Usage: yt [-t | --timestamps] youtube-link"
|
|
echo "Use the '-t' flag to get the transcript with timestamps."
|
|
return 1
|
|
fi
|
|
|
|
transcript_flag="--transcript"
|
|
if [ "$1" = "-t" ] || [ "$1" = "--timestamps" ]; then
|
|
transcript_flag="--transcript-with-timestamps"
|
|
shift
|
|
fi
|
|
local video_link="$1"
|
|
fabric -y "$video_link" $transcript_flag
|
|
}
|
|
|