1
0
mirror of https://github.com/gryf/.vim.git synced 2025-12-17 11:30:29 +01:00

Jellybeans colorscheme update, added repeat and zoom plugins, changed

vcscommand to support switching VCS on fly, changed python snippets (edbg)
added fitnesse wiki syntax.
This commit is contained in:
2011-04-16 06:53:59 +02:00
parent 056f63a34a
commit f205f3b36d
7 changed files with 317 additions and 65 deletions

72
plugin/repeat.vim Normal file
View File

@@ -0,0 +1,72 @@
" repeat.vim - Let the repeat command repeat plugin maps
" Maintainer: Tim Pope
" Version: 1.0
" Installation:
" Place in either ~/.vim/plugin/repeat.vim (to load at start up) or
" ~/.vim/autoload/repeat.vim (to load automatically as needed).
"
" Developers:
" Basic usage is as follows:
"
" silent! call repeat#set("\<Plug>MappingToRepeatCommand",3)
"
" The first argument is the mapping that will be invoked when the |.| key is
" pressed. Typically, it will be the same as the mapping the user invoked.
" This sequence will be stuffed into the input queue literally. Thus you must
" encode special keys by prefixing them with a backslash inside double quotes.
"
" The second argument is the default count. This is the number that will be
" prefixed to the mapping if no explicit numeric argument was given. The
" value of the v:count variable is usually correct and it will be used if the
" second parameter is omitted. If your mapping doesn't accept a numeric
" argument and you never want to receive one, pass a value of -1.
"
" Make sure to call the repeat#set function _after_ making changes to the
" file.
if exists("g:loaded_repeat") || &cp || v:version < 700
finish
endif
let g:loaded_repeat = 1
let g:repeat_tick = -1
function! repeat#set(sequence,...)
silent exe "norm! \"=''\<CR>p"
let g:repeat_sequence = a:sequence
let g:repeat_count = a:0 ? a:1 : v:count
let g:repeat_tick = b:changedtick
endfunction
function! s:repeat(count)
if g:repeat_tick == b:changedtick
let c = g:repeat_count
let s = g:repeat_sequence
let cnt = c == -1 ? "" : (a:count ? a:count : (c ? c : ''))
call feedkeys(cnt . s)
else
call feedkeys((a:count ? a:count : '') . '.', 'n')
endif
endfunction
function! s:wrap(command,count)
let preserve = (g:repeat_tick == b:changedtick)
exe 'norm! '.(a:count ? a:count : '').a:command
if preserve
let g:repeat_tick = b:changedtick
endif
endfunction
nnoremap <silent> . :<C-U>call <SID>repeat(v:count)<CR>
nnoremap <silent> u :<C-U>call <SID>wrap('u',v:count)<CR>
nnoremap <silent> U :<C-U>call <SID>wrap('U',v:count)<CR>
nnoremap <silent> <C-R> :<C-U>call <SID>wrap("\<Lt>C-R>",v:count)<CR>
augroup repeatPlugin
autocmd!
autocmd BufLeave,BufWritePre,BufReadPre * let g:repeat_tick = (g:repeat_tick == b:changedtick || g:repeat_tick == 0) ? 0 : -1
autocmd BufEnter,BufWritePost * if g:repeat_tick == 0|let g:repeat_tick = b:changedtick|endif
augroup END
" vim:set ft=vim et sw=4 sts=4:

View File

@@ -1027,6 +1027,9 @@ endfunction
" Multiple inexact matches is currently considered an error.
function! VCSCommandGetVCSType(buffer)
if exists("g:VCSTypeOverride")
return g:VCSTypeOverride
endif
let vcsType = getbufvar(a:buffer, 'VCSCommandVCSType')
if strlen(vcsType) > 0
return vcsType

81
plugin/zoom.vim Normal file
View File

@@ -0,0 +1,81 @@
if &cp || exists("g:loaded_zoom")
finish
endif
let g:loaded_zoom = 1
let s:save_cpo = &cpo
set cpo&vim
" keep default value
let s:current_font = &guifont
" command
command! -narg=0 ZoomIn :call s:ZoomIn()
command! -narg=0 ZoomOut :call s:ZoomOut()
command! -narg=0 ZoomReset :call s:ZoomReset()
" map
nmap <kPlus> :ZoomIn<CR>
nmap <kMinus> :ZoomOut<CR>
nmap <kDivide> :ZoomReset<CR>
" guifont size + 1
function! s:ZoomIn()
let l:font = split(&guifont)
let l:size = l:font[1] + 1
let &guifont = l:font[0] . " " . l:size
endfunction
" guifont size - 1
function! s:ZoomOut()
let l:font = split(&guifont)
let l:size = l:font[1] - 1
let &guifont = l:font[0] . " " . l:size
endfunction
" reset guifont size
function! s:ZoomReset()
let &guifont = s:current_font
endfunction
let &cpo = s:save_cpo
finish
==============================================================================
zoom.vim : control gui font size with "+" or "-" keys.
------------------------------------------------------------------------------
$VIMRUNTIMEPATH/plugin/zoom.vim
==============================================================================
author : OMI TAKU
url : http://nanasi.jp/
email : mail@nanasi.jp
version : 2008/07/18 10:00:00
==============================================================================
Control Vim editor font size with key "+", or key "-".
Press "+" key, Vim editor gui font size will change bigger.
And, press "-" key, Vim editor gui font size will change smaller.
This plugin is for GUI only.
Normal Mode:
+ ... change font size bigger
- ... change font size smaller
Command-line Mode:
:ZoomIn ... change font size bigger
:ZoomOut ... change font size smaller
:ZoomReset ... reset font size changes.
==============================================================================
1. Copy the zoom.vim script to
$HOME/vimfiles/plugin or $HOME/.vim/plugin directory.
Refer to ':help add-plugin', ':help add-global-plugin' and
':help runtimepath' for more details about Vim plugins.
2. Restart Vim.
==============================================================================
" vim: set ff=unix et ft=vim nowrap :