robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqMerge pull request #39435 from zeertzjq/vim-0ca1121f69aadd2b4

master
1.4 KiB48 linesraw
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
9if exists("b:did_ftplugin")
10  finish
11endif
12let b:did_ftplugin = 1
13
14let s:cpo_save = &cpo
15set cpo&vim
16
17let b:undo_ftplugin = "setl isk< fo< tw< cole< cocu< keywordprg< omnifunc< comments< cms<"
18
19setl comments= cms=
20
21setlocal formatoptions+=tcroql textwidth=78 keywordprg=:help! omnifunc=HelpComplete
22let &l:iskeyword='!-~,^*,^|,^",192-255'
23if has("conceal")
24  setlocal cole=2 cocu=nc
25endif
26
27if !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
45endif
46
47let &cpo = s:cpo_save
48unlet s:cpo_save