Created
July 30, 2008 14:58
-
-
Save agile/3271 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:gotoline() | |
let file = bufname("%") | |
let names = matchlist( file, '\(.*\):\(\d\+\)') | |
if len(names) != 0 && filereadable(names[1]) | |
exec ":e " . names[1] | |
exec ":" . names[2] | |
if foldlevel(names[2]) > 0 | |
exec ":foldopen!" | |
endif | |
endif | |
endfunction | |
autocmd! BufNewFile *:* nested call s:gotoline() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment