mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 20:08:17 +00:00

Problem: "set filetype=man" assumes the user wants :Man features, this does extra stuff like renaming the buffer as "man://". Solution: - old entrypoint was ":set filetype=man", but this is too presumptuous #15487 - make the entrypoints more explicit: 1. when the ":Man" command is run 2. when a "man://" buffer is opened - remove the tricky b:man_sect checks in ftplugin/man.vim and syntax/man.vim - MANPAGER is supported via ":Man!", as documented. fixes #15487
16 lines
427 B
VimL
16 lines
427 B
VimL
" Maintainer: Anmol Sethi <hi@nhooyr.io>
|
|
|
|
if exists('g:loaded_man')
|
|
finish
|
|
endif
|
|
let g:loaded_man = 1
|
|
|
|
command! -bang -bar -range=-1 -complete=customlist,man#complete -nargs=* Man
|
|
\ if <bang>0 | call man#init_pager() |
|
|
\ else | call man#open_page(<count>, <q-mods>, <f-args>) | endif
|
|
|
|
augroup man
|
|
autocmd!
|
|
autocmd BufReadCmd man://* call man#read_page(matchstr(expand('<amatch>'), 'man://\zs.*'))
|
|
augroup END
|