fzf.vim icon indicating copy to clipboard operation
fzf.vim copied to clipboard

Feature Request: Add command for searching available man pages

Open AlxHnr opened this issue 2 years ago • 1 comments

  • [ ] I have fzf 0.30.0 or above
  • [X] I have read through https://github.com/junegunn/fzf.vim/blob/master/README.md
  • [X] I have read through https://github.com/junegunn/fzf/blob/master/README-VIM.md
  • [X] I have read through the manual page of fzf (man fzf)
  • [X] I have searched through the existing issues

It would be great to provide a default command for searching available man-pages. This would complement commands like :Helptags and fits well into commands with external dependencies like :Locate, :Rg and :Commits.

AlxHnr avatar Apr 30 '22 08:04 AlxHnr

I went looking for something similar, and turned up this issue. For future travelers, this worked well for my purposes:

command! -bang -nargs=? Apropos
    \ call fzf#vim#grep('man --apropos '.fzf#shellescape(<q-args>), {
    \   'sink': {line -> execute('Man '. join(split(line, ' ')[:1],''))},
    \   'options': ['--preview', 'echo {1} | awk "{print \$1\$2}" | xargs man']
    \ }, <bang>0)

which is roughly equivalent to the command:

man -k $WORD | fzf --preview='man {1}{2}' | awk '{print $1$2}' | xargs man

kattrali avatar Oct 01 '23 10:10 kattrali