Am 09.06.2011 19:59, schrieb lith:
Hi,

Thanks. I didn't expect to find a function to solve this problem. Thanks.

Regards,
Tom

here is a small plugin, usage:
    :KeepHist {cmd}


" plugin/keephist.vim

com! -nargs=? -complete=command KeepHist  try| call s:Save()
    \| exec <q-args>| finally| call s:Restore()| endtry

let s:last_search = ""
let s:depth = 0
" nesting allowed

func! s:Save()
    if s:depth == 0
        let s:last_search = histget("search", -1)
    endif
    let s:depth += 1
endfunc

func! s:Restore()
    let s:depth -= 1
    if s:depth == 0
        if s:last_search != "" && s:last_search != histget("search", -1)
            call histdel("search", -1)
        endif
    endif
endfunc

--
Andy

--
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

Reply via email to