diff options
Diffstat (limited to 'home/.ansible/roles/bash_config')
| -rw-r--r-- | home/.ansible/roles/bash_config/files/.bash_aliases | 10 | ||||
| -rw-r--r-- | home/.ansible/roles/bash_config/files/.bash_profile | 3 | ||||
| -rw-r--r-- | home/.ansible/roles/bash_config/files/.bashrc | 38 | ||||
| -rw-r--r-- | home/.ansible/roles/bash_config/tasks/main.yml | 21 |
4 files changed, 72 insertions, 0 deletions
diff --git a/home/.ansible/roles/bash_config/files/.bash_aliases b/home/.ansible/roles/bash_config/files/.bash_aliases new file mode 100644 index 0000000..37d8775 --- /dev/null +++ b/home/.ansible/roles/bash_config/files/.bash_aliases @@ -0,0 +1,10 @@ +# navigation +alias ls='/bin/ls $LS_OPTIONS' +alias ll='ls -al --color=auto' + +# applications +alias vi=/usr/bin/vim +alias mc='. /usr/share/mc/bin/mc-wrapper.sh' + +# git +alias gstat='git status' diff --git a/home/.ansible/roles/bash_config/files/.bash_profile b/home/.ansible/roles/bash_config/files/.bash_profile new file mode 100644 index 0000000..a6c2023 --- /dev/null +++ b/home/.ansible/roles/bash_config/files/.bash_profile @@ -0,0 +1,3 @@ +if [ -f ~/.bashrc ]; then + . ~/.bashrc +fi diff --git a/home/.ansible/roles/bash_config/files/.bashrc b/home/.ansible/roles/bash_config/files/.bashrc new file mode 100644 index 0000000..5d417ae --- /dev/null +++ b/home/.ansible/roles/bash_config/files/.bashrc @@ -0,0 +1,38 @@ +# execute our aliases +if [ -f ~/.bash_aliases ]; then +. ~/.bash_aliases +fi + +# history settings +## setting unlimited filesize and history size +export HISTFILESIZE= +export HISTSIZE= +export HISTCONTROL=erasedups:ignorespace:ignoredups + +# allows you to choose which standalone commands to drop from your history +export HISTIGNORE='pwd:exit:fg:bg:top:clear:history:ls:uptime:ll' + +# display timestamp before the history command entry +export HISTTIMEFORMAT='%F %T ' + +# https://cyb.org.uk/2021/05/03/bash-productivity.html +# http://mywiki.wooledge.org/BashFAQ/088 +PROMPT_COMMAND='history -a' +shopt -s histappend + +#setting prompt +# export PS1="\u@\h:\w\$ " +# export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ " +export PS1="\n\[\033[11;33m\][\[\033[11;36m\]\D{%F} \t\[\033[11;33m\]][\[\033[11;36m\]\!\[\033[11;33m\]]\n[\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00;33m\]]\[\033[00m\]\n\$ " +export PS2="> " + +# the default editor +export EDITOR=vim + +# add color +eval `dircolors -b` + +# this function calls 'cd' to enter a directory and then immediately calls 'ls' +cdls() { + cd "$@" && ll; +} diff --git a/home/.ansible/roles/bash_config/tasks/main.yml b/home/.ansible/roles/bash_config/tasks/main.yml new file mode 100644 index 0000000..28a12c9 --- /dev/null +++ b/home/.ansible/roles/bash_config/tasks/main.yml @@ -0,0 +1,21 @@ +--- +- name: copy '.bash_aliases' + ansible.builtin.copy: + src: .bash_aliases + dest: "{{ prefix_dir }}.bash_aliases" + mode: '0644' + tags: ['bash_aliases'] + +- name: copy '.bashrc' file with content + ansible.builtin.copy: + src: .bashrc + dest: "{{ prefix_dir }}.bashrc" + mode: '0644' + tags: ['bashrc'] + +- name: copy '.bash_profile' file with content + ansible.builtin.copy: + src: .bash_profile + dest: "{{ prefix_dir }}.bash_profile" + mode: '0644' + tags: ['bash_profile'] |
