annotate runtime/ftplugin/man.vim @ 35348:1f56105832f2

runtime(man): disable the q mapping Commit: https://github.com/vim/vim/commit/6dcd7f1a4d6d216798963edce9de69d03092433f Author: Christian Brabandt <cb@256bit.org> Date: Thu Jun 6 19:06:38 2024 +0200 runtime(man): disable the q mapping fixes: https://github.com/vim/vim/issues/8210 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 06 Jun 2024 19:30:03 +0200
parents b2e8663e6dcc
children c018d4afc61f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim filetype plugin file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: man
20241
56265f711890 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20025
diff changeset
3 " Maintainer: Jason Franklin <vim@justemail.net>
20317
2334bf788e8a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20241
diff changeset
4 " Maintainer: SungHyun Nam <goweol@gmail.com>
29236
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25880
diff changeset
5 " Autoload Split: Bram Moolenaar
35348
1f56105832f2 runtime(man): disable the q mapping
Christian Brabandt <cb@256bit.org>
parents: 32294
diff changeset
6 " Last Change: 2024 Jun 06 (disabled the q mapping, #8210)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " To make the ":Man" command available before editing a manual page, source
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " this script from your startup vimrc file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
29236
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25880
diff changeset
11 " If 'filetype' isn't "man", we must have been called to define ":Man" and not
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25880
diff changeset
12 " to do the filetype plugin stuff.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 if &filetype == "man"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " Only do this when not done yet for this buffer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 if exists("b:did_ftplugin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 let b:did_ftplugin = 1
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
20 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
22 let s:cpo_save = &cpo
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
23 set cpo-=C
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
24
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
25 if &filetype == "man"
30634
f68f43043842 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 29236
diff changeset
26 " Allow hyphen, plus, colon, dot, and commercial at in manual page name.
32294
b2e8663e6dcc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30634
diff changeset
27 " Parentheses are not here but in dist#man#PreGetPage()
b2e8663e6dcc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 30634
diff changeset
28 setlocal iskeyword=48-57,_,a-z,A-Z,-,+,:,.,@-@
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
29 let b:undo_ftplugin = "setlocal iskeyword<"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " Add mappings, unless the user didn't want this.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 if !exists("no_plugin_maps") && !exists("no_man_maps")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 if !hasmapto('<Plug>ManBS')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 nmap <buffer> <LocalLeader>h <Plug>ManBS
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
35 let b:undo_ftplugin = b:undo_ftplugin
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
36 \ . '|silent! nunmap <buffer> <LocalLeader>h'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 endif
816
4a79d6d376f0 updated for version 7.0c02
vimboss
parents: 7
diff changeset
38 nnoremap <buffer> <Plug>ManBS :%s/.\b//g<CR>:setl nomod<CR>''
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
29236
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25880
diff changeset
40 nnoremap <buffer> <silent> <c-]> :call dist#man#PreGetPage(v:count)<CR>
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25880
diff changeset
41 nnoremap <buffer> <silent> <c-t> :call dist#man#PopPage()<CR>
35348
1f56105832f2 runtime(man): disable the q mapping
Christian Brabandt <cb@256bit.org>
parents: 32294
diff changeset
42 " Disabled, since this hides the ability to record a macro or use the
1f56105832f2 runtime(man): disable the q mapping
Christian Brabandt <cb@256bit.org>
parents: 32294
diff changeset
43 " command line window
1f56105832f2 runtime(man): disable the q mapping
Christian Brabandt <cb@256bit.org>
parents: 32294
diff changeset
44 " nnoremap <buffer> <silent> q :q<CR>
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
45
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
46 " Add undo commands for the maps
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
47 let b:undo_ftplugin = b:undo_ftplugin
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
48 \ . '|silent! nunmap <buffer> <Plug>ManBS'
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
49 \ . '|silent! nunmap <buffer> <c-]>'
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
50 \ . '|silent! nunmap <buffer> <c-t>'
35348
1f56105832f2 runtime(man): disable the q mapping
Christian Brabandt <cb@256bit.org>
parents: 32294
diff changeset
51 "\ . '|silent! nunmap <buffer> q'
7272
17333ebd2bbd commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents: 6476
diff changeset
52 endif
17333ebd2bbd commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents: 6476
diff changeset
53
17333ebd2bbd commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents: 6476
diff changeset
54 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
55 setlocal foldmethod=indent foldnestmax=1 foldenable
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
56 let b:undo_ftplugin = b:undo_ftplugin
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
57 \ . '|silent! setl fdm< fdn< fen<'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 if exists(":Man") != 2
29236
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25880
diff changeset
63 com -nargs=+ -complete=shellcmd Man call dist#man#GetPage(<q-mods>, <f-args>)
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25880
diff changeset
64 nmap <Leader>K :call dist#man#PreGetPage(0)<CR>
0eef32b4ebbc Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25880
diff changeset
65 nmap <Plug>ManPreGetPage :call dist#man#PreGetPage(0)<CR>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
68 let &cpo = s:cpo_save
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
69 unlet s:cpo_save
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13857
diff changeset
70
9326
cd9c4bbe1d03 commit https://github.com/vim/vim/commit/ddf8d1c746ee081d15c9d7e0515f6ac43adbf363
Christian Brabandt <cb@256bit.org>
parents: 7992
diff changeset
71 " vim: set sw=2 ts=8 noet: