1

Using Vim 8. I want to count the number of pipe symbols that are on the current line so that I can compare it to the other lines in the file and make sure my pipe symbol count is consistent. How do I do this?

Rich
  • 31,891
  • 3
  • 72
  • 139
MrSnrub
  • 431
  • 3
  • 10

1 Answers1

2

You can count occurrences by search/replace without actual change with n option.

:s,|,,gn
auditory
  • 170
  • 1
  • 6