help.vim (1403B)
1 " Vim filetype plugin file 2 " Language: Vim help file 3 " Previous Maintainer: Nikolai Weibull <now@bitwi.se> 4 " Last Change: 2025 Apr 08 5 " 2025 Apr 08 by Vim project (set 'omnifunc' and 'iskeyword', #17073) 6 " 2025 Aug 08 by Vim project (unset comment options, #17889) 7 " 2026 Apr 26 by Vim project (make HelpComplete global, #20024) 8 9 if exists("b:did_ftplugin") 10 finish 11 endif 12 let b:did_ftplugin = 1 13 14 let s:cpo_save = &cpo 15 set cpo&vim 16 17 let b:undo_ftplugin = "setl isk< fo< tw< cole< cocu< keywordprg< omnifunc< comments< cms<" 18 19 setl comments= cms= 20 21 setlocal formatoptions+=tcroql textwidth=78 keywordprg=:help omnifunc=HelpComplete 22 let &l:iskeyword='!-~,^*,^|,^",192-255' 23 if has("conceal") 24 setlocal cole=2 cocu=nc 25 endif 26 27 if !exists('*HelpComplete') 28 func HelpComplete(findstart, base) 29 if a:findstart 30 let colnr = col('.') - 1 " Get the column number before the cursor 31 let line = getline('.') 32 for i in range(colnr - 1, 0, -1) 33 if line[i] ==# '|' 34 return i + 1 " Don't include the `|` in base 35 elseif line[i] ==# "'" 36 return i " Include the `'` in base 37 endif 38 endfor 39 else 40 return taglist('^' .. a:base) 41 \ ->map({_, item -> #{word: item->get('name'), kind: item->get('kind')}}) 42 \ ->extend(getcompletion(a:base, 'help')) 43 endif 44 endfunc 45 endif 46 47 let &cpo = s:cpo_save 48 unlet s:cpo_save