danishprakash / vim-zen

Barebones Vim Plugin Manager
MIT License
63 stars 3 forks source link

Help tags #7

Closed SevereOverfl0w closed 6 years ago

SevereOverfl0w commented 6 years ago

While this library is trying to stay super light, it's a related problem to solve that help tags are needed for generation, I came up with this solution for myself:

func! ZenHelptags()
  let l:path = join(map(values(g:plugins), {key, value -> get(value, 'path')}), ",")
  let l:docs = globpath(l:path, 'doc', 0, v:true)

  echo l:docs
  for l:doc in l:docs
    silent! execute 'helptags' fnameescape(l:doc)
  endfor
endf

It uses the global plugins var in zen to generate the helptags automatically. I'm not sure what your personal feel is on how to solve this though.

arp242 commented 6 years ago

Note you can use :helptags ALL to generate all help tags.

SevereOverfl0w commented 6 years ago

I can't write to system directories, so that doesn't work for me.

On July 9, 2018 6:29:50 PM GMT+01:00, Martin Tournoij notifications@github.com wrote:

Note you can use :helptags ALL to generate all help tags.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/prakashdanish/vim-zen/issues/7#issuecomment-403557400

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

arp242 commented 6 years ago

It will just skip those:

:100verbose :helptags ALL
Searching for "doc" in "/home/martin/.vim,/home/martin/.vim/pack/plugins/start/xdg_open.vim,/home/martin/.vim/pack
/plugins/start/vim-yaml-helper,/home/martin/.vim/pack/plugins/start/vim-vimhelplint,/home/martin/.vim/pack/plugins
/start/vim-toml,/home/martin/.vim/pack/plugins/start/vim-qf,/home/martin/.vim/pack/plugins/start/vim-minisnip,/hom
e/martin/.vim/pack/plugins/start/vim-lookup,/home/martin/.vim/pack/plugins/start/vim-lion,/home/martin/.vim/pack/p
lugins/start/vim-go,/home/martin/.vim/pack/plugins/start/vim-dirvish,/home/martin/.vim/pack/plugins/start/vim-coff
ee-script,/home/martin/.vim/pack/plugins/start/vim-bookmarks,/home/martin/.vim/pack/plugins/start/unicode.vim,/hom
e/martin/.vim/pack/plugins/start/undofile_warn.vim,/home/martin/.vim/pack/plugins/start/softwrap.vim,/home/martin/
.vim/pack/plugins/start/scomplete.vim,/home/martin/.vim/pack/plugins/start/listnav.vim,/home/martin/.vim/pack/plug
ins/start/helplink.vim,/home/martin/.vim/pack/plugins/start/helpful.vim,/home/martin/.vim/pack/plugins/start/glo
Searching for "/home/martin/.vim/doc"
Searching for "/home/martin/.vim/pack/plugins/start/xdg_open.vim/doc"
Searching for "/home/martin/.vim/pack/plugins/start/vim-yaml-helper/doc"
Searching for "/home/martin/.vim/pack/plugins/start/vim-vimhelplint/doc"
Searching for "/home/martin/.vim/pack/plugins/start/vim-toml/doc"
Searching for "/home/martin/.vim/pack/plugins/start/vim-qf/doc"
Searching for "/home/martin/.vim/pack/plugins/start/vim-minisnip/doc"
Searching for "/home/martin/.vim/pack/plugins/start/vim-lookup/doc"
Searching for "/home/martin/.vim/pack/plugins/start/vim-lion/doc"
Searching for "/home/martin/.vim/pack/plugins/start/vim-go/doc"
Searching for "/home/martin/.vim/pack/plugins/start/vim-dirvish/doc"
Searching for "/home/martin/.vim/pack/plugins/start/vim-coffee-script/doc"
Searching for "/home/martin/.vim/pack/plugins/start/vim-bookmarks/doc"
Searching for "/home/martin/.vim/pack/plugins/start/unicode.vim/doc"
Searching for "/home/martin/.vim/pack/plugins/start/undofile_warn.vim/doc"
Searching for "/home/martin/.vim/pack/plugins/start/softwrap.vim/doc"
Searching for "/home/martin/.vim/pack/plugins/start/scomplete.vim/doc"
Searching for "/home/martin/.vim/pack/plugins/start/listnav.vim/doc"
Searching for "/home/martin/.vim/pack/plugins/start/helplink.vim/doc"
Searching for "/home/martin/.vim/pack/plugins/start/helpful.vim/doc"
Searching for "/home/martin/.vim/pack/plugins/start/globedit.vim/doc"
Searching for "/home/martin/.vim/pack/plugins/start/git.vim/doc"
Searching for "/home/martin/.vim/pack/plugins/start/default2.vim/doc"
Searching for "/home/martin/.vim/pack/plugins/start/auto_mkdir2.vim/doc"
Searching for "/home/martin/.vim/pack/plugins/start/ale/doc"
Searching for "/usr/share/vim/vimfiles/doc"
Searching for "/usr/share/vim/vim81/doc"
E152: Cannot open /usr/share/vim/vim81/doc/tags for writing
Searching for "/usr/share/vim/vimfiles/after/doc"
Searching for "/home/martin/.vim/after/doc"
Searching for "/home/martin/.vim/pack/plugins/start/vim-coffee-script/after/doc"
Searching for "/home/martin/.vim/pack/plugins/start/vim-qf/after/doc"

Notice how it continued after the E152.

danishprakash commented 6 years ago

:helptags ALL works fine for me, whether there should be an explicit call to this in zen somewhere or not, I don't know yet. But I'm not sure about defining a function to do it. However, @SevereOverfl0w does your implementation not throw permission error?

SevereOverfl0w commented 6 years ago

Right you are about ALL, that error is misleading.

@prakashdanish My implementation only loops over plugins managed by vim-zen, not all paths on the rtp.

danishprakash commented 6 years ago

Closing this, more inputs welcome.