diff --git a/doc/drupal.txt b/doc/drupal.txt
index cc83d3d..eac5caf 100644
--- a/doc/drupal.txt
+++ b/doc/drupal.txt
@@ -136,6 +136,15 @@ on UNIX-like systems.
 The script always defines all these keys.  If it cannot determine a reasonable
 value, it will use an empty string.
 
+							       *g:Drupal_dirs*
+If you are editing a project that is not inside your Drupal root, then it
+should still be able to determine the version of Drupal core.  In this case,
+define the |Dictionary| g:Drupal_dirs in your vimrc file, with keys the
+versions of Drupal core you use and values your Drupal roots.  For example, >
+	:let g:Drupal_dirs = {6: '/var/www/drupal6.22', 7: '/path/to/D7'}
+Then the script will set b:Drupal_info.DRUPAL_ROOT to the directory
+corresponding to the value of b:Drupal_info.CORE.
+
 The |drupal-ftplugin| file uses b:Drupal_info.DRUPAL_ROOT to define the
 environment variable $DRUPAL_ROOT.  This is done using a |BufEnter|
 autocommand, so the variable will be set correctly even if you switch between
diff --git a/plugin/drupal.vim b/plugin/drupal.vim
index 3ea5bd1..ea4bc0c 100644
--- a/plugin/drupal.vim
+++ b/plugin/drupal.vim
@@ -125,11 +125,14 @@ function! s:DrupalInit()
   let info.OPEN_COMMAND = s:OpenCommand()
   let info.TYPE = s:IniType(info.INFO_FILE)
   let info.CORE = s:CoreVersion(info.INFO_FILE)
+  " If we found only one of CORE and DRUPAL_ROOT, use it to get the other.
   if info.CORE == '' && info.DRUPAL_ROOT != ''
     let INFO_FILE = info.DRUPAL_ROOT . '/modules/system/system.info'
     if filereadable(INFO_FILE)
       let info.CORE = s:CoreVersion(INFO_FILE)
     endif
+  elseif info.DRUPAL_ROOT == '' && info.CORE != ''  && exists('g:Drupal_dirs')
+    let info.DRUPAL_ROOT = get(g:Drupal_dirs, info.CORE, '')
   endif
 
   " @var b:Drupal_info
