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
Oh My Zsh
Commits
49c0a138
Commit
49c0a138
authored
Apr 15, 2011
by
Tristan Carel
Browse files
- Fix pass of parameters
- Add new function `ecd'.
parent
a183bcbc
Changes
2
Show whitespace changes
Inline
Side-by-side
plugins/emacs/emacs.plugin.zsh
View file @
49c0a138
...
...
@@ -23,8 +23,24 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
# to code all night long
alias
emasc
=
emacs
alias
emcas
=
emacs
# jump to the directory of the current buffer
function
ecd
{
local
cmd
=
"(let ((buf-name (buffer-file-name (window-buffer))))
(if buf-name
(file-name-directory buf-name)))"
local dir
=
`
$EDITOR
--eval
"
$cmd
"
|
tr
-d
\"
`
if
[
-n
"
$dir
"
]
;
then
cd
"
$dir
"
else
echo
"can not deduce current buffer filename."
>
/dev/stderr
return
1
fi
}
fi
## Local Variables:
## mode: sh
## End:
plugins/emacs/emacsclient.sh
View file @
49c0a138
...
...
@@ -4,8 +4,8 @@
x
=
`
emacsclient
--alternate-editor
''
--eval
'(x-display-list)'
2>/dev/null
`
if
[
-z
"
$x
"
]
;
then
emacsclient
--alternate-editor
""
--create-frame
$@
emacsclient
--alternate-editor
""
--create-frame
"
$@
"
else
# prevent creating another X frame if there is at least one present.
emacsclient
--alternate-editor
""
$@
emacsclient
--alternate-editor
""
"
$@
"
fi
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