From 0ef3bd7a55028cd9d4b3695f50fdc1214f7b6210 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Thu, 11 Jun 2020 05:04:00 +0200 Subject: [PATCH] init --- README.md | 10 ++++++++++ base | 47 +++++++++++++++++++++++++++++++++++++++++++++++ dot_files | 9 +++++++++ media | 7 +++++++ mkcd | 6 ++++++ rsync | 3 +++ update | 26 ++++++++++++++++++++++++++ youtube-dl-cmd | 8 ++++++++ 8 files changed, 116 insertions(+) create mode 100644 README.md create mode 100644 base create mode 100644 dot_files create mode 100644 media create mode 100644 mkcd create mode 100644 rsync create mode 100644 update create mode 100644 youtube-dl-cmd diff --git a/README.md b/README.md new file mode 100644 index 0000000..03d552b --- /dev/null +++ b/README.md @@ -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''' diff --git a/base b/base new file mode 100644 index 0000000..2c9b2c2 --- /dev/null +++ b/base @@ -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" diff --git a/dot_files b/dot_files new file mode 100644 index 0000000..6921356 --- /dev/null +++ b/dot_files @@ -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 +} diff --git a/media b/media new file mode 100644 index 0000000..b610c3d --- /dev/null +++ b/media @@ -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 +} diff --git a/mkcd b/mkcd new file mode 100644 index 0000000..86aac6c --- /dev/null +++ b/mkcd @@ -0,0 +1,6 @@ + +function mkcd() { + mkdir $1 && cd $1 +} + + diff --git a/rsync b/rsync new file mode 100644 index 0000000..7ae793a --- /dev/null +++ b/rsync @@ -0,0 +1,3 @@ +function rsync_cp() { + rsync -avzhruP $1 $2 +} diff --git a/update b/update new file mode 100644 index 0000000..e7b1ccb --- /dev/null +++ b/update @@ -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 +} + diff --git a/youtube-dl-cmd b/youtube-dl-cmd new file mode 100644 index 0000000..0636ea4 --- /dev/null +++ b/youtube-dl-cmd @@ -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"