Skip to content

Instantly share code, notes, and snippets.

@pehlert
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pehlert/354f4b24d8140d16566c to your computer and use it in GitHub Desktop.
Save pehlert/354f4b24d8140d16566c to your computer and use it in GitHub Desktop.
function! RelativeFileComplete()
let oldpwd = getcwd()
lcd %:p:h
call feedkeys("\<C-x>\<C-f>")
execute 'lcd' oldpwd
return ''
endfunction
imap <C-f> <C-r>=RelativeFileComplete()<CR>
@dahu
Copy link

dahu commented Aug 17, 2014

function! RelativeFileComplete()
let g:oldpwd = getcwd()

lcd %:p:h
call feedkeys("")
return ''
endfunction

imap =RelativeFileComplete():exe 'lcd ' . g:oldpwd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment