Sunday, November 20, 2011

In script always search from start of buffer

In a script, how can I get repeated searches always to begin at the start of
the buffer?
If I precede the search with gg or :cursor(1, 1) I get E492, with 1G I get
E464.

:map p$ ggdd:while @" != ""<CR>:b#<CR>:cursor (1, 1)<CR>:silent!
/^R"<CR>0i$<Space><Esc>:b#<CR>dd:endwhile

--
View this message in context: http://vim.1045645.n5.nabble.com/In-script-always-search-from-start-of-buffer-tp5008841p5008841.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: