|
|
|
@ -9,26 +9,18 @@ endif
|
|
|
|
|
let g:autoloaded_Banana= 1
|
|
|
|
|
|
|
|
|
|
fun! banana#Enc() range
|
|
|
|
|
if line("'<") > 0
|
|
|
|
|
call s:ReplSel(s:Dec2Ban(s:GetSel()))
|
|
|
|
|
else
|
|
|
|
|
call s:EncLine()
|
|
|
|
|
endif
|
|
|
|
|
call s:ReplSel(s:Dec2Ban(s:GetSel()))
|
|
|
|
|
endfun!
|
|
|
|
|
|
|
|
|
|
fun! s:EncLine()
|
|
|
|
|
fun! banana#EncLine()
|
|
|
|
|
call setline('.', substitute(getline('.'), '\d\d*', '\=toupper(s:Doban(submatch(0)))','g'))
|
|
|
|
|
endfun!
|
|
|
|
|
|
|
|
|
|
fun! banana#Dec() range
|
|
|
|
|
if line("'<") > 0
|
|
|
|
|
call s:ReplSel(s:Ban2Dec(s:GetSel()))
|
|
|
|
|
else
|
|
|
|
|
call s:DecLine()
|
|
|
|
|
endif
|
|
|
|
|
endfun!
|
|
|
|
|
|
|
|
|
|
fun! s:DecLine()
|
|
|
|
|
fun! banana#DecLine()
|
|
|
|
|
call setline('.', substitute(getline('.'), '\C\u\u*', '\=s:Unban(tolower(submatch(0)))','g'))
|
|
|
|
|
endfun!
|
|
|
|
|
|
|
|
|
@ -103,7 +95,7 @@ fun! s:ReplSel(str)
|
|
|
|
|
let l:new_str = slice(l:lines[0],0,l:cstart - 1) . a:str . l:lines[-1][l:cend:]
|
|
|
|
|
let l:new_str_lst = split(l:new_str,'\n')
|
|
|
|
|
call setline(l:lstart ,l:new_str_lst)
|
|
|
|
|
delmarks < >
|
|
|
|
|
call setcursorcharpos(lstart, cstart)
|
|
|
|
|
endfun!
|
|
|
|
|
|
|
|
|
|
fun! s:Dec2Ban(text)
|
|
|
|
|