Add unmanaged plugins for convenience
This commit is contained in:
105
unmanaged-vim-plug/fontzoom/doc/fontzoom.txt
Executable file
105
unmanaged-vim-plug/fontzoom/doc/fontzoom.txt
Executable file
@@ -0,0 +1,105 @@
|
||||
*fontzoom.txt* The fontsize controller in gVim.
|
||||
|
||||
Version: 0.1.1
|
||||
Modified: thinca <thinca+vim@gmail.com>
|
||||
License: Creative Commons Attribution 2.1 Japan License
|
||||
<http://creativecommons.org/licenses/by/2.1/jp/deed.en>
|
||||
|
||||
==============================================================================
|
||||
CONTENTS *fontzoom-contents*
|
||||
|
||||
INTRODUCTION |fontzoom-introduction|
|
||||
INTERFACE |fontzoom-interface|
|
||||
KEY MAPPINGS |fontzoom-key-mappings|
|
||||
COMMANDS |fontzoom-commands|
|
||||
SETTINGS |fontzoom-settings|
|
||||
LIMITATION |fontzoom-limitation|
|
||||
CHANGELOG |fontzoom-changelog|
|
||||
|
||||
|
||||
==============================================================================
|
||||
INTRODUCTION *fontzoom-introduction*
|
||||
|
||||
*fontzoom* is a Vim plugin to control gui fontsize. You can change fontsize
|
||||
with + and - keys(when default setting). You can also use the [count].
|
||||
This plugin remember 'guifont', 'lines', and 'columns' when you change
|
||||
fontsize first. And tries to keep the size of the window as much as possible.
|
||||
|
||||
|
||||
|
||||
==============================================================================
|
||||
INTERFACE *fontzoom-interface*
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
KEY MAPPINGS *fontzoom-key-mappings*
|
||||
|
||||
<Plug>(fontzoom-learger) *<Plug>(fontzoom-learger)*
|
||||
Fontsize is made large [count] point.
|
||||
|
||||
<Plug>(fontzoom-smaller) *<Plug>(fontzoom-smaller)*
|
||||
Fontsize is made small [count] point.
|
||||
|
||||
|
||||
*g:fontzoom_no_default_key_mappings*
|
||||
The following key mappings will be also available unless
|
||||
g:fontzoom_no_default_key_mappings is defined:
|
||||
|
||||
{lhs} {rhs}
|
||||
-------- -----------------------------
|
||||
+ <Plug>(fontzoom-larger)
|
||||
- <Plug>(fontzoom-smaller)
|
||||
<C-ScrollWheelUp> <Plug>(fontzoom-larger)
|
||||
<C-ScrollWheelDown> <Plug>(fontzoom-smaller)
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
COMMANDS *fontzoom-commands*
|
||||
|
||||
:Fontzoom *:Fontzoom*
|
||||
Show fontsize in current.
|
||||
|
||||
:Fontzoom +[N]
|
||||
Fontsize is made large [N] point.
|
||||
|
||||
:Fontzoom -[N]
|
||||
Fontsize is made small [N] point.
|
||||
|
||||
:Fontzoom [N]
|
||||
Fontsize is changed into [N] points.
|
||||
|
||||
:Fontzoom!
|
||||
Fontsize is changed into initial size. All arguments
|
||||
are ignored.
|
||||
|
||||
|
||||
|
||||
==============================================================================
|
||||
SETTINGS *fontzoom-settings*
|
||||
|
||||
g:fontzoom_pattern *g:fontzoom_pattern*
|
||||
Pick out the Fontsize from font name. The pattern
|
||||
must match to the Fontsize. |/\zs| and |/\ze| are
|
||||
convenient.
|
||||
|
||||
|
||||
|
||||
==============================================================================
|
||||
LIMITATION *fontzoom-limitation*
|
||||
|
||||
- 'guifont' should contain fontsize that matches to |g:fontzoom_pattern|.
|
||||
|
||||
|
||||
|
||||
==============================================================================
|
||||
CHANGELOG *fontzoom-changelog*
|
||||
|
||||
0.1.1 2011-02-24
|
||||
- Added default key mappings.
|
||||
- <C-ScrollWheelUp> and <C-ScrollWheelDown>.
|
||||
|
||||
0.1.0 2009-12-25
|
||||
- Initial version.
|
||||
|
||||
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl
|
||||
15
unmanaged-vim-plug/fontzoom/doc/tags
Normal file
15
unmanaged-vim-plug/fontzoom/doc/tags
Normal file
@@ -0,0 +1,15 @@
|
||||
:Fontzoom fontzoom.txt /*:Fontzoom*
|
||||
<Plug>(fontzoom-learger) fontzoom.txt /*<Plug>(fontzoom-learger)*
|
||||
<Plug>(fontzoom-smaller) fontzoom.txt /*<Plug>(fontzoom-smaller)*
|
||||
fontzoom fontzoom.txt /*fontzoom*
|
||||
fontzoom-changelog fontzoom.txt /*fontzoom-changelog*
|
||||
fontzoom-commands fontzoom.txt /*fontzoom-commands*
|
||||
fontzoom-contents fontzoom.txt /*fontzoom-contents*
|
||||
fontzoom-interface fontzoom.txt /*fontzoom-interface*
|
||||
fontzoom-introduction fontzoom.txt /*fontzoom-introduction*
|
||||
fontzoom-key-mappings fontzoom.txt /*fontzoom-key-mappings*
|
||||
fontzoom-limitation fontzoom.txt /*fontzoom-limitation*
|
||||
fontzoom-settings fontzoom.txt /*fontzoom-settings*
|
||||
fontzoom.txt fontzoom.txt /*fontzoom.txt*
|
||||
g:fontzoom_no_default_key_mappings fontzoom.txt /*g:fontzoom_no_default_key_mappings*
|
||||
g:fontzoom_pattern fontzoom.txt /*g:fontzoom_pattern*
|
||||
75
unmanaged-vim-plug/fontzoom/plugin/fontzoom.vim
Executable file
75
unmanaged-vim-plug/fontzoom/plugin/fontzoom.vim
Executable file
@@ -0,0 +1,75 @@
|
||||
" The fontsize controller in gVim.
|
||||
" Version: 0.1.1
|
||||
" Author : thinca <thinca+vim@gmail.com>
|
||||
" License: Creative Commons Attribution 2.1 Japan License
|
||||
" <http://creativecommons.org/licenses/by/2.1/jp/deed.en>
|
||||
|
||||
if exists('g:loaded_fontzoom') || !has('gui_running')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_fontzoom = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
function! s:fontzoom(size, reset)
|
||||
if a:reset
|
||||
if exists('s:keep') " Reset font size.
|
||||
let [&guifont, &lines, &columns] = s:keep
|
||||
unlet! s:keep
|
||||
endif
|
||||
elseif a:size == ''
|
||||
echo matchstr(&guifont, g:fontzoom_pattern)
|
||||
else
|
||||
let size = (a:size =~ '^[+-]' ? 'submatch(0)' : '') . a:size
|
||||
if !exists('s:keep')
|
||||
let s:keep = [&guifont, &lines, &columns]
|
||||
endif
|
||||
let &guifont = join(map(split(&guifont, '\\\@<!,'),
|
||||
\ printf('substitute(v:val, %s, %s, "g")',
|
||||
\ string(g:fontzoom_pattern),
|
||||
\ string('\=max([1,' . size . '])'))), ',')
|
||||
" Keep window size if possible.
|
||||
let [&lines, &columns] = s:keep[1:]
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
|
||||
if !exists('g:fontzoom_pattern')
|
||||
" TODO: X11 is not tested because I do not have the environment.
|
||||
let g:fontzoom_pattern =
|
||||
\ has('win32') || has('win64') ||
|
||||
\ has('mac') || has('macunix') ? ':h\zs\d\+':
|
||||
\ has('gui_gtk') ? '\s\+\zs\d\+$':
|
||||
\ has('X11') ? '\v%([^-]*-){6}\zs\d+\ze%(-[^-]*){7}':
|
||||
\ '*Unknown system*'
|
||||
endif
|
||||
|
||||
|
||||
" Commands.
|
||||
command! -narg=? -bang -bar Fontzoom call s:fontzoom(<q-args>, <bang>0)
|
||||
|
||||
" Key mappings.
|
||||
nnoremap <silent> <Plug>(fontzoom-larger)
|
||||
\ :<C-u>Fontzoom +<C-r>=v:count1<CR><CR>
|
||||
nnoremap <silent> <Plug>(fontzoom-smaller)
|
||||
\ :<C-u>Fontzoom -<C-r>=v:count1<CR><CR>
|
||||
inoremap <silent> <Plug>(fontzoom-larger)
|
||||
\ <C-O>:<C-u>Fontzoom +<C-r>=v:count1<CR><CR>
|
||||
inoremap <silent> <Plug>(fontzoom-smaller)
|
||||
\ <C-O>:<C-u>Fontzoom -<C-r>=v:count1<CR><CR>
|
||||
|
||||
if !exists('g:fontzoom_no_default_key_mappings')
|
||||
\ || !g:fontzoom_no_default_key_mappings
|
||||
silent! nmap <unique> <silent> + <Plug>(fontzoom-larger)
|
||||
silent! nmap <unique> <silent> - <Plug>(fontzoom-smaller)
|
||||
silent! nmap <unique> <silent> <C-ScrollWheelUp> <Plug>(fontzoom-larger)
|
||||
silent! nmap <unique> <silent> <C-ScrollWheelDown> <Plug>(fontzoom-smaller)
|
||||
silent! imap <unique> <silent> <C-ScrollWheelUp> <Plug>(fontzoom-larger)
|
||||
silent! imap <unique> <silent> <C-ScrollWheelDown> <Plug>(fontzoom-smaller)
|
||||
endif
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
Reference in New Issue
Block a user