mirror of
https://github.com/GeorgeSG/dotfiles.git
synced 2026-09-06 09:28:45 +00:00
Split in folders
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
##### Platform independent #####
|
||||
|
||||
# Files
|
||||
alias df1="du -h -d 1"
|
||||
alias ls='ls -hG'
|
||||
alias ll='ls -alhFG'
|
||||
alias la='ls -AG'
|
||||
alias l='ls -CFG'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
|
||||
# Git Aliases
|
||||
alias g="git"
|
||||
alias ga="git add"
|
||||
alias gr="git rm"
|
||||
alias gc="git commit"
|
||||
alias gs="git status -s"
|
||||
alias gss="git status"
|
||||
alias gd="git diff"
|
||||
alias gds="git diff --staged"
|
||||
alias gco="git checkout"
|
||||
alias gcom="git checkout master"
|
||||
alias gpom="git pull origin master"
|
||||
alias gbd="git branch -D"
|
||||
alias gm="git mergetool"
|
||||
alias gmc="git merge --continue"
|
||||
alias grc="git rebase --continue"
|
||||
|
||||
# tmux
|
||||
alias tm="tmux -2 attach-session -t "default" || tmux -2 new-session -s \"default\""
|
||||
alias tmv="tmux -2 attach-session -t "vscode" || tmux -2 new-session -s \"vscode\""
|
||||
alias tmks="tmux kill-session -t"
|
||||
alias tmas="tmux attach-session -t"
|
||||
alias tmls="tmux list-sessions"
|
||||
|
||||
# Docker
|
||||
alias dc="docker compose"
|
||||
alias de="docker exec"
|
||||
alias dr="docker run"
|
||||
alias db="docker build"
|
||||
alias ds="docker stop"
|
||||
alias drm="docker rm"
|
||||
alias drmi="docker rmi"
|
||||
alias dps="docker ps"
|
||||
alias dl="docker logs"
|
||||
|
||||
# Editing files
|
||||
alias aliases="code ~/.bash_aliases"
|
||||
alias vimrc="vim ~/.vimrc"
|
||||
|
||||
# NPM
|
||||
alias npr="npm run"
|
||||
|
||||
# IP addresses
|
||||
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
|
||||
alias localip="ipconfig getifaddr en0"
|
||||
|
||||
alias grep="grep --color=auto"
|
||||
alias c="clear"
|
||||
alias be="bundle exec"
|
||||
alias serve="python -m http.server 9000"
|
||||
alias yda="youtube-dl -x --audio-format mp3"
|
||||
|
||||
# CD-ing to some commonly used folders
|
||||
alias og="cd ~/Git"
|
||||
|
||||
##### Mac OS Specific #####
|
||||
alias fl="open -a ForkLift"
|
||||
|
||||
if [ -f ~/.bash_aliases.local ]; then
|
||||
. ~/.bash_aliases.local
|
||||
fi
|
||||
@@ -0,0 +1,91 @@
|
||||
# Set prompt
|
||||
IFS='.' read -ra split_hostname <<<$(hostname | tr '[:upper:]' '[:lower:]')
|
||||
HOSTNAME=${split_hostname[0]}
|
||||
PS1='\[\e[1;4;36m\]$HOSTNAME\[\e[1;0m\] \[\e[1;32m\]\w\[\e[m\]\[\e[1;0m\] \[\e[0m\] \[\e[1;0m\]'
|
||||
export TERM=xterm-256color
|
||||
|
||||
shopt -s cdspell
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# Enable some Bash 4 features when possible:
|
||||
# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux`
|
||||
# * Recursive globbing, e.g. `echo **/*.txt`
|
||||
for option in autocd globstar; do
|
||||
shopt -s "$option" 2> /dev/null;
|
||||
done;
|
||||
|
||||
# Disable Caret-C output
|
||||
stty -ctlecho
|
||||
|
||||
set -o vi
|
||||
bind -m vi-insert "\C-l":clear-screen
|
||||
|
||||
#so as not to be disturbed by Ctrl-S ctrl-Q in terminals:
|
||||
stty -ixon
|
||||
|
||||
######################
|
||||
# History Management #
|
||||
######################
|
||||
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=5000
|
||||
HISTFILESIZE=2000
|
||||
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
# See bash(1) for more options
|
||||
HISTCONTROL=ignoreboth
|
||||
|
||||
######################
|
||||
# Aliases #
|
||||
######################
|
||||
|
||||
# enable color support of ls
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
fi
|
||||
|
||||
# Editor
|
||||
export EDITOR='code -w'
|
||||
|
||||
# bash-git-prompt
|
||||
GIT_PROMPT_ONLY_IN_REPO=1
|
||||
GIT_PROMPT_START="\[\e[1;4;36m\]$HOSTNAME\[\e[1;0m\] \[\e[1;32m\]\w\[\e[m\]"
|
||||
GIT_PROMPT_END="\[\e[1;m\] \[\e[1;m\]"
|
||||
|
||||
|
||||
# Disable deprecation warning on mac
|
||||
export BASH_SILENCE_DEPRECATION_WARNING=1
|
||||
|
||||
######################
|
||||
# Sources & exports #
|
||||
######################
|
||||
|
||||
if [ -f ~/.bash_aliases ]; then
|
||||
source ~/.bash_aliases
|
||||
fi
|
||||
|
||||
if [ -f ~/.bash_profile.local ]; then
|
||||
source ~/.bash_profile.local
|
||||
fi
|
||||
|
||||
# bash-git prompt
|
||||
if [ -f ~/.bash-git-prompt/gitprompt.sh ]; then
|
||||
source ~/.bash-git-prompt/gitprompt.sh
|
||||
fi
|
||||
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
|
||||
source /etc/bash_completion
|
||||
fi
|
||||
|
||||
# Git completion
|
||||
if [ -f ~/.git-completion.bash ]; then
|
||||
source ~/.git-completion.bash
|
||||
fi
|
||||
@@ -0,0 +1 @@
|
||||
[ -n "$PS1" ] && source ~/.bash_profile;
|
||||
Reference in New Issue
Block a user