Skip to content

Instantly share code, notes, and snippets.

@cj
Created December 23, 2010 02:15
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 cj/752459 to your computer and use it in GitHub Desktop.
Save cj/752459 to your computer and use it in GitHub Desktop.
function! s:RelPath()
if !exists('b:rel_path')
let root = escape('$PWD')
let file = expand('%:p')
let b:rel_path = strpart(file,matchend(file, root))
endif
return b:rel_path
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment