Permalink
Browse files

Cleanup

Delete a whole lot of unused/uninteresting code and make a few tweaks.

This includes, among other things:
  - Symfony support.
  - Various syntax and indent files, copied from the built-ins for a
    small change.
  - Some of my own code, unfinished or unused.
  • Loading branch information...
AndrewRadev committed Jan 5, 2013
1 parent cdd5b2e commit b8bdf59f493c24c634e8ec6c85b0d8f02c15c879
Showing with 24 additions and 15,991 deletions.
  1. +1 −2 README.md
  2. +0 −282 autoload/symfony.vim
  3. +0 −29 compiler/php.vim
  4. +0 −68 compiler/ruby.vim
  5. +0 −21 compiler/vala.vim
  6. +0 −11,402 doc/css21.txt
  7. +0 −175 doc/ttags.txt
  8. +0 −2 ftdetect/rake.vim
  9. +0 −4 ftdetect/ruby.vim
  10. +0 −2 ftdetect/vala.vim
  11. +0 −1 ftplugin/coffee.vim
  12. +0 −33 ftplugin/css_word_text_object.vim
  13. +0 −12 ftplugin/less.vim
  14. +1 −1 ftplugin/php.vim
  15. +0 −1 ftplugin/postscr.vim
  16. +0 −1 ftplugin/rake.vim
  17. +1 −0 ftplugin/ruby.vim
  18. +0 −85 indent/haskell.vim
  19. +0 −300 indent/php.vim
  20. +0 −45 nerdtree_plugin/follow_current.vim
  21. +0 −1,111 plugin/cctree.vim
  22. +0 −23 projects/node_express.vim
  23. +0 −5 projects/rails.vim
  24. +0 −66 projects/symfony.vim
  25. 0 scripts/{generate-rails-gem-tags → generate-bundler-gem-tags}
  26. +0 −70 scripts/symfony/detect.vim
  27. +0 −12 scripts/symfony/extract.vim
  28. +0 −102 scripts/symfony/includeexpr.vim
  29. +0 −180 scripts/symfony/navigation.vim
  30. +0 −2 snippets/_.snippets
  31. +4 −4 snippets/eruby.snippets
  32. +0 −2 snippets/gitconfig.snippets
  33. +0 −1 snippets/haskell.snippets
  34. +3 −63 snippets/html.snippets
  35. +0 −4 snippets/postscr.snippets
  36. +0 −65 snippets/symfony.snippets
  37. +0 −16 snippets/vim.snippets
  38. +0 −40 snippets/yaml.snippets
  39. +0 −10 startup/autocommands.vim
  40. +2 −24 startup/commands.vim
  41. +9 −3 startup/mappings.vim
  42. +3 −8 startup/plugins.vim
  43. +0 −675 syntax/c.vim
  44. +0 −132 syntax/cabal.vim
  45. +0 −181 syntax/haskell.vim
  46. +0 −32 syntax/httplog.vim
  47. +0 −32 syntax/info.vim
  48. +0 −106 syntax/mkd.vim
  49. +0 −3 syntax/pandoc.vim
  50. +0 −350 syntax/python.vim
  51. +0 −174 syntax/vala.vim
  52. +0 −29 wip/autoload/rake.vim
View
@@ -46,8 +46,7 @@ Note that I have a rather loose definition of "currently".
The "[projects][]" directory holds "project" files. I use this in combination
with the [proj plugin][] to load some project-specific settings depending on
what I'm working on right now. The symfony project file might be my largest,
but it's abandoned, since I'm not writing PHP anymore.
what I'm working on right now.
## Nerdtree plugins
View
@@ -1,282 +0,0 @@
" File: symfony.vim
" Author: Andrew Radev
" Description: Functions to use in symfony projects. Mostly helpful in
" commands to navigate across the project. All the functions assume the
" default directory structure of a symfony project with the exception of the
" possibility to configure the web dir via `g:sf_web_dir`
" Last Modified: July 09, 2010
let s:PS = has('win32') ? '\\' : '/'
let s:capture_group = '\(.\{-}\)'
let s:anything = '.*'
if !exists('g:sf_web_dir')
let g:sf_web_dir = 'web'
endif
function! symfony#LoadData()
let g:sf_fixture_dict = {}
let g:sf_js_dict = {}
let g:sf_css_dict = {}
" Fixtures:
let rx = s:PS.s:capture_group.'$'
for path in split(glob('data/fixtures/*.yml'))
let fixture = lib#ExtractRx(path, rx, '\1')
let fixture_key = lib#ExtractRx(fixture, '^\d\+_'.s:capture_group.'\.yml$', '\1')
let g:sf_fixture_dict[fixture_key] = fixture
endfor
" Javascript files:
for path in split(glob(g:sf_web_dir.'/js/**/*.js'))
let fname = substitute(path, lib#RxPath(g:sf_web_dir, 'js').s:PS.s:capture_group.'.js', '\1', '')
let g:sf_js_dict[fname] = 1
endfor
" CSS files:
for path in split(glob(g:sf_web_dir.'/css/**/*.css'))
let fname = substitute(path, lib#RxPath(g:sf_web_dir, 'css').s:PS.s:capture_group.'.css', '\1', '')
let g:sf_css_dict[fname] = 1
endfor
endfunction
" Property retrieval functions
function! symfony#CurrentModuleName()
if exists('b:current_module_name')
return b:current_module_name
endif
let path = expand('%:p')
if path =~# 'test'.s:PS.'functional' " we're in a functional test
let rx = lib#RxPath('test', 'functional', s:anything, s:capture_group)
let rx .= 'ActionsTest\.php$'
else " we're somewhere in a specific application
let rx = lib#RxPath('modules', s:capture_group)
let rx .= s:PS
endif
if match(path, rx) == -1
let b:current_module_name = input("Enter module name: ", "", "customlist,symfony#CompleteModule")
else
let b:current_module_name = lib#ExtractRx(path, rx, '\1')
endif
return b:current_module_name
endfunction
function! symfony#CurrentAppName()
if exists('b:current_app_name')
return b:current_app_name
endif
let path = expand('%:p')
if path =~# 'test'.s:PS.'functional' " we're in a functional test
let rx = lib#RxPath('test', 'functional', s:capture_group)
let rx .= s:PS
else " we're somewhere in a specific application
let rx = lib#RxPath('apps', s:capture_group).s:PS
endif
if match(expand('%:p'), rx) == -1
let b:current_app_name = input("Enter app name: ", "", "customlist,symfony#CompleteApp")
else
let b:current_app_name = lib#ExtractRx(expand('%:p'), rx, '\1')
endif
return b:current_app_name
endfunction
function! symfony#CurrentActionName()
let path = expand('%:p')
if path =~# 'templates' " we're in a view or a component
let rx = lib#Wrap(s:PS, 'templates')
if path =~# 'Success\..*php$' " then it's a view
let rx .= s:capture_group.'Success\..*php$'
else
let rx .= '_'.s:capture_group.'\..*php$'
endif
if match(path, rx) == -1
return 'index' " A default value
endif
return lib#ExtractRx(path, rx, '\1')
else " we're in an action
let function_line = search('function', 'b')
if function_line == 0
return 'index' " A default value
else
let rx = 'function'
let rx .= '\s\+'
let rx .= 'execute'
let rx .= s:capture_group
let rx .= '\s*'
let rx .= '('
if match(getline(function_line), rx) == -1
return 'index' " A default value
endif
let result = lib#ExtractRx(getline(function_line), rx, '\l\1')
return result
endif
endif
endfunction
function! symfony#CurrentModelName()
let path = expand('%:p')
if match(path, 'test'.s:PS.'unit') != -1 " Then we're in a unit test
let b:current_model_name = lib#Capitalize(lib#ExtractRx(path, s:PS.s:capture_group.'Test.php$', '\1'))
return b:current_model_name
endif
let rx = lib#RxPath('lib', s:anything, 'doctrine', s:capture_group)
let rx .= '\(Table\|FormFilter\|Form\)\{,1}'
let rx .= '\.class\.php'
let rx .= '$'
if match(path, rx) == -1
let b:current_model_name = lib#Capitalize(input("Enter model name: ", "", "customlist,symfony#CompleteModel"))
else
let b:current_model_name = lib#ExtractRx(path, rx, '\1')
endif
return b:current_model_name
endfunction
" Path functions
function! symfony#TablePath(table)
let paths = glob('lib/model/**/'.a:table.'Table.class.php')
if paths != ''
return paths
else
return 'lib/model/doctrine/'.a:table.'Table.class.php'
endif
endfunction
function symfony#ParsePartialPath(path)
let match = split(a:path, '/')
if len(match) == 2
let [module, template] = match
else
let module = symfony#CurrentModuleName()
let template = match[0]
endif
return [module, template]
endfunction
function! symfony#TemplatePath(module, template)
let app = symfony#CurrentAppName()
if a:template[0] == '_'
let template = a:template.'.php'
else
let template = a:template.'Success.php'
endif
if a:module == 'global'
let path = 'apps/'.app.'/templates/'.template
else
let path = 'apps/'.app.'/modules/'.a:module.'/templates/'.template
endif
return path
endfunction
" Completion functions
function! symfony#CompleteApp(A, L, P)
let rx = s:PS.s:capture_group.'$'
let app_dict = {}
for path in split(glob('apps/*'))
let app = lib#ExtractRx(path, rx, '\1')
let app_dict[app] = 1
endfor
return sort(keys(filter(app_dict, "v:key =~'^".a:A."'")))
endfunction
function! symfony#CompleteModule(A, L, P)
let rx = s:PS.s:capture_group.'$'
if len(split(substitute(a:L, a:A.'$', '', ''))) == 2
let app_dict = {}
for path in split(glob('apps/*'))
let app = lib#ExtractRx(path, rx, '\1')
let app_dict[app] = 1
endfor
return sort(keys(filter(copy(app_dict), "v:key =~'^".a:A."'")))
else
let module_dict = {}
for path in split(glob('apps/*/modules/*'))
let module = lib#ExtractRx(path, rx, '\1')
let module_dict[module] = 1
endfor
return sort(keys(filter(module_dict, "v:key =~'^".a:A."'")))
endif
endfunction
function! symfony#CompleteModel(A, L, P)
let rx = s:PS
let rx .= s:capture_group
let rx .= 'Table\.class\.php'
let rx .= '$'
let model_dict = {}
for path in split(glob('lib/model/doctrine/*Table.class.php'))
let model = lib#ExtractRx(path, rx, '\1')
let model_dict[model] = 1
endfor
return sort(keys(filter(model_dict, "v:key =~'^".a:A."'")))
endfunction
function! symfony#CompleteUnitTest(A, L, P)
return symfony#CompleteModel(a:A, a:L, a:P)
endfunction
function! symfony#CompleteSchema(A, L, P)
let rx = s:PS.s:capture_group.'_schema.yml$'
let schema_dict = {}
for path in split(glob('config/doctrine/*_schema.yml'))
let schema = lib#ExtractRx(path, rx, '\1')
let schema_dict[schema] = 1
endfor
return sort(keys(filter(schema_dict, "v:key =~'^".a:A."'")))
endfunction
function! symfony#CompleteFixture(A, L, P)
return sort(keys(filter(copy(g:sf_fixture_dict), "v:key =~'^".a:A."'")))
endfunction
function! symfony#CompleteJs(A, L, P)
return sort(keys(filter(copy(g:sf_js_dict), "v:key =~'^".a:A."'")))
endfunction
function! symfony#CompleteCss(A, L, P)
return sort(keys(filter(copy(g:sf_css_dict), "v:key =~'^".a:A."'")))
endfunction
function! symfony#CompleteConfig(A, L, P)
let rx = s:PS.s:capture_group.'\.yml$'
let config_dict = {}
for path in split(glob('apps/*/config/*.yml'))
let config = lib#ExtractRx(path, rx, '\1')
let config_dict[config] = 1
endfor
return sort(keys(filter(config_dict, "v:key =~'^".a:A."'")))
endfunction
View
@@ -1,29 +0,0 @@
" Vim compiler file
" Compiler: PHP
" Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
" URL: http://gus.gscit.monash.edu.au/~djkea2/vim/compiler/php.vim
" Last Change: 2004 Nov 27
if exists("current_compiler")
finish
endif
let current_compiler = "php"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo-=C
CompilerSet makeprg=php\ -lq\ %:p
CompilerSet errorformat=
\%E<b>PHP\ Parse\ error</b>:\ %m\ in\ <b>%f</b>\ on\ line\ <b>%l</b><br\ />,
\%W<b>Notice</b>:\ %m\ in\ <b>%f</b>\ on\ line\ <b>%l</b><br\ />,
\%EPHP\ Parse\ error:\ %m\ in\ %f\ on\ line\ %l,
\%WNotice:\ %m\ in\ %f\ on\ line\ %l,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save
View
@@ -1,68 +0,0 @@
" Vim compiler file
" Language: Ruby
" Function: Syntax check and/or error reporting
" Maintainer: Tim Hammerquist <timh at rubyforge.org>
" Info: $Id: ruby.vim,v 1.13 2008/06/29 04:18:43 tpope Exp $
" URL: http://vim-ruby.rubyforge.org
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" ----------------------------------------------------------------------------
"
" Changelog:
" 0.2: script saves and restores 'cpoptions' value to prevent problems with
" line continuations
" 0.1: initial release
"
" Contributors:
" Hugh Sasse <hgs@dmu.ac.uk>
" Doug Kearns <djkea2@gus.gscit.monash.edu.au>
"
" Todo:
" match error type %m
"
" Comments:
" I know this file isn't perfect. If you have any questions, suggestions,
" patches, etc., please don't hesitate to let me know.
"
" This is my first experience with 'errorformat' and compiler plugins and
" I welcome any input from more experienced (or clearer-thinking)
" individuals.
" ----------------------------------------------------------------------------
if exists("current_compiler")
finish
endif
let current_compiler = "ruby"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo-=C
" default settings runs script normally
" add '-c' switch to run syntax check only:
"
" CompilerSet makeprg=ruby\ -wc\ $*
"
" or add '-c' at :make command line:
"
" :make -c %<CR>
"
CompilerSet makeprg=ruby\ -wc\ %
CompilerSet errorformat=
\%+E%f:%l:\ parse\ error,
\%W%f:%l:\ warning:\ %m,
\%E%f:%l:in\ %*[^:]:\ %m,
\%E%f:%l:\ %m,
\%-C%\tfrom\ %f:%l:in\ %.%#,
\%-Z%\tfrom\ %f:%l,
\%-Z%p^,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: nowrap sw=2 sts=2 ts=8:
Oops, something went wrong.

0 comments on commit b8bdf59

Please sign in to comment.