Mercurial > vim
annotate runtime/ftplugin/man.vim @ 33424:14cf0b014b99 v9.0.1970
patch 9.0.1970: win32: high-dpi support can be improved
Commit: https://github.com/vim/vim/commit/7086b3e76a81cf87592077d54e0ef46a60006c2c
Author: Ken Takata <kentkt@csc.jp>
Date: Mon Oct 2 21:26:03 2023 +0200
patch 9.0.1970: win32: high-dpi support can be improved
Problem: win32: high-dpi support can be improved
Solution: implement WM_GETDPISCALEDSIZE
win32: Better support of Per-Monitor V2 High DPI
Implement WM_GETDPISCALEDSIZE.
It is not so easy to calculate the new size without actually changing
the size. So, this returns an approximate size.
This doesn't work well when a bitmap font (e.g. FixedSys) is selected,
but I think this is acceptable.
closes: #11812
closes: #13252
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 02 Oct 2023 21:30:05 +0200 |
parents | b2e8663e6dcc |
children | 1f56105832f2 |
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 |
32294 | 6 " Last Change: 2023 Mar 21 |
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> | |
7272
17333ebd2bbd
commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
42 nnoremap <buffer> <silent> q :q<CR> |
14421 | 43 |
44 " Add undo commands for the maps | |
45 let b:undo_ftplugin = b:undo_ftplugin | |
46 \ . '|silent! nunmap <buffer> <Plug>ManBS' | |
47 \ . '|silent! nunmap <buffer> <c-]>' | |
48 \ . '|silent! nunmap <buffer> <c-t>' | |
49 \ . '|silent! nunmap <buffer> q' | |
7272
17333ebd2bbd
commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
50 endif |
17333ebd2bbd
commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
51 |
17333ebd2bbd
commit https://github.com/vim/vim/commit/d042dc825c9b97dacd84d4728f88300da4d5b6b9
Christian Brabandt <cb@256bit.org>
parents:
6476
diff
changeset
|
52 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
|
53 setlocal foldmethod=indent foldnestmax=1 foldenable |
14421 | 54 let b:undo_ftplugin = b:undo_ftplugin |
55 \ . '|silent! setl fdm< fdn< fen<' | |
7 | 56 endif |
57 | |
58 endif | |
59 | |
60 if exists(":Man") != 2 | |
29236 | 61 com -nargs=+ -complete=shellcmd Man call dist#man#GetPage(<q-mods>, <f-args>) |
62 nmap <Leader>K :call dist#man#PreGetPage(0)<CR> | |
63 nmap <Plug>ManPreGetPage :call dist#man#PreGetPage(0)<CR> | |
7 | 64 endif |
65 | |
14421 | 66 let &cpo = s:cpo_save |
67 unlet s:cpo_save | |
68 | |
9326
cd9c4bbe1d03
commit https://github.com/vim/vim/commit/ddf8d1c746ee081d15c9d7e0515f6ac43adbf363
Christian Brabandt <cb@256bit.org>
parents:
7992
diff
changeset
|
69 " vim: set sw=2 ts=8 noet: |