소스 검색

Make <MiddleMouse> use "* instead of "" by default

Startify remaps <MiddleMouse> and uses v:register to paste from a specific
register.

The problem:

Unless 'clipboard' is set to "unnamed" or "unnamedplus", v:register will default
to "", whereas <MiddleMouse> usually defaults to "*.

Fixes #281.
Marco Hinz 8 년 전
부모
커밋
f80b0cbe62
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      autoload/startify.vim

+ 1 - 1
autoload/startify.vim

@@ -731,7 +731,7 @@ function! s:set_mappings() abort
   execute "nnoremap <buffer>". s:nowait ."<silent> v             :call <sid>set_mark('V')<cr>"
   execute "nnoremap <buffer>". s:nowait ."<silent> <cr>          :call startify#open_buffers()<cr>"
   execute "nnoremap <buffer>". s:nowait ."<silent> <2-LeftMouse> :call startify#open_buffers()<cr>"
-  execute "nnoremap <buffer>". s:nowait ."<silent> <MiddleMouse> :enew <bar> execute 'normal! \"'.v:register.'gp'<cr>"
+  execute "nnoremap <buffer>". s:nowait ."<silent> <MiddleMouse> :enew <bar> execute 'normal! \"'.(v:register=='\"'?'*':v:register).'gp'<cr>"
 
   " Without these mappings n/N wouldn't work properly, since autocmds always
   " force the cursor back on the index.