Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neovim with incsearch + easymotion paste problem. #158

Open
hungrybirder opened this issue Dec 27, 2019 · 3 comments
Open

neovim with incsearch + easymotion paste problem. #158

hungrybirder opened this issue Dec 27, 2019 · 3 comments

Comments

@hungrybirder
Copy link

hungrybirder commented Dec 27, 2019

HI, I got a problem.
Command + v dosen't work well with incsearch.
In normal mode , I type / and then type Command + v. It doesn't paste content to the nvim command line, instead paste the content into the buffer...

macOS 10.15.2
NVIM v0.4.3
Plug 'easymotion/vim-easymotion'
Plug 'haya14busa/incsearch.vim'
Plug 'haya14busa/incsearch-easymotion.vim'
Plug 'haya14busa/incsearch-fuzzy.vim'

if has('mac')
  let g:clipboard = {
    \   'name': 'macOS-clipboard',
    \   'copy': {
    \      '+': 'pbcopy',
    \      '*': 'pbcopy',
    \    },
    \   'paste': {
    \      '+': 'pbpaste',
    \      '*': 'pbpaste',
    \   },
    \   'cache_enabled': 0,
    \ }
endif

if has('clipboard')
  set clipboard& clipboard+=unnamedplus
endif

set hlsearch

let g:EasyMotion_smartcase = 1
nmap s <Plug>(easymotion-overwin-f)
nmap t <Plug>(easymotion-t2)
map <leader>j <Plug>(easymotion-j)
map <leader>k <Plug>(easymotion-k)
map <Leader>L <Plug>(easymotion-bd-jk)
nmap <Leader>L <Plug>(easymotion-overwin-line)
map  <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)

let g:incsearch#magic = '\v'
function! s:incsearch_config(...) abort
  return incsearch#util#deepextend(deepcopy({
  \   'modules': [incsearch#config#easymotion#module({'overwin': 1})],
  \   'keymap': {
  \     "\<CR>": '<Over>(easymotion)'
  \   },
  \   'is_expr': 0
  \ }), get(a:, 1, {}))
endfunction
noremap <silent><expr> /  incsearch#go(<SID>incsearch_config())
noremap <silent><expr> ?  incsearch#go(<SID>incsearch_config({'command': '?'}))
noremap <silent><expr> g/ incsearch#go(<SID>incsearch_config({'is_stay': 1}))

function! s:config_easyfuzzymotion(...) abort
  return extend(copy({
  \   'converters': [incsearch#config#fuzzy#converter()],
  \   'modules': [incsearch#config#easymotion#module()],
  \   'keymap': {"\<CR>": '<Over>(easymotion)'},
  \   'is_expr': 0,
  \   'is_stay': 1
  \ }), get(a:, 1, {}))
endfunction
noremap <silent><expr> <Space>/ incsearch#go(<SID>config_easyfuzzymotion())

augroup incsearch-keymap
    autocmd!
    autocmd VimEnter * call s:incsearch_keymap()
augroup END
function! s:incsearch_keymap()
    IncSearchNoreMap <D-v> <c-r>+
    IncSearchNoreMap <C-v> <c-r>+
endfunction

echo "<D-v>" => <80><fc><80>v
echo "<C-v>" => ^V

If there are something wrong in my init.vim, please let me know.
Thank you.

@lenkite
Copy link

lenkite commented May 10, 2020

Wasted So much time, trying to find out which plugin amongst 400 was causing this issue. Thank you godly for this comment!

@m-fonseca
Copy link

I've disabled all plugins and removed all settings except for the '/' mapping. It looks like neovim with incsearch alone causes this problem for me.

@itaiferber
Copy link

Same here — this took quite a bit of time to track down. This appears to happen with just Neovim + incsearch.vim and terminal bracketed pasting (the default for iTerm2). It looks like disabling either map / <Plug>(incsearch-forward) or performing a non-bracketed paste (iTerm2 Advanced Paste [⌥⌘V] > disable Bracketed Paste Mode) leaves things working correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants