Skip to content

Commit

Permalink
Fix example in Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattes Groeger committed Aug 31, 2014
1 parent f06d7d0 commit 9390478
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,20 @@ If you want to customize the location or filename you can define the following f
```viml
" Finds the Git super-project directory.
function! g:BMWorkDirFileLocation()
let filename = 'vim-bookmarks'
if !isdirectory('.git')
" Look upwards (at parents) for a directory named '.git'
let parent = finddir('.git', '.;')
if parent != ''
return parent.'/'.filename
endif
endif
return getcwd().'/.'.filename
let filename = 'bookmarks'
let location = ''
if isdirectory('.git')
" Current work dir is git's work tree
let location = getcwd().'/.git'
else
" Look upwards (at parents) for a directory named '.git'
let location = finddir('.git', '.;')
endif
if len(location) > 0
return location.'/'.filename
else
return getcwd().'/.'.filename
endif
endfunction
```

Expand Down

0 comments on commit 9390478

Please sign in to comment.