2

I've tried a bunch of things but I still haven't managed to get this working on my mac. Here's what vim --version | grep clip gives:

+clipboard       +job             +path_extra      -toolbar
+ex_extra        -mouse_gpm       -sun_workshop    +xterm_clipboard

And .vimrc:

➜  ~ cat .vimrc
set number
syntax on
set clipboard=unnamedplus

" indentation settings from https://stackoverflow.com/a/234578/1539208
filetype plugin indent on
" show existing tab with 2 spaces width
set tabstop=2
" when indenting with '>', use 2 spaces width
set shiftwidth=2
" On pressing tab, insert 2 spaces
set expandtab

I've also tried set clipboard=unnamed without luck. What I want to accomplish (that I have working on my Ubuntu machine) is that typing "+y will copy the selected text (selected with visual mode) so that I can paste it in another program. This isn't working. "*y isn't working either. What I mean by "not working" is that the text I've marked and yanked should be inserted when I press cmd+v in another program (say the chrome adress bar) but it isn't.

I'm running macOS Sierra 10.12.6. What I did to install the vim version I have is brew install vim --with-client-server --with-override-system-vim. I'm more than open to using another vim version if that'll help me. I'm using tmux v2.5 if that matters.

Edit: I've tried the solution suggested in this Stackoverflow question without luck: Clipboard failure in tmux + vim after upgrading to MacOS Sierra. I had already done that before posting this question, but for some reason my brain decided that information wasn't relevant - sorry! Here's cat .tmux.conf:

# Disable automatic renaming of windows when commands are executed
set-option -g allow-rename off

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'

# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'

# Fix copying (on mac). Ref https://github.com/tmux/tmux/issues/543
set -g default-shell $SHELL
set -g default-command "reattach-to-user-namespace -l ${SHELL}"

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
L42
  • 3,052
  • 4
  • 28
  • 49
  • Put `set-option -g default-command "reattach-to-user-namespace -l zsh"` in your `.tmux.conf` (replace `zsh` with `bash`, if you don't use zsh). Also, install `reattach-to-user-namespace` using brew. – L3viathan Nov 06 '17 at 10:34
  • Possible duplicate of [Clipboard failure in tmux + vim after upgrading to MacOS Sierra](https://stackoverflow.com/questions/39645253/clipboard-failure-in-tmux-vim-after-upgrading-to-macos-sierra) – L3viathan Nov 06 '17 at 10:37
  • 1
    Thank you! But unfortunately that hasn't solved my problem. – L42 Nov 06 '17 at 11:58

0 Answers0