Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " Vim plugin to strip ANSI escape sequences from an entire buffer.
- " Maintainer: Ben Kibbey <bjk@arbornet.org>
- " Last Change: Auguest 22, 2003
- "
- " $Log: stripansi.vim,v $
- " Revision 1.1 2003/08/22 22:56:47 bjk
- " Initial commit.
- "
- if exists("loaded_stripansi")
- finish
- endif
- let loaded_stripansi = 1
- noremap <unique> <script> <Plug>StripAnsi <SID>StripAnsi
- noremap <SID>StripAnsi :call <SID>StripAnsi()<CR>
- noremenu <script> Plugin.StripAnsi <SID>StripAnsi
- if !hasmapto('<Plug>StripAnsi')
- nmap <unique> <Leader>sa <Plug>StripAnsi
- endif
- if exists(":StripAnsi") != 2
- comm -nargs=0 StripAnsi call <SID>StripAnsi()
- endif
- func <SID>StripAnsi()
- :%s/\(\[\d*[ABCD]\)\|\(\[\d*,\d*[HfR]\)\|\(\[2J\)\|\(\[\d*m\)\|\(\[\d*\([;]\)\?\d*\([;]\)\?\d*[mH]\)//ge
- :%s/\(\[=[01]\?[h1]\?\)\|\(\[=[0-7],7[h1]\)\|\(\[?[7]\?[h1]\{,2\}\)\|\(\[[suK:]\)\|\(=\)//ge
- endfunc
Add Comment
Please, Sign In to add comment