zsh-vi-mode
zsh-vi-mode copied to clipboard
Pasting in normal mode breaks
Not sure exactly when this started happening, but pasting breaks in subtle ways.
Here I've entered normal mode, and hit p
. This pasted the contents of the buffer below my prompt. I cannot navigate to this content, and hitting dd
to delete the line only deleted a single character at the end of that pasted contented.
If I type content in insert mode and then delete the line, my inserted content is deleted and the content that was pasted moves up into the correct position and is delete-able.
This is on the latest content but is reproduce-able a couple of commits back to feat: provide a mechanism to execute extra commands
Hi @BerkeleyTrue
Thanks for your actively reporting. And now I have confirm the bug about dd
to delete the line but only deleted a single character at the end of content. But the navigation issue has not appeared yet. I will focus to figure out the issues and thanks agian for your support.
Thanks and regards
Hi @BerkeleyTrue
Thanks for your patient, and after some effort I have figured out some issues about visual line, such as dd
to delete one line or cc
to change one line and so on, the commit ( 0bcfe76 ) has fixed the issues mentioned, welcome to update it.
Thanks and regards
Looks like there is still some oddness. I'll upload a gif of what I'm experiencing.
On the latest commit:
I first open a new term, and switch to normal mode. Then I hit p
three times with a slight pause in between each. No results
Then I switch back to insert mode and again into normal mode and repeat the process. No results.
Then I switch back and forth and hit Shift and C-v to paste which does work in a way but it seems like I have to hit enter to accept the paste.
dd works to delete the line, now I hit p
I get that weird behavior where it pastes below the line and again in the same way where I have to hit enter to accept the paste.
Hi @BerkeleyTrue
So many thanks for your details about the issue, and my site still can not reproduce the issue. Could we have another approach for digging this issue?
Thanks and regards
@jeffreytse how do you mean? I can do some more debugging if you give me some guidance as I'm not that familiar with the inner works of zsh.
@BerkeleyTrue
I means that if you could provide the details about your enviroment, such as plugins that you are using and so on, maybe it is a conflict on some plugin. Or that we can talk with one IM, maybe it is better. : )
Thanks and regards
@jeffreytse Here are the plugins and config I use for zsh https://github.com/berkeleytrue/dotfiles/blob/master/.config/zsh/.zshrc And my theme https://github.com/berkeleytrue/dotfiles/blob/master/.config/zsh/ghanima.zsh-theme
Hi @BerkeleyTrue
Thanks for your instructions to help me to check this issue, now your issue about weird paste has been addressed, this issue caused by your .zshrc
at L102, here you put your content to the CUTBUFFER
, so you hit p
will put the content after the current line.
Thanks and regards
@jeffreytse Thanks for looking into it. Should I remove the offending code? I put that code together several years ago so I'm sure a lot has changed in zsh.
Edit: Removing that functionality doesn't seem to fix the behavior.
Hi @BerkeleyTrue
Remove the offending code can fix your issue, actually I have reproduced your issue in my side with your dotfile, I have commit a PR for you, you can have a try.
Thanks and regards
@jeffreytse I just gave it a try and I was still seeing the same behavior
Hi @BerkeleyTrue
I want to know whether you are using the command line by remote ssh?
Thanks and regards
I use kitty terminal and run tmux but I am local to my machine
Hi @BerkeleyTrue
I have tried again your issue, it is a feature in fact, because you use dd
to delete one line, you use p
will put the line after current line and the paste content will be highlighted also. You can usee P
to paste before current line.
Thanks and regards
@jeffreytse I think that the red highlighting caused the confusion. In my opinion red is not really a good color, because we associate it with errors.
Hi @weisbrja, thanks for the suggestion, I will take a consideration for a better highlight background color by default in the future.
also something maybe related: when I'm in normal mode, and I paste using ctrl+shift+v it filters all "g" characters from the string I pasted. And if it contained a double "gg" it would only leave one "g"
So when I paste "gregor" in normal mode, I get "reor"
Hi @gregorriegler
The issue you mentioned, I can not reproduce in my environment, could you tell me more details about it?
Thanks and Regards
Ubuntu 20.04.2 LTS x86_64 with i3 Kernel: 5.4.0-81-generic Shell: zsh 5.8 (x86_64-ubuntu-linux-gnu) Terminal: x-terminal-emul
Reproducable with a zshrc with just zsh-vi-mode installed
I should add: happens in alacritty as well as in gnome-terminal
@gregorriegler Thanks for your useful information.
I am now on an ArcoLinux Distribution Kernel: 5.13.12-arch1-1 Shell: zsh 5.8 Terminal: alacritty and I am able to reproduce this Issue I had on Ubuntu with the filtered out g's
@gregorriegler Than you! I will reply here if I get progress on it.
Hi @gregorriegler
I still can not reproduce your issue, I think it's something about your .zshrc
configuration, such as plugin clash. You can have a check which row of your .zshrc
making this issue.
https://user-images.githubusercontent.com/9413601/130899278-2153e8e7-ba4f-462a-bc37-578c4a08d2cd.mp4
Thanks and Regards
@gregorriegler What zsh-vi-mode
version are you using?
The latest from master branch. Hopefully, I find the time this weekend to make a quick video with a zshrc with only one module. Wondering what else could have an impact on this behaviour. Maybe my keyboard layout? I am using a German Keyboard Layout.
Hello, I've switched back to zsh-vim-mode now for a couple of months and I haven't noticed and issues with pasting.
Don't know if others are having issues still that require this issue to remain open?