public
Last active

  • Download Gist
h.vim
VimL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
let g:histignore = '^buf:^history'
function! s:h(commandline)
call histdel(':', '^H\s')
let oldhist=&history
try
if len(filter(split(g:histignore, ':'), 'a:commandline =~ v:val')) == 0
call histadd(':', a:commandline)
endif
set history=0
exe a:commandline
catch
echohl ErrorMsg | echomsg v:exception | echohl None
finally
let &history=oldhist
unlet oldhist
endtry
endfunction
command! -nargs=+ H call s:h(<q-args>)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.