Mercurial > vim
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 |
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 |
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 | 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" | |
30634 | 26 " Allow hyphen, plus, colon, dot, and commercial at in manual page name. |
32294 | 27 " Parentheses are not here but in dist#man#PreGetPage() |
28 setlocal iskeyword=48-57,_,a-z,A-Z,-,+,:,.,@-@ | |
14421 | 29 let b:undo_ftplugin = "setlocal iskeyword<" |
7 | 30 |
31 " Add mappings, unless the user didn't want this. | |
32 if !exists("no_plugin_maps") && !exists("no_man_maps") | |
33 if !hasmapto('<Plug>ManBS') | |
34 nmap <buffer> <LocalLeader>h <Plug>ManBS | |
14421 | 35 let b:undo_ftplugin = b:undo_ftplugin |
36 \ . '|silent! nunmap <buffer> <LocalLeader>h' | |
7 | 37 endif |
816 | 38 nnoremap <buffer> <Plug>ManBS :%s/.\b//g<CR>:setl nomod<CR>'' |
7 | 39 |
29236 | 40 nnoremap <buffer> <silent> <c-]> :call dist#man#PreGetPage(v:count)<CR> |
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 | 45 |
46 " Add undo commands for the maps | |
47 let b:undo_ftplugin = b:undo_ftplugin | |
48 \ . '|silent! nunmap <buffer> <Plug>ManBS' | |
49 \ . '|silent! nunmap <buffer> <c-]>' | |
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 | 56 let b:undo_ftplugin = b:undo_ftplugin |
57 \ . '|silent! setl fdm< fdn< fen<' | |
7 | 58 endif |
59 | |
60 endif | |
61 | |
62 if exists(":Man") != 2 | |
29236 | 63 com -nargs=+ -complete=shellcmd Man call dist#man#GetPage(<q-mods>, <f-args>) |
64 nmap <Leader>K :call dist#man#PreGetPage(0)<CR> | |
65 nmap <Plug>ManPreGetPage :call dist#man#PreGetPage(0)<CR> | |
7 | 66 endif |
67 | |
14421 | 68 let &cpo = s:cpo_save |
69 unlet s:cpo_save | |
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: |