From 5ff53e0c013d08c2ea4a6ce0d2155fa7bce03aa2 Mon Sep 17 00:00:00 2001 From: tiynger Date: Thu, 3 Oct 2019 17:23:39 +0200 Subject: [PATCH] changing shellconfig directories for better structure --- .bashrc | 2 +- .config/shell/aliasrc | 78 ++++++++++++++++++++++++++++++++++++++ .config/shell/bashspecific | 2 + .config/shell/shellrc | 19 ++++++++++ .config/shell/shortcutrc | 1 + .config/shell/zshspecific | 1 + .zshrc | 2 +- 7 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 .config/shell/aliasrc create mode 100644 .config/shell/bashspecific create mode 100644 .config/shell/shellrc create mode 100644 .config/shell/shortcutrc create mode 100644 .config/shell/zshspecific diff --git a/.bashrc b/.bashrc index 080e6da..ad8f1c1 120000 --- a/.bashrc +++ b/.bashrc @@ -1 +1 @@ -.config/shellrc \ No newline at end of file +.config/shell/shellrc \ No newline at end of file diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc new file mode 100644 index 0000000..78a9447 --- /dev/null +++ b/.config/shell/aliasrc @@ -0,0 +1,78 @@ +#!/bin/sh + +# bash +alias ":wq"="exit" +alias ":q"="exit" + +# calcurse +alias cal="calcurse-caldav --init=keep-remote && calcurse" +alias calchange="cd ~/.calcurse/caldav" + +# cd +alias ".."="cd .." +alias "..1"="cd .." +alias "..2"="cd ../.." +alias "..3"="cd ../../.." +alias "..4"="cd ../../../.." +alias "..5"="cd ../../../../.." + +# cp +alias cp="cp -i" + +# clear +alias c="clear" + +# config +alias config="/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME" + +# fzf +sc() { find ~/.config/* ~/.local/bin/* -type f | fzf | xargs -r $EDITOR ;} +sd() { find ~/ownCloud/* -type f | grep ".pdf" | fzf | xargs -r $READER ;} + +# git +alias TexHandout="cp ~/github/Tools/LaTeX\ Templates/LaTeX\ Handout/Handout.tex" + +# grep +alias grep="grep --color=auto" + +# lastpass +alias lastpass="lpass" + +# ls(d) +alias l="lsd" +alias la="lsd -la" +alias ll="lsd -l" +alias tree="lsd --tree" + +# mkdir +alias mkdir="mkdir -p" + +# mount +alias mount="mount |column -t" + +# mv +alias mv="mv -i" + +# pacman +alias pac="sudo pacman" +alias pacclean="sudo pacman -Rs $(pacman -Qtdq)" + +# ping +alias ping="ping -c 5" + +# rm +alias rm="rm -i" + +# root/sudo +alias root="sudo -i" +alias su="sudo -i" + +# nvim +alias svim="sudo nvim" +command -v nvim >/dev/null && alias vim="nvim" vimdiff="nvim -d" + +# weather +alias weather="curl wttr.in" + +# various +alias fuck='sudo $(history -p !!)' diff --git a/.config/shell/bashspecific b/.config/shell/bashspecific new file mode 100644 index 0000000..574730d --- /dev/null +++ b/.config/shell/bashspecific @@ -0,0 +1,2 @@ +#!/bin/bash +shopt -s autocd #Allows you to cd into directory without cd diff --git a/.config/shell/shellrc b/.config/shell/shellrc new file mode 100644 index 0000000..48f1e59 --- /dev/null +++ b/.config/shell/shellrc @@ -0,0 +1,19 @@ +#!/bin/bash +set -o vi +stty -ixon # Disable ctrl-s and ctrl-q. +HISTSIZE=10000 +SAVEHIST=10000 +HISTFILE=~/.cache/shell/history + +[ -f "$HOME/.config/shell/shortcutrc" ] && source "$HOME/.config/shell/shortcutrc" # Load shortcut aliases +[ -f "$HOME/.config/shell/aliasrc" ] && source "$HOME/.config/shell/aliasrc" # Load aliases + +# Load options depending on current shell +if [ $(echo $0) = "/bin/zsh" ]; then + [ -f "$HOME/.config/shell/zspecific" ] && source "$HOME/.config/shell/zspecific" +fi +if [ $(echo $0) = "/bin/bash" ]; then + [ -f "$HOME/.config/shell/bashspecific" ] && source "$HOME/.config/shell/bashspecific" +fi + +pfetch && echo $(vrms) | grep "non-free" diff --git a/.config/shell/shortcutrc b/.config/shell/shortcutrc new file mode 100644 index 0000000..c40f433 --- /dev/null +++ b/.config/shell/shortcutrc @@ -0,0 +1 @@ +# vim: filetype=sh diff --git a/.config/shell/zshspecific b/.config/shell/zshspecific new file mode 100644 index 0000000..f7df9c2 --- /dev/null +++ b/.config/shell/zshspecific @@ -0,0 +1 @@ +#!/bin/zsh diff --git a/.zshrc b/.zshrc index 080e6da..ad8f1c1 120000 --- a/.zshrc +++ b/.zshrc @@ -1 +1 @@ -.config/shellrc \ No newline at end of file +.config/shell/shellrc \ No newline at end of file