Changeset 321 for lang/vim/surround/trunk
- Timestamp:
- 10/01/07 04:56:56 (16 months ago)
- Location:
- lang/vim/surround/trunk
- Files:
-
- 2 modified
-
doc/surround.txt (modified) (1 diff)
-
plugin/surround.vim (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/vim/surround/trunk/doc/surround.txt
r320 r321 230 230 CHANGELOG *surround-changelog* 231 231 232 2007-10-01T03:43:51+09:00 kana <http://nicht.s8.xrea.com/> 233 234 - Support dynamic template for |surround-customizing|. 235 Now templates of user-defined surrounding objects may be functions 236 or funcrefs which must return a template. 237 238 For example, the following setting provides two-stroke keys "xb" and 239 "xB" for some templates. 240 > 241 function g:surround_{char2nr('x')}() 242 let c = nr2char(getchar()) 243 if c ==# 'b' 244 return "(((\r)))" 245 elseif c ==# 'B' 246 return "{{{\r}}}" 247 else 248 return '' 249 endif 250 endfunction 251 < 232 252 2007-10-01T00:25:20+09:00 kana <http://nicht.s8.xrea.com/> 233 253 -
lang/vim/surround/trunk/plugin/surround.vim
r320 r321 617 617 function! s:get_user_defined_object(char) 618 618 if exists("b:surround_".char2nr(a:char)) 619 return b:surround_{char2nr(a:char)} 619 let Value = b:surround_{char2nr(a:char)} 620 elseif exists("*b:surround_".char2nr(a:char)) 621 let Value = function('b:surround_'.char2nr(a:char)) 620 622 elseif exists("g:surround_".char2nr(a:char)) 621 return g:surround_{char2nr(a:char)} 622 else 623 return '' 623 let Value = g:surround_{char2nr(a:char)} 624 elseif exists("*g:surround_".char2nr(a:char)) 625 let Value = function('g:surround_'.char2nr(a:char)) 626 else 627 let Value = '' 628 endif 629 630 if type(Value) == type('string') 631 return Value 632 else " function? 633 return Value() 624 634 endif 625 635 endfunction
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)