pazams / d-is-for-delete

vim- easy mapping to make 'd' delete (not cut), and 'leader-d' cut.
23 stars 3 forks source link

Incompatible with pycharm ideavim plugin #1

Open joihn opened 9 months ago

joihn commented 9 months ago

Thanks for this tools, work well on classic vim,

However, it's Incompatible with pycharm ideavim plugin :( d copy to register (not clipboard) leader-d also seems to copy to register

how to reproduce install pycharm install ideavim plugin copy this to ~/.ideavimrc

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => pazams opinionated- ‘d is for delete’ & ‘ leader-d is for cut’ (shared clipboard register mode)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" if you are using the yankring plugin, there could be some conflicts.
" to make the most of these suggested mappings,
" make sure to delete any keys mapped below from the following line at yankring.vim 
" (i.e. delete 'x' and 'D'):
" let g:yankring_n_keys = 'Y D x X'

nnoremap x "_x
nnoremap X "_X
nnoremap d "_d
nnoremap D "_D
vnoremap d "_d

if has('unnamedplus')
  set clipboard=unnamed,unnamedplus
  nnoremap <leader>d "+d
  nnoremap <leader>D "+D
  vnoremap <leader>d "+d
else
  set clipboard=unnamed
  nnoremap <leader>d "*d
  nnoremap <leader>D "*D
  vnoremap <leader>d "*d
endif
joihn commented 9 months ago

looks like the if condiciton had some issues, this works:

nnoremap x "_x
nnoremap X "_X
nnoremap d "_d
nnoremap D "_D
vnoremap d "_d

set clipboard=unnamed,unnamedplus
nnoremap <leader>d "+d
nnoremap <leader>D "+D
vnoremap <leader>d "+d