Created
November 19, 2015 00:13
-
-
Save davidosomething/e2d2b0bbcdfbdf0448f3 to your computer and use it in GitHub Desktop.
PUM for easyclip yanks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scriptencoding UTF-8 | |
" ============================================================================ | |
" EasyClip ring | |
" Requires vim-easyclip installed | |
" Press <Leader>cr to get a pop-up menu to select a yank | |
" ============================================================================ | |
function! YanksToArray() | |
let yanks_array = [] | |
for yank in EasyClip#Yank#EasyClipGetAllYanks() | |
let line = yank.text | |
let line = substitute(line, '\V\n', '^M', 'g') | |
if len(line) > 40 | |
let line = line[: 40] . '…' | |
endif | |
call add(yanks_array, line) | |
endfor | |
return yanks_array | |
endfunction | |
function! EasyClipYankPum() | |
call complete(col('.'), YanksToArray()) | |
return '' | |
endfunc | |
" key binding | |
inoremap <Leader>cr <C-R>=EasyClipYankPum()<CR> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
moved to https://github.com/davidosomething/EasyClipRing.vim