noahp / emoji-fzf

🕵emoji picker that pairs nicely with fzf --preview
39 stars 5 forks source link

vim / nvim plugin #13

Open pschmitt opened 4 years ago

pschmitt commented 4 years ago

Hey I managed to get emoji-fzf working in vim and I wanted to share my quick and dirty setup. If I find the time & motivation I'll implement a propper vim plugin.

The following binds Ctrl-K to open emoji-fzf to complete the current word (it will replace it with the emoji).

Example workflow:

Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'

" emoji-fzf
inoremap <expr> <c-k> fzf#vim#complete(fzf#wrap({
  \ 'source':  'emoji-fzf preview --prepend',
  \ 'options': '--header "Emoji Selection" --no-hscroll',
  \ 'reducer': { lines -> split(lines[0])[0] } }))
pschmitt commented 4 years ago

Aha. I just noticed you did something similar @noahp while going through the readme.

noahp commented 4 years ago

Nice, I like your approach!