From 06f3dd4cb23a972bc86178b6de14983a661ed587 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Fri, 6 Jan 2023 21:26:34 -0800 Subject: [PATCH 1/9] store git credentials --- git/.gitconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git/.gitconfig b/git/.gitconfig index 5bbd23f..e480901 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -43,3 +43,5 @@ [commit] gpgsign = false +[credential] + helper = store From 9534971f9ca6f0944a01514ee65d73131e2da97b Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Fri, 6 Jan 2023 21:28:26 -0800 Subject: [PATCH 2/9] use main as the default git branch --- git/.gitconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git/.gitconfig b/git/.gitconfig index e480901..d8ac7e3 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -45,3 +45,5 @@ gpgsign = false [credential] helper = store +[init] + defaultBranch = main From 992cf340ae63b3238132f3479eeb05fc8662d415 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Mon, 9 Jan 2023 06:52:55 -0800 Subject: [PATCH 3/9] sourcing bash completion for fzf only if it exists --- bash/.bashrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bash/.bashrc b/bash/.bashrc index bf80358..8dca77b 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -238,7 +238,10 @@ function mt { # Debian if [ -d /usr/share/doc/fzf/examples ]; then source /usr/share/doc/fzf/examples/key-bindings.bash - source /usr/share/doc/fzf/examples/completion.bash + + if [-f /usr/share/doc/fzf/examples/completion.bash]; then + source /usr/share/doc/fzf/examples/completion.bash + fi fi # MacOS From 57d749b04a4288a7a6b9373c94eb04f7ec7d5dc4 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Mon, 9 Jan 2023 07:01:57 -0800 Subject: [PATCH 4/9] fixing typo --- bash/.bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash/.bashrc b/bash/.bashrc index 8dca77b..423eb79 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -239,7 +239,7 @@ function mt { if [ -d /usr/share/doc/fzf/examples ]; then source /usr/share/doc/fzf/examples/key-bindings.bash - if [-f /usr/share/doc/fzf/examples/completion.bash]; then + if [ -f /usr/share/doc/fzf/examples/completion.bash ]; then source /usr/share/doc/fzf/examples/completion.bash fi fi From 3d0bca4c35e484350c630dc3d398151d59613083 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Tue, 10 Jan 2023 21:37:02 -0800 Subject: [PATCH 5/9] adding vim-commentary --- vim/.vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vim/.vimrc b/vim/.vimrc index f3fa8ea..23f1e37 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -50,6 +50,8 @@ autocmd BufWritePre *.py execute ':Black' " Smart Line Numbers Plug 'myusuf3/numbers.vim' +Plug 'tpope/vim-commentary' + call plug#end() " ==================== Vim Settings ==================== From 9d30e171e440edb1f5c6fdab1a3d930e641d4796 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Tue, 10 Jan 2023 22:23:20 -0800 Subject: [PATCH 6/9] adding git details to bash prompt. fixes #2 --- bash/.bashrc | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/bash/.bashrc b/bash/.bashrc index 423eb79..349a772 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -66,9 +66,41 @@ sh_yellow="\[\033[1;33m\]" sh_light_gray="\[\033[0;37m\]" sh_white="\[\033[1;37m\]" +function git_prompt { + PCHANGED="" + PAHEAD="" + PBEHIND="" + local FULL_BRANCH="$(git symbolic-ref -q HEAD 2>/dev/null || git name-rev --name-only --no-undefined --always HEAD 2>/dev/null)" + PBRANCH="$(echo $FULL_BRANCH | sed 's/refs\/heads\///')" + if [ -n $PBRANCH ]; then + echo -n "${PBRANCH} " + # Are there unstaged changes in the working directory + local CHANGED=$(git status --porcelain --ignore-submodule -unormal 2>/dev/null | wc -l) + if [ $CHANGED -gt 0 ]; then + PCHANGED="◊" + fi + # Are we behind the origin? + local NUM_BEHIND="$(git log --oneline ..@{u} 2>/dev/null | wc -l | tr -d ' ' )" + if [ "$NUM_BEHIND" -gt 0 ]; then + PBEHIND="↓" + fi + # Are we ahead of the origin? + local NUM_AHEAD="$(git log --oneline @{u}.. 2>/dev/null | wc -l | tr -d ' ')" + if [ "$NUM_AHEAD" -gt 0 ]; then + PAHEAD="↑" + fi + + if [[ -n $PCHANGED || -n $PAHEAD || -n $PBEHIND ]]; then + echo -n "${PCHANGED}${PBEHIND}${PAHEAD}" + fi + fi +} + + + # Make a pretty prompt. export PROMPT_COMMAND='history -a; if [ $? -ne 0 ];then ERROR_FLAG=1;else ERROR_FLAG=;fi;' -export PS1=${HOSTCOLOUR}${sh_light_gray}'\t | \h'${sh_green}':\w'${sh_light_gray}' '${sh_light_gray}'${ERROR_FLAG:+'${sh_light_red}'}\$ '${sh_norm} +export PS1=${HOSTCOLOUR}${sh_light_gray}'\t | \h'${sh_green}':\w'${sh_light_gray}' $(git_prompt)'${sh_light_gray}'${ERROR_FLAG:+'${sh_light_red}'}\$ '${sh_norm} # New files and folders should not be world readable umask 0027 From 228fa5c061a3a0d1d0a808164a069548b7d43bfa Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Wed, 11 Jan 2023 09:20:36 -0800 Subject: [PATCH 7/9] adding some color to bash ls --- bash/.bashrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bash/.bashrc b/bash/.bashrc index 349a772..182b965 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -165,16 +165,16 @@ alias e="exit" alias g="grep --color=auto -i " # shorter ls -alias l="ls -G" +alias l="ls -G --color" # list files with details -alias ll="ls -lh" +alias ll="ls -lh --color" # list all files. -alias la="ls -alh" +alias la="ls -alh --color" # List directories. -alias ld="ls -Gd */" +alias ld="ls --color -Gd */" # add some color to grep. alias grep="grep --color=auto" From 1b8b051c7b55c1b7e3c8ef5eb6d4dc4f1c75cd6e Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Thu, 12 Jan 2023 22:54:35 -0800 Subject: [PATCH 8/9] adding gpg signing back in, updated key --- git/.gitconfig | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/git/.gitconfig b/git/.gitconfig index d8ac7e3..1ad4c0a 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -1,19 +1,22 @@ [user] name = Andrew Davidson - email = andrew@amdavidson.com - signingkey = 17AF8F2A49CF25C6 + email = andrew@andr3w.net + signingkey = F1199FC0A76BB402 [color] ui = auto + [color "branch"] current = yellow reverse local = yellow - remote = green + remote = green + [color "diff"] meta = yellow bold frag = magenta bold old = red bold - new = green bold + new = green bold + [color "status"] added = yellow changed = green @@ -23,14 +26,18 @@ ui = true diff = auto status = auto - branch = auto + branch = auto + [color "diff"] - whitespace = red reverse + whitespace = red reverse + [core] whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol pager = delta + [alias] lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative" + [push] default = simple @@ -38,12 +45,15 @@ plus-color = "#012800" minus-color = "#340001" syntax-theme = Monokai Extended + [interactive] diffFilter = delta --color-only [commit] - gpgsign = false + gpgsign = true + [credential] - helper = store + helper = store + [init] defaultBranch = main From b71302eb91e016d584bf96a9ece404ad18f117f3 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Sat, 14 Jan 2023 13:23:37 -0800 Subject: [PATCH 9/9] removing old references --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 4154c40..4337b05 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,8 @@ These are generic dotfiles intended for use across any platform. ## Supported Configurations * bash -* conky * emacs * git -* i3 * mutt * offlineimap * khard @@ -20,7 +18,7 @@ These are generic dotfiles intended for use across any platform. Following the best practices of the local platform install `git` and `stow`. ``` -$ git clone git@git.sr.ht:~amdavidson/dotfiles $HOME/.dotfiles +$ git clone https://pretend.work/amd/dotfiles.git $HOME/.dotfiles $ cd $HOME/.dotfiles $ stow {scripts,bash,git,tmux,vim} ```