Set prompt and pager differently when inside emacs

This commit is contained in:
Ivan Malison 2015-08-15 00:10:58 -07:00
parent 9c274c29f5
commit 60e4c76205
3 changed files with 9 additions and 1 deletions

View File

@ -49,7 +49,7 @@
# Use custom `.gitignore` and `.gitattributes` # Use custom `.gitignore` and `.gitattributes`
excludesfile = ~/.gitignore excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes attributesfile = ~/.gitattributes
pager = less -FXr # pager = less -FXr # set with environment variable so that pager can be different when inside emacs
[color] [color]
# Use colors in Git commands that are capable of colored output when # Use colors in Git commands that are capable of colored output when

View File

@ -116,3 +116,10 @@ export EDITOR="$HOME/.lib/editor.sh"
export ALTERNATE_EDITOR="" export ALTERNATE_EDITOR=""
export VISUAL="$EDITOR" export VISUAL="$EDITOR"
export GIT_EDITOR="$EDITOR" export GIT_EDITOR="$EDITOR"
# This actually gets executed in dotfiles/lib/shellrc.sh to make sure that it takes precedence over other settings
function inside_emacs_hook {
export PAGER="$EDITOR"
export GITPAGER="$EDITOR"
export MANPAGER="$EDITOR"
}

View File

@ -1,3 +1,4 @@
for filename in ~/.lib/shellrc/*; do for filename in ~/.lib/shellrc/*; do
source $filename source $filename
done done
environment_variable_exists INSIDE_EMACS && inside_emacs_hook