summaryrefslogtreecommitdiff
path: root/bash/dot-bashrc
blob: b56bebbd607381250190330b171b18b1b9d77fc1 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Bash initialization for interactive non-login shells and
# for remote shells (info "(bash) Bash Startup Files").
export SHELL
eval `dircolors`


# Disable xon xoff for Ctrl+S support
stty -ixon


if [[ $- != *i* ]]
then
    # We are being invoked from a non-interactive shell.  If this
    # is an SSH session (as in "ssh host command"), source
    # /etc/profile so we get PATH and other essential variables.
    [[ -n "$SSH_CLIENT" ]] && source /etc/profile

    # Don't do anything else.
    return
fi

source /etc/bashrc

# VARIABLE EXPORTS
######################################################################
# Colors
export COLOR_BLACK="\[\033[0;30m\]"
export COLOR_RED="\[\033[0;31m\]"
export COLOR_GREEN="\[\033[0;32m\]"
export COLOR_YELLOW="\[\033[0;33m\]"
export COLOR_BLUE="\[\033[0;34m\]"
export COLOR_MAGENTA="\[\033[0;35m\]"
export COLOR_CYAN="\[\033[0;36m\]"
export COLOR_GREY="\[\033[0;37m\]"
export COLOR_DEFAULT="\[\033[0;39m\]"
export COLOR_WHITE=$COLOR_DEFAULT

# History length and control
shopt -s histappend
export HISTCONTROL=ignoreboth:erasedups
export HISTSIZE=1000
export HISTTIMEFORMAT="[%F %T] "

# Editors
export EDITOR=nvim
export PAGER=less

PATH=$PATH:$HOME/.local/bin

# PROMPT
PS1BASE="$COLOR_BLUE\u$COLOR_GREY@\h $COLOR_YELLOW\w\[\033[00m\]"

#PS1BASE="$COLOR_CYAN\u $COLOR_YELLOW\w\[\033[m\]"
PS1GIT="$COLOR_BLUE\$(__git_ps1)$COLOR_DEFAULT"
PS1END="$COLOR_DEFAULT\$ "
export PS1="${PS1BASE}${PS1GIT}${PS1END}"

# GUIX
######################################################################

# Adjust the prompt depending on whether we're in 'guix environment'.
if [ -n "$GUIX_ENVIRONMENT" ]
then
    PS1="$PS1BASE$PS1GIT [env]$PS1END"
fi
######################################################################

# Pandoc bash completion
if hash pandoc 2>/dev/null; then
    eval "$(pandoc --bash-completion)"
fi

# Load in the git branch prompt script.
source ~/.git-prompt.sh

# Load aliases
if [ -f ~/.bash_aliases ] ; then
    . ~/.bash_aliases
fi

# Keyboard layout control spanish - russian
setxkbmap  -layout es,ru -option "grp:alt_space_toggle"