Browse code

Add dotfiles

Robert Cranston authored on 20/01/2022 13:06:13
Showing 5 changed files

1 1
new file mode 100644
... ...
@@ -0,0 +1,17 @@
1
+## Source POSIX login session startup script
2
+if [ -r "$HOME/.profile" ]
3
+then
4
+    . "$HOME/.profile"
5
+fi
6
+
7
+## For interactive shells, source `.bashrc`
8
+# This happens with login shells.
9
+case $- in
10
+    *i*)
11
+        # Source Bash interactive shell startup scripts.
12
+        if [ -r "$HOME/.bashrc" ]
13
+        then
14
+            . "$HOME/.bashrc"
15
+        fi
16
+        ;;
17
+esac
0 18
new file mode 100644
... ...
@@ -0,0 +1,29 @@
1
+## For non-interactive shells, source `.bash_profile` instead
2
+# This happens e.g. with `ssh`.
3
+case $- in
4
+  *i*) ;;
5
+  *)
6
+    # Source Bash login shell startup script.
7
+    if [ -r "$HOME/.bash_profile" ]
8
+    then
9
+      . "$HOME/.bash_profile"
10
+    fi
11
+    return 0
12
+    ;;
13
+esac
14
+
15
+## Source POSIX interactive shell startup script
16
+if [ -r "$HOME/.shrc" ]
17
+then
18
+  . "$HOME/.shrc"
19
+fi
20
+
21
+## Source Bash interactive shell startup scripts
22
+for path in "$HOME/.bashrc.d/"*".bash"
23
+do
24
+  if [ -r "$path" ]
25
+  then
26
+    . "$path"
27
+  fi
28
+done
29
+unset path
0 30
new file mode 100644
... ...
@@ -0,0 +1,7 @@
1
+if [ -f "/usr/share/bash-completion/bash_completion" ]
2
+then
3
+  . "/usr/share/bash-completion/bash_completion"
4
+elif [ -f "/etc/bash_completion" ]
5
+then
6
+  . "/etc/bash_completion"
7
+fi
0 8
new file mode 100644
... ...
@@ -0,0 +1,24 @@
1
+# Unlimited history.
2
+HISTSIZE="-1"
3
+
4
+# Do not save commands starting with a space. Only save the last usage of a
5
+# duplicate command.
6
+HISTCONTROL="ignorespace:ignoredups:erasedups"
7
+
8
+# Place history expansions into the editing buffer instead of executing them.
9
+shopt -s histverify
10
+
11
+# Reload failed history expansions.
12
+shopt -s histreedit
13
+
14
+# Append instead of replace.
15
+shopt -s histappend
16
+
17
+# Save all lines of multi-line command.
18
+shopt -s cmdhist
19
+
20
+# Do not replace newlines with semicolons.
21
+shopt -s lithist
22
+
23
+# Automatically perform history expansion when space is pressed.
24
+bind 'Space: magic-space'
0 25
new file mode 100644
... ...
@@ -0,0 +1,2 @@
1
+# List status of jobs and defer exit when exiting interactive shell.
2
+shopt -s checkjobs