Skip to content

Instantly share code, notes, and snippets.

@romainl
Created January 18, 2016 21:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romainl/17437ae3ed71ce9fbc0b to your computer and use it in GitHub Desktop.
Save romainl/17437ae3ed71ce9fbc0b to your computer and use it in GitHub Desktop.
Edit all buffers and come back without losing highlighting
function! EditAllBuffersAndComeBackWithoutLosingHighlighting()
let this_buffer = bufnr("%")
bufdo set eventignore= | if &buftype != "nofile" && expand("%") != '' | edit | endif
execute "b" . this_buffer
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment