Add Helptags command
If you use pathogen, you may notice that the name of the new command conflicts with the command of the same name from it, but you can still `call pathogen#helptags()`.
This commit is contained in:
parent
3a70b0b273
commit
8fbd617197
3 changed files with 20 additions and 0 deletions
|
@ -45,6 +45,7 @@ Commands
|
|||
| `History` | `v:oldfiles` and open buffers |
|
||||
| `Snippets` | Snippets ([UltiSnips][us]) |
|
||||
| `Commands` | User-defined commands |
|
||||
| `Helptags` | Help tags |
|
||||
|
||||
- Most commands support `CTRL-T` / `CTRL-X` / `CTRL-V` key
|
||||
bindings to open in a new tab, a new split, or in a new vertical split.
|
||||
|
|
|
@ -70,6 +70,7 @@ COMMANDS *fzf-vim-commands*
|
|||
`History` | `v:oldfiles` and open buffers
|
||||
`Snippets` | Snippets ({UltiSnips}{6})
|
||||
`Commands` | User-defined commands
|
||||
`Helptags` | Help tags
|
||||
-----------------+---------------------------------------------------------------------
|
||||
|
||||
- Most commands support CTRL-T / CTRL-X / CTRL-V key bindings to open in a new
|
||||
|
|
|
@ -472,6 +472,24 @@ endfunction
|
|||
|
||||
command! -bang Marks call s:marks(<bang>0)
|
||||
|
||||
" ------------------------------------------------------------------
|
||||
" Help tags
|
||||
" ------------------------------------------------------------------
|
||||
function! s:helptag_sink(line)
|
||||
execute 'help' split(a:line)[0]
|
||||
endfunction
|
||||
|
||||
function! s:helptags(bang)
|
||||
let tags = split(globpath(&runtimepath, '**/doc/tags'), '\n')
|
||||
|
||||
call s:fzf({
|
||||
\ 'source': 'cat '.join(map(tags, 'shellescape(v:val)'))."| sort | awk '{printf \"%-40s%s\\n\", $1, $2}'",
|
||||
\ 'sink': function('s:helptag_sink'),
|
||||
\ 'options': '+m --tiebreak=begin'}, a:bang)
|
||||
endfunction
|
||||
|
||||
command! -bang Helptags call s:helptags(<bang>0)
|
||||
|
||||
" ----------------------------------------------------------------------------
|
||||
" Completion helper
|
||||
" ----------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Reference in a new issue