svermeulen / vim-easyclip

Simplified clipboard functionality for Vim
689 stars 21 forks source link

Cannot toggle repeatedly through yankring #119

Open simlei opened 6 years ago

simlei commented 6 years ago

I past text with p, then immediately press CTRL-P. It goes back one entry in the buffer. I paste, the entry that was before the first one is pasted. So far, so good.

But then it gets sad: Pressing CTRL-P multiple times after a paste only toggles the yankring revolution once! At the second CTRL-P, I get the status: "last action was not paste, swap ignored".

But I want to access the yank 2 times before my last! What am I doing wrong? Or is it even a bug...

In the README it was described as

[...] What this means for example is that you can toggle a given paste back using <CTRL-P> 10 times, [...]

So, I assumed, repeated CTRL-P was the way to go.


Clarification: I am new to vim. I have though tried out the "original"YankRing now, and it is clear to me what to expect. In short, your CTRL-P and CTRL-N keybindings do not work at all. They do not change the text that has been previously pasted. Pretty frustrating :(

Because: I really like how you redirected everything in the black hole and made a dedicated "move" command. Exactly what I want! So - I will go with the original YankRing for now but would be glad to assist in debugging this issue!

I am on Vim 8.0.1669. This is my vimrc

" vim plugin manager autoloads
if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

" how to conditionalize so it doesnt delete when disabled
" , Cond(has('nvim'))

call plug#begin('~/.vim/plugged')
          Plug 'tpope/vim-repeat'
          Plug 'svermeulen/vim-easyclip'          
          Plug 'moll/vim-bbye'
          Plug 'vim-scripts/ZoomWin'
          Plug 'zirrostig/vim-schlepp' 
call plug#end()

" bbye
:nnoremap <Leader>q :Bdelete<CR>

" easyclip occupies 'm' now. gm is now set mark
nnoremap gm m
nmap M <Plug>MoveMotionEndOfLinePlug

"move lines alt-shift jk
set smartindent

" Schlepp
vmap <S-k> <Plug>SchleppDupUp
vmap <S-j> <Plug>SchleppDupDown
vmap <S-h> <Plug>SchleppDupLeft
vmap <S-l> <Plug>SchleppDupRight

vmap <C-i> <Plug>SchleppToggleReindent

vmap <C-k>    <Plug>SchleppUp
vmap <C-j>  <Plug>SchleppDown
vmap <C-h>  <Plug>SchleppLeft
vmap <C-l> <Plug>SchleppRight

set showcmd
set ic
set clipboard=unnamedplus
set backspace=2 " make backspace work like most other programs
imap <S-Space> <Esc>
imap <C-L> <Esc>
set undofile
set wildmenu
set et
nnoremap <C-i> i_<Esc>r
set hlsearch
set incsearch
:nnoremap <silent><expr> <Leader>h (&hls && v:hlsearch ? ':nohls' : ':set hls')."\n"

" ------------------------------------------------------------
svermeulen commented 6 years ago

Yes, this is a known issue, reported here as well : https://github.com/svermeulen/vim-easyclip/issues/109

Unfortunately I don't have time to look into it for another couple weeks minimum. Like I said in the other issue, if anyone with vimscript knowlege is able to help in the meantime that would be great

simlei commented 6 years ago

Is there any news on this? Your plugin in concept is great, but right now I have fallen back on the Yankring which massively pollutes my key bindings. I absolutely do not have the skills to debug a vimscript plugin that deals with registers, though :/

svermeulen commented 6 years ago

No news yet, but like I said in my last comment, I should finally have time in the next week to start taking a look

I am not seeing this issue so I think it's something new to Vim 8 / Neovim? Not sure

I can sympathize with your not wanting to learn vimscript :)

simlei commented 6 years ago

I'm sandboxing my vim right now anyways and should be able to make a minimal reproduction repo in the next week. You would just have to make it and a bashscript would bootstrap 1) subfolder-installed vim 2) minimal vimrc via VIMINIT environment variable. I'll post again here when I have it.

razor-x commented 6 years ago

I tired rolling back to some earlier commits when I believe this was working for me on Neovim, but no luck. I'm guessing that means that something changed in Neovim that broke this functionality.

gauteh commented 6 years ago

I'm hitting this bug as well. Would be super nice if this could be fixed! Missing the other features from similar plugins. Tried with a minimal vimrc (only vim-repeat and vim-easyclip), still the same.

VIM - Vi IMproved 8.1 (2018 May 17, compiled May 25 2018 00:50:25)
Included patches: 1-22
Compiled by Arch Linux
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               +farsi             +mouse_sgr         -tag_any_white
+arabic            +file_in_path      -mouse_sysmouse    +tcl/dyn
+autocmd           +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
+balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
+browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +timers
+byte_offset       -hangul_input      +num64             +title
+channel           +iconv             +packages          +toolbar
+cindent           +insert_expand     +path_extra        +user_commands
+clientserver      +job               +perl/dyn          +vertsplit
+clipboard         +jumplist          +persistent_undo   +virtualedit
+cmdline_compl     +keymap            +postscript        +visual
+cmdline_hist      +lambda            +printer           +visualextra
+cmdline_info      +langmap           +profile           +viminfo
+comments          +libcall           +python/dyn        +vreplace
+conceal           +linebreak         +python3/dyn       +wildignore
+cryptv            +lispindent        +quickfix          +wildmenu
+cscope            +listcmds          +reltime           +windows
+cursorbind        +localmap          +rightleft         +writebackup
+cursorshape       +lua/dyn           +ruby/dyn          +X11
+dialog_con_gui    +menu              +scrollbind        -xfontset
+diff              +mksession         +signs             +xim
+digraphs          +modify_fname      +smartindent       -xpm
+dnd               +mouse             +startuptime       +xsmp_interact
-ebcdic            +mouseshape        +statusline        +xterm_clipboard
+emacs_tags        +mouse_dec         -sun_workshop      -xterm_save
+eval              +mouse_gpm         +syntax            
+ex_extra          -mouse_jsbterm     +tag_binary        
+extra_search      +mouse_netterm     +tag_old_static    
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/libdrm -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_FORTIFY_SOURCE=2  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.26/core_perl/CORE  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lfribidi -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lelf -lnsl    -lacl -lattr -lgpm -ldl   -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.26/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/perl5/5.26/core_perl/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc   -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm     
svermeulen commented 5 years ago

As stated now at the top of the readme, easyclip is being split up into three new plugins that target Vim 8 / Neovim. I'm migrating to neovim and have got the previous yank swapping functionality working correctly again in Neovim with nvim-yoink