]> Sergey Matveev's repositories - dotfiles.git/blobdiff - vim/.vim/autoload/fileline.vim
Vim scripts refactoring
[dotfiles.git] / vim / .vim / autoload / fileline.vim
similarity index 79%
rename from vim/.vim/plugin/file_line.vim
rename to vim/.vim/autoload/fileline.vim
index 8d7c429b57d975d46ac4fcb8d3eb2c4b58ec5943..193328c316597afda3dd833b4681eb0817929a66 100644 (file)
@@ -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('*<SID>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()