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
Ohmyzsh
Commits
7f640923
Commit
7f640923
authored
Sep 01, 2015
by
Marc Cornellà
Committed by
Igor Dejanovic
Sep 01, 2015
Browse files
[vim-interaction plugin] Escaping special chars in file names and simplifying code.
parent
ba5fd57c
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/vim-interaction/vim-interaction.plugin.zsh
View file @
7f640923
...
...
@@ -4,17 +4,6 @@
# 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
{
if
[[
$#
==
0
]]
;
then
...
...
@@ -48,13 +37,10 @@ EOH
if
[[
${
before
#
:
}
!=
$before
&&
${
before
%<cr>
}
==
$before
]]
;
then
before
=
"
$before
<cr>"
fi
local
files
=
""
for
f
in
$@
do
files
=
"
$files
$(
resolveFile
$f
)
"
done
if
[[
-n
$files
]]
;
then
files
=
':args! '
"
$files
<cr>"
local
files
if
[[
$#
-gt
0
]]
;
then
# absolute path of files resolving symlinks (:A) and quoting special chars (:q)
files
=
':args! '
"
${
@
:A:q
}
<cr>"
fi
cmd
=
"
$before$files$after
"
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