dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 19096403b1dcb053e19da0188017a2057ab0b618
parent f8345fa5377a80955b5943232b6592c5bd008ff0
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Wed, 31 Jan 2018 06:45:35 -0500

Rework profile and shrc. Add aliases.

Diffstat:
M.profile | 2--
M.shrc | 39++++++++++++++++++++++++---------------
2 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/.profile b/.profile @@ -28,14 +28,12 @@ else export LESSOPEN fi -# Keep the go folder hidden if type go > /dev/null 2>&1 then GOPATH="$HOME/.go" export GOPATH fi -# Add our default paths __addpath () { if [ -d "$1" ] diff --git a/.shrc b/.shrc @@ -9,7 +9,6 @@ set -o emacs PS1="$LOGNAME@\h:\W\$ " export PS1 -# Turn on ls colors if type dircolors > /dev/null 2>&1 then if [ -n "$SOURCE_DIRCOLORS" ] @@ -18,13 +17,19 @@ then unset SOURCE_DIRCOLORS fi alias ls="ls --color=auto" + LSCOLORPARAM="--color=auto" else CLICOLOR=1 LSCOLORS=ExFxBxDxCxegedabagacad export CLICOLOR LSCOLORS + LSCOLORPARAM="" fi -# Colorize others if they exist +alias ll="ls $LSCOLORPARAM -l" +alias la="ls $LSCOLORPARAM -A" +alias lla="ls $LSCOLORPARAM -lA" +unset LSCOLORPARAM + COLORIZE_CMDS="pacman grep egrep fgrep" for cmd in $COLORIZE_CMDS do @@ -34,39 +39,43 @@ do fi done -# Handy Tmux aliases if type tmux > /dev/null 2>&1 then alias tas=tmux\ attach-session\ -t alias tns=tmux\ new-session\ -s alias tls=tmux\ list-sessions + alias ts=tmux-session fi -alias export="export -p" +if type lpass > /dev/null 2>&1 +then + alias lpl="lpass login" + alias lps="lpass show" + alias lpp="lpass show --password" + alias lpc="lpass show --password -c" +fi + +if [ "$VISUAL" = "vi" ] +then + alias vim=vi +fi -# Configure GPG and start the agent if it isn't already running if type gpg-connect-agent > /dev/null 2>&1 then - export GPG_TTY=`tty` + GPG_TTY=`tty`; export GPG_TTY gpg-connect-agent updatestartuptty /bye > /dev/null 2>&1 - # Configure GPG as an SSH key provider - # Assume SSH agent is forwarded if we're in an SSH session if [ -z "$SSH_TTY" ] && type gpgconf > /dev/null 2>&1 then - unset SSH_AGENT_PID if [ "`gpgconf --list-dirs agent-ssh-socket | wc -l`" -eq 1 ] then - export SSH_AUTH_SOCK=`gpgconf --list-dirs agent-ssh-socket` + unset SSH_AGENT_PID + SSH_AUTH_SOCK=`gpgconf --list-dirs agent-ssh-socket` + export SSH_AUTH_SOCK fi fi fi -if [ "$VISUAL" = "vi" ] -then - alias vim=vi -fi - if [ -r /etc/motd -a -n "$DISPLAY" -a -z "$SSH_TTY" ] then [ $SHLVL -le 1 ] && cat /etc/motd