File: help.vim

package info (click to toggle)
vim 2%3A9.1.1882-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 92,504 kB
  • sloc: ansic: 432,444; cpp: 6,371; makefile: 4,596; sh: 2,387; java: 2,312; xml: 2,099; python: 1,559; perl: 1,419; awk: 730; lisp: 501; cs: 458; objc: 369; sed: 8; csh: 6
file content (47 lines) | stat: -rw-r--r-- 1,345 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
" Vim filetype plugin file
" Language:             Vim help file
" Previous Maintainer:  Nikolai Weibull <now@bitwi.se>
" Last Change:          2025 Apr 08
" 2025 Apr 08 by Vim project (set 'omnifunc' and 'iskeyword', #17073)
" 2025 Aug 08 by Vim project (unset comment options, #17889)

if exists("b:did_ftplugin")
  finish
endif
let b:did_ftplugin = 1

let s:cpo_save = &cpo
set cpo&vim

let b:undo_ftplugin = "setl isk< fo< tw< cole< cocu< keywordprg< omnifunc< comments< cms<"

setl comments= cms=

setlocal formatoptions+=tcroql textwidth=78 keywordprg=:help omnifunc=s:HelpComplete
let &l:iskeyword='!-~,^*,^|,^",192-255'
if has("conceal")
  setlocal cole=2 cocu=nc
endif

if !exists('*s:HelpComplete')
  func s:HelpComplete(findstart, base)
    if a:findstart
      let colnr = col('.') - 1 " Get the column number before the cursor
      let line = getline('.')
      for i in range(colnr - 1, 0, -1)
        if line[i] ==# '|'
          return i + 1 " Don't include the `|` in base
        elseif line[i] ==# "'"
          return i " Include the `'` in base
        endif
      endfor
    else
      return taglist('^' .. a:base)
            \ ->map({_, item -> #{word: item->get('name'), kind: item->get('kind')}})
            \ ->extend(getcompletion(a:base, 'help'))
    endif
  endfunc
endif

let &cpo = s:cpo_save
unlet s:cpo_save