Mercurial > vim
annotate runtime/plugin/manpager.vim @ 27946:5147f3d3ed30 v8.2.4498
patch 8.2.4498: using <Plug> with "noremap" does not work
Commit: https://github.com/vim/vim/commit/1fc34225acbee5ddca2b9ec3f82b3014d385b7f8
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 3 13:56:24 2022 +0000
patch 8.2.4498: using <Plug> with "noremap" does not work
Problem: Using <Plug> with "noremap" does not work.
Solution: Always remap <Plug>. (closes https://github.com/vim/vim/issues/9879, closes https://github.com/vim/vim/issues/9789)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 03 Mar 2022 15:00:03 +0100 |
parents | 29ec2c198c8d |
children | f3ec3c57e070 |
rev | line source |
---|---|
9037
d07035f84f0d
commit https://github.com/vim/vim/commit/b20545f2a718d4f19c3f609fd11c0ca4eff450ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Vim plugin for using Vim as manpager. |
d07035f84f0d
commit https://github.com/vim/vim/commit/b20545f2a718d4f19c3f609fd11c0ca4eff450ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 " Maintainer: Enno Nagel <ennonagel+vim@gmail.com> |
25619 | 3 " Last Change: 2020 Aug 05 |
9037
d07035f84f0d
commit https://github.com/vim/vim/commit/b20545f2a718d4f19c3f609fd11c0ca4eff450ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 |
13231 | 5 command! -nargs=0 MANPAGER call s:ManPager() | delcommand MANPAGER |
9037
d07035f84f0d
commit https://github.com/vim/vim/commit/b20545f2a718d4f19c3f609fd11c0ca4eff450ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 |
13231 | 7 function! s:ManPager() |
8 set nocompatible | |
9 if exists('+viminfofile') | |
10 set viminfofile=NONE | |
11 endif | |
12 set noswapfile | |
9037
d07035f84f0d
commit https://github.com/vim/vim/commit/b20545f2a718d4f19c3f609fd11c0ca4eff450ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 |
13231 | 14 setlocal ft=man |
15 runtime ftplugin/man.vim | |
16 setlocal buftype=nofile bufhidden=hide iskeyword+=: modifiable | |
17 | |
18 " Emulate 'col -b' | |
25619 | 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 | |
9037
d07035f84f0d
commit https://github.com/vim/vim/commit/b20545f2a718d4f19c3f609fd11c0ca4eff450ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 |
13231 | 24 " Remove empty lines above the header |
25 call cursor(1, 1) | |
26 let n = search(".*(.*)", "c") | |
27 if n > 1 | |
28 exe "1," . n-1 . "d" | |
29 endif | |
30 setlocal nomodified readonly | |
9037
d07035f84f0d
commit https://github.com/vim/vim/commit/b20545f2a718d4f19c3f609fd11c0ca4eff450ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 |
13231 | 32 syntax on |
9037
d07035f84f0d
commit https://github.com/vim/vim/commit/b20545f2a718d4f19c3f609fd11c0ca4eff450ce
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 endfunction |