New answers tagged

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