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
7f640923
Commit
7f640923
authored
Sep 01, 2015
by
Marc Cornellà
Committed by
Igor Dejanovic
Sep 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[vim-interaction plugin] Escaping special chars in file names and simplifying code.
parent
ba5fd57c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
18 deletions
+4
-18
vim-interaction.plugin.zsh
plugins/vim-interaction/vim-interaction.plugin.zsh
+4
-18
No files found.
plugins/vim-interaction/vim-interaction.plugin.zsh
View file @
7f640923
...
@@ -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