diff --git a/home/dot_gitconfig.tmpl b/home/dot_config/git/config similarity index 71% rename from home/dot_gitconfig.tmpl rename to home/dot_config/git/config index 85bcf57..46ea44b 100644 --- a/home/dot_gitconfig.tmpl +++ b/home/dot_config/git/config @@ -4,12 +4,28 @@ status = always interactive = always diff = true +[color "branch"] + current = yellow reverse + local = yellow + remote = green +[color "diff"] + frag = magenta bold + meta = yellow bold + new = green bold + old = red bold + whitespace = red reverse +[color "status"] + added = yellow + changed = green + untracked = cyan +[status] + short = true + branch = true [user] name = Maximilian Friedersdorff - email = {{ .email | quote }} -[core] - editor = nvim - excludesfile = {{ .chezmoi.homeDir }}/.gitignore + email = "max@gwairfelin.com" +[includeIf "gitdir:~/src/esl/"] + path = ~/.config/git/config-esl [diff] tool = vimdiff [merge] @@ -22,10 +38,9 @@ hist = log --graph --full-history --all --pretty=format:'%Cred%h%Creset %G? %ad %s %C(bold blue)<%an>%Creset %C(yellow)%d%Creset' --date=short struct = log --graph --full-history --all --pretty=format:'%ad %s %Creset %C(yellow)%d%Creset' --date=short --simplify-by-decoration co = checkout - ci = commit - st = status - br = branch - df = diff + c = commit + s = status + d = diff commit = commit -S vt = tag -v tag = tag -s @@ -43,3 +58,5 @@ smtpserverport = 587 [mergetool "vimdiff"] cmd = nvim -d $LOCAL $BASE $REMOTE $MERGED -c "$wincmd w" -c "wincmd J" +[help] + autoCorrect = immediate diff --git a/home/dot_config/git/config-esl b/home/dot_config/git/config-esl new file mode 100644 index 0000000..202a00b --- /dev/null +++ b/home/dot_config/git/config-esl @@ -0,0 +1,2 @@ +[user] + email = "maximilian.friedersdorff@envsys.co.uk" diff --git a/home/dot_config/git/ignore b/home/dot_config/git/ignore new file mode 100644 index 0000000..81272bd --- /dev/null +++ b/home/dot_config/git/ignore @@ -0,0 +1,52 @@ +## VIM specific patterns +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + + +## Linux specific patterns +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + + +## Python specific settings +# Rope project settings +.ropeproject + +# Distribution / packaging +.Python +build/ +dist/ +*.egg +*.egg-info/ + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] diff --git a/home/dot_config/starship.toml b/home/dot_config/starship.toml new file mode 100644 index 0000000..82866be --- /dev/null +++ b/home/dot_config/starship.toml @@ -0,0 +1,2 @@ +[status] +disabled = false diff --git a/home/dot_gitignore b/home/dot_gitignore deleted file mode 100644 index 6c5ee8d..0000000 --- a/home/dot_gitignore +++ /dev/null @@ -1,6 +0,0 @@ -[._]*.s[a-w][a-z] -[._]s[a-w][a-z] -*.un~ -Session.vim -.netrwhist -*~ diff --git a/home/dot_shell_aliases b/home/dot_shell_aliases new file mode 100644 index 0000000..e8be3e1 --- /dev/null +++ b/home/dot_shell_aliases @@ -0,0 +1,29 @@ +if [ -x /usr/bin/dircolors ]; then + 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 + +function la { + ls_out=$(\ls -lah --color=always "$@") + let "allowed_lines = $(tput lines) - 3" + if [ $(echo "$ls_out" | wc -l) -le $allowed_lines ]; then + echo "$ls_out" + else + echo "$ls_out" | less -r + fi +} + +function search() { + quoted=$(python -c "import urllib.parse, sys; print(urllib.parse.quote_plus(' '.join(sys.argv[1:])))" "${@}") + w3m "https://duckduckgo.com/?q=${quoted}" +} + +alias black='black --line-length 99' + +alias cdtmp='cd $(mktemp -d)' + +alias g='git' diff --git a/home/dot_zshenv b/home/dot_zshenv index df70155..242842d 100644 --- a/home/dot_zshenv +++ b/home/dot_zshenv @@ -18,13 +18,6 @@ export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quo export EDITOR="nvim" export TMPDIR="/tmp/${USER}" -export GIT_PS1_SHOWDIRTYSTATE=true -export GIT_PS1_SHOWSTASHSTATE=true -export GIT_PS1_SHOWUNTRACKEDFILEDS=true -export GIT_PS1_SHOWUPSTREAM="verbose" -export GIT_PS1_DESCRIBE_STYLE="branch" -export GIT_PS1_SHOWCOLORHINTS="color" - eval $(dircolors ~/.dir_colors) export GPG_TTY=$(tty) diff --git a/home/dot_zshrc b/home/dot_zshrc index 95d1940..d264a8a 100644 --- a/home/dot_zshrc +++ b/home/dot_zshrc @@ -28,16 +28,6 @@ unsetopt beep notify bindkey -v # End of lines configured by zsh-newuser-install -# Prompt -NEWLINE=$'\n' -setopt prompt_subst - - -p="%(?;%F{green};%F{red})[%h]%f " -p+="%F{red}%B%n%b%f@%F{red}%B%m%b%f" -p+=":%F{blue}%~%f" -p+="${NEWLINE}%(!.#.$) " - virtual_env() { if [ -n "${VIRTUAL_ENV+1}" ]; then home_rel_path=$(echo ${VIRTUAL_ENV} | sed "s;^${HOME};~;") @@ -45,11 +35,6 @@ virtual_env() { fi } -source ~/.git-prompt.sh -precmd () { - __git_ps1 "" "$(virtual_env)${p}" "${NEWLINE}[%s]${NEWLINE}" -} - bindkey '^R' history-incremental-search-backward if [[ -f ~/.shell_aliases ]]; then @@ -106,3 +91,5 @@ scrot() { grim -g "$(slurp)" "$tmp_file" echo "$tmp_file" } + +eval "$(starship init zsh)" diff --git a/home/run_onchange_before_install-packages.sh b/home/run_onchange_before_install-packages.sh index 02d98e1..16f3c12 100755 --- a/home/run_onchange_before_install-packages.sh +++ b/home/run_onchange_before_install-packages.sh @@ -11,4 +11,5 @@ sudo pacman -Syu --needed \ firefox \ claws-mail \ tmux \ - age + age \ + starship