Closed luqasz closed 2 years ago
@luqasz
No, your mapping looks fine to me. I have a similar mapping for imap <S-Insert> <C-R>+
, which also reproduces this issue.
It looks like this is an issue with the <C-R>+
sequence in insert or visual mode.
I have no problems with "+p
or "+y
in normal mode.
Here is a simplified minimal repro case:
inoremap <silent><D-v> <C-R>+
This reproduces in nvim
too. I'd recommend filing a bug upstream in the Neovim repository. This also could be an issue even further upstream in Vim, but the Neovim folks should be able to help locate the issue.
In terminal nvim and vim everything works fine. I suspect that it works because CMD+V is a terminal emulator shortcut. I don't have this shortcut defined in nvim / vim (running in terminal). Sample text pastes just fine.
I have no problems with "+p or "+y in normal mode.
Yep. Works for me also
Do you think it's still worth reporting this to https://github.com/neovim/neovim ?
I think I know what might be the issue. help 'paste'
says that nvim has to be switched into paste mode so it doesn't think that when hitting CMD+V in insert mode is actual typing. I have smartindent etc. on, which results in those unwanted indents.
Now the question is how to tell nvim-qt that it has to switch into paste mode.
from help 'paste'
:
This option is obsolete; |bracketed-paste-mode| is built-in.
@luqasz Sorry for the slow response.
Yes, let's file a bug upstream in Neovim. I can reproduce the issue in nvim
and nvim-qt
, which is usually a good indicator the issue lies in Neovim (or Vim).
I'm not familiar with the paste
option, but it seams to break the mapping on my machine (Konsole Terminal).
Worst case, if this is actually in fact neovim-qt
bug, hopefully the Neovim folks can provide some guidance.
This is because of 'autoindent'
. Vim behaves the same with 'autoindent'
set.
OK. Thx for help. Is there any way to temporary for pasting purposes disable autoindent
?
You can try <C-R><C-O>+
or <C-R><C-P>+
.
See :h i_CTRL-R
, :h i_CTRL-R_CTRL-O
, :h i_CTRL-R_CTRL-P
.
@zeertzjq Works. Thx
HI
I've added some mappings to behave same as other apps on mac:
When selecting some text (from e.g. a browser) with indent e.g.
going to insert mode and hitting CMD+V causes text to be:
Any idea what's going on ? Maybe I am mapping my keys wrong.