Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " Unique Lines
- " Barry Arthur, 2012 01 09
- let b:unique_lines = []
- function! Unique(line)
- let l = getline(a:line)
- 1
- let n = search(l, 'w')
- if n != a:line
- return
- endif
- let n = search(l, 'W')
- if n == 0
- call add(b:unique_lines, a:line)
- endif
- endfunction
- 22,$g/./call Unique(line('.'))
- echo "Unique Lines = " . string(b:unique_lines)
- nohl
- finish
- one
- one
- two
- three
- three
- dour
- four
- dour
Advertisement
Add Comment
Please, Sign In to add comment