Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
a01b1fef
"nvidia/gp108/gr/gpccs_bl.bin" did not exist on "065c85fa4a2343ead20cadfe6138f7716659dfe1"
Commit
a01b1fef
authored
Oct 10, 2011
by
Tristan Carel
Browse files
Do not overwrite EDITOR environment variable if already defined.
parent
3a408f32
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/emacs/emacs.plugin.zsh
View file @
a01b1fef
...
@@ -11,12 +11,16 @@
...
@@ -11,12 +11,16 @@
if
"
$ZSH
/tools/require_tool.sh"
emacs 23 2>/dev/null
;
then
if
"
$ZSH
/tools/require_tool.sh"
emacs 23 2>/dev/null
;
then
export
EDITOR
=
"
$ZSH
/plugins/emacs/emacsclient.sh"
export
EMACS_PLUGIN_LAUNCHER
=
"
$ZSH
/plugins/emacs/emacsclient.sh"
alias
emacs
=
"
$EDITOR
--no-wait"
# set EDITOR if not already defined.
export
EDITOR
=
"
${
EDITOR
:-${
EMACS_PLUGIN_LAUNCHER
}}
"
alias
emacs
=
"
$EMACS_PLUGIN_LAUNCHER
--no-wait"
alias
e
=
emacs
alias
e
=
emacs
# same than M-x eval but from outside Emacs.
# same than M-x eval but from outside Emacs.
alias
eeval
=
"
$E
DITO
R
--eval"
alias
eeval
=
"
$E
MACS_PLUGIN_LAUNCHE
R
--eval"
# create a new X frame
# create a new X frame
alias
eframe
=
'emacsclient --alternate-editor "" --create-frame'
alias
eframe
=
'emacsclient --alternate-editor "" --create-frame'
...
@@ -28,7 +32,7 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
...
@@ -28,7 +32,7 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
# opened in the current buffer.
# opened in the current buffer.
function
efile
{
function
efile
{
local
cmd
=
"(buffer-file-name (window-buffer))"
local
cmd
=
"(buffer-file-name (window-buffer))"
$E
DITOR
--eval
"
$cmd
"
|
tr
-d
\"
"
$E
MACS_PLUGIN_LAUNCHER
"
--eval
"
$cmd
"
|
tr
-d
\"
}
}
# Write to standard output the directory of the file
# Write to standard output the directory of the file
...
@@ -37,7 +41,7 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
...
@@ -37,7 +41,7 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
local
cmd
=
"(let ((buf-name (buffer-file-name (window-buffer))))
local
cmd
=
"(let ((buf-name (buffer-file-name (window-buffer))))
(if buf-name (file-name-directory buf-name)))"
(if buf-name (file-name-directory buf-name)))"
local dir
=
"
$(
$E
DITO
R
--eval
$cmd
|
tr
-d
\"
)
"
local dir
=
"
$(
$E
MACS_PLUGIN_LAUNCHE
R
--eval
$cmd
|
tr
-d
\"
)
"
if
[
-n
"
$dir
"
]
;
then
if
[
-n
"
$dir
"
]
;
then
echo
"
$dir
"
echo
"
$dir
"
else
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment