Opened 12 years ago

Closed 7 years ago

#37798 closed enhancement (wontfix)

MacVim: Request to create 'gvim', 'gvimdiff', ... symbolic links in addition to 'mvim' series

Reported by: alexey.muranov@… Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: MacVim vim

Description

Would it be possible to create /opt/local/bin/gvim, .../gvimdiff, etc. symbolic links in addition to /opt/local/bin/mvim, .../mvimdiff, ... ? This would allow git mergetool gvimdiff work out of the box.

See also this Homebrew issue: https://github.com/mxcl/homebrew/issues/14458

Thanks.

Change History (10)

comment:1 Changed 12 years ago by alexey.muranov@…

In fact, for git mergetool it was enough to create just 'gvim' symbolic link, i did it manually.

comment:2 Changed 12 years ago by larryv (Lawrence Velázquez)

Keywords: gvim removed
Owner: changed from macports-tickets@… to raimue@…
Port: MacVim added; macvim removed
Summary: Create 'gvim', 'gvimdiff', ... symbolic links in addition to 'mvim' seriesMacVim: Request to create 'gvim', 'gvimdiff', ... symbolic links in addition to 'mvim' series
Version: 2.1.2

Thanks for the ticket. In the future, please try to Cc the relevant port maintainers.

comment:3 Changed 12 years ago by larryv (Lawrence Velázquez)

Note that this change would make MacVim conflict with vim-app, although maybe that wouldn’t be a big deal.

comment:4 in reply to:  3 ; Changed 12 years ago by raimue (Rainer Müller)

Port: vim added
Status: newassigned

Replying to larryv@…:

Note that this change would make MacVim conflict with vim-app, although maybe that wouldn’t be a big deal.

Actually this would not be the conflict as vim-app is for OS X <10.6 while MacVim is for >=10.6. The real problem would be with vim +gtk2 (or any other GUI variant) which already provides the gvim symlinks.

comment:5 Changed 12 years ago by alexey.muranov@…

Maybe just some message can be printed during the installation saying how and why to symlink mvim to gvim?

I used

sudo ln -s /opt/local/bin/mvim /usr/local/bin/gvim

comment:6 in reply to:  4 Changed 12 years ago by larryv (Lawrence Velázquez)

Replying to raimue@…:

Actually this would not be the conflict as vim-app is for OS X <10.6 while MacVim is for >=10.6.

Oh, oops. Guess that's what happens when I just skim the portfiles.

comment:7 in reply to:  5 Changed 12 years ago by raimue (Rainer Müller)

Replying to alexey.muranov@…:

sudo ln -s /opt/local/bin/mvim /usr/local/bin/gvim

Fine that this works for you. However, this is not a solution for everyone as /opt/local/bin usually comes before /usr/local/bin in PATH, which means that vim +gtk2 would still take preference over MacVim. I am not opposed to adding a way to make MacVim accessible using gvim*, but right now I don't see a way to avoid the conflict with vim (since we cannot add conflicts on specific variants) or the need for a port select gvim.

However, if git mergetool is your main use case, I can suggest two different ways to solve this in .gitconfig:

  1. Override gvimdiff with mvimdiff:
    [difftool "gvimdiff"]
        path = /opt/local/bin/mvimdiff
    
  1. Add an additional mergetool:
    [mergetool "mvimdiff"]
        cmd = /opt/local/bin/mvimdiff -f "$LOCAL" "$MERGED" "$REMOTE"
    [merge]
        tool = mvimdiff
    

comment:8 Changed 12 years ago by alexey.muranov@…

@raimue, thanks for the suggested solutions for the git mergetool, but i cannot test them right now, and my solution works for me. However, i tried something similar with .gitconfig before, and i could not get it to use mvim with the same window layout as it does with gvim. I also have doubts about your solution with

path = /opt/local/bin/mvimdiff

because i discovered that git mergetool gvimdiff does not call gvimdiff but apparently calls gvim directly.

comment:9 Changed 12 years ago by mf2k (Frank Schima)

Type: requestenhancement

comment:10 Changed 7 years ago by raimue (Rainer Müller)

Resolution: wontfix
Status: assignedclosed

As explained above, the 'gvim*' binaries are reserved for vim with a GUI variant.

Note: See TracTickets for help on using tickets.