1
0
mirror of https://github.com/amix/vimrc synced 2025-07-08 09:35:00 +08:00

renamed sources_non_forked folder to bundle

This commit is contained in:
Mirosław Pragłowski
2014-05-09 21:28:39 +02:00
parent 1b24133310
commit a1339baae9
1424 changed files with 5 additions and 33 deletions

View File

@ -0,0 +1,28 @@
" ----- Emulate 'gf' but recognize :line format -----
function! GotoFile(w)
let curword = expand("<cfile>")
if (strlen(curword) == 0)
return
endif
let matchstart = match(curword, ':\d\+$')
if matchstart > 0
let pos = '+' . strpart(curword, matchstart+1)
let fname = strpart(curword, 0, matchstart)
else
let pos = ""
let fname = curword
endif
" Open new window if requested
if a:w == "new"
new
endif
" Use 'find' so path is searched like 'gf' would
execute 'find ' . pos . ' ' . fname
endfunction
set isfname+=: " include colon in filenames
" Override vim commands 'gf', '^Wf', '^W^F'
nnoremap gf :call GotoFile("")<CR>
nnoremap <C-W>f :call GotoFile("new")<CR>
nnoremap <C-W><C-F> :call GotoFile("new")<CR>