New answers tagged ex-mode
1
Figured out what's happening.
Here /bar actually means :/bar which is a range spec meaning "go to next line which has bar in it". It's just like :1 which goes to line #1.
And :/bar works in a line-wise way. It goes to the the line and put cursor at column #1. So the next norm n would move cursor to bar 1, and another norm n would move to bar 2.
And ...
2
normal n works for me in Ex mode.
The problem is that you mix normal mode /search with ex-mode range :/search. In your case :/search is executed and it doesn't populate @/ register thus with :normal n you try to search something else (previous interactive search?)
UPD:
i want to find all bar lines and print them
:g/bar/p
or
for line in getline(1, '$')
...
Top 50 recent answers are included
Related Tags
ex-mode × 104command-line × 10
substitute × 10
regular-expression × 9
ex-command × 9
normal-mode × 8
vimscript × 6
search × 6
global-command × 6
cursor-motions × 5
external-command × 5
invocation × 5
key-bindings × 4
buffers × 4
visual-mode × 4
linux × 4
posix × 4
cut-copy-paste × 3
register × 3
line-numbers × 3
range × 3
original-vi × 3
autocompletion × 2
replace × 2
functions × 2