Mercurial > vim
comparison runtime/plugin/manpager.vim @ 25619:29ec2c198c8d
Update runtime files
Commit: https://github.com/vim/vim/commit/6aa57295cfbe8f21c15f0671e45fd53cf990d404
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 14 21:25:52 2021 +0200
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 14 Aug 2021 21:30:04 +0200 |
parents | 167a030448fa |
children | f3ec3c57e070 |
comparison
equal
deleted
inserted
replaced
25618:b5765575dc5a | 25619:29ec2c198c8d |
---|---|
1 " Vim plugin for using Vim as manpager. | 1 " Vim plugin for using Vim as manpager. |
2 " Maintainer: Enno Nagel <ennonagel+vim@gmail.com> | 2 " Maintainer: Enno Nagel <ennonagel+vim@gmail.com> |
3 " Last Change: 2018 Feb 04 | 3 " Last Change: 2020 Aug 05 |
4 | 4 |
5 command! -nargs=0 MANPAGER call s:ManPager() | delcommand MANPAGER | 5 command! -nargs=0 MANPAGER call s:ManPager() | delcommand MANPAGER |
6 | 6 |
7 function! s:ManPager() | 7 function! s:ManPager() |
8 set nocompatible | 8 set nocompatible |
14 setlocal ft=man | 14 setlocal ft=man |
15 runtime ftplugin/man.vim | 15 runtime ftplugin/man.vim |
16 setlocal buftype=nofile bufhidden=hide iskeyword+=: modifiable | 16 setlocal buftype=nofile bufhidden=hide iskeyword+=: modifiable |
17 | 17 |
18 " Emulate 'col -b' | 18 " Emulate 'col -b' |
19 silent keepj keepp %s/\v(.)\b\ze\1?//ge | 19 silent! keepj keepp %s/\v(.)\b\ze\1?//ge |
20 | |
21 " Remove ansi sequences | |
22 silent! keepj keepp %s/\v\e\[%(%(\d;)?\d{1,2})?[mK]//ge | |
20 | 23 |
21 " Remove empty lines above the header | 24 " Remove empty lines above the header |
22 call cursor(1, 1) | 25 call cursor(1, 1) |
23 let n = search(".*(.*)", "c") | 26 let n = search(".*(.*)", "c") |
24 if n > 1 | 27 if n > 1 |