blob: 0109c1752cc106132c6edde3ae636fa515e092b8 [file] [log] [blame]
Bram Moolenaar42eeac32005-06-29 22:40:58 +00001" Vim filetype plugin file
Bram Moolenaar214641f2017-03-05 17:04:09 +01002" Language: Vim help file
3" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
Phạm Bình An0b540c62025-04-08 20:40:12 +02004" Last Change: 2025 Apr 08
5" 2025 Apr 08 by Vim project (set 'omnifunc' and 'iskeyword', #17073)
Bram Moolenaar42eeac32005-06-29 22:40:58 +00006
7if exists("b:did_ftplugin")
8 finish
9endif
10let b:did_ftplugin = 1
11
Bram Moolenaare37d50a2008-08-06 17:06:04 +000012let s:cpo_save = &cpo
13set cpo&vim
14
Phạm Bình An0b540c62025-04-08 20:40:12 +020015let b:undo_ftplugin = "setl isk< fo< tw< cole< cocu< keywordprg< omnifunc<"
Bram Moolenaar42eeac32005-06-29 22:40:58 +000016
Phạm Bình An0b540c62025-04-08 20:40:12 +020017setlocal formatoptions+=tcroql textwidth=78 keywordprg=:help omnifunc=s:HelpComplete
18let &l:iskeyword='!-~,^*,^|,^",192-255'
Bram Moolenaar97293012011-07-18 19:40:27 +020019if has("conceal")
20 setlocal cole=2 cocu=nc
21endif
Bram Moolenaare37d50a2008-08-06 17:06:04 +000022
Phạm Bình An0b540c62025-04-08 20:40:12 +020023if !exists('*s:HelpComplete')
24 func s:HelpComplete(findstart, base)
25 if a:findstart
26 let colnr = col('.') - 1 " Get the column number before the cursor
27 let line = getline('.')
28 for i in range(colnr - 1, 0, -1)
29 if line[i] ==# '|'
30 return i + 1 " Don't include the `|` in base
31 elseif line[i] ==# "'"
32 return i " Include the `'` in base
33 endif
34 endfor
35 else
36 return taglist('^' .. a:base)
37 \ ->map({_, item -> #{word: item->get('name'), kind: item->get('kind')}})
38 \ ->extend(getcompletion(a:base, 'help'))
39 endif
40 endfunc
41endif
42
Bram Moolenaare37d50a2008-08-06 17:06:04 +000043let &cpo = s:cpo_save
44unlet s:cpo_save