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
3b291322
Commit
3b291322
authored
Sep 19, 2015
by
Robby Russell
Browse files
Merge pull request #4300 from igordejanovic/vim-escape-fname
[vim-interaction plugin] Escape special chars in filenames.
parents
cfba05cf
7f640923
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/vim-interaction/vim-interaction.plugin.zsh
View file @
3b291322
...
@@ -4,17 +4,6 @@
...
@@ -4,17 +4,6 @@
# Derek Wyatt (derek@{myfirstnamemylastname}.org
# Derek Wyatt (derek@{myfirstnamemylastname}.org
#
#
function
resolveFile
{
if
[
-f
"
$1
"
]
;
then
echo
$(
readlink
-f
"
$1
"
)
elif
[[
"
${
1
#/
}
"
==
"
$1
"
]]
;
then
echo
"
$PWD
/
$1
"
else
echo
$1
fi
}
function
callvim
function
callvim
{
{
if
[[
$#
==
0
]]
;
then
if
[[
$#
==
0
]]
;
then
...
@@ -48,13 +37,10 @@ EOH
...
@@ -48,13 +37,10 @@ EOH
if
[[
${
before
#
:
}
!=
$before
&&
${
before
%<cr>
}
==
$before
]]
;
then
if
[[
${
before
#
:
}
!=
$before
&&
${
before
%<cr>
}
==
$before
]]
;
then
before
=
"
$before
<cr>"
before
=
"
$before
<cr>"
fi
fi
local
files
=
""
local
files
for
f
in
$@
if
[[
$#
-gt
0
]]
;
then
do
# absolute path of files resolving symlinks (:A) and quoting special chars (:q)
files
=
"
$files
$(
resolveFile
$f
)
"
files
=
':args! '
"
${
@
:A:q
}
<cr>"
done
if
[[
-n
$files
]]
;
then
files
=
':args! '
"
$files
<cr>"
fi
fi
cmd
=
"
$before$files$after
"
cmd
=
"
$before$files$after
"
gvim
--remote-send
"
$cmd
"
gvim
--remote-send
"
$cmd
"
...
...
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