if emacsclient --version &> /dev/null; then
export ALTERNATE_EDITOR="vim"
export EDITOR="emacsclient --create-frame"
+ export EDITORBG="emacsclient --create-frame --no-wait"
+
+ # Disable emacs inside screen
+ if [[ "$TERM" == screen* ]]; then
+ export EMACS_SERVER_FILE=
+ fi
else
export EDITOR="vim"
+ export EDITORBG="vim"
fi
# Expand any symbolic links in the TMPDIR environment variable
# Usage: editf somefile
# Does a recursive search of the current directory for somefile, then edits it
function editf {
- find . -iname "${1}" -exec $EDITOR '{}' +
+ find . -iname "${1}" -exec $EDITORBG '{}' +
}
-# Usage: edit somefile
-# Opens the provided file(s) with $EDITOR
+# Usage: edit somefile [otherfiles ...]
function edit {
- $EDITOR "$@"
+ $EDITORBG "$@"
}
# Sets the nice and ionice priorities for the current shell to the lowest values
--- /dev/null
+[Desktop Entry]
+Name=Emacs
+GenericName=Text Editor
+Comment=Edit text
+MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
+Exec=emacsclient --create-frame --no-wait %F
+Icon=emacs
+Type=Application
+Terminal=false
+Categories=Development;TextEditor;
+StartupWMClass=Emacs
+Keywords=Text;Editor;