I'm trying to figure out how to copy-and-paste between a file edited with Vim and the macOS Clipboard. Most instructions say to start by installing Vim using Homebrew as it will be installed with the clipboard option enabled (vim --version will display "+clipboard"). However, when I installed Vim using brew, the clipboard option was still set to "-clipboard". Can I force brew to reinstall Vim and turn this option on in the process? I'm using Homebrew 1.1.2 which installed VIM 7.4.
Because Homebrew no longer takes package specific options on the command line you need to edit the formula to add support for the clipboard back and then tell brew to install from source and not from a bottle.
brew uninstall vim
brew edit vim
# Add `"--enable-clipboard",` after the `./configure` in the list of other options.
brew install -s vim
Summarized from this solution:
https://coderwall.com/p/avmotq/gain-clipboard-support-for-vim-on-os-x
Expanding on Andy Ray's comment…
MacVim is a GUI program but it also comes with a TUI executable that can be run in a terminal emulator. Because that TUI executable has all the features of the GUI program, installing MacVim is by far the easiest and safest way to have a full-featured and well optimized Vim on Mac OS X:
Download the latest release.
Mount the disk image.
Drag and drop MacVim.app to /Applications/ or ~/Applications.
Put the mvim scriptsomewhere in your$PATH`.
[OPTIONAL] Add alias vim='mvim -v' to your shell's init script.
From your shell, you can do:
$ mvim foo.txt
to edit foo.txt in the MacVim GUI,
$ mvim -v bar.txt
to edit bar.txt in the MacVim TUI. Or, if you added the alias:
$ vim bar.txt
Now, to address your comment…
If you connect to your Mac from your Linux box, iTerm.app doesn't come into play and you can use whatever TUI program is installed on the Mac, including the Macvim TUI.
If you connect to your Linux box from your Mac, whether it is via iTerm.app or Terminal.app, the vim you are going to run will be the vim on your Linux machine so… what programs you install on your Mac doesn't matter at all as you won't have access to them anyway.
Related
I am quite new to Vim on Mac OSX 10.13. I installed a few plugins, especially for use with Python.
Thus I installed YouCompleteMe & compiled it. Originally I got an error because a trial of Kite shut the server down. But this I deactivated and now I restart and restart the server just to get it shutdown.
And the YcmToggleLogs does not show anything :-(
I followed all of the advice given here: YCM error. The ycmd server SHUT DOWN (restart wit...the instructions in the documentation
But still it doesn't work.
And of course I followed along with the official install manual:
Install YCM plugin via Vundle
Install cmake, macvim and python
Note that the system vim is not supported.
brew install cmake macvim python
.
Install mono, go, node and npm
brew install mono go nodejs
Compile YCM
cd ~/.vim/bundle/YouCompleteMe python3 install.py --all
Btw, when compiling everything I get several warning along these lines:
ld: warning: text-based stub file /*****/CoreFoundation.tbd and library file
/****//CoreFoundation.framework/CoreFoundation are out of sync.
Falling back to library file for linking.
Any ideas what I can do to get it off the ground?
Thanks.
On Linux, with VIM >8.1
To solve the issue, run the installer from the plugin.
Go to vim folder
cd ~/.vim/plugged/YouCompleteMe
and run the installer.sh
./installer.sh
hope this solution solves your as well.
I installed Vim 7.4 in a Windows 8 machine and it was working fine. After installing all plugins in my .vimrc, GVIM crashed and it wouldn't open again. I could manage to use VIM from cmd but not without some errors. My first try was to reeinstall GVIM completely. After reinstalling, it worked fine but if I also reinstall my plugins it would crash and not open again. What should I do?
I removed all plugins and installed one by one until I got the error, which was with the Ultisnips plugin. I happen to know that this plugin requires VIM with Python support, which my VIM probably wouldn't have. To test this, run vim --version and look for a +python (or run echo has("python") from inside GVIM and look for a output of 1). In my case, it was -python, which was confusing, since I have Python installed. According to this answer, you need to install Python after installing VIM, so I did it and it worked.
I installed vim with:
brew install vim --override-system-vi
I also installed macvim using:
brew install macvim
However, terminal vim uses 7.4.52 and macvim uses 7.4.22. Any way around this?
I've uninstalled and reinstalled many times, but I must be doing it wrong...
which vim returns /usr/local/bin/vim
which mvim returns /usr/local/bin/mvim
Any help would be greatly appreciated.
Thnx!
You only need to install macvim: it runs both as a GUI and in the terminal.
I don't know where the confusion comes from but neither gvim nor macvim are frontends for a separate vim. They are vim.
you can rename your system vim, then vim will be the mac vim
You've installed two different pieces of software..but you only want to use one? If so, then just alias your macvim in your shell; for example:
alias vim="/Applications/MacVim.app/Contents/MacOS/Vim"
I'm working in vim and having a problem. On my primary macbook pro, I have vim running in iterm via macvim terminal mode. Normally, I can have multiple tabs open ie, tab1 is rails app a and tab 2 is rails app b, and I can yank y lines from tab1 and paste p them into tab2. On my macbook air, I can't seem to paste between tabs. I'm sharing the bundle dire and bash_profile between the two computers via dropbox so the configuration should be good. The one problem I think I'm noticing is that when I run vim --version on the correctly functioning machine, I get
VIM - Vi Improved 7.3 (date)
MacOs X (unix) version
Included patches: 1-754
compiled by usr#usr-macbook-pro.local
Huge version with MacVim GUI
and when I run vim --version on my mac book air, the non correctly functioning machine I get
V
IM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 23 2012 13:50:52)
Compiled by root#apple.com
Normal version without GUI. Features included (+) or not (-):
and I notice that in the correctly functioning machine the features list has +clipboard and in the non functioning machine the feature list has -clipboard. how do I change this to reflect the proper configuration on the macbook air?
Try running
brew install macvim --override-system-vim
followed by
brew link macvim
However, it looks like the version of vim you are using on your macbook air is not the macvim version you are looking for. It's the standard version of vim. What is the output of which -a vim? You may have to add macvim to your path on your macbook air before the builtin vim. What does echo $PATH output?
i just uninstalled macvim via homebrew and reinstalled it making careful to connect the symlink to the application folder correctly. everything now works.
I'm using RVM (1.17.7) and Ruby 1.9.3p362. In the long run I want to move over to Vim in the Terminal with Tmux. I'm trying to learn how to install and run with my choices for plugins instead of defaulting to Janus, just trying to learn it all and not be a cargo cult programmer.
I did a brew install of Vim git clone of Command-T (I'm using Pathogen) while the Ruby was set to 1.9.3... and everything is good in Terminal using Vim and Command-T. When I run :ruby puts RUBY_VERSION in Terminal Vim, it gives 1.9.3 back. The Command-T works fine too.
When I try and use the same Command-T in MacVim it crashes and the Terminal says:
Vim: Caught deadly signal SEGV
Vim: Finished.
I did a brew install macvim while in 1.9.3, but when I launch mvim from Terminal and run :ruby puts RUBY_VERSION I get back 1.8.7. I know Wincent recommends the system version of Ruby for installing Command-T and I've read you have to match up the Ruby version either way. I've managed to get it working for both when I had the system ruby, but can't get it for both on the RVM version with 1.9.3...
Is it possible? Should I just forget about MacVim and stick with Vim in the Terminal?
Other things I thought I could do would be to have a disabled folder and just move the different Command-T installations in and out of it. Or maybe do an if for 'gui_running' and target the different installs. Any advice to set me straight would be great.
I've installed Tim Pope's rvm.vim and can set the Ruby version, but that doesn't seem to stop the crash in the MacVim when I call :CommandT.
I'm guessing that you installed the macvim package before you installed installed all the rest of that, and then installed the vim package afterwards. That'd explain why it works in terminal mode. These are two different packages, and they have their own build options.
Run:
vim --version
And compare the output to:
mvim --version
In particular, check out the last line (starts with Linking:). You'll probably see ruby-1.8 linked in for mvim, and ruby-1.9.1 linked in for vim (note that 1.9.3 reports 1.9.1; it's the C API version, not the Ruby version).
If all this is true, fix it by doing:
brew uninstall macvim
brew install macvim
It should build against your 1.9.3 config. Make sure rvm current reports 1.9.3 before you do that.