summaryrefslogtreecommitdiff
path: root/dotfiles/.bashrc
blob: 09efb5fee7e32d9187e1b22b5321ad06eaf6b226 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# -*- shell-script -*-
# Bash initialization for interactive non-login shells and
# for remote shells (info "(bash) Bash Startup Files").

# Export 'SHELL' to child processes.  Programs such as 'screen'
# honor it and otherwise use /bin/sh.
export SHELL

if [ -n "$SSH_CLIENT" -a -z "`type -P cat`" ]
then
    # We are being invoked from a non-interactive SSH session
    # (as in "ssh host command") but 'cat' cannot be found
    # in $PATH.  Source /etc/profile so we get $PATH and other
    # essential variables.
    source /etc/profile
fi

# Append to the history file, don't overwrite it
shopt -s histappend

# For setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# Don't put duplicate lines or lines starting with space in the history.
HISTCONTROL=ignoreboth

# Check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# The pattern "**" used in a pathname expansion context will match all
# files and zero or more directories and subdirectories.
shopt -s globstar

# Add the shell level to PS1 if we're in a deeply nested shell.
if [ $SHLVL -gt 3 ]
then
    # A tty in a terminal emulator is typically at shell level 3.
    ((level = $SHLVL - 3))
    PS1='\u@\h \w [$level]\$ '
else
    PS1='\u@\h \w\$ '
fi

alias ls='ls -p --color'
alias ll='ls -l'

alias guix-dev-env="cd ~/Code/guix; guix environment -e '(@@ (gnu packages package-management) guix-devel)'"
alias sly-dev-env="cd ~/Code/sly; guix environment -l package.scm"

if vhl
then
    alias rackknife="knife rackspace -c .chef/rack_knife.rb"
    alias chef-env="cd ~/Code/chef-repo; eval $(~/bin/gem-env chef-repo)"
    alias api-env="cd ~/Code/api; eval $(~/bin/gem-env api)"
fi