Comments (22)
Thanks, I can reproduce the problem. I've just realized that i_CTRL-O
does not work in that mode at all. Duh, is it an expected behavior?
from vim-peekaboo.
I don't know.. the help for v_b_I
is rather short:
Visual-block Insert v_b_I
With a blockwise selection, I{string} will insert {string} at the start
of block on every line of the block, provided that the line extends into the
block. Thus lines that are short will remain unmodified. TABs are split to
retain visual columns.
See v_b_I_example.
from vim-peekaboo.
Hmm, with Vim behaving this way, I have no idea how to fix it 😕
from vim-peekaboo.
Maybe it could be disabled / skipped in this case?
It would need to hook into InsertEnter maybe and/or look at mode()
and visualmode()
, doing nothing if it's CTRL-V
.
from vim-peekaboo.
visualmode()
only tells what the previous visual mode was. So if we
- Enter blockwise-visual mode
- Esc
- Do something in normal mode
- Enter ordinary insert mode (
i
,a
)
then, visualmode()
will still return CTRL-V
, and we can't use it to determine whether we should temporarily disable CTRL-R
or not.
from vim-peekaboo.
I see. But using mode(1)
should do?
I could imagine using a <expr>
mapping instead of the current one, if that's possible, and it would check mode(1)
against CTRL-V
.
from vim-peekaboo.
Hmm, do you mean checking mode(1)
on InsertEnter?
from vim-peekaboo.
No, with the insert mapping (which needs to be turned into a <expr>
mapping the probably).
It would skip any action (and return "") if mode(1)
is CTRL-V
.
from vim-peekaboo.
Then, wouldn't it return i
? e.g. inoremap <expr> xxx mode(1)
from vim-peekaboo.
Yes, it returns i
then.. :/
It seems to be required to hook into InsertEnter/InsertLeave then, as outlined in Raimondi/delimitMate#138 (comment).
from vim-peekaboo.
But doing so still has the same problem I mentioned above (C-V
, normal
, insert
), visualmode()
is not a perfect way to determine if we're in blockwise-insert mode.
from vim-peekaboo.
Maybe we could fix this by changing the current mapping to <expr>
mapping and not using <c-o>
, I'll check if it's viable.
from vim-peekaboo.
No it's not 💩
Error detected while processing function peekaboo#peek..<SNR>32_init:
line 13:
E523: Not allowed here: vertical botright 30new
from vim-peekaboo.
There would be visualmode(1)
which clears the current mode after getting it (which might have side effects, if others rely on it). But without being able to use <expr>
it does not help much, does it?
from vim-peekaboo.
Oh, I wasn't aware of visualmode(1)
, but I don't think we should use it because of its global side-effect.
But without being able to use it does not help much, does it?
You're right.
By the way, I'm starting to wonder if this (not allowing <c-o>
is vbi) can be a bug of vim itself. If that's the case, I mean if this is a known issue of Vim, we probably shouldn't try too hard to find a complicated workaround for it and just let the users know about it and suggest them to iunmap
if it severely hinders their workflow.
from vim-peekaboo.
Thank you for this thread. I finally understand why nmap <F3> a<C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR><Esc>
doesn't work on my setup (I have peekaboo installed).
from vim-peekaboo.
@nick-s-b No, it's unrelated. Your problem is easily fixed by using non-recursive map.
nnoremap <F3> a<C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR><Esc>
See: https://github.com/junegunn/vim-peekaboo#peekaboo-conflicts-with-my-maps-and-abbrevs
from vim-peekaboo.
Thank you so much junegunn! Works perfectly now!
from vim-peekaboo.
@junegunn: I guess, you can workaround that issue by mapping I
in the visual-mode and keep tracking state changes to determine whether vim in the CTRL-V I
mode or just I
, like I've done in the following commit: reconquest/vim-pythonx@8884830
from vim-peekaboo.
@seletskiy Thanks, maybe it's the only option. But unfortunately once this plugin defines the mapping it will no longer be compatible with the plugins that also define the same mapping, right? That is not ideal :(
from vim-peekaboo.
@junegunn: If you feel particularly hacky, you can try to save/restore user-mapping back and forth. Or just print warning, if mappings are clashing and write concise howto in the readme about how to use vim-peekaboo
mapping for I
with other plugins. User always can do something like that:
vnoremap <expr> I peekaboo#WorkaroundBlockWiseInsert() && doMyPreviousIActions()
Much better, I guess, than having plugin completely broken in the block-wise insert.
from vim-peekaboo.
Did anybody find a workaround this issue?
from vim-peekaboo.
Related Issues (20)
- Window is being resized when pasting in insert mode HOT 2
- Plugin regularly (but unpredictably) crashes neovim HOT 5
- when this plugin be loaded lazy will occur some problem HOT 1
- screencapture tool used in README?
- [Feature Request] Use floating window instead of split HOT 17
- Can it support redir @?
- Can it display the type of register?
- Blank window in visual mode HOT 1
- Not working in Command mode HOT 1
- cmd height changed to maximum HOT 5
- Breaks Ex mode if used
- Peekaboo window does not show leading whitespaces
- [Feature Request] foldcolumn independent window HOT 1
- [Feature Request] show special key combinations instead of bytes: <Esc> instead of ^[ HOT 1
- [bug] conflict with startify
- vim-peekaboo sets cmdheight to max, meaning I can only see 1 line of my window output HOT 5
- Feature Request: change (or disable) default maps HOT 3
- change location of sidebar? HOT 2
- Ctrl-R Insert Mode places register one char before last
- Peekaboo makes it impossible to paste in telescope HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-peekaboo.