junegunn / vim-peekaboo Goto Github PK
View Code? Open in Web Editor NEW:eyes: " / @ / CTRL-R
:eyes: " / @ / CTRL-R
Hello,
First of all thank you so much for this amazing plugins, it is one of my favorite plugins.
In different opened issues you mentioned that some issues are unfixable. Specifically you said: here #32 "I have learned from my experience that overriding the default behavior of Vim leads to many subtle issues that are very difficult or even impossible to fix".
I'm really interested in learning how you achieve this, and maybe use this popup for multiple things like commands I rarely use and can't really remember, like 'z..'. Can you explain exactly what is the problem?
For example would using floating windows in neovim help with this?
Thank you for everything
This is a really weird thing I've started seeing lately, I'm guessing since I updated to Neovim 0.4.2. Say I have this buffer. I've selected the second "something" and I want to copy it:
When I type the "
, Peekaboo appears as normal. Then if I type +
to choose the system clipboard register, this happens:
It always seems to be the second word in the fourth line where this happens. The highlighted region is using the peekabooSelected
highlight group. The selected item does get yanked to the correct register, but now I have an errant +
in my buffer.
Any ideas would be appreciated. This is really strange!
Is this possible? Is there a function that can be called to do this? Thanks
Hi,
I love your plugin, but my mappings such as
nmap <M-o> "+gP
imap <M-o> <ESC>"+gP
No longer work because your plug-in changes the double quote character. Is there a way around this?
Thanks!
If I press @ap
, the peekaboo window will show. However, after that, the "
and @
will fail to work. No window will show.
A command like ciw<C-r>a
cannot be repeated with the .
(dot) command.
It behaves like i<C-r>a<Esc>
.
This might get fixed by using https://github.com/tpope/vim-repeat?!
I often edit the same buffer in vertical split. When I try to paste in insert mode CTRL+R, while in the right pane, the cursor jumps to left pane, and pasted word appears in random area.
Here I try to delete word del to paste()
Here my cursor in between parens: paste(|), while in insert mode I press CTRL+R+-
The result:
Peekaboo is able to integrate with Cmd2.vim to allow Peekaboo to be called in command mode.
The only missing thing is that <Plug>(pkbcr)
is not cnoremap
-ped. Is it possible to put this as a default mapping to allow for a seamless integration?
hi peekabooSelected cterm=reverse
Would work with most colorschemes (but not look as good probably, but i am running into cases when the selected register renders black on black with many themes. Maybe drop the highlight group completely?
Hi, thanks a lot for this plugin. The solved issue #61 allows me to use this plugin again...
Often, when I paste in insert mode (ctrl+r<register>p
), I get the window resized to one line:
I can't get a pattern for that, So I don't know how to reproduce it, but it happens very often when pasting in insert mode. I don't have this problem when pasting in normal mode.
I'm using nvim 0.4.3
. This was not a thing until 0.4.1
@junegunn the gifs you have in READMEs across your repos are very nice.
Specifically I'm thinking of these
What do you use? asciinema for example does not appear to support keypress overlays.
Thanks for any insight.
Issue: Failed to install in Vim (Neovim) using the approach listed.
Aside:
## Symlinks (to use Vim settings with Neovim):
ln -s ~/.vim ~/.config/nvim
ln -s ~/.vimrc ~/.config/nvim/init.vim
Solution: I manually recreated the autoload | plugin | syntax
directory structure shown at https://github.com/junegunn/vim-peekaboo in /home/victoria/.vim/ (copied raw files/code to those locations).
In my case, I needed to create the /home/victoria/.vim/plugin/ and /home/victoria/.vim/syntax directories.
[victoria@victoria .vim]$ tree -L 2 -F ~/.vim -I 'bundle*|init*|readme*|spell*|swap|undo|view|vim*'
/home/victoria/.vim
├── autoload/
│ ├── pathogen.vim
│ └── peekaboo.vim
├── plugin/
│ └── peekaboo.vim
└── syntax/
└── peekaboo.vim
Peekaboo doesn't trigger on ctrl+r in :command
mode.
If the any text in in the registers has fold markers, some or most of the buffer ends up folded away.
Suggestion: setlocal foldlevel to something very high, so it is always open.
As my peekaboo window opens and closes my gvim window slowly get more and more narrow. There a resize happening that is causing my window to shrink
canceled :)
Hi,
Peekaboo is very convenient since it removes the need to remember what is stored in which register.
I think it would be very useful to have a similar mechanism for marks. Indeed marks are conceptually quite similar to registers, in the sense that there is a whole list of automatic and manual marks at different positions and it is often difficult to remember where every mark is located.
Do you think it would be possible to extend peekaboo (or create another plugin along the same concept), but with marks instead of registers?
I've noticed that with Neovim, (e.g. <c-r>*
) in insert mode at the end of line will insert the register not at the end, but one character before it.
foo_
=> fobar_o
Can you confirm this?
Hi, while using peekaboo I've hit problems when one of the registers contains a lot of data, is there a way to temporarily disable peekaboo?
Register 0 is shown wrong in the peekaboo window.
https://github.com/junegunn/vim-peekaboo/blob/master/autoload/peekaboo.vim#L32
This is caused by Vim's string equality, 0 == '%'
is true. So for register 0, register '%' is printed instead. This can be fixed by checking that the register is a Number or using a regex.
Is there a way to temporarily maximize the view, perhaps by pressing a key that would never be used following "
or @
(maybe <SPACE>
)?
I love using this plug-in, but sometimes I might be doing a thing like:
:'<,'>normal @q
And so as this runs on every line I have to see the peekaboo panel toggle open and closed every time it executes the @q.
Do you have any suggestions for how you might handle a thing like this? I'm thinking maybe I should just have a function that I can call to toggle peekaboo on/off.
Not sure, though.
Vim version 7.4.692 hangs.
I'm using nvim v0.4.3 (also tested with git master), and with this plugin enabled, pressing "
often (but not always) causes neovim to completely lock up. If I'm using the QT GUI, the mouse cursor changes to busy, and the application completely freezes. It doesn't respond to any keypresses or mouse clicks, and usually has to be killed with SIGKILL
, as SIGTERM
doesn't seem to do anything either.
Hi. Peekaboo looks fascinating. Can I get a git tag so I can send my package managers to pull the plugin with a version number? Tyvm sir
Currently nonumber
is set to disable line numbers, however if relativenumber
is normally set then the peekaboo window will contain numbers.
Adding norelativenumber
to the set of local buffer options fixes this.
I did not pay attention.
For anyone using this plugin for the first time: you have the recording in the peekaboo menu.
So, you can still use recording like you normally do.
Cheers
My apologies for asking this question here, but I couldn't find how to configure the position of the peekaboo window. I noticed the setting g:peekaboo_window
but it's not clear to me what format I should use for that.
I wanted to make the peekaboo_window show up at the top in a horizontal split, so my failed attempt was:
let g:peekaboo_window='split topleft'
thanks
That would add like 7 more lines on the screen, so more fits on small screens.
Running a macro that does in insert mode to read from register does not work, and returns empty string - not contents of register.
Bug is only visible when running macro, not when recording it.
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 9 2014 22:01:23)
MacOS X (unix) version
Included patches: 1-488
Compiled by Homebrew
The settings in my vimrc (mappings and functions removed)
Tested without other plugins.
Cannot reproduce with peekaboo plugin disabled.
Record a macro that reads from a register in insert mode like this:
<C-R><register>
So, with 'hello' in the " register, this command qqi<C-R>"<ESC>q
, writes 'hello', and is working as expected.
The issue emerges when running the macro with @q
.
Expected: hello
is printed
Actual: nothing is printed, and the bell rings (visuall and sound bell from terminal)
Possibly related:
If you do exactly the same as above, but add after and before ", then the "
will be written out instead of nothing.
Off topic trivia:
When using <C-R><register>
in a macro, you will paste whatever was in the register at the time of recording.
When you use <C-R><C-P><register>
, you will paste whatever is in the register when you run the macro.
Hi,
Firstly, just want to say that I really love this plugin, it's a great idea and seems to be very well implemented. Thank you!
The issue that I'm having is that I'd like to open the peekaboo window in the current buffer window instead of in a separate split. I've attempted to use the g:peekaboo_window
variable, but couldn't figure out how to do anything with it other than split windows.
Is it possible to achieve this with the plugin as it exists?
If not, it's a feature that I'd really like, as opening a split if often not desirable on wide monitors. I understand you might not have the time / desire to do this, in which case I'd be happy to fork it and attempt to implement it myself.
Thanks
Thanks for these great Vim plugins.
Unfortunately when I combine Limelight as an autocmd on .txt files and then use Peekaboo, if there's something already on the line I'm pasting to, the paste goes to the start of the line (which is very impractical).
Not sure what's causing the problem.
fmt.Println("|string") // ya"
test :=⋅| //<C-r>"
// middle dot denotes a space here
--- Result:
test :="string"⋅ // note the middle dot's position, denoting a space
--- Expected:
test :=⋅"string"
MX Linux 17
NVIM v0.3.0-1029-g48967695c Build type: RelWithDebInfo
.I'd rather avoid shadowing @
, which is used for macros, and remap the prefix to another key. I tried several in the format let g:peekaboo_prefix="<leader>2
, but it had the effect of preventing peekaboo from working altogether.
The following abbreviation is broken when using vim-peekabo
.
iabbr tdate <c-r>=strftime("%Y-%m-%d")<cr>
When vim-peekaboo
is installed, the text inserted is literally strftime("%Y-%m-%d")
.
call dein#add('junegunn/vim-peekaboo', {
\ 'on_map': ['"', '@'],
\ })
when type '@' or '"', nothing will occur. utill user :edit
to refresh, the plugin will work.
Thank you!
This is a nasty one. And I'm not even sure of what is going on.
Special sequence of commands, involving moving a line up/down, pasting from a specified register, and moving back, produces strange output.
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 9 2014 22:01:23)
MacOS X (unix) version
Included patches: 1-488
Compiled by Homebrew
The settings in my vimrc (mappings and functions removed)
Tested without other plugins.
Cannot reproduce with peekaboo plugin disabled.
These produce the exact same output when peekaboo is enabled.
Should paste a word under the cursor
o^[""pk
$a^M^[""pk
j""pk
k""pj
YES
o^[""pk
, or one from the list above (or just yank it into the q register)Expected:
some text that was here before
YES
Actual:
sYESome text that was here before
(empty line inserted from the o-command, if you used the macro with an o-command)
Notes:
The bug does occur for other registers than the one used in the example.
The bug does not occur if you paste without specifying register with ".
The bug does not occur if you don't move back to the starting line. So this macro does not trigger it: k""p
(the same as the last macro in the list of macros, but without the j
for returning to the line).
For instance, my vimrc contains
iabbrev ddate <C-R>=strftime(%F")<CR>
to insert the current date. Vim-peekaboo captures the and prevents this from working. Is there a good way to work around that conflict?
Pastes :call peekaboo#peek(1, 'ctrl-r', 0)
into the file.
If I enter in the expression register "=
, either by doing <C-R>=
in insert mode or "=
in normal mode, and then try to paste something, as soon as I press "
, the text Peekaboo
is written on the commandline, and I can't paste anything unless I do the workaround of entering the commandline window with <C-F>
.
When you know exactly what register to use, peekaboo gets in the way (visually, but might also "eat" some keys).
It would be nice if it could be deferred, e.g. until CursorHold or something similar is triggered - given the limited async capabilities Vim has.
Here is a minimal .vimrc
to show problem case:
" minimalvimrc
set nocompatible
" Add vim-peekaboo repository to runtime path.
set runtimepath+=/tmp/vim-peekaboo
runtime! 'plugin/vim-peekaboo.vim'
augroup foobar
autocmd!
" `silent! !true` provokes the same behavior.
autocmd InsertEnter * silent! call system('true')
augroup END
Run vim -u minimalvimrc
, then enter insert mode and press <C-r>0
(or insert any other register). For me, it doesn't output register content, but inserts <Plug>(pkbcr)0
.
Sorry I swear I am going to stop logging issues on all of your awesome plugins after this one.
Basically when I show the peekaboo
register it is full of ../
and ../../
it gets worst after using netrw
Any ideas, could be related to this: kien/ctrlp.vim#648
I have disabled any lines related to my clipboard.
Cheers.
Otis.
I guess there is some reason why it's not already mapped to cmode or you would have already done so. But just double checking.
I naively tried:
cnoremap call peekaboo#peek(1, 'ctrl-r', 0)
and the sidebar shows up, but not sure how to go on. Needless to say, my knowledge of viml is limited to let this and let that...
If you enter the commandline window (with q: or :) and then try to paste something there, you get this series of errors:
For the time being I am fixing this by setting a delay for peekaboo, but I thought you could implement in the commandline window the same behavior it has on the commandline, namely, be inactive.
Thanks for the great plugin!
e.g.
hello world
qqVyo<c-r>"<esc>k
hello world
hello world
<blank line>
@q
Expected:
hello world
hello world
hello world
<blank line>
<blank line>
Actual
hello world
hello world
<blank line>
<blank line>
<blank line>
When using Visual-block Insert (CTRL-V
from normal mode, select a region, then I
), the <C-r>
mapping does not work: it enters the right hand side literally:
:call peekaboo#peek(1, 'ctrl-r', 0)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.