Relative Content

Tag Archive for vim

How to load the search history?

If you start a session with +/pat/ or -c/pat, vim will search for the first occurrence of pat in the buffer and place the cursor on the line with the match. But pat is not entered into the search history! If you search for another string, you cannot easily re-search for pat without explicitly loading that string, probably by typing it out. You can certainly do n* when you first enter the buffer to load the history, but that is a bit fragile and too much work.

How to load the search history?

If you start a session with +/pat/ or -c/pat, vim will search for the first occurrence of pat in the buffer and place the cursor on the line with the match. But pat is not entered into the search history! If you search for another string, you cannot easily re-search for pat without explicitly loading that string, probably by typing it out. You can certainly do n* when you first enter the buffer to load the history, but that is a bit fragile and too much work.