vim-anywhere
vim-anywhere copied to clipboard
I have Macvim.app but when I install gives an error.
Error is the following.
vim-anywhere requires mvim to function
Run `brew install macvim`.
Do I have to uninstall Macvim.app and install through brew?
Thanks in advance.
No, definitely not. This is a bug. vim-anywhere
should detect where MacVim is installed, even if it isn't installed via Homebrew. Marking this as a bug. I'll have a look today.
This turned out to be not as easy as I originally expected. For some reason, when you start the vim executable stored in the MacVim.app installation directly, it doesn't focus the editor. I can hack my way around it and focus the window in this specific situation.
Same issue. MacVim installed in Applications folder.
mycomputer:~ myhome$ /Users/myhome/vim-anywhere-master/install ; exit;
vim-anywhere requires mvim to function
Run `brew install macvim`.
logout
[Process completed]
Dylan-- did you read the OWNER's comments in this thread, @cknadler??
OP: "Do I have to uninstall Macvim.app and install through brew?"
OWNER: No, definitely not. This is a bug. vim-anywhere should detect where MacVim is installed, even if it isn't installed via Homebrew. Marking this as a bug. I'll have a look today.
Ah I admit I skimmed that a little. I'll remove those comments since they were irrelevant then.
Still, it's been 3.5 years since cknadler tried to fix it, so I don't think it's going to be fixed anytime soon. (I also had a similar problem trying to replace mvim with vimr yesterday with no luck.) So you're better off just installing mvim through brew
So you're better off just installing mvim through brew
Yep. If you want to take a stab at fixing this, go for it. I'm likely not going to make an attempt anytime soon.
@dylan-chong No worries--sorry if I over-reacted. I have base Vim installed via MacOS, Vim_8+ installed via Macports, and MacVim.app in the Applications folder. Three Vim installs are enough!
@cknadler I certainly like the concept of Vim-anywhere and would love to take a stab at sending you a pull request, but I'm getting-by right now using a shortcut to open MacVim.app via the Services Menu (and/or keyboard shortcut): "New MacVim Buffer with Selection".
Not as slick as Vim-anywhere (esp. closing the app), but it'll do for now.
No worries. Just wondering, what happens when you change the .path
file to point to the mvim
executable inside Macvim.app
?
@cknadler @dylan-chong The vim-anywhere Install-script balks and won't complete the install without finding a brew-installed mvim. The invisible folder you referred to, ~/.vim-anywhere/
, doesn't exist.
Ah. There's probably a way of getting around that if you have a look at the install script. Can't really help you much there though
@cknadler @dylan-chong
I had a thought that the vim-anywhere install-script might accept vim installed via Macports, which installs into /opt/local/bin/vim
.
Alternatively, vim-anywhere install-script might accept being pointed at either the mvim executable or (like Linux), the gvim alias present within the MacVim.app bundle, generally located at:
/Applications/MacVim_snapshot-[insert-number-here]/MacVim.app/Contents/bin/mvim
/Applications/MacVim_snapshot-[insert-number-here]/MacVim.app/Contents/bin/gvim
You could change the install script to try that, e.g. by doing something like this
diff --git a/install b/install
index 0e988de..5040389 100755
--- a/install
+++ b/install
@@ -75,13 +75,13 @@ if [[ $OSTYPE == "linux-gnu" ]]; then
require_installed xclip
# OSX specific checks
-elif [[ $OSTYPE == "darwin"* ]]; then
- require_installed mvim 'Run `brew install macvim`.'
+# elif [[ $OSTYPE == "darwin"* ]]; then
+ # require_installed mvim 'Run `brew install macvim`.'
-# Unsupported OS
-else
- echo "OS '$OSTYPE' is not supported!"
- exit 1
+# # Unsupported OS
+# else
+ # echo "OS '$OSTYPE' is not supported!"
+ # exit 1
fi
###
@@ -121,7 +121,8 @@ if [[ $OSTYPE == "linux-gnu" ]]; then
# OSX install
elif [[ $OSTYPE == "darwin"* ]]; then
# store the absolute path to the mvim executable
- which mvim > $AW_PATH/.path
+ #which mvim > $AW_PATH/.path
+ echo "YOUR_PATH" > $AW_PATH/.path
# install the workflow as a service
mkdir -p $HOME/Library/Services
Just replace YOUR_PATH
with your mvim path. Also you can play with the path by modifying the path inside ~/.vim-anywhere/.path
after it is installed. The bin/run
script will use the .path
file to run mvim
I'm having this issue today as well. the brew build of macvim is a little ropey for me -- segfaults with some of my plugins so I'm using vanilla brew vim instead for console mode... any suggestions how to get around this?
I notice the package author @cknadler removed the "bug" label back in February. But I haven't gone back to try the changes suggested above, or looked at the repo to see if there have been any updates.