mirror of
https://github.com/nikdoof/dotfiles.git
synced 2025-12-13 09:42:27 +00:00
Reorganise bash files
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
if [ $(uname) == "Darwin" ]; then
|
if [ $(uname) == "Darwin" ]; then
|
||||||
alias ls="ls -FG"
|
alias ls="ls -FG"
|
||||||
alias code="code-insiders"
|
alias code="code-insiders"
|
||||||
|
alias flushdns="sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder"
|
||||||
else
|
else
|
||||||
alias ls="ls -F --color=auto"
|
alias ls="ls -F --color=auto"
|
||||||
fi
|
fi
|
||||||
|
|||||||
2
bash/.bash/completions.bash
Normal file
2
bash/.bash/completions.bash
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# SSH completion based on ssh config
|
||||||
|
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2- | tr ' ' '\n')" scp sftp ssh;
|
||||||
39
bash/.bash/exports.bash
Normal file
39
bash/.bash/exports.bash
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# Prompt
|
||||||
|
export PS1="\[\e[0;90m\][\[\e[0;37m\]\u\[\e[0;37m\]@\[\e[0;37m\]\H\[\e[0;90m\]] \[\e[0;90m\](\[\e[0;37m\]\W\[\e[0;90m\]) \[\e[0;37m\]\$\[\e[0m\] "
|
||||||
|
|
||||||
|
# User specific environment and startup programs
|
||||||
|
export TZ=GB
|
||||||
|
export LANG=en_GB.UTF-8
|
||||||
|
|
||||||
|
# Make a sensible editor choice
|
||||||
|
if [ -x /usr/bin/nano ]; then
|
||||||
|
export EDITOR=nano
|
||||||
|
export VISUAL=nano
|
||||||
|
else
|
||||||
|
export EDITOR=vi
|
||||||
|
export VISUAL=vi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Go stuff
|
||||||
|
if [ -d /usr/local/go ]; then
|
||||||
|
export GOROOT=/usr/local/go/
|
||||||
|
export GOPATH=$HOME/go/
|
||||||
|
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
|
||||||
|
fi
|
||||||
|
|
||||||
|
# OSX Specific envs
|
||||||
|
if [ $(uname) == "Darwin" ]; then
|
||||||
|
# Shhh Catlina, we don't care!
|
||||||
|
export BASH_SILENCE_DEPRECATION_WARNING=1
|
||||||
|
|
||||||
|
# M1 specific hacks
|
||||||
|
if [ $(uname -p) == "arm" ]; then
|
||||||
|
# Stop golang progs having fun with Rosetta 2 (https://yaleman.org/post/2021/2021-01-01-apple-m1-terraform-and-golang/)
|
||||||
|
export GODEBUG=asyncpreemptoff=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# https://github.com/oz/tz
|
||||||
|
if [ -f $HOME/go/bin/tz ]; then
|
||||||
|
export TZ_LIST="America/New_York,America/Los_Angeles,Europe/Paris"
|
||||||
|
fi
|
||||||
@@ -1,53 +1,6 @@
|
|||||||
# .bash_profile
|
|
||||||
|
|
||||||
# Get the aliases and functions
|
# Get the aliases and functions
|
||||||
if [ -f ~/.bashrc ]; then
|
if [ -f $HOME/.bashrc ]; then
|
||||||
. ~/.bashrc
|
source $HOME/.bashrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# User specific environment and startup programs
|
|
||||||
export TZ=GB
|
|
||||||
export LANG=en_GB.UTF-8
|
|
||||||
|
|
||||||
# Make a sensible editor choice
|
|
||||||
if [ -x /usr/bin/nano ]; then
|
|
||||||
export EDITOR=nano
|
|
||||||
export VISUAL=nano
|
|
||||||
else
|
|
||||||
export EDITOR=vi
|
|
||||||
export VISUAL=vi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Load iTerm2 integration, for all hosts
|
|
||||||
source ~/.bash/iterm2_integration.bash
|
|
||||||
|
|
||||||
# OSX Specific envs
|
|
||||||
if [ $(uname) == "Darwin" ]; then
|
|
||||||
# Shhh Catlina, we don't care!
|
|
||||||
export BASH_SILENCE_DEPRECATION_WARNING=1
|
|
||||||
|
|
||||||
# M1 specific hacks
|
|
||||||
if [ $(uname -p) == "arm" ]; then
|
|
||||||
# Stop golang progs having fun with Rosetta 2 (https://yaleman.org/post/2021/2021-01-01-apple-m1-terraform-and-golang/)
|
|
||||||
export GODEBUG=asyncpreemptoff=1
|
|
||||||
|
|
||||||
# Homebrew
|
|
||||||
if [ -d /opt/homebrew ]; then
|
|
||||||
eval $(/opt/homebrew/bin/brew shellenv)
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Go stuff
|
|
||||||
if [ -d /usr/local/go ]; then
|
|
||||||
export GOROOT=/usr/local/go/
|
|
||||||
export GOPATH=$HOME/go/
|
|
||||||
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
|
|
||||||
fi
|
|
||||||
|
|
||||||
# https://github.com/oz/tz
|
|
||||||
if [ -f $HOME/go/bin/tz ]; then
|
|
||||||
export TZ_LIST="America/New_York,America/Los_Angeles,Europe/Paris"
|
|
||||||
fi
|
|
||||||
|
|
||||||
export PS1="\[\e[0;90m\][\[\e[0;37m\]\u\[\e[0;37m\]@\[\e[0;37m\]\H\[\e[0;90m\]] \[\e[0;90m\](\[\e[0;37m\]\W\[\e[0;90m\]) \[\e[0;37m\]\$\[\e[0m\] "
|
|
||||||
|
|||||||
26
bash/.bashrc
26
bash/.bashrc
@@ -5,16 +5,32 @@ if [ -f /etc/bashrc ]; then
|
|||||||
. /etc/bashrc
|
. /etc/bashrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# User specific environment
|
||||||
|
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
|
||||||
|
export PATH
|
||||||
|
|
||||||
# Source functions, if it exists
|
# Source functions, if it exists
|
||||||
if [ -e $HOME/.bash/functions.bash ]; then
|
if [ -f $HOME/.bash/functions.bash ]; then
|
||||||
source $HOME/.bash/functions.bash
|
source $HOME/.bash/functions.bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Source aliases, if it exists
|
# Source aliases, if it exists
|
||||||
if [ -e $$HOME/.bash/aliases.bash ]; then
|
if [ -f $HOME/.bash/aliases.bash ]; then
|
||||||
source $HOME/.bash/aliases.bash
|
source $HOME/.bash/aliases.bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# User specific environment
|
# Source exports, if it exists
|
||||||
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
|
if [ -f $HOME/.bash/exports.bash ]; then
|
||||||
export PATH
|
source $HOME/.bash/exports.bash
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Source completions, if it exists
|
||||||
|
if [ -f $HOME/.bash/exports.bash ]; then
|
||||||
|
source $HOME/.bash/completions.bash
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Load iTerm2 integration, for all hosts
|
||||||
|
source ~/.bash/iterm2_integration.bash
|
||||||
|
|
||||||
|
# Homebrew
|
||||||
|
[ -d /opt/homebrew ]; eval $(/opt/homebrew/bin/brew shellenv)
|
||||||
Reference in New Issue
Block a user