init
This commit is contained in:
commit
0ef3bd7a55
8 changed files with 116 additions and 0 deletions
10
README.md
Normal file
10
README.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
# ZSH Config Snippets
|
||||
|
||||
This is a Collection of little ZSHRC Snippets that can be modularly merged into one .zshrc file
|
||||
|
||||
# Usage
|
||||
|
||||
Specify the features you want in the cat command
|
||||
|
||||
## Example
|
||||
'''cat base mkcd update > ~/.zshrc'''
|
47
base
Normal file
47
base
Normal file
|
@ -0,0 +1,47 @@
|
|||
# Set up the prompt
|
||||
|
||||
autoload -Uz promptinit
|
||||
promptinit
|
||||
#prompt adam1
|
||||
PROMPT='%n@%m: %~ $ '
|
||||
|
||||
setopt histignorealldups sharehistory
|
||||
setopt autocd
|
||||
|
||||
# Use emacs keybindings even if our EDITOR is set to vi
|
||||
bindkey -e
|
||||
|
||||
# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
|
||||
HISTSIZE=1000
|
||||
SAVEHIST=1000
|
||||
HISTFILE=~/.zsh_history
|
||||
|
||||
# Use modern completion system
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
zstyle ':completion:*' auto-description 'specify: %d'
|
||||
zstyle ':completion:*' completer _expand _complete _correct _approximate
|
||||
zstyle ':completion:*' format 'Completing %d'
|
||||
zstyle ':completion:*' group-name ''
|
||||
zstyle ':completion:*' menu select=2
|
||||
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
||||
zstyle ':completion:*' list-colors ''
|
||||
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
|
||||
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
|
||||
zstyle ':completion:*' menu select=long
|
||||
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
|
||||
zstyle ':completion:*' use-compctl false
|
||||
zstyle ':completion:*' verbose true
|
||||
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
|
||||
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
|
||||
|
||||
# User
|
||||
|
||||
export EDITOR="nano"
|
||||
export PATH=~/bin:$PATH
|
||||
alias zshconfig="nano ~/.zshrc"
|
||||
alias zshrefresh="source ~/.zshrc"
|
||||
alias ls="ls --color=always"
|
||||
alias la="ls -lah --color=always"
|
9
dot_files
Normal file
9
dot_files
Normal file
|
@ -0,0 +1,9 @@
|
|||
function find_dot_files() {
|
||||
find . -name '.DS_Store';
|
||||
find . -name '._*';
|
||||
}
|
||||
|
||||
function clean_dot_files() {
|
||||
find . -name '.DS_Store' -type f -delete;
|
||||
find . -name '._*' -type f -delete
|
||||
}
|
7
media
Normal file
7
media
Normal file
|
@ -0,0 +1,7 @@
|
|||
function convert() {
|
||||
for i in *.$1; do ffmpeg -i "$i" "${i%.*}.$2"; done
|
||||
}
|
||||
|
||||
function mkvToMp4() {
|
||||
for i in *.mkv; do ffmpeg -i "$i" -map 0 -c copy "${i%.*}.mp4"; done
|
||||
}
|
6
mkcd
Normal file
6
mkcd
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
function mkcd() {
|
||||
mkdir $1 && cd $1
|
||||
}
|
||||
|
||||
|
3
rsync
Normal file
3
rsync
Normal file
|
@ -0,0 +1,3 @@
|
|||
function rsync_cp() {
|
||||
rsync -avzhruP $1 $2
|
||||
}
|
26
update
Normal file
26
update
Normal file
|
@ -0,0 +1,26 @@
|
|||
|
||||
function update() {
|
||||
if type "apt-get" &> /dev/null; then
|
||||
sudo apt-get update;
|
||||
sudo apt-get upgrade;
|
||||
sudo apt-get dist-upgrade;
|
||||
fi
|
||||
if type "pacman" &> /dev/null; then
|
||||
sudo pacman -Syu;
|
||||
fi
|
||||
if type "yum" &> /dev/null; then
|
||||
yum upgrade;
|
||||
fi
|
||||
if type "snap" &> /dev/null; then
|
||||
sudo snap refresh;
|
||||
fi
|
||||
if type "flatpak" &> /dev/null; then
|
||||
flatpak update;
|
||||
fi
|
||||
if type "brew" &> /dev/null; then
|
||||
brew update;
|
||||
brew upgrade;
|
||||
brew cask upgrade;
|
||||
fi
|
||||
}
|
||||
|
8
youtube-dl-cmd
Normal file
8
youtube-dl-cmd
Normal file
|
@ -0,0 +1,8 @@
|
|||
|
||||
alias downloadVid="youtube-dl -o \"%(title)s.%(ext)s\" -f \"bestvideo[height<=1080][ext=webm]+bestaudio\" --write-thumbnail"
|
||||
|
||||
alias downloadVid1440="youtube-dl -o \"%(title)s.%(ext)s\" -f \"bestvideo[height<=1440][ext=webm]+bestaudio\" --write-thumbnail"
|
||||
|
||||
alias downloadVid4K="youtube-dl -o \"%(title)s.%(ext)s\" -f \"bestvideo[height<=2160][ext=webm]+bestaudio\" --write-thumbnail"
|
||||
|
||||
alias downloadAudio="youtube-dl -o \"%(playlist_index)s %(title)s.%(ext)s\" -x"
|
Loading…
Add table
Reference in a new issue