neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

help.vim (1345B)


      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 
      8 if exists("b:did_ftplugin")
      9  finish
     10 endif
     11 let b:did_ftplugin = 1
     12 
     13 let s:cpo_save = &cpo
     14 set cpo&vim
     15 
     16 let b:undo_ftplugin = "setl isk< fo< tw< cole< cocu< keywordprg< omnifunc< comments< cms<"
     17 
     18 setl comments= cms=
     19 
     20 setlocal formatoptions+=tcroql textwidth=78 keywordprg=:help omnifunc=s:HelpComplete
     21 let &l:iskeyword='!-~,^*,^|,^",192-255'
     22 if has("conceal")
     23  setlocal cole=2 cocu=nc
     24 endif
     25 
     26 if !exists('*s:HelpComplete')
     27  func s:HelpComplete(findstart, base)
     28    if a:findstart
     29      let colnr = col('.') - 1 " Get the column number before the cursor
     30      let line = getline('.')
     31      for i in range(colnr - 1, 0, -1)
     32        if line[i] ==# '|'
     33          return i + 1 " Don't include the `|` in base
     34        elseif line[i] ==# "'"
     35          return i " Include the `'` in base
     36        endif
     37      endfor
     38    else
     39      return taglist('^' .. a:base)
     40            \ ->map({_, item -> #{word: item->get('name'), kind: item->get('kind')}})
     41            \ ->extend(getcompletion(a:base, 'help'))
     42    endif
     43  endfunc
     44 endif
     45 
     46 let &cpo = s:cpo_save
     47 unlet s:cpo_save