There may or may not have been asked before, but I don’t know enough about vim to be able to look. How can I add add single quotes (‘) 5 characters into the line and at the end of every line that begins with a (-)
An example from the file is
want quotes
here & here
v v
- essentials.help
- essentials.helpop
- essentials.list
- essentials.motd
- essentials.rules
- essentials.spawn
- groupmanager.notify.self
You could do something like:
Adjust the exact number of spaces you need as required.
This searches for the start of a line
^, then four spaces, a dash, and then uses a capturing group to capture all the characters to the end of the line. Then it’s replaced with four spaces, a dash, a single quote,\1is the contents of the capturing group, then a final single quote.The leading
%applies this command to all lines in the file.