From 61c27e32ce0bd6174b510f33f5441f6eed6ab104 Mon Sep 17 00:00:00 2001 From: Paul Walko Date: Tue, 26 Nov 2019 14:18:41 -0500 Subject: [PATCH] add macos stuff --- Makefile | 2 ++ vimrc | 6 +++--- zprofile | 2 ++ zshrc | 50 ++++++++++++++++++++++++++++++++++++-------------- 4 files changed, 43 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 1c5fc35..b27a7ef 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ gnupg_symlinks = gpg-agent.conf local_install: aliases Xresources xbindkeysrc xinitrc offlineimaprc urlview msmtprc zprofile zshrc vimrc vim termite dircolors-solarized oh-my-zsh i3 gitconfig config gpg-agent.conf +mac_local_install: zprofile zshrc vimrc vim dircolors-solarized oh-my-zsh gpg-agent.conf tmux.conf + remote_install: vim vimrc dircolors-solarized zshrc aliases oh-my-zsh zprofile tmux.conf noroot_install: bash_profile diff --git a/vimrc b/vimrc index 53eea4a..6294789 100644 --- a/vimrc +++ b/vimrc @@ -46,9 +46,9 @@ nnoremap l :CodeQuery Call nnoremap r :CodeQuery Caller nnoremap e :CodeQuery Callee -"" Set tabs to 4 spaces -set tabstop=4 -set shiftwidth=4 +"" Set tabs to 2 spaces +set tabstop=2 +set shiftwidth=2 set expandtab "" Stupid backspace setting diff --git a/zprofile b/zprofile index f09ea07..ed658bc 100644 --- a/zprofile +++ b/zprofile @@ -1 +1,3 @@ xbindkeys &> /dev/null + +export PATH="$HOME/.cargo/bin:$PATH" diff --git a/zshrc b/zshrc index d4b0061..a94f2c4 100644 --- a/zshrc +++ b/zshrc @@ -1,10 +1,10 @@ -source $HOME/.aliases +#source $HOME/.aliases # Set TERM for proper tmux colors if [[ -z $TMUX ]]; then - export TERM='xterm-256color' + export TERM='xterm-256color' else - export TERM='screen-256color' + export TERM='screen-256color' fi # Customl binaries @@ -13,11 +13,10 @@ export PATH=$HOME/.cargo/bin:$PATH export GOPATH=$HOME/go export PATH=$HOME/.local/share/flatpak/exports/bin:$PATH export PATH=$HOME/.local/minecraft-launcher:$PATH - # ZSH export ZSH=$HOME/.oh-my-zsh -ZSH_THEME="steeef" -plugins=(git history-substring-search) +ZSH_THEME='steeef' +plugins=(git history-substring-search docker docker-compose) source $ZSH/oh-my-zsh.sh ## Keybindings @@ -26,28 +25,51 @@ bindkey '^J' history-beginning-search-forward bindkey '^w' backward-kill-word bindkey '\e[2~' insert-last-word if [ -f /etc/os-release ]; then - . /etc/os-release - if [ "$ID" = "rhel" ]; then - bindkey '\e[1~' beginning-of-line - bindkey '\e[4~' end-of-line - fi + . /etc/os-release + if [ "$ID" = 'rhel' ]; then + bindkey '\e[1~' beginning-of-line + bindkey '\e[4~' end-of-line + fi fi # GPG/SSH ## Void: Install pcsclite, pcsc-ccid, gnupg2-scdaemon ## Yubico openpgp: https://support.yubico.com/support/solutions/articles/15000006420-using-your-yubikey-with-openpgp +# Run if NOT ssh session if [ -z "$SSH_CLIENT" ] || [ -z "$SSH_TTY" ]; then + CONTINUE=true + if [[ "$OSTYPE" == 'darwin'* ]]; then + eval `ssh-agent` + ssh-add -t 48h -s $OPENSC_LIBS/opensc-pkcs11.so + CONTINUE=false + fi + + if [[ "$CONTINUE" == true ]]; then unset SSH_AGENT_PID if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" fi export GPG_TTY=$(tty) gpg-connect-agent updatestartuptty /bye >/dev/null + fi +fi + +if [[ "$OSTYPE" == 'darwin'* ]]; then + export CLICOLOR=YES + export PATH=/usr/local/opt/python/libexec/bin:$PATH + export PATH=/usr/local/opt/ncurses/bin:$PATH + export PATH=$PATH:$HOME/.linkerd2/bin + export OPENSC_LIBS=/usr/local/lib + source $HOME/.cargo/env + # ssh-agent config + eval `ssh-agent` + ssh-add -t 48h -s $OPENSC_LIBS/opensc-pkcs11.so + if [ "$?" -ne 0 ]; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" +elif [[ "$OSTYPE" == 'linux-gnu' ]]; then + eval `dircolors ~/.config/dircolors-solarized/dircolors.256dark` fi # VIM ## Reduce delay swithing between normal & insert mode export KEYTIMEOUT=1 - -# Fancy tui dircolors -eval `dircolors ~/.config/dircolors-solarized/dircolors.256dark`