X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=blobdiff_plain;f=vim%2F.vim%2Fautoload%2Ffileline.vim;fp=vim%2F.vim%2Fplugin%2Ffile_line.vim;h=193328c316597afda3dd833b4681eb0817929a66;hp=8d7c429b57d975d46ac4fcb8d3eb2c4b58ec5943;hb=1280549be01e3ce72d9e0aeef6254a1ff14a25a3;hpb=86cacc081de452eb66d50f13261310b07f8ca2d4 diff --git a/vim/.vim/plugin/file_line.vim b/vim/.vim/autoload/fileline.vim similarity index 79% rename from vim/.vim/plugin/file_line.vim rename to vim/.vim/autoload/fileline.vim index 8d7c429..193328c 100644 --- a/vim/.vim/plugin/file_line.vim +++ b/vim/.vim/autoload/fileline.vim @@ -1,9 +1,7 @@ " Simplified version of http://www.vim.org/scripts/script.php?script_id=2184 " that does not replace current window -if exists('*gotoline') | finish | endif - -function! s:gotoline() +function! fileline#goto() abort let file = bufname("%") if filereadable(file) | return | endif let names = matchlist(file, '\(.\{-1,}\):\%(\(\d\+\)\%(:\(\d*\):\?\)\?\)\?$') @@ -17,6 +15,3 @@ function! s:gotoline() exec "normal! " . col_num . "|" exec "bdelete " . nr endfunction - -autocmd! BufNewFile *:* nested call s:gotoline() -autocmd! BufRead *:* nested call s:gotoline()