Compare commits
No commits in common. "master" and "8720932be24d5344e37a15742c80f6d2cbc2a332" have entirely different histories.
master
...
8720932be2
7
.zshrc
7
.zshrc
|
@ -10,10 +10,6 @@ case $TERM in (xterm*)
|
||||||
TERM=xterm-256color
|
TERM=xterm-256color
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -f $HOME/.profile ]; then
|
|
||||||
source $HOME/.profile
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Source local zsh configs
|
# Source local zsh configs
|
||||||
if [ -f $HOME/.zshrc_local ]; then
|
if [ -f $HOME/.zshrc_local ]; then
|
||||||
source $HOME/.zshrc_local
|
source $HOME/.zshrc_local
|
||||||
|
@ -29,7 +25,7 @@ fi
|
||||||
# Source color tags for hostnames
|
# Source color tags for hostnames
|
||||||
if [ -f $HOME/.zsh_host_colors ]; then
|
if [ -f $HOME/.zsh_host_colors ]; then
|
||||||
source $HOME/.zsh_host_colors
|
source $HOME/.zsh_host_colors
|
||||||
HOST_COLOR="${HOST_COLORS[$(cat /etc/hostname | tr -d '\n')]}"
|
HOST_COLOR="${HOST_COLORS[$(hostname | tr -d '\n')]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Default to none if not defined
|
# Default to none if not defined
|
||||||
|
@ -64,4 +60,3 @@ for plugin in $PLUGINS; do
|
||||||
source $plugin
|
source $plugin
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
declare -a LOCAL_BINS
|
declare -a LOCAL_BINS
|
||||||
LOCAL_BINS=( "$HOME/.local/bin" "$HOME/Projects/env/bin" "/usr/local/bin" "/usr/local/sbin" )
|
LOCAL_BINS=( "$HOME/.local/bin" "$HOME/Projects/env/bin" "/usr/local/bin" "/usr/local/sbin" )
|
||||||
for bin in $LOCAL_BINS; do
|
for bin in LOCAL_BINS; do
|
||||||
if [ -e $bin ]; then
|
if [ -e $bin ]; then
|
||||||
PATH="$PATH:$bin"
|
$PATH="$PATH:$bin"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
export PATH
|
|
||||||
|
|
|
@ -5,63 +5,24 @@ if [ -n "$LOCALCITY" ]; then
|
||||||
alias weatherfetch="curl -sf https://wttr.in/$LOCALCITY | head -n 7 && echo ''"
|
alias weatherfetch="curl -sf https://wttr.in/$LOCALCITY | head -n 7 && echo ''"
|
||||||
fi
|
fi
|
||||||
if [ -n "$DESKTOP_SESSION" ]; then
|
if [ -n "$DESKTOP_SESSION" ]; then
|
||||||
# winver is a thing, so here's linver
|
alias linuxver="nohup zenity --info --text=\"Linux version: \\n$(uname -srm)\" > /dev/null"
|
||||||
alias linver="nohup zenity --info --text=\"Linux version: \\n$(uname -srm)\" > /dev/null"
|
|
||||||
# tools to manipulate xclip easier
|
|
||||||
alias paste="xclip -o -selection clipboard"
|
alias paste="xclip -o -selection clipboard"
|
||||||
alias copy="xclip -o | xclip -i -selection clipboard"
|
alias copy="xclip -o | xclip -i -selection clipboard"
|
||||||
fi
|
fi
|
||||||
# unless you're using vim to this day, this is what most people do
|
|
||||||
alias vim="nvim"
|
alias vim="nvim"
|
||||||
function nojail() {
|
function nojail() {
|
||||||
# specific tool for firejail to disable jailing at all
|
|
||||||
PATH=`echo $PATH | sed "s/:\/usr\/local\/bin//g" | sed "s/:\/usr\/local\/sbin//g"` $@
|
PATH=`echo $PATH | sed "s/:\/usr\/local\/bin//g" | sed "s/:\/usr\/local\/sbin//g"` $@
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set a default music path
|
if which flashplayer > /dev/null; then
|
||||||
if [ -z "$MUSIC_PATH" ]; then
|
function z0rde() {
|
||||||
export MUSIC_PATH="$HOME/Music/"
|
local id
|
||||||
|
id="$1"
|
||||||
|
if [ "$1" == "" ]; then
|
||||||
|
id="$((1 + $RANDOM % 8000))"
|
||||||
|
fi
|
||||||
|
echo $id
|
||||||
|
flashplayer "https://z0r.de/L/z0r-de_$id.swf"
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Try to be sensible about youtube-dl downloader
|
|
||||||
if ! which yt-dlp > /dev/null; then
|
|
||||||
if ! which youtube-dl > /dev/null; then
|
|
||||||
alias yt-dlp="echo Unable to execute: youtube-dl or yt-dlp not found; false "
|
|
||||||
else
|
|
||||||
# No, really. Not even an ad, it just runs faster because people keep fixing the throttling issue, which youtube-dl got stuck on.
|
|
||||||
alias yt-dlp="echo youtube-dl is heavily outdated, consider installing yt-dlp; youtube-dl "
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
function ytdl() {
|
|
||||||
# Download and convert to audio a youtube video
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
echo "USAGE: ytdl <video name or URL>"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
mkdir -p $MUSIC_PATH/ytdl
|
|
||||||
yt-dlp -x --default-search "ytsearch:" --output "$MUSIC_PATH/ytdl/%(title)s.%(ext)s" $1
|
|
||||||
}
|
|
||||||
|
|
||||||
function scdl() {
|
|
||||||
# Download audio from soundcloud
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
echo "USAGE: scdl <audio name or URL>"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
mkdir -p $MUSIC_PATH/soundclown
|
|
||||||
yt-dlp -x --default-search "scsearch:" --output "$MUSIC_PATH/soundclown/%(title)s.%(ext)s" $1
|
|
||||||
}
|
|
||||||
|
|
||||||
function countlines() {
|
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
echo "USAGE: countlines <file extension>"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
for file in $(find . -name \*.$1); do
|
|
||||||
cat $file
|
|
||||||
done | wc -l
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
autoload bashcompinit
|
|
||||||
bashcompinit
|
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit
|
||||||
compinit
|
compinit
|
||||||
# ZSH menu styling
|
# ZSH menu styling
|
||||||
|
@ -8,19 +6,14 @@ zstyle :compinstall filename '/home/yessiest/.zshrc'
|
||||||
zstyle ':completion:*' completer _extensions _complete _approximate
|
zstyle ':completion:*' completer _extensions _complete _approximate
|
||||||
zstyle ':completion:*' use-cache on
|
zstyle ':completion:*' use-cache on
|
||||||
zstyle ':completion:*' cache-path "$HOME/.cache/zsh/.zcompcache"
|
zstyle ':completion:*' cache-path "$HOME/.cache/zsh/.zcompcache"
|
||||||
zstyle ':completion:*' menu select
|
zstyle ':completion:*' menu select
|
||||||
zstyle ':completion:*' group-name ''
|
|
||||||
# Colors for descriptions
|
# Colors for descriptions
|
||||||
zstyle ':completion:*:*:*:*:descriptions' format '%F{green} %B%d%b:%f'
|
zstyle ':completion:*:*:*:*:descriptions' format '%F{green} %d:%f'
|
||||||
zstyle ':completion:*:*:*:*:corrections' format '%F{yellow} %B%d%b (errors: %e):%f'
|
zstyle ':completion:*:*:*:*:corrections' format '%F{yellow} %d (errors: %e):%f'
|
||||||
# Custom coloring for options
|
# Custom coloring for options
|
||||||
zstyle ':completion:*:options' list-colors '=(#b)*(-- *)=0=38;5;241'
|
zstyle ':completion:*:options' list-colors '=(#b)*(-- *)=0=38;5;241'
|
||||||
zstyle ':completion:*:commands' list-colors '=(#b)*(-- *)=0=38;5;241'
|
|
||||||
# wtf git
|
|
||||||
zstyle ':completion:*:*:git*' list-colors '=(#b)*(-- *)=0=38;5;241'
|
|
||||||
|
|
||||||
# Custom coloring for processes
|
# Custom coloring for processes
|
||||||
zstyle ':completion:*:processes' list-colors '=(#b) #([0-9]#)*( *[a-z])*=0=38;5;242=32'
|
zstyle ':completion:*:processes' list-colors '=(#b) #([0-9]#)*( *[a-z])*=0=38;5;242=32'
|
||||||
# Colors for LS
|
# Colors for LS
|
||||||
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
||||||
setopt GLOB_COMPLETE LIST_ROWS_FIRST
|
|
||||||
|
|
|
@ -3,12 +3,6 @@ bindkey "^[[1;5C" forward-word #Ctrl+right goes forwards one word
|
||||||
bindkey "^[[1;5D" backward-word #Ctrl+left goes backwards one word
|
bindkey "^[[1;5D" backward-word #Ctrl+left goes backwards one word
|
||||||
bindkey "^[[1;3C" forward-word #Alt+right goes forwards one word
|
bindkey "^[[1;3C" forward-word #Alt+right goes forwards one word
|
||||||
bindkey "^[[1;3D" backward-word #Alt+left goes backwards one word
|
bindkey "^[[1;3D" backward-word #Alt+left goes backwards one word
|
||||||
if echo "$TERM" | grep xterm >> /dev/null; then
|
bindkey '^[[H' beginning-of-line #Home goes to the beginning of the line
|
||||||
# Applies specifically to xterm - tested on st, and it doesn't seem to work
|
bindkey '^[[F' end-of-line #End goes to the end of the line
|
||||||
bindkey '^[[H' beginning-of-line #Home goes to the beginning of the line
|
|
||||||
bindkey '^[[F' end-of-line #End goes to the end of the line
|
|
||||||
else
|
|
||||||
# Applies to all terminals (hopefully)
|
|
||||||
bindkey '^[[H' beginning-of-line #Home goes to the beginning of the line
|
|
||||||
bindkey '^[[4~' end-of-line #End goes to the end of the line
|
|
||||||
fi
|
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main)
|
|
||||||
typeset -A ZSH_HIGHLIGHT_STYLES
|
|
||||||
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]="fg=magenta"
|
|
||||||
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]="fg=magenta"
|
|
||||||
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]="fg=cyan"
|
|
||||||
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]="fg=cyan"
|
|
||||||
ZSH_HIGHLIGHT_STYLES[single-quoted-argument-unclosed]="fg=cyan"
|
|
||||||
ZSH_HIGHLIGHT_STYLES[double-quoted-argument-unclosed]="fg=cyan"
|
|
||||||
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]="fg=cyan"
|
|
||||||
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument-unclosed]="fg=cyan"
|
|
|
@ -1,2 +0,0 @@
|
||||||
alias ip="ip --color=auto"
|
|
||||||
alias ls="ls --color=auto"
|
|
|
@ -6,7 +6,6 @@ This is my zsh config made from scratch to avoid using the overblown OhMyZsh con
|
||||||
- Plugins autoloading (i guess? currently it just sources zsh-syntax-highlight)
|
- Plugins autoloading (i guess? currently it just sources zsh-syntax-highlight)
|
||||||
- (somewhat) colored autocompletion menu
|
- (somewhat) colored autocompletion menu
|
||||||
- Aliases of little to none practical value (as of yet)
|
- Aliases of little to none practical value (as of yet)
|
||||||
- *Humane* default bindings (whose bright idea was it to implement HOME and END button behaviour as ctrl-a and ctrl-e?)
|
|
||||||
- ...And potentially much more
|
- ...And potentially much more
|
||||||
|
|
||||||
# License
|
# License
|
||||||
|
|
Loading…
Reference in New Issue