This week I picked up an excellent Vim command:
CTRL-X CTRL-L. This command searches backwards through your project and inserts a matching line after the cursor.
So, if there’s a line in your project like this:
defimpl Phoenix.Param, for: Tilex.Developer do
And I type
defimpl (which is unique enough to match only a few functions), Vim will suggest matching options, letting choose a match and complete it:
defimpl Phoenix.Param, for: Tilex.Developer do defimpl Phoenix.Param, for: Tilex.Developer do
This is useful when importing items into a framework like React.js, where the head of the file often includes a group of common import statements.
See ‘Insert mode completion’ inside
insert.txt in the Vim help for more information.
h/t Dorian KarterTweet