Add default zshrc from bashrc, add warning in Makefile to add git email if missing
This commit is contained in:
parent
87d890c75a
commit
a50e6cfca6
25
.bashrc
25
.bashrc
|
@ -1,17 +1,4 @@
|
||||||
#!/bin/bash
|
|
||||||
# vim: ft=sh
|
# vim: ft=sh
|
||||||
|
|
||||||
# Return if called by load leveller
|
|
||||||
# if [[ -n "$LOADL_ACTIVE" ]] ; then
|
|
||||||
# return
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
|
||||||
# case $- in
|
|
||||||
# *i*) ;;
|
|
||||||
# *) return;;
|
|
||||||
# esac
|
|
||||||
|
|
||||||
# Source global definitions
|
# Source global definitions
|
||||||
if [ -f /etc/bashrc ]; then
|
if [ -f /etc/bashrc ]; then
|
||||||
. /etc/bashrc
|
. /etc/bashrc
|
||||||
|
@ -20,6 +7,12 @@ fi
|
||||||
# set PATH so it includes user's private bin if it exists
|
# set PATH so it includes user's private bin if it exists
|
||||||
grep "$HOME/.local/bin" "$PATH" > /dev/null 2>&1 || export PATH="$HOME/.local/bin:$PATH"
|
grep "$HOME/.local/bin" "$PATH" > /dev/null 2>&1 || export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
|
||||||
|
# set PATH so it includes homebrew bin directories if they exist
|
||||||
|
HOMEBREW_BIN="/opt/homebrew/bin"
|
||||||
|
HOMEBREW_SBIN="/opt/homebrew/sbin"
|
||||||
|
grep "$HOMEBREW_SBIN" "$PATH" > /dev/null 2>&1 || export PATH="$HOMEBREW_SBIN:$PATH"
|
||||||
|
grep "$HOMEBREW_BIN" "$PATH" > /dev/null 2>&1 || export PATH="$HOMEBREW_BIN:$PATH"
|
||||||
|
|
||||||
# enable color support of ls and also add handy aliases
|
# enable color support of ls and also add handy aliases
|
||||||
if [ -x /usr/bin/dircolors ]; then
|
if [ -x /usr/bin/dircolors ]; then
|
||||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||||
|
@ -43,10 +36,14 @@ alias ll='ls -alF'
|
||||||
alias la='ls -A'
|
alias la='ls -A'
|
||||||
alias l='ls -CF'
|
alias l='ls -CF'
|
||||||
|
|
||||||
|
|
||||||
command -v nvim > /dev/null 2>&1 && export EDITOR=nvim || export EDITOR=vi
|
command -v nvim > /dev/null 2>&1 && export EDITOR=nvim || export EDITOR=vi
|
||||||
command -v xed > /dev/null 2>&1 && export VISUAL=xed || export VISUAL=vi
|
command -v xed > /dev/null 2>&1 && export VISUAL=xed || export VISUAL=vi
|
||||||
|
|
||||||
|
alias lg="lazygit"
|
||||||
|
alias nvimdiff="nvim -d"
|
||||||
|
alias vim="nvim"
|
||||||
|
alias vimdiff="nvim -d"
|
||||||
|
|
||||||
if [ -f "$HOME/.bashrc.local" ] ; then
|
if [ -f "$HOME/.bashrc.local" ] ; then
|
||||||
source "$HOME/.bashrc.local"
|
source "$HOME/.bashrc.local"
|
||||||
fi
|
fi
|
||||||
|
|
55
.zshrc
Normal file
55
.zshrc
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
# vim: ft=zsh
|
||||||
|
# Source global definitions
|
||||||
|
if [ -f /etc/zshrc ]; then
|
||||||
|
. /etc/zshrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set PATH so it includes user's private bin if it exists
|
||||||
|
LOCAL_BIN="$HOME/.local/bin"
|
||||||
|
grep "$LOCAL_BIN" "$PATH" > /dev/null 2>&1 || export PATH="$LOCAL_BIN:$PATH"
|
||||||
|
|
||||||
|
# set PATH so it includes homebrew bin directories if they exist
|
||||||
|
HOMEBREW_BIN="/opt/homebrew/bin"
|
||||||
|
HOMEBREW_SBIN="/opt/homebrew/sbin"
|
||||||
|
grep "$HOMEBREW_SBIN" "$PATH" > /dev/null 2>&1 || export PATH="$HOMEBREW_SBIN:$PATH"
|
||||||
|
grep "$HOMEBREW_BIN" "$PATH" > /dev/null 2>&1 || export PATH="$HOMEBREW_BIN:$PATH"
|
||||||
|
|
||||||
|
# enable color support of ls and also add handy aliases
|
||||||
|
if [ -x /usr/bin/dircolors ]; then
|
||||||
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||||
|
alias ls='ls --color=auto'
|
||||||
|
alias dir='dir --color=auto'
|
||||||
|
alias vdir='vdir --color=auto'
|
||||||
|
|
||||||
|
alias grep='grep --color=auto'
|
||||||
|
alias fgrep='fgrep --color=auto'
|
||||||
|
alias egrep='egrep --color=auto'
|
||||||
|
fi
|
||||||
|
|
||||||
|
# colored GCC warnings and errors
|
||||||
|
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||||
|
|
||||||
|
# set LANG to be something sensible
|
||||||
|
export LANG="en_GB.utf-8"
|
||||||
|
|
||||||
|
# some more ls aliases
|
||||||
|
alias ll='ls -alF'
|
||||||
|
alias la='ls -A'
|
||||||
|
alias l='ls -CF'
|
||||||
|
|
||||||
|
command -v nvim > /dev/null 2>&1 && export EDITOR=nvim || export EDITOR=vi
|
||||||
|
command -v xed > /dev/null 2>&1 && export VISUAL=xed || export VISUAL=vi
|
||||||
|
|
||||||
|
alias lg="lazygit"
|
||||||
|
alias nvimdiff="nvim -d"
|
||||||
|
alias vim="nvim"
|
||||||
|
alias vimdiff="nvim -d"
|
||||||
|
|
||||||
|
if [ -f "$HOME/.zshrc.local" ] ; then
|
||||||
|
source "$HOME/.zshrc.local"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PYENV_ROOT="$HOME/.pyenv"
|
||||||
|
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
|
||||||
|
command -v direnv > /dev/null 2>&1 && eval "$(direnv hook zsh)"
|
||||||
|
command -v starship > /dev/null 2>&1 && eval "$(starship init zsh)"
|
12
Makefile
12
Makefile
|
@ -17,14 +17,14 @@ POETRY_DIR := $(HOME)/.local/share/pypoetry
|
||||||
|
|
||||||
.PHONY: all clean check link unlink install uninstall pacman
|
.PHONY: all clean check link unlink install uninstall pacman
|
||||||
|
|
||||||
all: link install
|
all: link install config/git/user_email
|
||||||
|
|
||||||
clean: unlink uninstall
|
clean: unlink uninstall
|
||||||
|
|
||||||
check:
|
check:
|
||||||
echo "Placeholder"
|
echo "Placeholder"
|
||||||
|
|
||||||
link: $(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.bashrc $(HOME)/.ssh/sockets
|
link: $(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.bashrc $(HOME)/.zshrc $(HOME)/.ssh/sockets
|
||||||
|
|
||||||
unlink:
|
unlink:
|
||||||
for link in $(CONFIG_TARGETS); do rm "$$link"; done
|
for link in $(CONFIG_TARGETS); do rm "$$link"; done
|
||||||
|
@ -40,12 +40,16 @@ uninstall:
|
||||||
rm -rf $(POETRY_DIR)
|
rm -rf $(POETRY_DIR)
|
||||||
rm -rf config/nvim/.venv
|
rm -rf config/nvim/.venv
|
||||||
|
|
||||||
|
config/git/user_email:
|
||||||
|
echo "Missing user_email; Add your email to $$(readlink -f config/git)/user_email"
|
||||||
|
|
||||||
$(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/%
|
$(CONFIG_TARGETS): $(CONFIG_DIR)/%: config/%
|
||||||
$(SSH_TARGETS): $(SSH_DIR)/%: ssh/%
|
$(SSH_TARGETS): $(SSH_DIR)/%: ssh/%
|
||||||
$(THEMES_TARGETS): $(THEMES_DIR)/%: themes/%
|
$(THEMES_TARGETS): $(THEMES_DIR)/%: themes/%
|
||||||
$(HOME)/.bashrc: $(HOME)/%: %
|
$(HOME)/.bashrc: $(HOME)/%: %
|
||||||
$(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.bashrc:
|
$(HOME)/.zshrc: $(HOME)/%: %
|
||||||
ln -s $(PWD)/$? -t $$(dirname $@)
|
$(CONFIG_TARGETS) $(SSH_TARGETS) $(THEMES_TARGETS) $(HOME)/.bashrc $(HOME)/.zshrc:
|
||||||
|
ln -s $(PWD)/$? $@
|
||||||
|
|
||||||
$(LAZY_DIR):
|
$(LAZY_DIR):
|
||||||
git clone --depth 1 $(LAZY_REPO) $@
|
git clone --depth 1 $(LAZY_REPO) $@
|
||||||
|
|
Loading…
Reference in a new issue