Mercurial > vim
annotate runtime/ftplugin/man.vim @ 29236:0eef32b4ebbc
Update runtime files
Commit: https://github.com/vim/vim/commit/d799daa660b8821943cbe1682f00da9e812dd48c
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 20 11:17:32 2022 +0100
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 20 Jun 2022 12:30:06 +0200 |
parents | 9c221ad9634a |
children | f68f43043842 |
rev | line source |
---|---|
7 | 1 " Vim filetype plugin file |
2 " Language: man | |
20241 | 3 " Maintainer: Jason Franklin <vim@justemail.net> |
20317 | 4 " Maintainer: SungHyun Nam <goweol@gmail.com> |
29236 | 5 " Autoload Split: Bram Moolenaar |
6 " Last Change: 2022 Jun 18 | |
7 | 7 |
8 " To make the ":Man" command available before editing a manual page, source | |
9 " this script from your startup vimrc file. | |
10 | |
29236 | 11 " If 'filetype' isn't "man", we must have been called to define ":Man" and not |
12 " to do the filetype plugin stuff. | |
7 | 13 if &filetype == "man" |
14 | |
15 " Only do this when not done yet for this buffer | |
16 if exists("b:did_ftplugin") | |
17 finish | |
18 endif | |
19 let b:did_ftplugin = 1 | |
14421 | 20 endif |
7 | 21 |
14421 | 22 let s:cpo_save = &cpo |
23 set cpo-=C | |
24 | |
25 if &filetype == "man" | |
7 | 26 " allow dot and dash in manual page name. |
27 setlocal iskeyword+=\.,- | |
14421 | 28 let b:undo_ftplugin = "setlocal iskeyword<" |
7 | 29 |
30 " Add mappings, unless the user didn't want this. | |
31 if !exists("no_plugin_maps") && !exists("no_man_maps") | |
32 if !hasmapto('<Plug>ManBS') | |
33 nmap <buffer> <LocalLeader>h <Plug>ManBS | |
14421 | 34 let b:undo_ftplugin = b:undo_ftplugin |
35 \ . '|silent! nunmap <buffer> <LocalLeader>h' | |
7 | 36 endif |
816 | 37 nnoremap <buffer> <Plug>ManBS :%s/.\b//g<CR>:setl nomod<CR>'' |
7 | 38 |
29236 | 39 nnoremap <buffer> <silent> <c-]> :call dist#man#PreGetPage(v:count)<CR> |
40 nnoremap <buffer> <silent> <c-t> :call dist#man#PopPage()<CR> | |
7272
17333ebd2bbd
commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
41 nnoremap <buffer> <silent> q :q<CR> |
14421 | 42 |
43 " Add undo commands for the maps | |
44 let b:undo_ftplugin = b:undo_ftplugin | |
45 \ . '|silent! nunmap <buffer> <Plug>ManBS' | |
46 \ . '|silent! nunmap <buffer> <c-]>' | |
47 \ . '|silent! nunmap <buffer> <c-t>' | |
48 \ . '|silent! nunmap <buffer> q' | |
7272
17333ebd2bbd
commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
49 endif |
17333ebd2bbd
commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
50 |
17333ebd2bbd
commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
51 if exists('g:ft_man_folding_enable') && (g:ft_man_folding_enable == 1) |
17333ebd2bbd
commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
52 setlocal foldmethod=indent foldnestmax=1 foldenable |
14421 | 53 let b:undo_ftplugin = b:undo_ftplugin |
54 \ . '|silent! setl fdm< fdn< fen<' | |
7 | 55 endif |
56 | |
57 endif | |
58 | |
59 if exists(":Man") != 2 | |
29236 | 60 com -nargs=+ -complete=shellcmd Man call dist#man#GetPage(<q-mods>, <f-args>) |
61 nmap <Leader>K :call dist#man#PreGetPage(0)<CR> | |
62 nmap <Plug>ManPreGetPage :call dist#man#PreGetPage(0)<CR> | |
7 | 63 endif |
64 | |
14421 | 65 let &cpo = s:cpo_save |
66 unlet s:cpo_save | |
67 | |
9326
cd9c4bbe1d03
commit https://github.com/vim/vim/commit/ddf8d1c746ee081d15c9d7e0515f6ac43adbf363
Christian Brabandt <cb@256bit.org>
parents:
7992
diff
changeset
|
68 " vim: set sw=2 ts=8 noet: |