Fix my macvim installation to use most current version - vim

I have 4 versions of macvim installed in homebrew's Cellar folder. I want the most recent version only to be my default vim everywhere, ie, when I type gvim or vim from the command line.
brew linkapps macvim does not work, ie, gvim still gives "No such file" after running it.
Here's the current info:
$ brew info macvim
macvim: stable 7.4-85, HEAD
GUI for vim, made for OS X
https://github.com/macvim-dev/macvim
/usr/local/Cellar/macvim/7.4-72 (1799 files, 28M)
Built from source
/usr/local/Cellar/macvim/7.4-73 (1810 files, 28M)
Built from source
/usr/local/Cellar/macvim/7.4-73_1 (1810 files, 28M)
Built from source
/usr/local/Cellar/macvim/7.4-85 (1910 files, 35M)
Built from source with: --with-lua --with-luajit --with-python3 --with-override-system-vim
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/macvim.rb
==> Dependencies
Recommended: cscope ✔
Optional: lua ✔, luajit ✔
==> Options
--with-custom-icons
Try to generate custom document icons
--with-lua
Build with lua support
--with-luajit
Build with luajit support
--with-override-system-vim
Override system vim
--with-python3
Build with python3 support
--without-cscope
Build without cscope support
--without-python
Build without python support
--HEAD
Install HEAD version
==> Caveats
.app bundles were installed.
Run `brew linkapps macvim` to symlink these to /Applications.
UPDATE
When I run brew doctor, the relevant message is:
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
macvim
vim
However, when I brew link macvim, it links back up the previous version of macvim, rather than the most recent one.

Please run brew prune to remove broken links. Also brew doctor can help you finding additional problems.

Related

Vim could not load libpython3.7m.a with python3 from Anaconda

I'm trying to use Anaconda python3.7 + vim 8.1 + jedi-vim on Rocks 7.0 (Manzanita) but I get an error saying that libpython3.7m.a cannot be loaded and I can't find a solution.
First things first. I have to compile vim by myself because the vim installed by default has only +python and I have to use python3.
I cloned the git and, following several other suggestions found online I configure vim with
./configure --enable-cscope --enable-multibyte --enable-python3interp=dynamic --with-features=huge --with-python-config-dir=/home/mazzi/miniconda3/lib/python3.7/config-3.7m-x86_64-linux-gnu --with-tlib=ncurses --enable-fail-if-missing --prefix=/home/mazzi/.local
The prefix is due to the fact that I don't have root access and its output of can be found here. Please note that during the whole procedure I had to stay inside a conda environment, otherwise the configuration would fail saying that no python3 was found.
I then make, with this output, and make install with this other output.
I check vim version and everything seems ok.
Finally, I start vim normally (/home/mazzi/.local/bin is on the PATH, before the system paths, and the vim command points to ~/.local/bin/vim) and type :py3 pass but I get the following error:
E370: Could not load library libpython3.7m.a
E263: Sorry, this command is disabled, the Python library could not be loaded.
What can I do?
Additional info
Some of my sources:
https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source (without sudo and just to be clear I did not try YouCompleteMe due to some issues in the past that forced me to go to jedi-vim)
https://gist.github.com/hxhc/778d7c3a3ad491dedf3675a47275a979
Compiling vim 8.0 with Python 3 support resulting in SIGABRT
https://github.com/Valloric/YouCompleteMe/issues/2855#issuecomment-352181535

ycm_client_support.[so|pyd|dll] and ycm_core.[so|pyd|dll] not detected; you need to compile YCM before using it

orror in compile prses. how to solve it?
According to this blog post, you just have to compile the YouCompleteMe modules by running the install.sh script in the YCM install.
cd ~/.vim/bundle/YouCompleteMe
./install.sh --clang-completer
Once this completes you should be able to install the plugin (here's how to do it with Vundle). Once in Vim
:source ~/.vimrc
:PluginInstall
Apparently, when you run ./.install.sh --clang-completer it says that it is "out of date."
I ran python2 install.py and it worked for me. (I believe it was python2.)
Also, I had was using vim and neovim, and I decided to do ./install.sh --clang-completer inside my ~/.vim/bundle/Vundle.vim/ and at the same tim decided to do python2 install.py inside my ~/.configs/nvim/bundle/Vundle.vim/ and the python install installed faster and did the same thing.
The difference might be that you need to "compile vim with pdython support," but the simple fix for that is installing python-nvim (if using neovim), or - I think - vim just comes with python support. (? maybe.)
I encountered the same error message when trying out new neovim installation. In my case, it was because I was using vim-plugin and the plugins are installed in the ~/.vim/plugged instead of ~/.vim/bundle (this is the plugin folder for Vundle before I switched to vim-plug).
Thus, after scratching my head for few hours, turns out I have to run install.sh in the ~/.vim/plugged (not ~/.vim/bundle). I hope this will save someone's time.

I can’t autocomplete my Go code even after installing vim-gocode

My setup
I already installed gocode with the command go get github.com/nsf/gocode.
I use Pathogen to manage my Vim plugins. I installed vim-gocode with git clone git#github.com:Blackrush/vim-gocode.git.
What I’m seeing
The :Fmt command works ok, but I can’t autocomplete my golang code. It reports an error like in this image:
Can someone help me?
Please ensure you have YCM or neocomplete installed. You need some additional binaries to get all features. Following on the vim-go repo tells you how to install them.
All necessary binaries should be installed (such as gocode, godef, goimports, etc.). You can easily install them with the included :GoInstallBinaries command, by running command in your vim.

no python3 support for brew macvim

For some reason macvim installed with brew doesn't have the python3 support. Here is how I installed it:
brew install macvim --with-cscope --with-python3
Whenever I run
:echo has('python3')
The result is 0, meaning there is no python3 support. Does anybody know what is the problem? Any help is appreciated.
Python 3 is deliberately disabled in the macvim recipe in homebrew.
You can, however, run "brew edit macvim" and fix up the recipe so it works.
I recommend the following actions (which have worked for me):
Use the current MacVim 7.4 snapshot 72 (update the url and sha1). brew still has older snapshot 71.
sha1 '3fb5b09d7496c8031a40e7a73374424ef6c81166'
Delete all the patches from the end of the recipe. The last line should be __END__. None of the patches are necessary anymore - ruby support was fixed upstream in snapshot 72.
depends_on :python3 => :recommended
in the install function, when its messing with the args, fixup the python section like so:
args << "--enable-python3interp=yes" if build.with? 'python3'
ENV.prepend 'LDFLAGS', "-L#{python3.libdir} -F#{python3.framework} -framework Ruby" if python3 && python3.brewed?
Ensure you use a homebrew python3 and if you have upgraded to Mavericks, re-brew absolutely everything - the stdc++ library has changed and you cannot mix old and new when linking.
brew it with:
$ brew install --HEAD macvim
$ mvim --version # to ensure it has all the right things linked
I've run through ultisnips and vinarise, both of which work and neither of which caused the window to mysteriously disappear as previously lamented in the recipe for macvim & python3. I've also done other basic testing with :py3 command. No issues seen (yet)

How to install pyclewn in plain vim?

I note that pyclewn can be installed in plain vim since version 7.3 due to it supports netbeans.
So I enabled netbeans_intg and autocmd features in my vim73. However, when I was trying to
install it by:
$sudo python setup.py install --force
I get a return message of:
"Failed to run 'gvim' as Vim."
I am pretty sure I have set up the environment variable EDITOR as /usr/bin/vim.
Any idea?
Thanks,
Xi
Given the output message "'gvim' as Vim". It is most likely that you set EDITOR incorrectly
> EDITOR=vim
> echo EDITOR
this should return 'vim'. Then,
> export EDITOR
> vimdir=$HOME/.vim python setup.py install --force --home=$HOME
Try their local installation approach. This might work better for you. From their installation notes:
Both binaries and runtime
Local installation of the pyclewn binaries and the runtime file is done with the command:
vimdir=$HOME/.vim python setup.py install --force --home=$HOME

Resources