Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
8c18f007
Commit
8c18f007
authored
May 06, 2012
by
mapc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enhance handleing of spaces in filenames
parent
b7bad0f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
fastfile.plugin.zsh
plugins/fastfile/fastfile.plugin.zsh
+19
-9
No files found.
plugins/fastfile/fastfile.plugin.zsh
View file @
8c18f007
...
...
@@ -32,14 +32,17 @@ default fastfile_var_prefix "§"
#
function
fastfile
()
{
test
"
$2
"
||
2
=
"."
2
=
$(
readlink
-f
"
$2
"
)
test
"
$1
"
||
1
=
"
$(
basename
"
$2
"
)
"
file
=
$(
readlink
-f
"
$2
"
)
test
"
$1
"
||
1
=
"
$(
basename
"
$file
"
)
"
name
=
$(
echo
"
$1
"
|
tr
" "
"_"
)
mkdir
-p
"
${
fastfile_dir
}
"
echo
"
$
2
"
>
"
$(
fastfile_resolv
"
$1
"
)
"
echo
"
$
file
"
>
"
$(
fastfile_resolv
"
$name
"
)
"
fastfile_sync
fastfile_print
"
$
1
"
fastfile_print
"
$
name
"
}
#
...
...
@@ -85,9 +88,13 @@ function fastfile_print() {
# (=> fastfle_print) for each shortcut
#
function
fastfile_ls
()
{
for
f
in
$(
ls
"
${
fastfile_dir
}
"
)
;
do
fastfile_print
"
$f
"
done
| column
-t
for
f
in
"
${
fastfile_dir
}
"
/
*
;
do
file
=
`
basename
"
$f
"
`
# To enable simpler handeling of spaces in file names
varkey
=
`
echo
"
$file
"
|
tr
" "
"_"
`
# Special format for colums
echo
"
${
fastfile_var_prefix
}${
varkey
}
|->|
$(
fastfile_get
"
$file
"
)
"
done
| column
-t
-s
"|"
}
#
...
...
@@ -108,8 +115,11 @@ function fastfile_rm() {
# Generate the aliases for the shortcuts
#
function
fastfile_sync
()
{
for
f
in
$(
ls
"
${
fastfile_dir
}
"
)
;
do
alias
-g
"
${
fastfile_var_prefix
}${
f
}
"
=
"
$(
fastfile_get
"
$f
"
)
"
for
f
in
"
${
fastfile_dir
}
"
/
*
;
do
file
=
`
basename
"
$f
"
`
# To enable simpler handeling of spaces in file names
varkey
=
`
echo
"
$file
"
|
tr
" "
"_"
`
alias
-g
"
${
fastfile_var_prefix
}${
varkey
}
"
=
"'
$(
fastfile_get
"
$file
"
)
'"
done
}
...
...
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