Skip to content

Instantly share code, notes, and snippets.

@mhinz
Created November 30, 2016 22:48
Show Gist options
  • Save mhinz/17bd0e445f6cec2d43c20103f7a01a42 to your computer and use it in GitHub Desktop.
Save mhinz/17bd0e445f6cec2d43c20103f7a01a42 to your computer and use it in GitHub Desktop.
autocmd VimEnter * nested
\ if argc() == 0
\| let last = filter(filter(copy(v:oldfiles), 'match(v:val, getcwd()) == 0'), 'filereadable(v:val)')
\| if !empty(last)
\| execute 'edit' fnameescape(last[0])
\| endif
\| endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment