When running an Ex command in Vim on range of lines, the range is always extended to cover adjacent folds (which is documented in :help fold-behavior
). For example, given the following file:
int foo() {
foobar();
}
the :2s/o//n
command (i.e. counting o's in second line), will print:
2 matches on 1 line
However, if I fold the whole file, I get:
4 matches on 2 lines
Is there any way to override / workaround this behavior? I want to run my command on precisely specified range of lines; I don't care about folds.