On Sat, Jul 16, 2016 at 4:52 AM, Tim Chase <[email protected]> wrote:
> On 2016-07-15 21:30, 李哲 wrote: > > as you know when you search `abc` in the text, you press `n` to go > > to the next match, > > > > now I want to map n here to nzz, what should I do? > > > > nmap n nzz obvious wrong here. > > By using "nmap" rather than "nnoremap", you end up with a recursive > macro that does an "n" that does an "n" that does an "n", to infinity. > > Should be able to just change it to > > :nnoremap n nzz > > and you're good to go. > > As it appears that the intent here is to re-center the searched line, another approach is to set a high 'scrolloff' lines, like :set scrolloff=999 That way, even backward search (or any other jump for that matter) would also re-center the screen. --Arun -- -- 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 --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
