Changeset 4726 for lang/vim/textobj-datetime/trunk
- Timestamp:
- 01/17/08 01:19:29 (10 months ago)
- Location:
- lang/vim/textobj-datetime/trunk
- Files:
-
- 2 modified
- 1 moved
-
doc/textobj-datetime.txt (modified) (6 diffs)
-
plugin (moved) (moved from lang/vim/textobj-datetime/trunk/autoload)
-
plugin/textobj/datetime.vim (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/vim/textobj-datetime/trunk/doc/textobj-datetime.txt
r3176 r4726 1 1 *textobj-datetime.txt* Text objects for date and time. 2 2 3 Version 0. 14 Copyright (C) 2007 kana <http://nicht.s8.xrea.com/>3 Version 0.2 4 Copyright (C) 2007-2008 kana <http://nicht.s8.xrea.com/> 5 5 License: MIT license (see <http://www.opensource.org/licenses/mit-license>) 6 6 $Id$ 7 8 9 CONTENTS *textobj-datetime-contents* 10 11 Introduction |textobj-datetime-introduction| 12 Key Mapings |textobj-datetime-key-mappings| 13 Customizing |textobj-datetime-customizing| 14 Bugs |textobj-datetime-bugs| 15 ChangeLog |textobj-datetime-changelog| 7 16 8 17 … … 15 24 16 25 Requirements: 17 * |textobj-user| 26 * Vim 7.0 or later. 27 * |textobj-user| <http://www.vim.org/scripts/script.php?script_id=2100> 18 28 19 29 … … 21 31 22 32 ============================================================================== 23 KEY MAPPINGS *textobj-datetime-keymappings* 33 KEY MAPPINGS *textobj-datetime-key-mappings* 34 35 <Plug>textobj#datetime#auto *<Plug>textobj#datetime#auto* 36 Select one of the following objects (as long as possible). 24 37 25 38 <Plug>textobj#datetime#full *<Plug>textobj#datetime#full* 26 Select date plustime.39 Select a date and time. 27 40 28 41 <Plug>textobj#datetime#date *<Plug>textobj#datetime#date* … … 30 43 31 44 <Plug>textobj#datetime#time *<Plug>textobj#datetime#time* 32 Select time (hh:mm or hh:mm:ss).45 Select a time (hh:mm or hh:mm:ss). 33 46 34 47 <Plug>textobj#datetime#tz *<Plug>textobj#datetime#tz* 35 48 Select a time zone designator (Z or +hh:mm or -hh:mm). 36 It must be preced inga time.49 It must be preceded by a time. 37 50 38 <Plug>textobj#datetime#auto *<Plug>textobj#datetime#auto*39 Select one of the above (as long as possible).40 51 41 *textobj#datetime#default_mappings()*42 textobj-datetime provides textobj#datetime#default_mappings() to define some43 useful key mappings. Call it from your |vimrc|.44 52 45 {lhs} {rhs} ~ 46 ----- ------------------------~ 53 54 ============================================================================== 55 CUSTOMIZING *textobj-datetime-customizing* 56 57 *g:textobj_datetime_no_default_key_mappings* 58 *:TextobjDatetimeDefaultKeyMappings* 59 This plugin will define the following key mappings in Visual mode and 60 Operator-pending mode automatically. If you don't want these key mappings, 61 define |g:textobj_datetime_no_default_key_mappings| before this plugin is 62 loaded (e.g. in $MYVIMRC). You can also use 63 |:TextobjDatetimeDefaultKeyMappings| to redefine these key mappings. 64 65 {lhs} {rhs} ~ 66 ----- --------------------------- ~ 47 67 ada <Plug>textobj#datetime#auto 48 68 add <Plug>textobj#datetime#date … … 57 77 idz <Plug>textobj#datetime#tz 58 78 79 Note that there is no difference between a{x} and i{x}. 80 59 81 60 82 61 83 62 84 ============================================================================== 63 BUGS *textobj-datetime-bugs*85 BUGS *textobj-datetime-bugs* 64 86 65 87 Currently, W3C-DTF is only supported. … … 72 94 ============================================================================== 73 95 CHANGELOG *textobj-datetime-changelog* 96 97 0.2 2008-01-08T23:03:05+09:00 98 - Fix the incorrect design - modify not to be autoloaded. 99 - Modify the policy for the defauly key mappings. 100 See |g:textobj_datetime_no_default_key_mappings|. 74 101 75 102 0.1 2007-11-17 -
lang/vim/textobj-datetime/trunk/plugin/textobj/datetime.vim
r3176 r4726 1 1 " textobj-datetime - Text objects for date and time. 2 " Version: 0. 13 " Copyright (C) 2007 kana <http://nicht.s8.xrea.com/>2 " Version: 0.2 3 " Copyright (C) 2007-2008 kana <http://nicht.s8.xrea.com/> 4 4 " License: MIT license (see <http://www.opensource.org/licenses/mit-license>) 5 " $Id$ 6 " Interfaces "{{{1 5 " $Id$ "{{{1 6 7 if exists('g:loaded_textobj_datetime') 8 finish 9 endif 10 11 12 13 14 15 16 17 18 " Interface "{{{1 7 19 8 20 vnoremap <silent> <Plug>textobj#datetime#auto … … 31 43 32 44 33 function! textobj#datetime#default_mappings(...) 34 let forcep = (a:0 ? a:1 : 0)45 command! -bang -bar -nargs=0 TextobjDatetimeDefaultKeyMappings 46 \ call s:default_key_mappings('<bang>' == '!') 35 47 36 function! s:Map(forcep, lhs, rhs) 37 execute 'vmap' (a:forcep ? '' : '<unique>') a:lhs a:rhs 38 execute 'omap' (a:forcep ? '' : '<unique>') a:lhs a:rhs 48 function! s:default_key_mappings(bangedp) 49 let forcedp = (a:bangedp ? '' : '<unique>') 50 51 function! s:Map(forcedp, lhs, rhs) 52 execute 'vmap' (a:forcedp ? '' : '<unique>') a:lhs a:rhs 53 execute 'omap' (a:forcedp ? '' : '<unique>') a:lhs a:rhs 39 54 endfunction 40 55 41 call s:Map(force p, 'ada', '<Plug>textobj#datetime#auto')42 call s:Map(force p, 'adf', '<Plug>textobj#datetime#full')43 call s:Map(force p, 'add', '<Plug>textobj#datetime#date')44 call s:Map(force p, 'adt', '<Plug>textobj#datetime#time')45 call s:Map(force p, 'adz', '<Plug>textobj#datetime#tz')56 call s:Map(forcedp, 'ada', '<Plug>textobj#datetime#auto') 57 call s:Map(forcedp, 'adf', '<Plug>textobj#datetime#full') 58 call s:Map(forcedp, 'add', '<Plug>textobj#datetime#date') 59 call s:Map(forcedp, 'adt', '<Plug>textobj#datetime#time') 60 call s:Map(forcedp, 'adz', '<Plug>textobj#datetime#tz') 46 61 47 call s:Map(forcep, 'ida', '<Plug>textobj#datetime#auto') 48 call s:Map(forcep, 'idf', '<Plug>textobj#datetime#full') 49 call s:Map(forcep, 'idd', '<Plug>textobj#datetime#date') 50 call s:Map(forcep, 'idt', '<Plug>textobj#datetime#time') 51 call s:Map(forcep, 'idz', '<Plug>textobj#datetime#tz') 62 call s:Map(forcedp, 'ida', '<Plug>textobj#datetime#auto') 63 call s:Map(forcedp, 'idf', '<Plug>textobj#datetime#full') 64 call s:Map(forcedp, 'idd', '<Plug>textobj#datetime#date') 65 call s:Map(forcedp, 'idt', '<Plug>textobj#datetime#time') 66 call s:Map(forcedp, 'idz', '<Plug>textobj#datetime#tz') 67 return 52 68 endfunction 69 70 if !exists('g:textobj_datetime_no_default_key_mappings') 71 TextobjDatetimeDefaultKeyMappings 72 endif 53 73 54 74 … … 62 82 63 83 function! s:select(type, previous_mode) 64 echomsg 's:select' string(a:type) string(a:previous_mode)65 84 return textobj#user#select(s:PATTERNS[a:type], '', a:previous_mode) 66 85 endfunction … … 96 115 97 116 98 " __END__ "{{{1 117 " Fin. "{{{1 118 119 let g:loaded_textobj_datetime = 1 120 121 122 123 124 125 126 127 128 " __END__ 99 129 " vim: foldmethod=marker
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)