about summary refs log tree commit diff stats
path: root/bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash')
-rw-r--r--bash/eat.bash5
-rw-r--r--bash/emacs.bash29
-rw-r--r--bash/rec.bash11
-rw-r--r--bash/rlwrap.bash5
-rw-r--r--bash/termtitle.bash1
-rw-r--r--bash/z.bash9
6 files changed, 60 insertions, 0 deletions
diff --git a/bash/eat.bash b/bash/eat.bash new file mode 100644 index 0000000..2f2b810 --- /dev/null +++ b/bash/eat.bash
@@ -0,0 +1,5 @@
1## EAT/bash integration
2# eat is https://codeberg.org/akib/emacs-eat
3
4test -n "$EAT_SHELL_INTEGRATION_DIR" &&
5 . "$EAT_SHELL_INTEGRATION_DIR/bash"
diff --git a/bash/emacs.bash b/bash/emacs.bash new file mode 100644 index 0000000..188c64f --- /dev/null +++ b/bash/emacs.bash
@@ -0,0 +1,29 @@
1# Shell-side configuration for Emacs-based shells
2
3setup_vterm() {
4 ## https://github.com/akermu/emacs-libvterm#shell-side-configuration
5 ## Make sure this is the last file loaded by ~/.bashrc!
6
7 # Load the requisite code from the vterm install directory
8 if [[ "$INSIDE_EMACS" = 'vterm' ]] \
9 && [[ -n ${EMACS_VTERM_PATH} ]] \
10 && [[ -f ${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh ]]; then
11 source ${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh
12 fi
13
14 # Extra commands for `vterm-eval-cmds'
15 find_file() { vterm_cmd find-file "$(realpath "${@:-.}")"; }
16 say() { vterm_cmd message "%s" "$*"; }
17}
18
19setup_emacs_shell() {
20 export PAGER=cat
21 export PS1='\w \$ '
22}
23
24# CONSIDER: Could this go in ~/.profile ?
25case "$INSIDE_EMACS" in
26 '') ;; # not inside emacs
27 vterm) setup_vterm ;;
28 *) setup_emacs_shell ;;
29esac
diff --git a/bash/rec.bash b/bash/rec.bash new file mode 100644 index 0000000..9fc854f --- /dev/null +++ b/bash/rec.bash
@@ -0,0 +1,11 @@
1# Recutils bash integration
2# https://www.gnu.org/software/recutils/
3
4# enable shared library --- add other possible locations here
5for lib in /usr/lib/recutils/bash-builtins/readrec.so ; do
6 if [ -f "$lib" ]; then
7 enable -f "$lib" readrec
8 break
9 fi
10done
11
diff --git a/bash/rlwrap.bash b/bash/rlwrap.bash new file mode 100644 index 0000000..a8703a9 --- /dev/null +++ b/bash/rlwrap.bash
@@ -0,0 +1,5 @@
1# rlwrap aliases
2
3if command -v rlwrap >/dev/null 2>&1; then
4 alias sh='rlwrap sh'
5fi
diff --git a/bash/termtitle.bash b/bash/termtitle.bash new file mode 100644 index 0000000..477f65d --- /dev/null +++ b/bash/termtitle.bash
@@ -0,0 +1 @@
# terminal title
diff --git a/bash/z.bash b/bash/z.bash new file mode 100644 index 0000000..d84fd55 --- /dev/null +++ b/bash/z.bash
@@ -0,0 +1,9 @@
1### z.lua integration
2# https://github.com/skywind3000/z.lua
3
4zlua="$HOME/misc/z.lua/z.lua"
5
6if [ -f "$zlua" ]; then
7 export _ZL_DATA="${XDG_DATA_HOME:-$LOCAL_PREFIX/share}/zlua"
8 eval "$(lua "$zlua" --init bash enhanced once)"
9fi