Created: 2023-02-04 23:36

To turn the following:

interface Foo { foo: string }
interface Bar { foo: string }

Into:

type Foo = { foo: string }
type Bar = { foo: string }

Do:

:%s/interface \(.*\) {/type \1 = {/

The capture group should be escaped on the search side, and referenced by number on the replace side.