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
3c5bbcf5
Commit
3c5bbcf5
authored
Nov 27, 2015
by
hqingyi
Committed by
Marc Cornellà
Feb 11, 2020
Browse files
jump: add support for directories starting with a dot (#4661)
Closes #4661
parent
bc67a55f
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/jump/jump.plugin.zsh
View file @
3c5bbcf5
...
@@ -29,14 +29,14 @@ unmark() {
...
@@ -29,14 +29,14 @@ unmark() {
}
}
marks
()
{
marks
()
{
local
max
=
0
local
link
max
=
0
for
link
in
$MARKPATH
/
*
(
@
)
;
do
for
link
in
$MARKPATH
/
{
,.
}
*
(
@
)
;
do
if
[[
${#
link
:t
}
-gt
$max
]]
;
then
if
[[
${#
link
:t
}
-gt
$max
]]
;
then
max
=
${#
link
:t
}
max
=
${#
link
:t
}
fi
fi
done
done
local
printf_markname_template
=
"
$(
printf
--
"%%%us "
"
$max
"
)
"
local
printf_markname_template
=
"
$(
printf
--
"%%%us "
"
$max
"
)
"
for
link
in
$MARKPATH
/
*
(
@
)
;
do
for
link
in
$MARKPATH
/
{
,.
}
*
(
@
)
;
do
local
markname
=
"
$fg
[cyan]
${
link
:t
}
$reset_color
"
local
markname
=
"
$fg
[cyan]
${
link
:t
}
$reset_color
"
local
markpath
=
"
$fg
[blue]
$(
readlink
$link
)
$reset_color
"
local
markpath
=
"
$fg
[blue]
$(
readlink
$link
)
$reset_color
"
printf
--
"
$printf_markname_template
"
"
$markname
"
printf
--
"
$printf_markname_template
"
"
$markname
"
...
@@ -45,13 +45,13 @@ marks() {
...
@@ -45,13 +45,13 @@ marks() {
}
}
_completemarks
()
{
_completemarks
()
{
reply
=(
"
${
MARKPATH
}
"
/
*
(
N:t
))
reply
=(
"
${
MARKPATH
}
"
/
{
,.
}
*
(
@
N:t
))
}
}
compctl
-K
_completemarks jump
compctl
-K
_completemarks jump
compctl
-K
_completemarks unmark
compctl
-K
_completemarks unmark
_mark_expansion
()
{
_mark_expansion
()
{
setopt extendedglob
setopt
localoptions
extendedglob
autoload
-U
modify-current-argument
autoload
-U
modify-current-argument
modify-current-argument
'$(readlink "$MARKPATH/$ARG")'
modify-current-argument
'$(readlink "$MARKPATH/$ARG")'
}
}
...
...
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