From 05ff84489a64da20d27a88d8f6300cebdd653bae Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Tue, 22 Sep 2020 17:30:46 -0700 Subject: [PATCH 1/4] moving blank chrome function --- zsh/.zsh/aliases.zsh | 15 --------------- zsh/.zsh/functions.zsh | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/zsh/.zsh/aliases.zsh b/zsh/.zsh/aliases.zsh index 02377db..732c52b 100644 --- a/zsh/.zsh/aliases.zsh +++ b/zsh/.zsh/aliases.zsh @@ -35,18 +35,3 @@ alias tm="tmux new-session -A -s main" # A crude speedtest with curl alias speedtest="curl -o /dev/null http://speedtest-nyc1.digitalocean.com/100mb.test" -# blank-chrome -function blank-chrome { - if [ "$@" ]; then - URL="$@" - else - URL="https://duckduckgo.com" - fi - TMPDIR=`mktemp -d /tmp/chrome-XXXXX` - if [ $IS_MAC ]; then - /Applications/Chromium.app/Contents/MacOS/Chromium --user-data-dir=$TMPDIR --no-first-run --no-make-default-browser "$URL" - else - chromium-browser --user-data-dir=$TMPDIR --no-first-run --no-make-default-browser "$URL" - fi - rm -rf $TMPDIR -} diff --git a/zsh/.zsh/functions.zsh b/zsh/.zsh/functions.zsh index 7e93d1d..108c557 100644 --- a/zsh/.zsh/functions.zsh +++ b/zsh/.zsh/functions.zsh @@ -34,5 +34,19 @@ extract() { fi } - +# blank-chrome +function blank-chrome { + if [ "$@" ]; then + URL="$@" + else + URL="https://duckduckgo.com" + fi + TMPDIR=`mktemp -d /tmp/chrome-XXXXX` + if [ $IS_MAC ]; then + /Applications/Chromium.app/Contents/MacOS/Chromium --user-data-dir=$TMPDIR --no-first-run --no-make-default-browser "$URL" + else + chromium-browser --user-data-dir=$TMPDIR --no-first-run --no-make-default-browser "$URL" + fi + rm -rf $TMPDIR +} From 68e2b1fd81a2a04b7bee8f2c87b9c0d38736c4a6 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Sun, 15 Nov 2020 07:21:26 -0800 Subject: [PATCH 2/4] using delta for diff viewer --- git/.gitconfig | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/git/.gitconfig b/git/.gitconfig index 2edcec5..e1daa00 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -27,12 +27,21 @@ [color "diff"] whitespace = red reverse [core] - whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol + 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 + default = simple + +[delta] + plus-color = "#012800" + minus-color = "#340001" + syntax-theme = Monokai Extended +[interactive] + diffFilter = delta --color-only + [commit] gpgsign = true [gpg] - program = /usr/local/bin/gpg + program = /usr/local/bin/gpg From ea489444b6be2a100fd22a453fbae121c6416383 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Sun, 15 Nov 2020 07:22:22 -0800 Subject: [PATCH 3/4] adding zsh homebrew completions if homebrew is installed --- zsh/.zsh/completion.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zsh/.zsh/completion.zsh b/zsh/.zsh/completion.zsh index 23b1ca3..5ef0c55 100644 --- a/zsh/.zsh/completion.zsh +++ b/zsh/.zsh/completion.zsh @@ -53,3 +53,10 @@ zstyle ':completion:*:ssh:*' tag-order users 'hosts:-host hosts:-domain:domain h zstyle ':completion:*:ssh:*' group-order hosts-domain hosts-host users hosts-ipaddr zstyle '*' single-ignored show +# include homebrew completions if available +if type brew &>/dev/null; then + FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH + + autoload -Uz compinit + compinit +fi From 5f169f6acd8b42a81e16567d3c49b118906cab84 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Sun, 15 Nov 2020 07:26:41 -0800 Subject: [PATCH 4/4] Adding mt function to zsh functions.zsh allows mosh and tmux to an arbitrary host --- zsh/.zsh/functions.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/zsh/.zsh/functions.zsh b/zsh/.zsh/functions.zsh index 108c557..3dad8cf 100644 --- a/zsh/.zsh/functions.zsh +++ b/zsh/.zsh/functions.zsh @@ -34,6 +34,20 @@ extract() { fi } + +# create an archive of a list of files, compress the archive, and encrypt the compressed archive +function archive-and-encrypt { + echo -n "Enter desired output filename: " + read filename + tar cJ $1 | \ + gpg -q -r andrew@amdavidson.com -s -e -o "$filename.tar.xz.gpg" +} + +# run mosh and tmux to a specific host +function mt { + mosh $1 -- tmux new-session -A -s main +} + # blank-chrome function blank-chrome { if [ "$@" ]; then