Merge branch 'master' of https://git.scientificdatasystems.co.uk/robin/useful_linux_scripts
This commit is contained in:
commit
373c75216b
4
rename_mac.sh
Executable file
4
rename_mac.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
sudo scutil --set ComputerName $1
|
||||||
|
sudo scutil --set HostName $1
|
||||||
|
sudo scutil --set LocalHostName $1
|
||||||
|
|
||||||
81
zshrc.zshrc
Normal file
81
zshrc.zshrc
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
alias pyviz='source ~/pyviz/bin/activate'
|
||||||
|
|
||||||
|
export STM32_PRG_PATH=/Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/bin
|
||||||
|
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# Basic environment
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
|
export EDITOR=vi
|
||||||
|
export PAGER=less
|
||||||
|
export LANG=en_GB.UTF-8
|
||||||
|
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# History (zsh-native, better than bash)
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
|
HISTFILE=~/.zsh_history
|
||||||
|
HISTSIZE=50000
|
||||||
|
SAVEHIST=50000
|
||||||
|
|
||||||
|
setopt INC_APPEND_HISTORY
|
||||||
|
setopt SHARE_HISTORY
|
||||||
|
setopt HIST_IGNORE_ALL_DUPS
|
||||||
|
setopt HIST_REDUCE_BLANKS
|
||||||
|
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# Completion system
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
|
autoload -Uz compinit
|
||||||
|
compinit
|
||||||
|
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# Git branch helper (explicit NO GIT REPO)
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# Aliases (bash-compatible)
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
|
alias ll='ls -lh'
|
||||||
|
alias la='ls -A'
|
||||||
|
alias l='ls -CF'
|
||||||
|
alias gs='git status'
|
||||||
|
alias gd='git diff'
|
||||||
|
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# Path additions (example)
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
|
export PATH="$HOME/bin:$PATH"
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# Git branch helper (branch only, explicit NO GIT REPO)
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
|
git_branch() {
|
||||||
|
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||||
|
git symbolic-ref --short HEAD 2>/dev/null || echo "DETACHED"
|
||||||
|
else
|
||||||
|
echo "NO GIT REPO"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
# Prompt with colours
|
||||||
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
|
setopt PROMPT_SUBST
|
||||||
|
setopt NO_NOMATCH
|
||||||
|
|
||||||
|
# Colours:
|
||||||
|
# %F{colour} ... %f = foreground colour on/off
|
||||||
|
|
||||||
|
PROMPT='%n@%F{208}%m%f %F{green}%~%f [%F{red}$(git_branch)%f] %# '
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user