Skip to content

Instantly share code, notes, and snippets.

@dre-hh
Last active February 23, 2018 10:37
Show Gist options
  • Save dre-hh/bda01bf58aea3c175cc228ccfb74551e to your computer and use it in GitHub Desktop.
Save dre-hh/bda01bf58aea3c175cc228ccfb74551e to your computer and use it in GitHub Desktop.
fun! TerminalRepeat()
let buffers = map(filter(copy(getbufinfo()), 'v:val.listed'), 'v:val.name')
for buffer in buffers
if buffer =~ "term://.*/"
let windowNr = bufwinnr(buffer)
if windowNr > 0
execute windowNr 'wincmd w'
else
execute "b " . buffer
endif
startinsert
call feedkeys("\<UP>")
endif
endfor
endfun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment