mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 12:46:39 +00:00
feat(emacs): improve vterm helpers for use within Emacs
This commit is contained in:
@@ -23,3 +23,20 @@ fi
|
|||||||
|
|
||||||
# add doom-emacs' bin directory to path if it exists
|
# add doom-emacs' bin directory to path if it exists
|
||||||
path_prepend "$HOME/.config/doom-emacs/bin"
|
path_prepend "$HOME/.config/doom-emacs/bin"
|
||||||
|
|
||||||
|
# Setup vterm if shell is within vterm inside Emacs.
|
||||||
|
if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
|
||||||
|
if [[ -n "${EMACS_VTERM_PATH}" ]] &&
|
||||||
|
[[ -f "${EMACS_VTERM_PATH}/etc/emacs-vterm-zsh.sh" ]]; then
|
||||||
|
source "${EMACS_VTERM_PATH}/etc/emacs-vterm-zsh.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Some commands to invoke emacs functions
|
||||||
|
find-file() {
|
||||||
|
vterm_cmd find-file "$(realpath "${@:-.}")"
|
||||||
|
}
|
||||||
|
|
||||||
|
say() {
|
||||||
|
vterm_cmd message "%s" "$*"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
#
|
|
||||||
# vterm Integration
|
|
||||||
# https://github.com/akermu/emacs-libvterm#shell-side-configuration
|
|
||||||
#
|
|
||||||
|
|
||||||
vterm_printf(){
|
|
||||||
if [ -n "$TMUX" ]; then
|
|
||||||
# Tell tmux to pass the escape sequences through
|
|
||||||
# (Source: http://permalink.gmane.org/gmane.comp.terminal-emulators.tmux.user/1324)
|
|
||||||
printf "\ePtmux;\e\e]%s\007\e\\" "$1"
|
|
||||||
elif [ "${TERM%%-*}" = "screen" ]; then
|
|
||||||
# GNU screen (screen, screen-256color, screen-256color-bce)
|
|
||||||
printf "\eP\e]%s\007\e\\" "$1"
|
|
||||||
else
|
|
||||||
printf "\e]%s\e\\" "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
1
zshrc
1
zshrc
@@ -111,7 +111,6 @@ source "$DOTZSH/git.zsh"
|
|||||||
source "$DOTZSH/less.zsh"
|
source "$DOTZSH/less.zsh"
|
||||||
source "$DOTZSH/rclone.zsh"
|
source "$DOTZSH/rclone.zsh"
|
||||||
source "$DOTZSH/tmux.zsh"
|
source "$DOTZSH/tmux.zsh"
|
||||||
source "$DOTZSH/vterm.zsh"
|
|
||||||
|
|
||||||
# Development
|
# Development
|
||||||
source "$DOTZSH/docker.zsh"
|
source "$DOTZSH/docker.zsh"
|
||||||
|
|||||||
Reference in New Issue
Block a user