svermeulen / vim-easyclip

Simplified clipboard functionality for Vim
693 stars 21 forks source link

unnamed ("") register being populated #67

Closed fdelacruz closed 8 years ago

fdelacruz commented 8 years ago

The following d{motion}, dd, D, c{motion}, cc, C, s, and S All populate the unnamed ("") register. I have tested it with: :command! RegClear :let @a='' | let @-='' | let @0='' | let @1='' | let @"='' Which then I can use to clear the "a, "-, "0, "1 and the "" registers by issuing :RegClear. Checking the content of the registers :reg after each of the aforementioned vim commands. I'm on OS X (SL) vim clipboard=unnamed

svermeulen commented 8 years ago

So hitting dd will save the current line to the unnamed register? I just ran a test with vanilla vim + easyclip and this worked ok on windows (did not save to unnamed register) so I wonder if this is a mac thing.

fdelacruz commented 8 years ago

Yes. Can any other Mac users please attest to this? Make sure I'm not going crazy.

fdelacruz commented 8 years ago

How did you go about testing it in a vanilla vim. My guess is start vim without loading plugins and then load easyclip. Can you please briefly go over that?? Thank you

fdelacruz commented 8 years ago

I should maybe add that I'm using the following settings:

let g:EasyClipUseSubstituteDefaults = 1

let g:EasyClipUseCutDefaults = 0
nmap x <Plug>MoveMotionPlug
xmap x <Plug>MoveMotionXPlug
nmap xx <Plug>MoveMotionLinePlug

let g:EasyClipUsePasteToggleDefaults = 0
nmap <c-f> <plug>EasyClipSwapPasteForward
nmap <c-d> <plug>EasyClipSwapPasteBackwards
fdelacruz commented 8 years ago

Oops!!

svermeulen commented 8 years ago

For testing these kinds of things I use a stripped down vimrc that just contains the following. Then I run it by executing gvim.exe -u ~/.vimrc2. I append a 2 to vimrc and also the vim directory to allow me to avoid changing my normal config

" Note: Skip initialization for vim-tiny or vim-small.
if !1 | finish | endif

let &rtp = substitute(&rtp, 'Steve/vimfiles\>', 'Steve/vimfiles2', 'g')
let &rtp = substitute(&rtp, 'Steve/.vim\>', 'Steve/.vim2', 'g')

if has('vim_starting')
    set nocompatible               " Be iMproved

    " Required:
    set runtimepath+=~/.vim2/bundle/neobundle.vim/
endif

" Required:
call neobundle#begin(expand('~/.vim2/bundle/'))

" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'

NeoBundle 'svermeulen/vim-easyclip.git'

NeoBundle 'tpope/vim-repeat'

call neobundle#end()

" Required:
filetype plugin indent on

" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck

"""""""""""""""""""""""
" Settings
"""""""""""""""""""""""

set clipboard=unnamed
svermeulen commented 8 years ago

By the way, that vimrc is based on the neobundle page (note that I added some custom paths that won't apply to you)

Unfortunately I don't have a mac so can't try and reproduce this. Can you try it with a similarly stripped down config on your mac?

fdelacruz commented 8 years ago

I'm on it..

fdelacruz commented 8 years ago

Did something similar. Used the striped down vimrc found in the Vundle repo.

# ~/.vimrc2

set nocompatible    
filetype off               

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

Plugin 'svermeulen/vim-easyclip.git'
Plugin 'tpope/vim-repeat'

call vundle#end()   

filetype plugin indent on    

clipboard=unnamed

The unnamed register still gets populated on deletes.

svermeulen commented 8 years ago

I'll see if I can figure out a way to reproduce this on mac. I can't really fix it otherwise

fdelacruz commented 8 years ago

Thanks for looking into this. I'm surprised no other Mac user has noticed this. I hope it's not just me.

fdelacruz commented 8 years ago

I'm starting to think this is a very serious vim bug. Even manually remapping d to "_d this issue persists :nnoremap d "_d

svermeulen commented 8 years ago

Oh interesting. The black hole register doesn't work at all? What if you just type "_d instead of using a mapping?

fdelacruz commented 8 years ago

Yes, without using a mapping the black hole register seems to work. scratches head

fdelacruz commented 8 years ago

I found the problem which only happens on js files. The JSHint fork of jslint.vim I was using seems to hijack dw and dd: jshint_vs_easyclip It's an open issue too. The rest of the commands work as intended after all.

svermeulen commented 8 years ago

Ah yes. That makes more sense than a vim bug or easyclip completely not working on mac :)