0

I have the following alias/function in my .zshrc to open gvim with file names as arguments.

vim() { if [[ $# -ge 1 ]]; then gvim "$*"; else gvim; fi } 

It opens files in ~ just fine, but when I try to pass a path, it doesn't work. For example, from a zsh I say vim ~/dir/test1.txt (a file which exists on C:\Users\myname\dir\test1.txt) and gvim opens with the following file \c\Users\myname\dir\test1.txt [NEW DIRECTORY] which doesn't exist? How can I fix this issue?

1 Answer 1

2

cygpath might help here, like this:

gvim `cygpath -w $*` 
Sign up to request clarification or add additional context in comments.

1 Comment

fantastic! thanks so much for this should have rtfm but you got it!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.