Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " Will write text including first match until before the second match:
- " :WriteMatchedText first second /path/to/file.ext
- function! WriteMatchedText(first, second, file)
- exec "normal /".a:first."\<CR>"
- normal v
- exec "normal /".a:second."\<CR>h"
- normal y
- call writefile(split(@", "\n"), expand(a:file))
- endfunction
- command! -bar -nargs=+ -complete=file WriteMatchedText call WriteMatchedText(<f-args>)
Add Comment
Please, Sign In to add comment