Skip to content

Instantly share code, notes, and snippets.

@lcobucci
Last active February 15, 2023 11:45
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lcobucci/0b487ae61cd06b48fffef534c7092ca7 to your computer and use it in GitHub Desktop.
Save lcobucci/0b487ae61cd06b48fffef534c7092ca7 to your computer and use it in GitHub Desktop.
My dot files
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
if [ -f /usr/share/git-core/contrib/completion/git-prompt.sh ]; then
source /usr/share/git-core/contrib/completion/git-prompt.sh
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
__has_parent_dir () {
# Utility function so we can test for things like .git/.hg without firing
# up a separate process
test -d "$1" && return 0;
current="."
while [ ! "$current" -ef "$current/.." ]; do
if [ -d "$current/$1" ]; then
return 0;
fi
current="$current/..";
done
return 1;
}
__vcs_name() {
if [ -d .svn ]; then
echo "-[svn]";
elif __has_parent_dir ".git"; then
echo "-[$(__git_ps1 'git %s')]";
elif __has_parent_dir ".hg"; then
echo "-[hg $(hg branch)]"
fi
}
black=$(tput -Txterm setaf 0)
red=$(tput -Txterm setaf 1)
green=$(tput -Txterm setaf 2)
yellow=$(tput -Txterm setaf 3)
dk_blue=$(tput -Txterm setaf 4)
pink=$(tput -Txterm setaf 5)
lt_blue=$(tput -Txterm setaf 6)
bold=$(tput -Txterm bold)
reset=$(tput -Txterm sgr0)
function enable_xdebug {
sudo mv /etc/opt/remi/php73/php.d/15-xdebug.ini{.disabled,}
sudo mv /etc/opt/remi/php74/php.d/15-xdebug.ini{.disabled,}
}
function disable_xdebug {
sudo mv /etc/opt/remi/php73/php.d/15-xdebug.ini{,.disabled}
sudo mv /etc/opt/remi/php74/php.d/15-xdebug.ini{,.disabled}
}
export EDITOR=vim
export PS1='\[$bold\]\[$black\][\[$dk_blue\]\@\[$black\]]-[\[$green\]\u\[$yellow\]@\[$green\]\h\[$black\]]-[\[$pink\]\w\[$black\]]\[\033[0;33m\]$(__vcs_name) \[\033[00m\]\[$reset\]\[$reset\]\$ '
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1
export PATH=$PATH:vendor/bin
alias ll='ls -la'
alias cp='cp -v'
alias mv='mv -v'
alias grep='grep --color=auto -in'
alias ..='cd ..'
syntax on
set number
set expandtab
set softtabstop=4
set autoread
set ruler
set spell spelllang=en_gb
au BufNewFile,BufRead COMMIT_EDITMSG set tw=72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment