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 names = matchlist(bufname("%"), '\(.\{-1,}\):\%(\(\d\+\)\%(:\(\d*\):\?\)\?\)\?$')
9 if empty(names) | return | endif
10 let file_name = names[1]
11 let line_num = names[2] == "" ? "0" : names[2]
12 let col_num = names[3] == "" ? "0" : names[3]
13 if !filereadable(file_name) | return | endif
14 exec "keepalt edit +" . line_num . " " . file_name
15 exec "normal! " . col_num . "|"
18 autocmd! BufNewFile *:* nested call s:gotoline()
19 autocmd! BufRead *:* nested call s:gotoline()