1 " Simplified version of http://www.vim.org/scripts/script.php?script_id=2184
2 " that does not replace current window
4 if exists("g:loaded_mein_file_line") | finish | endif
5 let g:loaded_mein_file_line = 1
8 let file = bufname("%")
9 if filereadable(file) | return | endif
10 let names = matchlist(bufname("%"), '\(.\{-1,}\):\%(\(\d\+\)\%(:\(\d*\):\?\)\?\)\?$')
11 if empty(names) | return | endif
12 let file_name = names[1]
13 let line_num = names[2] == "" ? "0" : names[2]
14 let col_num = names[3] == "" ? "0" : names[3]
15 if !filereadable(file_name) | return | endif
17 exec "keepalt edit +" . line_num . " " . file_name
18 exec "normal! " . col_num . "|"
22 autocmd! BufNewFile *:* nested call s:gotoline()
23 autocmd! BufRead *:* nested call s:gotoline()