Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
574de93e
Commit
574de93e
authored
Sep 06, 2011
by
Tristan Carel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New function `efile`
parent
6f1929f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
emacs.plugin.zsh
plugins/emacs/emacs.plugin.zsh
+10
-3
No files found.
plugins/emacs/emacs.plugin.zsh
View file @
574de93e
...
...
@@ -24,14 +24,22 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
alias
emasc
=
emacs
alias
emcas
=
emacs
# jump to the directory of the current buffer
# Write to standard output the path to the file
# opened in the current buffer.
function
efile
{
local
cmd
=
"(buffer-file-name (window-buffer))"
$EDITOR
--eval
"
$cmd
"
|
tr
-d
\"
}
# display the directory of the file
# opened in the 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
"
echo
"
$dir
"
else
echo
"can not deduce current buffer filename."
>
/dev/stderr
return
1
...
...
@@ -39,7 +47,6 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
}
fi
## Local Variables:
## mode: sh
## End:
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