Adds vim monkey-patch to edit files within Emacs
This commit is contained in:
parent
1cd470b85d
commit
708670590f
1 changed files with 10 additions and 1 deletions
|
|
@ -9,12 +9,21 @@ fi
|
||||||
|
|
||||||
|
|
||||||
if [ -n "$INSIDE_EMACS" ]; then
|
if [ -n "$INSIDE_EMACS" ]; then
|
||||||
export EDITOR="emacsclient"
|
export EDITOR="edit-file-in-emacs.sh"
|
||||||
else
|
else
|
||||||
export EDITOR=$(which vim)
|
export EDITOR=$(which vim)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
vim () {
|
||||||
|
if [ -n "$INSIDE_EMACS" ]; then
|
||||||
|
emacsclient -e "(find-file-other-window \"$1\")"
|
||||||
|
else
|
||||||
|
eval "$EDITOR \"$1\""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
man () {
|
man () {
|
||||||
if [ -n "$INSIDE_EMACS" ]; then
|
if [ -n "$INSIDE_EMACS" ]; then
|
||||||
emacsclient -e "(man \"$1\")"
|
emacsclient -e "(man \"$1\")"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue