1
2 Maintainer:peter@peterodding.com
3 Last Change:
4 URL:http://peterodding.com/code/vim/profile/autoload/xolox/escape.vim
5
6 pattern():substitute
7
8 function! xolox#escape#pattern(string)
9 if type(a:string) == type('')
10 let string = escape(a:string, '^$.*\~[]')
11 return substitute(string, '\n', '\\n', 'g')
12 endif
13 return ''
14 endfunction
15
16 substitute():substitute
17
18 function! xolox#escape#substitute(string)
19 if type(a:string) == type('')
20 let string = escape(a:string, '\&~%')
21 return substitute(string, '\n', '\\r', 'g')
22 endif
23 return ''
24 endfunction
25
26