diff --git a/bundle/vim-plugin-for-drupal/ftplugin/drupal.vim b/bundle/vim-plugin-for-drupal/ftplugin/drupal.vim index 9f6d2a4..ebeb905 100644 --- a/bundle/vim-plugin-for-drupal/ftplugin/drupal.vim +++ b/bundle/vim-plugin-for-drupal/ftplugin/drupal.vim @@ -25,6 +25,20 @@ if &ft =~ '\' && exists('loaded_syntastic_plugin') && executable('phpcs') \ . ' --extensions=php,module,inc,install,test,profile,theme' endif +" {{{ PHP specific settings. +" In ftdetect/drupal.vim we set ft=php.drupal. This means that the settings +" here will come after those set by the PHP ftplugins. In particular, we can +" override the 'comments' setting. + +if &ft =~ '\' + setl ignorecase "Ignore case in search + setl smartcase "Only ignore case when all letters are lowercase + " Format comment blocks. Just type / on a new line to close. + " Recognize // (but not #) style comments. + setl comments=sr:/**,m:*\ ,ex:*/,:// +endif +" }}} PHP specific settings. + augroup Drupal autocmd! BufEnter call s:BufEnter() augroup END @@ -104,8 +118,10 @@ endfun endif " !exists('*s:OpenURL') +" Add some menu items. + +let s:options = {'root': 'Drupal', 'special': ''} if strlen(b:Drupal_info.OPEN_COMMAND) - let s:options = {'root': 'Drupal', 'special': ''} " Lookup the API docs for a drupal function under cursor. nmap DrupalAPI :silent call OpenURL("api.d.o") @@ -128,17 +144,3 @@ nnoremap dv :execute "!drush vget ".shellescape(expand("dv', \ ':execute "!drush vget ".shellescape(expand(""), 1)', \ s:options) - -" {{{ PHP specific settings. -" In ftdetect/drupal.vim we set ft=php.drupal. This means that the settings -" here will come after those set by the PHP ftplugins. In particular, we can -" override the 'comments' setting. - -if &ft =~ '\' - setl ignorecase "Ignore case in search - setl smartcase "Only ignore case when all letters are lowercase - " Format comment blocks. Just type / on a new line to close. - " Recognize // (but not #) style comments. - setl comments=sr:/**,m:*\ ,ex:*/,:// -endif -" }}} PHP specific settings. diff --git a/bundle/vim-plugin-for-drupal/plugin/drupal.vim b/bundle/vim-plugin-for-drupal/plugin/drupal.vim index 19d1c33..4fbaf63 100644 --- a/bundle/vim-plugin-for-drupal/plugin/drupal.vim +++ b/bundle/vim-plugin-for-drupal/plugin/drupal.vim @@ -181,19 +181,18 @@ endfun " if strlen(open) | execute '!' . open . ' http://example.com' | endif " See http://www.dwheeler.com/essays/open-files-urls.html function! s:OpenCommand() -if has('macunix') && executable('open') - return 'open' -endif if has('win32unix') && executable('cygstart') return 'cygstart' -endif -if has('unix') && executable('xdg-open') +elseif has('unix') && executable('xdg-open') return 'xdg-open' -endif -if (has('win32') || has('win64')) && executable('cmd') +elseif (has('win32') || has('win64')) && executable('cmd') return 'cmd /c start' -endif +elseif (has('macunix') || has('unix') && system('uname') =~ 'Darwin') + \ && executable('open') + return 'open' +else return '' +endif endfun " {{{ @function s:CoreVersion(info_path)