How do I remove duplicate lines from a buffer?

You can use the following user-defined command to remove all the duplicate lines from a buffer: :command -range=% Uniq <line1>,<line2>g/^\%<<line2>l\(.*\)\n\1$/d Add the above command to your .vimrc file and invoke “:Uniq” to remove all the duplicate lines.

Read free Software Algorithms and Computer Science Books by CodeAhoy Learn.

Introduction to Recursion and Backtracking

Sorting Algorithms

Introduction to C Programming Language

And More...

Speak Your Mind