about summary refs log tree commit diff stats
path: root/bash/emacs.bash
diff options
context:
space:
mode:
authorCase Duckworth2023-01-30 17:33:06 -0600
committerCase Duckworth2023-01-30 17:33:06 -0600
commit1d562af8927d932bc3329de3b06c94a966047238 (patch)
treeacb2c460fbb8d01473f38f4de426c4879c7ae11a /bash/emacs.bash
parentDeclare mode (diff)
downloadetc-1d562af8927d932bc3329de3b06c94a966047238.tar.gz
etc-1d562af8927d932bc3329de3b06c94a966047238.zip
Add a bunch of stuff
Forgot I had to `git add -f' these!
Diffstat (limited to 'bash/emacs.bash')
-rw-r--r--bash/emacs.bash29
1 files changed, 29 insertions, 0 deletions
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