aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules36
-rw-r--r--Xresources50
-rw-r--r--bashrc69
-rw-r--r--config/i3/config237
-rwxr-xr-xconfig/i3/scripts/keyboard_layout2
-rwxr-xr-xconfig/i3/scripts/keyboard_switch14
-rw-r--r--config/i3blocks/config187
-rwxr-xr-xconfig/i3blocks/scripts/backup47
-rwxr-xr-xconfig/i3blocks/scripts/battery75
-rwxr-xr-xconfig/i3blocks/scripts/bbswitch9
-rwxr-xr-xconfig/i3blocks/scripts/email5
-rwxr-xr-xconfig/i3blocks/scripts/mpd10
-rw-r--r--config/i3status/config62
-rw-r--r--config/mpd/mpd.conf416
-rw-r--r--eaglerc164
-rw-r--r--gitconfig7
-rwxr-xr-xinstall61
-rwxr-xr-xlocal/bin/mxrandr119
-rwxr-xr-xlocal/bin/system-backup58
-rw-r--r--mutt/color88
-rw-r--r--mutt/muttemail7
-rw-r--r--mutt/muttfel7
-rw-r--r--mutt/muttgmail7
-rw-r--r--mutt/muttrc29
-rw-r--r--vim/.netrwhist4
-rw-r--r--vim/3rdparty/vim-pathogen/CONTRIBUTING.markdown14
-rw-r--r--vim/3rdparty/vim-pathogen/README.markdown141
-rw-r--r--vim/3rdparty/vim-pathogen/autoload/pathogen.vim353
-rw-r--r--vim/autoload/autoload/pathogen.vim353
-rw-r--r--vim/autoload/pathogen.vim347
-rw-r--r--vim/bundle/YouCompleteMe/.github/ISSUE_TEMPLATE.md39
-rw-r--r--vim/bundle/YouCompleteMe/.github/PULL_REQUEST_TEMPLATE.md20
-rw-r--r--vim/bundle/YouCompleteMe/.gitignore58
-rw-r--r--vim/bundle/YouCompleteMe/.gitmodules6
-rw-r--r--vim/bundle/YouCompleteMe/.travis.yml47
-rw-r--r--vim/bundle/YouCompleteMe/CODE_OF_CONDUCT.md50
-rw-r--r--vim/bundle/YouCompleteMe/CONTRIBUTING.md112
-rw-r--r--vim/bundle/YouCompleteMe/COPYING.txt674
-rw-r--r--vim/bundle/YouCompleteMe/README.md2920
-rw-r--r--vim/bundle/YouCompleteMe/appveyor.yml18
-rw-r--r--vim/bundle/YouCompleteMe/autoload/youcompleteme.vim889
-rwxr-xr-xvim/bundle/YouCompleteMe/ci/appveyor/appveyor_install.bat22
-rw-r--r--vim/bundle/YouCompleteMe/ci/travis/travis_install.linux.sh5
-rw-r--r--vim/bundle/YouCompleteMe/ci/travis/travis_install.osx.sh24
-rw-r--r--vim/bundle/YouCompleteMe/ci/travis/travis_install.sh61
-rw-r--r--vim/bundle/YouCompleteMe/doc/youcompleteme.txt3209
-rwxr-xr-xvim/bundle/YouCompleteMe/install.py44
-rwxr-xr-xvim/bundle/YouCompleteMe/install.sh17
-rw-r--r--vim/bundle/YouCompleteMe/plugin/youcompleteme.vim138
-rwxr-xr-xvim/bundle/YouCompleteMe/print_todos.sh8
-rw-r--r--vim/bundle/YouCompleteMe/python/test_requirements.txt6
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/__init__.py0
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/base.py175
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/client/__init__.py0
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/client/base_request.py244
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/client/command_request.py153
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/client/completer_available_request.py58
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/client/completion_request.py109
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/client/event_notification.py89
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/client/omni_completion_request.py71
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/client/tests/__init__.py0
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/client/tests/command_request_test.py283
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/client/tests/completion_request_test.py186
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/client/tests/omni_completion_request_tests.py81
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/client/ycmd_keepalive.py54
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/diagnostic_interface.py265
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/omni_completer.py123
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/paths.py135
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/setup.py53
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/syntax_parse.py224
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/test_utils.py201
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/tests/__init__.py0
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/tests/base_test.py270
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/tests/event_notification_test.py406
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/tests/omni_completer_test.py758
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/tests/paths_test.py78
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/tests/postcomplete_tests.py439
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/tests/syntax_parse_test.py310
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/tests/testdata/cpp_syntax160
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/tests/testdata/java_syntax231
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/tests/testdata/php_syntax1862
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/tests/testdata/python_syntax63
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/tests/vimsupport_test.py1434
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/tests/youcompleteme_test.py47
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/unsafe_thread_pool_executor.py120
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/vimsupport.py978
-rw-r--r--vim/bundle/YouCompleteMe/python/ycm/youcompleteme.py711
-rwxr-xr-xvim/bundle/YouCompleteMe/run_tests.py81
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/CHANGES44
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/LICENSE21
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/__init__.py3
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/__init__.py18
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py574
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_compat.py101
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/process.py363
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/thread.py138
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/crawl.py74
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/docs/conf.py194
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/docs/index.rst345
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/docs/make.bat112
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/futures/__init__.py24
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/futures/process.py1
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/futures/thread.py1
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/primes.py50
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/setup.cfg6
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/setup.py33
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/test_futures.py723
-rwxr-xr-xvim/bundle/YouCompleteMe/third_party/pythonfutures/tox.ini8
-rw-r--r--vim/bundle/YouCompleteMe/third_party/requests-futures/.gitignore4
-rw-r--r--vim/bundle/YouCompleteMe/third_party/requests-futures/.travis.yml11
-rw-r--r--vim/bundle/YouCompleteMe/third_party/requests-futures/LICENSE13
-rw-r--r--vim/bundle/YouCompleteMe/third_party/requests-futures/MANIFEST.in1
-rw-r--r--vim/bundle/YouCompleteMe/third_party/requests-futures/README.rst110
-rw-r--r--vim/bundle/YouCompleteMe/third_party/requests-futures/requests_futures/__init__.py28
-rw-r--r--vim/bundle/YouCompleteMe/third_party/requests-futures/requests_futures/sessions.py73
-rw-r--r--vim/bundle/YouCompleteMe/third_party/requests-futures/requirements-python-2.7.txt2
-rw-r--r--vim/bundle/YouCompleteMe/third_party/requests-futures/requirements-python-3.2.txt1
-rw-r--r--vim/bundle/YouCompleteMe/third_party/requests-futures/setup.py56
-rw-r--r--vim/bundle/YouCompleteMe/third_party/requests-futures/test_requests_futures.py84
-rw-r--r--vim/bundle/YouCompleteMe/third_party/retries/retries.py79
-rw-r--r--vim/bundle/YouCompleteMe/tox.ini4
-rw-r--r--vim/bundle/lightline.vim/.gitignore1
-rw-r--r--vim/bundle/lightline.vim/.travis.yml22
-rw-r--r--vim/bundle/lightline.vim/LICENSE21
-rw-r--r--vim/bundle/lightline.vim/README.md788
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline.vim485
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme.vim228
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/16color.vim46
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/PaperColor.vim12
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/PaperColor_dark.vim60
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/PaperColor_light.vim55
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow.vim41
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night.vim41
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night_Blue.vim43
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night_Bright.vim42
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night_Eighties.vim42
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/default.vim8
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/jellybeans.vim40
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/landscape.vim25
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/powerline.vim28
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/seoul256.vim42
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/solarized.vim11
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/solarized_dark.vim73
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/solarized_light.vim80
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colorscheme/wombat.vim40
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/colortable.vim42
-rw-r--r--vim/bundle/lightline.vim/autoload/lightline/tab.vim33
-rw-r--r--vim/bundle/lightline.vim/doc/lightline.txt1281
-rw-r--r--vim/bundle/lightline.vim/plugin/lightline.vim24
-rw-r--r--vim/bundle/lightline.vim/test/.themisrc20
-rw-r--r--vim/bundle/lightline.vim/test/concatenate.vim90
-rw-r--r--vim/bundle/lightline.vim/test/error.vim15
-rw-r--r--vim/bundle/lightline.vim/test/expand.vim612
-rw-r--r--vim/bundle/lightline.vim/test/highlight.vim171
-rw-r--r--vim/bundle/lightline.vim/test/link.vim131
-rw-r--r--vim/bundle/lightline.vim/test/mode.vim14
-rw-r--r--vim/bundle/lightline.vim/test/onetab.vim98
-rw-r--r--vim/bundle/lightline.vim/test/subseparator.vim302
-rw-r--r--vim/bundle/lightline.vim/test/tabline.vim67
-rw-r--r--vim/bundle/lightline.vim/test/tabs.vim99
-rw-r--r--vim/bundle/lightline.vim/test/toggle.vim37
-rw-r--r--vim/bundle/lightline.vim/test/uniq.vim46
-rw-r--r--vim/bundle/syntastic/.gitignore4
-rw-r--r--vim/bundle/syntastic/CONTRIBUTING.md105
-rw-r--r--vim/bundle/syntastic/LICENCE13
-rw-r--r--vim/bundle/syntastic/README.markdown480
-rw-r--r--vim/bundle/syntastic/_assets/screenshot_1.pngbin0 -> 92425 bytes
-rw-r--r--vim/bundle/syntastic/autoload/syntastic/c.vim341
-rw-r--r--vim/bundle/syntastic/autoload/syntastic/log.vim222
-rw-r--r--vim/bundle/syntastic/autoload/syntastic/postprocess.vim73
-rw-r--r--vim/bundle/syntastic/autoload/syntastic/preprocess.vim614
-rw-r--r--vim/bundle/syntastic/autoload/syntastic/util.vim552
-rw-r--r--vim/bundle/syntastic/doc/syntastic-checkers.txt6931
-rw-r--r--vim/bundle/syntastic/doc/syntastic.txt1128
-rw-r--r--vim/bundle/syntastic/plugin/syntastic.vim729
-rw-r--r--vim/bundle/syntastic/plugin/syntastic/autoloclist.vim38
-rw-r--r--vim/bundle/syntastic/plugin/syntastic/balloons.vim59
-rw-r--r--vim/bundle/syntastic/plugin/syntastic/checker.vim273
-rw-r--r--vim/bundle/syntastic/plugin/syntastic/cursor.vim138
-rw-r--r--vim/bundle/syntastic/plugin/syntastic/highlighting.vim104
-rw-r--r--vim/bundle/syntastic/plugin/syntastic/loclist.vim439
-rw-r--r--vim/bundle/syntastic/plugin/syntastic/modemap.vim117
-rw-r--r--vim/bundle/syntastic/plugin/syntastic/notifiers.vim86
-rw-r--r--vim/bundle/syntastic/plugin/syntastic/registry.vim375
-rw-r--r--vim/bundle/syntastic/plugin/syntastic/signs.vim138
-rw-r--r--vim/bundle/syntastic/syntax_checkers/actionscript/mxmlc.vim67
-rw-r--r--vim/bundle/syntastic/syntax_checkers/ada/gcc.vim47
-rw-r--r--vim/bundle/syntastic/syntax_checkers/ansible/ansible_lint.vim54
-rw-r--r--vim/bundle/syntastic/syntax_checkers/apiblueprint/drafter.vim66
-rw-r--r--vim/bundle/syntastic/syntax_checkers/applescript/osacompile.vim49
-rw-r--r--vim/bundle/syntastic/syntax_checkers/asciidoc/asciidoc.vim47
-rw-r--r--vim/bundle/syntastic/syntax_checkers/asm/gcc.vim61
-rw-r--r--vim/bundle/syntastic/syntax_checkers/bemhtml/bemhtmllint.vim35
-rw-r--r--vim/bundle/syntastic/syntax_checkers/bro/bro.vim58
-rw-r--r--vim/bundle/syntastic/syntax_checkers/c/avrgcc.vim57
-rw-r--r--vim/bundle/syntastic/syntax_checkers/c/checkpatch.vim60
-rw-r--r--vim/bundle/syntastic/syntax_checkers/c/clang_check.vim64
-rw-r--r--vim/bundle/syntastic/syntax_checkers/c/clang_tidy.vim64
-rw-r--r--vim/bundle/syntastic/syntax_checkers/c/cppcheck.vim62
-rw-r--r--vim/bundle/syntastic/syntax_checkers/c/gcc.vim59
-rw-r--r--vim/bundle/syntastic/syntax_checkers/c/make.vim61
-rw-r--r--vim/bundle/syntastic/syntax_checkers/c/oclint.vim65
-rw-r--r--vim/bundle/syntastic/syntax_checkers/c/pc_lint.vim66
-rw-r--r--vim/bundle/syntastic/syntax_checkers/c/sparse.vim48
-rw-r--r--vim/bundle/syntastic/syntax_checkers/c/splint.vim55
-rw-r--r--vim/bundle/syntastic/syntax_checkers/cabal/cabal.vim55
-rw-r--r--vim/bundle/syntastic/syntax_checkers/chef/foodcritic.vim39
-rw-r--r--vim/bundle/syntastic/syntax_checkers/co/coco.vim47
-rw-r--r--vim/bundle/syntastic/syntax_checkers/cobol/cobc.vim47
-rw-r--r--vim/bundle/syntastic/syntax_checkers/coffee/coffee.vim58
-rw-r--r--vim/bundle/syntastic/syntax_checkers/coffee/coffeelint.vim44
-rw-r--r--vim/bundle/syntastic/syntax_checkers/coq/coqtop.vim40
-rw-r--r--vim/bundle/syntastic/syntax_checkers/cpp/clang_check.vim22
-rw-r--r--vim/bundle/syntastic/syntax_checkers/cpp/clang_tidy.vim22
-rw-r--r--vim/bundle/syntastic/syntax_checkers/cpp/cppcheck.vim22
-rw-r--r--vim/bundle/syntastic/syntax_checkers/cpp/cpplint.vim52
-rw-r--r--vim/bundle/syntastic/syntax_checkers/cpp/gcc.vim56
-rw-r--r--vim/bundle/syntastic/syntax_checkers/cpp/oclint.vim22
-rw-r--r--vim/bundle/syntastic/syntax_checkers/cpp/pc_lint.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/cpp/verapp.vim48
-rw-r--r--vim/bundle/syntastic/syntax_checkers/cs/mcs.vim39
-rw-r--r--vim/bundle/syntastic/syntax_checkers/css/csslint.vim47
-rw-r--r--vim/bundle/syntastic/syntax_checkers/css/mixedindentlint.vim22
-rw-r--r--vim/bundle/syntastic/syntax_checkers/css/phpcs.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/css/prettycss.vim61
-rw-r--r--vim/bundle/syntastic/syntax_checkers/css/recess.vim24
-rw-r--r--vim/bundle/syntastic/syntax_checkers/css/stylelint.vim47
-rw-r--r--vim/bundle/syntastic/syntax_checkers/cucumber/cucumber.vim42
-rw-r--r--vim/bundle/syntastic/syntax_checkers/cuda/nvcc.vim81
-rw-r--r--vim/bundle/syntastic/syntax_checkers/d/dmd.vim132
-rw-r--r--vim/bundle/syntastic/syntax_checkers/dart/dartanalyzer.vim76
-rw-r--r--vim/bundle/syntastic/syntax_checkers/docbk/igor.vim55
-rw-r--r--vim/bundle/syntastic/syntax_checkers/docbk/xmllint.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/dockerfile/dockerfile_lint.vim53
-rw-r--r--vim/bundle/syntastic/syntax_checkers/dustjs/swiffer.vim38
-rw-r--r--vim/bundle/syntastic/syntax_checkers/elixir/elixir.vim56
-rwxr-xr-xvim/bundle/syntastic/syntax_checkers/erlang/erlang_check_file.erl95
-rw-r--r--vim/bundle/syntastic/syntax_checkers/erlang/escript.vim61
-rw-r--r--vim/bundle/syntastic/syntax_checkers/erlang/syntaxerl.vim42
-rw-r--r--vim/bundle/syntastic/syntax_checkers/eruby/ruby.vim82
-rw-r--r--vim/bundle/syntastic/syntax_checkers/fortran/gfortran.vim99
-rw-r--r--vim/bundle/syntastic/syntax_checkers/glsl/cgc.vim81
-rw-r--r--vim/bundle/syntastic/syntax_checkers/go/go.vim103
-rw-r--r--vim/bundle/syntastic/syntax_checkers/go/gofmt.vim45
-rw-r--r--vim/bundle/syntastic/syntax_checkers/go/golint.vim42
-rw-r--r--vim/bundle/syntastic/syntax_checkers/go/gometalinter.vim53
-rw-r--r--vim/bundle/syntastic/syntax_checkers/go/gotype.vim48
-rw-r--r--vim/bundle/syntastic/syntax_checkers/go/govet.vim48
-rw-r--r--vim/bundle/syntastic/syntax_checkers/haml/haml.vim46
-rw-r--r--vim/bundle/syntastic/syntax_checkers/haml/haml_lint.vim37
-rw-r--r--vim/bundle/syntastic/syntax_checkers/handlebars/handlebars.vim43
-rw-r--r--vim/bundle/syntastic/syntax_checkers/haskell/ghc-mod.vim94
-rw-r--r--vim/bundle/syntastic/syntax_checkers/haskell/hdevtools.vim56
-rw-r--r--vim/bundle/syntastic/syntax_checkers/haskell/hlint.vim41
-rw-r--r--vim/bundle/syntastic/syntax_checkers/haskell/scan.vim43
-rw-r--r--vim/bundle/syntastic/syntax_checkers/haxe/haxe.vim63
-rw-r--r--vim/bundle/syntastic/syntax_checkers/hss/hss.vim38
-rw-r--r--vim/bundle/syntastic/syntax_checkers/html/eslint.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/html/gjslint.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/html/jshint.vim50
-rw-r--r--vim/bundle/syntastic/syntax_checkers/html/textlint.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/html/tidy.vim212
-rw-r--r--vim/bundle/syntastic/syntax_checkers/html/validator.vim69
-rw-r--r--vim/bundle/syntastic/syntax_checkers/html/w3.vim62
-rw-r--r--vim/bundle/syntastic/syntax_checkers/jade/jade_lint.vim24
-rw-r--r--vim/bundle/syntastic/syntax_checkers/java/checkstyle.vim85
-rw-r--r--vim/bundle/syntastic/syntax_checkers/java/javac.vim427
-rw-r--r--vim/bundle/syntastic/syntax_checkers/javascript/closurecompiler.vim76
-rw-r--r--vim/bundle/syntastic/syntax_checkers/javascript/eslint.vim78
-rw-r--r--vim/bundle/syntastic/syntax_checkers/javascript/flow.vim67
-rw-r--r--vim/bundle/syntastic/syntax_checkers/javascript/gjslint.vim46
-rw-r--r--vim/bundle/syntastic/syntax_checkers/javascript/jscs.vim53
-rw-r--r--vim/bundle/syntastic/syntax_checkers/javascript/jshint.vim60
-rw-r--r--vim/bundle/syntastic/syntax_checkers/javascript/jsl.vim48
-rw-r--r--vim/bundle/syntastic/syntax_checkers/javascript/jslint.vim51
-rw-r--r--vim/bundle/syntastic/syntax_checkers/javascript/jsxhint.vim56
-rw-r--r--vim/bundle/syntastic/syntax_checkers/javascript/mixedindentlint.vim40
-rw-r--r--vim/bundle/syntastic/syntax_checkers/javascript/standard.vim55
-rw-r--r--vim/bundle/syntastic/syntax_checkers/javascript/tern_lint.vim53
-rw-r--r--vim/bundle/syntastic/syntax_checkers/json/jsonlint.vim43
-rw-r--r--vim/bundle/syntastic/syntax_checkers/json/jsonval.vim41
-rw-r--r--vim/bundle/syntastic/syntax_checkers/less/less-lint.coffee41
-rw-r--r--vim/bundle/syntastic/syntax_checkers/less/less-lint.js57
-rw-r--r--vim/bundle/syntastic/syntax_checkers/less/lessc.vim59
-rw-r--r--vim/bundle/syntastic/syntax_checkers/less/recess.vim44
-rw-r--r--vim/bundle/syntastic/syntax_checkers/lex/flex.vim50
-rw-r--r--vim/bundle/syntastic/syntax_checkers/limbo/limbo.vim46
-rw-r--r--vim/bundle/syntastic/syntax_checkers/lisp/clisp.vim57
-rw-r--r--vim/bundle/syntastic/syntax_checkers/llvm/llvm.vim39
-rw-r--r--vim/bundle/syntastic/syntax_checkers/lua/luac.vim65
-rw-r--r--vim/bundle/syntastic/syntax_checkers/lua/luacheck.vim67
-rw-r--r--vim/bundle/syntastic/syntax_checkers/markdown/mdl.vim45
-rw-r--r--vim/bundle/syntastic/syntax_checkers/markdown/textlint.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/matlab/mlint.vim41
-rw-r--r--vim/bundle/syntastic/syntax_checkers/mercury/mmc.vim49
-rw-r--r--vim/bundle/syntastic/syntax_checkers/nasm/nasm.vim41
-rw-r--r--vim/bundle/syntastic/syntax_checkers/nix/nix.vim45
-rw-r--r--vim/bundle/syntastic/syntax_checkers/nroff/igor.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/nroff/mandoc.vim41
-rw-r--r--vim/bundle/syntastic/syntax_checkers/objc/gcc.vim59
-rw-r--r--vim/bundle/syntastic/syntax_checkers/objc/oclint.vim22
-rw-r--r--vim/bundle/syntastic/syntax_checkers/objcpp/gcc.vim59
-rw-r--r--vim/bundle/syntastic/syntax_checkers/objcpp/oclint.vim22
-rw-r--r--vim/bundle/syntastic/syntax_checkers/ocaml/camlp4o.vim130
-rw-r--r--vim/bundle/syntastic/syntax_checkers/perl/perl.vim94
-rw-r--r--vim/bundle/syntastic/syntax_checkers/perl/perlcritic.vim52
-rw-r--r--vim/bundle/syntastic/syntax_checkers/perl/podchecker.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/php/php.vim52
-rw-r--r--vim/bundle/syntastic/syntax_checkers/php/phpcs.vim41
-rw-r--r--vim/bundle/syntastic/syntax_checkers/php/phplint.vim91
-rw-r--r--vim/bundle/syntastic/syntax_checkers/php/phpmd.vim77
-rw-r--r--vim/bundle/syntastic/syntax_checkers/po/msgfmt.vim50
-rw-r--r--vim/bundle/syntastic/syntax_checkers/pod/podchecker.vim51
-rw-r--r--vim/bundle/syntastic/syntax_checkers/pug/pug_lint.vim40
-rw-r--r--vim/bundle/syntastic/syntax_checkers/puppet/puppet.vim47
-rw-r--r--vim/bundle/syntastic/syntax_checkers/puppet/puppetlint.vim52
-rwxr-xr-xvim/bundle/syntastic/syntax_checkers/python/codec.py31
-rwxr-xr-xvim/bundle/syntastic/syntax_checkers/python/compile.py13
-rw-r--r--vim/bundle/syntastic/syntax_checkers/python/flake8.vim72
-rw-r--r--vim/bundle/syntastic/syntax_checkers/python/frosted.vim63
-rw-r--r--vim/bundle/syntastic/syntax_checkers/python/mypy.vim36
-rw-r--r--vim/bundle/syntastic/syntax_checkers/python/pep257.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/python/pep8.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/python/prospector.vim73
-rw-r--r--vim/bundle/syntastic/syntax_checkers/python/py3kwarn.vim36
-rw-r--r--vim/bundle/syntastic/syntax_checkers/python/pycodestyle.vim48
-rw-r--r--vim/bundle/syntastic/syntax_checkers/python/pydocstyle.vim66
-rw-r--r--vim/bundle/syntastic/syntax_checkers/python/pyflakes.vim74
-rw-r--r--vim/bundle/syntastic/syntax_checkers/python/pylama.vim79
-rw-r--r--vim/bundle/syntastic/syntax_checkers/python/pylint.vim98
-rw-r--r--vim/bundle/syntastic/syntax_checkers/python/python.vim57
-rw-r--r--vim/bundle/syntastic/syntax_checkers/qml/qmllint.vim39
-rw-r--r--vim/bundle/syntastic/syntax_checkers/r/lint.vim82
-rw-r--r--vim/bundle/syntastic/syntax_checkers/r/lintr.vim81
-rw-r--r--vim/bundle/syntastic/syntax_checkers/r/svtools.vim74
-rw-r--r--vim/bundle/syntastic/syntax_checkers/racket/code-ayatollah.vim62
-rw-r--r--vim/bundle/syntastic/syntax_checkers/racket/racket.vim51
-rw-r--r--vim/bundle/syntastic/syntax_checkers/rmd/lintr.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/rnc/rnv.vim38
-rw-r--r--vim/bundle/syntastic/syntax_checkers/rst/rst2pseudoxml.vim65
-rw-r--r--vim/bundle/syntastic/syntax_checkers/rst/rstcheck.vim50
-rw-r--r--vim/bundle/syntastic/syntax_checkers/rst/sphinx.vim80
-rw-r--r--vim/bundle/syntastic/syntax_checkers/ruby/flog.vim72
-rw-r--r--vim/bundle/syntastic/syntax_checkers/ruby/jruby.vim50
-rw-r--r--vim/bundle/syntastic/syntax_checkers/ruby/macruby.vim49
-rw-r--r--vim/bundle/syntastic/syntax_checkers/ruby/mri.vim82
-rw-r--r--vim/bundle/syntastic/syntax_checkers/ruby/reek.vim56
-rw-r--r--vim/bundle/syntastic/syntax_checkers/ruby/rubocop.vim57
-rw-r--r--vim/bundle/syntastic/syntax_checkers/ruby/rubylint.vim45
-rw-r--r--vim/bundle/syntastic/syntax_checkers/sass/sass.vim84
-rw-r--r--vim/bundle/syntastic/syntax_checkers/sass/sass_lint.vim51
-rw-r--r--vim/bundle/syntastic/syntax_checkers/sass/sassc.vim38
-rw-r--r--vim/bundle/syntastic/syntax_checkers/scala/fsc.vim48
-rw-r--r--vim/bundle/syntastic/syntax_checkers/scala/scalac.vim43
-rw-r--r--vim/bundle/syntastic/syntax_checkers/scala/scalastyle.vim77
-rw-r--r--vim/bundle/syntastic/syntax_checkers/scss/mixedindentlint.vim22
-rw-r--r--vim/bundle/syntastic/syntax_checkers/scss/sass.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/scss/sass_lint.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/scss/sassc.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/scss/scss_lint.vim64
-rw-r--r--vim/bundle/syntastic/syntax_checkers/scss/stylelint.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/sh/bashate.vim48
-rw-r--r--vim/bundle/syntastic/syntax_checkers/sh/checkbashisms.vim42
-rw-r--r--vim/bundle/syntastic/syntax_checkers/sh/sh.vim93
-rw-r--r--vim/bundle/syntastic/syntax_checkers/sh/shellcheck.vim66
-rw-r--r--vim/bundle/syntastic/syntax_checkers/slim/slim_lint.vim39
-rw-r--r--vim/bundle/syntastic/syntax_checkers/slim/slimrb.vim55
-rw-r--r--vim/bundle/syntastic/syntax_checkers/sml/smlnj.vim47
-rw-r--r--vim/bundle/syntastic/syntax_checkers/spec/rpmlint.vim43
-rw-r--r--vim/bundle/syntastic/syntax_checkers/sql/sqlint.vim50
-rw-r--r--vim/bundle/syntastic/syntax_checkers/stylus/stylint.vim43
-rw-r--r--vim/bundle/syntastic/syntax_checkers/tcl/nagelfar.vim44
-rw-r--r--vim/bundle/syntastic/syntax_checkers/tex/chktex.vim52
-rw-r--r--vim/bundle/syntastic/syntax_checkers/tex/lacheck.vim40
-rw-r--r--vim/bundle/syntastic/syntax_checkers/texinfo/makeinfo.vim47
-rw-r--r--vim/bundle/syntastic/syntax_checkers/text/atdtool.vim61
-rw-r--r--vim/bundle/syntastic/syntax_checkers/text/igor.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/text/language_check.vim37
-rw-r--r--vim/bundle/syntastic/syntax_checkers/text/textlint.vim42
-rw-r--r--vim/bundle/syntastic/syntax_checkers/trig/rapper.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/turtle/rapper.vim46
-rw-r--r--vim/bundle/syntastic/syntax_checkers/turtle/ttl.vim43
-rw-r--r--vim/bundle/syntastic/syntax_checkers/twig/twiglint.vim41
-rw-r--r--vim/bundle/syntastic/syntax_checkers/typescript/eslint.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/typescript/tsc.vim66
-rw-r--r--vim/bundle/syntastic/syntax_checkers/typescript/tslint.vim51
-rw-r--r--vim/bundle/syntastic/syntax_checkers/vala/valac.vim86
-rw-r--r--vim/bundle/syntastic/syntax_checkers/verilog/iverilog.vim38
-rw-r--r--vim/bundle/syntastic/syntax_checkers/verilog/verilator.vim42
-rw-r--r--vim/bundle/syntastic/syntax_checkers/vhdl/ghdl.vim38
-rw-r--r--vim/bundle/syntastic/syntax_checkers/vhdl/vcom.vim55
-rw-r--r--vim/bundle/syntastic/syntax_checkers/vim/vimlint.vim108
-rw-r--r--vim/bundle/syntastic/syntax_checkers/vim/vint.vim55
-rw-r--r--vim/bundle/syntastic/syntax_checkers/xhtml/jshint.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/xhtml/tidy.vim92
-rw-r--r--vim/bundle/syntastic/syntax_checkers/xml/plutil.vim42
-rw-r--r--vim/bundle/syntastic/syntax_checkers/xml/xmllint.vim54
-rw-r--r--vim/bundle/syntastic/syntax_checkers/xquery/basex.vim51
-rw-r--r--vim/bundle/syntastic/syntax_checkers/xslt/xmllint.vim23
-rw-r--r--vim/bundle/syntastic/syntax_checkers/yacc/bison.vim55
-rw-r--r--vim/bundle/syntastic/syntax_checkers/yaml/jsyaml.vim48
-rw-r--r--vim/bundle/syntastic/syntax_checkers/yaml/yamllint.vim52
-rw-r--r--vim/bundle/syntastic/syntax_checkers/yaml/yamlxs.vim72
-rw-r--r--vim/bundle/syntastic/syntax_checkers/yang/pyang.vim46
-rw-r--r--vim/bundle/syntastic/syntax_checkers/z80/z80syntaxchecker.vim39
-rw-r--r--vim/bundle/syntastic/syntax_checkers/zpt/zptlint.vim42
-rw-r--r--vim/bundle/syntastic/syntax_checkers/zsh/zsh.vim38
-rw-r--r--vim/bundle/tagbar/.gitattributes4
-rw-r--r--vim/bundle/tagbar/.gitignore1
-rw-r--r--vim/bundle/tagbar/.info2
-rw-r--r--vim/bundle/tagbar/LICENSE82
-rw-r--r--vim/bundle/tagbar/README.md89
-rw-r--r--vim/bundle/tagbar/autoload/tagbar.vim4268
-rw-r--r--vim/bundle/tagbar/doc/tagbar.txt1508
-rw-r--r--vim/bundle/tagbar/plugin/tagbar.vim146
-rw-r--r--vim/bundle/tagbar/syntax/tagbar.vim63
-rw-r--r--vim/bundle/tlib_vim/.gitignore10
-rw-r--r--vim/bundle/tlib_vim/CHANGES.TXT755
-rw-r--r--vim/bundle/tlib_vim/LICENSE.TXT674
-rw-r--r--vim/bundle/tlib_vim/README21
-rw-r--r--vim/bundle/tlib_vim/addon-info.json9
-rw-r--r--vim/bundle/tlib_vim/autoload/tinykeymap/map/para_move.vim12
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib.vim8
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/Filter_cnf.vim151
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/Filter_cnfd.vim53
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/Filter_fuzzy.vim83
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/Filter_glob.vim68
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/Object.vim154
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/Test.vim19
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/TestChild.vim19
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/World.vim1404
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/agent.vim665
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/arg.vim338
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/assert.vim44
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/autocmdgroup.vim14
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/balloon.vim73
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/bitwise.vim141
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/buffer.vim401
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/cache.vim360
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/char.vim59
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/cmd.vim117
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/comments.vim26
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/date.vim189
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/dictionary.vim45
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/dir.vim93
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/eval.vim72
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/file.vim283
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/fixes.vim14
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/grep.vim38
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/hash.vim145
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/hook.vim25
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/input.vim1336
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/list.vim194
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/loclist.vim13
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/map.vim23
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/normal.vim34
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/notify.vim113
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/number.vim30
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/paragraph.vim97
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/persistent.vim47
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/progressbar.vim72
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/qfl.vim312
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/rx.vim60
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/scratch.vim136
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/selection.vim40
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/signs.vim103
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/string.vim172
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/syntax.vim38
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/sys.vim212
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/tab.vim49
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/tag.vim132
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/textobjects.vim45
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/time.vim67
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/trace.vim159
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/type.vim126
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/url.vim52
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/var.vim83
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/vcs.vim189
-rw-r--r--vim/bundle/tlib_vim/autoload/tlib/vim.vim152
-rwxr-xr-xvim/bundle/tlib_vim/autoload/tlib/win.vim128
-rwxr-xr-xvim/bundle/tlib_vim/doc/tlib.txt2559
-rw-r--r--vim/bundle/tlib_vim/etc/tpl_tlib.txt30
-rw-r--r--vim/bundle/tlib_vim/macros/tlib.vim38
-rwxr-xr-xvim/bundle/tlib_vim/plugin/02tlib.vim106
-rw-r--r--vim/bundle/tlib_vim/samples/tlib/input/tlib_input_list.vim50
-rw-r--r--vim/bundle/tlib_vim/scripts/create_crc_table.rb67
-rwxr-xr-xvim/bundle/tlib_vim/spec/tlib/arg.vim66
-rw-r--r--vim/bundle/tlib_vim/spec/tlib/date.vim61
-rw-r--r--vim/bundle/tlib_vim/spec/tlib/dictionary.vim28
-rw-r--r--vim/bundle/tlib_vim/spec/tlib/eval.vim27
-rwxr-xr-xvim/bundle/tlib_vim/spec/tlib/file.vim59
-rw-r--r--vim/bundle/tlib_vim/spec/tlib/hash.vim58
-rwxr-xr-xvim/bundle/tlib_vim/spec/tlib/input.vim127
-rwxr-xr-xvim/bundle/tlib_vim/spec/tlib/list.vim67
-rwxr-xr-xvim/bundle/tlib_vim/spec/tlib/rx.vim27
-rwxr-xr-xvim/bundle/tlib_vim/spec/tlib/string.vim29
-rwxr-xr-xvim/bundle/tlib_vim/spec/tlib/url.vim23
-rwxr-xr-xvim/bundle/tlib_vim/spec/tlib/var.vim37
-rw-r--r--vim/bundle/vim-addon-mw-utils/.gitignore1
-rw-r--r--vim/bundle/vim-addon-mw-utils/autoload/buf_utils.vim24
-rw-r--r--vim/bundle/vim-addon-mw-utils/autoload/cached_file_contents.vim104
-rw-r--r--vim/bundle/vim-addon-mw-utils/autoload/env_reload.vim12
-rw-r--r--vim/bundle/vim-addon-mw-utils/autoload/funcref.vim95
-rw-r--r--vim/bundle/vim-addon-mw-utils/autoload/glob.vim27
-rw-r--r--vim/bundle/vim-addon-mw-utils/autoload/tiny_cmd.vim19
-rw-r--r--vim/bundle/vim-addon-mw-utils/autoload/tovl/scratch_buffer.vim103
-rw-r--r--vim/bundle/vim-addon-mw-utils/autoload/tovl/ui/filter_list.vim473
-rw-r--r--vim/bundle/vim-addon-mw-utils/doc/cached_file_contents.txt7
-rw-r--r--vim/bundle/vim-addon-mw-utils/doc/funcref.txt35
-rw-r--r--vim/bundle/vim-addon-mw-utils/doc/tiny_cmd.txt18
-rw-r--r--vim/bundle/vim-addon-mw-utils/vim-addon-mw-utils-addon-info.txt9
-rw-r--r--vim/bundle/vim-fugitive/.gitignore1
-rw-r--r--vim/bundle/vim-fugitive/CONTRIBUTING.markdown18
-rw-r--r--vim/bundle/vim-fugitive/README.markdown118
-rw-r--r--vim/bundle/vim-fugitive/doc/fugitive.txt357
-rw-r--r--vim/bundle/vim-fugitive/plugin/fugitive.vim3096
-rw-r--r--vim/bundle/vim-gitgutter/.gitignore5
-rw-r--r--vim/bundle/vim-gitgutter/README.mkd499
-rw-r--r--vim/bundle/vim-gitgutter/autoload/gitgutter.vim253
-rw-r--r--vim/bundle/vim-gitgutter/autoload/gitgutter/async.vim196
-rw-r--r--vim/bundle/vim-gitgutter/autoload/gitgutter/debug.vim119
-rw-r--r--vim/bundle/vim-gitgutter/autoload/gitgutter/diff.vim342
-rw-r--r--vim/bundle/vim-gitgutter/autoload/gitgutter/highlight.vim115
-rw-r--r--vim/bundle/vim-gitgutter/autoload/gitgutter/hunk.vim137
-rw-r--r--vim/bundle/vim-gitgutter/autoload/gitgutter/sign.vim173
-rw-r--r--vim/bundle/vim-gitgutter/autoload/gitgutter/utility.vim199
-rw-r--r--vim/bundle/vim-gitgutter/doc/gitgutter.txt340
-rw-r--r--vim/bundle/vim-gitgutter/plugin/gitgutter.vim224
-rw-r--r--vim/bundle/vim-gitgutter/screenshot.pngbin0 -> 16191 bytes
-rw-r--r--vim/bundle/vim-gitgutter/test/=fixture=.txt0
-rw-r--r--vim/bundle/vim-gitgutter/test/README.markdown30
-rw-r--r--vim/bundle/vim-gitgutter/test/addLines.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/addLinesFish.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/ambiguousFile.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/fileAddedToGit.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/filenameWithEquals.expected5
-rw-r--r--vim/bundle/vim-gitgutter/test/filenameWithSquareBrackets.expected5
-rw-r--r--vim/bundle/vim-gitgutter/test/fix[tu]re.txt0
-rw-r--r--vim/bundle/vim-gitgutter/test/fixture.txt11
-rw-r--r--vim/bundle/vim-gitgutter/test/followSymlink.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/helper.vim27
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopStageGitDiffStaged.expected0
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopUndoGitDiffStaged.expected0
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkOutsideNoopStageSigns.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkOutsideNoopUndoSigns.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkStageGitDiff.expected13
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiff.expected13
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiffStaged.expected12
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkStageNearbySigns.expected6
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkStageSigns.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkUndoGitDiff.expected0
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkUndoNearbyGitDiff.expected13
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkUndoNearbySigns.expected6
-rw-r--r--vim/bundle/vim-gitgutter/test/hunkUndoSigns.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/keepAlt.expected3
-rw-r--r--vim/bundle/vim-gitgutter/test/keepModified.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/keepOpMarks.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/modifyLines.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/noModifications.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/orphanedSigns.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/removeFirstLines.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/removeLines.expected4
-rw-r--r--vim/bundle/vim-gitgutter/test/signColumnAlways.expected4
-rwxr-xr-xvim/bundle/vim-gitgutter/test/test50
-rw-r--r--vim/bundle/vim-gitgutter/test/testAddLines.vim6
-rw-r--r--vim/bundle/vim-gitgutter/test/testAddLinesFish.vim7
-rw-r--r--vim/bundle/vim-gitgutter/test/testEditAmbiguousFile.vim9
-rw-r--r--vim/bundle/vim-gitgutter/test/testFileAddedToGit.vim12
-rw-r--r--vim/bundle/vim-gitgutter/test/testFilenameWithEquals.vim12
-rw-r--r--vim/bundle/vim-gitgutter/test/testFilenameWithSquareBrackets.vim9
-rw-r--r--vim/bundle/vim-gitgutter/test/testFollowSymlink.vim10
-rw-r--r--vim/bundle/vim-gitgutter/test/testHunkOutsideNoop.vim13
-rw-r--r--vim/bundle/vim-gitgutter/test/testHunkStage.vim7
-rw-r--r--vim/bundle/vim-gitgutter/test/testHunkStageNearbyHunk.vim10
-rw-r--r--vim/bundle/vim-gitgutter/test/testHunkUndo.vim7
-rw-r--r--vim/bundle/vim-gitgutter/test/testHunkUndoNearbyHunk.vim9
-rw-r--r--vim/bundle/vim-gitgutter/test/testKeepAlt.vim12
-rw-r--r--vim/bundle/vim-gitgutter/test/testKeepModified.vim8
-rw-r--r--vim/bundle/vim-gitgutter/test/testKeepOpMarks.vim10
-rw-r--r--vim/bundle/vim-gitgutter/test/testModifyLines.vim6
-rw-r--r--vim/bundle/vim-gitgutter/test/testNoModifications.vim4
-rw-r--r--vim/bundle/vim-gitgutter/test/testOrphanedSigns.vim8
-rw-r--r--vim/bundle/vim-gitgutter/test/testRemoveFirstLines.vim6
-rw-r--r--vim/bundle/vim-gitgutter/test/testRemoveLines.vim6
-rw-r--r--vim/bundle/vim-gitgutter/test/testSignColumnAlways.vim7
-rw-r--r--vim/bundle/vim-gitgutter/test/testUntrackedFileOutsideRepo.vim6
-rw-r--r--vim/bundle/vim-gitgutter/test/testUntrackedFileSquareBracketsWithinRepo.vim10
-rw-r--r--vim/bundle/vim-gitgutter/test/testUntrackedFileWithinRepo.vim10
-rw-r--r--vim/bundle/vim-gitgutter/test/untrackedFileOutsideRepo.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/untrackedFileSquareBracketsWithinRepo.expected2
-rw-r--r--vim/bundle/vim-gitgutter/test/untrackedFileWithinRepo.expected2
-rw-r--r--vim/bundle/vim-snipmate/.gitignore3
-rw-r--r--vim/bundle/vim-snipmate/Contributors.md52
-rw-r--r--vim/bundle/vim-snipmate/README.md169
-rw-r--r--vim/bundle/vim-snipmate/addon-info.json12
-rw-r--r--vim/bundle/vim-snipmate/after/plugin/snipMate.vim46
-rw-r--r--vim/bundle/vim-snipmate/autoload/snipMate.vim603
-rw-r--r--vim/bundle/vim-snipmate/autoload/snipMate_python_demo.vim47
-rw-r--r--vim/bundle/vim-snipmate/autoload/snipmate/jumping.vim228
-rw-r--r--vim/bundle/vim-snipmate/autoload/snipmate/legacy.vim139
-rw-r--r--vim/bundle/vim-snipmate/autoload/snipmate/parse.vim309
-rw-r--r--vim/bundle/vim-snipmate/autoload/snipmate/util.vim30
-rw-r--r--vim/bundle/vim-snipmate/doc/SnipMate.txt646
-rw-r--r--vim/bundle/vim-snipmate/ftplugin/html_snip_helper.vim10
-rw-r--r--vim/bundle/vim-snipmate/ftplugin/snippets.vim20
-rw-r--r--vim/bundle/vim-snipmate/indent/snippets.vim32
-rw-r--r--vim/bundle/vim-snipmate/plugin/snipMate.vim137
-rw-r--r--vim/bundle/vim-snipmate/syntax/snippet.vim11
-rw-r--r--vim/bundle/vim-snipmate/syntax/snippets.vim23
-rw-r--r--vim/bundle/vim-snipmate/t/jumping.vim175
-rw-r--r--vim/bundle/vim-snipmate/t/parser.vim142
-rwxr-xr-xvim/bundle/vim-snipmate/t/tests.sh20
-rw-r--r--vim/bundle/vim-snippets/.gitignore1
-rw-r--r--vim/bundle/vim-snippets/.travis.yml8
-rw-r--r--vim/bundle/vim-snippets/LICENSE20
-rw-r--r--vim/bundle/vim-snippets/README.md252
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/README17
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/ada.snippets280
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/all.snippets76
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/bib.snippets52
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/bindzone.snippets29
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/c.snippets99
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/coffee-jasmine.snippets166
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/coffee-react.snippets80
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/coffee.snippets100
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/cpp.snippets73
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/cs.snippets328
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/css.snippets499
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/d.snippets584
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/django.snippets361
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/eelixir.snippets39
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/erlang.snippets108
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/eruby.snippets237
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/go.snippets115
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/help.snippets37
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/html.snippets306
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/html_minimal.snippets33
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/htmldjango.snippets299
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/htmljinja.snippets3
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/java.snippets435
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/javascript-angular.snippets77
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/javascript-ember.snippets90
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/javascript-jasmine.snippets218
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/javascript-jsdoc.snippets51
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/javascript-node.snippets65
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/javascript-openui5.snippets205
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/javascript.snippets171
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/jinja2.snippets209
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/json.snippets51
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/julia.snippets34
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/ledger.snippets7
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/lhaskell.snippets3
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/lua.snippets98
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/mako.snippets92
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/markdown.snippets53
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/objc.snippets272
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/ocaml.snippets174
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/pandoc.snippets12
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/perl.snippets139
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/php-laravel.snippets270
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/php-phpspec.snippets222
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/php-symfony2.snippets360
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/php.snippets251
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/proto.snippets52
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/puppet.snippets235
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/python.snippets707
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/r.snippets178
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/rails.snippets894
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/rnoweb.snippets3
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/rst.snippets293
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/ruby.snippets353
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/rust.snippets106
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/sh.snippets99
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/snippets.snippets21
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/soy.snippets63
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/supercollider.snippets10
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/tcl.snippets52
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/tex.snippets121
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/texmath.snippets56
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/typescript.snippets3
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/vim.snippets24
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/xhtml.snippets3
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/xml.snippets16
-rw-r--r--vim/bundle/vim-snippets/UltiSnips/zsh.snippets17
-rw-r--r--vim/bundle/vim-snippets/addon-info.json9
-rw-r--r--vim/bundle/vim-snippets/autoload/vim_snippets.vim27
-rw-r--r--vim/bundle/vim-snippets/plugin/vimsnippets.vim50
-rw-r--r--vim/bundle/vim-snippets/pythonx/vimsnippets.py92
-rw-r--r--vim/bundle/vim-snippets/snippets/_.snippets281
-rw-r--r--vim/bundle/vim-snippets/snippets/actionscript.snippets153
-rw-r--r--vim/bundle/vim-snippets/snippets/ada.snippets217
-rw-r--r--vim/bundle/vim-snippets/snippets/apache.snippets35
-rw-r--r--vim/bundle/vim-snippets/snippets/arduino.snippets106
-rw-r--r--vim/bundle/vim-snippets/snippets/autoit.snippets66
-rw-r--r--vim/bundle/vim-snippets/snippets/awk.snippets102
-rw-r--r--vim/bundle/vim-snippets/snippets/c.snippets228
-rw-r--r--vim/bundle/vim-snippets/snippets/chef.snippets204
-rw-r--r--vim/bundle/vim-snippets/snippets/clojure.snippets87
-rw-r--r--vim/bundle/vim-snippets/snippets/cmake.snippets83
-rw-r--r--vim/bundle/vim-snippets/snippets/codeigniter.snippets171
-rw-r--r--vim/bundle/vim-snippets/snippets/coffee/angular_coffee.snippets116
-rw-r--r--vim/bundle/vim-snippets/snippets/coffee/coffee.snippets101
-rw-r--r--vim/bundle/vim-snippets/snippets/coffee/jquery_coffee.snippets524
-rw-r--r--vim/bundle/vim-snippets/snippets/coffee/requirejs_coffee.snippets11
-rw-r--r--vim/bundle/vim-snippets/snippets/cpp.snippets154
-rw-r--r--vim/bundle/vim-snippets/snippets/cs.snippets470
-rw-r--r--vim/bundle/vim-snippets/snippets/css.snippets987
-rw-r--r--vim/bundle/vim-snippets/snippets/d.snippets338
-rw-r--r--vim/bundle/vim-snippets/snippets/dart.snippets82
-rw-r--r--vim/bundle/vim-snippets/snippets/diff.snippets11
-rw-r--r--vim/bundle/vim-snippets/snippets/django.snippets112
-rw-r--r--vim/bundle/vim-snippets/snippets/dosini.snippets12
-rw-r--r--vim/bundle/vim-snippets/snippets/eelixir.snippets34
-rw-r--r--vim/bundle/vim-snippets/snippets/elixir.snippets136
-rw-r--r--vim/bundle/vim-snippets/snippets/elm.snippets50
-rw-r--r--vim/bundle/vim-snippets/snippets/erlang.snippets706
-rw-r--r--vim/bundle/vim-snippets/snippets/eruby.snippets131
-rw-r--r--vim/bundle/vim-snippets/snippets/falcon.snippets71
-rw-r--r--vim/bundle/vim-snippets/snippets/fortran.snippets93
-rw-r--r--vim/bundle/vim-snippets/snippets/go.snippets234
-rw-r--r--vim/bundle/vim-snippets/snippets/haml.snippets37
-rw-r--r--vim/bundle/vim-snippets/snippets/haskell.snippets115
-rw-r--r--vim/bundle/vim-snippets/snippets/html.snippets879
-rw-r--r--vim/bundle/vim-snippets/snippets/htmldjango.snippets142
-rw-r--r--vim/bundle/vim-snippets/snippets/htmltornado.snippets55
-rw-r--r--vim/bundle/vim-snippets/snippets/jade.snippets18
-rw-r--r--vim/bundle/vim-snippets/snippets/java.snippets287
-rw-r--r--vim/bundle/vim-snippets/snippets/javascript-mocha.snippets14
-rw-r--r--vim/bundle/vim-snippets/snippets/javascript/javascript-jquery.snippets589
-rw-r--r--vim/bundle/vim-snippets/snippets/javascript/javascript-requirejs.snippets14
-rw-r--r--vim/bundle/vim-snippets/snippets/javascript/javascript.d3.snippets30
-rw-r--r--vim/bundle/vim-snippets/snippets/javascript/javascript.es6.snippets28
-rw-r--r--vim/bundle/vim-snippets/snippets/javascript/javascript.node.snippets51
-rw-r--r--vim/bundle/vim-snippets/snippets/javascript/javascript.snippets281
-rw-r--r--vim/bundle/vim-snippets/snippets/jinja.snippets142
-rw-r--r--vim/bundle/vim-snippets/snippets/jsp.snippets99
-rw-r--r--vim/bundle/vim-snippets/snippets/julia.snippets102
-rw-r--r--vim/bundle/vim-snippets/snippets/laravel.snippets242
-rw-r--r--vim/bundle/vim-snippets/snippets/ledger.snippets5
-rw-r--r--vim/bundle/vim-snippets/snippets/ls.snippets108
-rw-r--r--vim/bundle/vim-snippets/snippets/lua.snippets21
-rw-r--r--vim/bundle/vim-snippets/snippets/make.snippets50
-rw-r--r--vim/bundle/vim-snippets/snippets/mako.snippets54
-rw-r--r--vim/bundle/vim-snippets/snippets/markdown.snippets139
-rw-r--r--vim/bundle/vim-snippets/snippets/mustache.snippets18
-rw-r--r--vim/bundle/vim-snippets/snippets/objc.snippets247
-rw-r--r--vim/bundle/vim-snippets/snippets/openfoam.snippets53
-rw-r--r--vim/bundle/vim-snippets/snippets/perl.snippets359
-rw-r--r--vim/bundle/vim-snippets/snippets/perl6.snippets116
-rw-r--r--vim/bundle/vim-snippets/snippets/php.snippets661
-rw-r--r--vim/bundle/vim-snippets/snippets/plsql.snippets109
-rw-r--r--vim/bundle/vim-snippets/snippets/po.snippets5
-rwxr-xr-xvim/bundle/vim-snippets/snippets/processing.snippets705
-rw-r--r--vim/bundle/vim-snippets/snippets/progress.snippets58
-rw-r--r--vim/bundle/vim-snippets/snippets/puppet.snippets269
-rw-r--r--vim/bundle/vim-snippets/snippets/python.snippets242
-rw-r--r--vim/bundle/vim-snippets/snippets/r.snippets131
-rw-r--r--vim/bundle/vim-snippets/snippets/rails.snippets490
-rw-r--r--vim/bundle/vim-snippets/snippets/rst.snippets98
-rw-r--r--vim/bundle/vim-snippets/snippets/ruby.snippets731
-rw-r--r--vim/bundle/vim-snippets/snippets/rust.snippets186
-rw-r--r--vim/bundle/vim-snippets/snippets/sass.snippets36
-rw-r--r--vim/bundle/vim-snippets/snippets/scala.snippets360
-rw-r--r--vim/bundle/vim-snippets/snippets/scheme.snippets36
-rw-r--r--vim/bundle/vim-snippets/snippets/scss.snippets44
-rw-r--r--vim/bundle/vim-snippets/snippets/sh.snippets99
-rw-r--r--vim/bundle/vim-snippets/snippets/simplemvcf.snippets122
-rw-r--r--vim/bundle/vim-snippets/snippets/slim.snippets63
-rw-r--r--vim/bundle/vim-snippets/snippets/snippets.snippets11
-rw-r--r--vim/bundle/vim-snippets/snippets/sql.snippets26
-rw-r--r--vim/bundle/vim-snippets/snippets/stylus.snippets993
-rw-r--r--vim/bundle/vim-snippets/snippets/supercollider.snippets22
-rw-r--r--vim/bundle/vim-snippets/snippets/systemverilog.snippets73
-rw-r--r--vim/bundle/vim-snippets/snippets/tcl.snippets96
-rw-r--r--vim/bundle/vim-snippets/snippets/tex.snippets317
-rw-r--r--vim/bundle/vim-snippets/snippets/textile.snippets30
-rw-r--r--vim/bundle/vim-snippets/snippets/twig.snippets34
-rw-r--r--vim/bundle/vim-snippets/snippets/verilog.snippets63
-rw-r--r--vim/bundle/vim-snippets/snippets/vim.snippets52
-rw-r--r--vim/bundle/vim-snippets/snippets/xml.snippets12
-rw-r--r--vim/bundle/vim-snippets/snippets/xslt.snippets97
-rw-r--r--vim/bundle/vim-snippets/snippets/yii-chtml.snippets248
-rw-r--r--vim/bundle/vim-snippets/snippets/yii.snippets300
-rw-r--r--vim/bundle/vim-snippets/snippets/zsh.snippets66
-rwxr-xr-xvim/bundle/vim-snippets/tests.sh15
-rw-r--r--vim/bundle/vim-table-mode/.gitignore2
-rw-r--r--vim/bundle/vim-table-mode/.travis.yml4
-rw-r--r--vim/bundle/vim-table-mode/CHANGELOG.md144
-rw-r--r--vim/bundle/vim-table-mode/Gemfile5
-rw-r--r--vim/bundle/vim-table-mode/Gemfile.lock18
-rw-r--r--vim/bundle/vim-table-mode/README.md248
-rw-r--r--vim/bundle/vim-table-mode/Rakefile13
-rw-r--r--vim/bundle/vim-table-mode/VimFlavor.lock1
-rw-r--r--vim/bundle/vim-table-mode/autoload/tablemode.vim195
-rw-r--r--vim/bundle/vim-table-mode/autoload/tablemode/align.vim134
-rw-r--r--vim/bundle/vim-table-mode/autoload/tablemode/logger.vim5
-rw-r--r--vim/bundle/vim-table-mode/autoload/tablemode/spreadsheet.vim189
-rw-r--r--vim/bundle/vim-table-mode/autoload/tablemode/spreadsheet/cell.vim258
-rw-r--r--vim/bundle/vim-table-mode/autoload/tablemode/spreadsheet/formula.vim122
-rw-r--r--vim/bundle/vim-table-mode/autoload/tablemode/table.vim198
-rw-r--r--vim/bundle/vim-table-mode/autoload/tablemode/utils.vim49
-rw-r--r--vim/bundle/vim-table-mode/doc/table-mode.txt444
-rw-r--r--vim/bundle/vim-table-mode/plugin/table-mode.vim132
-rw-r--r--vim/bundle/vim-table-mode/t/align.vim20
-rw-r--r--vim/bundle/vim-table-mode/t/cell.vim135
-rw-r--r--vim/bundle/vim-table-mode/t/config/options.vim27
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/align/simple_after.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/align/simple_before.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/align/unicode_after.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/align/unicode_before.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/cell/sample.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/formula/formula.txt7
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/formula/sample.txt7
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/sample.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header.txt3
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header_unicode.txt9
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_after.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_before.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_after.txt8
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_before.txt8
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_after.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_before.txt2
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_after.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_before.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/table/sample_with_header.txt7
-rw-r--r--vim/bundle/vim-table-mode/t/fixtures/tableize.txt4
-rw-r--r--vim/bundle/vim-table-mode/t/formula.vim39
-rw-r--r--vim/bundle/vim-table-mode/t/spreadsheet.vim105
-rw-r--r--vim/bundle/vim-table-mode/t/table.vim184
-rw-r--r--vim/bundle/vim-table-mode/t/tablemode.vim56
-rw-r--r--vim/bundle/vim-table-mode/t/utils.vim45
-rw-r--r--vim/bundle/vim-table-mode/youtube.pngbin0 -> 44355 bytes
-rw-r--r--vim/ftdetect/c-co.vim1
-rw-r--r--vim/ftdetect/conffile.vim1
-rw-r--r--vim/ftdetect/make-co.vim1
-rw-r--r--vim/syntax/c-co.vim475
-rw-r--r--vim/syntax/conffile.vim37
-rw-r--r--vim/syntax/make-co.vim153
-rw-r--r--vimrc134
-rw-r--r--xinitrc9
-rw-r--r--xmod_swapper_not_used_any_more5
-rw-r--r--ycm_c_conf.py136
-rw-r--r--ycm_cpp_conf.py196
844 files changed, 118831 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..75b68d9
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,36 @@
+[submodule "vim/bundle/YouCompleteMe"]
+ path = vim/bundle/YouCompleteMe
+ url = https://github.com/Valloric/YouCompleteMe.git
+[submodule "vim/bundle/lightline.vim"]
+ path = vim/bundle/lightline.vim
+ url = https://github.com/itchyny/lightline.vim.git
+[submodule "vim/bundle/syntastic"]
+ path = vim/bundle/syntastic
+ url = https://github.com/scrooloose/syntastic.git
+[submodule "vim/bundle/tlib_vim"]
+ path = vim/bundle/tlib_vim
+ url = https://github.com/tomtom/tlib_vim.git
+[submodule "vim/bundle/vim-fugitive"]
+ path = vim/bundle/vim-fugitive
+ url = https://github.com/tpope/vim-fugitive.git
+[submodule "vim/bundle/vim-snipmate"]
+ path = vim/bundle/vim-snipmate
+ url = https://github.com/garbas/vim-snipmate.git
+[submodule "vim/bundle/tagbar"]
+ path = vim/bundle/tagbar
+ url = https://github.com/majutsushi/tagbar.git
+[submodule "vim/bundle/vim-addon-mw-utils"]
+ path = vim/bundle/vim-addon-mw-utils
+ url = https://github.com/MarcWeber/vim-addon-mw-utils.git
+[submodule "vim/bundle/vim-gitgutter"]
+ path = vim/bundle/vim-gitgutter
+ url = git://github.com/airblade/vim-gitgutter.git
+[submodule "vim/bundle/vim-snippets"]
+ path = vim/bundle/vim-snippets
+ url = https://github.com/honza/vim-snippets.git
+[submodule "vim/bundle/vim-table-mode"]
+ path = vim/bundle/vim-table-mode
+ url = https://github.com/dhruvasagar/vim-table-mode.git
+[submodule "vim/3rdparty/vim-pathogen"]
+ path = vim/3rdparty/vim-pathogen
+ url = https://github.com/tpope/vim-pathogen.git
diff --git a/Xresources b/Xresources
new file mode 100644
index 0000000..ea9c066
--- /dev/null
+++ b/Xresources
@@ -0,0 +1,50 @@
+! XTerm ##
+XTerm*metaSendsEscape: true
+XTerm*locale: true
+Xterm*saveLines: 4096
+XTerm*reverseVideo: on
+Xterm*faceName: Liberation Mono:size=10:antialias=true
+Xterm*borderWidth: 0
+! unicode rxvt ##
+URxvt*background: black
+URxvt*foreground: white
+URxvt*color0: black
+URxvt*color1: red3
+URxvt*color2: green3
+URxvt*color3: yellow3
+URxvt*color4: blue2
+URxvt*color5: magenta3
+URxvt*color6: cyan3
+URxvt*color7: gray90
+URxvt*color8: grey50
+URxvt*color9: red
+URxvt*color10: green
+URxvt*color11: yellow
+!URxvt*color12: blue
+URxvt*color12: rgb:5c/5c/ff
+URxvt*color13: magenta
+URxvt*color14: cyan
+URxvt*color15: white
+! scrollbar style - rxvt (default), plain (most compact), next, or xterm
+!URxvt.scrollstyle: plain
+URxvt.scrollBar: false
+! do not scroll with output
+URxvt*scrollTtyOutput: false
+! scroll in relation to buffer (with mouse scroll or Shift+Page Up)
+URxvt*scrollWithBuffer: true
+! scroll back to the bottom on keypress
+URxvt*scrollTtyKeypress: true
+! Disable scrollback for secondary screens
+URxvt*secondaryScreen: 1
+URxvt*secondaryScroll: 0
+! Font
+URxvt*font: xft:mono:size=10
+URxvt*perl-ext-common: default,clipboard,vtwheel,resize-font
+URxvt*resize-font*smaller: C-Down
+URxvt*resize-font*bigger: C-Up
+
+URxvt*iso14755: False
+URxvt*keysym*Shift-Control-C: perl:clipboard:copy
+URxvt*keysym*Shift-Control-V: perl:clipboard:paste
+URxvt*clipboard*copycmd: xsel -ib
+URxvt*clipboard*pastecmd: xsel -ob
diff --git a/bashrc b/bashrc
new file mode 100644
index 0000000..33801c6
--- /dev/null
+++ b/bashrc
@@ -0,0 +1,69 @@
+# .bashrc
+
+# If not running interactively, don't do anything
+[[ $- != *i* ]] && return
+
+# Source global definitions
+if [ -f /etc/bashrc ]; then
+ . /etc/bashrc
+fi
+
+export PATH=$PATH:$(ruby -e "print Gem.user_dir")/bin:~/.local/bin
+export EDITOR=vim
+
+alias ls='ls --color=auto'
+alias ll='ls -l'
+eval $(dircolors -b)
+alias grep='grep --color=auto'
+alias git='LANG=en_GB git'
+alias gdb='gdb -q'
+alias cgdb='cgdb -q'
+alias octave='octave-cli -q'
+alias ssh='TERM="xterm-256color" ssh'
+alias pacaur='pacaur -a'
+
+export LESS=-R
+export LESS_TERMCAP_mb=$'\E[1;31m'
+export LESS_TERMCAP_md=$'\E[1;36m'
+export LESS_TERMCAP_me=$'\E[0m'
+export LESS_TERMCAP_se=$'\E[0m'
+export LESS_TERMCAP_so=$'\E[01;44;33m'
+export LESS_TERMCAP_ue=$'\E[0m'
+export LESS_TERMCAP_us=$'\E[1;32m'
+
+alias gst='git status'
+alias vimc='vim -c "call InitC()"'
+alias vimb='vim -c "call InitBase()"'
+alias vimp='vim -c "call InitPython()"'
+alias vims='vim -c "call InitBash()"'
+alias i='i3-msg'
+
+PS1='$(
+if [ `id -u` -eq "0" ]; then
+ echo -n "\[\e[1;31m\]\u@\h:\[\e[1;34m\]\W\[\e[1;31m\]\$\[\e[0m\] "
+else
+ echo -n "\[\e[1;32m\]\u@\h:\[\e[1;34m\]\W\[\e[1;32m\]\$\[\e[0m\] "
+fi)'
+
+PROMPT_COMMAND='
+EC=$?
+if [[ $EC < 0 ]]; then
+ echo -e "\e[1;31m"EXIT: $EC"\e[0m"
+elif [[ $EC > 0 ]]; then
+ echo -e "\e[1;33m"EXIT: $EC"\e[0m"
+fi'
+
+function settitle {
+ echo -ne "\033]0;`whoami`@`hostname`:`pwd`\007"
+}
+case "$TERM" in
+ xterm*|*rxvt*)
+ trap 'settitle' DEBUG
+ ;;
+esac
+
+genpasswd() {
+ local l=$1
+ [ "$l" == "" ] && l=16
+ tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs
+}
diff --git a/config/i3/config b/config/i3/config
new file mode 100644
index 0000000..c0d71d7
--- /dev/null
+++ b/config/i3/config
@@ -0,0 +1,237 @@
+# This file has been auto-generated by i3-config-wizard(1).
+# It will not be overwritten, so edit it as you like.
+#
+# Should you change your keyboard layout some time, delete
+# this file and re-run i3-config-wizard(1).
+
+# i3 config file (v4)
+#
+# Please see http://i3wm.org/docs/userguide.html for a complete reference!
+
+set $mod Mod4
+
+# Font for window titles. Will also be used by the bar unless a different font
+# is used in the bar {} block below.
+font pango:monospace 8
+
+# This font is widely installed, provides lots of unicode glyphs, right-to-left
+# text rendering and scalability on retina/hidpi displays (thanks to pango).
+#font pango:DejaVu Sans Mono 8
+
+# Before i3 v4.8, we used to recommend this one as the default:
+# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+# The font above is very space-efficient, that is, it looks good, sharp and
+# clear in small sizes. However, its unicode glyph coverage is limited, the old
+# X core fonts rendering does not support right-to-left and this being a bitmap
+# font, it doesn’t scale on retina/hidpi displays.
+
+# Use Mouse+$mod to drag floating windows to their wanted position
+floating_modifier $mod
+
+# start a terminal
+bindsym $mod+Return exec urxvt
+bindsym $mod+Shift+Return exec firefox & pidgin
+
+# kill focused window
+bindsym $mod+q kill
+
+# start dmenu (a program launcher)
+bindsym $mod+d exec dmenu_run
+# There also is the (new) i3-dmenu-desktop which only displays applications
+# shipping a .desktop file. It is a wrapper around dmenu, so you need that
+# installed.
+#bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
+
+# bar toggle, hide or show
+bindsym $mod+m bar mode toggle
+
+# change focus
+bindsym $mod+h focus left
+bindsym $mod+j focus down
+bindsym $mod+k focus up
+bindsym $mod+l focus right
+
+# alternatively, you can use the cursor keys:
+bindsym $mod+Left focus left
+bindsym $mod+Down focus down
+bindsym $mod+Up focus up
+bindsym $mod+Right focus right
+
+# move focused window
+bindsym $mod+Shift+h move left
+bindsym $mod+Shift+j move down
+bindsym $mod+Shift+k move up
+bindsym $mod+Shift+l move right
+
+# alternatively, you can use the cursor keys:
+bindsym $mod+Shift+Left move left
+bindsym $mod+Shift+Down move down
+bindsym $mod+Shift+Up move up
+bindsym $mod+Shift+Right move right
+
+# split in horizontal orientation
+bindsym $mod+g split h
+
+# split in vertical orientation
+bindsym $mod+v split v
+
+# enter fullscreen mode for the focused container
+bindsym $mod+f fullscreen toggle
+
+# Scratchpad
+bindsym $mod+Tab scratchpad show
+bindsym $mod+Shift+Tab move scratchpad
+
+# change container layout (stacked, tabbed, toggle split)
+bindsym $mod+s layout stacking
+bindsym $mod+w layout tabbed
+bindsym $mod+e layout toggle split
+
+# toggle tiling / floating
+bindsym $mod+Shift+space floating toggle
+
+# change focus between tiling / floating windows
+bindsym $mod+space focus mode_toggle
+
+# focus the parent container
+bindsym $mod+a focus parent
+
+# focus the child container
+#bindsym $mod+d focus child
+
+# Output moving
+bindsym $mod+x move container to output right
+bindsym $mod+z move container to output left
+bindsym $mod+Shift+x move workspace to output right
+bindsym $mod+Shift+z move workspace to output left
+
+# switch to workspace
+bindsym $mod+1 workspace 1
+bindsym $mod+2 workspace 2
+bindsym $mod+3 workspace 3
+bindsym $mod+4 workspace 4
+bindsym $mod+5 workspace 5
+bindsym $mod+6 workspace 6
+bindsym $mod+7 workspace 7
+bindsym $mod+8 workspace 8
+bindsym $mod+9 workspace 9
+bindsym $mod+0 workspace 10
+bindsym $mod+grave workspace web
+bindsym $mod+underscore workspace t
+
+# move focused container to workspace
+bindsym $mod+Shift+1 move container to workspace 1
+bindsym $mod+Shift+2 move container to workspace 2
+bindsym $mod+Shift+3 move container to workspace 3
+bindsym $mod+Shift+4 move container to workspace 4
+bindsym $mod+Shift+5 move container to workspace 5
+bindsym $mod+Shift+6 move container to workspace 6
+bindsym $mod+Shift+7 move container to workspace 7
+bindsym $mod+Shift+8 move container to workspace 8
+bindsym $mod+Shift+9 move container to workspace 9
+bindsym $mod+Shift+0 move container to workspace 10
+bindsym $mod+Shift+grave move container to workspace web
+bindsym $mod+Shift+underscore move container to workspace t
+
+assign [class="Firefox"] web
+for_window [class="Pidgin"] move scratchpad
+
+# reload the configuration file
+bindsym $mod+Shift+c reload
+# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
+bindsym $mod+Shift+r restart
+
+set $Locker i3lock -d -c 000000 && sleep 1
+
+set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
+mode "$mode_system" {
+ bindsym l exec --no-startup-id $Locker, mode "default"
+ bindsym e exec --no-startup-id i3-msg exit, mode "default"
+ bindsym s exec --no-startup-id $Locker && systemctl suspend, mode "default"
+ bindsym h exec --no-startup-id $Locker && systemctl hibernate, mode "default"
+ bindsym r exec --no-startup-id systemctl reboot, mode "default"
+ bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default"
+
+ # back to normal: Enter or Escape
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
+}
+bindsym $mod+Shift+q mode "$mode_system"
+
+set $displays (d)efault, toggle: 1:eDP 2:HDMI 3:VGA
+mode "$displays" {
+ bindsym d exec --no-startup-id mxrandr, mode "default"
+ bindsym 1 exec --no-startup-id mxrandr toggle eDP1, mode "default"
+ bindsym 2 exec --no-startup-id mxrandr toggle HDMI1, mode "default"
+ bindsym 3 exec --no-startup-id mxrandr toggle VGA1, mode "default"
+
+ # back to normal: Enter or Escape
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
+}
+bindsym $mod+Shift+w mode "$displays"
+
+# resize window (you can also use the mouse for that)
+mode "resize" {
+ # These bindings trigger as soon as you enter the resize mode
+
+ # Pressing left will shrink the window’s width.
+ # Pressing right will grow the window’s width.
+ # Pressing up will shrink the window’s height.
+ # Pressing down will grow the window’s height.
+ bindsym h resize shrink width 10 px or 10 ppt
+ bindsym j resize grow height 10 px or 10 ppt
+ bindsym k resize shrink height 10 px or 10 ppt
+ bindsym l resize grow width 10 px or 10 ppt
+
+ # same bindings, but for the arrow keys
+ bindsym Left resize shrink width 10 px or 10 ppt
+ bindsym Down resize grow height 10 px or 10 ppt
+ bindsym Up resize shrink height 10 px or 10 ppt
+ bindsym Right resize grow width 10 px or 10 ppt
+
+ # back to normal: Enter or Escape
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
+}
+
+bindsym $mod+r mode "resize"
+
+# Switch keyboard
+bindsym Mod1+space exec --no-startup-id ~/.config/i3/scripts/keyboard_switch
+
+# Pulse audio control
+bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 1 +5% && pkill -RTMIN+10 i3blocks
+bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 1 -5% && pkill -RTMIN+10 i3blocks
+bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 1 toggle && pkill -RTMIN+10 i3blocks
+
+# Sreen brightness controls
+bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 20 # increase screen brightness
+bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 20 # decrease screen brightness
+
+# Keyboard backlight
+bindsym XF86KbdBrightnessUp exec --no-startup-id asus-kbd-backlight up
+bindsym XF86KbdBrightnessDown exec --no-startup-id asus-kbd-backlight down
+
+# Media player controls
+bindsym XF86AudioPlay exec --no-startup-id mpc toggle && pkill -RTMIN+12 i3blocks
+bindsym XF86AudioStop exec --no-startup-id mpc stop && pkill -RTMIN+12 i3blocks
+bindsym XF86AudioNext exec --no-startup-id mpc next && pkill -RTMIN+12 i3blocks
+bindsym XF86AudioPrev exec --no-startup-id mpc prev && pkill -RTMIN+12 i3blocks
+
+# Mouse bindings
+# TODO fillter windows
+bindsym --whole-window button11 exec --no-startup-id xdotool key ctrl+t
+bindsym --whole-window button12 exec --no-startup-id xdotool key ctrl+w
+bindsym --whole-window button13 exec --no-startup-id xdotool key ctrl+Tab
+bindsym --whole-window button14 exec --no-startup-id xdotool key ctrl+shift+Tab
+
+
+# Start i3bar to display a workspace bar (plus the system information i3status
+# finds out, if available)
+bar {
+ position top
+ status_command i3blocks
+ #status_command i3status
+ tray_output primary
+}
diff --git a/config/i3/scripts/keyboard_layout b/config/i3/scripts/keyboard_layout
new file mode 100755
index 0000000..90b82e4
--- /dev/null
+++ b/config/i3/scripts/keyboard_layout
@@ -0,0 +1,2 @@
+#!/bin/bash
+setxkbmap -query | awk '/layout/{print $2}'
diff --git a/config/i3/scripts/keyboard_switch b/config/i3/scripts/keyboard_switch
new file mode 100755
index 0000000..7ba27f8
--- /dev/null
+++ b/config/i3/scripts/keyboard_switch
@@ -0,0 +1,14 @@
+#!/bin/bash
+active=`~/.config/i3/scripts/keyboard_layout`
+
+case "$active" in
+ us)
+ setxkbmap cz_qwerty
+ ;;
+ cz_qwerty)
+ setxkbmap us
+ ;;
+esac
+
+# Send update to i3blocks
+pkill -RTMIN+11 i3blocks
diff --git a/config/i3blocks/config b/config/i3blocks/config
new file mode 100644
index 0000000..ed64ff9
--- /dev/null
+++ b/config/i3blocks/config
@@ -0,0 +1,187 @@
+# i3blocks config file
+#
+# Please see man i3blocks for a complete reference!
+# The man page is also hosted at http://vivien.github.io/i3blocks
+#
+# List of valid properties:
+#
+# align
+# color
+# command
+# full_text
+# instance
+# interval
+# label
+# min_width
+# name
+# separator
+# separator_block_width
+# short_text
+# signal
+# urgent
+
+# Global properties
+#
+# The top properties below are applied to every block, but can be overridden.
+# Each block command defaults to the script name to avoid boilerplate.
+command=/usr/lib/i3blocks/$BLOCK_NAME
+separator_block_width=15
+markup=none
+
+[mpd]
+command=~/.config/i3blocks/scripts/mpd
+interval=5
+signal=12
+
+[keymap]
+command=~/.config/i3/scripts/keyboard_layout
+interval=once
+signal=11
+
+[backup]
+command=~/.config/i3blocks/scripts/backup
+interval=86400
+signal=13
+
+# Volume indicator
+#
+# The first parameter sets the step (and units to display)
+# The second parameter overrides the mixer selection
+# See the script for details.
+[volume]
+#label=VOL
+label=♪
+instance=Master
+#instance=PCM
+interval=once
+signal=10
+
+# CPU usage
+#
+# The script may be called with -w and -c switches to specify thresholds,
+# see the script for details.
+[cpu_usage]
+#label=CPU
+label=
+interval=10
+separator=false
+
+# Memory usage
+#
+# The type defaults to "mem" if the instance is not specified.
+[memory]
+#label=MEM
+label=
+interval=30
+
+[bbswitch]
+command=~/.config/i3blocks/scripts/bbswitch
+interval=5
+
+#[memory]
+#label=SWAP
+#instance=swap
+#separator=false
+#interval=30
+
+# Disk usage
+#
+# The directory defaults to $HOME if the instance is not specified.
+# The script may be called with a optional argument to set the alert
+# (defaults to 10 for 10%).
+[disk]
+label=/
+instance=/
+interval=30
+separator=false
+[disk]
+label=/home
+instance=/home
+interval=30
+separator=false
+[disk]
+label=/home_hdd
+instance=/home_hdd
+interval=30
+
+# Network interface monitoring
+#
+# If the instance is not specified, use the interface used for default route.
+# The address can be forced to IPv4 or IPv6 with -4 or -6 switches.
+[iface]
+#instance=wlan0
+color=#00FF00
+interval=10
+separator=false
+
+[wifi]
+#instance=wlp3s0
+interval=10
+separator=false
+
+[bandwidth]
+#instance=eth0
+interval=5
+
+# OpenVPN support
+#
+# Support multiple VPN, with colors.
+#[openvpn]
+#interval=20
+
+# Temperature
+#
+# Support multiple chips, though lm-sensors.
+# The script may be called with -w and -c switches to specify thresholds,
+# see the script for details.
+[temperature]
+#label=T
+interval=10
+
+#[load_average]
+#interval=10
+
+# Battery indicator
+#
+# The battery instance defaults to 0.
+[battery]
+command=~/.config/i3blocks/scripts/battery
+#label=BAT
+#label=⚡
+#instance=1
+interval=30
+
+#[email]
+#command=~/.config/i3blocks/scripts/email
+#interval=30
+
+# Date Time
+#
+[time]
+command=date '+%Y-%m-%d %H:%M:%S'
+interval=1
+
+# Generic media player support
+#
+# This displays "ARTIST - SONG" if a music is playing.
+# Supported players are: spotify, vlc, audacious, xmms2, mplayer, and others.
+#[mediaplayer]
+#instance=mpd
+#interval=5
+#signal=10
+
+# Key indicators
+#
+# Add the following bindings to i3 config file:
+#
+# bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks
+# bindsym --release Num_Lock exec pkill -SIGRTMIN+11 i3blocks
+#[keyindicator]
+#instance=CAPS
+#interval=once
+#signal=11
+
+#[keyindicator]
+#instance=NUM
+#interval=once
+#signal=11
diff --git a/config/i3blocks/scripts/backup b/config/i3blocks/scripts/backup
new file mode 100755
index 0000000..24b3954
--- /dev/null
+++ b/config/i3blocks/scripts/backup
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+if [[ -n "$BLOCK_BUTTON" ]]; then
+ nohup urxvt -title "System backup" -hold -e sudo system-backup 2>&1 >/dev/null &
+fi
+
+state=5
+if [[ -e ~/.backup_date ]]; then
+ today=$(date +"%Y%m%d")
+ prev=$(date -d `cat ~/.backup_date` +"%Y%m%d")
+ dif=$(expr $today - $prev)
+ if [[ $dif -ge 30 ]]; then
+ state=4
+ elif [[ $dif -ge 20 ]]; then
+ state=3
+ elif [[ $dif -ge 5 ]]; then
+ state=2
+ elif [[ $dif -ge 2 ]]; then
+ state=1
+ else
+ state=0
+ fi
+fi
+
+if [[ $state -eq 0 ]]; then
+ exit 0
+fi
+
+echo "Do backup"
+echo "Backup"
+case $state in
+ 1)
+ echo
+ ;;
+ 2)
+ echo "#ffff00"
+ ;;
+ 3)
+ echo "#ff8a00"
+ ;;
+ 4)
+ echo "#ff5000"
+ ;;
+ 5)
+ echo "#ff0000"
+ ;;
+esac
diff --git a/config/i3blocks/scripts/battery b/config/i3blocks/scripts/battery
new file mode 100755
index 0000000..7a5563a
--- /dev/null
+++ b/config/i3blocks/scripts/battery
@@ -0,0 +1,75 @@
+#!/usr/bin/perl
+#
+# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
+# Copyright 2014 Vivien Didelot <vivien@didelot.org>
+#
+# Licensed under the terms of the GNU GPL v3, or any later version.
+#
+# This script is meant to use with i3blocks. It parses the output of the "acpi"
+# command (often provided by a package of the same name) to read the status of
+# the battery, and eventually its remaining time (to full charge or discharge).
+#
+# The color will gradually change for a percentage below 85%, and the urgency
+# (exit code 33) is set if there is less that 5% remaining.
+
+use strict;
+use warnings;
+use utf8;
+
+my $acpi;
+my $status;
+my $percent;
+my $full_text;
+my $short_text;
+my $bat_number = $ENV{BLOCK_INSTANCE} || 0;
+
+# read the first line of the "acpi" command output
+open (ACPI, "acpi -b | grep 'Battery $bat_number' |") or die;
+$acpi = <ACPI>;
+close(ACPI);
+
+# fail on unexpected output
+if ($acpi !~ /: (\w+), (\d+)%/) {
+ die "$acpi\n";
+}
+
+$status = $1;
+$percent = $2;
+
+if ($status eq 'Discharging') {
+ $full_text = '🔋 ';
+} elsif ($status eq 'Charging') {
+ $full_text = '🔌 ';
+}
+
+$full_text .= "$percent%";
+
+$short_text = $full_text;
+
+if ($acpi =~ /(\d\d:\d\d):/) {
+ $full_text .= " ($1)";
+}
+
+# print text
+print "$full_text\n";
+print "$short_text\n";
+
+# consider color and urgent flag only on discharge
+if ($status eq 'Discharging') {
+
+ if ($percent < 20) {
+ print "#FF0000\n";
+ } elsif ($percent < 40) {
+ print "#FFAE00\n";
+ } elsif ($percent < 60) {
+ print "#FFF600\n";
+ } elsif ($percent < 85) {
+ print "#A8FF00\n";
+ }
+
+ if ($percent < 5) {
+ exit(33);
+ }
+}
+
+exit(0);
diff --git a/config/i3blocks/scripts/bbswitch b/config/i3blocks/scripts/bbswitch
new file mode 100755
index 0000000..a6ad24c
--- /dev/null
+++ b/config/i3blocks/scripts/bbswitch
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if [ -e /proc/acpi/bbswitch ]; then
+ if [ -n "`cat /proc/acpi/bbswitch | grep ON`" ]; then
+ echo OPTIMUS
+ echo OP
+ echo '#ffff00'
+ fi
+fi
diff --git a/config/i3blocks/scripts/email b/config/i3blocks/scripts/email
new file mode 100755
index 0000000..138deb8
--- /dev/null
+++ b/config/i3blocks/scripts/email
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+email-unread -s | tr "\n" " " | sed 's/[ ]*$/\n/'
+echo
+echo "#ffff00"
diff --git a/config/i3blocks/scripts/mpd b/config/i3blocks/scripts/mpd
new file mode 100755
index 0000000..63ba924
--- /dev/null
+++ b/config/i3blocks/scripts/mpd
@@ -0,0 +1,10 @@
+#!/bin/bash
+if [ -n "`mpc status | grep -E "(playing|paused)"`" ]; then
+ echo `mpc -f "%artist%, %album%, %title%" status | head -1`
+ echo
+ if [ -n `mpc status | grep playing` ]; then
+ echo "#ffff00"
+ elif [ -n `mpc status | grep paused` ]; then
+ echo "#00ff00"
+ fi
+fi
diff --git a/config/i3status/config b/config/i3status/config
new file mode 100644
index 0000000..d01d390
--- /dev/null
+++ b/config/i3status/config
@@ -0,0 +1,62 @@
+# i3status configuration file.
+# see "man i3status" for documentation.
+
+# It is important that this file is edited as UTF-8.
+# The following line should contain a sharp s:
+# ß
+# If the above line is not correctly displayed, fix your editor first!
+
+general {
+ colors = true
+ interval = 5
+}
+
+order += "volume pulse"
+order += "disk /"
+order += "disk /home"
+order += "disk /home_hdd"
+order += "wireless _first_"
+order += "ethernet _first_"
+order += "battery 0"
+order += "load"
+order += "tztime local"
+
+wireless _first_ {
+ format_up = "W: (%quality at %essid) %ip"
+ format_down = "W: down"
+}
+
+ethernet _first_ {
+ # if you use %speed, i3status requires root privileges
+ format_up = "E: %ip (%speed)"
+ format_down = "E: down"
+}
+
+battery 0 {
+ format = "%status %percentage %remaining"
+}
+
+tztime local {
+ format = "%Y-%m-%d %H:%M:%S"
+}
+
+load {
+ format = "%1min %5min %15min"
+ max_threshold= "0.1"
+}
+
+disk "/" {
+ format = "/ %avail"
+}
+disk "/home" {
+ format = "/home %avail"
+}
+disk "/home_hdd" {
+ format = "/home_hdd %avail"
+}
+
+volume pulse{
+ format = "♪: %volume"
+ format_muted = "♪: muted (%volume)"
+ device = "pulse"
+}
diff --git a/config/mpd/mpd.conf b/config/mpd/mpd.conf
new file mode 100644
index 0000000..17a21cc
--- /dev/null
+++ b/config/mpd/mpd.conf
@@ -0,0 +1,416 @@
+# An example configuration file for MPD.
+# Read the user manual for documentation: http://www.musicpd.org/doc/user/
+
+
+# Probably not supported
+#mpd_crossfade_time = "3"
+
+# Files and directories #######################################################
+#
+# This setting controls the top directory which MPD will search to discover the
+# available audio files and add them to the daemon's online database. This
+# setting defaults to the XDG directory, otherwise the music directory will be
+# be disabled and audio files will only be accepted over ipc socket (using
+# file:// protocol) or streaming files over an accepted protocol.
+#
+music_directory "~/hdd/music"
+#
+# This setting sets the MPD internal playlist directory. The purpose of this
+# directory is storage for playlists created by MPD. The server will use
+# playlist files not created by the server but only if they are in the MPD
+# format. This setting defaults to playlist saving being disabled.
+#
+playlist_directory "~/.config/mpd/playlists"
+#
+# This setting sets the location of the MPD database. This file is used to
+# load the database at server start up and store the database while the
+# server is not up. This setting defaults to disabled which will allow
+# MPD to accept files over ipc socket (using file:// protocol) or streaming
+# files over an accepted protocol.
+#
+db_file "~/.config/mpd/database"
+#
+# These settings are the locations for the daemon log files for the daemon.
+# These logs are great for troubleshooting, depending on your log_level
+# settings.
+#
+# The special value "syslog" makes MPD use the local syslog daemon. This
+# setting defaults to logging to syslog, otherwise logging is disabled.
+#
+log_file "~/.config/mpd/log"
+#
+# This setting sets the location of the file which stores the process ID
+# for use of mpd --kill and some init scripts. This setting is disabled by
+# default and the pid file will not be stored.
+#
+pid_file "~/.config/mpd/pid"
+#
+# This setting sets the location of the file which contains information about
+# most variables to get MPD back into the same general shape it was in before
+# it was brought down. This setting is disabled by default and the server
+# state will be reset on server start up.
+#
+state_file "~/.config/mpd/state"
+#
+# The location of the sticker database. This is a database which
+# manages dynamic information attached to songs.
+#
+sticker_file "~/.config/mpd/sticker.sql"
+#
+###############################################################################
+
+
+# General music daemon options ################################################
+#
+# This setting specifies the user that MPD will run as. MPD should never run as
+# root and you may use this setting to make MPD change its user ID after
+# initialization. This setting is disabled by default and MPD is run as the
+# current user.
+#
+#user "nobody"
+#
+# This setting specifies the group that MPD will run as. If not specified
+# primary group of user specified with "user" setting will be used (if set).
+# This is useful if MPD needs to be a member of group such as "audio" to
+# have permission to use sound card.
+#
+#group "nogroup"
+#
+# This setting sets the address for the daemon to listen on. Careful attention
+# should be paid if this is assigned to anything other then the default, any.
+# This setting can deny access to control of the daemon.
+#
+# For network
+#bind_to_address "any"
+#
+# And for Unix Socket
+#bind_to_address "~/.mpd/socket"
+#
+# This setting is the TCP port that is desired for the daemon to get assigned
+# to.
+#
+#port "6600"
+#
+# This setting controls the type of information which is logged. Available
+# setting arguments are "default", "secure" or "verbose". The "verbose" setting
+# argument is recommended for troubleshooting, though can quickly stretch
+# available resources on limited hardware storage.
+#
+#log_level "default"
+#
+# If you have a problem with your MP3s ending abruptly it is recommended that
+# you set this argument to "no" to attempt to fix the problem. If this solves
+# the problem, it is highly recommended to fix the MP3 files with vbrfix
+# (available from <http://www.willwap.co.uk/Programs/vbrfix.php>), at which
+# point gapless MP3 playback can be enabled.
+#
+#gapless_mp3_playback "yes"
+#
+# Setting "restore_paused" to "yes" puts MPD into pause mode instead
+# of starting playback after startup.
+#
+#restore_paused "no"
+#
+# This setting enables MPD to create playlists in a format usable by other
+# music players.
+#
+#save_absolute_paths_in_playlists "no"
+#
+# This setting defines a list of tag types that will be extracted during the
+# audio file discovery process. The complete list of possible values can be
+# found in the mpd.conf man page.
+#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
+#
+# This setting enables automatic update of MPD's database when files in
+# music_directory are changed.
+#
+#auto_update "yes"
+#
+# Limit the depth of the directories being watched, 0 means only watch
+# the music directory itself. There is no limit by default.
+#
+#auto_update_depth "3"
+#
+###############################################################################
+
+
+# Symbolic link behavior ######################################################
+#
+# If this setting is set to "yes", MPD will discover audio files by following
+# symbolic links outside of the configured music_directory.
+#
+#follow_outside_symlinks "yes"
+#
+# If this setting is set to "yes", MPD will discover audio files by following
+# symbolic links inside of the configured music_directory.
+#
+#follow_inside_symlinks "yes"
+#
+###############################################################################
+
+
+# Zeroconf / Avahi Service Discovery ##########################################
+#
+# If this setting is set to "yes", service information will be published with
+# Zeroconf / Avahi.
+#
+#zeroconf_enabled "yes"
+#
+# The argument to this setting will be the Zeroconf / Avahi unique name for
+# this MPD server on the network.
+#
+#zeroconf_name "Music Player"
+#
+###############################################################################
+
+
+# Permissions #################################################################
+#
+# If this setting is set, MPD will require password authorization. The password
+# can setting can be specified multiple times for different password profiles.
+#
+#password "password@read,add,control,admin"
+#
+# This setting specifies the permissions a user has who has not yet logged in.
+#
+#default_permissions "read,add,control,admin"
+#
+###############################################################################
+
+
+# Database #######################################################################
+#
+
+#database {
+# plugin "proxy"
+# host "other.mpd.host"
+# port "6600"
+#}
+
+# Input #######################################################################
+#
+
+input {
+ plugin "curl"
+# proxy "proxy.isp.com:8080"
+# proxy_user "user"
+# proxy_password "password"
+}
+
+#
+###############################################################################
+
+# Audio Output ################################################################
+#
+# MPD supports various audio output types, as well as playing through multiple
+# audio outputs at the same time, through multiple audio_output settings
+# blocks. Setting this block is optional, though the server will only attempt
+# autodetection for one sound card.
+#
+# An example of an ALSA output:
+#
+#audio_output {
+# type "alsa"
+# name "My ALSA Device"
+## device "hw:0,0" # optional
+## mixer_type "hardware" # optional
+## mixer_device "default" # optional
+## mixer_control "PCM" # optional
+## mixer_index "0" # optional
+#}
+#
+# An example of an OSS output:
+#
+#audio_output {
+# type "oss"
+# name "My OSS Device"
+## device "/dev/dsp" # optional
+## mixer_type "hardware" # optional
+## mixer_device "/dev/mixer" # optional
+## mixer_control "PCM" # optional
+#}
+#
+# An example of a shout output (for streaming to Icecast):
+#
+#audio_output {
+# type "shout"
+# encoding "ogg" # optional
+# name "My Shout Stream"
+# host "localhost"
+# port "8000"
+# mount "/mpd.ogg"
+# password "hackme"
+# quality "5.0"
+# bitrate "128"
+# format "44100:16:1"
+## protocol "icecast2" # optional
+## user "source" # optional
+## description "My Stream Description" # optional
+## url "http://example.com" # optional
+## genre "jazz" # optional
+## public "no" # optional
+## timeout "2" # optional
+## mixer_type "software" # optional
+#}
+#
+# An example of a recorder output:
+#
+#audio_output {
+# type "recorder"
+# name "My recorder"
+# encoder "vorbis" # optional, vorbis or lame
+# path "/var/lib/mpd/recorder/mpd.ogg"
+## quality "5.0" # do not define if bitrate is defined
+# bitrate "128" # do not define if quality is defined
+# format "44100:16:1"
+#}
+#
+# An example of a httpd output (built-in HTTP streaming server):
+#
+#audio_output {
+# type "httpd"
+# name "My HTTP Stream"
+# encoder "vorbis" # optional, vorbis or lame
+# port "8000"
+# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
+## quality "5.0" # do not define if bitrate is defined
+# bitrate "128" # do not define if quality is defined
+# format "44100:16:1"
+# max_clients "0" # optional 0=no limit
+#}
+#
+# An example of a pulseaudio output (streaming to a remote pulseaudio server)
+#
+audio_output {
+ type "pulse"
+ name "pulse audio"
+## server "remote_server" # optional
+## sink "remote_server_sink" # optional
+}
+#
+# An example of a winmm output (Windows multimedia API).
+#
+#audio_output {
+# type "winmm"
+# name "My WinMM output"
+## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
+# or
+## device "0" # optional
+## mixer_type "hardware" # optional
+#}
+#
+# An example of an openal output.
+#
+#audio_output {
+# type "openal"
+# name "My OpenAL output"
+## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
+#}
+#
+## Example "pipe" output:
+#
+#audio_output {
+# type "pipe"
+# name "my pipe"
+# command "aplay -f cd 2>/dev/null"
+## Or if you're want to use AudioCompress
+# command "AudioCompress -m | aplay -f cd 2>/dev/null"
+## Or to send raw PCM stream through PCM:
+# command "nc example.org 8765"
+# format "44100:16:2"
+#}
+#
+## An example of a null output (for no audio output):
+#
+#audio_output {
+# type "null"
+# name "My Null Output"
+# mixer_type "none" # optional
+#}
+#
+# If MPD has been compiled with libsamplerate support, this setting specifies
+# the sample rate converter to use. Possible values can be found in the
+# mpd.conf man page or the libsamplerate documentation. By default, this is
+# setting is disabled.
+#
+#samplerate_converter "Fastest Sinc Interpolator"
+#
+###############################################################################
+
+
+# Normalization automatic volume adjustments ##################################
+#
+# This setting specifies the type of ReplayGain to use. This setting can have
+# the argument "off", "album", "track" or "auto". "auto" is a special mode that
+# chooses between "track" and "album" depending on the current state of
+# random playback. If random playback is enabled then "track" mode is used.
+# See <http://www.replaygain.org> for more details about ReplayGain.
+# This setting is off by default.
+#
+#replaygain "album"
+#
+# This setting sets the pre-amp used for files that have ReplayGain tags. By
+# default this setting is disabled.
+#
+#replaygain_preamp "0"
+#
+# This setting sets the pre-amp used for files that do NOT have ReplayGain tags.
+# By default this setting is disabled.
+#
+#replaygain_missing_preamp "0"
+#
+# This setting enables or disables ReplayGain limiting.
+# MPD calculates actual amplification based on the ReplayGain tags
+# and replaygain_preamp / replaygain_missing_preamp setting.
+# If replaygain_limit is enabled MPD will never amplify audio signal
+# above its original level. If replaygain_limit is disabled such amplification
+# might occur. By default this setting is enabled.
+#
+#replaygain_limit "yes"
+#
+# This setting enables on-the-fly normalization volume adjustment. This will
+# result in the volume of all playing audio to be adjusted so the output has
+# equal "loudness". This setting is disabled by default.
+#
+#volume_normalization "no"
+#
+###############################################################################
+
+# Character Encoding ##########################################################
+#
+# If file or directory names do not display correctly for your locale then you
+# may need to modify this setting.
+#
+#filesystem_charset "UTF-8"
+#
+# This setting controls the encoding that ID3v1 tags should be converted from.
+#
+#id3v1_encoding "ISO-8859-1"
+#
+###############################################################################
+
+
+# SIDPlay decoder #############################################################
+#
+# songlength_database:
+# Location of your songlengths file, as distributed with the HVSC.
+# The sidplay plugin checks this for matching MD5 fingerprints.
+# See http://www.c64.org/HVSC/DOCUMENTS/Songlengths.faq
+#
+# default_songlength:
+# This is the default playing time in seconds for songs not in the
+# songlength database, or in case you're not using a database.
+# A value of 0 means play indefinitely.
+#
+# filter:
+# Turns the SID filter emulation on or off.
+#
+#decoder {
+# plugin "sidplay"
+# songlength_database "/media/C64Music/DOCUMENTS/Songlengths.txt"
+# default_songlength "120"
+# filter "true"
+#}
+#
+###############################################################################
+
diff --git a/eaglerc b/eaglerc
new file mode 100644
index 0000000..4804ffa
--- /dev/null
+++ b/eaglerc
@@ -0,0 +1,164 @@
+# EAGLE Parameter File (generated by EAGLE Version 7.5.0 - DO NOT EDIT!)
+
+Brd.LargeCursor = "0"
+Brd.Palette = "0"
+Brd.WhiteBackground = "0"
+CheckForUpdate.AdvPanelNumber = "7"
+CheckForUpdate.AdvSplashNumber = "7"
+CheckForUpdate.Auto = "1"
+CheckForUpdate.Beta = "0"
+CheckForUpdate.LastTimeChecked = "1456155178"
+Cmd.Copy.ClassicEagleMode = "0"
+Cmd.Delete.WireJointsWithoutCtrl = "0"
+Cmd.Name.RenameEntireNetByDefault = "0"
+Cmd.Name.RenameEntireSignalByDefault = "0"
+Cmd.Wire.IgnoreCtrlForRadiusMode = "0"
+ControlPanel.Header1 = "1 0:185 1:20 2:100"
+ControlPanel.View.AutoOpenProjectFolder = "1"
+ControlPanel.View.Extended = "1"
+ControlPanel.View.Sort = "0"
+Dialog.Add.Sch.Header1 = "1 0:100 1:297"
+Dialog.Add.Sch.Size = "835 644"
+Dialog.Add.Sch.Splitter1.Sizes = "413 396"
+Dialog.Add.Sch.Splitter2.Sizes = "199 381"
+Dialog.Add.Sch.Splitter3.Sizes = "196 196"
+Dialog.Add.Sch.Splitter4.Sizes = "189 188"
+Dialog.Assign.Size = "446 252"
+Dialog.CheckForUpdate.Size = "278 252"
+Directories.Cam = "$EAGLEDIR/cam"
+Directories.Doc = "$EAGLEDIR/doc"
+Directories.Dru = "$EAGLEDIR/dru"
+Directories.Epf = "$HOME/Documents/eagle:$EAGLEDIR/projects/examples"
+Directories.IgnoreNonExisting = "0"
+Directories.Lbr = "$EAGLEDIR/lbr:$HOME/Documents/eagle/lbr/"
+Directories.Scr = "$EAGLEDIR/scr"
+Directories.Ulp = "$EAGLEDIR/ulp"
+EAGLE.Version = "7.5"
+Erc.AllowUserOverrideConsistencyCheck = "0"
+Interface.ActionToolbar = "1"
+Interface.BubbleHelp = "1"
+Interface.ClassicIcons = "0"
+Interface.CommandButtons = "1"
+Interface.CommandTexts = "1"
+Interface.ExternalTextEditor = ""
+Interface.IconSize = "16"
+Interface.LimitZoomFactor = "1"
+Interface.MouseButtonReleaseTimeout = "500"
+Interface.MouseWheelZoom = "1.2"
+Interface.ParameterToolbar = "1"
+Interface.PreferredUnit = "0"
+Interface.PulldownMenu = "1"
+Interface.SheetThumbnails = "1"
+Interface.UseCtrlForPanning = "0"
+Interface.UserGuidance = "1"
+Interface.VectorFont = "0"
+Interface.VerticalText = "0"
+Lbr.CommandPopup.Add.1 = "ATMEGA328P-AU;"
+Lbr.CommandPopup.EditDev.1 = "ATMEGA328P-AU;"
+Lbr.CommandPopup.EditPac.1 = "QFP80P900X900X120-32N;"
+Lbr.CommandPopup.EditSym.1 = "ATMEGA328P-AU;"
+Lbr.DeviceEditor.SplitterH.Sizes = "#0 0 839 838 839 0 #1 0 839 838 839 0 #2 1238 0 0 0 1258"
+Lbr.DeviceEditor.SplitterVL.Sizes = "#0 0 1271 #1 0 1271 #2 331 936"
+Lbr.DeviceEditor.SplitterVR.Sizes = "605 580"
+Lbr.MenuText.01 = "[designlink.png] Search and order : Run designlink-order.ulp -general;"
+Lbr.ToolBar.Action = "2 0 1 0 2"
+Lbr.ToolBar.CommandButtons = "5 0 1 0 5"
+Lbr.ToolBar.CommandTexts = "2 1 0 0 2"
+Lbr.ToolBar.Parameters = "2 2 1 0 2"
+Option.ActivateItemOnSingleClick = "0"
+Option.AlphaBlendingOnBlackBackground = "1"
+Option.AutoBackupInterval = "5"
+Option.AutoJunction = "1"
+Option.AutoLoadMatchingDrawingFile = "0"
+Option.Beep = "1"
+Option.BusWireWidth = "7620"
+Option.CatchFactor = "0.05"
+Option.Codec = "System"
+Option.DisplayMode = "1"
+Option.DrawUnprocessedPolygonEdgesContinuous = "0"
+Option.DrcFillStyle = "3"
+Option.Drill.Symbol.Diameter = "20320"
+Option.Drill.Symbol.Nr.0 = "5000"
+Option.Drill.Symbol.Nr.1 = "6000"
+Option.Drill.Symbol.Nr.2 = "7000"
+Option.Drill.Symbol.Nr.3 = "8000"
+Option.Drill.Symbol.Nr.4 = "9000"
+Option.Drill.Symbol.Nr.5 = "10000"
+Option.Drill.Symbol.Nr.6 = "11000"
+Option.Drill.Symbol.Nr.7 = "12000"
+Option.Drill.Symbol.Nr.8 = "13000"
+Option.Drill.Symbol.Nr.9 = "14000"
+Option.Drill.Symbol.Nr.10 = "15000"
+Option.Drill.Symbol.Nr.11 = "16000"
+Option.Drill.Symbol.Nr.12 = "20000"
+Option.Drill.Symbol.Nr.13 = "22000"
+Option.Drill.Symbol.Nr.14 = "28000"
+Option.Drill.Symbol.Nr.15 = "32000"
+Option.Drill.Symbol.Nr.16 = "0"
+Option.Drill.Symbol.Nr.17 = "0"
+Option.Drill.Symbol.Width = "254"
+Option.FileLocking = "1"
+Option.GridColorBlackBgDots = "7"
+Option.GridColorBlackBgLines = "8"
+Option.GridColorColoredBgDots = "7"
+Option.GridColorColoredBgLines = "8"
+Option.GridColorWhiteBgDots = "7"
+Option.GridColorWhiteBgLines = "8"
+Option.LayerSequence = ""
+Option.MaxBackupLevel = "9"
+Option.MinGridSize = "5"
+Option.MinTextSize = "3"
+Option.NetWireWidth = "1524"
+Option.Optimizing = "1"
+Option.PadNames = "0"
+Option.RatsnestLimit = "0"
+Option.RepositionMouseCursorAfterContextMenu = "0"
+Option.SelectFactor = "0.02"
+Option.ShowPartOrigins = "1"
+Option.ShowTextOrigins = "1"
+Option.SnapLength = "5080"
+Option.ToggleCtrlForGroupSelectionAndContextMenu = "0"
+Option.XrefLabelFormat = "%F%N/%S.%C%R"
+Option.XrefPartFormat = "/%S.%C%R"
+Project.Dir = "/home/cynerd/Documents/eagle/oh-avr"
+Recent.Epf.1 = "/home/cynerd/Documents/eagle/oh-avr"
+Recent.Lbr.1 = "/home/cynerd/Documents/eagle/lbr/AVR.lbr"
+Recent.Sch.1 = "/home/cynerd/Documents/eagle/oh-avr/avrunit.sch"
+Recent.Scr.1 = "/home/cynerd/Downloads/Atmel-ATMEGA328P-AU@E/Atmel-ATMEGA328P-AU.scr"
+Sch.Cmd.Add.AlwaysUseDeviceNameAsValue = "0"
+Sch.CommandPopup.Add.1 = "+5V (supply1.lbr);'+5V@/home/cynerd/.eagle/lbr/supply1.lbr'"
+Sch.CommandPopup.Add.2 = "GND (supply1.lbr);'GND@/home/cynerd/.eagle/lbr/supply1.lbr'"
+Sch.CommandPopup.Add.3 = "MA04-2 (con-lstb.lbr);'MA04-2@/home/cynerd/.eagle/lbr/con-lstb.lbr'"
+Sch.CommandPopup.Add.4 = "MA05-2 (con-lstb.lbr);'MA05-2@/home/cynerd/.eagle/lbr/con-lstb.lbr'"
+Sch.CommandPopup.Add.5 = "MA03-2 (con-lstb.lbr);'MA03-2@/home/cynerd/.eagle/lbr/con-lstb.lbr'"
+Sch.CommandPopup.Add.6 = "MA03-1 (con-lstb.lbr);'MA03-1@/home/cynerd/.eagle/lbr/con-lstb.lbr'"
+Sch.CommandPopup.Add.7 = "ATMEGA328P-AU (AVR.lbr);'ATMEGA328P-AU@/home/cynerd/Documents/eagle/lbr/AVR.lbr'"
+Sch.DockWidget.Thumbnails = "1 -1 -1 -1 70 -1 0"
+Sch.Key.A+A = "Add"
+Sch.Key.A+C = "Copy"
+Sch.Key.A+D = "Delete"
+Sch.Key.A+F = "Mirror"
+Sch.Key.A+F2 = "Window fit"
+Sch.Key.A+G = "Group"
+Sch.Key.A+L = "Label"
+Sch.Key.A+M = "Move"
+Sch.Key.A+N = "Name"
+Sch.Key.A+R = "Rotate"
+Sch.Key.A+S = "Smash"
+Sch.Key.A+V = "Value"
+Sch.Key.A+W = "Wire"
+Sch.Key.F2 = "Window;"
+Sch.Key.F3 = "Window 2"
+Sch.Key.F4 = "Window 0.5"
+Sch.Key.F5 = "Window (@);"
+Sch.Key.F6 = "Grid;"
+Sch.LargeCursor = "0"
+Sch.MenuText.01 = "[designlink.png] Search and order { General : Run designlink-order.ulp -general; | Schematic : Run designlink-order.ulp; }"
+Sch.Palette = "1"
+Sch.ToolBar.Action = "2 0 1 0 2"
+Sch.ToolBar.CommandButtons = "5 0 1 0 5"
+Sch.ToolBar.CommandTexts = "2 1 0 0 2"
+Sch.ToolBar.Parameters = "2 2 1 0 2"
+Sch.WhiteBackground = "1"
+Warning.PartHasNoUserDefinableValue = "1"
+Warning.SupplyPinAutoOverwriteGeneratedNetName = "0"
diff --git a/gitconfig b/gitconfig
new file mode 100644
index 0000000..59fe735
--- /dev/null
+++ b/gitconfig
@@ -0,0 +1,7 @@
+[user]
+ name = Karel Kočí
+ email = cynerd@email.cz
+[push]
+ default = simple
+[core]
+ editor = vim
diff --git a/install b/install
new file mode 100755
index 0000000..52970bc
--- /dev/null
+++ b/install
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+WDIR=`pwd`
+cd `dirname $0`
+
+IUSER=`whoami`
+WHOME=`cd ~ && pwd`
+
+function inst {
+ SOURCE=$1
+ OUTPUT=$2
+ echo rsync -rlpt $SOURCE $OUTPUT
+ rsync -rlpt $SOURCE $OUTPUT
+}
+
+read -p "Install Bashrc? (Y/n) "
+if [[ $REPLY =~ ^[Yy]?$ ]]; then
+ inst bashrc $WHOME/.bashrc
+fi
+
+read -p "Install Bashrc to root? (Y/n) "
+if [[ $REPLY =~ ^[Yy]?$ ]]; then
+ sudo inst bashrc /root/.bashrc
+fi
+
+read -p "Install GIT configuration? (Y/n) "
+if [[ $REPLY =~ ^[Yy]?$ ]]; then
+ sudo inst gitconfig $WHOME/.gitconfig
+fi
+
+read -p "Install VIM scripts? (Y/n) "
+if [[ $REPLY =~ ^[Yy]?$ ]]; then
+ inst vimrc $WHOME/.vimrc
+ inst vim $WHOME/.vim
+ echo "Please don't forget to setup YouCompleteMe"
+fi
+
+read -p "Install i3 configuration? (Y/n) "
+if [[ $REPLY =~ ^[Yy]?$ ]]; then
+ inst xinitrc $WHOME/.xinitrc
+ inst Xresources $WHOME/.Xresources
+ inst config/i3 $WHOME/.config/i3
+ inst config/i3blocks $WHOME/.config/i3blocks
+ inst config/i3status $WHOME/.config/i3status
+ inst local/bin/mxrandr $WHOME/.local/bin/mxrandr
+fi
+
+read -p "Install MPD configuration? (Y/n) "
+if [[ $REPLY =~ ^[Yy]?$ ]]; then
+ inst config/mpd $WHOME/.config/mpd
+fi
+
+read -p "Install backup script? (Y/n) "
+if [[ $REPLY =~ ^[Yy]?$ ]]; then
+ inst local/bin/system-backup $WHOME/.local/bin/system-backup
+fi
+
+read -p "Install Eagle CAD configuration? (Y/n) "
+if [[ $REPLY =~ ^[Yy]?$ ]]; then
+ inst eaglerc $WHOME/.eaglerc
+fi
diff --git a/local/bin/mxrandr b/local/bin/mxrandr
new file mode 100755
index 0000000..7c51128
--- /dev/null
+++ b/local/bin/mxrandr
@@ -0,0 +1,119 @@
+#!/bin/bash
+
+# get info from xrandr
+connectedOutputs=$(xrandr | grep " connected" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/")
+activeOutput=$(xrandr | grep -E " connected (primary )?[1-9]+" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/")
+disconnectedOutputs=$(xrandr | grep -E " disconnected (primary )?[1-9]+" | awk '{print $1}')
+
+cmd="xrandr "
+cmd_def=$cmd
+
+INTERNAL=eDP1
+HDMI=HDMI1
+VGA=VGA1
+
+for device in "$disconnectedOutputs"; do
+ if [ -n "$defice" ]; then
+ if [[ "$activeOutput" == *"$device"* ]]; then
+ cmd=$cmd" --output $device --off"
+ fi
+ fi
+done
+
+function only_internal {
+ cmd=$cmd" --output $INTERNAL --auto --primary"
+ cmd=$cmd" --output $HDMI --off"
+ cmd=$cmd" --output $VGA --off"
+}
+
+function internal_vga {
+ cmd=$cmd" --output $INTERNAL --auto --primary"
+ cmd=$cmd" --output $HDMI --off"
+ cmd=$cmd" --output $VGA --auto --right-of $INTERNAL"
+}
+
+function internal_hdmi {
+ cmd=$cmd" --output $INTERNAL --auto --right-of $HDMI"
+ cmd=$cmd" --output $HDMI --auto --primary"
+ cmd=$cmd" --output $VGA --off"
+}
+
+function internal_hdmi_vga {
+ cmd=$cmd" --output $INTERNAL --auto --right-of $HDMI"
+ cmd=$cmd" --output $HDMI --auto --primary"
+ cmd=$cmd" --output $VGA --auto --left-of $HDMI"
+}
+
+function cmd_exec {
+ if [ "$cmd" != "$cmd_def" ]; then
+ echo $cmd
+ `$cmd`
+ fi
+}
+
+
+if [ $# -le 1 ]; then
+ if [[ "$connectedOutputs" == *"$HDMI"* ]]; then
+ if [[ "$connectedOutputs" == *"$VGA"* ]]; then
+ internal_hdmi_vga
+ else
+ internal_hdmi
+ fi
+ else
+ if [[ "$connectedOutputs" == *"$VGA"* ]]; then
+ internal_vga
+ else
+ only_internal
+ fi
+ fi
+ cmd_exec
+ exit
+fi
+
+if [ "$2" != "mode" ]; then
+ if [[ "$connectedOutputs" != *"$2"* ]]; then
+ echo No $2 display known
+ exit
+ fi
+fi
+
+case "$1" in
+ toggle)
+ case "$2" in
+ $INTERNAL)
+ if [[ "$activeOutput" == *"$INTERNAL"* ]]; then
+ cmd=$cmd" --output $INTERNAL --off"
+ else
+ if [[ "$activeOutput" == *"$HDMI"* ]]; then
+ cmd=$cmd" --output $INTERNAL --auto --right-of $HDMI"
+ else
+ cmd=$cmd" --output $INTERNAL --auto --primary"
+ fi
+ fi
+ ;;
+ $HDMI)
+ if [[ "$activeOutput" == *"$HDMI"* ]]; then
+ cmd=$cmd" --output $HDMI --off"
+ else
+ if [[ "$activeOutput" == *"$VGA"* ]]; then
+ cmd=$cmd" --output $HDMI --auto --primary"
+ else
+ cmd=$cmd" --output $HDMI --auto --right-of $INTERNAL"
+ fi
+ fi
+ ;;
+ $VGA)
+ if [[ "$activeOutput" == *"$VGA"* ]]; then
+ cmd=$cmd" --output $VGA --off"
+ else
+ if [[ "$activeOutput" == *"$HDMI"* ]]; then
+ cmd=$cmd" --output $VGA --auto --left-of $HDMI"
+ else
+ cmd=$cmd" --output $VGA --auto --right-of $INTERNAL"
+ fi
+ fi
+ ;;
+ esac
+ ;;
+esac
+cmd_exec
diff --git a/local/bin/system-backup b/local/bin/system-backup
new file mode 100755
index 0000000..18b85bc
--- /dev/null
+++ b/local/bin/system-backup
@@ -0,0 +1,58 @@
+#!/bin/bash
+# vim:ft=sh
+# New line separated list of all directories to backup
+read -d '' DIRS <<-"_EOF_"
+/etc
+/home
+/home_hdd
+_EOF_
+# Directory where backup will be stored
+BACKUP=backup
+# Directory where backup will be mounted
+MBACKUP=/media/backup-hdd
+# UUID of disk
+UUID=21e0c8dd-77cc-44f1-b2bd-bb238d142e7f
+####################################################################
+# Check if running as root
+if [ `id -u` -ne "0" ]; then
+ echo Please run this as root.
+ exit 1
+fi
+# Mount backup disk if available
+PART=$(lsblk -fpl | grep "$UUID" | awk '{print $1}')
+if [ -z "$PART" ]; then
+ echo Disk not detected. Exiting
+ exit -1
+fi
+MPATH=$(lsblk -lp | grep "$PART" | awk '{print$7}')
+if [ -n "$MPATH" ]; then
+ echo Disk already mounted to $MPATH. Continuing with that.
+else
+ MPATH=$MBACKUP
+ mkdir -p "$MPATH"
+ mount "$PART" "$MPATH"
+fi
+
+mkdir -p "$MPATH/$BACKUP"
+while read -r DIR; do
+ echo Backing up: $DIR
+ rdiff-backup -b --exclude-device-files --exclude-fifos --exclude-sockets \
+ --terminal-verbosity=5 --print-statistics \
+ "$DIR" "$MPATH/$BACKUP/$(basename $DIR)/"
+ rdiff-backup --remove-older-than 100D --force \
+ --terminal-verbosity=5 --print-statistics \
+ "$MPATH/$BACKUP/$(basename $DIR)/"
+done <<< "$DIRS"
+
+# If we were mounting it, we should unmount it
+if [ "$MBACKUP" = "$MPATH" ]; then
+ umount "$MPATH"
+fi
+
+date +"%Y%m%d" > /home/cynerd/.backup_date
+pkill -RTMIN+13 i3blocks
+
+sync
+
+echo
+echo Backup finished
diff --git a/mutt/color b/mutt/color
new file mode 100644
index 0000000..b603f9e
--- /dev/null
+++ b/mutt/color
@@ -0,0 +1,88 @@
+## Theme kindly inspired from
+## http://nongeekshandbook.blogspot.ie/2009/03/mutt-color-configuration.html
+
+## Colours for items in the index
+color index brightcyan black ~N
+color index brightred black ~O
+color index brightyellow black ~F
+color index black green ~T
+color index brightred black ~D
+mono index bold ~N
+mono index bold ~F
+mono index bold ~T
+mono index bold ~D
+
+## Highlights inside the body of a message.
+
+## URLs
+color body brightgreen black "(http|ftp|news|telnet|finger)://[^ \"\t\r\n]*"
+color body brightgreen black "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
+mono body bold "(http|ftp|news|telnet|finger)://[^ \"\t\r\n]*"
+mono body bold "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
+
+## Email addresses.
+color body brightgreen black "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"
+
+## Header
+color header green black "^from:"
+color header green black "^to:"
+color header green black "^cc:"
+color header green black "^date:"
+color header yellow black "^newsgroups:"
+color header yellow black "^reply-to:"
+color header brightcyan black "^subject:"
+color header red black "^x-spam-rule:"
+color header green black "^x-mailer:"
+color header yellow black "^message-id:"
+color header yellow black "^Organization:"
+color header yellow black "^Organisation:"
+color header yellow black "^User-Agent:"
+color header yellow black "^message-id: .*pine"
+color header yellow black "^X-Fnord:"
+color header yellow black "^X-WebTV-Stationery:"
+
+color header red black "^x-spam-rule:"
+color header green black "^x-mailer:"
+color header yellow black "^message-id:"
+color header yellow black "^Organization:"
+color header yellow black "^Organisation:"
+color header yellow black "^User-Agent:"
+color header yellow black "^message-id: .*pine"
+color header yellow black "^X-Fnord:"
+color header yellow black "^X-WebTV-Stationery:"
+color header yellow black "^X-Message-Flag:"
+color header yellow black "^X-Spam-Status:"
+color header yellow black "^X-SpamProbe:"
+color header red black "^X-SpamProbe: SPAM"
+
+## Coloring quoted text - coloring the first 7 levels:
+color quoted cyan black
+color quoted1 yellow black
+color quoted2 red black
+color quoted3 green black
+color quoted4 cyan black
+color quoted5 yellow black
+color quoted6 red black
+color quoted7 green black
+
+## Default color definitions
+#color hdrdefault white green
+color signature brightmagenta black
+color indicator black cyan
+color attachment black green
+color error red black
+color message white black
+color search brightwhite magenta
+color status brightyellow blue
+color tree brightblue black
+color normal white black
+color tilde green black
+color bold brightyellow black
+#color underline magenta black
+color markers brightcyan black
+
+## Colour definitions when on a mono screen
+mono bold bold
+mono underline underline
+mono indicator reverse
+
diff --git a/mutt/muttemail b/mutt/muttemail
new file mode 100644
index 0000000..2b3b14e
--- /dev/null
+++ b/mutt/muttemail
@@ -0,0 +1,7 @@
+# vim: set filetype=muttrc:
+color status green default
+set folder = "~/.mail/email"
+source ~/.mutt/mailboxes
+set spoolfile = "+INBOX"
+set record = "+Sent\ Items"
+set postponed = "+Drafts"
diff --git a/mutt/muttfel b/mutt/muttfel
new file mode 100644
index 0000000..10ee924
--- /dev/null
+++ b/mutt/muttfel
@@ -0,0 +1,7 @@
+# vim: set filetype=muttrc:
+color status blue default
+set folder = "~/.mail/fel"
+source ~/.mutt/mailboxes
+set spoolfile = "+INBOX"
+set record = "+Sent\ Items"
+set postponed = "+Drafts"
diff --git a/mutt/muttgmail b/mutt/muttgmail
new file mode 100644
index 0000000..dd3d409
--- /dev/null
+++ b/mutt/muttgmail
@@ -0,0 +1,7 @@
+# vim: set filetype=muttrc:
+color status red default
+set folder = "~/.mail/gmail"
+source ~/.mutt/mailboxes
+set spoolfile = "+INBOX"
+set record = "+Sent\ Items"
+set postponed = "+Drafts"
diff --git a/mutt/muttrc b/mutt/muttrc
new file mode 100644
index 0000000..a174e30
--- /dev/null
+++ b/mutt/muttrc
@@ -0,0 +1,29 @@
+set editor="vim"
+set my_name="Karel Kočí"
+
+hdr_order Date From To Cc #Sorting emails by the given criteria (from left to right)
+set pager_index_lines= 5
+set sort = 'threads'
+set sort_aux = 'last-date-received'
+
+#set mbox_type=Maildir
+#set folder = "~/.mail"
+#set spoolfile = "+gmail/Inbox"
+#set record = "+gmail/Sent"
+#set postponed = "+gmail/Drafts"
+#set header_cache=~/.cache/mutt
+#
+#set folder = "~/.imail"
+#source ~/.mutt/mailboxes
+#set spoolfile = "+gmail/INBOX"
+#set record = "+gmail/Sent\ Items"
+#set postponed = "+gmail/Drafts"
+
+macro index <F2> ':source ~/.mutt/muttgmail<enter>c~/.mail/gmail/INBOX<enter>'
+macro index <F3> ':source ~/.mutt/muttemail<enter>c~/.mail/email/INBOX<enter>'
+macro index <F4> ':source ~/.mutt/muttfel<enter>c~/.mail/fel/INBOX<enter>'
+
+source ~/.mutt/color
+
+# As default open gmail
+source ~/.mutt/muttgmail
diff --git a/vim/.netrwhist b/vim/.netrwhist
new file mode 100644
index 0000000..a5d1aaf
--- /dev/null
+++ b/vim/.netrwhist
@@ -0,0 +1,4 @@
+let g:netrw_dirhistmax =10
+let g:netrw_dirhist_cnt =2
+let g:netrw_dirhist_1='/home/cynerd'
+let g:netrw_dirhist_2='/home'
diff --git a/vim/3rdparty/vim-pathogen/CONTRIBUTING.markdown b/vim/3rdparty/vim-pathogen/CONTRIBUTING.markdown
new file mode 100644
index 0000000..f5a62ca
--- /dev/null
+++ b/vim/3rdparty/vim-pathogen/CONTRIBUTING.markdown
@@ -0,0 +1,14 @@
+If your [commit message sucks](http://stopwritingramblingcommitmessages.com/),
+I'm not going to accept your pull request. I've explained very politely
+dozens of times that
+[my general guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
+are absolute rules on my own repositories, so I may lack the energy to
+explain it to you yet another time. And please, if I ask you to change
+something, `git commit --amend`.
+
+Beyond that, don't be shy about asking before patching. What takes you
+hours might take me minutes simply because I have both domain knowledge
+and a perverse knowledge of Vim script so vast that many would consider
+it a symptom of mental illness. On the flip side, some ideas I'll
+reject no matter how good the implementation is. "Send a patch" is an
+edge case answer in my book.
diff --git a/vim/3rdparty/vim-pathogen/README.markdown b/vim/3rdparty/vim-pathogen/README.markdown
new file mode 100644
index 0000000..00c2878
--- /dev/null
+++ b/vim/3rdparty/vim-pathogen/README.markdown
@@ -0,0 +1,141 @@
+# pathogen.vim
+
+Manage your `'runtimepath'` with ease. In practical terms, pathogen.vim
+makes it super easy to install plugins and runtime files in their own
+private directories.
+
+## Installation
+
+Install to `~/.vim/autoload/pathogen.vim`. Or copy and paste:
+
+ mkdir -p ~/.vim/autoload ~/.vim/bundle && \
+ curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
+
+If you're using Windows, change all occurrences of `~/.vim` to `~\vimfiles`.
+
+## Runtime Path Manipulation
+
+Add this to your vimrc:
+
+ execute pathogen#infect()
+
+If you're brand new to Vim and lacking a vimrc, `vim ~/.vimrc` and paste
+in the following super-minimal example:
+
+ execute pathogen#infect()
+ syntax on
+ filetype plugin indent on
+
+Now any plugins you wish to install can be extracted to a subdirectory
+under `~/.vim/bundle`, and they will be added to the `'runtimepath'`.
+Observe:
+
+ cd ~/.vim/bundle && \
+ git clone git://github.com/tpope/vim-sensible.git
+
+Now [sensible.vim](https://github.com/tpope/vim-sensible) is installed.
+If you really want to get crazy, you could set it up as a submodule in
+whatever repository you keep your dot files in. I don't like to get
+crazy.
+
+If you don't like the directory name `bundle`, you can pass a runtime relative
+glob as an argument:
+
+ execute pathogen#infect('stuff/{}')
+
+The `{}` indicates where the expansion should occur.
+
+You can also pass an absolute path instead. I keep the plugins I maintain under `~/src`, and this is how I add them:
+
+ execute pathogen#infect('bundle/{}', '~/src/vim/bundle/{}')
+
+Normally to generate documentation, Vim expects you to run `:helptags`
+on each directory with documentation (e.g., `:helptags ~/.vim/doc`).
+Provided with pathogen.vim is a `:Helptags` command that does this on
+every directory in your `'runtimepath'`. If you really want to get
+crazy, you could even invoke `Helptags` in your vimrc. I don't like to
+get crazy.
+
+Finally, pathogen.vim has a rich API that can manipulate `'runtimepath'`
+and other comma-delimited path options in ways most people will never
+need to do. If you're one of those edge cases, look at the source.
+It's well documented.
+
+## Runtime File Editing
+
+`:Vopen`, `:Vedit`, `:Vsplit`, `:Vvsplit`, `:Vtabedit`, `:Vpedit`, and
+`:Vread` have all moved to [scriptease.vim][].
+
+[scriptease.vim]: https://github.com/tpope/vim-scriptease
+
+## FAQ
+
+> Can I put pathogen.vim in a submodule like all my other plugins?
+
+Sure, stick it under `~/.vim/bundle`, and prepend the following to your
+vimrc:
+
+ runtime bundle/vim-pathogen/autoload/pathogen.vim
+
+Or if your bundles are somewhere other than `~/.vim` (say, `~/src/vim`):
+
+ source ~/src/vim/bundle/vim-pathogen/autoload/pathogen.vim
+
+> Will you accept these 14 pull requests adding a `.gitignore` for
+> `tags` so I don't see untracked changes in my dot files repository?
+
+No, but I'll teach you how to ignore `tags` globally:
+
+ git config --global core.excludesfile '~/.cvsignore'
+ echo tags >> ~/.cvsignore
+
+While any filename will work, I've chosen to follow the ancient
+tradition of `.cvsignore` because utilities like rsync use it, too.
+Clever, huh?
+
+> What about Vimballs?
+
+If you really must use one:
+
+ :e name.vba
+ :!mkdir ~/.vim/bundle/name
+ :UseVimball ~/.vim/bundle/name
+
+> Why don't my plugins load when I use Vim sessions?
+
+Vim sessions default to capturing all global options, which includes the
+`'runtimepath'` that pathogen.vim manipulates. This can cause other problems
+too, so I recommend turning that behavior off:
+
+ set sessionoptions-=options
+
+## Contributing
+
+If your [commit message sucks](http://stopwritingramblingcommitmessages.com/),
+I'm not going to accept your pull request. I've explained very politely
+dozens of times that
+[my general guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
+are absolute rules on my own repositories, so I may lack the energy to
+explain it to you yet another time. And please, if I ask you to change
+something, `git commit --amend`.
+
+Beyond that, don't be shy about asking before patching. What takes you
+hours might take me minutes simply because I have both domain knowledge
+and a perverse knowledge of Vim script so vast that many would consider
+it a symptom of mental illness. On the flip side, some ideas I'll
+reject no matter how good the implementation is. "Send a patch" is an
+edge case answer in my book.
+
+## Self-Promotion
+
+Like pathogen.vim? Follow the repository on
+[GitHub](https://github.com/tpope/vim-pathogen) and vote for it on
+[vim.org](http://www.vim.org/scripts/script.php?script_id=2332). And if
+you're feeling especially charitable, follow [tpope](http://tpo.pe/) on
+[Twitter](http://twitter.com/tpope) and
+[GitHub](https://github.com/tpope).
+
+## License
+
+Copyright (c) Tim Pope. Distributed under the same terms as Vim itself.
+See `:help license`.
diff --git a/vim/3rdparty/vim-pathogen/autoload/pathogen.vim b/vim/3rdparty/vim-pathogen/autoload/pathogen.vim
new file mode 100644
index 0000000..59a75c1
--- /dev/null
+++ b/vim/3rdparty/vim-pathogen/autoload/pathogen.vim
@@ -0,0 +1,353 @@
+" pathogen.vim - path option manipulation
+" Maintainer: Tim Pope <http://tpo.pe/>
+" Version: 2.4
+
+" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
+"
+" For management of individually installed plugins in ~/.vim/bundle (or
+" ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your
+" .vimrc is the only other setup necessary.
+"
+" The API is documented inline below.
+
+if exists("g:loaded_pathogen") || &cp
+ finish
+endif
+let g:loaded_pathogen = 1
+
+" Point of entry for basic default usage. Give a relative path to invoke
+" pathogen#interpose() (defaults to "bundle/{}"), or an absolute path to invoke
+" pathogen#surround(). Curly braces are expanded with pathogen#expand():
+" "bundle/{}" finds all subdirectories inside "bundle" inside all directories
+" in the runtime path.
+function! pathogen#infect(...) abort
+ for path in a:0 ? filter(reverse(copy(a:000)), 'type(v:val) == type("")') : ['bundle/{}']
+ if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*[{}*]'
+ call pathogen#surround(path)
+ elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)'
+ call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
+ call pathogen#surround(path . '/{}')
+ elseif path =~# '[{}*]'
+ call pathogen#interpose(path)
+ else
+ call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
+ call pathogen#interpose(path . '/{}')
+ endif
+ endfor
+ call pathogen#cycle_filetype()
+ if pathogen#is_disabled($MYVIMRC)
+ return 'finish'
+ endif
+ return ''
+endfunction
+
+" Split a path into a list.
+function! pathogen#split(path) abort
+ if type(a:path) == type([]) | return a:path | endif
+ if empty(a:path) | return [] | endif
+ let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
+ return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
+endfunction
+
+" Convert a list to a path.
+function! pathogen#join(...) abort
+ if type(a:1) == type(1) && a:1
+ let i = 1
+ let space = ' '
+ else
+ let i = 0
+ let space = ''
+ endif
+ let path = ""
+ while i < a:0
+ if type(a:000[i]) == type([])
+ let list = a:000[i]
+ let j = 0
+ while j < len(list)
+ let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
+ let path .= ',' . escaped
+ let j += 1
+ endwhile
+ else
+ let path .= "," . a:000[i]
+ endif
+ let i += 1
+ endwhile
+ return substitute(path,'^,','','')
+endfunction
+
+" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
+function! pathogen#legacyjoin(...) abort
+ return call('pathogen#join',[1] + a:000)
+endfunction
+
+" Turn filetype detection off and back on again if it was already enabled.
+function! pathogen#cycle_filetype() abort
+ if exists('g:did_load_filetypes')
+ filetype off
+ filetype on
+ endif
+endfunction
+
+" Check if a bundle is disabled. A bundle is considered disabled if its
+" basename or full name is included in the list g:pathogen_blacklist or the
+" comma delimited environment variable $VIMBLACKLIST.
+function! pathogen#is_disabled(path) abort
+ if a:path =~# '\~$'
+ return 1
+ endif
+ let sep = pathogen#slash()
+ let blacklist =
+ \ get(g:, 'pathogen_blacklist', get(g:, 'pathogen_disabled', [])) +
+ \ pathogen#split($VIMBLACKLIST)
+ if !empty(blacklist)
+ call map(blacklist, 'substitute(v:val, "[\\/]$", "", "")')
+ endif
+ return index(blacklist, fnamemodify(a:path, ':t')) != -1 || index(blacklist, a:path) != -1
+endfunction
+
+" Prepend the given directory to the runtime path and append its corresponding
+" after directory. Curly braces are expanded with pathogen#expand().
+function! pathogen#surround(path) abort
+ let sep = pathogen#slash()
+ let rtp = pathogen#split(&rtp)
+ let path = fnamemodify(a:path, ':s?[\\/]\=$??')
+ let before = filter(pathogen#expand(path), '!pathogen#is_disabled(v:val)')
+ let after = filter(reverse(pathogen#expand(path, sep.'after')), '!pathogen#is_disabled(v:val[0:-7])')
+ call filter(rtp, 'index(before + after, v:val) == -1')
+ let &rtp = pathogen#join(before, rtp, after)
+ return &rtp
+endfunction
+
+" For each directory in the runtime path, add a second entry with the given
+" argument appended. Curly braces are expanded with pathogen#expand().
+function! pathogen#interpose(name) abort
+ let sep = pathogen#slash()
+ let name = a:name
+ if has_key(s:done_bundles, name)
+ return ""
+ endif
+ let s:done_bundles[name] = 1
+ let list = []
+ for dir in pathogen#split(&rtp)
+ if dir =~# '\<after$'
+ let list += reverse(filter(pathogen#expand(dir[0:-6].name, sep.'after'), '!pathogen#is_disabled(v:val[0:-7])')) + [dir]
+ else
+ let list += [dir] + filter(pathogen#expand(dir.sep.name), '!pathogen#is_disabled(v:val)')
+ endif
+ endfor
+ let &rtp = pathogen#join(pathogen#uniq(list))
+ return 1
+endfunction
+
+let s:done_bundles = {}
+
+" Invoke :helptags on all non-$VIM doc directories in runtimepath.
+function! pathogen#helptags() abort
+ let sep = pathogen#slash()
+ for glob in pathogen#split(&rtp)
+ for dir in map(split(glob(glob), "\n"), 'v:val.sep."/doc/".sep')
+ if (dir)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir) == 2 && !empty(split(glob(dir.'*.txt'))) && (!filereadable(dir.'tags') || filewritable(dir.'tags'))
+ silent! execute 'helptags' pathogen#fnameescape(dir)
+ endif
+ endfor
+ endfor
+endfunction
+
+command! -bar Helptags :call pathogen#helptags()
+
+" Execute the given command. This is basically a backdoor for --remote-expr.
+function! pathogen#execute(...) abort
+ for command in a:000
+ execute command
+ endfor
+ return ''
+endfunction
+
+" Section: Unofficial
+
+function! pathogen#is_absolute(path) abort
+ return a:path =~# (has('win32') ? '^\%([\\/]\|\w:\)[\\/]\|^[~$]' : '^[/~$]')
+endfunction
+
+" Given a string, returns all possible permutations of comma delimited braced
+" alternatives of that string. pathogen#expand('/{a,b}/{c,d}') yields
+" ['/a/c', '/a/d', '/b/c', '/b/d']. Empty braces are treated as a wildcard
+" and globbed. Actual globs are preserved.
+function! pathogen#expand(pattern, ...) abort
+ let after = a:0 ? a:1 : ''
+ if a:pattern =~# '{[^{}]\+}'
+ let [pre, pat, post] = split(substitute(a:pattern, '\(.\{-\}\){\([^{}]\+\)}\(.*\)', "\\1\001\\2\001\\3", ''), "\001", 1)
+ let found = map(split(pat, ',', 1), 'pre.v:val.post')
+ let results = []
+ for pattern in found
+ call extend(results, pathogen#expand(pattern))
+ endfor
+ elseif a:pattern =~# '{}'
+ let pat = matchstr(a:pattern, '^.*{}[^*]*\%($\|[\\/]\)')
+ let post = a:pattern[strlen(pat) : -1]
+ let results = map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post')
+ else
+ let results = [a:pattern]
+ endif
+ let vf = pathogen#slash() . 'vimfiles'
+ call map(results, 'v:val =~# "\\*" ? v:val.after : isdirectory(v:val.vf.after) ? v:val.vf.after : isdirectory(v:val.after) ? v:val.after : ""')
+ return filter(results, '!empty(v:val)')
+endfunction
+
+" \ on Windows unless shellslash is set, / everywhere else.
+function! pathogen#slash() abort
+ return !exists("+shellslash") || &shellslash ? '/' : '\'
+endfunction
+
+function! pathogen#separator() abort
+ return pathogen#slash()
+endfunction
+
+" Convenience wrapper around glob() which returns a list.
+function! pathogen#glob(pattern) abort
+ let files = split(glob(a:pattern),"\n")
+ return map(files,'substitute(v:val,"[".pathogen#slash()."/]$","","")')
+endfunction
+
+" Like pathogen#glob(), only limit the results to directories.
+function! pathogen#glob_directories(pattern) abort
+ return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
+endfunction
+
+" Remove duplicates from a list.
+function! pathogen#uniq(list) abort
+ let i = 0
+ let seen = {}
+ while i < len(a:list)
+ if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
+ call remove(a:list,i)
+ elseif a:list[i] ==# ''
+ let i += 1
+ let empty = 1
+ else
+ let seen[a:list[i]] = 1
+ let i += 1
+ endif
+ endwhile
+ return a:list
+endfunction
+
+" Backport of fnameescape().
+function! pathogen#fnameescape(string) abort
+ if exists('*fnameescape')
+ return fnameescape(a:string)
+ elseif a:string ==# '-'
+ return '\-'
+ else
+ return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
+ endif
+endfunction
+
+" Like findfile(), but hardcoded to use the runtimepath.
+function! pathogen#runtime_findfile(file,count) abort
+ let rtp = pathogen#join(1,pathogen#split(&rtp))
+ let file = findfile(a:file,rtp,a:count)
+ if file ==# ''
+ return ''
+ else
+ return fnamemodify(file,':p')
+ endif
+endfunction
+
+" Section: Deprecated
+
+function! s:warn(msg) abort
+ echohl WarningMsg
+ echomsg a:msg
+ echohl NONE
+endfunction
+
+" Prepend all subdirectories of path to the rtp, and append all 'after'
+" directories in those subdirectories. Deprecated.
+function! pathogen#runtime_prepend_subdirectories(path) abort
+ call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#infect('.string(a:path.'/{}').')')
+ return pathogen#surround(a:path . pathogen#slash() . '{}')
+endfunction
+
+function! pathogen#incubate(...) abort
+ let name = a:0 ? a:1 : 'bundle/{}'
+ call s:warn('Change pathogen#incubate('.(a:0 ? string(a:1) : '').') to pathogen#infect('.string(name).')')
+ return pathogen#interpose(name)
+endfunction
+
+" Deprecated alias for pathogen#interpose().
+function! pathogen#runtime_append_all_bundles(...) abort
+ if a:0
+ call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#infect('.string(a:1.'/{}').')')
+ else
+ call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()')
+ endif
+ return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}')
+endfunction
+
+if exists(':Vedit')
+ finish
+endif
+
+let s:vopen_warning = 0
+
+function! s:find(count,cmd,file,lcd)
+ let rtp = pathogen#join(1,pathogen#split(&runtimepath))
+ let file = pathogen#runtime_findfile(a:file,a:count)
+ if file ==# ''
+ return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
+ endif
+ if !s:vopen_warning
+ let s:vopen_warning = 1
+ let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE'
+ else
+ let warning = ''
+ endif
+ if a:lcd
+ let path = file[0:-strlen(a:file)-2]
+ execute 'lcd `=path`'
+ return a:cmd.' '.pathogen#fnameescape(a:file) . warning
+ else
+ return a:cmd.' '.pathogen#fnameescape(file) . warning
+ endif
+endfunction
+
+function! s:Findcomplete(A,L,P)
+ let sep = pathogen#slash()
+ let cheats = {
+ \'a': 'autoload',
+ \'d': 'doc',
+ \'f': 'ftplugin',
+ \'i': 'indent',
+ \'p': 'plugin',
+ \'s': 'syntax'}
+ if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
+ let request = cheats[a:A[0]].a:A[1:-1]
+ else
+ let request = a:A
+ endif
+ let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
+ let found = {}
+ for path in pathogen#split(&runtimepath)
+ let path = expand(path, ':p')
+ let matches = split(glob(path.sep.pattern),"\n")
+ call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
+ call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
+ for match in matches
+ let found[match] = 1
+ endfor
+ endfor
+ return sort(keys(found))
+endfunction
+
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
+
+" vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=':
diff --git a/vim/autoload/autoload/pathogen.vim b/vim/autoload/autoload/pathogen.vim
new file mode 100644
index 0000000..59a75c1
--- /dev/null
+++ b/vim/autoload/autoload/pathogen.vim
@@ -0,0 +1,353 @@
+" pathogen.vim - path option manipulation
+" Maintainer: Tim Pope <http://tpo.pe/>
+" Version: 2.4
+
+" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
+"
+" For management of individually installed plugins in ~/.vim/bundle (or
+" ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your
+" .vimrc is the only other setup necessary.
+"
+" The API is documented inline below.
+
+if exists("g:loaded_pathogen") || &cp
+ finish
+endif
+let g:loaded_pathogen = 1
+
+" Point of entry for basic default usage. Give a relative path to invoke
+" pathogen#interpose() (defaults to "bundle/{}"), or an absolute path to invoke
+" pathogen#surround(). Curly braces are expanded with pathogen#expand():
+" "bundle/{}" finds all subdirectories inside "bundle" inside all directories
+" in the runtime path.
+function! pathogen#infect(...) abort
+ for path in a:0 ? filter(reverse(copy(a:000)), 'type(v:val) == type("")') : ['bundle/{}']
+ if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*[{}*]'
+ call pathogen#surround(path)
+ elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)'
+ call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
+ call pathogen#surround(path . '/{}')
+ elseif path =~# '[{}*]'
+ call pathogen#interpose(path)
+ else
+ call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
+ call pathogen#interpose(path . '/{}')
+ endif
+ endfor
+ call pathogen#cycle_filetype()
+ if pathogen#is_disabled($MYVIMRC)
+ return 'finish'
+ endif
+ return ''
+endfunction
+
+" Split a path into a list.
+function! pathogen#split(path) abort
+ if type(a:path) == type([]) | return a:path | endif
+ if empty(a:path) | return [] | endif
+ let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
+ return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
+endfunction
+
+" Convert a list to a path.
+function! pathogen#join(...) abort
+ if type(a:1) == type(1) && a:1
+ let i = 1
+ let space = ' '
+ else
+ let i = 0
+ let space = ''
+ endif
+ let path = ""
+ while i < a:0
+ if type(a:000[i]) == type([])
+ let list = a:000[i]
+ let j = 0
+ while j < len(list)
+ let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
+ let path .= ',' . escaped
+ let j += 1
+ endwhile
+ else
+ let path .= "," . a:000[i]
+ endif
+ let i += 1
+ endwhile
+ return substitute(path,'^,','','')
+endfunction
+
+" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
+function! pathogen#legacyjoin(...) abort
+ return call('pathogen#join',[1] + a:000)
+endfunction
+
+" Turn filetype detection off and back on again if it was already enabled.
+function! pathogen#cycle_filetype() abort
+ if exists('g:did_load_filetypes')
+ filetype off
+ filetype on
+ endif
+endfunction
+
+" Check if a bundle is disabled. A bundle is considered disabled if its
+" basename or full name is included in the list g:pathogen_blacklist or the
+" comma delimited environment variable $VIMBLACKLIST.
+function! pathogen#is_disabled(path) abort
+ if a:path =~# '\~$'
+ return 1
+ endif
+ let sep = pathogen#slash()
+ let blacklist =
+ \ get(g:, 'pathogen_blacklist', get(g:, 'pathogen_disabled', [])) +
+ \ pathogen#split($VIMBLACKLIST)
+ if !empty(blacklist)
+ call map(blacklist, 'substitute(v:val, "[\\/]$", "", "")')
+ endif
+ return index(blacklist, fnamemodify(a:path, ':t')) != -1 || index(blacklist, a:path) != -1
+endfunction
+
+" Prepend the given directory to the runtime path and append its corresponding
+" after directory. Curly braces are expanded with pathogen#expand().
+function! pathogen#surround(path) abort
+ let sep = pathogen#slash()
+ let rtp = pathogen#split(&rtp)
+ let path = fnamemodify(a:path, ':s?[\\/]\=$??')
+ let before = filter(pathogen#expand(path), '!pathogen#is_disabled(v:val)')
+ let after = filter(reverse(pathogen#expand(path, sep.'after')), '!pathogen#is_disabled(v:val[0:-7])')
+ call filter(rtp, 'index(before + after, v:val) == -1')
+ let &rtp = pathogen#join(before, rtp, after)
+ return &rtp
+endfunction
+
+" For each directory in the runtime path, add a second entry with the given
+" argument appended. Curly braces are expanded with pathogen#expand().
+function! pathogen#interpose(name) abort
+ let sep = pathogen#slash()
+ let name = a:name
+ if has_key(s:done_bundles, name)
+ return ""
+ endif
+ let s:done_bundles[name] = 1
+ let list = []
+ for dir in pathogen#split(&rtp)
+ if dir =~# '\<after$'
+ let list += reverse(filter(pathogen#expand(dir[0:-6].name, sep.'after'), '!pathogen#is_disabled(v:val[0:-7])')) + [dir]
+ else
+ let list += [dir] + filter(pathogen#expand(dir.sep.name), '!pathogen#is_disabled(v:val)')
+ endif
+ endfor
+ let &rtp = pathogen#join(pathogen#uniq(list))
+ return 1
+endfunction
+
+let s:done_bundles = {}
+
+" Invoke :helptags on all non-$VIM doc directories in runtimepath.
+function! pathogen#helptags() abort
+ let sep = pathogen#slash()
+ for glob in pathogen#split(&rtp)
+ for dir in map(split(glob(glob), "\n"), 'v:val.sep."/doc/".sep')
+ if (dir)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir) == 2 && !empty(split(glob(dir.'*.txt'))) && (!filereadable(dir.'tags') || filewritable(dir.'tags'))
+ silent! execute 'helptags' pathogen#fnameescape(dir)
+ endif
+ endfor
+ endfor
+endfunction
+
+command! -bar Helptags :call pathogen#helptags()
+
+" Execute the given command. This is basically a backdoor for --remote-expr.
+function! pathogen#execute(...) abort
+ for command in a:000
+ execute command
+ endfor
+ return ''
+endfunction
+
+" Section: Unofficial
+
+function! pathogen#is_absolute(path) abort
+ return a:path =~# (has('win32') ? '^\%([\\/]\|\w:\)[\\/]\|^[~$]' : '^[/~$]')
+endfunction
+
+" Given a string, returns all possible permutations of comma delimited braced
+" alternatives of that string. pathogen#expand('/{a,b}/{c,d}') yields
+" ['/a/c', '/a/d', '/b/c', '/b/d']. Empty braces are treated as a wildcard
+" and globbed. Actual globs are preserved.
+function! pathogen#expand(pattern, ...) abort
+ let after = a:0 ? a:1 : ''
+ if a:pattern =~# '{[^{}]\+}'
+ let [pre, pat, post] = split(substitute(a:pattern, '\(.\{-\}\){\([^{}]\+\)}\(.*\)', "\\1\001\\2\001\\3", ''), "\001", 1)
+ let found = map(split(pat, ',', 1), 'pre.v:val.post')
+ let results = []
+ for pattern in found
+ call extend(results, pathogen#expand(pattern))
+ endfor
+ elseif a:pattern =~# '{}'
+ let pat = matchstr(a:pattern, '^.*{}[^*]*\%($\|[\\/]\)')
+ let post = a:pattern[strlen(pat) : -1]
+ let results = map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post')
+ else
+ let results = [a:pattern]
+ endif
+ let vf = pathogen#slash() . 'vimfiles'
+ call map(results, 'v:val =~# "\\*" ? v:val.after : isdirectory(v:val.vf.after) ? v:val.vf.after : isdirectory(v:val.after) ? v:val.after : ""')
+ return filter(results, '!empty(v:val)')
+endfunction
+
+" \ on Windows unless shellslash is set, / everywhere else.
+function! pathogen#slash() abort
+ return !exists("+shellslash") || &shellslash ? '/' : '\'
+endfunction
+
+function! pathogen#separator() abort
+ return pathogen#slash()
+endfunction
+
+" Convenience wrapper around glob() which returns a list.
+function! pathogen#glob(pattern) abort
+ let files = split(glob(a:pattern),"\n")
+ return map(files,'substitute(v:val,"[".pathogen#slash()."/]$","","")')
+endfunction
+
+" Like pathogen#glob(), only limit the results to directories.
+function! pathogen#glob_directories(pattern) abort
+ return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
+endfunction
+
+" Remove duplicates from a list.
+function! pathogen#uniq(list) abort
+ let i = 0
+ let seen = {}
+ while i < len(a:list)
+ if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
+ call remove(a:list,i)
+ elseif a:list[i] ==# ''
+ let i += 1
+ let empty = 1
+ else
+ let seen[a:list[i]] = 1
+ let i += 1
+ endif
+ endwhile
+ return a:list
+endfunction
+
+" Backport of fnameescape().
+function! pathogen#fnameescape(string) abort
+ if exists('*fnameescape')
+ return fnameescape(a:string)
+ elseif a:string ==# '-'
+ return '\-'
+ else
+ return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
+ endif
+endfunction
+
+" Like findfile(), but hardcoded to use the runtimepath.
+function! pathogen#runtime_findfile(file,count) abort
+ let rtp = pathogen#join(1,pathogen#split(&rtp))
+ let file = findfile(a:file,rtp,a:count)
+ if file ==# ''
+ return ''
+ else
+ return fnamemodify(file,':p')
+ endif
+endfunction
+
+" Section: Deprecated
+
+function! s:warn(msg) abort
+ echohl WarningMsg
+ echomsg a:msg
+ echohl NONE
+endfunction
+
+" Prepend all subdirectories of path to the rtp, and append all 'after'
+" directories in those subdirectories. Deprecated.
+function! pathogen#runtime_prepend_subdirectories(path) abort
+ call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#infect('.string(a:path.'/{}').')')
+ return pathogen#surround(a:path . pathogen#slash() . '{}')
+endfunction
+
+function! pathogen#incubate(...) abort
+ let name = a:0 ? a:1 : 'bundle/{}'
+ call s:warn('Change pathogen#incubate('.(a:0 ? string(a:1) : '').') to pathogen#infect('.string(name).')')
+ return pathogen#interpose(name)
+endfunction
+
+" Deprecated alias for pathogen#interpose().
+function! pathogen#runtime_append_all_bundles(...) abort
+ if a:0
+ call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#infect('.string(a:1.'/{}').')')
+ else
+ call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()')
+ endif
+ return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}')
+endfunction
+
+if exists(':Vedit')
+ finish
+endif
+
+let s:vopen_warning = 0
+
+function! s:find(count,cmd,file,lcd)
+ let rtp = pathogen#join(1,pathogen#split(&runtimepath))
+ let file = pathogen#runtime_findfile(a:file,a:count)
+ if file ==# ''
+ return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
+ endif
+ if !s:vopen_warning
+ let s:vopen_warning = 1
+ let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE'
+ else
+ let warning = ''
+ endif
+ if a:lcd
+ let path = file[0:-strlen(a:file)-2]
+ execute 'lcd `=path`'
+ return a:cmd.' '.pathogen#fnameescape(a:file) . warning
+ else
+ return a:cmd.' '.pathogen#fnameescape(file) . warning
+ endif
+endfunction
+
+function! s:Findcomplete(A,L,P)
+ let sep = pathogen#slash()
+ let cheats = {
+ \'a': 'autoload',
+ \'d': 'doc',
+ \'f': 'ftplugin',
+ \'i': 'indent',
+ \'p': 'plugin',
+ \'s': 'syntax'}
+ if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
+ let request = cheats[a:A[0]].a:A[1:-1]
+ else
+ let request = a:A
+ endif
+ let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
+ let found = {}
+ for path in pathogen#split(&runtimepath)
+ let path = expand(path, ':p')
+ let matches = split(glob(path.sep.pattern),"\n")
+ call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
+ call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
+ for match in matches
+ let found[match] = 1
+ endfor
+ endfor
+ return sort(keys(found))
+endfunction
+
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
+
+" vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=':
diff --git a/vim/autoload/pathogen.vim b/vim/autoload/pathogen.vim
new file mode 100644
index 0000000..a13ae08
--- /dev/null
+++ b/vim/autoload/pathogen.vim
@@ -0,0 +1,347 @@
+" pathogen.vim - path option manipulation
+" Maintainer: Tim Pope <http://tpo.pe/>
+" Version: 2.3
+
+" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
+"
+" For management of individually installed plugins in ~/.vim/bundle (or
+" ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your
+" .vimrc is the only other setup necessary.
+"
+" The API is documented inline below.
+
+if exists("g:loaded_pathogen") || &cp
+ finish
+endif
+let g:loaded_pathogen = 1
+
+" Point of entry for basic default usage. Give a relative path to invoke
+" pathogen#interpose() (defaults to "bundle/{}"), or an absolute path to invoke
+" pathogen#surround(). Curly braces are expanded with pathogen#expand():
+" "bundle/{}" finds all subdirectories inside "bundle" inside all directories
+" in the runtime path.
+function! pathogen#infect(...) abort
+ for path in a:0 ? filter(reverse(copy(a:000)), 'type(v:val) == type("")') : ['bundle/{}']
+ if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*[{}*]'
+ call pathogen#surround(path)
+ elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)'
+ call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
+ call pathogen#surround(path . '/{}')
+ elseif path =~# '[{}*]'
+ call pathogen#interpose(path)
+ else
+ call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
+ call pathogen#interpose(path . '/{}')
+ endif
+ endfor
+ call pathogen#cycle_filetype()
+ if pathogen#is_disabled($MYVIMRC)
+ return 'finish'
+ endif
+ return ''
+endfunction
+
+" Split a path into a list.
+function! pathogen#split(path) abort
+ if type(a:path) == type([]) | return a:path | endif
+ if empty(a:path) | return [] | endif
+ let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
+ return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
+endfunction
+
+" Convert a list to a path.
+function! pathogen#join(...) abort
+ if type(a:1) == type(1) && a:1
+ let i = 1
+ let space = ' '
+ else
+ let i = 0
+ let space = ''
+ endif
+ let path = ""
+ while i < a:0
+ if type(a:000[i]) == type([])
+ let list = a:000[i]
+ let j = 0
+ while j < len(list)
+ let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
+ let path .= ',' . escaped
+ let j += 1
+ endwhile
+ else
+ let path .= "," . a:000[i]
+ endif
+ let i += 1
+ endwhile
+ return substitute(path,'^,','','')
+endfunction
+
+" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
+function! pathogen#legacyjoin(...) abort
+ return call('pathogen#join',[1] + a:000)
+endfunction
+
+" Turn filetype detection off and back on again if it was already enabled.
+function! pathogen#cycle_filetype() abort
+ if exists('g:did_load_filetypes')
+ filetype off
+ filetype on
+ endif
+endfunction
+
+" Check if a bundle is disabled. A bundle is considered disabled if its
+" basename or full name is included in the list g:pathogen_disabled.
+function! pathogen#is_disabled(path) abort
+ if a:path =~# '\~$'
+ return 1
+ endif
+ let sep = pathogen#slash()
+ let blacklist = map(
+ \ get(g:, 'pathogen_blacklist', get(g:, 'pathogen_disabled', [])) +
+ \ pathogen#split($VIMBLACKLIST),
+ \ 'substitute(v:val, "[\\/]$", "", "")')
+ return index(blacklist, fnamemodify(a:path, ':t')) != -1 || index(blacklist, a:path) != -1
+endfunction "}}}1
+
+" Prepend the given directory to the runtime path and append its corresponding
+" after directory. Curly braces are expanded with pathogen#expand().
+function! pathogen#surround(path) abort
+ let sep = pathogen#slash()
+ let rtp = pathogen#split(&rtp)
+ let path = fnamemodify(a:path, ':p:?[\\/]\=$??')
+ let before = filter(pathogen#expand(path), '!pathogen#is_disabled(v:val)')
+ let after = filter(reverse(pathogen#expand(path.sep.'after')), '!pathogen#is_disabled(v:val[0:-7])')
+ call filter(rtp, 'index(before + after, v:val) == -1')
+ let &rtp = pathogen#join(before, rtp, after)
+ return &rtp
+endfunction
+
+" For each directory in the runtime path, add a second entry with the given
+" argument appended. Curly braces are expanded with pathogen#expand().
+function! pathogen#interpose(name) abort
+ let sep = pathogen#slash()
+ let name = a:name
+ if has_key(s:done_bundles, name)
+ return ""
+ endif
+ let s:done_bundles[name] = 1
+ let list = []
+ for dir in pathogen#split(&rtp)
+ if dir =~# '\<after$'
+ let list += reverse(filter(pathogen#expand(dir[0:-6].name.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])')) + [dir]
+ else
+ let list += [dir] + filter(pathogen#expand(dir.sep.name), '!pathogen#is_disabled(v:val)')
+ endif
+ endfor
+ let &rtp = pathogen#join(pathogen#uniq(list))
+ return 1
+endfunction
+
+let s:done_bundles = {}
+
+" Invoke :helptags on all non-$VIM doc directories in runtimepath.
+function! pathogen#helptags() abort
+ let sep = pathogen#slash()
+ for glob in pathogen#split(&rtp)
+ for dir in map(split(glob(glob), "\n"), 'v:val.sep."/doc/".sep')
+ if (dir)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir) == 2 && !empty(split(glob(dir.'*.txt'))) && (!filereadable(dir.'tags') || filewritable(dir.'tags'))
+ silent! execute 'helptags' pathogen#fnameescape(dir)
+ endif
+ endfor
+ endfor
+endfunction
+
+command! -bar Helptags :call pathogen#helptags()
+
+" Execute the given command. This is basically a backdoor for --remote-expr.
+function! pathogen#execute(...) abort
+ for command in a:000
+ execute command
+ endfor
+ return ''
+endfunction
+
+" Section: Unofficial
+
+function! pathogen#is_absolute(path) abort
+ return a:path =~# (has('win32') ? '^\%([\\/]\|\w:\)[\\/]\|^[~$]' : '^[/~$]')
+endfunction
+
+" Given a string, returns all possible permutations of comma delimited braced
+" alternatives of that string. pathogen#expand('/{a,b}/{c,d}') yields
+" ['/a/c', '/a/d', '/b/c', '/b/d']. Empty braces are treated as a wildcard
+" and globbed. Actual globs are preserved.
+function! pathogen#expand(pattern) abort
+ if a:pattern =~# '{[^{}]\+}'
+ let [pre, pat, post] = split(substitute(a:pattern, '\(.\{-\}\){\([^{}]\+\)}\(.*\)', "\\1\001\\2\001\\3", ''), "\001", 1)
+ let found = map(split(pat, ',', 1), 'pre.v:val.post')
+ let results = []
+ for pattern in found
+ call extend(results, pathogen#expand(pattern))
+ endfor
+ return results
+ elseif a:pattern =~# '{}'
+ let pat = matchstr(a:pattern, '^.*{}[^*]*\%($\|[\\/]\)')
+ let post = a:pattern[strlen(pat) : -1]
+ return map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post')
+ else
+ return [a:pattern]
+ endif
+endfunction
+
+" \ on Windows unless shellslash is set, / everywhere else.
+function! pathogen#slash() abort
+ return !exists("+shellslash") || &shellslash ? '/' : '\'
+endfunction
+
+function! pathogen#separator() abort
+ return pathogen#slash()
+endfunction
+
+" Convenience wrapper around glob() which returns a list.
+function! pathogen#glob(pattern) abort
+ let files = split(glob(a:pattern),"\n")
+ return map(files,'substitute(v:val,"[".pathogen#slash()."/]$","","")')
+endfunction "}}}1
+
+" Like pathogen#glob(), only limit the results to directories.
+function! pathogen#glob_directories(pattern) abort
+ return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
+endfunction "}}}1
+
+" Remove duplicates from a list.
+function! pathogen#uniq(list) abort
+ let i = 0
+ let seen = {}
+ while i < len(a:list)
+ if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
+ call remove(a:list,i)
+ elseif a:list[i] ==# ''
+ let i += 1
+ let empty = 1
+ else
+ let seen[a:list[i]] = 1
+ let i += 1
+ endif
+ endwhile
+ return a:list
+endfunction
+
+" Backport of fnameescape().
+function! pathogen#fnameescape(string) abort
+ if exists('*fnameescape')
+ return fnameescape(a:string)
+ elseif a:string ==# '-'
+ return '\-'
+ else
+ return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
+ endif
+endfunction
+
+" Like findfile(), but hardcoded to use the runtimepath.
+function! pathogen#runtime_findfile(file,count) abort "{{{1
+ let rtp = pathogen#join(1,pathogen#split(&rtp))
+ let file = findfile(a:file,rtp,a:count)
+ if file ==# ''
+ return ''
+ else
+ return fnamemodify(file,':p')
+ endif
+endfunction
+
+" Section: Deprecated
+
+function! s:warn(msg) abort
+ echohl WarningMsg
+ echomsg a:msg
+ echohl NONE
+endfunction
+
+" Prepend all subdirectories of path to the rtp, and append all 'after'
+" directories in those subdirectories. Deprecated.
+function! pathogen#runtime_prepend_subdirectories(path) abort
+ call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#infect('.string(a:path.'/{}').')')
+ return pathogen#surround(a:path . pathogen#slash() . '{}')
+endfunction
+
+function! pathogen#incubate(...) abort
+ let name = a:0 ? a:1 : 'bundle/{}'
+ call s:warn('Change pathogen#incubate('.(a:0 ? string(a:1) : '').') to pathogen#infect('.string(name).')')
+ return pathogen#interpose(name)
+endfunction
+
+" Deprecated alias for pathogen#interpose().
+function! pathogen#runtime_append_all_bundles(...) abort
+ if a:0
+ call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#infect('.string(a:1.'/{}').')')
+ else
+ call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()')
+ endif
+ return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}')
+endfunction
+
+if exists(':Vedit')
+ finish
+endif
+
+let s:vopen_warning = 0
+
+function! s:find(count,cmd,file,lcd)
+ let rtp = pathogen#join(1,pathogen#split(&runtimepath))
+ let file = pathogen#runtime_findfile(a:file,a:count)
+ if file ==# ''
+ return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
+ endif
+ if !s:vopen_warning
+ let s:vopen_warning = 1
+ let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE'
+ else
+ let warning = ''
+ endif
+ if a:lcd
+ let path = file[0:-strlen(a:file)-2]
+ execute 'lcd `=path`'
+ return a:cmd.' '.pathogen#fnameescape(a:file) . warning
+ else
+ return a:cmd.' '.pathogen#fnameescape(file) . warning
+ endif
+endfunction
+
+function! s:Findcomplete(A,L,P)
+ let sep = pathogen#slash()
+ let cheats = {
+ \'a': 'autoload',
+ \'d': 'doc',
+ \'f': 'ftplugin',
+ \'i': 'indent',
+ \'p': 'plugin',
+ \'s': 'syntax'}
+ if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
+ let request = cheats[a:A[0]].a:A[1:-1]
+ else
+ let request = a:A
+ endif
+ let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
+ let found = {}
+ for path in pathogen#split(&runtimepath)
+ let path = expand(path, ':p')
+ let matches = split(glob(path.sep.pattern),"\n")
+ call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
+ call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
+ for match in matches
+ let found[match] = 1
+ endfor
+ endfor
+ return sort(keys(found))
+endfunction
+
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
+
+" vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=':
diff --git a/vim/bundle/YouCompleteMe/.github/ISSUE_TEMPLATE.md b/vim/bundle/YouCompleteMe/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..fa80b9c
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,39 @@
+# Issue Prelude
+
+**Please complete these steps and check these boxes (by putting an `x` inside
+the brackets) _before_ filing your issue:**
+
+- [ ] I have read and understood YCM's [CONTRIBUTING][cont] document.
+- [ ] I have read and understood YCM's [CODE_OF_CONDUCT][code] document.
+- [ ] I have read and understood YCM's [README][readme], **especially the
+ [Frequently Asked Questions][faq] section.**
+- [ ] I have searched YCM's issue tracker to find issues similar to the one I'm
+ about to report and couldn't find an answer to my problem. ([Example Google
+ search.][search])
+- [ ] If filing a bug report, I have included the output of `vim --version`.
+- [ ] If filing a bug report, I have included the output of `:YcmDebugInfo`.
+- [ ] If filing a bug report, I have included the output of
+ `:YcmToggleLogs stderr`.
+- [ ] If filing a bug report, I have included which OS (including specific OS
+ version) I am using.
+- [ ] If filing a bug report, I have included a minimal test case that reproduces
+ my issue.
+- [ ] **I understand this is an open-source project staffed by volunteers and
+ that any help I receive is a selfless, heartfelt _gift_ of their free time. I
+ know I am not entitled to anything and will be polite and courteous.**
+- [ ] **I understand my issue may be closed if it becomes obvious I didn't
+ actually perform all of these steps.**
+
+Thank you for adhering to this process! It ensures your issue is resolved
+quickly and that neither your nor our time is needlessly wasted.
+
+# Issue Details
+
+[If filing a bug report, please include **a list of steps** that describe how to
+reproduce the bug you are experiencing. Also include test code if relevant.]
+
+[cont]: https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md
+[code]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md
+[readme]: https://github.com/Valloric/YouCompleteMe/blob/master/README.md
+[faq]: https://github.com/Valloric/YouCompleteMe/blob/master/README.md#faq
+[search]: https://www.google.com/search?q=site%3Ahttps%3A%2F%2Fgithub.com%2FValloric%2FYouCompleteMe%2Fissues%20python%20mac
diff --git a/vim/bundle/YouCompleteMe/.github/PULL_REQUEST_TEMPLATE.md b/vim/bundle/YouCompleteMe/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..ffcf4a5
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,20 @@
+# PR Prelude
+
+Thank you for working on YCM! :)
+
+**Please complete these steps and check these boxes (by putting an `x` inside
+the brackets) _before_ filing your PR:**
+
+- [ ] I have read and understood YCM's [CONTRIBUTING][cont] document.
+- [ ] I have read and understood YCM's [CODE_OF_CONDUCT][code] document.
+- [ ] I have included tests for the changes in my PR. If not, I have included a
+ rationale for why I haven't.
+- [ ] **I understand my PR may be closed if it becomes obvious I didn't
+ actually perform all of these steps.**
+
+# Why this change is necessary and useful
+
+[Please explain **in detail** why the changes in this PR are needed.]
+
+[cont]: https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md
+[code]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md
diff --git a/vim/bundle/YouCompleteMe/.gitignore b/vim/bundle/YouCompleteMe/.gitignore
new file mode 100644
index 0000000..80c1256
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/.gitignore
@@ -0,0 +1,58 @@
+# Compiled Object files
+*.slo
+*.lo
+*.o
+
+# Compiled Dynamic libraries
+*.dll
+*.so
+*.dylib
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+
+# CMake
+CMakeCache.txt
+CMakeFiles
+Makefile
+cmake_install.cmake
+install_manifest.txt
+
+# Python
+*.py[cod]
+
+# Installer logs
+pip-log.txt
+
+# Unit test / coverage reports
+.coverage
+.tox
+nosetests.xml
+
+#Translations
+*.mo
+
+#Mr Developer
+.mr.developer.cfg
+
+# custom
+ycm_core_tests
+
+# When we use the bcp tool to copy over the parts of boost we care about, it
+# also copies some cruft files we don't need; this ignores them
+cpp/BoostParts/libs/*/build
+cpp/BoostParts/libs/*/test
+
+# These folders in cpp/llvm contain lots of upstream cruft we don't care
+# about and would rather not have in our tree...
+cpp/llvm/docs/*
+cpp/llvm/tools/clang/www/*
+
+# ... but excluding these LLVMBuild.txt files breaks the build so we need to
+# explicitely include them
+!LLVMBuild.txt
+
+# Exclude auto generated vim doc tags.
+doc/tags
diff --git a/vim/bundle/YouCompleteMe/.gitmodules b/vim/bundle/YouCompleteMe/.gitmodules
new file mode 100644
index 0000000..81b39d1
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/.gitmodules
@@ -0,0 +1,6 @@
+[submodule "third_party/requests-futures"]
+ path = third_party/requests-futures
+ url = https://github.com/ross/requests-futures
+[submodule "third_party/ycmd"]
+ path = third_party/ycmd
+ url = https://github.com/Valloric/ycmd
diff --git a/vim/bundle/YouCompleteMe/.travis.yml b/vim/bundle/YouCompleteMe/.travis.yml
new file mode 100644
index 0000000..34df1b2
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/.travis.yml
@@ -0,0 +1,47 @@
+language: generic
+os:
+ - linux
+ - osx
+sudo: false
+before_install:
+ - git submodule update --init --recursive
+install:
+ # source because it sets up env vars on some platforms
+ - source ci/travis/travis_install.sh
+script: ./run_tests.py
+env:
+ matrix:
+ - YCM_PYTHON_VERSION=2.7
+ - YCM_PYTHON_VERSION=2.6
+ - YCM_PYTHON_VERSION=3.3
+matrix:
+ exclude:
+ - os: osx
+ env: YCM_PYTHON_VERSION=2.6
+addons:
+ apt:
+ sources:
+ # The Travis apt source whitelist can be found here:
+ # https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
+ - ubuntu-toolchain-r-test # for new libstdc++
+ - george-edison55-precise-backports # for a more recent version of cmake (3.2.3)
+ packages:
+ - cmake-data
+ - cmake
+ - ninja-build
+ # Everything below is a Python build dep (though it depends on Python
+ # version). We need them because pyenv builds Python.
+ - libssl-dev
+ - zlib1g-dev
+ - libbz2-dev
+ - libreadline-dev
+ - libsqlite3-dev
+ - wget
+ - curl
+ - llvm
+ - libncurses5-dev
+ - libncursesw5-dev
+cache:
+ directories:
+ - $HOME/.cache/pip # Python packages from pip
+ - $HOME/.pyenv # pyenv
diff --git a/vim/bundle/YouCompleteMe/CODE_OF_CONDUCT.md b/vim/bundle/YouCompleteMe/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..e39575f
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/CODE_OF_CONDUCT.md
@@ -0,0 +1,50 @@
+# Contributor Code of Conduct
+
+As contributors and maintainers of this project, and in the interest of
+fostering an open and welcoming community, we pledge to respect all people who
+contribute through reporting issues, posting feature requests, updating
+documentation, submitting pull requests or patches, and other activities.
+
+We are committed to making participation in this project a harassment-free
+experience for everyone, regardless of level of experience, gender, gender
+identity and expression, sexual orientation, disability, personal appearance,
+body size, race, ethnicity, age, religion, or nationality.
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery
+* Personal attacks
+* Trolling or insulting/derogatory comments
+* Public or private harassment
+* Publishing other's private information, such as physical or electronic
+ addresses, without explicit permission
+* Other unethical or unprofessional conduct
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+By adopting this Code of Conduct, project maintainers commit themselves to
+fairly and consistently applying these principles to every aspect of managing
+this project. Project maintainers who do not follow or enforce the Code of
+Conduct may be permanently removed from the project team.
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community.
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting a project maintainer at val@markovic.io. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. Maintainers are
+obligated to maintain confidentiality with regard to the reporter of an
+incident.
+
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 1.3.0, available at
+[http://contributor-covenant.org/version/1/3/0/][version]
+
+[homepage]: http://contributor-covenant.org
+[version]: http://contributor-covenant.org/version/1/3/0/
diff --git a/vim/bundle/YouCompleteMe/CONTRIBUTING.md b/vim/bundle/YouCompleteMe/CONTRIBUTING.md
new file mode 100644
index 0000000..d3e158f
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/CONTRIBUTING.md
@@ -0,0 +1,112 @@
+Writing good issue reports
+==========================
+
+First things first: **the issue tracker is NOT for tech support**. It is for
+reporting bugs and requesting features. If your issue amounts to "I can't get
+YCM to work on my machine" and the reason why is obviously related to your
+machine configuration and the problem would not be resolved with _reasonable_
+changes to the YCM codebase, then the issue is likely to be closed.
+
+**A good place to ask questions is the [ycm-users][] Google group**. Rule of
+thumb: if you're not sure whether your problem is a real bug, ask on the group.
+
+**YCM compiles just fine**; [the build bots say so][build-bots]. If the bots are
+green and YCM doesn't compile on your machine, then _your machine is the root
+cause_. Now read the first paragraph again.
+
+Realize that quite literally _thousands_ of people have gotten YCM to work
+successfully so if you can't, it's probably because you have a peculiar
+system/Vim configuration or you didn't go through the docs carefully enough.
+It's very unlikely to be caused by an actual bug in YCM because someone would
+have already found it and reported it.
+
+This leads us to point #2: **make sure you have checked the docs before
+reporting an issue**. The docs are extensive and cover a ton of things; there's
+also an FAQ at the bottom that quite possibly addresses your problem.
+
+Further, **search the issue tracker for similar issues** before creating a new
+one. There's no point in duplication; if an existing issue addresses your
+problem, please comment there instead of creating a duplicate.
+
+You should also **search the archives of the [ycm-users][] mailing list**.
+
+Lastly, **make sure you are running the latest version of YCM**. The issue you
+have encountered may have already been fixed. **Don't forget to recompile
+ycm_core.so too** (usually by just running `install.py` again).
+
+OK, so we've reached this far. You need to create an issue. First realize that
+the time it takes to fix your issue is a multiple of how long it takes the
+developer to reproduce it. The easier it is to reproduce, the quicker it'll be
+fixed.
+
+Here are the things you should do when creating an issue:
+
+1. **Write a step-by-step procedure that when performed repeatedly reproduces
+ your issue.** If we can't reproduce the issue, then we can't fix it. It's
+ that simple.
+2. Put the following options in your vimrc:
+
+ ```viml
+ let g:ycm_server_keep_logfiles = 1
+ let g:ycm_server_log_level = 'debug'
+ ```
+
+ Run `:YcmToggleLogs stderr` in vim to open the logfile. Attach the contents
+ of this file to your issue.
+3. Add the output of the `:YcmDebugInfo` command.
+4. **Create a test case for your issue**. This is critical. Don't talk about how
+ "when I have X in my file" or similar, _create a file with X in it_ and put
+ the contents inside code blocks in your issue description. Try to make this
+ test file _as small as possible_. Don't just paste a huge, 500 line source
+ file you were editing and present that as a test. _Minimize_ the file so that
+ the problem is reproduced with the smallest possible amount of test data.
+5. **Include your OS and OS version.**
+6. **Include the output of `vim --version`.**
+
+
+Creating good pull requests
+===========================
+
+1. **Follow the code style of the existing codebase.**
+ - The Python code **DOES NOT** follow PEP 8. This is not an oversight, this
+ is by choice. You can dislike this as much as you want, but you still need
+ to follow the existing style. Look at other Python files to see what the
+ style is.
+ - The C++ code has an automated formatter (`style_format.sh` that runs
+ `astyle`) but it's not perfect. Again, look at the other C++ files and
+ match the code style you see.
+ - Same thing for VimScript. Match the style of the existing code.
+
+2. **Your code needs to be well written and easy to maintain**. This is of the
+ _utmost_ importance. Other people will have to maintain your code so don't
+ just throw stuff against the wall until things kinda work.
+
+3. **Split your pull request into several smaller ones if possible.** This
+ makes it easier to review your changes, which means they will be merged
+ faster.
+
+4. **Write tests for your code**. If you're changing the VimScript code then
+ you don't have to since it's hard to test that code. This is also why you
+ should strive to implement your change in Python if at all possible (and if
+ it makes sense to do so). Python is also _much_ faster than VimScript.
+
+5. **Explain in detail why your pull request makes sense.** Ask yourself, would
+ this feature be helpful to others? Not just a few people, but a lot of YCM’s
+ users? See, good features are useful to many. If your feature is only useful
+ to you and _maybe_ a couple of others, then that’s not a good feature.
+ There is such a thing as “feature overload”. When software accumulates so
+ many features of which most are only useful to a handful, then that software
+ has become “bloated”. We don’t want that.
+
+ Requests for features that are obscure or are helpful to but a few, or are
+ not part of YCM's "vision" will be rejected. Yes, even if you provide a
+ patch that completely implements it.
+
+ Please include details on exactly what you would like to see, and why. The
+ why is important - it's not always clear why a feature is really useful. And
+ sometimes what you want can be done in a different way if the reason for the
+ change is known. _What goal is your change trying to accomplish?_
+
+
+[build-bots]: https://travis-ci.org/Valloric/YouCompleteMe
+[ycm-users]: https://groups.google.com/forum/?hl=en#!forum/ycm-users
diff --git a/vim/bundle/YouCompleteMe/COPYING.txt b/vim/bundle/YouCompleteMe/COPYING.txt
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/COPYING.txt
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/vim/bundle/YouCompleteMe/README.md b/vim/bundle/YouCompleteMe/README.md
new file mode 100644
index 0000000..fb8a9e7
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/README.md
@@ -0,0 +1,2920 @@
+YouCompleteMe: a code-completion engine for Vim
+===============================================
+
+[![Build Status](https://travis-ci.org/Valloric/YouCompleteMe.svg?branch=master)](https://travis-ci.org/Valloric/YouCompleteMe)
+[![Build status](https://ci.appveyor.com/api/projects/status/ag9uqwi8s6btwjd8/branch/master?svg=true)](https://ci.appveyor.com/project/Valloric/YouCompleteMe)
+
+- [Intro](#intro)
+- [Installation](#installation)
+ - [Mac OS X](#mac-os-x)
+ - [Ubuntu Linux x64](#ubuntu-linux-x64)
+ - [Fedora Linux x64](#fedora-linux-x64)
+ - [Windows](#windows)
+ - [FreeBSD/OpenBSD](#freebsdopenbsd)
+ - [Full Installation Guide](#full-installation-guide)
+- [Quick Feature Summary](#quick-feature-summary)
+- [User Guide](#user-guide)
+ - [General Usage](#general-usage)
+ - [Client-Server Architecture](#client-server-architecture)
+ - [Completion String Ranking](#completion-string-ranking)
+ - [General Semantic Completion](#general-semantic-completion)
+ - [C-family Semantic Completion](#c-family-semantic-completion)
+ - [JavaScript Semantic Completion](#javascript-semantic-completion)
+ - [Rust Semantic Completion](#rust-semantic-completion)
+ - [Python Semantic Completion](#python-semantic-completion)
+ - [Semantic Completion for Other Languages](#semantic-completion-for-other-languages)
+ - [Writing New Semantic Completers](#writing-new-semantic-completers)
+ - [Diagnostic Display](#diagnostic-display)
+ - [Diagnostic Highlighting Groups](#diagnostic-highlighting-groups)
+- [Commands](#commands)
+ - [YcmCompleter subcommands](#ycmcompleter-subcommands)
+ - [GoTo Commands](#goto-commands)
+ - [Semantic Information Commands](#semantic-information-commands)
+ - [Refactoring and FixIt Commands](#refactoring-and-fixit-commands)
+ - [Miscellaneous Commands](#miscellaneous-commands)
+- [Functions](#functions)
+- [Autocommands](#autocommands)
+- [Options](#options)
+- [FAQ](#faq)
+- [Contributor Code of Conduct](#contributor-code-of-conduct)
+- [Contact](#contact)
+- [License](#license)
+
+Intro
+-----
+
+YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for
+[Vim][]. It has several completion engines:
+
+- an identifier-based engine that works with every programming language,
+- a [Clang][]-based engine that provides native semantic code
+ completion for C/C++/Objective-C/Objective-C++ (from now on referred to as
+ "the C-family languages"),
+- a [Jedi][]-based completion engine for Python 2 and 3 (using the [JediHTTP][] wrapper),
+- an [OmniSharp][]-based completion engine for C#,
+- a combination of [Gocode][] and [Godef][] semantic engines for Go,
+- a [TSServer][]-based completion engine for TypeScript,
+- a [Tern][]-based completion engine for JavaScript,
+- a [racer][]-based completion engine for Rust,
+- and an omnifunc-based completer that uses data from Vim's omnicomplete system
+ to provide semantic completions for many other languages (Ruby, PHP etc.).
+
+![YouCompleteMe GIF demo](http://i.imgur.com/0OP4ood.gif)
+
+Here's an explanation of what happens in the short GIF demo above.
+
+First, realize that **no keyboard shortcuts had to be pressed** to get the list
+of completion candidates at any point in the demo. The user just types and the
+suggestions pop up by themselves. If the user doesn't find the completion
+suggestions relevant and/or just wants to type, they can do so; the completion
+engine will not interfere.
+
+When the user sees a useful completion string being offered, they press the TAB
+key to accept it. This inserts the completion string. Repeated presses of the
+TAB key cycle through the offered completions.
+
+If the offered completions are not relevant enough, the user can continue typing
+to further filter out unwanted completions.
+
+A critical thing to notice is that the completion **filtering is NOT based on
+the input being a string prefix of the completion** (but that works too). The
+input needs to be a _[subsequence][] match_ of a completion. This is a fancy way
+of saying that any input characters need to be present in a completion string in
+the order in which they appear in the input. So `abc` is a subsequence of
+`xaybgc`, but not of `xbyxaxxc`. After the filter, a complicated sorting system
+ranks the completion strings so that the most relevant ones rise to the top of
+the menu (so you usually need to press TAB just once).
+
+**All of the above works with any programming language** because of the
+identifier-based completion engine. It collects all of the identifiers in the
+current file and other files you visit (and your tags files) and searches them
+when you type (identifiers are put into per-filetype groups).
+
+The demo also shows the semantic engine in use. When the user presses `.`, `->`
+or `::` while typing in insert mode (for C++; different triggers are used for
+other languages), the semantic engine is triggered (it can also be triggered
+with a keyboard shortcut; see the rest of the docs).
+
+The last thing that you can see in the demo is YCM's diagnostic display features
+(the little red X that shows up in the left gutter; inspired by [Syntastic][])
+if you are editing a C-family file. As Clang compiles your file and detects
+warnings or errors, they will be presented in various ways. You don't need to
+save your file or press any keyboard shortcut to trigger this, it "just happens"
+in the background.
+
+In essence, YCM obsoletes the following Vim plugins because it has all of their
+features plus extra:
+
+- clang_complete
+- AutoComplPop
+- Supertab
+- neocomplcache
+
+**And that's not all...**
+
+YCM also provides [semantic IDE-like features](#quick-feature-summary) in a
+number of languages, including:
+
+- finding declarations, definitions, usages, etc. of identifiers,
+- displaying type information for classes, variables, functions etc.,
+- displaying documentation for methods, members, etc. in the preview window,
+- fixing common coding errors, like missing semi-colons, typos, etc.,
+- semantic renaming of variables across files (JavaScript only).
+
+Features vary by file type, so make sure to check out the [file type feature
+summary](#quick-feature-summary) and the
+[full list of completer subcommands](#ycmcompleter-subcommands) to
+find out what's available for your favourite languages.
+
+You'll also find that YCM has filepath completers (try typing `./` in a file)
+and a completer that integrates with [UltiSnips][].
+
+Installation
+------------
+
+### Mac OS X
+
+Please refer to the full Installation Guide below; the following commands are
+provided on a best-effort basis and may not work for you.
+
+Install the latest version of [MacVim][]. Yes, MacVim. And yes, the _latest_.
+
+If you don't use the MacVim GUI, it is recommended to use the Vim binary that is
+inside the MacVim.app package (`MacVim.app/Contents/MacOS/Vim`). To ensure it
+works correctly copy the `mvim` script from the [MacVim][] download to your
+local binary folder (for example `/usr/local/bin/mvim`) and then symlink it:
+
+ ln -s /usr/local/bin/mvim vim
+
+Install YouCompleteMe with [Vundle][].
+
+**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
+using Vundle and the ycm_core library APIs have changed (happens
+rarely), YCM will notify you to recompile it. You should then rerun the install
+process.
+
+**NOTE:** If you want C-family completion, you MUST have the latest Xcode
+installed along with the latest Command Line Tools (they are installed
+automatically when you run `clang` for the first time, or manually by running
+`xcode-select --install`)
+
+Install CMake. Preferably with [Homebrew][brew], but here's the [stand-alone
+CMake installer][cmake-download].
+
+_If_ you have installed a Homebrew Python and/or Homebrew MacVim, see the _FAQ_
+for details.
+
+Compiling YCM **with** semantic support for C-family languages:
+
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --clang-completer
+
+Compiling YCM **without** semantic support for C-family languages:
+
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py
+
+The following additional language support options are available:
+
+- C# support: install Mono with [Homebrew][brew] or by downloading the [Mono Mac
+ package][mono-install-osx] and add `--omnisharp-completer` when calling
+ `./install.py`.
+- Go support: install [Go][go-install] and add `--gocode-completer` when calling
+ `./install.py`.
+- TypeScript support: install [Node.js and npm][npm-install] then install the
+ TypeScript SDK with `npm install -g typescript`.
+- JavaScript support: install [Node.js and npm][npm-install] and add
+ `--tern-completer` when calling `./install.py`.
+- Rust support: install [Rust][rust-install] and add
+ `--racer-completer` when calling `./install.py`.
+
+To simply compile with everything enabled, there's a `--all` flag. So, to
+install with all language features, ensure `xbuild`, `go`, `tsserver`, `node`,
+`npm`, `rustc`, and `cargo` tools are installed and in your `PATH`, then
+simply run:
+
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --all
+
+That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
+Don't forget that if you want the C-family semantic completion engine to work,
+you will need to provide the compilation flags for your project to YCM. It's all
+in the User Guide.
+
+YCM comes with sane defaults for its options, but you still may want to take a
+look at what's available for configuration. There are a few interesting options
+that are conservatively turned off by default that you may want to turn on.
+
+### Ubuntu Linux x64
+
+Please refer to the full Installation Guide below; the following commands are
+provided on a best-effort basis and may not work for you.
+
+Make sure you have Vim 7.3.598 with python2 or python3 support. Ubuntu 14.04 and
+later have a Vim that's recent enough. You can see the version of Vim installed
+by running `vim --version`. If the version is too old, you may need to [compile
+Vim from source][vim-build] (don't worry, it's easy).
+
+Install YouCompleteMe with [Vundle][].
+
+**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
+using Vundle and the ycm_core library APIs have changed (happens
+rarely), YCM will notify you to recompile it. You should then rerun the install
+process.
+
+Install development tools and CMake: `sudo apt-get install build-essential cmake`
+
+Make sure you have Python headers installed: `sudo apt-get install python-dev
+python3-dev`.
+
+Compiling YCM **with** semantic support for C-family languages:
+
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --clang-completer
+
+Compiling YCM **without** semantic support for C-family languages:
+
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py
+
+The following additional language support options are available:
+
+- C# support: install [Mono][mono-install-ubuntu] and add `--omnisharp-completer`
+ when calling `./install.py`.
+- Go support: install [Go][go-install] and add `--gocode-completer` when calling
+ `./install.py`.
+- TypeScript support: install [Node.js and npm][npm-install] then install the
+ TypeScript SDK with `npm install -g typescript`.
+- JavaScript support: install [Node.js and npm][npm-install] and add
+ `--tern-completer` when calling `./install.py`.
+- Rust support: install [Rust][rust-install] and add `--racer-completer` when
+ calling `./install.py`.
+
+To simply compile with everything enabled, there's a `--all` flag. So, to
+install with all language features, ensure `xbuild`, `go`, `tsserver`, `node`,
+`npm`, `rustc`, and `cargo` tools are installed and in your `PATH`, then
+simply run:
+
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --all
+
+That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
+Don't forget that if you want the C-family semantic completion engine to work,
+you will need to provide the compilation flags for your project to YCM. It's all
+in the User Guide.
+
+YCM comes with sane defaults for its options, but you still may want to take a
+look at what's available for configuration. There are a few interesting options
+that are conservatively turned off by default that you may want to turn on.
+
+### Fedora Linux x64
+
+Please refer to the full Installation Guide below; the following commands are
+provided on a best-effort basis and may not work for you.
+
+Make sure you have Vim 7.3.598 with Python 2 or Python 3 support. Fedora 21 and
+later have a Vim that's recent enough. You can see the version of Vim installed
+by running `vim --version`. If the version is too old, you may need to [compile
+Vim from source][vim-build] (don't worry, it's easy).
+
+Install YouCompleteMe with [Vundle][].
+
+**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
+using Vundle and the ycm_core library APIs have changed (happens
+rarely), YCM will notify you to recompile it. You should then rerun the install
+process.
+
+Install development tools and CMake: `sudo dnf install automake gcc gcc-c++ kernel-devel cmake`
+
+Make sure you have Python headers installed: `sudo dnf install python-devel
+python3-devel`.
+
+Compiling YCM **with** semantic support for C-family languages:
+
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --clang-completer
+
+Compiling YCM **without** semantic support for C-family languages:
+
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py
+
+The following additional language support options are available:
+
+- C# support: install [Mono][mono-install-fedora] and add `--omnisharp-completer`
+ when calling `./install.py`.
+- Go support: install [Go][go-install] and add `--gocode-completer` when calling
+ `./install.py`.
+- TypeScript support: install [Node.js and npm][npm-install] then install the
+ TypeScript SDK with `npm install -g typescript`.
+- JavaScript support: install [Node.js and npm][npm-install] and add
+ `--tern-completer` when calling `./install.py`.
+- Rust support: install [Rust][rust-install] and add `--racer-completer` when
+ calling `./install.py`.
+
+To simply compile with everything enabled, there's a `--all` flag. So, to
+install with all language features, ensure `xbuild`, `go`, `tsserver`, `node`,
+`npm`, `rustc`, and `cargo` tools are installed and in your `PATH`, then
+simply run:
+
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --all
+
+That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
+Don't forget that if you want the C-family semantic completion engine to work,
+you will need to provide the compilation flags for your project to YCM. It's all
+in the User Guide.
+
+YCM comes with sane defaults for its options, but you still may want to take a
+look at what's available for configuration. There are a few interesting options
+that are conservatively turned off by default that you may want to turn on.
+
+### Windows
+
+Please refer to the full Installation Guide below; the following commands are
+provided on a best-effort basis and may not work for you.
+
+**Important:** we assume that you are using the `cmd.exe` command prompt and
+that you know how to add an executable to the PATH environment variable.
+
+Make sure you have at least Vim 7.3.598 with Python 2 or Python 3 support. You
+can check the version and which Python is supported by typing `:version` inside
+Vim. Look at the features included: `+python/dyn` for Python 2 and
+`+python3/dyn` for Python 3. Take note of the Vim architecture, i.e. 32 or
+64-bit. It will be important when choosing the Python installer. We recommend
+using a 64-bit client. [Daily updated copies of 32-bit and 64-bit Vim with
+Python 2 and Python 3 support][vim-win-download] are available.
+
+Install YouCompleteMe with [Vundle][].
+
+**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
+using Vundle and the ycm_core library APIs have changed (happens
+rarely), YCM will notify you to recompile it. You should then rerun the install
+process.
+
+Download and install the following software:
+
+- [Python 2 or Python 3][python-win-download]. Be sure to pick the version
+corresponding to your Vim architecture. It is _Windows x86_ for a 32-bit Vim and
+_Windows x86-64_ for a 64-bit Vim. We recommend installing Python 3.
+- [CMake][cmake-download]. Add CMake executable to the PATH environment
+variable.
+- [Visual Studio][visual-studio-download]. Download the community edition.
+During setup, choose _Custom_ as the installation type and select the _Visual
+C++_ component.
+- [7-zip][7z-download]. Required to build YCM with semantic support for
+C-family languages.
+
+Compiling YCM **with** semantic support for C-family languages:
+
+ cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
+ install.py --clang-completer
+
+Compiling YCM **without** semantic support for C-family languages:
+
+ cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
+ install.py
+
+The following additional language support options are available:
+
+- C# support: add `--omnisharp-completer` when calling `install.py`.
+ Be sure that [the build utility `msbuild` is in your PATH][add-msbuild-to-path].
+- Go support: install [Go][go-install] and add `--gocode-completer` when calling
+ `install.py`.
+- TypeScript support: install [Node.js and npm][npm-install] then install the
+ TypeScript SDK with `npm install -g typescript`.
+- JavaScript support: install [Node.js and npm][npm-install] and add
+ `--tern-completer` when calling `install.py`.
+- Rust support: install [Rust][rust-install] and add `--racer-completer` when
+ calling `install.py`.
+
+To simply compile with everything enabled, there's a `--all` flag. So, to
+install with all language features, ensure `msbuild`, `go`, `tsserver`, `node`,
+`npm`, and `cargo` tools are installed and in your `PATH`, then simply run:
+
+ cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
+ python install.py --all
+
+You can specify the Microsoft Visual C++ (MSVC) version using the `--msvc`
+option. YCM officially supports MSVC 11 (Visual Studio 2012), 12 (2013), and 14
+(2015).
+
+That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
+Don't forget that if you want the C-family semantic completion engine to work,
+you will need to provide the compilation flags for your project to YCM. It's all
+in the User Guide.
+
+YCM comes with sane defaults for its options, but you still may want to take a
+look at what's available for configuration. There are a few interesting options
+that are conservatively turned off by default that you may want to turn on.
+
+### FreeBSD/OpenBSD
+
+Please refer to the full Installation Guide below; the following commands are
+provided on a best-effort basis and may not work for you. OpenBSD / FreeBSD are
+not officially supported platforms by YCM.
+
+Make sure you have Vim 7.3.598 with Python 2 or Python 3 support.
+
+OpenBSD 5.5 and later have a Vim that's recent enough. You can see the version of
+Vim installed by running `vim --version`.
+
+FreeBSD 10.x comes with clang compiler but not the libraries needed to install.
+
+ pkg install llvm35 boost-all boost-python-libs clang35
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/llvm35/lib/
+
+Install YouCompleteMe with [Vundle][].
+
+**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
+using Vundle and the ycm_core library APIs have changed (happens
+rarely), YCM will notify you to recompile it. You should then rerun the install
+process.
+
+Install dependencies and CMake: `sudo pkg_add llvm boost cmake`
+
+Compiling YCM **with** semantic support for C-family languages:
+
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --clang-completer --system-libclang --system-boost
+
+Compiling YCM **without** semantic support for C-family languages:
+
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --system-boost
+
+The following additional language support options are available:
+
+- C# support: install Mono and add `--omnisharp-completer` when calling
+ `./install.py`.
+- Go support: install [Go][go-install] and add `--gocode-completer` when calling
+ `./install.py`.
+- TypeScript support: install [Node.js and npm][npm-install] then install the
+ TypeScript SDK with `npm install -g typescript`.
+- JavaScript support: install [Node.js and npm][npm-install] and add
+ `--tern-completer` when calling `./install.py`.
+- Rust support: install [Rust][rust-install] and add `--racer-completer` when
+ calling `./install.py`.
+
+To simply compile with everything enabled, there's a `--all` flag. So, to
+install with all language features, ensure `xbuild`, `go`, `tsserver`, `node`,
+`npm`, and `cargo` tools are installed and in your `PATH`, then simply run:
+
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --all
+
+That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
+Don't forget that if you want the C-family semantic completion engine to work,
+you will need to provide the compilation flags for your project to YCM. It's all
+in the User Guide.
+
+YCM comes with sane defaults for its options, but you still may want to take a
+look at what's available for configuration. There are a few interesting options
+that are conservatively turned off by default that you may want to turn on.
+
+### Full Installation Guide
+
+These are the steps necessary to get YCM working on a Unix OS and on Windows.
+
+**Note to Windows users:** we assume that you are running the `cmd.exe` command
+prompt and that the needed executables are in the PATH environment variable. Do
+not just copy the shell commands. Replace `~` by `%USERPROFILE%` in them and use
+the right Vim home directory. It should be `vimfiles` by default instead of
+`.vim`.
+
+See the _FAQ_ if you have any issues.
+
+**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
+using Vundle and the ycm_core library APIs have changed (happens
+rarely), YCM will notify you to recompile it. You should then rerun the install
+process.
+
+**Please follow the instructions carefully. Read EVERY WORD.**
+
+1. **Ensure that your version of Vim is _at least_ 7.3.598 _and_ that it has
+ support for Python 2 or Python 3 scripting**.
+
+ Inside Vim, type `:version`. Look at the first two to three lines of output;
+ it should say `Vi IMproved X.Y`, where X.Y is the major version of vim. If
+ your version is greater than 7.3, then you're all set. If your version is
+ 7.3 then look below that where it says, `Included patches: 1-Z`, where Z
+ will be some number. That number needs to be 598 or higher.
+
+ If your version of Vim is not recent enough, you may need to [compile Vim
+ from source][vim-build] (don't worry, it's easy).
+
+ After you have made sure that you have Vim 7.3.598+, type the following in
+ Vim: `:echo has('python') || has('python3')`. The output should be 1. If
+ it's 0, then get a version of Vim with Python support.
+
+ On Windows, check also if your Vim architecture is 32 or 64-bit. This is
+ critical because it must match the Python and the YCM libraries
+ architectures. We recommend using a 64-bit Vim.
+
+2. **Install YCM** with [Vundle][] (or [Pathogen][], but Vundle is a better
+ idea). With Vundle, this would mean adding a `Plugin
+ 'Valloric/YouCompleteMe'` line to your [vimrc][].
+
+ If you don't install YCM with Vundle, make sure you have run
+ `git submodule update --init --recursive` after checking out the YCM
+ repository (Vundle will do this for you) to fetch YCM's dependencies.
+
+3. [Complete this step ONLY if you care about semantic completion support for
+ C-family languages. Otherwise it's not necessary.]
+
+ **Download the latest version of `libclang`**. Clang is an open-source
+ compiler that can compile C/C++/Objective-C/Objective-C++. The `libclang`
+ library it provides is used to power the YCM semantic completion engine for
+ those languages. YCM is designed to work with libclang version 3.8 or
+ higher.
+
+ You can use the system libclang _only if you are sure it is version 3.8 or
+ higher_, otherwise don't. Even if it is, we recommend using the [official
+ binaries from llvm.org][clang-download] if at all possible. Make sure you
+ download the correct archive file for your OS.
+
+ We **STRONGLY recommend AGAINST use** of the system libclang instead of
+ the upstream compiled binaries. Random things may break. Save yourself the
+ hassle and use the upstream pre-built libclang.
+
+4. **Compile the `ycm_core` library** that YCM needs. This library
+ is the C++ engine that YCM uses to get fast completions.
+
+ You will need to have `cmake` installed in order to generate the required
+ makefiles. Linux users can install cmake with their package manager (`sudo
+ apt-get install cmake` for Ubuntu) whereas other users can [download and
+ install][cmake-download] cmake from its project site. Mac users can also get
+ it through [Homebrew][brew] with `brew install cmake`.
+
+ On a Unix OS, you need to make sure you have Python headers installed. On a
+ Debian-like Linux distro, this would be `sudo apt-get install python-dev
+ python3-dev`. On Mac they should already be present.
+
+ On Windows, you need to download and install [Python 2 or
+ Python 3][python-win-download]. Pick the version corresponding to your Vim
+ architecture. You will also need Microsoft Visual C++ (MSVC) to build YCM.
+ You can obtain it by installing [Visual Studio][visual-studio-download].
+ MSVC 11 (Visual Studio 2012), 12 (2013), and 14 (2015) are officially
+ supported.
+
+ Here we'll assume you installed YCM with Vundle. That means that the
+ top-level YCM directory is in `~/.vim/bundle/YouCompleteMe`.
+
+ We'll create a new folder where build files will be placed. Run the
+ following:
+
+ cd ~
+ mkdir ycm_build
+ cd ycm_build
+
+ Now we need to generate the makefiles. If you DON'T care about semantic
+ support for C-family languages, run the following command in the `ycm_build`
+ directory:
+
+ cmake -G "<generator>" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
+
+ where `<generator>` is `Unix Makefiles` on Unix systems and one of the
+ following Visual Studio generators on Windows:
+
+ - `Visual Studio 11 Win64`
+ - `Visual Studio 12 Win64`
+ - `Visual Studio 14 Win64`
+
+ Remove the `Win64` part in these generators if your Vim architecture is
+ 32-bit.
+
+ For those who want to use the system version of boost, you would pass
+ `-DUSE_SYSTEM_BOOST=ON` to cmake. This may be necessary on some systems
+ where the bundled version of boost doesn't compile out of the box.
+
+ NOTE: We **STRONGLY recommend AGAINST use** of the system boost instead
+ of the bundled version of boost. Random things may break. Save yourself
+ the hassle and use the bundled version of boost.
+
+ If you DO care about semantic support for C-family languages, then your
+ `cmake` call will be a bit more complicated. We'll assume you downloaded a
+ binary distribution of LLVM+Clang from llvm.org in step 3 and that you
+ extracted the archive file to folder `~/ycm_temp/llvm_root_dir` (with `bin`,
+ `lib`, `include` etc. folders right inside that folder). On Windows, you can
+ extract the files from the LLVM+Clang installer using [7-zip][7z-download].
+
+ NOTE: This _only_ works with a _downloaded_ LLVM binary package, not a
+ custom-built LLVM! See docs below for `EXTERNAL_LIBCLANG_PATH` when using a
+ custom LLVM build.
+
+ With that in mind, run the following command in the `ycm_build` directory:
+
+ cmake -G "<generator>" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
+
+ where `<generator>` is replaced like above.
+
+ Now that configuration files have been generated, compile the libraries
+ using this command:
+
+ cmake --build . --target ycm_core --config Release
+
+ The `--config Release` part is specific to Windows and will be ignored on a
+ Unix OS.
+
+ For those who want to use the system version of libclang, you would pass
+ `-DUSE_SYSTEM_LIBCLANG=ON` to cmake _instead of_ the
+ `-DPATH_TO_LLVM_ROOT=...` flag.
+
+ NOTE: We **STRONGLY recommend AGAINST use** of the system libclang instead
+ of the upstream compiled binaries. Random things may break. Save yourself
+ the hassle and use the upstream pre-built libclang.
+
+ You could also force the use of a custom libclang library with
+ `-DEXTERNAL_LIBCLANG_PATH=/path/to/libclang.so` flag (the library would end
+ with `.dylib` on a Mac). Again, this flag would be used _instead of_ the
+ other flags. **If you compiled LLVM from source, this is the flag you should
+ be using.**
+
+ Running the `cmake` command will also place the `libclang.[so|dylib|dll]` in
+ the `YouCompleteMe/third_party/ycmd` folder for you if you compiled with
+ clang support (it needs to be there for YCM to work).
+
+5. Set up support for additional languages, as desired:
+
+ - C# support: install [Mono on non-Windows platforms][mono-install]. Navigate
+ to `YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer` and run
+ `msbuild` (Windows) or `xbuild` (other platforms, using Mono) depending on
+ your platform. On Windows, be sure that [the build utility `msbuild` is in
+ your PATH][add-msbuild-to-path].
+
+ - Go support: install [Go][go-install] and add it to your path. Navigate to
+ `YouCompleteMe/third_party/ycmd/third_party/gocode` and run `go build`.
+
+ - TypeScript support: as with the quick installation, simply `npm install -g
+ typescript` after successfully installing [Node.js and npm][npm-install].
+
+ - JavaScript support: install [Node.js and npm][npm-install]. Then navigate to
+ `YouCompleteMe/third_party/ycmd/third_party/tern_runtime` and run `npm install
+ --production`
+
+ - Rust support: install [Rust][rust-install]. Navigate to
+ `YouCompleteMe/third_party/ycmd/third_party/racerd` and run
+ `cargo build --release`.
+
+That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
+Don't forget that if you want the C-family semantic completion engine to work,
+you will need to provide the compilation flags for your project to YCM. It's all
+in the User Guide.
+
+YCM comes with sane defaults for its options, but you still may want to take a
+look at what's available for configuration. There are a few interesting options
+that are conservatively turned off by default that you may want to turn on.
+
+Quick Feature Summary
+-----
+
+### General (all languages)
+
+* Super-fast identifier completer including tags files and syntax elements
+* Intelligent suggestion ranking and filtering
+* File and path suggestions
+* Suggestions from Vim's OmniFunc
+* UltiSnips snippet suggestions
+
+### C-family languages (C, C++, Objective C, Objective C++)
+
+* Semantic auto-completion
+* Real-time diagnostic display
+* Go to include/declaration/definition (`GoTo`, etc.)
+* Semantic type information for identifiers (`GetType`)
+* Automatically fix certain errors (`FixIt`)
+* View documentation comments for identifiers (`GetDoc`)
+
+### C♯
+
+* Semantic auto-completion
+* Real-time diagnostic display
+* Go to declaration/definition (`GoTo`, etc.)
+* Semantic type information for identifiers (`GetType`)
+* Automatically fix certain errors (`FixIt`)
+* Management of OmniSharp server instance
+* View documentation comments for identifiers (`GetDoc`)
+
+### Python
+
+* Intelligent auto-completion
+* Go to declaration/definition, find references (`GoTo`, `GoToReferences`)
+* View documentation comments for identifiers (`GetDoc`)
+* Restart [JediHTTP][] server using a different Python interpreter
+
+### Go
+
+* Semantic auto-completion
+* Go to definition (`GoTo`)
+* Management of `gocode` server instance
+
+### TypeScript
+
+* Semantic auto-completion
+* Renaming symbols (`RefactorRename <new name>`)
+* Go to definition, find references (`GoToDefinition`, `GoToReferences`)
+* Semantic type information for identifiers (`GetType`)
+* View documentation comments for identifiers (`GetDoc`)
+
+### JavaScript
+
+* Intelligent auto-completion
+* Renaming variables (`RefactorRename <new name>`)
+* Go to definition, find references (`GoToDefinition`, `GoToReferences`)
+* Type information for identifiers (`GetType`)
+* View documentation comments for identifiers (`GetDoc`)
+* Management of `Tern` server instance
+
+### Rust
+
+* Semantic auto-completion
+* Go to definition (`GoTo`, `GoToDefinition`, and `GoToDeclaration` are
+ identical)
+* Management of `racer` server instance
+
+User Guide
+----------
+
+### General Usage
+
+- If the offered completions are too broad, keep typing characters; YCM will
+ continue refining the offered completions based on your input.
+- Filtering is "smart-case" sensitive; if you are typing only lowercase letters,
+ then it's case-insensitive. If your input contains uppercase letters, then the
+ uppercase letters in your query must match uppercase letters in the completion
+ strings (the lowercase letters still match both). So, "foo" matches "Foo" and
+ "foo", "Foo" matches "Foo" and "FOO" but not "foo".
+- Use the TAB key to accept a completion and continue pressing TAB to cycle
+ through the completions. Use Shift-TAB to cycle backwards. Note that if you're
+ using console Vim (that is, not Gvim or MacVim) then it's likely that the
+ Shift-TAB binding will not work because the console will not pass it to Vim.
+ You can remap the keys; see the _[Options][]_ section below.
+
+Knowing a little bit about how YCM works internally will prevent confusion. YCM
+has several completion engines: an identifier-based completer that collects all
+of the identifiers in the current file and other files you visit (and your tags
+files) and searches them when you type (identifiers are put into per-filetype
+groups).
+
+There are also several semantic engines in YCM. There's a libclang-based
+completer that provides semantic completion for C-family languages. There's a
+Jedi-based completer for semantic completion for Python. There's also an
+omnifunc-based completer that uses data from Vim's omnicomplete system to
+provide semantic completions when no native completer exists for that language
+in YCM.
+
+There are also other completion engines, like the UltiSnips completer and the
+filepath completer.
+
+YCM automatically detects which completion engine would be the best in any
+situation. On occasion, it queries several of them at once, merges the
+outputs and presents the results to you.
+
+### Client-Server Architecture
+
+YCM has a client-server architecture; the Vim part of YCM is only a thin client
+that talks to the [ycmd HTTP+JSON server][ycmd] that has the vast majority of
+YCM logic and functionality. The server is started and stopped automatically as
+you start and stop Vim.
+
+### Completion String Ranking
+
+The subsequence filter removes any completions that do not match the input, but
+then the sorting system kicks in. It's actually very complicated and uses lots
+of factors, but suffice it to say that "word boundary" (WB) subsequence
+character matches are "worth" more than non-WB matches. In effect, this means
+given an input of "gua", the completion "getUserAccount" would be ranked higher
+in the list than the "Fooguxa" completion (both of which are subsequence
+matches). A word-boundary character are all capital characters, characters
+preceded by an underscore and the first letter character in the completion
+string.
+
+### General Semantic Completion
+
+- You can use Ctrl+Space to trigger the completion suggestions anywhere, even
+ without a string prefix. This is useful to see which top-level functions are
+ available for use.
+
+### C-family Semantic Completion
+
+YCM looks for a `.ycm_extra_conf.py` file in the directory of the opened file or
+in any directory above it in the hierarchy (recursively); when the file is
+found, it is loaded (only once!) as a Python module. YCM calls a `FlagsForFile`
+method in that module which should provide it with the information necessary to
+compile the current file. You can also provide a path to a global
+`.ycm_extra_conf.py` file, which will be used as a fallback. To prevent the
+execution of malicious code from a file you didn't write YCM will ask you once
+per `.ycm_extra_conf.py` if it is safe to load. This can be disabled and you can
+white-/blacklist files. See the _Options_ section for more details.
+
+This system was designed this way so that the user can perform any arbitrary
+sequence of operations to produce a list of compilation flags YCM should hand
+to Clang.
+
+[See YCM's own `.ycm_extra_conf.py`][flags_example] for details on how this
+works. You should be able to use it _as a starting point_. **Don't** just
+copy/paste that file somewhere and expect things to magically work; **your project
+needs different flags**. Hint: just replace the strings in the `flags` variable
+with compilation flags necessary for your project. That should be enough for 99%
+of projects.
+
+Yes, [Clang's `CompilationDatabase` system][compdb] is also supported. Again,
+see the above linked example file. You can get CMake to generate this file for
+you by adding `set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )` to your project's
+`CMakeLists.txt` file (if using CMake). If you're not using CMake, you could use
+something like [Bear][] to generate the `compile_commands.json` file.
+
+Consider using [YCM-Generator][ygen] to generate the `ycm_extra_conf.py` file.
+
+If Clang encounters errors when compiling the header files that your file
+includes, then it's probably going to take a long time to get completions. When
+the completion menu finally appears, it's going to have a large number of
+unrelated completion strings (type/function names that are not actually
+members). This is because Clang fails to build a precompiled preamble for your
+file if there are any errors in the included headers and that preamble is key to
+getting fast completions.
+
+Call the `:YcmDiags` command to see if any errors or warnings were detected in
+your file.
+
+### JavaScript Semantic Completion
+
+#### Quick start
+
+1. Ensure that you have enabled the Tern completer. See the
+ [installation guide](#installation) for details.
+
+2. Create a `.tern-project` file in the root directory of your JavaScript
+ project, by following the [instructions][tern-project] in the [Tern][]
+ documentation.
+
+3. Make sure that Vim's working directory is a descendent of that directory (or
+ that directory itself) when working with JavaScript files.
+
+#### Explanation
+
+JavaScript completion is based on [Tern][]. This completion engine requires a
+file named [`.tern-project`][tern-project] to exist in the current working
+directory or a directory which is an ancestor of the current working directory
+when the tern server is started. YCM starts the Tern server the first time a
+JavaScript file is edited, so Vim's working directory at that time needs to be a
+descendent of the directory containing the `.tern-project` file (or that
+directory itself).
+
+Alternatively, as described in the [Tern documentation][tern-docs], a global
+`.tern-config` file may be used.
+
+Multiple Tern servers, are not supported. To switch to a different
+JavaScript project, you can do one of the following:
+
+- start a new instance of Vim from the new project's directory
+- change Vim's working directory (`:cd /path/to/new/project`) and restart the
+ [ycmd server][ycmd] (`:YcmRestartServer`)
+- change Vim's working directory (`:cd /path/to/new/project`), open a JavaScript
+ file (or set filetype to JavaScript) and restart the Tern server using YCM
+ completer subcommands `:YcmCompleter StopServer` and `:YcmCompleter
+ StartServer`.
+
+#### Tips and tricks
+
+This section contains some advice for configuring `.tern-project` and working
+with JavaScript files. The canonical reference for correctly configuring Tern is
+the [Tern documentation][tern-docs]. Any issues, improvements, advice, etc.
+should be sought from the [Tern][] project. For example, see the [list of tern
+plugins](http://ternjs.net/doc/manual.html#plugins) for the list of plugins
+which can be enabled in the `plugins` section of the `.tern-project` file.
+
+##### Configuring Tern for node support
+
+The following simple example `.tern-project` file enables nodejs support:
+
+```json
+{
+ "plugins": {
+ "node": {}
+ }
+}
+
+```
+
+##### Configuring Tern for requirejs support
+
+The Tern requirejs plugin requires that all included "libraries" are rooted
+under the same base directory. If that's not the case for your projects, then it
+is possible to make it work with appropriate symbolic links. For example, create
+a directory `ext_lib` within your project and populate it with symlinks to your
+libraries. Then set up the `.tern-project` something like this:
+
+```json
+
+{
+ "plugins": {
+ "requirejs": {
+ "baseURL": "./ext_lib",
+ }
+ }
+}
+```
+
+Then, given the following structure:
+
+```
+./ext_lib/mylib (symlink)
+./ext_lib/anotherlib (symlink)
+```
+
+Can be used as follows:
+
+```javascript
+define( [ 'mylib/file1', 'anotherlib/anotherfile' ], function( f1, f2 ) {
+ // etc.
+} );
+```
+
+### Rust Semantic Completion
+
+Completions and GoTo commands within the current crate and its dependencies
+should work out of the box with no additional configuration (provided that you
+built YCM with the `--racer-completer` flag; see the [*Installation*
+section](#installation) for details). For semantic analysis inclusive of the
+standard library, you must have a local copy of [the rust source
+code][rust-src]. You also need to set the following option so YouCompleteMe can
+locate it.
+
+```viml
+" In this example, the rust source code zip has been extracted to
+" /usr/local/rust/rustc-1.5.0
+let g:ycm_rust_src_path = '/usr/local/rust/rustc-1.5.0/src'
+```
+
+### Python Semantic Completion
+
+Completion and GoTo commands work out of the box with no additional
+configuration. Those features are provided by the [jedi][] library which
+supports a variety of Python versions (2.6, 2.7, 3.2+) as long as it
+runs in the corresponding Python interpreter. By default YCM runs [jedi][] with
+the same Python interpreter used by the [ycmd server][ycmd], so if you would like to
+use a different interpreter, use the following option specifying the Python
+binary to use. For example, to provide Python 3 completion in your project, set:
+
+```viml
+let g:ycm_python_binary_path = '/usr/bin/python3'
+```
+
+If the value of `g:ycm_python_binary_path` is an absolute path like above it
+will be used as-is, but if it's an executable name it will be searched through
+the PATH. So for example if you set:
+
+```viml
+let g:ycm_python_binary_path = 'python'
+```
+
+YCM will use the first `python` executable it finds in the PATH to run
+[jedi][]. This means that if you are in a virtual environment and you start vim
+in that directory, the first `python` that YCM will find will be the one in the
+virtual environment, so [jedi][] will be able to provide completions for every
+package you have in the virtual environment.
+
+### Semantic Completion for Other Languages
+
+Python, C#, Go, Rust, and TypeScript are supported natively by YouCompleteMe
+using the [Jedi][], [Omnisharp][], [Gocode][], [racer][], and [TSServer][]
+engines, respectively. Check the [installation](#installation) section for
+instructions to enable these features if desired.
+
+YCM will use your `omnifunc` (see `:h omnifunc` in Vim) as a source for semantic
+completions if it does not have a native semantic completion engine for your
+file's filetype. Vim comes with okayish omnifuncs for various languages like
+Ruby, PHP etc. It depends on the language.
+
+You can get stellar omnifuncs for Java and Ruby with [Eclim][]. Just make sure
+you have the _latest_ Eclim installed and configured (this means Eclim `>= 2.2.*`
+and Eclipse `>= 4.2.*`).
+
+After installing Eclim remember to create a new Eclipse project within your
+application by typing `:ProjectCreate <path-to-your-project> -n ruby` (or `-n java`)
+inside vim and don't forget to have `let g:EclimCompletionMethod = 'omnifunc'`
+in your vimrc. This will make YCM and Eclim play nice; YCM will use Eclim's omnifuncs
+as the data source for semantic completions and provide the auto-triggering
+and subsequence-based matching (and other YCM features) on top of it.
+
+### Writing New Semantic Completers
+
+You have two options here: writing an `omnifunc` for Vim's omnicomplete system
+that YCM will then use through its omni-completer, or a custom completer for YCM
+using the [Completer API][completer-api].
+
+Here are the differences between the two approaches:
+
+- You have to use VimScript to write the omnifunc, but get to use Python to
+ write for the Completer API; this by itself should make you want to use the
+ API.
+- The Completer API is a _much_ more powerful way to integrate with YCM and it
+ provides a wider set of features. For instance, you can make your Completer
+ query your semantic back-end in an asynchronous fashion, thus not blocking
+ Vim's GUI thread while your completion system is processing stuff. This is
+ impossible with VimScript. All of YCM's completers use the Completer API.
+- Performance with the Completer API is better since Python executes faster than
+ VimScript.
+
+If you want to use the `omnifunc` system, see the relevant Vim docs with `:h
+complete-functions`. For the Completer API, see [the API docs][completer-api].
+
+If you want to upstream your completer into YCM's source, you should use the
+Completer API.
+
+### Diagnostic Display
+
+YCM will display diagnostic notifications for C-family and C# languages if you
+compiled YCM with Clang and Omnisharp support, respectively. Since YCM continuously
+recompiles your file as you type, you'll get notified of errors and warnings
+in your file as fast as possible.
+
+Here are the various pieces of the diagnostic UI:
+
+- Icons show up in the Vim gutter on lines that have a diagnostic.
+- Regions of text related to diagnostics are highlighted (by default, a red
+ wavy underline in `gvim` and a red background in `vim`).
+- Moving the cursor to a line with a diagnostic echoes the diagnostic text.
+- Vim's location list is automatically populated with diagnostic data (off by
+ default, see options).
+
+The new diagnostics (if any) will be displayed the next time you press any key
+on the keyboard. So if you stop typing and just wait for the new diagnostics to
+come in, that _will not work_. You need to press some key for the GUI to update.
+
+Having to press a key to get the updates is unfortunate, but cannot be changed
+due to the way Vim internals operate; there is no way that a background task can
+update Vim's GUI after it has finished running. You _have to_ press a key. This
+will make YCM check for any pending diagnostics updates.
+
+You _can_ force a full, blocking compilation cycle with the
+`:YcmForceCompileAndDiagnostics` command (you may want to map that command to a
+key; try putting `nnoremap <F5> :YcmForceCompileAndDiagnostics<CR>` in your
+vimrc). Calling this command will force YCM to immediately recompile your file
+and display any new diagnostics it encounters. Do note that recompilation with
+this command may take a while and during this time the Vim GUI _will_ be
+blocked.
+
+YCM will display a short diagnostic message when you move your cursor to the
+line with the error. You can get a detailed diagnostic message with the
+`<leader>d` key mapping (can be changed in the options) YCM provides when your
+cursor is on the line with the diagnostic.
+
+You can also see the full diagnostic message for all the diagnostics in the
+current file in Vim's `locationlist`, which can be opened with the `:lopen` and
+`:lclose` commands (make sure you have set `let
+g:ycm_always_populate_location_list = 1` in your vimrc). A good way to toggle
+the display of the `locationlist` with a single key mapping is provided by
+another (very small) Vim plugin called [ListToggle][] (which also makes it
+possible to change the height of the `locationlist` window), also written by
+yours truly.
+
+#### Diagnostic Highlighting Groups
+
+You can change the styling for the highlighting groups YCM uses. For the signs
+in the Vim gutter, the relevant groups are:
+
+- `YcmErrorSign`, which falls back to group `SyntasticErrorSign` and then
+ `error` if they exist
+- `YcmWarningSign`, which falls back to group `SyntasticWarningSign` and then
+ `todo` if they exist
+
+You can also style the line that has the warning/error with these groups:
+
+- `YcmErrorLine`, which falls back to group `SyntasticErrorLine` if it exists
+- `YcmWarningLine`, which falls back to group `SyntasticWarningLine` if it
+ exists
+
+Note that the line highlighting groups only work when gutter signs are turned
+on.
+
+The syntax groups used to highlight regions of text with errors/warnings:
+- `YcmErrorSection`, which falls back to group `SyntasticError` if it exists and
+ then `SpellBad`
+- `YcmWarningSection`, which falls back to group `SyntasticWarning` if it exists
+ and then `SpellCap`
+
+Here's how you'd change the style for a group:
+
+```viml
+highlight YcmErrorLine guibg=#3f0000
+```
+
+Commands
+--------
+
+### The `:YcmRestartServer` command
+
+If the [ycmd completion server][ycmd] suddenly stops for some reason, you can
+restart it with this command.
+
+### The `:YcmForceCompileAndDiagnostics` command
+
+Calling this command will force YCM to immediately recompile your file
+and display any new diagnostics it encounters. Do note that recompilation with
+this command may take a while and during this time the Vim GUI _will_ be
+blocked.
+
+You may want to map this command to a key; try putting `nnoremap <F5>
+:YcmForceCompileAndDiagnostics<CR>` in your vimrc.
+
+### The `:YcmDiags` command
+
+Calling this command will fill Vim's `locationlist` with errors or warnings if
+any were detected in your file and then open it. If a given error or warning can
+be fixed by a call to `:YcmCompleter FixIt`, then ` (FixIt available)` is
+appended to the error or warning text. See the `FixIt` completer subcommand for
+more information.
+
+NOTE: The absense of ` (FixIt available)` does not strictly imply a fix-it is
+not available as not all completers are able to provide this indication. For
+example, the c-sharp completer provides many fix-its but does not add this
+additional indication.
+
+The `g:ycm_open_loclist_on_ycm_diags` option can be used to prevent the location
+list from opening, but still have it filled with new diagnostic data. See the
+_Options_ section for details.
+
+### The `:YcmShowDetailedDiagnostic` command
+
+This command shows the full diagnostic text when the user's cursor is on the
+line with the diagnostic.
+
+### The `:YcmDebugInfo` command
+
+This will print out various debug information for the current file. Useful to
+see what compile commands will be used for the file if you're using the semantic
+completion engine.
+
+### The `:YcmToggleLogs` command
+
+This command automatically opens in windows the stdout and stderr logfiles
+written by the [ycmd server][ycmd]. If one or both logfiles are already opened,
+they are automatically closed. `stderr` or `stdout` can be specified as an
+argument of this command to only open the corresponding logfile instead of both.
+If this logfile is already opened, it will be closed. Only for debugging
+purpose.
+
+### The `:YcmCompleter` command
+
+This command gives access to a number of additional [IDE-like
+features](#quick-feature-summary) in YCM, for things like semantic GoTo, type
+information, FixIt and refactoring.
+
+Technically the command invokes completer-specific commands. If the first
+argument is of the form `ft=...` the completer for that file type will be used
+(for example `ft=cpp`), else the native completer of the current buffer will be
+used.
+Call `YcmCompleter` without further arguments for a list of the
+commands you can call for the current completer.
+
+See the [file type feature summary](#quick-feature-summary) for an overview of
+the features available for each file type. See the _YcmCompleter subcommands_
+section for more information on the available subcommands and their usage.
+
+YcmCompleter Subcommands
+------------------------
+
+NOTE: See the docs for the `YcmCompleter` command before tackling this section.
+
+The invoked subcommand is automatically routed to the currently active semantic
+completer, so `:YcmCompleter GoToDefinition` will invoke the `GoToDefinition`
+subcommand on the Python semantic completer if the currently active file is a
+Python one and on the Clang completer if the currently active file is a
+C/C++/Objective-C one.
+
+You may also want to map the subcommands to something less verbose; for
+instance, `nnoremap <leader>jd :YcmCompleter GoTo<CR>`
+maps the `<leader>jd` sequence to the longer subcommand invocation.
+
+### GoTo Commands
+
+These commands are useful for jumping around and exploring code. When moving
+the cursor, the subcommands add entries to Vim's `jumplist` so you can use
+`CTRL-O` to jump back to where you where before invoking the command (and
+`CTRL-I` to jump forward; see `:h jumplist` for details). If there is more
+than one destination, the quickfix list (see `:h quickfix`) is populated with
+the available locations and opened to full width at the bottom of the screen.
+You can change this behavior by using [the `YcmQuickFixOpened`
+autocommand](#the-ycmquickfixopened-autocommand).
+
+#### The `GoToInclude` subcommand
+
+Looks up the current line for a header and jumps to it.
+
+Supported in filetypes: `c, cpp, objc, objcpp`
+
+#### The `GoToDeclaration` subcommand
+
+Looks up the symbol under the cursor and jumps to its declaration.
+
+Supported in filetypes: `c, cpp, objc, objcpp, cs, go, python, rust`
+
+#### The `GoToDefinition` subcommand
+
+Looks up the symbol under the cursor and jumps to its definition.
+
+NOTE: For C-family languages **this only works in certain situations**, namely when
+the definition of the symbol is in the current translation unit. A translation
+unit consists of the file you are editing and all the files you are including
+with `#include` directives (directly or indirectly) in that file.
+
+Supported in filetypes: `c, cpp, objc, objcpp, cs, go, javascript, python,
+rust, typescript`
+
+#### The `GoTo` subcommand
+
+This command tries to perform the "most sensible" GoTo operation it can.
+Currently, this means that it tries to look up the symbol under the cursor and
+jumps to its definition if possible; if the definition is not accessible from
+the current translation unit, jumps to the symbol's declaration. For
+C/C++/Objective-C, it first tries to look up the current line for a header and
+jump to it. For C#, implementations are also considered and preferred.
+
+Supported in filetypes: `c, cpp, objc, objcpp, cs, go, javascript, python, rust`
+
+#### The `GoToImprecise` subcommand
+
+WARNING: This command trades correctness for speed!
+
+Same as the `GoTo` command except that it doesn't recompile the file with
+libclang before looking up nodes in the AST. This can be very useful when you're
+editing files that take long to compile but you know that you haven't made any
+changes since the last parse that would lead to incorrect jumps. When you're
+just browsing around your codebase, this command can spare you quite a bit of
+latency.
+
+Supported in filetypes: `c, cpp, objc, objcpp`
+
+#### The `GoToReferences` subcommand
+
+This command attempts to find all of the references within the project to the
+identifier under the cursor and populates the quickfix list with those
+locations.
+
+Supported in filetypes: `javascript, python, typescript`
+
+#### The `GoToImplementation` subcommand
+
+Looks up the symbol under the cursor and jumps to its implementation (i.e.
+non-interface). If there are multiple implementations, instead provides a list
+of implementations to choose from.
+
+Supported in filetypes: `cs`
+
+#### The `GoToImplementationElseDeclaration` subcommand
+
+Looks up the symbol under the cursor and jumps to its implementation if one,
+else jump to its declaration. If there are multiple implementations, instead
+provides a list of implementations to choose from.
+
+Supported in filetypes: `cs`
+
+### Semantic Information Commands
+
+These commands are useful for finding static information about the code, such
+as the types of variables, viewing declarations and documentation strings.
+
+#### The `GetType` subcommand
+
+Echos the type of the variable or method under the cursor, and where it differs,
+the derived type.
+
+For example:
+
+```c++
+ std::string s;
+```
+
+Invoking this command on `s` returns `std::string => std::basic_string<char>`
+
+NOTE: Due to limitations of `libclang`, invoking this command on the word
+`auto` typically returns `auto`. However, invoking it on a usage of the variable
+with inferred type returns the correct type, but typically it is repeated due to
+`libclang` returning that the types differ.
+
+For example:
+
+```c++
+const char *s = "String";
+auto x = &s; // invoking on x or auto returns "auto";
+ // invoking on s returns "const char *"
+std::cout << *x; // invoking on x returns "const char ** => const char **"
+```
+
+NOTE: Causes re-parsing of the current translation unit.
+
+Supported in filetypes: `c, cpp, objc, objcpp, javascript, typescript`
+
+#### The `GetParent` subcommand
+
+Echos the semantic parent of the point under the cursor.
+
+The semantic parent is the item that semantically contains the given position.
+
+For example:
+
+```c++
+class C {
+ void f();
+};
+
+void C::f() {
+
+}
+```
+
+In the out-of-line definition of `C::f`, the semantic parent is the class `C`,
+of which this function is a member.
+
+In the example above, both declarations of `C::f` have `C` as their semantic
+context, while the lexical context of the first `C::f` is `C` and the lexical
+context of the second `C::f` is the translation unit.
+
+For global declarations, the semantic parent is the translation unit.
+
+NOTE: Causes re-parsing of the current translation unit.
+
+Supported in filetypes: `c, cpp, objc, objcpp`
+
+#### The `GetDoc` subcommand
+
+Displays the preview window populated with quick info about the identifier
+under the cursor. Depending on the file type, this includes things like:
+
+* The type or declaration of identifier,
+* Doxygen/javadoc comments,
+* Python docstrings,
+* etc.
+
+Supported in filetypes: `c, cpp, objc, objcpp, cs, python, typescript,
+javascript`
+
+### Refactoring and FixIt Commands
+
+These commands make changes to your source code in order to perform refactoring
+or code correction. YouCompleteMe does not perform any action which cannot be
+undone, and never saves or writes files to the disk.
+
+#### The `FixIt` subcommand
+
+Where available, attempts to make changes to the buffer to correct the
+diagnostic closest to the cursor position.
+
+Completers which provide diagnostics may also provide trivial modifications to
+the source in order to correct the diagnostic. Examples include syntax errors
+such as missing trailing semi-colons, spurious characters, or other errors which
+the semantic engine can deterministically suggest corrections.
+
+If no fix-it is available for the current line, or there is no diagnostic on the
+current line, this command has no effect on the current buffer. If any
+modifications are made, the number of changes made to the buffer is echo'd and
+the user may use the editor's undo command to revert.
+
+When a diagnostic is available, and `g:ycm_echo_current_diagnostic` is set to 1,
+then the text ` (FixIt)` is appended to the echo'd diagnostic when the
+completer is able to add this indication. The text ` (FixIt available)` is
+also appended to the diagnostic text in the output of the `:YcmDiags` command
+for any diagnostics with available fix-its (where the completer can provide this
+indication).
+
+NOTE: Causes re-parsing of the current translation unit.
+
+NOTE: After applying a fix-it, the diagnostics UI is not immediately updated.
+This is due to a technical restriction in Vim. Moving the cursor, or issuing
+the `:YcmForceCompileAndDiagnostics` command will refresh the diagnostics.
+Repeated invocations of the `FixIt` command on a given line, however, _do_ apply
+all diagnostics as expected without requiring refreshing of the diagnostics UI.
+This is particularly useful where there are multiple diagnostics on one line, or
+where after fixing one diagnostic, another fix-it is available.
+
+Supported in filetypes: `c, cpp, objc, objcpp, cs`
+
+#### The `RefactorRename <new name>` subcommand
+
+In supported file types, this command attempts to perform a semantic rename of
+the identifier under the cursor. This includes renaming declarations,
+definitions and usages of the identifier, or any other language-appropriate
+action. The specific behavior is defined by the semantic engine in use.
+
+Similar to `FixIt`, this command applies automatic modifications to your source
+files. Rename operations may involve changes to multiple files, which may or may
+not be open in Vim buffers at the time. YouCompleteMe handles all of this for
+you. The behavior is described in [the following section](#multi-file-refactor).
+
+Supported in filetypes: `javascript` (variables only), `typescript`
+
+#### Multi-file Refactor
+
+When a Refactor or FixIt command touches multiple files, YouCompleteMe attempts
+to apply those modifications to any existing open, visible buffer in the current
+tab. If no such buffer can be found, YouCompleteMe opens the file in a new
+small horizontal split at the top of the current window, applies the change,
+and then *hides* the window. NOTE: The buffer remains open, and must be
+manually saved. A confirmation dialog is opened prior to doing this to remind
+you that this is about to happen.
+
+Once the modifications have been made, the quickfix list (see `:help quickfix`)
+is opened and populated with the locations of all modifications. This can be
+used to review all automatic changes made. Typically, use the `CTRL-W
+<enter>` combination to open the selected file in a new split. It is possible
+to customize how the quickfix window is opened by using [the `YcmQuickFixOpened`
+autocommand](#the-ycmquickfixopened-autocommand).
+
+The buffers are *not* saved automatically. That is, you must save the modified
+buffers manually after reviewing the changes from the quickfix list. Changes
+can be undone using Vim's powerful undo features (see `:help undo`). Note
+that Vim's undo is per-buffer, so to undo all changes, the undo commands must
+be applied in each modified buffer separately.
+
+NOTE: While applying modifications, Vim may find files which are already open
+and have a swap file. The command is aborted if you select Abort or Quit in any
+such prompts. This leaves the Refactor operation partially complete and must be
+manually corrected using Vim's undo features. The quickfix list is *not*
+populated in this case. Inspect `:buffers` or equivalent (see `:help buffers`)
+to see the buffers that were opened by the command.
+
+### Miscellaneous Commands
+
+These commands are for general administration, rather than IDE-like features.
+They cover things like the semantic engine server instance and compilation
+flags.
+
+#### The `ClearCompilationFlagCache` subcommand
+
+YCM caches the flags it gets from the `FlagsForFile` function in your
+`ycm_extra_conf.py` file if you return them with the `do_cache` parameter set to
+`True`. The cache is in memory and is never invalidated (unless you restart Vim
+of course).
+
+This command clears that cache entirely. YCM will then re-query your
+`FlagsForFile` function as needed in the future.
+
+Supported in filetypes: `c, cpp, objc, objcpp`
+
+#### The `StartServer` subcommand
+
+Starts the semantic-engine-as-localhost-server for those semantic engines that
+work as separate servers that YCM talks to.
+
+Supported in filetypes: `cs, go, javascript, rust`
+
+#### The `StopServer` subcommand
+
+Stops the semantic-engine-as-localhost-server for those semantic engines that
+work as separate servers that YCM talks to.
+
+Supported in filetypes: `cs, go, javascript, rust`
+
+#### The `RestartServer` subcommand
+
+Restarts the semantic-engine-as-localhost-server for those semantic engines that
+work as separate servers that YCM talks to.
+
+An additional optional argument may be supplied for Python, specifying the
+python binary to use to restart the Python semantic engine.
+
+```viml
+:YcmCompleter RestartServer /usr/bin/python3.4
+```
+
+Supported in filetypes: `cs, python, rust`
+
+#### The `ReloadSolution` subcommand
+
+Instruct the Omnisharp server to clear its cache and reload all files from disk.
+This is useful when files are added, removed, or renamed in the solution, files
+are changed outside of Vim, or whenever Omnisharp cache is out-of-sync.
+
+Supported in filetypes: `cs`
+
+Functions
+--------
+
+### The `youcompleteme#GetErrorCount` function
+
+Get the number of YCM Diagnostic errors. If no errors are present, this function
+returns 0.
+
+For example:
+```viml
+ call youcompleteme#GetErrorCount()
+```
+
+Both this function and `youcompleteme#GetWarningCount` can be useful when
+integrating YCM with other Vim plugins. For example, a [lightline][] user could
+add a diagnostics section to their statusline which would display the number of
+errors and warnings.
+
+### The `youcompleteme#GetWarningCount` function
+
+Get the number of YCM Diagnostic warnings. If no warnings are present, this
+function returns 0.
+
+For example:
+```viml
+ call youcompleteme#GetWarningCount()
+```
+
+Autocommands
+------------
+
+### The `YcmQuickFixOpened` autocommand
+
+This `User` autocommand is fired when YCM opens the quickfix window in response
+to the `GoTo*` and `RefactorRename` subcommands. By default, the quickfix window
+is opened to full width at the bottom of the screen and its height is set to fit
+all entries. This behavior can be overridden by using the `YcmQuickFixOpened`
+autocommand. For instance:
+```viml
+function s:CustomizeYcmQuickFixWindow()
+ " Move the window at the top of the screen.
+ execute "wincmd K"
+ " Set the window height to 5.
+ execute "5wincmd _"
+endfunction
+
+autocmd User YcmQuickFixOpened call s:CustomizeYcmQuickFixWindow()
+```
+
+Options
+-------
+
+All options have reasonable defaults so if the plug-in works after installation
+you don't need to change any options. These options can be configured in your
+[vimrc script][vimrc] by including a line like this:
+
+```viml
+let g:ycm_min_num_of_chars_for_completion = 1
+```
+
+Note that after changing an option in your [vimrc script] [vimrc] you have to
+restart Vim for the changes to take effect.
+
+### The `g:ycm_min_num_of_chars_for_completion` option
+
+This option controls the number of characters the user needs to type before
+identifier-based completion suggestions are triggered. For example, if the
+option is set to `2`, then when the user types a second alphanumeric character
+after a whitespace character, completion suggestions will be triggered. This
+option is NOT used for semantic completion.
+
+Setting this option to a high number like `99` effectively turns off the
+identifier completion engine and just leaves the semantic engine.
+
+Default: `2`
+
+```viml
+let g:ycm_min_num_of_chars_for_completion = 2
+```
+
+### The `g:ycm_min_num_identifier_candidate_chars` option
+
+This option controls the minimum number of characters that a completion
+candidate coming from the identifier completer must have to be shown in the
+popup menu.
+
+A special value of `0` means there is no limit.
+
+NOTE: This option only applies to the identifier completer; it has no effect on
+the various semantic completers.
+
+Default: `0`
+
+```viml
+let g:ycm_min_num_identifier_candidate_chars = 0
+```
+
+### The `g:ycm_auto_trigger` option
+
+When set to `0`, this option turns off YCM's identifier completer (the
+as-you-type popup) _and_ the semantic triggers (the popup you'd get after typing
+`.` or `->` in say C++). You can still force semantic completion with the
+`<C-Space>` shortcut.
+
+If you want to just turn off the identifier completer but keep the semantic
+triggers, you should set `g:ycm_min_num_of_chars_for_completion` to a high
+number like `99`.
+
+Default: `1`
+
+```viml
+let g:ycm_auto_trigger = 1
+```
+
+### The `g:ycm_filetype_whitelist` option
+
+This option controls for which Vim filetypes (see `:h filetype`) should YCM be
+turned on. The option value should be a Vim dictionary with keys being filetype
+strings (like `python`, `cpp` etc) and values being unimportant (the dictionary
+is used like a hash set, meaning that only the keys matter).
+
+The `*` key is special and matches all filetypes. By default, the whitelist
+contains only this `*` key.
+
+YCM also has a `g:ycm_filetype_blacklist` option that lists filetypes for which
+YCM shouldn't be turned on. YCM will work only in filetypes that both the
+whitelist and the blacklist allow (the blacklist "allows" a filetype by _not_
+having it as a key).
+
+For example, let's assume you want YCM to work in files with the `cpp` filetype.
+The filetype should then be present in the whitelist either directly (`cpp` key
+in the whitelist) or indirectly through the special `*` key. It should _not_ be
+present in the blacklist.
+
+Filetypes that are blocked by the either of the lists will be completely ignored
+by YCM, meaning that neither the identifier-based completion engine nor the
+semantic engine will operate in them.
+
+You can get the filetype of the current file in Vim with `:set ft?`.
+
+Default: `{'*' : 1}`
+
+```viml
+let g:ycm_filetype_whitelist = { '*': 1 }
+```
+
+### The `g:ycm_filetype_blacklist` option
+
+This option controls for which Vim filetypes (see `:h filetype`) should YCM be
+turned off. The option value should be a Vim dictionary with keys being filetype
+strings (like `python`, `cpp` etc) and values being unimportant (the dictionary
+is used like a hash set, meaning that only the keys matter).
+
+See the `g:ycm_filetype_whitelist` option for more details on how this works.
+
+Default: `[see next line]`
+
+```viml
+let g:ycm_filetype_blacklist = {
+ \ 'tagbar' : 1,
+ \ 'qf' : 1,
+ \ 'notes' : 1,
+ \ 'markdown' : 1,
+ \ 'unite' : 1,
+ \ 'text' : 1,
+ \ 'vimwiki' : 1,
+ \ 'pandoc' : 1,
+ \ 'infolog' : 1,
+ \ 'mail' : 1
+ \}
+```
+
+### The `g:ycm_filetype_specific_completion_to_disable` option
+
+This option controls for which Vim filetypes (see `:h filetype`) should the YCM
+semantic completion engine be turned off. The option value should be a Vim
+dictionary with keys being filetype strings (like `python`, `cpp` etc) and
+values being unimportant (the dictionary is used like a hash set, meaning that
+only the keys matter). The listed filetypes will be ignored by the YCM semantic
+completion engine, but the identifier-based completion engine will still trigger
+in files of those filetypes.
+
+Note that even if semantic completion is not turned off for a specific filetype,
+you will not get semantic completion if the semantic engine does not support
+that filetype.
+
+You can get the filetype of the current file in Vim with `:set ft?`.
+
+Default: `[see next line]`
+
+```viml
+let g:ycm_filetype_specific_completion_to_disable = {
+ \ 'gitcommit': 1
+ \}
+```
+
+### The `g:ycm_show_diagnostics_ui` option
+
+When set, this option turns on YCM's diagnostic display features. See the
+_Diagnostic display_ section in the _User Manual_ for more details.
+
+Specific parts of the diagnostics UI (like the gutter signs, text highlighting,
+diagnostic echo and auto location list population) can be individually turned on
+or off. See the other options below for details.
+
+Note that YCM's diagnostics UI is only supported for C-family languages.
+
+When set, this option also makes YCM remove all Syntastic checkers set for the
+`c`, `cpp`, `objc` and `objcpp` filetypes since this would conflict with YCM's
+own diagnostics UI.
+
+If you're using YCM's identifier completer in C-family languages but cannot use
+the clang-based semantic completer for those languages _and_ want to use the GCC
+Syntastic checkers, unset this option.
+
+Default: `1`
+
+```viml
+let g:ycm_show_diagnostics_ui = 1
+```
+
+### The `g:ycm_error_symbol` option
+
+YCM will use the value of this option as the symbol for errors in the Vim
+gutter.
+
+This option is part of the Syntastic compatibility layer; if the option is not
+set, YCM will fall back to the value of the `g:syntastic_error_symbol` option
+before using this option's default.
+
+Default: `>>`
+
+```viml
+let g:ycm_error_symbol = '>>'
+```
+
+### The `g:ycm_warning_symbol` option
+
+YCM will use the value of this option as the symbol for warnings in the Vim
+gutter.
+
+This option is part of the Syntastic compatibility layer; if the option is not
+set, YCM will fall back to the value of the `g:syntastic_warning_symbol` option
+before using this option's default.
+
+Default: `>>`
+
+```viml
+let g:ycm_warning_symbol = '>>'
+```
+
+### The `g:ycm_enable_diagnostic_signs` option
+
+When this option is set, YCM will put icons in Vim's gutter on lines that have a
+diagnostic set. Turning this off will also turn off the `YcmErrorLine` and
+`YcmWarningLine` highlighting.
+
+This option is part of the Syntastic compatibility layer; if the option is not
+set, YCM will fall back to the value of the `g:syntastic_enable_signs` option
+before using this option's default.
+
+Default: `1`
+
+```viml
+let g:ycm_enable_diagnostic_signs = 1
+```
+
+### The `g:ycm_enable_diagnostic_highlighting` option
+
+When this option is set, YCM will highlight regions of text that are related to
+the diagnostic that is present on a line, if any.
+
+This option is part of the Syntastic compatibility layer; if the option is not
+set, YCM will fall back to the value of the `g:syntastic_enable_highlighting`
+option before using this option's default.
+
+Default: `1`
+
+```viml
+let g:ycm_enable_diagnostic_highlighting = 1
+```
+
+### The `g:ycm_echo_current_diagnostic` option
+
+When this option is set, YCM will echo the text of the diagnostic present on the
+current line when you move your cursor to that line. If a `FixIt` is available
+for the current diagnostic, then ` (FixIt)` is appended.
+
+This option is part of the Syntastic compatibility layer; if the option is not
+set, YCM will fall back to the value of the `g:syntastic_echo_current_error`
+option before using this option's default.
+
+Default: `1`
+
+```viml
+let g:ycm_echo_current_diagnostic = 1
+```
+
+### The `g:ycm_always_populate_location_list` option
+
+When this option is set, YCM will populate the location list automatically every
+time it gets new diagnostic data. This option is off by default so as not to
+interfere with other data you might have placed in the location list.
+
+See `:help location-list` in Vim to learn more about the location list.
+
+This option is part of the Syntastic compatibility layer; if the option is not
+set, YCM will fall back to the value of the
+`g:syntastic_always_populate_loc_list` option before using this option's
+default.
+
+Default: `0`
+
+```viml
+let g:ycm_always_populate_location_list = 0
+```
+
+### The `g:ycm_open_loclist_on_ycm_diags` option
+
+When this option is set, `:YcmDiags` will automatically open the location list
+after forcing a compilation and filling the list with diagnostic data.
+
+See `:help location-list` in Vim to learn more about the location list.
+
+Default: `1`
+
+```viml
+let g:ycm_open_loclist_on_ycm_diags = 1
+```
+
+### The `g:ycm_allow_changing_updatetime` option
+
+When this option is set to `1`, YCM will change the `updatetime` Vim option to
+`2000` (see `:h updatetime`). This may conflict with some other plugins you have
+(but it's unlikely). The `updatetime` option is the number of milliseconds that
+have to pass before Vim's `CursorHold` (see `:h CursorHold`) event fires. YCM
+runs the completion engines' "file comprehension" systems in the background on
+every such event; the identifier-based engine collects the identifiers whereas
+the semantic engine compiles the file to build an AST.
+
+The Vim default of `4000` for `updatetime` is a bit long, so YCM reduces
+this. Set this option to `0` to force YCM to leave your `updatetime` setting
+alone.
+
+Default: `1`
+
+```viml
+let g:ycm_allow_changing_updatetime = 1
+```
+
+### The `g:ycm_complete_in_comments` option
+
+When this option is set to `1`, YCM will show the completion menu even when
+typing inside comments.
+
+Default: `0`
+
+```viml
+let g:ycm_complete_in_comments = 0
+```
+
+### The `g:ycm_complete_in_strings` option
+
+When this option is set to `1`, YCM will show the completion menu even when
+typing inside strings.
+
+Note that this is turned on by default so that you can use the filename
+completion inside strings. This is very useful for instance in C-family files
+where typing `#include "` will trigger the start of filename completion. If you
+turn off this option, you will turn off filename completion in such situations
+as well.
+
+Default: `1`
+
+```viml
+let g:ycm_complete_in_strings = 1
+```
+
+### The `g:ycm_collect_identifiers_from_comments_and_strings` option
+
+When this option is set to `1`, YCM's identifier completer will also collect
+identifiers from strings and comments. Otherwise, the text in comments and
+strings will be ignored.
+
+Default: `0`
+
+```viml
+let g:ycm_collect_identifiers_from_comments_and_strings = 0
+```
+
+### The `g:ycm_collect_identifiers_from_tags_files` option
+
+When this option is set to `1`, YCM's identifier completer will also collect
+identifiers from tags files. The list of tags files to examine is retrieved from
+the `tagfiles()` Vim function which examines the `tags` Vim option. See `:h
+'tags'` for details.
+
+YCM will re-index your tags files if it detects that they have been modified.
+
+The only supported tag format is the [Exuberant Ctags format][ctags-format]. The
+format from "plain" ctags is NOT supported. Ctags needs to be called with the
+`--fields=+l` option (that's a lowercase `L`, not a one) because YCM needs the
+`language:<lang>` field in the tags output.
+
+See the _FAQ_ for pointers if YCM does not appear to read your tag files.
+
+This option is off by default because it makes Vim slower if your tags are on a
+network directory.
+
+Default: `0`
+
+```viml
+let g:ycm_collect_identifiers_from_tags_files = 0
+```
+
+### The `g:ycm_seed_identifiers_with_syntax` option
+
+When this option is set to `1`, YCM's identifier completer will seed its
+identifier database with the keywords of the programming language you're
+writing.
+
+Since the keywords are extracted from the Vim syntax file for the filetype, all
+keywords may not be collected, depending on how the syntax file was written.
+Usually at least 95% of the keywords are successfully extracted.
+
+Default: `0`
+
+```viml
+let g:ycm_seed_identifiers_with_syntax = 0
+```
+
+### The `g:ycm_extra_conf_vim_data` option
+
+If you're using semantic completion for C-family files, this option might come
+handy; it's a way of sending data from Vim to your `FlagsForFile` function in
+your `.ycm_extra_conf.py` file.
+
+This option is supposed to be a list of VimScript expression strings that are
+evaluated for every request to the [ycmd server][ycmd] and then passed to your
+`FlagsForFile` function as a `client_data` keyword argument.
+
+For instance, if you set this option to `['v:version']`, your `FlagsForFile`
+function will be called like this:
+
+```python
+# The '704' value is of course contingent on Vim 7.4; in 7.3 it would be '703'
+FlagsForFile(filename, client_data = {'v:version': 704})
+```
+
+So the `client_data` parameter is a dictionary mapping Vim expression strings to
+their values at the time of the request.
+
+The correct way to define parameters for your `FlagsForFile` function:
+
+```python
+def FlagsForFile(filename, **kwargs):
+```
+
+You can then get to `client_data` with `kwargs['client_data']`.
+
+Default: `[]`
+
+```viml
+let g:ycm_extra_conf_vim_data = []
+```
+
+### The `g:ycm_server_python_interpreter` option
+
+YCM will by default search for an appropriate Python interpreter on your system.
+You can use this option to override that behavior and force the use of a
+specific interpreter of your choosing.
+
+NOTE: This interpreter is only used for the [ycmd server][ycmd]. The YCM client
+running inside Vim always uses the Python interpreter that's embedded inside
+Vim.
+
+Default: `''`
+
+```viml
+let g:ycm_server_python_interpreter = ''
+```
+
+### The `g:ycm_server_keep_logfiles` option
+
+When this option is set to `1`, the [ycmd completion server][ycmd] will keep the
+logfiles around after shutting down (they are deleted on shutdown by default).
+
+To see where the logfiles are, call `:YcmDebugInfo`.
+
+Default: `0`
+
+```viml
+let g:ycm_server_keep_logfiles = 0
+```
+
+### The `g:ycm_server_log_level` option
+
+The logging level that the [ycmd completion server][ycmd] uses. Valid values are
+the following, from most verbose to least verbose:
+- `debug`
+- `info`
+- `warning`
+- `error`
+- `critical`
+
+Note that `debug` is _very_ verbose.
+
+Default: `info`
+
+```viml
+let g:ycm_server_log_level = 'info'
+```
+
+### The `g:ycm_auto_start_csharp_server` option
+
+When set to `1`, the OmniSharp server will be automatically started (once per
+Vim session) when you open a C# file.
+
+Default: `1`
+
+```viml
+let g:ycm_auto_start_csharp_server = 1
+```
+
+### The `g:ycm_auto_stop_csharp_server` option
+
+When set to `1`, the OmniSharp server will be automatically stopped upon
+closing Vim.
+
+Default: `1`
+
+```viml
+let g:ycm_auto_stop_csharp_server = 1
+```
+
+### The `g:ycm_csharp_server_port` option
+
+When g:ycm_auto_start_csharp_server is set to `1`, specifies the port for
+the OmniSharp server to listen on. When set to `0` uses an unused port provided
+by the OS.
+
+Default: `0`
+
+```viml
+let g:ycm_csharp_server_port = 0
+```
+
+### The `g:ycm_csharp_insert_namespace_expr` option
+
+By default, when YCM inserts a namespace, it will insert the `using` statement
+under the nearest `using` statement. You may prefer that the `using` statement is
+inserted somewhere, for example, to preserve sorting. If so, you can set this
+option to override this behavior.
+
+When this option is set, instead of inserting the `using` statement itself, YCM
+will set the global variable `g:ycm_namespace_to_insert` to the namespace to
+insert, and then evaluate this option's value as an expression. The option's
+expression is responsible for inserting the namespace - the default insertion
+will not occur.
+
+Default: ''
+
+```viml
+let g:ycm_csharp_insert_namespace_expr = ''
+```
+
+### The `g:ycm_add_preview_to_completeopt` option
+
+When this option is set to `1`, YCM will add the `preview` string to Vim's
+`completeopt` option (see `:h completeopt`). If your `completeopt` option
+already has `preview` set, there will be no effect. You can see the current
+state of your `completeopt` setting with `:set completeopt?` (yes, the question
+mark is important).
+
+When `preview` is present in `completeopt`, YCM will use the `preview` window at
+the top of the file to store detailed information about the current completion
+candidate (but only if the candidate came from the semantic engine). For
+instance, it would show the full function prototype and all the function
+overloads in the window if the current completion is a function name.
+
+Default: `0`
+
+```viml
+let g:ycm_add_preview_to_completeopt = 0
+```
+
+### The `g:ycm_autoclose_preview_window_after_completion` option
+
+When this option is set to `1`, YCM will auto-close the `preview` window after
+the user accepts the offered completion string. If there is no `preview` window
+triggered because there is no `preview` string in `completeopt`, this option is
+irrelevant. See the `g:ycm_add_preview_to_completeopt` option for more details.
+
+Default: `0`
+
+```viml
+let g:ycm_autoclose_preview_window_after_completion = 0
+```
+
+### The `g:ycm_autoclose_preview_window_after_insertion` option
+
+When this option is set to `1`, YCM will auto-close the `preview` window after
+the user leaves insert mode. This option is irrelevant if
+`g:ycm_autoclose_preview_window_after_completion` is set or if no `preview`
+window is triggered. See the `g:ycm_add_preview_to_completeopt` option for more
+details.
+
+Default: `0`
+
+```viml
+let g:ycm_autoclose_preview_window_after_insertion = 0
+```
+
+### The `g:ycm_max_diagnostics_to_display` option
+
+This option controls the maximum number of diagnostics shown to the user when
+errors or warnings are detected in the file. This option is only relevant if you
+are using the C-family semantic completion engine.
+
+Default: `30`
+
+```viml
+let g:ycm_max_diagnostics_to_display = 30
+```
+
+### The `g:ycm_key_list_select_completion` option
+
+This option controls the key mappings used to select the first completion
+string. Invoking any of them repeatedly cycles forward through the completion
+list.
+
+Some users like adding `<Enter>` to this list.
+
+Default: `['<TAB>', '<Down>']`
+
+```viml
+let g:ycm_key_list_select_completion = ['<TAB>', '<Down>']
+```
+
+### The `g:ycm_key_list_previous_completion` option
+
+This option controls the key mappings used to select the previous completion
+string. Invoking any of them repeatedly cycles backwards through the completion
+list.
+
+Note that one of the defaults is `<S-TAB>` which means Shift-TAB. That mapping
+will probably only work in GUI Vim (Gvim or MacVim) and not in plain console Vim
+because the terminal usually does not forward modifier key combinations to Vim.
+
+Default: `['<S-TAB>', '<Up>']`
+
+```viml
+let g:ycm_key_list_previous_completion = ['<S-TAB>', '<Up>']
+```
+
+### The `g:ycm_key_invoke_completion` option
+
+This option controls the key mapping used to invoke the completion menu for
+semantic completion. By default, semantic completion is trigged automatically
+after typing `.`, `->` and `::` in insert mode (if semantic completion support
+has been compiled in). This key mapping can be used to trigger semantic
+completion anywhere. Useful for searching for top-level functions and classes.
+
+Console Vim (not Gvim or MacVim) passes `<Nul>` to Vim when the user types
+`<C-Space>` so YCM will make sure that `<Nul>` is used in the map command when
+you're editing in console Vim, and `<C-Space>` in GUI Vim. This means that you
+can just press `<C-Space>` in both console and GUI Vim and YCM will do the right
+thing.
+
+Setting this option to an empty string will make sure no mapping is created.
+
+Default: `<C-Space>`
+
+```viml
+let g:ycm_key_invoke_completion = '<C-Space>'
+```
+
+### The `g:ycm_key_detailed_diagnostics` option
+
+This option controls the key mapping used to show the full diagnostic text when
+the user's cursor is on the line with the diagnostic. It basically calls
+`:YcmShowDetailedDiagnostic`.
+
+Setting this option to an empty string will make sure no mapping is created.
+
+Default: `<leader>d`
+
+```viml
+let g:ycm_key_detailed_diagnostics = '<leader>d'
+```
+
+### The `g:ycm_global_ycm_extra_conf` option
+
+Normally, YCM searches for a `.ycm_extra_conf.py` file for compilation flags
+(see the User Guide for more details on how this works). This option specifies
+a fallback path to a config file which is used if no `.ycm_extra_conf.py` is
+found.
+
+You can place such a global file anywhere in your filesystem.
+
+Default: `''`
+
+```viml
+let g:ycm_global_ycm_extra_conf = ''
+```
+
+### The `g:ycm_confirm_extra_conf` option
+
+When this option is set to `1` YCM will ask once per `.ycm_extra_conf.py` file
+if it is safe to be loaded. This is to prevent execution of malicious code
+from a `.ycm_extra_conf.py` file you didn't write.
+
+To selectively get YCM to ask/not ask about loading certain `.ycm_extra_conf.py`
+files, see the `g:ycm_extra_conf_globlist` option.
+
+Default: `1`
+
+```viml
+let g:ycm_confirm_extra_conf = 1
+```
+
+### The `g:ycm_extra_conf_globlist` option
+
+This option is a list that may contain several globbing patterns. If a pattern
+starts with a `!` all `.ycm_extra_conf.py` files matching that pattern will be
+blacklisted, that is they won't be loaded and no confirmation dialog will be
+shown. If a pattern does not start with a `!` all files matching that pattern
+will be whitelisted. Note that this option is not used when confirmation is
+disabled using `g:ycm_confirm_extra_conf` and that items earlier in the list
+will take precedence over the later ones.
+
+Rules:
+
+* `*` matches everything
+* `?` matches any single character
+* `[seq]` matches any character in seq
+* `[!seq]` matches any char not in seq
+
+Example:
+
+```viml
+let g:ycm_extra_conf_globlist = ['~/dev/*','!~/*']
+```
+
+* The first rule will match everything contained in the `~/dev` directory so
+ `.ycm_extra_conf.py` files from there will be loaded.
+* The second rule will match everything in the home directory so a
+ `.ycm_extra_conf.py` file from there won't be loaded.
+* As the first rule takes precedence everything in the home directory excluding
+ the `~/dev` directory will be blacklisted.
+
+NOTE: The glob pattern is first expanded with Python's `os.path.expanduser()`
+and then resolved with `os.path.abspath()` before being matched against the
+filename.
+
+Default: `[]`
+
+```viml
+let g:ycm_extra_conf_globlist = []
+```
+
+### The `g:ycm_filepath_completion_use_working_dir` option
+
+By default, YCM's filepath completion will interpret relative paths like `../`
+as being relative to the folder of the file of the currently active buffer.
+Setting this option will force YCM to always interpret relative paths as being
+relative to Vim's current working directory.
+
+Default: `0`
+
+```viml
+let g:ycm_filepath_completion_use_working_dir = 0
+```
+
+### The `g:ycm_semantic_triggers` option
+
+This option controls the character-based triggers for the various semantic
+completion engines. The option holds a dictionary of key-values, where the keys
+are Vim's filetype strings delimited by commas and values are lists of strings,
+where the strings are the triggers.
+
+Setting key-value pairs on the dictionary _adds_ semantic triggers to the
+internal default set (listed below). You cannot remove the default triggers,
+only add new ones.
+
+A "trigger" is a sequence of one or more characters that trigger semantic
+completion when typed. For instance, C++ (`cpp` filetype) has `.` listed as a
+trigger. So when the user types `foo.`, the semantic engine will trigger and
+serve `foo`'s list of member functions and variables. Since C++ also has `->`
+listed as a trigger, the same thing would happen when the user typed `foo->`.
+
+It's also possible to use a regular expression as a trigger. You have to prefix
+your trigger with `re!` to signify it's a regex trigger. For instance,
+`re!\w+\.` would only trigger after the `\w+\.` regex matches.
+
+NOTE: The regex syntax is **NOT** Vim's, it's [Python's][python-re].
+
+Default: `[see next line]`
+
+```viml
+let g:ycm_semantic_triggers = {
+ \ 'c' : ['->', '.'],
+ \ 'objc' : ['->', '.', 're!\[[_a-zA-Z]+\w*\s', 're!^\s*[^\W\d]\w*\s',
+ \ 're!\[.*\]\s'],
+ \ 'ocaml' : ['.', '#'],
+ \ 'cpp,objcpp' : ['->', '.', '::'],
+ \ 'perl' : ['->'],
+ \ 'php' : ['->', '::'],
+ \ 'cs,java,javascript,typescript,d,python,perl6,scala,vb,elixir,go' : ['.'],
+ \ 'ruby' : ['.', '::'],
+ \ 'lua' : ['.', ':'],
+ \ 'erlang' : [':'],
+ \ }
+```
+
+### The `g:ycm_cache_omnifunc` option
+
+Some omnicompletion engines do not work well with the YCM cache—in particular,
+they might not produce all possible results for a given prefix. By unsetting
+this option you can ensure that the omnicompletion engine is re-queried on every
+keypress. That will ensure all completions will be presented, but might cause
+stuttering and lagginess if the omnifunc is slow.
+
+Default: `1`
+
+```viml
+let g:ycm_cache_omnifunc = 1
+```
+
+### The `g:ycm_use_ultisnips_completer` option
+
+By default, YCM will query the UltiSnips plugin for possible completions of
+snippet triggers. This option can turn that behavior off.
+
+Default: `1`
+
+```viml
+let g:ycm_use_ultisnips_completer = 1
+```
+
+### The `g:ycm_goto_buffer_command` option
+
+Defines where `GoTo*` commands result should be opened.
+Can take one of the following values:
+`[ 'same-buffer', 'horizontal-split', 'vertical-split', 'new-tab',
+ 'new-or-existing-tab' ]`
+If this option is set to the `'same-buffer'` but current buffer can not
+be switched (when buffer is modified and `nohidden` option is set),
+then result will be opened in horizontal split.
+
+Default: `'same-buffer'`
+
+```viml
+let g:ycm_goto_buffer_command = 'same-buffer'
+```
+
+### The `g:ycm_disable_for_files_larger_than_kb` option
+
+Defines the max size (in Kb) for a file to be considered for completion. If this
+option is set to 0 then no check is made on the size of the file you're opening.
+
+Default: 1000
+
+```viml
+let g:ycm_disable_for_files_larger_than_kb = 1000
+```
+
+### The `g:ycm_python_binary_path` option
+
+This option specifies the Python interpreter to use to run the [jedi][]
+completion library. Specify the Python interpreter to use to get completions.
+By default the Python under which [ycmd][] runs is used ([ycmd][] runs on
+Python 2.6, 2.7 or 3.3+).
+
+Default: `''`
+
+```viml
+let g:ycm_python_binary_path = 'python'
+```
+
+NOTE: the settings above will make YCM use the first `python` executable
+found through the PATH.
+
+FAQ
+---
+
+### I used to be able to `import vim` in `.ycm_extra_conf.py`, but now can't
+
+YCM was rewritten to use a client-server architecture where most of the logic is
+in the [ycmd server][ycmd]. So the magic `vim` module you could have previously
+imported in your `.ycm_extra_conf.py` files doesn't exist anymore.
+
+To be fair, importing the magic `vim` module in extra conf files was never
+supported in the first place; it only ever worked by accident and was never a
+part of the extra conf API.
+
+But fear not, you should be able to tweak your extra conf files to continue
+working by using the `g:ycm_extra_conf_vim_data` option. See the docs on that
+option for details.
+
+### On very rare occasions Vim crashes when I tab through the completion menu
+
+That's a very rare Vim bug most users never encounter. It's fixed in Vim
+7.4.72. Update to that version (or above) to resolve the issue.
+
+### I get `ImportError` exceptions that mention `PyInit_ycm_core` or `initycm_core`
+
+These errors are caused by building the YCM native libraries for Python 2 and
+trying to load them into a Python 3 process (or the other way around).
+
+For instance, if building for Python 2 but loading in Python 3:
+
+```
+ImportError: dynamic module does not define init function (PyInit_ycm_core)
+```
+
+If building for Python 3 but loading in Python 2:
+
+```
+ImportError: dynamic module does not define init function (initycm_core)
+```
+
+Setting the `g:ycm_server_python_interpreter` option to force the use of a
+specific Python interpreter for `ycmd` is usually the easiest way to solve the
+problem. Common values for that option are `/usr/bin/python` and
+`/usr/bin/python3`.
+
+### I get a linker warning regarding `libpython` on Mac when compiling YCM
+
+If the warning is `ld: warning: path '/usr/lib/libpython2.7.dylib' following -L
+not a directory`, then feel free to ignore it; it's caused by a limitation of
+CMake and is not an issue. Everything should still work fine.
+
+### I get a weird window at the top of my file when I use the semantic engine
+
+This is Vim's `preview` window. Vim uses it to show you extra information about
+something if such information is available. YCM provides Vim with such extra
+information. For instance, when you select a function in the completion list,
+the `preview` window will hold that function's prototype and the prototypes of
+any overloads of the function. It will stay there after you select the
+completion so that you can use the information about the parameters and their
+types to write the function call.
+
+If you would like this window to auto-close after you select a completion
+string, set the `g:ycm_autoclose_preview_window_after_completion` option to `1`
+in your `vimrc` file. Similarly, the `g:ycm_autoclose_preview_window_after_insertion`
+option can be set to close the `preview` window after leaving insert mode.
+
+If you don't want this window to ever show up, add `set completeopt-=preview` to
+your `vimrc`. Also make sure that the `g:ycm_add_preview_to_completeopt` option
+is set to `0`.
+
+### It appears that YCM is not working
+
+In Vim, run `:messages` and carefully read the output. YCM will echo messages to
+the message log if it encounters problems. It's likely you misconfigured
+something and YCM is complaining about it.
+
+Also, you may want to run the `:YcmDebugInfo` command; it will make YCM spew out
+various debugging information, including the [ycmd][] logfile paths and the
+compile flags for the current file if the file is a C-family language file and
+you have compiled in Clang support. Logfiles can be automatically opened in the
+editor using the `:YcmToggleLogs` command.
+
+### Sometimes it takes much longer to get semantic completions than normal
+
+This means that libclang (which YCM uses for C-family semantic completion)
+failed to pre-compile your file's preamble. In other words, there was an error
+compiling some of the source code you pulled in through your header files. I
+suggest calling the `:YcmDiags` command to see what they were.
+
+Bottom line, if libclang can't pre-compile your file's preamble because there
+were errors in it, you're going to get slow completions because there's no AST
+cache.
+
+### YCM auto-inserts completion strings I don't want!
+
+This means you probably have some mappings that interfere with YCM's internal
+ones. Make sure you don't have something mapped to `<C-p>`, `<C-x>` or `<C-u>`
+(in insert mode).
+
+YCM _never_ selects something for you; it just shows you a menu and the user has
+to explicitly select something. If something is being selected automatically,
+this means there's a bug or a misconfiguration somewhere.
+
+### I get a `E227: mapping already exists for <blah>` error when I start Vim
+
+This means that YCM tried to set up a key mapping but failed because you already
+had something mapped to that key combination. The `<blah>` part of the message
+will tell you what was the key combination that failed.
+
+Look in the _Options_ section and see if any of the default mappings conflict
+with your own. Then change that option value to something else so that the
+conflict goes away.
+
+### I get `'GLIBC_2.XX' not found (required by libclang.so)` when starting Vim
+
+Your system is too old for the precompiled binaries from llvm.org. Compile
+Clang on your machine and then link against the `libclang.so` you just produced.
+See the full installation guide for help.
+
+### I'm trying to use a Homebrew Vim with YCM and I'm getting segfaults
+
+Something (I don't know what) is wrong with the way that Homebrew configures and
+builds Vim. I recommend using [MacVim][]. Even if you don't like the MacVim GUI,
+you can use the Vim binary that is inside the MacVim.app package (it's
+`MacVim.app/Contents/MacOS/Vim`) and get the Vim console experience.
+
+### I have a Homebrew Python and/or MacVim; can't compile/SIGABRT when starting
+
+You should probably run `brew rm python; brew install python` to get the latest
+fixes that should make YCM work with such a configuration. Also rebuild Macvim
+then. If you still get problems with this, see [issue #18][issue18] for
+suggestions.
+
+### Vim segfaults when I use the semantic completer in Ruby files
+
+This was caused by a Vim bug. Update your version of Vim (Vim 7.3.874 is known
+to work, earlier versions may also fix this issue).
+
+### I get `LONG_BIT definition appears wrong for platform` when compiling
+
+Look at the output of your CMake call. There should be a line in it like the
+following (with `.dylib` in place of `.so` on a Mac):
+
+```
+-- Found PythonLibs: /usr/lib/libpython2.7.so (Required is at least version "2.5")
+```
+
+That would be the **correct** output. An example of **incorrect** output would
+be the following:
+
+```
+-- Found PythonLibs: /usr/lib/libpython2.7.so (found suitable version "2.5.1", minimum required is "2.5")
+```
+
+Notice how there's an extra bit of output there, the `found suitable version
+"<version>"` part, where `<version>` is not the same as the version of the
+dynamic library. In the example shown, the library is version 2.7 but the second
+string is version `2.5.1`.
+
+This means that CMake found one version of Python headers and a different
+version for the library. This is wrong. It can happen when you have multiple
+versions of Python installed on your machine.
+
+You should probably add the following flags to your cmake call (again, `dylib`
+instead of `so` on a Mac):
+
+```
+-DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so
+```
+
+This will force the paths to the Python include directory and the Python library
+to use. You may need to set these flags to something else, but you need to make
+sure you use the same version of Python that your Vim binary is built against,
+which is highly likely to be the system's default Python.
+
+### I get `libpython2.7.a [...] relocation R_X86_64_32` when compiling
+
+The error is usually encountered when compiling YCM on Centos or RHEL. The full
+error looks something like the following:
+
+```
+/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
+```
+
+It's possible to get a slightly different error that's similar to the one above.
+Here's the problem and how you solve it:
+
+Your `libpython2.7.a` was not compiled with `-fPIC` so it can't be linked into
+`ycm_core.so`. Use the `-DPYTHON_LIBRARY=` CMake flag to point it to a `.so`
+version of libpython on your machine (for instance,
+`-DPYTHON_LIBRARY=/usr/lib/libpython2.7.so`). Naturally, this means you'll have
+to go through the full installation guide by hand.
+
+### I get `Vim: Caught deadly signal SEGV` on Vim startup
+
+This can happen on some Linux distros. If you encounter this situation, run Vim
+under `gdb`. You'll probably see something like this in the output when Vim
+crashes:
+
+```
+undefined symbol: clang_CompileCommands_dispose
+```
+
+This means that Vim is trying to load a `libclang.so` that is too old. You need
+at least a 3.8 libclang. Just go through the installation guide and make sure
+you are using a correct `libclang.so`. We recommend downloading prebuilt
+binaries from llvm.org.
+
+
+### I get `Fatal Python error: PyThreadState_Get: no current thread` on startup
+
+This is caused by linking a static version of `libpython` into ycmd's
+`ycm_core.so`. This leads to multiple copies of the python interpreter loaded
+when `python` loads `ycmd_core.so` and this messes up python's global state.
+The details aren't important.
+
+The solution is that the version of Python linked and run against must be built
+with either `--enable-shared` or `--enable-framework` (on OS X).
+This is achieved as follows (NOTE: for Mac, replace `--enable-shared`
+with `--enable-framework`):
+
+- When building python from source: `./configure --enable-shared {options}`
+- When building python from pyenv:
+ `PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install {version}`
+
+
+## `install.py` says python must be compiled with `--enable-framework`. Wat?
+
+See the previous answer for how to ensure your python is built to support
+dynamic modules.
+
+### YCM does not read identifiers from my tags files
+
+First, put `let g:ycm_collect_identifiers_from_tags_files = 1` in your vimrc.
+
+Make sure you are using [Exuberant Ctags][exuberant-ctags] to produce your tags
+files since the only supported tag format is the [Exuberant Ctags
+format][ctags-format]. The format from "plain" ctags is NOT supported. The
+output of `ctags --version` should list "Exuberant Ctags".
+
+Ctags needs to be called with the `--fields=+l` (that's a lowercase `L`, not a
+one) option because YCM needs the `language:<lang>` field in the tags output.
+
+NOTE: [Exuberant Ctags][exuberant-ctags] by default sets language tag for `*.h`
+files as `C++`. If you have C (not C++) project, consider
+giving parameter `--langmap=c:.c.h` to ctags to see tags from `*.h` files.
+
+NOTE: Mac OS X comes with "plain" ctags installed by default. `brew install
+ctags` will get you the Exuberant Ctags version.
+
+Also make sure that your Vim `tags` option is set correctly. See `:h 'tags'` for
+details. If you want to see which tag files YCM will read for a given buffer,
+run `:echo tagfiles()` with the relevant buffer active. Note that that function
+will only list tag files that already exist.
+
+### `CTRL-U` in insert mode does not work
+
+YCM keeps you in a `completefunc` completion mode when you're typing in insert
+mode and Vim disables `<C-U>` in completion mode as a "feature." Sadly there's
+nothing I can do about this.
+
+### YCM conflicts with UltiSnips TAB key usage
+
+YCM comes with support for UltiSnips (snippet suggestions in the popup menu),
+but you'll have to change the UltiSnips mappings. See `:h UltiSnips-triggers` in
+Vim for details. You'll probably want to change some/all of the following
+options:
+
+```viml
+g:UltiSnipsExpandTrigger
+g:UltiSnipsJumpForwardTrigger
+g:UltiSnipsJumpBackwardTrigger
+```
+
+### Why isn't YCM just written in plain VimScript, FFS?
+
+Because of the identifier completion engine and subsequence-based filtering.
+Let's say you have _many_ dozens of files open in a single Vim instance (I often
+do); the identifier-based engine then needs to store thousands (if not tens of
+thousands) of identifiers in its internal data-structures. When the user types,
+YCM needs to perform subsequence-based filtering on _all_ of those identifiers
+(every single one!) in less than 10 milliseconds.
+
+I'm sorry, but that level of performance is just plain impossible to achieve
+with VimScript. I've tried, and the language is just too slow. No, you can't get
+acceptable performance even if you limit yourself to just the identifiers in the
+current file and simple prefix-based filtering.
+
+### Why does YCM demand such a recent version of Vim?
+
+During YCM's development several show-stopper bugs were encountered in Vim.
+Those needed to be fixed upstream (and were). A few months after those bugs were
+fixed, Vim trunk landed the `pyeval()` function which improved YCM performance
+even more since less time was spent serializing and deserializing data between
+Vim and the embedded Python interpreter. A few critical bugfixes for `pyeval()`
+landed in Vim 7.3.584 (and a few commits before that).
+
+### I get annoying messages in Vim's status area when I type
+
+If you're referring to the `User defined completion <bla bla> back at original`
+and similar, then just update to Vim 7.4.314 (or later) and they'll go away.
+
+### Nasty bugs happen if I have the `vim-autoclose` plugin installed
+
+Use the [delimitMate][] plugin instead. It does the same thing without
+conflicting with YCM.
+
+### Is there some sort of YCM mailing list? I have questions
+
+If you have questions about the plugin or need help, please use the
+[ycm-users][] mailing list, _don't_ create issues on the tracker. The tracker is
+for bug reports and feature requests.
+
+### I get an internal compiler error when installing
+
+This can be a problem on virtual servers with limited memory. A possible
+solution is to add more swap memory. A more practical solution would be to force
+the build script to run only one compile job at a time. You can do this by
+setting the `YCM_CORES` environment variable to `1`. Example:
+
+```
+YCM_CORES=1 ./install.py --clang-completer
+```
+
+### I get weird errors when I press `Ctrl-C` in Vim
+
+_Never_ use `Ctrl-C` in Vim.
+
+Using `Ctrl-C` to exit insert mode in Vim is a bad idea. The main issue here is
+that `Ctrl-C` in Vim doesn't just leave insert mode, it leaves it without
+triggering `InsertLeave` autocommands (as per Vim docs). This is a bad idea and
+is likely to break many other things and not just YCM.
+
+Bottom line, if you use `Ctrl-C` to exit insert mode in Vim, you're gonna have a
+bad time.
+
+If pressing `<esc>` is too annoying (agreed, it is), we suggest mapping it to
+something more convenient. On a QWERTY keyboard, a good pick for the `<esc>` map
+is `inoremap jk <Esc>`. This is right on the home row, it's an incredibly rare
+digraph in English and if you ever need to type those two chars in sequence in
+insert mode, you just type `j`, then wait 500ms, then type `k`.
+
+### Why did YCM stop using Syntastic for diagnostics display?
+
+Previously, YCM would send any diagnostics it would receive from the libclang
+semantic engine to Syntastic for display as signs in the gutter, red squiggles
+etc. Today, YCM uses its own code to do that.
+
+Using Syntastic for this was always a kludge. Syntastic assumes its "checker"
+plugins behave in a certain way; those assumptions have never fit YCM. For
+instance, YCM continuously recompiles your code in the background for C-family
+languages and tries to push new diagnostics to the user as fast as possible,
+even while the user types.
+
+Syntastic assumes that a checker only runs on file save ("active" mode) or even
+less frequently, when the user explicitly invokes it ("passive" mode). This
+mismatch in assumptions causes performance problems since Syntastic code isn't
+optimized for this use case of constant diagnostic refreshing.
+
+Poor support for this use case also led to crash bugs in Vim caused by
+Syntastic-Vim interactions ([issue #593][issue-593]) and other problems, like
+random Vim flickering. Attempts were made to resolve these issues in
+Syntastic, but ultimately some of them failed (for various reasons).
+
+Implementing diagnostic display code directly in YCM resolves all of these
+problems. Performance also improved substantially since the relevant code is now
+written in Python instead of VimScript (which is very slow) and is tailored only
+for YCM's use-cases. We were also able to introduce new features in this area
+since we're now not limited to the Syntastic checker API.
+
+We've tried to implement this in the most backwards-compatible way possible; YCM
+options that control diagnostic display fall back to Syntastic options that
+control the same concepts if the user has those set.
+
+Still, some Syntastic-specific configuration you might have had might not
+be supported by the new code. Please file issues on the tracker in such
+cases; if we find the request to be reasonable, we'll find a way to address it.
+
+### Completion doesn't work with the C++ standard library headers
+
+This is caused by an issue with libclang that only affects some operating
+systems. Compiling with `clang` the binary will use the correct default header
+search paths but compiling with `libclang.so` (which YCM uses) does not.
+
+Mac OS X is normally affected, but there's a workaround in YCM for that specific
+OS. If you're not running that OS but still have the same problem, continue
+reading.
+
+The workaround is to call `echo | clang -v -E -x c++ -` and look at the
+paths under the `#include <...> search starts here:` heading. You should take
+those paths, prepend `-isystem` to each individual path and append them all to
+the list of flags you return from your `FlagsForFile` function in your
+`.ycm_extra_conf.py` file.
+
+See [issue #303][issue-303] for details.
+
+### When I open a JavaScript file, I get an annoying warning about `.tern-project` file
+
+Take a look at the [instructions for using the JavaScript
+completer](#javascript-semantic-completion).
+
+If this is still really annoying, and you have a good reason not to have a
+`.tern-project` file, create an empty `.tern-config` file in your home directory
+and YCM will stop complaining.
+
+### When I start vim I get a runtime error saying `R6034 An application has made an attempt to load the C runtime library incorrectly.`
+
+[CMake and other things seem to screw up the PATH with their own msvcrXX.dll
+versions.][identify-R6034-cause] Add the following to the very top of your vimrc
+to remove these entries from the path.
+
+```python
+python << EOF
+import os
+import re
+path = os.environ['PATH'].split(';')
+
+def contains_msvcr_lib(folder):
+ try:
+ for item in os.listdir(folder):
+ if re.match(r'msvcr\d+\.dll', item):
+ return True
+ except:
+ pass
+ return False
+
+path = [folder for folder in path if not contains_msvcr_lib(folder)]
+os.environ['PATH'] = ';'.join(path)
+EOF
+```
+
+### I hear that YCM only supports Python 2, is that true?
+
+**No.** Both the Vim client and the [ycmd server][ycmd] run on Python 2 or 3. If
+you work on a Python 3 project, you may need to set `g:ycm_python_binary_path`
+to the Python interpreter you use for your project to get completions for that
+version of Python.
+
+### On Windows I get `E887: Sorry, this command is disabled, the Python's site module could not be loaded`
+
+If you are running vim on Windows with Python 2.7.11, this is likely caused by
+a [bug][vim_win-python2.7.11-bug]. Follow this [workaround]
+[vim_win-python2.7.11-bug_workaround] or use a different version (Python 2.7.9
+does not suffer from the bug).
+
+### I can't complete python packages in a virtual environment.
+
+This means that the Python used to run [JediHTTP][] is not the Python of the
+virtual environment you're in. To resolve this you either set
+`g:ycm_python_binary_path` to the absolute path of the Python binary in your
+virtual environment or since virtual environment will put that Python
+executable first in your PATH when the virtual environment is active then if
+you set `g:ycm_python_binary_path` to just `'python'` it will be found as the
+first Python and used to run [JediHTTP][].
+
+Contributor Code of Conduct
+---------------------------
+
+Please note that this project is released with a [Contributor Code of
+Conduct][ccoc]. By participating in this project you agree to abide by its
+terms.
+
+
+Contact
+-------
+
+If you have questions about the plugin or need help, please use the
+[ycm-users][] mailing list.
+
+If you have bug reports or feature suggestions, please use the [issue
+tracker][tracker].
+
+The latest version of the plugin is available at
+<http://valloric.github.io/YouCompleteMe/>.
+
+The author's homepage is <http://val.markovic.io>.
+
+
+License
+-------
+
+This software is licensed under the [GPL v3 license][gpl].
+© 2015-2016 YouCompleteMe contributors
+
+[ycmd]: https://github.com/Valloric/ycmd
+[Clang]: http://clang.llvm.org/
+[vundle]: https://github.com/VundleVim/Vundle.vim#about
+[pathogen]: https://github.com/tpope/vim-pathogen#pathogenvim
+[clang-download]: http://llvm.org/releases/download.html
+[brew]: http://brew.sh
+[cmake-download]: https://cmake.org/download/
+[macvim]: https://github.com/macvim-dev/macvim/releases
+[vimrc]: http://vimhelp.appspot.com/starting.txt.html#vimrc
+[gpl]: http://www.gnu.org/copyleft/gpl.html
+[vim]: http://www.vim.org/
+[syntastic]: https://github.com/scrooloose/syntastic
+[lightline]: https://github.com/itchyny/lightline.vim
+[flags_example]: https://github.com/Valloric/ycmd/blob/master/cpp/ycm/.ycm_extra_conf.py
+[compdb]: http://clang.llvm.org/docs/JSONCompilationDatabase.html
+[subsequence]: https://en.wikipedia.org/wiki/Subsequence
+[listtoggle]: https://github.com/Valloric/ListToggle
+[vim-build]: https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
+[tracker]: https://github.com/Valloric/YouCompleteMe/issues?state=open
+[issue18]: https://github.com/Valloric/YouCompleteMe/issues/18
+[delimitMate]: https://github.com/Raimondi/delimitMate
+[completer-api]: https://github.com/Valloric/ycmd/blob/master/ycmd/completers/completer.py
+[eclim]: http://eclim.org/
+[jedi]: https://github.com/davidhalter/jedi
+[ultisnips]: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt
+[exuberant-ctags]: http://ctags.sourceforge.net/
+[ctags-format]: http://ctags.sourceforge.net/FORMAT
+[vundle-bug]: https://github.com/VundleVim/Vundle.vim/issues/48
+[ycm-users]: https://groups.google.com/forum/?hl=en#!forum/ycm-users
+[omnisharp]: https://github.com/OmniSharp/omnisharp-server
+[issue-303]: https://github.com/Valloric/YouCompleteMe/issues/303
+[issue-593]: https://github.com/Valloric/YouCompleteMe/issues/593
+[issue-669]: https://github.com/Valloric/YouCompleteMe/issues/669
+[status-mes]: https://groups.google.com/forum/#!topic/vim_dev/WeBBjkXE8H8
+[python-re]: https://docs.python.org/2/library/re.html#regular-expression-syntax
+[bear]: https://github.com/rizsotto/Bear
+[Options]: https://github.com/Valloric/YouCompleteMe#options
+[ygen]: https://github.com/rdnetto/YCM-Generator
+[Gocode]: https://github.com/nsf/gocode
+[Godef]: https://github.com/Manishearth/godef
+[TSServer]: https://github.com/Microsoft/TypeScript/tree/master/src/server
+[vim-win-download]: https://bintray.com/micbou/generic/vim
+[python-win-download]: https://www.python.org/downloads/windows/
+[visual-studio-download]: https://www.visualstudio.com/products/free-developer-offers-vs.aspx
+[7z-download]: http://www.7-zip.org/download.html
+[mono-install-osx]: http://www.mono-project.com/docs/getting-started/install/mac/
+[mono-install-ubuntu]: http://www.mono-project.com/docs/getting-started/install/linux/#debian-ubuntu-and-derivatives
+[mono-install-fedora]: http://www.mono-project.com/docs/getting-started/install/linux/#centos-7-fedora-19-and-later-and-derivatives
+[mono-install]: http://www.mono-project.com/docs/getting-started/install/
+[go-install]: https://golang.org/doc/install
+[npm-install]: https://docs.npmjs.com/getting-started/installing-node
+[Tern]: http://ternjs.net
+[tern-project]: http://ternjs.net/doc/manual.html#configuration
+[tern-docs]: http://ternjs.net/doc/manual.html#server
+[racer]: https://github.com/phildawes/racer
+[rust-install]: https://www.rust-lang.org/
+[rust-src]: https://www.rust-lang.org/downloads.html
+[add-msbuild-to-path]: http://stackoverflow.com/questions/6319274/how-do-i-run-msbuild-from-the-command-line-using-windows-sdk-7-1
+[identify-R6034-cause]: http://stackoverflow.com/questions/14552348/runtime-error-r6034-in-embedded-python-application/34696022
+[ccoc]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md
+[JediHTTP]: https://github.com/vheon/JediHTTP
+[vim_win-python2.7.11-bug]: https://github.com/vim/vim/issues/717
+[vim_win-python2.7.11-bug_workaround]: https://github.com/vim/vim-win32-installer/blob/master/appveyor.bat#L90
diff --git a/vim/bundle/YouCompleteMe/appveyor.yml b/vim/bundle/YouCompleteMe/appveyor.yml
new file mode 100644
index 0000000..6ea7062
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/appveyor.yml
@@ -0,0 +1,18 @@
+version: '{build}'
+environment:
+ matrix:
+ - arch: 32
+ python: 35
+ # We only test Python 2.7 on 64 bits.
+ - arch: 64
+ python: 27
+ - arch: 64
+ python: 35
+install:
+ - ci\appveyor\appveyor_install.bat
+build_script:
+ - python run_tests.py
+# Disable automatic tests
+test: off
+cache:
+ - '%LOCALAPPDATA%\pip\cache' # Python packages from pip
diff --git a/vim/bundle/YouCompleteMe/autoload/youcompleteme.vim b/vim/bundle/YouCompleteMe/autoload/youcompleteme.vim
new file mode 100644
index 0000000..37ed572
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/autoload/youcompleteme.vim
@@ -0,0 +1,889 @@
+" Copyright (C) 2011, 2012 Google Inc.
+"
+" This file is part of YouCompleteMe.
+"
+" YouCompleteMe is free software: you can redistribute it and/or modify
+" it under the terms of the GNU General Public License as published by
+" the Free Software Foundation, either version 3 of the License, or
+" (at your option) any later version.
+"
+" YouCompleteMe is distributed in the hope that it will be useful,
+" but WITHOUT ANY WARRANTY; without even the implied warranty of
+" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+" GNU General Public License for more details.
+"
+" You should have received a copy of the GNU General Public License
+" along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+" This is basic vim plugin boilerplate
+let s:save_cpo = &cpo
+set cpo&vim
+
+" This needs to be called outside of a function
+let s:script_folder_path = escape( expand( '<sfile>:p:h' ), '\' )
+let s:omnifunc_mode = 0
+let s:defer_omnifunc = 1
+
+let s:old_cursor_position = []
+let s:cursor_moved = 0
+let s:moved_vertically_in_insert_mode = 0
+let s:previous_num_chars_on_current_line = strlen( getline('.') )
+
+
+function! s:UsingPython2()
+ " I'm willing to bet quite a bit that sooner or later, somebody will ask us to
+ " make it configurable which version of Python we use.
+ if has('python')
+ return 1
+ endif
+ return 0
+endfunction
+
+
+let s:using_python2 = s:UsingPython2()
+let s:python_until_eof = s:using_python2 ? "python << EOF" : "python3 << EOF"
+let s:python_command = s:using_python2 ? "py " : "py3 "
+
+
+function! s:Pyeval( eval_string )
+ if s:using_python2
+ return pyeval( a:eval_string )
+ endif
+ return py3eval( a:eval_string )
+endfunction
+
+
+function! youcompleteme#Enable()
+ call s:SetUpBackwardsCompatibility()
+
+ " This can be 0 if YCM libs are old or -1 if an exception occured while
+ " executing the function.
+ if s:SetUpPython() != 1
+ return
+ endif
+
+ call s:SetUpCommands()
+ call s:SetUpCpoptions()
+ call s:SetUpCompleteopt()
+ call s:SetUpKeyMappings()
+
+ if g:ycm_show_diagnostics_ui
+ call s:TurnOffSyntasticForCFamily()
+ endif
+
+ call s:SetUpSigns()
+ call s:SetUpSyntaxHighlighting()
+
+ if g:ycm_allow_changing_updatetime && &updatetime > 2000
+ set ut=2000
+ endif
+
+ call youcompleteme#EnableCursorMovedAutocommands()
+ augroup youcompleteme
+ autocmd!
+ " Note that these events will NOT trigger for the file vim is started with;
+ " so if you do "vim foo.cc", these events will not trigger when that buffer
+ " is read. This is because youcompleteme#Enable() is called on VimEnter and
+ " that happens *after" BufRead/BufEnter has already triggered for the
+ " initial file.
+ " We also need to trigger buf init code on the FileType event because when
+ " the user does :enew and then :set ft=something, we need to run buf init
+ " code again.
+ autocmd BufReadPre * call s:OnBufferReadPre( expand( '<afile>:p' ) )
+ autocmd BufRead,BufEnter,FileType * call s:OnBufferVisit()
+ autocmd BufUnload * call s:OnBufferUnload( expand( '<afile>:p' ) )
+ autocmd CursorHold,CursorHoldI * call s:OnCursorHold()
+ autocmd InsertLeave * call s:OnInsertLeave()
+ autocmd InsertEnter * call s:OnInsertEnter()
+ autocmd VimLeave * call s:OnVimLeave()
+ autocmd CompleteDone * call s:OnCompleteDone()
+ augroup END
+
+ " Setting the omnifunc require us to ask the server if it has a Native
+ " Semantic Completer for the current buffer's filetype. When vim first start
+ " this mean that we have to wait for the server to be up and running which
+ " would block vim's GUI. To avoid this we defer setting the omnifunc the
+ " first time to when we enter Insert mode and then update it on every
+ " BufferVisit as normal.
+ if s:defer_omnifunc
+ augroup ycm_defer_omnifunc
+ autocmd!
+ autocmd InsertEnter * call s:SetOmnicompleteFunc()
+ \ | let s:defer_omnifunc = 0
+ \ | autocmd! ycm_defer_omnifunc
+ augroup END
+ endif
+
+ " Calling these once solves the problem of BufReadPre/BufRead/BufEnter not
+ " triggering for the first loaded file. This should be the last commands
+ " executed in this function!
+ call s:OnBufferReadPre( expand( '<afile>:p' ) )
+ call s:OnBufferVisit()
+endfunction
+
+
+function! youcompleteme#EnableCursorMovedAutocommands()
+ augroup ycmcompletemecursormove
+ autocmd!
+ autocmd CursorMovedI * call s:OnCursorMovedInsertMode()
+ autocmd CursorMoved * call s:OnCursorMovedNormalMode()
+ augroup END
+endfunction
+
+
+function! youcompleteme#DisableCursorMovedAutocommands()
+ autocmd! ycmcompletemecursormove CursorMoved *
+ autocmd! ycmcompletemecursormove CursorMovedI *
+endfunction
+
+
+function! youcompleteme#GetErrorCount()
+ return s:Pyeval( 'ycm_state.GetErrorCount()' )
+endfunction
+
+
+function! youcompleteme#GetWarningCount()
+ return s:Pyeval( 'ycm_state.GetWarningCount()' )
+endfunction
+
+
+function! s:SetUpPython() abort
+ exec s:python_until_eof
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+
+import os
+import sys
+import traceback
+import vim
+
+# Add python sources folder to the system path.
+script_folder = vim.eval( 's:script_folder_path' )
+sys.path.insert( 0, os.path.join( script_folder, '..', 'python' ) )
+
+from ycm.setup import SetUpSystemPaths, SetUpYCM
+
+# We enclose this code in a try/except block to avoid backtraces in Vim.
+try:
+ SetUpSystemPaths()
+
+ # Import the modules used in this file.
+ from ycm import base, vimsupport
+
+ ycm_state = SetUpYCM()
+except Exception as error:
+ # We don't use PostVimMessage or EchoText from the vimsupport module because
+ # importing this module may fail.
+ vim.command( 'redraw | echohl WarningMsg' )
+ for line in traceback.format_exc().splitlines():
+ vim.command( "echom '{0}'".format( line.replace( "'", "''" ) ) )
+
+ vim.command( "echo 'YouCompleteMe unavailable: {0}'"
+ .format( str( error ).replace( "'", "''" ) ) )
+ vim.command( 'echohl None' )
+ vim.command( 'return 0' )
+else:
+ vim.command( 'return 1' )
+EOF
+endfunction
+
+
+function! s:SetUpKeyMappings()
+ " The g:ycm_key_select_completion and g:ycm_key_previous_completion used to
+ " exist and are now here purely for the sake of backwards compatibility; we
+ " don't want to break users if we can avoid it.
+
+ if exists('g:ycm_key_select_completion') &&
+ \ index(g:ycm_key_list_select_completion,
+ \ g:ycm_key_select_completion) == -1
+ call add(g:ycm_key_list_select_completion, g:ycm_key_select_completion)
+ endif
+
+ if exists('g:ycm_key_previous_completion') &&
+ \ index(g:ycm_key_list_previous_completion,
+ \ g:ycm_key_previous_completion) == -1
+ call add(g:ycm_key_list_previous_completion, g:ycm_key_previous_completion)
+ endif
+
+ for key in g:ycm_key_list_select_completion
+ " With this command, when the completion window is visible, the tab key
+ " (default) will select the next candidate in the window. In vim, this also
+ " changes the typed-in text to that of the candidate completion.
+ exe 'inoremap <expr>' . key .
+ \ ' pumvisible() ? "\<C-n>" : "\' . key .'"'
+ endfor
+
+
+ for key in g:ycm_key_list_previous_completion
+ " This selects the previous candidate for shift-tab (default)
+ exe 'inoremap <expr>' . key .
+ \ ' pumvisible() ? "\<C-p>" : "\' . key .'"'
+ endfor
+
+ if !empty( g:ycm_key_invoke_completion )
+ let invoke_key = g:ycm_key_invoke_completion
+
+ " Inside the console, <C-Space> is passed as <Nul> to Vim
+ if invoke_key ==# '<C-Space>'
+ imap <Nul> <C-Space>
+ endif
+
+ " <c-x><c-o> trigger omni completion, <c-p> deselects the first completion
+ " candidate that vim selects by default
+ silent! exe 'inoremap <unique> ' . invoke_key . ' <C-X><C-O><C-P>'
+ endif
+
+ if !empty( g:ycm_key_detailed_diagnostics )
+ silent! exe 'nnoremap <unique> ' . g:ycm_key_detailed_diagnostics .
+ \ ' :YcmShowDetailedDiagnostic<cr>'
+ endif
+endfunction
+
+
+function! s:SetUpSigns()
+ " We try to ensure backwards compatibility with Syntastic if the user has
+ " already defined styling for Syntastic highlight groups.
+
+ if !hlexists( 'YcmErrorSign' )
+ if hlexists( 'SyntasticErrorSign')
+ highlight link YcmErrorSign SyntasticErrorSign
+ else
+ highlight link YcmErrorSign error
+ endif
+ endif
+
+ if !hlexists( 'YcmWarningSign' )
+ if hlexists( 'SyntasticWarningSign')
+ highlight link YcmWarningSign SyntasticWarningSign
+ else
+ highlight link YcmWarningSign todo
+ endif
+ endif
+
+ if !hlexists( 'YcmErrorLine' )
+ highlight link YcmErrorLine SyntasticErrorLine
+ endif
+
+ if !hlexists( 'YcmWarningLine' )
+ highlight link YcmWarningLine SyntasticWarningLine
+ endif
+
+ exe 'sign define YcmError text=' . g:ycm_error_symbol .
+ \ ' texthl=YcmErrorSign linehl=YcmErrorLine'
+ exe 'sign define YcmWarning text=' . g:ycm_warning_symbol .
+ \ ' texthl=YcmWarningSign linehl=YcmWarningLine'
+endfunction
+
+
+function! s:SetUpSyntaxHighlighting()
+ " We try to ensure backwards compatibility with Syntastic if the user has
+ " already defined styling for Syntastic highlight groups.
+
+ if !hlexists( 'YcmErrorSection' )
+ if hlexists( 'SyntasticError' )
+ highlight link YcmErrorSection SyntasticError
+ else
+ highlight link YcmErrorSection SpellBad
+ endif
+ endif
+
+ if !hlexists( 'YcmWarningSection' )
+ if hlexists( 'SyntasticWarning' )
+ highlight link YcmWarningSection SyntasticWarning
+ else
+ highlight link YcmWarningSection SpellCap
+ endif
+ endif
+endfunction
+
+
+function! s:SetUpBackwardsCompatibility()
+ let complete_in_comments_and_strings =
+ \ get( g:, 'ycm_complete_in_comments_and_strings', 0 )
+
+ if complete_in_comments_and_strings
+ let g:ycm_complete_in_strings = 1
+ let g:ycm_complete_in_comments = 1
+ endif
+
+ " ycm_filetypes_to_completely_ignore is the old name for fileype_blacklist
+ if has_key( g:, 'ycm_filetypes_to_completely_ignore' )
+ let g:filetype_blacklist = g:ycm_filetypes_to_completely_ignore
+ endif
+endfunction
+
+
+" Needed so that YCM is used instead of Syntastic
+function! s:TurnOffSyntasticForCFamily()
+ let g:syntastic_cpp_checkers = []
+ let g:syntastic_c_checkers = []
+ let g:syntastic_objc_checkers = []
+ let g:syntastic_objcpp_checkers = []
+endfunction
+
+
+function! s:AllowedToCompleteInCurrentFile()
+ if empty( &filetype ) ||
+ \ getbufvar( winbufnr( winnr() ), "&buftype" ) ==# 'nofile' ||
+ \ &filetype ==# 'qf'
+ return 0
+ endif
+
+ if exists( 'b:ycm_largefile' )
+ return 0
+ endif
+
+ let whitelist_allows = has_key( g:ycm_filetype_whitelist, '*' ) ||
+ \ has_key( g:ycm_filetype_whitelist, &filetype )
+ let blacklist_allows = !has_key( g:ycm_filetype_blacklist, &filetype )
+
+ return whitelist_allows && blacklist_allows
+endfunction
+
+
+function! s:SetUpCommands()
+ command! YcmRestartServer call s:RestartServer()
+ command! YcmShowDetailedDiagnostic call s:ShowDetailedDiagnostic()
+ command! YcmDebugInfo call s:DebugInfo()
+ command! -nargs=? -complete=custom,youcompleteme#LogsComplete
+ \ YcmToggleLogs call s:ToggleLogs(<f-args>)
+ command! -nargs=* -complete=custom,youcompleteme#SubCommandsComplete
+ \ YcmCompleter call s:CompleterCommand(<f-args>)
+ command! YcmForceCompileAndDiagnostics call s:ForceCompileAndDiagnostics()
+ command! YcmDiags call s:ShowDiagnostics()
+endfunction
+
+
+function! s:SetUpCpoptions()
+ " Without this flag in cpoptions, critical YCM mappings do not work. There's
+ " no way to not have this and have YCM working, so force the flag.
+ set cpoptions+=B
+
+ " This prevents the display of "Pattern not found" & similar messages during
+ " completion. This is only available since Vim 7.4.314
+ if s:Pyeval( 'vimsupport.VimVersionAtLeast("7.4.314")' )
+ set shortmess+=c
+ endif
+endfunction
+
+
+function! s:SetUpCompleteopt()
+ " Some plugins (I'm looking at you, vim-notes) change completeopt by for
+ " instance adding 'longest'. This breaks YCM. So we force our settings.
+ " There's no two ways about this: if you want to use YCM then you have to
+ " have these completeopt settings, otherwise YCM won't work at all.
+
+ " We need menuone in completeopt, otherwise when there's only one candidate
+ " for completion, the menu doesn't show up.
+ set completeopt-=menu
+ set completeopt+=menuone
+
+ " This is unnecessary with our features. People use this option to insert
+ " the common prefix of all the matches and then add more differentiating chars
+ " so that they can select a more specific match. With our features, they
+ " don't need to insert the prefix; they just type the differentiating chars.
+ " Also, having this option set breaks the plugin.
+ set completeopt-=longest
+
+ if g:ycm_add_preview_to_completeopt
+ set completeopt+=preview
+ endif
+endfunction
+
+
+" For various functions/use-cases, we want to keep track of whether the buffer
+" has changed since the last time they were invoked. We keep the state of
+" b:changedtick of the last time the specific function was called in
+" b:ycm_changedtick.
+function! s:SetUpYcmChangedTick()
+ let b:ycm_changedtick =
+ \ get( b:, 'ycm_changedtick', {
+ \ 'file_ready_to_parse' : -1,
+ \ } )
+endfunction
+
+
+function! s:OnVimLeave()
+ exec s:python_command "ycm_state.OnVimLeave()"
+endfunction
+
+
+function! s:OnCompleteDone()
+ exec s:python_command "ycm_state.OnCompleteDone()"
+endfunction
+
+
+function! s:OnBufferReadPre(filename)
+ let threshold = g:ycm_disable_for_files_larger_than_kb * 1024
+
+ if threshold > 0 && getfsize( a:filename ) > threshold
+ echohl WarningMsg |
+ \ echomsg "YouCompleteMe is disabled in this buffer; " .
+ \ "the file exceeded the max size (see YCM options)." |
+ \ echohl None
+ let b:ycm_largefile = 1
+ endif
+endfunction
+
+function! s:OnBufferVisit()
+ " We need to do this even when we are not allowed to complete in the current
+ " file because we might be allowed to complete in the future! The canonical
+ " example is creating a new buffer with :enew and then setting a filetype.
+ call s:SetUpYcmChangedTick()
+
+ if !s:AllowedToCompleteInCurrentFile()
+ return
+ endif
+
+ call s:SetUpCompleteopt()
+ call s:SetCompleteFunc()
+
+ if !s:defer_omnifunc
+ call s:SetOmnicompleteFunc()
+ endif
+
+ exec s:python_command "ycm_state.OnBufferVisit()"
+ call s:OnFileReadyToParse()
+endfunction
+
+
+function! s:OnBufferUnload( deleted_buffer_file )
+ if !s:AllowedToCompleteInCurrentFile() || empty( a:deleted_buffer_file )
+ return
+ endif
+
+ exec s:python_command "ycm_state.OnBufferUnload("
+ \ "vim.eval( 'a:deleted_buffer_file' ) )"
+endfunction
+
+
+function! s:OnCursorHold()
+ if !s:AllowedToCompleteInCurrentFile()
+ return
+ endif
+
+ call s:SetUpCompleteopt()
+ call s:OnFileReadyToParse()
+endfunction
+
+
+function! s:OnFileReadyToParse()
+ " We need to call this just in case there is no b:ycm_changetick; this can
+ " happen for special buffers.
+ call s:SetUpYcmChangedTick()
+
+ " Order is important here; we need to extract any information before
+ " reparsing the file again. If we sent the new parse request first, then
+ " the response would always be pending when we called
+ " HandleFileParseRequest.
+ exec s:python_command "ycm_state.HandleFileParseRequest()"
+
+ let buffer_changed = b:changedtick != b:ycm_changedtick.file_ready_to_parse
+ if buffer_changed
+ exec s:python_command "ycm_state.OnFileReadyToParse()"
+ endif
+ let b:ycm_changedtick.file_ready_to_parse = b:changedtick
+endfunction
+
+
+function! s:SetCompleteFunc()
+ let &completefunc = 'youcompleteme#Complete'
+ let &l:completefunc = 'youcompleteme#Complete'
+endfunction
+
+
+function! s:SetOmnicompleteFunc()
+ if s:Pyeval( 'ycm_state.NativeFiletypeCompletionUsable()' )
+ let &omnifunc = 'youcompleteme#OmniComplete'
+ let &l:omnifunc = 'youcompleteme#OmniComplete'
+
+ " If we don't have native filetype support but the omnifunc is set to YCM's
+ " omnifunc because the previous file the user was editing DID have native
+ " support, we remove our omnifunc.
+ elseif &omnifunc == 'youcompleteme#OmniComplete'
+ let &omnifunc = ''
+ let &l:omnifunc = ''
+ endif
+endfunction
+
+function! s:OnCursorMovedInsertMode()
+ if !s:AllowedToCompleteInCurrentFile()
+ return
+ endif
+
+ exec s:python_command "ycm_state.OnCursorMoved()"
+ call s:UpdateCursorMoved()
+
+ " Basically, we need to only trigger the completion menu when the user has
+ " inserted or deleted a character, NOT just when the user moves in insert mode
+ " (with, say, the arrow keys). If we trigger the menu even on pure moves, then
+ " it's impossible to move in insert mode since the up/down arrows start moving
+ " the selected completion in the completion menu. Yeah, people shouldn't be
+ " moving in insert mode at all (that's what normal mode is for) but explain
+ " that to the users who complain...
+ if !s:BufferTextChangedSinceLastMoveInInsertMode()
+ return
+ endif
+
+ call s:IdentifierFinishedOperations()
+ if g:ycm_autoclose_preview_window_after_completion
+ call s:ClosePreviewWindowIfNeeded()
+ endif
+
+ if g:ycm_auto_trigger || s:omnifunc_mode
+ call s:InvokeCompletion()
+ endif
+
+ " We have to make sure we correctly leave omnifunc mode even when the user
+ " inserts something like a "operator[]" candidate string which fails
+ " CurrentIdentifierFinished check.
+ if s:omnifunc_mode && !s:Pyeval( 'base.LastEnteredCharIsIdentifierChar()')
+ let s:omnifunc_mode = 0
+ endif
+endfunction
+
+
+function! s:OnCursorMovedNormalMode()
+ if !s:AllowedToCompleteInCurrentFile()
+ return
+ endif
+
+ call s:OnFileReadyToParse()
+ exec s:python_command "ycm_state.OnCursorMoved()"
+endfunction
+
+
+function! s:OnInsertLeave()
+ if !s:AllowedToCompleteInCurrentFile()
+ return
+ endif
+
+ let s:omnifunc_mode = 0
+ call s:OnFileReadyToParse()
+ exec s:python_command "ycm_state.OnInsertLeave()"
+ if g:ycm_autoclose_preview_window_after_completion ||
+ \ g:ycm_autoclose_preview_window_after_insertion
+ call s:ClosePreviewWindowIfNeeded()
+ endif
+endfunction
+
+
+function! s:OnInsertEnter()
+ let s:previous_num_chars_on_current_line = strlen( getline('.') )
+
+ if !s:AllowedToCompleteInCurrentFile()
+ return
+ endif
+
+ let s:old_cursor_position = []
+endfunction
+
+
+function! s:UpdateCursorMoved()
+ let current_position = getpos('.')
+ let s:cursor_moved = current_position != s:old_cursor_position
+
+ let s:moved_vertically_in_insert_mode = s:old_cursor_position != [] &&
+ \ current_position[ 1 ] != s:old_cursor_position[ 1 ]
+
+ let s:old_cursor_position = current_position
+endfunction
+
+
+function! s:BufferTextChangedSinceLastMoveInInsertMode()
+ let num_chars_in_current_cursor_line = strlen( getline('.') )
+
+ if s:moved_vertically_in_insert_mode
+ let s:previous_num_chars_on_current_line = num_chars_in_current_cursor_line
+ return 0
+ endif
+
+ let changed_text_on_current_line = num_chars_in_current_cursor_line !=
+ \ s:previous_num_chars_on_current_line
+ let s:previous_num_chars_on_current_line = num_chars_in_current_cursor_line
+
+ return changed_text_on_current_line
+endfunction
+
+
+function! s:ClosePreviewWindowIfNeeded()
+ let current_buffer_name = bufname('')
+
+ " We don't want to try to close the preview window in special buffers like
+ " "[Command Line]"; if we do, Vim goes bonkers. Special buffers always start
+ " with '['.
+ if current_buffer_name[ 0 ] == '['
+ return
+ endif
+
+ " This command does the actual closing of the preview window. If no preview
+ " window is shown, nothing happens.
+ pclose
+endfunction
+
+
+function! s:IdentifierFinishedOperations()
+ if !s:Pyeval( 'base.CurrentIdentifierFinished()' )
+ return
+ endif
+ exec s:python_command "ycm_state.OnCurrentIdentifierFinished()"
+ let s:omnifunc_mode = 0
+endfunction
+
+
+" Returns 1 when inside comment and 2 when inside string
+function! s:InsideCommentOrString()
+ " Has to be col('.') -1 because col('.') doesn't exist at this point. We are
+ " in insert mode when this func is called.
+ let syntax_group = synIDattr(
+ \ synIDtrans( synID( line( '.' ), col( '.' ) - 1, 1 ) ), 'name')
+
+ if stridx(syntax_group, 'Comment') > -1
+ return 1
+ endif
+
+ if stridx(syntax_group, 'String') > -1
+ return 2
+ endif
+
+ return 0
+endfunction
+
+
+function! s:InsideCommentOrStringAndShouldStop()
+ let retval = s:InsideCommentOrString()
+ let inside_comment = retval == 1
+ let inside_string = retval == 2
+
+ if inside_comment && g:ycm_complete_in_comments ||
+ \ inside_string && g:ycm_complete_in_strings
+ return 0
+ endif
+
+ return retval
+endfunction
+
+
+function! s:OnBlankLine()
+ return s:Pyeval( 'not vim.current.line or vim.current.line.isspace()' )
+endfunction
+
+
+function! s:InvokeCompletion()
+ if &completefunc != "youcompleteme#Complete"
+ return
+ endif
+
+ if s:InsideCommentOrStringAndShouldStop() || s:OnBlankLine()
+ return
+ endif
+
+ " This is tricky. First, having 'refresh' set to 'always' in the dictionary
+ " that our completion function returns makes sure that our completion function
+ " is called on every keystroke. Second, when the sequence of characters the
+ " user typed produces no results in our search an infinite loop can occur. The
+ " problem is that our feedkeys call triggers the OnCursorMovedI event which we
+ " are tied to. We prevent this infinite loop from starting by making sure that
+ " the user has moved the cursor since the last time we provided completion
+ " results.
+ if !s:cursor_moved
+ return
+ endif
+
+ " <c-x><c-u> invokes the user's completion function (which we have set to
+ " youcompleteme#Complete), and <c-p> tells Vim to select the previous
+ " completion candidate. This is necessary because by default, Vim selects the
+ " first candidate when completion is invoked, and selecting a candidate
+ " automatically replaces the current text with it. Calling <c-p> forces Vim to
+ " deselect the first candidate and in turn preserve the user's current text
+ " until he explicitly chooses to replace it with a completion.
+ call feedkeys( "\<C-X>\<C-U>\<C-P>", 'n' )
+endfunction
+
+
+exec s:python_until_eof
+def GetCompletionsInner():
+ request = ycm_state.GetCurrentCompletionRequest()
+ request.Start()
+ while not request.Done():
+ if bool( int( vim.eval( 'complete_check()' ) ) ):
+ return { 'words' : [], 'refresh' : 'always'}
+
+ results = base.AdjustCandidateInsertionText( request.Response() )
+ return { 'words' : results, 'refresh' : 'always' }
+EOF
+
+
+function! s:GetCompletions()
+ exec s:python_command "results = GetCompletionsInner()"
+ let results = s:Pyeval( 'results' )
+ return results
+endfunction
+
+
+" This is our main entry point. This is what vim calls to get completions.
+function! youcompleteme#Complete( findstart, base )
+ " After the user types one character after the call to the omnifunc, the
+ " completefunc will be called because of our mapping that calls the
+ " completefunc on every keystroke. Therefore we need to delegate the call we
+ " 'stole' back to the omnifunc
+ if s:omnifunc_mode
+ return youcompleteme#OmniComplete( a:findstart, a:base )
+ endif
+
+ if a:findstart
+ " InvokeCompletion has this check but we also need it here because of random
+ " Vim bugs and unfortunate interactions with the autocommands of other
+ " plugins
+ if !s:cursor_moved
+ " for vim, -2 means not found but don't trigger an error message
+ " see :h complete-functions
+ return -2
+ endif
+
+ if !s:Pyeval( 'ycm_state.IsServerAlive()' )
+ return -2
+ endif
+ exec s:python_command "ycm_state.CreateCompletionRequest()"
+ return s:Pyeval( 'base.CompletionStartColumn()' )
+ else
+ return s:GetCompletions()
+ endif
+endfunction
+
+
+function! youcompleteme#OmniComplete( findstart, base )
+ if a:findstart
+ if !s:Pyeval( 'ycm_state.IsServerAlive()' )
+ return -2
+ endif
+ let s:omnifunc_mode = 1
+ exec s:python_command "ycm_state.CreateCompletionRequest("
+ \ "force_semantic = True )"
+ return s:Pyeval( 'base.CompletionStartColumn()' )
+ else
+ return s:GetCompletions()
+ endif
+endfunction
+
+
+function! youcompleteme#ServerPid()
+ return s:Pyeval( 'ycm_state.ServerPid()' )
+endfunction
+
+
+function! s:RestartServer()
+ exec s:python_command "ycm_state.RestartServer()"
+endfunction
+
+
+function! s:ShowDetailedDiagnostic()
+ exec s:python_command "ycm_state.ShowDetailedDiagnostic()"
+endfunction
+
+
+function! s:DebugInfo()
+ echom "Printing YouCompleteMe debug information..."
+ let debug_info = s:Pyeval( 'ycm_state.DebugInfo()' )
+ for line in split( debug_info, "\n" )
+ echom '-- ' . line
+ endfor
+endfunction
+
+
+function! s:ToggleLogs(...)
+ let stderr = a:0 == 0 || a:1 !=? 'stdout'
+ let stdout = a:0 == 0 || a:1 !=? 'stderr'
+ exec s:python_command "ycm_state.ToggleLogs("
+ \ "stdout = vimsupport.GetBoolValue( 'l:stdout' ),"
+ \ "stderr = vimsupport.GetBoolValue( 'l:stderr' ) )"
+endfunction
+
+
+function! s:CompleterCommand(...)
+ " CompleterCommand will call the OnUserCommand function of a completer.
+ " If the first arguments is of the form "ft=..." it can be used to specify the
+ " completer to use (for example "ft=cpp"). Else the native filetype completer
+ " of the current buffer is used. If no native filetype completer is found and
+ " no completer was specified this throws an error. You can use
+ " "ft=ycm:ident" to select the identifier completer.
+ " The remaining arguments will be passed to the completer.
+ let arguments = copy(a:000)
+ let completer = ''
+
+ if a:0 > 0 && strpart(a:1, 0, 3) == 'ft='
+ if a:1 == 'ft=ycm:ident'
+ let completer = 'identifier'
+ endif
+ let arguments = arguments[1:]
+ endif
+
+ exec s:python_command "ycm_state.SendCommandRequest("
+ \ "vim.eval( 'l:arguments' ), vim.eval( 'l:completer' ) ) "
+endfunction
+
+
+function! youcompleteme#OpenGoToList()
+ exec s:python_command "vimsupport.PostVimMessage("
+ \ "'WARNING: youcompleteme#OpenGoToList function is deprecated."
+ \ "Do NOT use it.')"
+ exec s:python_command "vimsupport.OpenQuickFixList( True, True )"
+endfunction
+
+
+function! youcompleteme#LogsComplete( arglead, cmdline, cursorpos )
+ return "stdout\nstderr"
+endfunction
+
+
+function! youcompleteme#SubCommandsComplete( arglead, cmdline, cursorpos )
+ return join( s:Pyeval( 'ycm_state.GetDefinedSubcommands()' ),
+ \ "\n")
+endfunction
+
+
+function! s:ForceCompile()
+ if !s:Pyeval( 'ycm_state.NativeFiletypeCompletionUsable()' )
+ echom "Native filetype completion not supported for current file, "
+ \ . "cannot force recompilation."
+ return 0
+ endif
+
+ echom "Forcing compilation, this will block Vim until done."
+ exec s:python_command "ycm_state.OnFileReadyToParse()"
+ exec s:python_command "ycm_state.HandleFileParseRequest( True )"
+
+ return 1
+endfunction
+
+
+function! s:ForceCompileAndDiagnostics()
+ let compilation_succeeded = s:ForceCompile()
+ if !compilation_succeeded
+ return
+ endif
+ echom "Diagnostics refreshed."
+endfunction
+
+
+function! s:ShowDiagnostics()
+ let compilation_succeeded = s:ForceCompile()
+ if !compilation_succeeded
+ return
+ endif
+
+ if s:Pyeval( 'ycm_state.PopulateLocationListWithLatestDiagnostics()' )
+ if g:ycm_open_loclist_on_ycm_diags
+ lopen
+ endif
+ else
+ echom "No warnings or errors detected"
+ endif
+endfunction
+
+
+" This is basic vim plugin boilerplate
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/YouCompleteMe/ci/appveyor/appveyor_install.bat b/vim/bundle/YouCompleteMe/ci/appveyor/appveyor_install.bat
new file mode 100755
index 0000000..33c7807
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/ci/appveyor/appveyor_install.bat
@@ -0,0 +1,22 @@
+git submodule update --init --recursive
+:: Batch script will not exit if a command returns an error, so we manually do
+:: it for commands that may fail.
+if %errorlevel% neq 0 exit /b %errorlevel%
+
+::
+:: Python configuration
+::
+
+if %arch% == 32 (
+ set python_path=C:\Python%python%
+) else (
+ set python_path=C:\Python%python%-x64
+)
+
+set PATH=%python_path%;%python_path%\Scripts;%PATH%
+python --version
+
+appveyor DownloadFile https://bootstrap.pypa.io/get-pip.py
+python get-pip.py
+pip install -r python\test_requirements.txt
+if %errorlevel% neq 0 exit /b %errorlevel%
diff --git a/vim/bundle/YouCompleteMe/ci/travis/travis_install.linux.sh b/vim/bundle/YouCompleteMe/ci/travis/travis_install.linux.sh
new file mode 100644
index 0000000..52d400e
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/ci/travis/travis_install.linux.sh
@@ -0,0 +1,5 @@
+# Linux-specific installation
+
+# In order to work with ycmd, python *must* be built as a shared library. This
+# is set via the PYTHON_CONFIGURE_OPTS option.
+export PYTHON_CONFIGURE_OPTS="--enable-shared"
diff --git a/vim/bundle/YouCompleteMe/ci/travis/travis_install.osx.sh b/vim/bundle/YouCompleteMe/ci/travis/travis_install.osx.sh
new file mode 100644
index 0000000..3873f93
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/ci/travis/travis_install.osx.sh
@@ -0,0 +1,24 @@
+# OS X-specific installation
+
+# There's a homebrew bug which causes brew update to fail the first time. Run
+# it twice to workaround. https://github.com/Homebrew/homebrew/issues/42553
+brew update || brew update
+
+# List of homebrew formulae to install in the order they appear.
+# These are dependencies of pyenv.
+REQUIREMENTS="ninja
+ readline
+ autoconf
+ pkg-config
+ openssl"
+
+# Install pyenv and dependencies
+for pkg in $REQUIREMENTS; do
+ # Install package, or upgrade it if it is already installed
+ brew install $pkg || brew outdated $pkg || brew upgrade $pkg
+done
+
+# In order to work with ycmd, python *must* be built as a shared library. The
+# most compatible way to do this on OS X is with --enable-framework. This is
+# set via the PYTHON_CONFIGURE_OPTS option
+export PYTHON_CONFIGURE_OPTS="--enable-framework"
diff --git a/vim/bundle/YouCompleteMe/ci/travis/travis_install.sh b/vim/bundle/YouCompleteMe/ci/travis/travis_install.sh
new file mode 100644
index 0000000..0060de9
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/ci/travis/travis_install.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+set -ev
+
+####################
+# OS-specific setup
+####################
+
+# Requirements of OS-specific install:
+# - install any software which is not installed by Travis configuration
+# - set up everything necessary so that pyenv can build python
+source ci/travis/travis_install.${TRAVIS_OS_NAME}.sh
+
+#############
+# pyenv setup
+#############
+
+export PYENV_ROOT="${HOME}/.pyenv"
+
+if [ ! -d "${PYENV_ROOT}/.git" ]; then
+ git clone https://github.com/yyuu/pyenv.git ${PYENV_ROOT}
+fi
+pushd ${PYENV_ROOT}
+git fetch --tags
+git checkout v20160202
+popd
+
+export PATH="${PYENV_ROOT}/bin:${PATH}"
+
+eval "$(pyenv init -)"
+
+if [ "${YCM_PYTHON_VERSION}" == "2.6" ]; then
+ PYENV_VERSION="2.6.6"
+elif [ "${YCM_PYTHON_VERSION}" == "2.7" ]; then
+ PYENV_VERSION="2.7.6"
+else
+ PYENV_VERSION="3.3.6"
+fi
+
+pyenv install --skip-existing ${PYENV_VERSION}
+pyenv rehash
+pyenv global ${PYENV_VERSION}
+
+# It is quite easy to get the above series of steps wrong. Verify that the
+# version of python actually in the path and used is the version that was
+# requested, and fail the build if we broke the travis setup
+python_version=$(python -c 'import sys; print( "{0}.{1}".format( sys.version_info[0], sys.version_info[1] ) )')
+echo "Checking python version (actual ${python_version} vs expected ${YCM_PYTHON_VERSION})"
+test ${python_version} == ${YCM_PYTHON_VERSION}
+
+############
+# pip setup
+############
+
+pip install -U pip wheel setuptools
+pip install -r python/test_requirements.txt
+
+# The build infrastructure prints a lot of spam after this script runs, so make
+# sure to disable printing, and failing on non-zero exit code after this script
+# finishes
+set +ev
diff --git a/vim/bundle/YouCompleteMe/doc/youcompleteme.txt b/vim/bundle/YouCompleteMe/doc/youcompleteme.txt
new file mode 100644
index 0000000..4a7bfd7
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/doc/youcompleteme.txt
@@ -0,0 +1,3209 @@
+*youcompleteme* YouCompleteMe: a code-completion engine for Vim
+
+===============================================================================
+Contents ~
+
+ 1. Introduction |youcompleteme-introduction|
+ 2. Intro |youcompleteme-intro|
+ 3. Installation |youcompleteme-installation|
+ 1. Mac OS X |youcompleteme-mac-os-x|
+ 2. Ubuntu Linux x64 |youcompleteme-ubuntu-linux-x64|
+ 3. Fedora Linux x64 |youcompleteme-fedora-linux-x64|
+ 4. Windows |youcompleteme-windows|
+ 5. FreeBSD/OpenBSD |youcompleteme-freebsd-openbsd|
+ 6. Full Installation Guide |youcompleteme-full-installation-guide|
+ 4. Quick Feature Summary |youcompleteme-quick-feature-summary|
+ 1. General (all languages) |youcompleteme-general|
+ 2. C-family languages (C, C++, Objective C, Objective C++) |youcompleteme-c-family-languages|
+ 3. C♯ |youcompleteme-c|
+ 4. Python |youcompleteme-python|
+ 5. Go |youcompleteme-go|
+ 6. TypeScript |youcompleteme-typescript|
+ 7. JavaScript |youcompleteme-javascript|
+ 8. Rust |youcompleteme-rust|
+ 5. User Guide |youcompleteme-user-guide|
+ 1. General Usage |youcompleteme-general-usage|
+ 2. Client-Server Architecture |youcompleteme-client-server-architecture|
+ 3. Completion String Ranking |youcompleteme-completion-string-ranking|
+ 4. General Semantic Completion |youcompleteme-general-semantic-completion|
+ 5. C-family Semantic Completion |youcompleteme-c-family-semantic-completion|
+ 6. JavaScript Semantic Completion |youcompleteme-javascript-semantic-completion|
+ 1. Quick start |youcompleteme-quick-start|
+ 2. Explanation |youcompleteme-explanation|
+ 3. Tips and tricks |youcompleteme-tips-tricks|
+ 1. Configuring Tern for node support |youcompleteme-configuring-tern-for-node-support|
+ 2. Configuring Tern for requirejs support |youcompleteme-configuring-tern-for-requirejs-support|
+ 7. Rust Semantic Completion |youcompleteme-rust-semantic-completion|
+ 8. Python Semantic Completion |youcompleteme-python-semantic-completion|
+ 9. Semantic Completion for Other Languages |youcompleteme-semantic-completion-for-other-languages|
+ 10. Writing New Semantic Completers |youcompleteme-writing-new-semantic-completers|
+ 11. Diagnostic Display |youcompleteme-diagnostic-display|
+ 1. Diagnostic Highlighting Groups |youcompleteme-diagnostic-highlighting-groups|
+ 6. Commands |youcompleteme-commands|
+ 1. The |:YcmRestartServer| command
+ 2. The |:YcmForceCompileAndDiagnostics| command
+ 3. The |:YcmDiags| command
+ 4. The |:YcmShowDetailedDiagnostic| command
+ 5. The |:YcmDebugInfo| command
+ 6. The |:YcmToggleLogs| command
+ 7. The |:YcmCompleter| command
+ 7. YcmCompleter Subcommands |youcompleteme-ycmcompleter-subcommands|
+ 1. GoTo Commands |youcompleteme-goto-commands|
+ 1. The |GoToInclude| subcommand
+ 2. The |GoToDeclaration| subcommand
+ 3. The |GoToDefinition| subcommand
+ 4. The |GoTo| subcommand
+ 5. The |GoToImprecise| subcommand
+ 6. The |GoToReferences| subcommand
+ 7. The |GoToImplementation| subcommand
+ 8. The |GoToImplementationElseDeclaration| subcommand
+ 2. Semantic Information Commands |youcompleteme-semantic-information-commands|
+ 1. The |GetType| subcommand
+ 2. The |GetParent| subcommand
+ 3. The |GetDoc| subcommand
+ 3. Refactoring and FixIt Commands |youcompleteme-refactoring-fixit-commands|
+ 1. The |FixIt| subcommand
+ 2. The 'RefactorRename <new name>' subcommand |RefactorRename-new-name|
+ 3. Multi-file Refactor |youcompleteme-multi-file-refactor|
+ 4. Miscellaneous Commands |youcompleteme-miscellaneous-commands|
+ 1. The |ClearCompilationFlagCache| subcommand
+ 2. The |StartServer| subcommand
+ 3. The |StopServer| subcommand
+ 4. The |RestartServer| subcommand
+ 5. The |ReloadSolution| subcommand
+ 8. Functions |youcompleteme-functions|
+ 1. The |youcompleteme#GetErrorCount| function
+ 2. The |youcompleteme#GetWarningCount| function
+ 9. Autocommands |youcompleteme-autocommands|
+ 1. The |YcmQuickFixOpened| autocommand
+ 10. Options |youcompleteme-options|
+ 1. The |g:ycm_min_num_of_chars_for_completion| option
+ 2. The |g:ycm_min_num_identifier_candidate_chars| option
+ 3. The |g:ycm_auto_trigger| option
+ 4. The |g:ycm_filetype_whitelist| option
+ 5. The |g:ycm_filetype_blacklist| option
+ 6. The |g:ycm_filetype_specific_completion_to_disable| option
+ 7. The |g:ycm_show_diagnostics_ui| option
+ 8. The |g:ycm_error_symbol| option
+ 9. The |g:ycm_warning_symbol| option
+ 10. The |g:ycm_enable_diagnostic_signs| option
+ 11. The |g:ycm_enable_diagnostic_highlighting| option
+ 12. The |g:ycm_echo_current_diagnostic| option
+ 13. The |g:ycm_always_populate_location_list| option
+ 14. The |g:ycm_open_loclist_on_ycm_diags| option
+ 15. The |g:ycm_allow_changing_updatetime| option
+ 16. The |g:ycm_complete_in_comments| option
+ 17. The |g:ycm_complete_in_strings| option
+ 18. The |g:ycm_collect_identifiers_from_comments_and_strings| option
+ 19. The |g:ycm_collect_identifiers_from_tags_files| option
+ 20. The |g:ycm_seed_identifiers_with_syntax| option
+ 21. The |g:ycm_extra_conf_vim_data| option
+ 22. The |g:ycm_server_python_interpreter| option
+ 23. The |g:ycm_server_keep_logfiles| option
+ 24. The |g:ycm_server_log_level| option
+ 25. The |g:ycm_auto_start_csharp_server| option
+ 26. The |g:ycm_auto_stop_csharp_server| option
+ 27. The |g:ycm_csharp_server_port| option
+ 28. The |g:ycm_csharp_insert_namespace_expr| option
+ 29. The |g:ycm_add_preview_to_completeopt| option
+ 30. The |g:ycm_autoclose_preview_window_after_completion| option
+ 31. The |g:ycm_autoclose_preview_window_after_insertion| option
+ 32. The |g:ycm_max_diagnostics_to_display| option
+ 33. The |g:ycm_key_list_select_completion| option
+ 34. The |g:ycm_key_list_previous_completion| option
+ 35. The |g:ycm_key_invoke_completion| option
+ 36. The |g:ycm_key_detailed_diagnostics| option
+ 37. The |g:ycm_global_ycm_extra_conf| option
+ 38. The |g:ycm_confirm_extra_conf| option
+ 39. The |g:ycm_extra_conf_globlist| option
+ 40. The |g:ycm_filepath_completion_use_working_dir| option
+ 41. The |g:ycm_semantic_triggers| option
+ 42. The |g:ycm_cache_omnifunc| option
+ 43. The |g:ycm_use_ultisnips_completer| option
+ 44. The |g:ycm_goto_buffer_command| option
+ 45. The |g:ycm_disable_for_files_larger_than_kb| option
+ 46. The |g:ycm_python_binary_path| option
+ 11. FAQ |youcompleteme-faq|
+ 1. I used to be able to 'import vim' in '.ycm_extra_conf.py', but now can't |import-vim|
+ 2. On very rare occasions Vim crashes when I tab through the completion menu |youcompleteme-on-very-rare-occasions-vim-crashes-when-i-tab-through-completion-menu|
+ 3. I get |ImportError| exceptions that mention 'PyInit_ycm_core' or 'initycm_core'
+ 4. I get a linker warning regarding |libpython| on Mac when compiling YCM
+ 5. I get a weird window at the top of my file when I use the semantic engine |youcompleteme-i-get-weird-window-at-top-of-my-file-when-i-use-semantic-engine|
+ 6. It appears that YCM is not working |youcompleteme-it-appears-that-ycm-is-not-working|
+ 7. Sometimes it takes much longer to get semantic completions than normal |youcompleteme-sometimes-it-takes-much-longer-to-get-semantic-completions-than-normal|
+ 8. YCM auto-inserts completion strings I don't want! |youcompleteme-ycm-auto-inserts-completion-strings-i-dont-want|
+ 9. I get a 'E227: mapping already exists for <blah>' error when I start Vim |E227:-mapping-already-exists-for-blah|
+ 10. I get "'GLIBC_2.XX' not found (required by libclang.so)" when starting Vim |GLIBC_2.XX-not-found()|
+ 11. I'm trying to use a Homebrew Vim with YCM and I'm getting segfaults |youcompleteme-im-trying-to-use-homebrew-vim-with-ycm-im-getting-segfaults|
+ 12. I have a Homebrew Python and/or MacVim; can't compile/SIGABRT when starting |youcompleteme-i-have-homebrew-python-and-or-macvim-cant-compile-sigabrt-when-starting|
+ 13. Vim segfaults when I use the semantic completer in Ruby files |youcompleteme-vim-segfaults-when-i-use-semantic-completer-in-ruby-files|
+ 14. I get 'LONG_BIT definition appears wrong for platform' when compiling |LONG_BIT-definition-appears-wrong-for-platform|
+ 15. I get 'libpython2.7.a [...] relocation R_X86_64_32' when compiling |libpython2.7.a-...-relocation-R_X86_64_32|
+ 16. I get 'Vim: Caught deadly signal SEGV' on Vim startup |Vim:-Caught-deadly-signal-SEGV|
+ 17. I get 'Fatal Python error: PyThreadState_Get: no current thread' on startup |Fatal-Python-error:-PyThreadState_Get:-no-current-thread|
+ 12. |install.py| says python must be compiled with '--enable-framework'. Wat?
+ 1. YCM does not read identifiers from my tags files |youcompleteme-ycm-does-not-read-identifiers-from-my-tags-files|
+ 2. 'CTRL-U' in insert mode does not work |CTRL-sub-U|
+ 3. YCM conflicts with UltiSnips TAB key usage |youcompleteme-ycm-conflicts-with-ultisnips-tab-key-usage|
+ 4. Why isn't YCM just written in plain VimScript, FFS? |youcompleteme-why-isnt-ycm-just-written-in-plain-vimscript-ffs|
+ 5. Why does YCM demand such a recent version of Vim? |youcompleteme-why-does-ycm-demand-such-recent-version-of-vim|
+ 6. I get annoying messages in Vim's status area when I type |youcompleteme-i-get-annoying-messages-in-vims-status-area-when-i-type|
+ 7. Nasty bugs happen if I have the 'vim-autoclose' plugin installed |vim-sub-autoclose|
+ 8. Is there some sort of YCM mailing list? I have questions |youcompleteme-is-there-sort-of-ycm-mailing-list-i-have-questions|
+ 9. I get an internal compiler error when installing |youcompleteme-i-get-an-internal-compiler-error-when-installing|
+ 10. I get weird errors when I press 'Ctrl-C' in Vim |Ctrl-sub-C|
+ 11. Why did YCM stop using Syntastic for diagnostics display? |youcompleteme-why-did-ycm-stop-using-syntastic-for-diagnostics-display|
+ 12. Completion doesn't work with the C++ standard library headers |youcompleteme-completion-doesnt-work-with-c-standard-library-headers|
+ 13. When I open a JavaScript file, I get an annoying warning about '.tern-project'
+file |.tern-sub-project|
+ 14. When I start vim I get a runtime error saying 'R6034 An application has made an
+attempt to load the C runtime library incorrectly.' |R6034-An-application-has-made-an-attempt-to-load-the-C-runtime-library-incorrectly.|
+ 15. I hear that YCM only supports Python 2, is that true? |youcompleteme-i-hear-that-ycm-only-supports-python-2-is-that-true|
+ 16. On Windows I get "E887: Sorry, this command is disabled, the Python's site
+module could not be loaded" |E887:-Sorry-this-command-is-disabled-the-Python-s-site-module-could-not-be-loaded|
+ 17. I can't complete python packages in a virtual environment. |youcompleteme-i-cant-complete-python-packages-in-virtual-environment.|
+ 13. Contributor Code of Conduct |youcompleteme-contributor-code-of-conduct|
+ 14. Contact |youcompleteme-contact|
+ 15. License |youcompleteme-license|
+ 16. References |youcompleteme-references|
+
+===============================================================================
+ *youcompleteme-introduction*
+Introduction ~
+
+Image: Build Status [1] Image: Build status [3]
+
+- Intro
+- Installation
+
+ - Mac OS X
+ - Ubuntu Linux x64
+ - Fedora Linux x64
+ - Windows
+ - FreeBSD/OpenBSD
+ - Full Installation Guide
+
+- Quick Feature Summary
+- User Guide
+
+ - General Usage
+ - Client-Server Architecture
+ - Completion String Ranking
+ - General Semantic Completion
+ - C-family Semantic Completion
+ - JavaScript Semantic Completion
+ - Rust Semantic Completion
+ - Python Semantic Completion
+ - Semantic Completion for Other Languages
+ - Writing New Semantic Completers
+ - Diagnostic Display
+
+ - Diagnostic Highlighting Groups
+
+- Commands
+
+ - YcmCompleter subcommands
+
+ - GoTo Commands
+ - Semantic Information Commands
+ - Refactoring and FixIt Commands
+ - Miscellaneous Commands
+
+- Functions
+- Autocommands
+- Options
+- FAQ
+- Contributor Code of Conduct
+- Contact
+- License
+
+===============================================================================
+ *youcompleteme-intro*
+Intro ~
+
+YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for
+Vim. It has several completion engines:
+
+- an identifier-based engine that works with every programming language,
+
+- a Clang [5]-based engine that provides native semantic code completion for
+ C/C++/Objective-C/Objective-C++ (from now on referred to as "the C-family
+ languages"),
+
+- a Jedi [6]-based completion engine for Python 2 and 3 (using the JediHTTP
+ [7] wrapper),
+
+- an OmniSharp [8]-based completion engine for C#,
+
+- a combination of Gocode [9] and Godef [10] semantic engines for Go,
+
+- a TSServer [11]-based completion engine for TypeScript,
+
+- a Tern [12]-based completion engine for JavaScript,
+
+- a racer [13]-based completion engine for Rust,
+
+- and an omnifunc-based completer that uses data from Vim's omnicomplete
+ system to provide semantic completions for many other languages (Ruby, PHP
+ etc.).
+
+ Image: YouCompleteMe GIF demo (see reference [14])
+
+Here's an explanation of what happens in the short GIF demo above.
+
+First, realize that **no keyboard shortcuts had to be pressed** to get the list
+of completion candidates at any point in the demo. The user just types and the
+suggestions pop up by themselves. If the user doesn't find the completion
+suggestions relevant and/or just wants to type, they can do so; the completion
+engine will not interfere.
+
+When the user sees a useful completion string being offered, they press the TAB
+key to accept it. This inserts the completion string. Repeated presses of the
+TAB key cycle through the offered completions.
+
+If the offered completions are not relevant enough, the user can continue
+typing to further filter out unwanted completions.
+
+A critical thing to notice is that the completion **filtering is NOT based on
+the input being a string prefix of the completion** (but that works too). The
+input needs to be a _subsequence [15] match_ of a completion. This is a fancy
+way of saying that any input characters need to be present in a completion
+string in the order in which they appear in the input. So 'abc' is a
+subsequence of 'xaybgc', but not of 'xbyxaxxc'. After the filter, a complicated
+sorting system ranks the completion strings so that the most relevant ones rise
+to the top of the menu (so you usually need to press TAB just once).
+
+**All of the above works with any programming language** because of the
+identifier-based completion engine. It collects all of the identifiers in the
+current file and other files you visit (and your tags files) and searches them
+when you type (identifiers are put into per-filetype groups).
+
+The demo also shows the semantic engine in use. When the user presses '.', '->'
+or '::' while typing in insert mode (for C++; different triggers are used for
+other languages), the semantic engine is triggered (it can also be triggered
+with a keyboard shortcut; see the rest of the docs).
+
+The last thing that you can see in the demo is YCM's diagnostic display
+features (the little red X that shows up in the left gutter; inspired by
+Syntastic [16]) if you are editing a C-family file. As Clang compiles your file
+and detects warnings or errors, they will be presented in various ways. You
+don't need to save your file or press any keyboard shortcut to trigger this, it
+"just happens" in the background.
+
+In essence, YCM obsoletes the following Vim plugins because it has all of their
+features plus extra:
+
+- clang_complete
+- AutoComplPop
+- Supertab
+- neocomplcache
+
+**And that's not all...**
+
+YCM also provides semantic IDE-like features in a number of languages,
+including:
+
+- finding declarations, definitions, usages, etc. of identifiers,
+- displaying type information for classes, variables, functions etc.,
+- displaying documentation for methods, members, etc. in the preview window,
+- fixing common coding errors, like missing semi-colons, typos, etc.,
+- semantic renaming of variables across files (JavaScript only).
+
+Features vary by file type, so make sure to check out the file type feature
+summary and the full list of completer subcommands to find out what's available
+for your favourite languages.
+
+You'll also find that YCM has filepath completers (try typing './' in a file)
+and a completer that integrates with UltiSnips [17].
+
+===============================================================================
+ *youcompleteme-installation*
+Installation ~
+
+-------------------------------------------------------------------------------
+ *youcompleteme-mac-os-x*
+Mac OS X ~
+
+Please refer to the full Installation Guide below; the following commands are
+provided on a best-effort basis and may not work for you.
+
+Install the latest version of MacVim [18]. Yes, MacVim. And yes, the _latest_.
+
+If you don't use the MacVim GUI, it is recommended to use the Vim binary that
+is inside the MacVim.app package ('MacVim.app/Contents/MacOS/Vim'). To ensure
+it works correctly copy the 'mvim' script from the MacVim [18] download to your
+local binary folder (for example '/usr/local/bin/mvim') and then symlink it:
+>
+ ln -s /usr/local/bin/mvim vim
+<
+Install YouCompleteMe with Vundle [19].
+
+**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
+using Vundle and the ycm_core library APIs have changed (happens rarely), YCM
+will notify you to recompile it. You should then rerun the install process.
+
+**NOTE:** If you want C-family completion, you MUST have the latest Xcode
+installed along with the latest Command Line Tools (they are installed
+automatically when you run 'clang' for the first time, or manually by running
+'xcode-select --install')
+
+Install CMake. Preferably with Homebrew [20], but here's the stand-alone CMake
+installer [21].
+
+_If_ you have installed a Homebrew Python and/or Homebrew MacVim, see the _FAQ_
+for details.
+
+Compiling YCM **with** semantic support for C-family languages:
+>
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --clang-completer
+<
+Compiling YCM **without** semantic support for C-family languages:
+>
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py
+<
+The following additional language support options are available:
+
+- C# support: install Mono with Homebrew [20] or by downloading the Mono Mac
+ package [22] and add '--omnisharp-completer' when calling './install.py'.
+
+- Go support: install Go [23] and add '--gocode-completer' when calling
+ './install.py'.
+
+- TypeScript support: install Node.js and npm [24] then install the
+ TypeScript SDK with 'npm install -g typescript'.
+
+- JavaScript support: install Node.js and npm [24] and add '--tern-completer'
+ when calling './install.py'.
+
+- Rust support: install Rust [25] and add '--racer-completer' when calling
+ './install.py'.
+
+To simply compile with everything enabled, there's a '--all' flag. So, to
+install with all language features, ensure 'xbuild', 'go', 'tsserver', 'node',
+'npm', 'rustc', and 'cargo' tools are installed and in your 'PATH', then simply
+run:
+>
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --all
+<
+That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
+Don't forget that if you want the C-family semantic completion engine to work,
+you will need to provide the compilation flags for your project to YCM. It's
+all in the User Guide.
+
+YCM comes with sane defaults for its options, but you still may want to take a
+look at what's available for configuration. There are a few interesting options
+that are conservatively turned off by default that you may want to turn on.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-ubuntu-linux-x64*
+Ubuntu Linux x64 ~
+
+Please refer to the full Installation Guide below; the following commands are
+provided on a best-effort basis and may not work for you.
+
+Make sure you have Vim 7.3.598 with python2 or python3 support. Ubuntu 14.04
+and later have a Vim that's recent enough. You can see the version of Vim
+installed by running 'vim --version'. If the version is too old, you may need
+to compile Vim from source [26] (don't worry, it's easy).
+
+Install YouCompleteMe with Vundle [19].
+
+**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
+using Vundle and the ycm_core library APIs have changed (happens rarely), YCM
+will notify you to recompile it. You should then rerun the install process.
+
+Install development tools and CMake: 'sudo apt-get install build-essential
+cmake'
+
+Make sure you have Python headers installed: 'sudo apt-get install python-dev
+python3-dev'.
+
+Compiling YCM **with** semantic support for C-family languages:
+>
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --clang-completer
+<
+Compiling YCM **without** semantic support for C-family languages:
+>
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py
+<
+The following additional language support options are available:
+
+- C# support: install Mono [27] and add '--omnisharp-completer' when calling
+ './install.py'.
+
+- Go support: install Go [23] and add '--gocode-completer' when calling
+ './install.py'.
+
+- TypeScript support: install Node.js and npm [24] then install the
+ TypeScript SDK with 'npm install -g typescript'.
+
+- JavaScript support: install Node.js and npm [24] and add '--tern-completer'
+ when calling './install.py'.
+
+- Rust support: install Rust [25] and add '--racer-completer' when calling
+ './install.py'.
+
+To simply compile with everything enabled, there's a '--all' flag. So, to
+install with all language features, ensure 'xbuild', 'go', 'tsserver', 'node',
+'npm', 'rustc', and 'cargo' tools are installed and in your 'PATH', then simply
+run:
+>
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --all
+<
+That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
+Don't forget that if you want the C-family semantic completion engine to work,
+you will need to provide the compilation flags for your project to YCM. It's
+all in the User Guide.
+
+YCM comes with sane defaults for its options, but you still may want to take a
+look at what's available for configuration. There are a few interesting options
+that are conservatively turned off by default that you may want to turn on.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-fedora-linux-x64*
+Fedora Linux x64 ~
+
+Please refer to the full Installation Guide below; the following commands are
+provided on a best-effort basis and may not work for you.
+
+Make sure you have Vim 7.3.598 with Python 2 or Python 3 support. Fedora 21 and
+later have a Vim that's recent enough. You can see the version of Vim installed
+by running 'vim --version'. If the version is too old, you may need to compile
+Vim from source [26] (don't worry, it's easy).
+
+Install YouCompleteMe with Vundle [19].
+
+**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
+using Vundle and the ycm_core library APIs have changed (happens rarely), YCM
+will notify you to recompile it. You should then rerun the install process.
+
+Install development tools and CMake: 'sudo dnf install automake gcc gcc-c++
+kernel-devel cmake'
+
+Make sure you have Python headers installed: 'sudo dnf install python-devel
+python3-devel'.
+
+Compiling YCM **with** semantic support for C-family languages:
+>
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --clang-completer
+<
+Compiling YCM **without** semantic support for C-family languages:
+>
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py
+<
+The following additional language support options are available:
+
+- C# support: install Mono [28] and add '--omnisharp-completer' when calling
+ './install.py'.
+
+- Go support: install Go [23] and add '--gocode-completer' when calling
+ './install.py'.
+
+- TypeScript support: install Node.js and npm [24] then install the
+ TypeScript SDK with 'npm install -g typescript'.
+
+- JavaScript support: install Node.js and npm [24] and add '--tern-completer'
+ when calling './install.py'.
+
+- Rust support: install Rust [25] and add '--racer-completer' when calling
+ './install.py'.
+
+To simply compile with everything enabled, there's a '--all' flag. So, to
+install with all language features, ensure 'xbuild', 'go', 'tsserver', 'node',
+'npm', 'rustc', and 'cargo' tools are installed and in your 'PATH', then simply
+run:
+>
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --all
+<
+That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
+Don't forget that if you want the C-family semantic completion engine to work,
+you will need to provide the compilation flags for your project to YCM. It's
+all in the User Guide.
+
+YCM comes with sane defaults for its options, but you still may want to take a
+look at what's available for configuration. There are a few interesting options
+that are conservatively turned off by default that you may want to turn on.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-windows*
+Windows ~
+
+Please refer to the full Installation Guide below; the following commands are
+provided on a best-effort basis and may not work for you.
+
+**Important:** we assume that you are using the 'cmd.exe' command prompt and
+that you know how to add an executable to the PATH environment variable.
+
+Make sure you have at least Vim 7.3.598 with Python 2 or Python 3 support. You
+can check the version and which Python is supported by typing ':version' inside
+Vim. Look at the features included: '+python/dyn' for Python 2 and
+'+python3/dyn' for Python 3. Take note of the Vim architecture, i.e. 32 or
+64-bit. It will be important when choosing the Python installer. We recommend
+using a 64-bit client. Daily updated copies of 32-bit and 64-bit Vim with
+Python 2 and Python 3 support [29] are available.
+
+Install YouCompleteMe with Vundle [19].
+
+**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
+using Vundle and the ycm_core library APIs have changed (happens rarely), YCM
+will notify you to recompile it. You should then rerun the install process.
+
+Download and install the following software:
+
+- Python 2 or Python 3 [30]. Be sure to pick the version corresponding to
+ your Vim architecture. It is _Windows x86_ for a 32-bit Vim and _Windows
+ x86-64_ for a 64-bit Vim. We recommend installing Python 3.
+
+- CMake [21]. Add CMake executable to the PATH environment variable.
+
+- Visual Studio [31]. Download the community edition. During setup, choose
+ _Custom_ as the installation type and select the _Visual C++_ component.
+
+- 7-zip [32]. Required to build YCM with semantic support for C-family
+ languages.
+
+Compiling YCM **with** semantic support for C-family languages:
+>
+ cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
+ install.py --clang-completer
+<
+Compiling YCM **without** semantic support for C-family languages:
+>
+ cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
+ install.py
+<
+The following additional language support options are available:
+
+- C# support: add '--omnisharp-completer' when calling |install.py|. Be sure
+ that the build utility 'msbuild' is in your PATH [33].
+
+- Go support: install Go [23] and add '--gocode-completer' when calling
+ |install.py|.
+
+- TypeScript support: install Node.js and npm [24] then install the
+ TypeScript SDK with 'npm install -g typescript'.
+
+- JavaScript support: install Node.js and npm [24] and add '--tern-completer'
+ when calling |install.py|.
+
+- Rust support: install Rust [25] and add '--racer-completer' when calling
+ |install.py|.
+
+To simply compile with everything enabled, there's a '--all' flag. So, to
+install with all language features, ensure 'msbuild', 'go', 'tsserver', 'node',
+'npm', and 'cargo' tools are installed and in your 'PATH', then simply run:
+>
+ cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
+ python install.py --all
+<
+You can specify the Microsoft Visual C++ (MSVC) version using the '--msvc'
+option. YCM officially supports MSVC 11 (Visual Studio 2012), 12 (2013), and 14
+(2015).
+
+That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
+Don't forget that if you want the C-family semantic completion engine to work,
+you will need to provide the compilation flags for your project to YCM. It's
+all in the User Guide.
+
+YCM comes with sane defaults for its options, but you still may want to take a
+look at what's available for configuration. There are a few interesting options
+that are conservatively turned off by default that you may want to turn on.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-freebsd-openbsd*
+FreeBSD/OpenBSD ~
+
+Please refer to the full Installation Guide below; the following commands are
+provided on a best-effort basis and may not work for you. OpenBSD / FreeBSD are
+not officially supported platforms by YCM.
+
+Make sure you have Vim 7.3.598 with Python 2 or Python 3 support.
+
+OpenBSD 5.5 and later have a Vim that's recent enough. You can see the version
+of Vim installed by running 'vim --version'.
+
+FreeBSD 10.x comes with clang compiler but not the libraries needed to install.
+>
+ pkg install llvm35 boost-all boost-python-libs clang35
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/llvm35/lib/
+<
+Install YouCompleteMe with Vundle [19].
+
+**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
+using Vundle and the ycm_core library APIs have changed (happens rarely), YCM
+will notify you to recompile it. You should then rerun the install process.
+
+Install dependencies and CMake: 'sudo pkg_add llvm boost cmake'
+
+Compiling YCM **with** semantic support for C-family languages:
+>
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --clang-completer --system-libclang --system-boost
+<
+Compiling YCM **without** semantic support for C-family languages:
+>
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --system-boost
+<
+The following additional language support options are available:
+
+- C# support: install Mono and add '--omnisharp-completer' when calling
+ './install.py'.
+
+- Go support: install Go [23] and add '--gocode-completer' when calling
+ './install.py'.
+
+- TypeScript support: install Node.js and npm [24] then install the
+ TypeScript SDK with 'npm install -g typescript'.
+
+- JavaScript support: install Node.js and npm [24] and add '--tern-completer'
+ when calling './install.py'.
+
+- Rust support: install Rust [25] and add '--racer-completer' when calling
+ './install.py'.
+
+To simply compile with everything enabled, there's a '--all' flag. So, to
+install with all language features, ensure 'xbuild', 'go', 'tsserver', 'node',
+'npm', and 'cargo' tools are installed and in your 'PATH', then simply run:
+>
+ cd ~/.vim/bundle/YouCompleteMe
+ ./install.py --all
+<
+That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
+Don't forget that if you want the C-family semantic completion engine to work,
+you will need to provide the compilation flags for your project to YCM. It's
+all in the User Guide.
+
+YCM comes with sane defaults for its options, but you still may want to take a
+look at what's available for configuration. There are a few interesting options
+that are conservatively turned off by default that you may want to turn on.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-full-installation-guide*
+Full Installation Guide ~
+
+These are the steps necessary to get YCM working on a Unix OS and on Windows.
+
+**Note to Windows users:** we assume that you are running the 'cmd.exe' command
+prompt and that the needed executables are in the PATH environment variable. Do
+not just copy the shell commands. Replace '~' by '%USERPROFILE%' in them and
+use the right Vim home directory. It should be 'vimfiles' by default instead of
+'.vim'.
+
+See the _FAQ_ if you have any issues.
+
+**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
+using Vundle and the ycm_core library APIs have changed (happens rarely), YCM
+will notify you to recompile it. You should then rerun the install process.
+
+**Please follow the instructions carefully. Read EVERY WORD.**
+
+1. **Ensure that your version of Vim is _at least_ 7.3.598 _and_ that it has
+ support for Python 2 or Python 3 scripting**.
+
+ Inside Vim, type ':version'. Look at the first two to three lines of
+ output; it should say 'Vi IMproved X.Y', where X.Y is the major version
+ of vim. If your version is greater than 7.3, then you're all set. If your
+ version is 7.3 then look below that where it says, 'Included patches:
+ 1-Z', where Z will be some number. That number needs to be 598 or higher.
+
+ If your version of Vim is not recent enough, you may need to compile Vim
+ from source [26] (don't worry, it's easy).
+
+ After you have made sure that you have Vim 7.3.598+, type the following
+ in Vim: ":echo has('python') || has('python3')". The output should be 1.
+ If it's 0, then get a version of Vim with Python support.
+
+ On Windows, check also if your Vim architecture is 32 or 64-bit. This is
+ critical because it must match the Python and the YCM libraries
+ architectures. We recommend using a 64-bit Vim.
+
+2. **Install YCM** with Vundle [19] (or Pathogen [34], but Vundle is a
+ better idea). With Vundle, this would mean adding a "Plugin
+ 'Valloric/YouCompleteMe'" line to your vimrc [35].
+
+ If you don't install YCM with Vundle, make sure you have run 'git
+ submodule update --init --recursive' after checking out the YCM
+ repository (Vundle will do this for you) to fetch YCM's dependencies.
+
+3. [Complete this step ONLY if you care about semantic completion support
+ for C-family languages. Otherwise it's not necessary.]
+
+ **Download the latest version of 'libclang'**. Clang is an open-source
+ compiler that can compile C/C++/Objective-C/Objective-C++. The 'libclang'
+ library it provides is used to power the YCM semantic completion engine
+ for those languages. YCM is designed to work with libclang version 3.8 or
+ higher.
+
+ You can use the system libclang _only if you are sure it is version 3.8
+ or higher_, otherwise don't. Even if it is, we recommend using the
+ official binaries from llvm.org [36] if at all possible. Make sure you
+ download the correct archive file for your OS.
+
+ We **STRONGLY recommend AGAINST use** of the system libclang instead of
+ the upstream compiled binaries. Random things may break. Save yourself
+ the hassle and use the upstream pre-built libclang.
+
+4. **Compile the 'ycm_core' library** that YCM needs. This library is the
+ C++ engine that YCM uses to get fast completions.
+
+ You will need to have 'cmake' installed in order to generate the required
+ makefiles. Linux users can install cmake with their package manager
+ ('sudo apt-get install cmake' for Ubuntu) whereas other users can
+ download and install [21] cmake from its project site. Mac users can also
+ get it through Homebrew [20] with 'brew install cmake'.
+
+ On a Unix OS, you need to make sure you have Python headers installed. On
+ a Debian-like Linux distro, this would be 'sudo apt-get install python-
+ dev python3-dev'. On Mac they should already be present.
+
+ On Windows, you need to download and install Python 2 or Python 3 [30].
+ Pick the version corresponding to your Vim architecture. You will also
+ need Microsoft Visual C++ (MSVC) to build YCM. You can obtain it by
+ installing Visual Studio [31]. MSVC 11 (Visual Studio 2012), 12 (2013),
+ and 14 (2015) are officially supported.
+
+ Here we'll assume you installed YCM with Vundle. That means that the top-
+ level YCM directory is in '~/.vim/bundle/YouCompleteMe'.
+
+ We'll create a new folder where build files will be placed. Run the
+ following:
+>
+ cd ~
+ mkdir ycm_build
+ cd ycm_build
+<
+ Now we need to generate the makefiles. If you DON'T care about semantic
+ support for C-family languages, run the following command in the
+ 'ycm_build' directory:
+>
+ cmake -G "<generator>" . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
+<
+ where '<generator>' is 'Unix Makefiles' on Unix systems and one of the
+ following Visual Studio generators on Windows:
+
+ - 'Visual Studio 11 Win64'
+ - 'Visual Studio 12 Win64'
+ - 'Visual Studio 14 Win64'
+
+ Remove the 'Win64' part in these generators if your Vim architecture is
+ 32-bit.
+
+ For those who want to use the system version of boost, you would pass
+ '-DUSE_SYSTEM_BOOST=ON' to cmake. This may be necessary on some systems
+ where the bundled version of boost doesn't compile out of the box.
+
+ NOTE: We **STRONGLY recommend AGAINST use** of the system boost instead
+ of the bundled version of boost. Random things may break. Save yourself
+ the hassle and use the bundled version of boost.
+
+ If you DO care about semantic support for C-family languages, then your
+ 'cmake' call will be a bit more complicated. We'll assume you downloaded
+ a binary distribution of LLVM+Clang from llvm.org in step 3 and that you
+ extracted the archive file to folder '~/ycm_temp/llvm_root_dir' (with
+ 'bin', 'lib', 'include' etc. folders right inside that folder). On
+ Windows, you can extract the files from the LLVM+Clang installer using
+ 7-zip [32].
+
+ NOTE: This _only_ works with a _downloaded_ LLVM binary package, not a
+ custom-built LLVM! See docs below for 'EXTERNAL_LIBCLANG_PATH' when using
+ a custom LLVM build.
+
+ With that in mind, run the following command in the 'ycm_build'
+ directory:
+>
+ cmake -G "<generator>" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
+<
+ where '<generator>' is replaced like above.
+
+ Now that configuration files have been generated, compile the libraries
+ using this command:
+>
+ cmake --build . --target ycm_core --config Release
+<
+ The '--config Release' part is specific to Windows and will be ignored on
+ a Unix OS.
+
+ For those who want to use the system version of libclang, you would pass
+ '-DUSE_SYSTEM_LIBCLANG=ON' to cmake _instead of_ the
+ '-DPATH_TO_LLVM_ROOT=...' flag.
+
+ NOTE: We **STRONGLY recommend AGAINST use** of the system libclang
+ instead of the upstream compiled binaries. Random things may break. Save
+ yourself the hassle and use the upstream pre-built libclang.
+
+ You could also force the use of a custom libclang library with
+ '-DEXTERNAL_LIBCLANG_PATH=/path/to/libclang.so' flag (the library would
+ end with '.dylib' on a Mac). Again, this flag would be used _instead of_
+ the other flags. **If you compiled LLVM from source, this is the flag you
+ should be using.**
+
+ Running the 'cmake' command will also place the 'libclang.[so|dylib|dll]'
+ in the 'YouCompleteMe/third_party/ycmd' folder for you if you compiled
+ with clang support (it needs to be there for YCM to work).
+
+5. Set up support for additional languages, as desired:
+
+6. C# support: install Mono on non-Windows platforms [37]. Navigate to
+ 'YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer' and run
+ 'msbuild' (Windows) or 'xbuild' (other platforms, using Mono) depending
+ on your platform. On Windows, be sure that the build utility 'msbuild' is
+ in your PATH [33].
+
+7. Go support: install Go [23] and add it to your path. Navigate to
+ 'YouCompleteMe/third_party/ycmd/third_party/gocode' and run 'go build'.
+
+8. TypeScript support: as with the quick installation, simply 'npm install
+ -g typescript' after successfully installing Node.js and npm [24].
+
+9. JavaScript support: install Node.js and npm [24]. Then navigate to
+ 'YouCompleteMe/third_party/ycmd/third_party/tern_runtime' and run 'npm
+ install --production'
+
+10. Rust support: install Rust [25]. Navigate to
+ 'YouCompleteMe/third_party/ycmd/third_party/racerd' and run 'cargo
+ build --release'.
+
+That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
+Don't forget that if you want the C-family semantic completion engine to work,
+you will need to provide the compilation flags for your project to YCM. It's
+all in the User Guide.
+
+YCM comes with sane defaults for its options, but you still may want to take a
+look at what's available for configuration. There are a few interesting options
+that are conservatively turned off by default that you may want to turn on.
+
+===============================================================================
+ *youcompleteme-quick-feature-summary*
+Quick Feature Summary ~
+
+-------------------------------------------------------------------------------
+ *youcompleteme-general*
+General (all languages) ~
+
+- Super-fast identifier completer including tags files and syntax elements
+- Intelligent suggestion ranking and filtering
+- File and path suggestions
+- Suggestions from Vim's OmniFunc
+- UltiSnips snippet suggestions
+
+-------------------------------------------------------------------------------
+ *youcompleteme-c-family-languages*
+C-family languages (C, C++, Objective C, Objective C++) ~
+
+- Semantic auto-completion
+- Real-time diagnostic display
+- Go to include/declaration/definition (|GoTo|, etc.)
+- Semantic type information for identifiers (|GetType|)
+- Automatically fix certain errors (|FixIt|)
+- View documentation comments for identifiers (|GetDoc|)
+
+-------------------------------------------------------------------------------
+ *youcompleteme-c*
+C♯ ~
+
+- Semantic auto-completion
+- Real-time diagnostic display
+- Go to declaration/definition (|GoTo|, etc.)
+- Semantic type information for identifiers (|GetType|)
+- Automatically fix certain errors (|FixIt|)
+- Management of OmniSharp server instance
+- View documentation comments for identifiers (|GetDoc|)
+
+-------------------------------------------------------------------------------
+ *youcompleteme-python*
+Python ~
+
+- Intelligent auto-completion
+- Go to declaration/definition, find references (|GoTo|, |GoToReferences|)
+- View documentation comments for identifiers (|GetDoc|)
+- Restart JediHTTP [7] server using a different Python interpreter
+
+-------------------------------------------------------------------------------
+ *youcompleteme-go*
+Go ~
+
+- Semantic auto-completion
+- Go to definition (|GoTo|)
+- Management of 'gocode' server instance
+
+-------------------------------------------------------------------------------
+ *youcompleteme-typescript*
+TypeScript ~
+
+- Semantic auto-completion
+- Renaming symbols ('RefactorRename <new name>')
+- Go to definition, find references (|GoToDefinition|, |GoToReferences|)
+- Semantic type information for identifiers (|GetType|)
+- View documentation comments for identifiers (|GetDoc|)
+
+-------------------------------------------------------------------------------
+ *youcompleteme-javascript*
+JavaScript ~
+
+- Intelligent auto-completion
+- Renaming variables ('RefactorRename <new name>')
+- Go to definition, find references (|GoToDefinition|, |GoToReferences|)
+- Type information for identifiers (|GetType|)
+- View documentation comments for identifiers (|GetDoc|)
+- Management of 'Tern' server instance
+
+-------------------------------------------------------------------------------
+ *youcompleteme-rust*
+Rust ~
+
+- Semantic auto-completion
+- Go to definition (|GoTo|, |GoToDefinition|, and |GoToDeclaration| are
+ identical)
+- Management of 'racer' server instance
+
+===============================================================================
+ *youcompleteme-user-guide*
+User Guide ~
+
+-------------------------------------------------------------------------------
+ *youcompleteme-general-usage*
+General Usage ~
+
+- If the offered completions are too broad, keep typing characters; YCM will
+ continue refining the offered completions based on your input.
+
+- Filtering is "smart-case" sensitive; if you are typing only lowercase
+ letters, then it's case-insensitive. If your input contains uppercase
+ letters, then the uppercase letters in your query must match uppercase
+ letters in the completion strings (the lowercase letters still match both).
+ So, "foo" matches "Foo" and "foo", "Foo" matches "Foo" and "FOO" but not
+ "foo".
+
+- Use the TAB key to accept a completion and continue pressing TAB to cycle
+ through the completions. Use Shift-TAB to cycle backwards. Note that if
+ you're using console Vim (that is, not Gvim or MacVim) then it's likely
+ that the Shift-TAB binding will not work because the console will not pass
+ it to Vim. You can remap the keys; see the _Options [38]_ section below.
+
+Knowing a little bit about how YCM works internally will prevent confusion. YCM
+has several completion engines: an identifier-based completer that collects all
+of the identifiers in the current file and other files you visit (and your tags
+files) and searches them when you type (identifiers are put into per-filetype
+groups).
+
+There are also several semantic engines in YCM. There's a libclang-based
+completer that provides semantic completion for C-family languages. There's a
+Jedi-based completer for semantic completion for Python. There's also an
+omnifunc-based completer that uses data from Vim's omnicomplete system to
+provide semantic completions when no native completer exists for that language
+in YCM.
+
+There are also other completion engines, like the UltiSnips completer and the
+filepath completer.
+
+YCM automatically detects which completion engine would be the best in any
+situation. On occasion, it queries several of them at once, merges the outputs
+and presents the results to you.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-client-server-architecture*
+Client-Server Architecture ~
+
+YCM has a client-server architecture; the Vim part of YCM is only a thin client
+that talks to the ycmd HTTP+JSON server [39] that has the vast majority of YCM
+logic and functionality. The server is started and stopped automatically as you
+start and stop Vim.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-completion-string-ranking*
+Completion String Ranking ~
+
+The subsequence filter removes any completions that do not match the input, but
+then the sorting system kicks in. It's actually very complicated and uses lots
+of factors, but suffice it to say that "word boundary" (WB) subsequence
+character matches are "worth" more than non-WB matches. In effect, this means
+given an input of "gua", the completion "getUserAccount" would be ranked higher
+in the list than the "Fooguxa" completion (both of which are subsequence
+matches). A word-boundary character are all capital characters, characters
+preceded by an underscore and the first letter character in the completion
+string.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-general-semantic-completion*
+General Semantic Completion ~
+
+- You can use Ctrl+Space to trigger the completion suggestions anywhere, even
+ without a string prefix. This is useful to see which top-level functions
+ are available for use.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-c-family-semantic-completion*
+C-family Semantic Completion ~
+
+YCM looks for a '.ycm_extra_conf.py' file in the directory of the opened file
+or in any directory above it in the hierarchy (recursively); when the file is
+found, it is loaded (only once!) as a Python module. YCM calls a 'FlagsForFile'
+method in that module which should provide it with the information necessary to
+compile the current file. You can also provide a path to a global
+'.ycm_extra_conf.py' file, which will be used as a fallback. To prevent the
+execution of malicious code from a file you didn't write YCM will ask you once
+per '.ycm_extra_conf.py' if it is safe to load. This can be disabled and you
+can white-/blacklist files. See the _Options_ section for more details.
+
+This system was designed this way so that the user can perform any arbitrary
+sequence of operations to produce a list of compilation flags YCM should hand
+to Clang.
+
+See YCM's own '.ycm_extra_conf.py' [40] for details on how this works. You
+should be able to use it _as a starting point_. **Don't** just copy/paste that
+file somewhere and expect things to magically work; **your project needs
+different flags**. Hint: just replace the strings in the 'flags' variable with
+compilation flags necessary for your project. That should be enough for 99% of
+projects.
+
+Yes, Clang's 'CompilationDatabase' system [41] is also supported. Again, see
+the above linked example file. You can get CMake to generate this file for you
+by adding 'set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )' to your project's
+'CMakeLists.txt' file (if using CMake). If you're not using CMake, you could
+use something like Bear [42] to generate the 'compile_commands.json' file.
+
+Consider using YCM-Generator [43] to generate the 'ycm_extra_conf.py' file.
+
+If Clang encounters errors when compiling the header files that your file
+includes, then it's probably going to take a long time to get completions. When
+the completion menu finally appears, it's going to have a large number of
+unrelated completion strings (type/function names that are not actually
+members). This is because Clang fails to build a precompiled preamble for your
+file if there are any errors in the included headers and that preamble is key
+to getting fast completions.
+
+Call the |:YcmDiags| command to see if any errors or warnings were detected in
+your file.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-javascript-semantic-completion*
+JavaScript Semantic Completion ~
+
+-------------------------------------------------------------------------------
+ *youcompleteme-quick-start*
+Quick start ~
+
+1. Ensure that you have enabled the Tern completer. See the installation
+ guide for details.
+
+2. Create a '.tern-project' file in the root directory of your JavaScript
+ project, by following the instructions [44] in the Tern [12]
+ documentation.
+
+3. Make sure that Vim's working directory is a descendent of that directory
+ (or that directory itself) when working with JavaScript files.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-explanation*
+Explanation ~
+
+JavaScript completion is based on Tern [12]. This completion engine requires a
+file named '.tern-project' [44] to exist in the current working directory or a
+directory which is an ancestor of the current working directory when the tern
+server is started. YCM starts the Tern server the first time a JavaScript file
+is edited, so Vim's working directory at that time needs to be a descendent of
+the directory containing the '.tern-project' file (or that directory itself).
+
+Alternatively, as described in the Tern documentation [45], a global '.tern-
+config' file may be used.
+
+Multiple Tern servers, are not supported. To switch to a different JavaScript
+project, you can do one of the following:
+
+- start a new instance of Vim from the new project's directory
+
+- change Vim's working directory (':cd /path/to/new/project') and restart the
+ ycmd server [39] (|:YcmRestartServer|)
+
+- change Vim's working directory (':cd /path/to/new/project'), open a
+ JavaScript file (or set filetype to JavaScript) and restart the Tern server
+ using YCM completer subcommands ':YcmCompleter StopServer' and
+ ':YcmCompleter StartServer'.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-tips-tricks*
+Tips and tricks ~
+
+This section contains some advice for configuring '.tern-project' and working
+with JavaScript files. The canonical reference for correctly configuring Tern
+is the Tern documentation [45]. Any issues, improvements, advice, etc. should
+be sought from the Tern [12] project. For example, see the list of tern plugins
+[46] for the list of plugins which can be enabled in the 'plugins' section of
+the '.tern-project' file.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-configuring-tern-for-node-support*
+Configuring Tern for node support ~
+
+The following simple example '.tern-project' file enables nodejs support:
+>
+ {
+ "plugins": {
+ "node": {}
+ }
+ }
+<
+-------------------------------------------------------------------------------
+ *youcompleteme-configuring-tern-for-requirejs-support*
+Configuring Tern for requirejs support ~
+
+The Tern requirejs plugin requires that all included "libraries" are rooted
+under the same base directory. If that's not the case for your projects, then
+it is possible to make it work with appropriate symbolic links. For example,
+create a directory 'ext_lib' within your project and populate it with symlinks
+to your libraries. Then set up the '.tern-project' something like this:
+>
+ {
+ "plugins": {
+ "requirejs": {
+ "baseURL": "./ext_lib",
+ }
+ }
+ }
+<
+Then, given the following structure:
+>
+ ./ext_lib/mylib (symlink)
+ ./ext_lib/anotherlib (symlink)
+<
+Can be used as follows:
+>
+ define( [ 'mylib/file1', 'anotherlib/anotherfile' ], function( f1, f2 ) {
+ // etc.
+ } );
+<
+-------------------------------------------------------------------------------
+ *youcompleteme-rust-semantic-completion*
+Rust Semantic Completion ~
+
+Completions and GoTo commands within the current crate and its dependencies
+should work out of the box with no additional configuration (provided that you
+built YCM with the '--racer-completer' flag; see the _Installation_ section for
+details). For semantic analysis inclusive of the standard library, you must
+have a local copy of the rust source code [47]. You also need to set the
+following option so YouCompleteMe can locate it.
+>
+ " In this example, the rust source code zip has been extracted to
+ " /usr/local/rust/rustc-1.5.0
+ let g:ycm_rust_src_path = '/usr/local/rust/rustc-1.5.0/src'
+<
+-------------------------------------------------------------------------------
+ *youcompleteme-python-semantic-completion*
+Python Semantic Completion ~
+
+Completion and GoTo commands work out of the box with no additional
+configuration. Those features are provided by the jedi [6] library which
+supports a variety of Python versions (2.6, 2.7, 3.2+) as long as it runs in
+the corresponding Python interpreter. By default YCM runs jedi [6] with the
+same Python interpreter used by the ycmd server [39], so if you would like to
+use a different interpreter, use the following option specifying the Python
+binary to use. For example, to provide Python 3 completion in your project,
+set:
+>
+ let g:ycm_python_binary_path = '/usr/bin/python3'
+<
+If the value of |g:ycm_python_binary_path| is an absolute path like above it
+will be used as-is, but if it's an executable name it will be searched through
+the PATH. So for example if you set:
+>
+ let g:ycm_python_binary_path = 'python'
+<
+YCM will use the first 'python' executable it finds in the PATH to run jedi
+[6]. This means that if you are in a virtual environment and you start vim in
+that directory, the first 'python' that YCM will find will be the one in the
+virtual environment, so jedi [6] will be able to provide completions for every
+package you have in the virtual environment.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-semantic-completion-for-other-languages*
+Semantic Completion for Other Languages ~
+
+Python, C#, Go, Rust, and TypeScript are supported natively by YouCompleteMe
+using the Jedi [6], Omnisharp [8], Gocode [9], racer [13], and TSServer [11]
+engines, respectively. Check the installation section for instructions to
+enable these features if desired.
+
+YCM will use your 'omnifunc' (see ':h omnifunc' in Vim) as a source for
+semantic completions if it does not have a native semantic completion engine
+for your file's filetype. Vim comes with okayish omnifuncs for various
+languages like Ruby, PHP etc. It depends on the language.
+
+You can get stellar omnifuncs for Java and Ruby with Eclim [48]. Just make sure
+you have the _latest_ Eclim installed and configured (this means Eclim '>=
+2.2.*' and Eclipse '>= 4.2.*').
+
+After installing Eclim remember to create a new Eclipse project within your
+application by typing ':ProjectCreate <path-to-your-project> -n ruby' (or '-n
+java') inside vim and don't forget to have "let g:EclimCompletionMethod =
+'omnifunc'" in your vimrc. This will make YCM and Eclim play nice; YCM will use
+Eclim's omnifuncs as the data source for semantic completions and provide the
+auto-triggering and subsequence-based matching (and other YCM features) on top
+of it.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-writing-new-semantic-completers*
+Writing New Semantic Completers ~
+
+You have two options here: writing an 'omnifunc' for Vim's omnicomplete system
+that YCM will then use through its omni-completer, or a custom completer for
+YCM using the Completer API [49].
+
+Here are the differences between the two approaches:
+
+- You have to use VimScript to write the omnifunc, but get to use Python to
+ write for the Completer API; this by itself should make you want to use the
+ API.
+
+- The Completer API is a _much_ more powerful way to integrate with YCM and
+ it provides a wider set of features. For instance, you can make your
+ Completer query your semantic back-end in an asynchronous fashion, thus not
+ blocking Vim's GUI thread while your completion system is processing stuff.
+ This is impossible with VimScript. All of YCM's completers use the
+ Completer API.
+
+- Performance with the Completer API is better since Python executes faster
+ than VimScript.
+
+If you want to use the 'omnifunc' system, see the relevant Vim docs with ':h
+complete-functions'. For the Completer API, see the API docs [49].
+
+If you want to upstream your completer into YCM's source, you should use the
+Completer API.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-diagnostic-display*
+Diagnostic Display ~
+
+YCM will display diagnostic notifications for C-family and C# languages if you
+compiled YCM with Clang and Omnisharp support, respectively. Since YCM
+continuously recompiles your file as you type, you'll get notified of errors
+and warnings in your file as fast as possible.
+
+Here are the various pieces of the diagnostic UI:
+
+- Icons show up in the Vim gutter on lines that have a diagnostic.
+- Regions of text related to diagnostics are highlighted (by default, a red
+ wavy underline in 'gvim' and a red background in 'vim').
+- Moving the cursor to a line with a diagnostic echoes the diagnostic text.
+- Vim's location list is automatically populated with diagnostic data (off by
+ default, see options).
+
+The new diagnostics (if any) will be displayed the next time you press any key
+on the keyboard. So if you stop typing and just wait for the new diagnostics to
+come in, that _will not work_. You need to press some key for the GUI to
+update.
+
+Having to press a key to get the updates is unfortunate, but cannot be changed
+due to the way Vim internals operate; there is no way that a background task
+can update Vim's GUI after it has finished running. You _have to_ press a key.
+This will make YCM check for any pending diagnostics updates.
+
+You _can_ force a full, blocking compilation cycle with the
+|:YcmForceCompileAndDiagnostics| command (you may want to map that command to a
+key; try putting 'nnoremap <F5> :YcmForceCompileAndDiagnostics<CR>' in your
+vimrc). Calling this command will force YCM to immediately recompile your file
+and display any new diagnostics it encounters. Do note that recompilation with
+this command may take a while and during this time the Vim GUI _will_ be
+blocked.
+
+YCM will display a short diagnostic message when you move your cursor to the
+line with the error. You can get a detailed diagnostic message with the
+'<leader>d' key mapping (can be changed in the options) YCM provides when your
+cursor is on the line with the diagnostic.
+
+You can also see the full diagnostic message for all the diagnostics in the
+current file in Vim's 'locationlist', which can be opened with the ':lopen' and
+':lclose' commands (make sure you have set 'let
+g:ycm_always_populate_location_list = 1' in your vimrc). A good way to toggle
+the display of the 'locationlist' with a single key mapping is provided by
+another (very small) Vim plugin called ListToggle [50] (which also makes it
+possible to change the height of the 'locationlist' window), also written by
+yours truly.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-diagnostic-highlighting-groups*
+Diagnostic Highlighting Groups ~
+
+You can change the styling for the highlighting groups YCM uses. For the signs
+in the Vim gutter, the relevant groups are:
+
+- 'YcmErrorSign', which falls back to group 'SyntasticErrorSign' and then
+ 'error' if they exist
+
+- 'YcmWarningSign', which falls back to group 'SyntasticWarningSign' and then
+ 'todo' if they exist
+
+You can also style the line that has the warning/error with these groups:
+
+- 'YcmErrorLine', which falls back to group 'SyntasticErrorLine' if it exists
+- 'YcmWarningLine', which falls back to group 'SyntasticWarningLine' if it
+ exists
+
+Note that the line highlighting groups only work when gutter signs are turned
+on.
+
+The syntax groups used to highlight regions of text with errors/warnings: -
+'YcmErrorSection', which falls back to group 'SyntasticError' if it exists and
+then 'SpellBad' - 'YcmWarningSection', which falls back to group
+'SyntasticWarning' if it exists and then 'SpellCap'
+
+Here's how you'd change the style for a group:
+>
+ highlight YcmErrorLine guibg=#3f0000
+<
+===============================================================================
+ *youcompleteme-commands*
+Commands ~
+
+-------------------------------------------------------------------------------
+The *:YcmRestartServer* command
+
+If the ycmd completion server [39] suddenly stops for some reason, you can
+restart it with this command.
+
+-------------------------------------------------------------------------------
+The *:YcmForceCompileAndDiagnostics* command
+
+Calling this command will force YCM to immediately recompile your file and
+display any new diagnostics it encounters. Do note that recompilation with this
+command may take a while and during this time the Vim GUI _will_ be blocked.
+
+You may want to map this command to a key; try putting 'nnoremap <F5>
+:YcmForceCompileAndDiagnostics<CR>' in your vimrc.
+
+-------------------------------------------------------------------------------
+The *:YcmDiags* command
+
+Calling this command will fill Vim's 'locationlist' with errors or warnings if
+any were detected in your file and then open it. If a given error or warning
+can be fixed by a call to ':YcmCompleter FixIt', then '(FixIt available)' is
+appended to the error or warning text. See the |FixIt| completer subcommand for
+more information.
+
+NOTE: The absense of '(FixIt available)' does not strictly imply a fix-it is
+not available as not all completers are able to provide this indication. For
+example, the c-sharp completer provides many fix-its but does not add this
+additional indication.
+
+The |g:ycm_open_loclist_on_ycm_diags| option can be used to prevent the
+location list from opening, but still have it filled with new diagnostic data.
+See the _Options_ section for details.
+
+-------------------------------------------------------------------------------
+The *:YcmShowDetailedDiagnostic* command
+
+This command shows the full diagnostic text when the user's cursor is on the
+line with the diagnostic.
+
+-------------------------------------------------------------------------------
+The *:YcmDebugInfo* command
+
+This will print out various debug information for the current file. Useful to
+see what compile commands will be used for the file if you're using the
+semantic completion engine.
+
+-------------------------------------------------------------------------------
+The *:YcmToggleLogs* command
+
+This command automatically opens in windows the stdout and stderr logfiles
+written by the ycmd server [39]. If one or both logfiles are already opened,
+they are automatically closed. 'stderr' or 'stdout' can be specified as an
+argument of this command to only open the corresponding logfile instead of
+both. If this logfile is already opened, it will be closed. Only for debugging
+purpose.
+
+-------------------------------------------------------------------------------
+The *:YcmCompleter* command
+
+This command gives access to a number of additional IDE-like features in YCM,
+for things like semantic GoTo, type information, FixIt and refactoring.
+
+Technically the command invokes completer-specific commands. If the first
+argument is of the form 'ft=...' the completer for that file type will be used
+(for example 'ft=cpp'), else the native completer of the current buffer will be
+used. Call 'YcmCompleter' without further arguments for a list of the commands
+you can call for the current completer.
+
+See the file type feature summary for an overview of the features available for
+each file type. See the _YcmCompleter subcommands_ section for more information
+on the available subcommands and their usage.
+
+===============================================================================
+ *youcompleteme-ycmcompleter-subcommands*
+YcmCompleter Subcommands ~
+
+NOTE: See the docs for the 'YcmCompleter' command before tackling this section.
+
+The invoked subcommand is automatically routed to the currently active semantic
+completer, so ':YcmCompleter GoToDefinition' will invoke the |GoToDefinition|
+subcommand on the Python semantic completer if the currently active file is a
+Python one and on the Clang completer if the currently active file is a
+C/C++/Objective-C one.
+
+You may also want to map the subcommands to something less verbose; for
+instance, 'nnoremap <leader>jd :YcmCompleter GoTo<CR>' maps the '<leader>jd'
+sequence to the longer subcommand invocation.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-goto-commands*
+GoTo Commands ~
+
+These commands are useful for jumping around and exploring code. When moving
+the cursor, the subcommands add entries to Vim's 'jumplist' so you can use
+'CTRL-O' to jump back to where you where before invoking the command (and
+'CTRL-I' to jump forward; see ':h jumplist' for details). If there is more than
+one destination, the quickfix list (see ':h quickfix') is populated with the
+available locations and opened to full width at the bottom of the screen. You
+can change this behavior by using the |YcmQuickFixOpened| autocommand.
+
+-------------------------------------------------------------------------------
+The *GoToInclude* subcommand
+
+Looks up the current line for a header and jumps to it.
+
+Supported in filetypes: 'c, cpp, objc, objcpp'
+
+-------------------------------------------------------------------------------
+The *GoToDeclaration* subcommand
+
+Looks up the symbol under the cursor and jumps to its declaration.
+
+Supported in filetypes: 'c, cpp, objc, objcpp, cs, go, python, rust'
+
+-------------------------------------------------------------------------------
+The *GoToDefinition* subcommand
+
+Looks up the symbol under the cursor and jumps to its definition.
+
+NOTE: For C-family languages **this only works in certain situations**, namely
+when the definition of the symbol is in the current translation unit. A
+translation unit consists of the file you are editing and all the files you are
+including with '#include' directives (directly or indirectly) in that file.
+
+Supported in filetypes: 'c, cpp, objc, objcpp, cs, go, javascript, python,
+rust, typescript'
+
+-------------------------------------------------------------------------------
+The *GoTo* subcommand
+
+This command tries to perform the "most sensible" GoTo operation it can.
+Currently, this means that it tries to look up the symbol under the cursor and
+jumps to its definition if possible; if the definition is not accessible from
+the current translation unit, jumps to the symbol's declaration. For
+C/C++/Objective-C, it first tries to look up the current line for a header and
+jump to it. For C#, implementations are also considered and preferred.
+
+Supported in filetypes: 'c, cpp, objc, objcpp, cs, go, javascript, python,
+rust'
+
+-------------------------------------------------------------------------------
+The *GoToImprecise* subcommand
+
+WARNING: This command trades correctness for speed!
+
+Same as the |GoTo| command except that it doesn't recompile the file with
+libclang before looking up nodes in the AST. This can be very useful when
+you're editing files that take long to compile but you know that you haven't
+made any changes since the last parse that would lead to incorrect jumps. When
+you're just browsing around your codebase, this command can spare you quite a
+bit of latency.
+
+Supported in filetypes: 'c, cpp, objc, objcpp'
+
+-------------------------------------------------------------------------------
+The *GoToReferences* subcommand
+
+This command attempts to find all of the references within the project to the
+identifier under the cursor and populates the quickfix list with those
+locations.
+
+Supported in filetypes: 'javascript, python, typescript'
+
+-------------------------------------------------------------------------------
+The *GoToImplementation* subcommand
+
+Looks up the symbol under the cursor and jumps to its implementation (i.e. non-
+interface). If there are multiple implementations, instead provides a list of
+implementations to choose from.
+
+Supported in filetypes: 'cs'
+
+-------------------------------------------------------------------------------
+The *GoToImplementationElseDeclaration* subcommand
+
+Looks up the symbol under the cursor and jumps to its implementation if one,
+else jump to its declaration. If there are multiple implementations, instead
+provides a list of implementations to choose from.
+
+Supported in filetypes: 'cs'
+
+-------------------------------------------------------------------------------
+ *youcompleteme-semantic-information-commands*
+Semantic Information Commands ~
+
+These commands are useful for finding static information about the code, such
+as the types of variables, viewing declarations and documentation strings.
+
+-------------------------------------------------------------------------------
+The *GetType* subcommand
+
+Echos the type of the variable or method under the cursor, and where it
+differs, the derived type.
+
+For example:
+>
+ std::string s;
+<
+Invoking this command on 's' returns 'std::string => std::basic_string<char>'
+
+NOTE: Due to limitations of 'libclang', invoking this command on the word
+'auto' typically returns 'auto'. However, invoking it on a usage of the
+variable with inferred type returns the correct type, but typically it is
+repeated due to 'libclang' returning that the types differ.
+
+For example:
+>
+ const char *s = "String";
+ auto x = &s; // invoking on x or auto returns "auto";
+ // invoking on s returns "const char *"
+ std::cout << *x; // invoking on x returns "const char ** => const char **"
+<
+NOTE: Causes re-parsing of the current translation unit.
+
+Supported in filetypes: 'c, cpp, objc, objcpp, javascript, typescript'
+
+-------------------------------------------------------------------------------
+The *GetParent* subcommand
+
+Echos the semantic parent of the point under the cursor.
+
+The semantic parent is the item that semantically contains the given position.
+
+For example:
+>
+ class C {
+ void f();
+ };
+
+ void C::f() {
+
+ }
+<
+In the out-of-line definition of 'C::f', the semantic parent is the class 'C',
+of which this function is a member.
+
+In the example above, both declarations of 'C::f' have 'C' as their semantic
+context, while the lexical context of the first 'C::f' is 'C' and the lexical
+context of the second 'C::f' is the translation unit.
+
+For global declarations, the semantic parent is the translation unit.
+
+NOTE: Causes re-parsing of the current translation unit.
+
+Supported in filetypes: 'c, cpp, objc, objcpp'
+
+-------------------------------------------------------------------------------
+The *GetDoc* subcommand
+
+Displays the preview window populated with quick info about the identifier
+under the cursor. Depending on the file type, this includes things like:
+
+- The type or declaration of identifier,
+- Doxygen/javadoc comments,
+- Python docstrings,
+- etc.
+
+Supported in filetypes: 'c, cpp, objc, objcpp, cs, python, typescript,
+javascript'
+
+-------------------------------------------------------------------------------
+ *youcompleteme-refactoring-fixit-commands*
+Refactoring and FixIt Commands ~
+
+These commands make changes to your source code in order to perform refactoring
+or code correction. YouCompleteMe does not perform any action which cannot be
+undone, and never saves or writes files to the disk.
+
+-------------------------------------------------------------------------------
+The *FixIt* subcommand
+
+Where available, attempts to make changes to the buffer to correct the
+diagnostic closest to the cursor position.
+
+Completers which provide diagnostics may also provide trivial modifications to
+the source in order to correct the diagnostic. Examples include syntax errors
+such as missing trailing semi-colons, spurious characters, or other errors
+which the semantic engine can deterministically suggest corrections.
+
+If no fix-it is available for the current line, or there is no diagnostic on
+the current line, this command has no effect on the current buffer. If any
+modifications are made, the number of changes made to the buffer is echo'd and
+the user may use the editor's undo command to revert.
+
+When a diagnostic is available, and |g:ycm_echo_current_diagnostic| is set to
+1, then the text '(FixIt)' is appended to the echo'd diagnostic when the
+completer is able to add this indication. The text '(FixIt available)' is also
+appended to the diagnostic text in the output of the |:YcmDiags| command for
+any diagnostics with available fix-its (where the completer can provide this
+indication).
+
+NOTE: Causes re-parsing of the current translation unit.
+
+NOTE: After applying a fix-it, the diagnostics UI is not immediately updated.
+This is due to a technical restriction in Vim. Moving the cursor, or issuing
+the |:YcmForceCompileAndDiagnostics| command will refresh the diagnostics.
+Repeated invocations of the |FixIt| command on a given line, however, _do_
+apply all diagnostics as expected without requiring refreshing of the
+diagnostics UI. This is particularly useful where there are multiple
+diagnostics on one line, or where after fixing one diagnostic, another fix-it
+is available.
+
+Supported in filetypes: 'c, cpp, objc, objcpp, cs'
+
+-------------------------------------------------------------------------------
+ *RefactorRename-new-name*
+The 'RefactorRename <new name>' subcommand ~
+
+In supported file types, this command attempts to perform a semantic rename of
+the identifier under the cursor. This includes renaming declarations,
+definitions and usages of the identifier, or any other language-appropriate
+action. The specific behavior is defined by the semantic engine in use.
+
+Similar to |FixIt|, this command applies automatic modifications to your source
+files. Rename operations may involve changes to multiple files, which may or
+may not be open in Vim buffers at the time. YouCompleteMe handles all of this
+for you. The behavior is described in the following section.
+
+Supported in filetypes: 'javascript' (variables only), 'typescript'
+
+-------------------------------------------------------------------------------
+ *youcompleteme-multi-file-refactor*
+Multi-file Refactor ~
+
+When a Refactor or FixIt command touches multiple files, YouCompleteMe attempts
+to apply those modifications to any existing open, visible buffer in the
+current tab. If no such buffer can be found, YouCompleteMe opens the file in a
+new small horizontal split at the top of the current window, applies the
+change, and then _hides_ the window. NOTE: The buffer remains open, and must be
+manually saved. A confirmation dialog is opened prior to doing this to remind
+you that this is about to happen.
+
+Once the modifications have been made, the quickfix list (see ':help quickfix')
+is opened and populated with the locations of all modifications. This can be
+used to review all automatic changes made. Typically, use the 'CTRL-W <enter>'
+combination to open the selected file in a new split. It is possible to
+customize how the quickfix window is opened by using the |YcmQuickFixOpened|
+autocommand.
+
+The buffers are _not_ saved automatically. That is, you must save the modified
+buffers manually after reviewing the changes from the quickfix list. Changes
+can be undone using Vim's powerful undo features (see ':help undo'). Note that
+Vim's undo is per-buffer, so to undo all changes, the undo commands must be
+applied in each modified buffer separately.
+
+NOTE: While applying modifications, Vim may find files which are already open
+and have a swap file. The command is aborted if you select Abort or Quit in any
+such prompts. This leaves the Refactor operation partially complete and must be
+manually corrected using Vim's undo features. The quickfix list is _not_
+populated in this case. Inspect ':buffers' or equivalent (see ':help buffers')
+to see the buffers that were opened by the command.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-miscellaneous-commands*
+Miscellaneous Commands ~
+
+These commands are for general administration, rather than IDE-like features.
+They cover things like the semantic engine server instance and compilation
+flags.
+
+-------------------------------------------------------------------------------
+The *ClearCompilationFlagCache* subcommand
+
+YCM caches the flags it gets from the 'FlagsForFile' function in your
+'ycm_extra_conf.py' file if you return them with the 'do_cache' parameter set
+to 'True'. The cache is in memory and is never invalidated (unless you restart
+Vim of course).
+
+This command clears that cache entirely. YCM will then re-query your
+'FlagsForFile' function as needed in the future.
+
+Supported in filetypes: 'c, cpp, objc, objcpp'
+
+-------------------------------------------------------------------------------
+The *StartServer* subcommand
+
+Starts the semantic-engine-as-localhost-server for those semantic engines that
+work as separate servers that YCM talks to.
+
+Supported in filetypes: 'cs, go, javascript, rust'
+
+-------------------------------------------------------------------------------
+The *StopServer* subcommand
+
+Stops the semantic-engine-as-localhost-server for those semantic engines that
+work as separate servers that YCM talks to.
+
+Supported in filetypes: 'cs, go, javascript, rust'
+
+-------------------------------------------------------------------------------
+The *RestartServer* subcommand
+
+Restarts the semantic-engine-as-localhost-server for those semantic engines
+that work as separate servers that YCM talks to.
+
+An additional optional argument may be supplied for Python, specifying the
+python binary to use to restart the Python semantic engine.
+>
+ :YcmCompleter RestartServer /usr/bin/python3.4
+<
+Supported in filetypes: 'cs, python, rust'
+
+-------------------------------------------------------------------------------
+The *ReloadSolution* subcommand
+
+Instruct the Omnisharp server to clear its cache and reload all files from
+disk. This is useful when files are added, removed, or renamed in the solution,
+files are changed outside of Vim, or whenever Omnisharp cache is out-of-sync.
+
+Supported in filetypes: 'cs'
+
+===============================================================================
+ *youcompleteme-functions*
+Functions ~
+
+-------------------------------------------------------------------------------
+The *youcompleteme#GetErrorCount* function
+
+Get the number of YCM Diagnostic errors. If no errors are present, this
+function returns 0.
+
+For example:
+>
+ call youcompleteme#GetErrorCount()
+<
+Both this function and |youcompleteme#GetWarningCount| can be useful when
+integrating YCM with other Vim plugins. For example, a lightline [51] user
+could add a diagnostics section to their statusline which would display the
+number of errors and warnings.
+
+-------------------------------------------------------------------------------
+The *youcompleteme#GetWarningCount* function
+
+Get the number of YCM Diagnostic warnings. If no warnings are present, this
+function returns 0.
+
+For example:
+>
+ call youcompleteme#GetWarningCount()
+<
+===============================================================================
+ *youcompleteme-autocommands*
+Autocommands ~
+
+-------------------------------------------------------------------------------
+The *YcmQuickFixOpened* autocommand
+
+This 'User' autocommand is fired when YCM opens the quickfix window in response
+to the 'GoTo*' and 'RefactorRename' subcommands. By default, the quickfix
+window is opened to full width at the bottom of the screen and its height is
+set to fit all entries. This behavior can be overridden by using the
+|YcmQuickFixOpened| autocommand. For instance:
+>
+ function s:CustomizeYcmQuickFixWindow()
+ " Move the window at the top of the screen.
+ execute "wincmd K"
+ " Set the window height to 5.
+ execute "5wincmd _"
+ endfunction
+
+ autocmd User YcmQuickFixOpened call s:CustomizeYcmQuickFixWindow()
+<
+===============================================================================
+ *youcompleteme-options*
+Options ~
+
+All options have reasonable defaults so if the plug-in works after installation
+you don't need to change any options. These options can be configured in your
+vimrc script [35] by including a line like this:
+>
+ let g:ycm_min_num_of_chars_for_completion = 1
+<
+Note that after changing an option in your vimrc script [35] you have to
+restart Vim for the changes to take effect.
+
+-------------------------------------------------------------------------------
+The *g:ycm_min_num_of_chars_for_completion* option
+
+This option controls the number of characters the user needs to type before
+identifier-based completion suggestions are triggered. For example, if the
+option is set to '2', then when the user types a second alphanumeric character
+after a whitespace character, completion suggestions will be triggered. This
+option is NOT used for semantic completion.
+
+Setting this option to a high number like '99' effectively turns off the
+identifier completion engine and just leaves the semantic engine.
+
+Default: '2'
+>
+ let g:ycm_min_num_of_chars_for_completion = 2
+<
+-------------------------------------------------------------------------------
+The *g:ycm_min_num_identifier_candidate_chars* option
+
+This option controls the minimum number of characters that a completion
+candidate coming from the identifier completer must have to be shown in the
+popup menu.
+
+A special value of '0' means there is no limit.
+
+NOTE: This option only applies to the identifier completer; it has no effect on
+the various semantic completers.
+
+Default: '0'
+>
+ let g:ycm_min_num_identifier_candidate_chars = 0
+<
+-------------------------------------------------------------------------------
+The *g:ycm_auto_trigger* option
+
+When set to '0', this option turns off YCM's identifier completer (the as-you-
+type popup) _and_ the semantic triggers (the popup you'd get after typing '.'
+or '->' in say C++). You can still force semantic completion with the
+'<C-Space>' shortcut.
+
+If you want to just turn off the identifier completer but keep the semantic
+triggers, you should set |g:ycm_min_num_of_chars_for_completion| to a high
+number like '99'.
+
+Default: '1'
+>
+ let g:ycm_auto_trigger = 1
+<
+-------------------------------------------------------------------------------
+The *g:ycm_filetype_whitelist* option
+
+This option controls for which Vim filetypes (see ':h filetype') should YCM be
+turned on. The option value should be a Vim dictionary with keys being filetype
+strings (like 'python', 'cpp' etc) and values being unimportant (the dictionary
+is used like a hash set, meaning that only the keys matter).
+
+The '*' key is special and matches all filetypes. By default, the whitelist
+contains only this '*' key.
+
+YCM also has a |g:ycm_filetype_blacklist| option that lists filetypes for which
+YCM shouldn't be turned on. YCM will work only in filetypes that both the
+whitelist and the blacklist allow (the blacklist "allows" a filetype by _not_
+having it as a key).
+
+For example, let's assume you want YCM to work in files with the 'cpp'
+filetype. The filetype should then be present in the whitelist either directly
+('cpp' key in the whitelist) or indirectly through the special '*' key. It
+should _not_ be present in the blacklist.
+
+Filetypes that are blocked by the either of the lists will be completely
+ignored by YCM, meaning that neither the identifier-based completion engine nor
+the semantic engine will operate in them.
+
+You can get the filetype of the current file in Vim with ':set ft?'.
+
+Default: "{'*' : 1}"
+>
+ let g:ycm_filetype_whitelist = { '*': 1 }
+<
+-------------------------------------------------------------------------------
+The *g:ycm_filetype_blacklist* option
+
+This option controls for which Vim filetypes (see ':h filetype') should YCM be
+turned off. The option value should be a Vim dictionary with keys being
+filetype strings (like 'python', 'cpp' etc) and values being unimportant (the
+dictionary is used like a hash set, meaning that only the keys matter).
+
+See the |g:ycm_filetype_whitelist| option for more details on how this works.
+
+Default: '[see next line]'
+>
+ let g:ycm_filetype_blacklist = {
+ \ 'tagbar' : 1,
+ \ 'qf' : 1,
+ \ 'notes' : 1,
+ \ 'markdown' : 1,
+ \ 'unite' : 1,
+ \ 'text' : 1,
+ \ 'vimwiki' : 1,
+ \ 'pandoc' : 1,
+ \ 'infolog' : 1,
+ \ 'mail' : 1
+ \}
+<
+-------------------------------------------------------------------------------
+The *g:ycm_filetype_specific_completion_to_disable* option
+
+This option controls for which Vim filetypes (see ':h filetype') should the YCM
+semantic completion engine be turned off. The option value should be a Vim
+dictionary with keys being filetype strings (like 'python', 'cpp' etc) and
+values being unimportant (the dictionary is used like a hash set, meaning that
+only the keys matter). The listed filetypes will be ignored by the YCM semantic
+completion engine, but the identifier-based completion engine will still
+trigger in files of those filetypes.
+
+Note that even if semantic completion is not turned off for a specific
+filetype, you will not get semantic completion if the semantic engine does not
+support that filetype.
+
+You can get the filetype of the current file in Vim with ':set ft?'.
+
+Default: '[see next line]'
+>
+ let g:ycm_filetype_specific_completion_to_disable = {
+ \ 'gitcommit': 1
+ \}
+<
+-------------------------------------------------------------------------------
+The *g:ycm_show_diagnostics_ui* option
+
+When set, this option turns on YCM's diagnostic display features. See the
+_Diagnostic display_ section in the _User Manual_ for more details.
+
+Specific parts of the diagnostics UI (like the gutter signs, text highlighting,
+diagnostic echo and auto location list population) can be individually turned
+on or off. See the other options below for details.
+
+Note that YCM's diagnostics UI is only supported for C-family languages.
+
+When set, this option also makes YCM remove all Syntastic checkers set for the
+'c', 'cpp', 'objc' and 'objcpp' filetypes since this would conflict with YCM's
+own diagnostics UI.
+
+If you're using YCM's identifier completer in C-family languages but cannot use
+the clang-based semantic completer for those languages _and_ want to use the
+GCC Syntastic checkers, unset this option.
+
+Default: '1'
+>
+ let g:ycm_show_diagnostics_ui = 1
+<
+-------------------------------------------------------------------------------
+The *g:ycm_error_symbol* option
+
+YCM will use the value of this option as the symbol for errors in the Vim
+gutter.
+
+This option is part of the Syntastic compatibility layer; if the option is not
+set, YCM will fall back to the value of the 'g:syntastic_error_symbol' option
+before using this option's default.
+
+Default: '>>'
+>
+ let g:ycm_error_symbol = '>>'
+<
+-------------------------------------------------------------------------------
+The *g:ycm_warning_symbol* option
+
+YCM will use the value of this option as the symbol for warnings in the Vim
+gutter.
+
+This option is part of the Syntastic compatibility layer; if the option is not
+set, YCM will fall back to the value of the 'g:syntastic_warning_symbol' option
+before using this option's default.
+
+Default: '>>'
+>
+ let g:ycm_warning_symbol = '>>'
+<
+-------------------------------------------------------------------------------
+The *g:ycm_enable_diagnostic_signs* option
+
+When this option is set, YCM will put icons in Vim's gutter on lines that have
+a diagnostic set. Turning this off will also turn off the 'YcmErrorLine' and
+'YcmWarningLine' highlighting.
+
+This option is part of the Syntastic compatibility layer; if the option is not
+set, YCM will fall back to the value of the 'g:syntastic_enable_signs' option
+before using this option's default.
+
+Default: '1'
+>
+ let g:ycm_enable_diagnostic_signs = 1
+<
+-------------------------------------------------------------------------------
+The *g:ycm_enable_diagnostic_highlighting* option
+
+When this option is set, YCM will highlight regions of text that are related to
+the diagnostic that is present on a line, if any.
+
+This option is part of the Syntastic compatibility layer; if the option is not
+set, YCM will fall back to the value of the 'g:syntastic_enable_highlighting'
+option before using this option's default.
+
+Default: '1'
+>
+ let g:ycm_enable_diagnostic_highlighting = 1
+<
+-------------------------------------------------------------------------------
+The *g:ycm_echo_current_diagnostic* option
+
+When this option is set, YCM will echo the text of the diagnostic present on
+the current line when you move your cursor to that line. If a |FixIt| is
+available for the current diagnostic, then '(FixIt)' is appended.
+
+This option is part of the Syntastic compatibility layer; if the option is not
+set, YCM will fall back to the value of the 'g:syntastic_echo_current_error'
+option before using this option's default.
+
+Default: '1'
+>
+ let g:ycm_echo_current_diagnostic = 1
+<
+-------------------------------------------------------------------------------
+The *g:ycm_always_populate_location_list* option
+
+When this option is set, YCM will populate the location list automatically
+every time it gets new diagnostic data. This option is off by default so as not
+to interfere with other data you might have placed in the location list.
+
+See ':help location-list' in Vim to learn more about the location list.
+
+This option is part of the Syntastic compatibility layer; if the option is not
+set, YCM will fall back to the value of the
+'g:syntastic_always_populate_loc_list' option before using this option's
+default.
+
+Default: '0'
+>
+ let g:ycm_always_populate_location_list = 0
+<
+-------------------------------------------------------------------------------
+The *g:ycm_open_loclist_on_ycm_diags* option
+
+When this option is set, |:YcmDiags| will automatically open the location list
+after forcing a compilation and filling the list with diagnostic data.
+
+See ':help location-list' in Vim to learn more about the location list.
+
+Default: '1'
+>
+ let g:ycm_open_loclist_on_ycm_diags = 1
+<
+-------------------------------------------------------------------------------
+The *g:ycm_allow_changing_updatetime* option
+
+When this option is set to '1', YCM will change the 'updatetime' Vim option to
+'2000' (see ':h updatetime'). This may conflict with some other plugins you
+have (but it's unlikely). The 'updatetime' option is the number of milliseconds
+that have to pass before Vim's 'CursorHold' (see ':h CursorHold') event fires.
+YCM runs the completion engines' "file comprehension" systems in the background
+on every such event; the identifier-based engine collects the identifiers
+whereas the semantic engine compiles the file to build an AST.
+
+The Vim default of '4000' for 'updatetime' is a bit long, so YCM reduces this.
+Set this option to '0' to force YCM to leave your 'updatetime' setting alone.
+
+Default: '1'
+>
+ let g:ycm_allow_changing_updatetime = 1
+<
+-------------------------------------------------------------------------------
+The *g:ycm_complete_in_comments* option
+
+When this option is set to '1', YCM will show the completion menu even when
+typing inside comments.
+
+Default: '0'
+>
+ let g:ycm_complete_in_comments = 0
+<
+-------------------------------------------------------------------------------
+The *g:ycm_complete_in_strings* option
+
+When this option is set to '1', YCM will show the completion menu even when
+typing inside strings.
+
+Note that this is turned on by default so that you can use the filename
+completion inside strings. This is very useful for instance in C-family files
+where typing '#include "' will trigger the start of filename completion. If you
+turn off this option, you will turn off filename completion in such situations
+as well.
+
+Default: '1'
+>
+ let g:ycm_complete_in_strings = 1
+<
+-------------------------------------------------------------------------------
+The *g:ycm_collect_identifiers_from_comments_and_strings* option
+
+When this option is set to '1', YCM's identifier completer will also collect
+identifiers from strings and comments. Otherwise, the text in comments and
+strings will be ignored.
+
+Default: '0'
+>
+ let g:ycm_collect_identifiers_from_comments_and_strings = 0
+<
+-------------------------------------------------------------------------------
+The *g:ycm_collect_identifiers_from_tags_files* option
+
+When this option is set to '1', YCM's identifier completer will also collect
+identifiers from tags files. The list of tags files to examine is retrieved
+from the 'tagfiles()' Vim function which examines the 'tags' Vim option. See
+":h 'tags'" for details.
+
+YCM will re-index your tags files if it detects that they have been modified.
+
+The only supported tag format is the Exuberant Ctags format [52]. The format
+from "plain" ctags is NOT supported. Ctags needs to be called with the '--
+fields=+l' option (that's a lowercase 'L', not a one) because YCM needs the
+'language:<lang>' field in the tags output.
+
+See the _FAQ_ for pointers if YCM does not appear to read your tag files.
+
+This option is off by default because it makes Vim slower if your tags are on a
+network directory.
+
+Default: '0'
+>
+ let g:ycm_collect_identifiers_from_tags_files = 0
+<
+-------------------------------------------------------------------------------
+The *g:ycm_seed_identifiers_with_syntax* option
+
+When this option is set to '1', YCM's identifier completer will seed its
+identifier database with the keywords of the programming language you're
+writing.
+
+Since the keywords are extracted from the Vim syntax file for the filetype, all
+keywords may not be collected, depending on how the syntax file was written.
+Usually at least 95% of the keywords are successfully extracted.
+
+Default: '0'
+>
+ let g:ycm_seed_identifiers_with_syntax = 0
+<
+-------------------------------------------------------------------------------
+The *g:ycm_extra_conf_vim_data* option
+
+If you're using semantic completion for C-family files, this option might come
+handy; it's a way of sending data from Vim to your 'FlagsForFile' function in
+your '.ycm_extra_conf.py' file.
+
+This option is supposed to be a list of VimScript expression strings that are
+evaluated for every request to the ycmd server [39] and then passed to your
+'FlagsForFile' function as a 'client_data' keyword argument.
+
+For instance, if you set this option to "['v:version']", your 'FlagsForFile'
+function will be called like this:
+>
+ # The '704' value is of course contingent on Vim 7.4; in 7.3 it would be '703'
+ FlagsForFile(filename, client_data = {'v:version': 704})
+<
+So the 'client_data' parameter is a dictionary mapping Vim expression strings
+to their values at the time of the request.
+
+The correct way to define parameters for your 'FlagsForFile' function:
+>
+ def FlagsForFile(filename, **kwargs):
+<
+You can then get to 'client_data' with "kwargs['client_data']".
+
+Default: '[]'
+>
+ let g:ycm_extra_conf_vim_data = []
+<
+-------------------------------------------------------------------------------
+The *g:ycm_server_python_interpreter* option
+
+YCM will by default search for an appropriate Python interpreter on your
+system. You can use this option to override that behavior and force the use of
+a specific interpreter of your choosing.
+
+NOTE: This interpreter is only used for the ycmd server [39]. The YCM client
+running inside Vim always uses the Python interpreter that's embedded inside
+Vim.
+
+Default: "''"
+>
+ let g:ycm_server_python_interpreter = ''
+<
+-------------------------------------------------------------------------------
+The *g:ycm_server_keep_logfiles* option
+
+When this option is set to '1', the ycmd completion server [39] will keep the
+logfiles around after shutting down (they are deleted on shutdown by default).
+
+To see where the logfiles are, call |:YcmDebugInfo|.
+
+Default: '0'
+>
+ let g:ycm_server_keep_logfiles = 0
+<
+-------------------------------------------------------------------------------
+The *g:ycm_server_log_level* option
+
+The logging level that the ycmd completion server [39] uses. Valid values are
+the following, from most verbose to least verbose: - 'debug' - 'info' -
+'warning' - 'error' - 'critical'
+
+Note that 'debug' is _very_ verbose.
+
+Default: 'info'
+>
+ let g:ycm_server_log_level = 'info'
+<
+-------------------------------------------------------------------------------
+The *g:ycm_auto_start_csharp_server* option
+
+When set to '1', the OmniSharp server will be automatically started (once per
+Vim session) when you open a C# file.
+
+Default: '1'
+>
+ let g:ycm_auto_start_csharp_server = 1
+<
+-------------------------------------------------------------------------------
+The *g:ycm_auto_stop_csharp_server* option
+
+When set to '1', the OmniSharp server will be automatically stopped upon
+closing Vim.
+
+Default: '1'
+>
+ let g:ycm_auto_stop_csharp_server = 1
+<
+-------------------------------------------------------------------------------
+The *g:ycm_csharp_server_port* option
+
+When g:ycm_auto_start_csharp_server is set to '1', specifies the port for the
+OmniSharp server to listen on. When set to '0' uses an unused port provided by
+the OS.
+
+Default: '0'
+>
+ let g:ycm_csharp_server_port = 0
+<
+-------------------------------------------------------------------------------
+The *g:ycm_csharp_insert_namespace_expr* option
+
+By default, when YCM inserts a namespace, it will insert the 'using' statement
+under the nearest 'using' statement. You may prefer that the 'using' statement
+is inserted somewhere, for example, to preserve sorting. If so, you can set
+this option to override this behavior.
+
+When this option is set, instead of inserting the 'using' statement itself, YCM
+will set the global variable 'g:ycm_namespace_to_insert' to the namespace to
+insert, and then evaluate this option's value as an expression. The option's
+expression is responsible for inserting the namespace - the default insertion
+will not occur.
+
+Default: ''
+>
+ let g:ycm_csharp_insert_namespace_expr = ''
+<
+-------------------------------------------------------------------------------
+The *g:ycm_add_preview_to_completeopt* option
+
+When this option is set to '1', YCM will add the 'preview' string to Vim's
+'completeopt' option (see ':h completeopt'). If your 'completeopt' option
+already has 'preview' set, there will be no effect. You can see the current
+state of your 'completeopt' setting with ':set completeopt?' (yes, the question
+mark is important).
+
+When 'preview' is present in 'completeopt', YCM will use the 'preview' window
+at the top of the file to store detailed information about the current
+completion candidate (but only if the candidate came from the semantic engine).
+For instance, it would show the full function prototype and all the function
+overloads in the window if the current completion is a function name.
+
+Default: '0'
+>
+ let g:ycm_add_preview_to_completeopt = 0
+<
+-------------------------------------------------------------------------------
+The *g:ycm_autoclose_preview_window_after_completion* option
+
+When this option is set to '1', YCM will auto-close the 'preview' window after
+the user accepts the offered completion string. If there is no 'preview' window
+triggered because there is no 'preview' string in 'completeopt', this option is
+irrelevant. See the |g:ycm_add_preview_to_completeopt| option for more details.
+
+Default: '0'
+>
+ let g:ycm_autoclose_preview_window_after_completion = 0
+<
+-------------------------------------------------------------------------------
+The *g:ycm_autoclose_preview_window_after_insertion* option
+
+When this option is set to '1', YCM will auto-close the 'preview' window after
+the user leaves insert mode. This option is irrelevant if
+|g:ycm_autoclose_preview_window_after_completion| is set or if no 'preview'
+window is triggered. See the |g:ycm_add_preview_to_completeopt| option for more
+details.
+
+Default: '0'
+>
+ let g:ycm_autoclose_preview_window_after_insertion = 0
+<
+-------------------------------------------------------------------------------
+The *g:ycm_max_diagnostics_to_display* option
+
+This option controls the maximum number of diagnostics shown to the user when
+errors or warnings are detected in the file. This option is only relevant if
+you are using the C-family semantic completion engine.
+
+Default: '30'
+>
+ let g:ycm_max_diagnostics_to_display = 30
+<
+-------------------------------------------------------------------------------
+The *g:ycm_key_list_select_completion* option
+
+This option controls the key mappings used to select the first completion
+string. Invoking any of them repeatedly cycles forward through the completion
+list.
+
+Some users like adding '<Enter>' to this list.
+
+Default: "['<TAB>', '<Down>']"
+>
+ let g:ycm_key_list_select_completion = ['<TAB>', '<Down>']
+<
+-------------------------------------------------------------------------------
+The *g:ycm_key_list_previous_completion* option
+
+This option controls the key mappings used to select the previous completion
+string. Invoking any of them repeatedly cycles backwards through the completion
+list.
+
+Note that one of the defaults is '<S-TAB>' which means Shift-TAB. That mapping
+will probably only work in GUI Vim (Gvim or MacVim) and not in plain console
+Vim because the terminal usually does not forward modifier key combinations to
+Vim.
+
+Default: "['<S-TAB>', '<Up>']"
+>
+ let g:ycm_key_list_previous_completion = ['<S-TAB>', '<Up>']
+<
+-------------------------------------------------------------------------------
+The *g:ycm_key_invoke_completion* option
+
+This option controls the key mapping used to invoke the completion menu for
+semantic completion. By default, semantic completion is trigged automatically
+after typing '.', '->' and '::' in insert mode (if semantic completion support
+has been compiled in). This key mapping can be used to trigger semantic
+completion anywhere. Useful for searching for top-level functions and classes.
+
+Console Vim (not Gvim or MacVim) passes '<Nul>' to Vim when the user types
+'<C-Space>' so YCM will make sure that '<Nul>' is used in the map command when
+you're editing in console Vim, and '<C-Space>' in GUI Vim. This means that you
+can just press '<C-Space>' in both console and GUI Vim and YCM will do the
+right thing.
+
+Setting this option to an empty string will make sure no mapping is created.
+
+Default: '<C-Space>'
+>
+ let g:ycm_key_invoke_completion = '<C-Space>'
+<
+-------------------------------------------------------------------------------
+The *g:ycm_key_detailed_diagnostics* option
+
+This option controls the key mapping used to show the full diagnostic text when
+the user's cursor is on the line with the diagnostic. It basically calls
+|:YcmShowDetailedDiagnostic|.
+
+Setting this option to an empty string will make sure no mapping is created.
+
+Default: '<leader>d'
+>
+ let g:ycm_key_detailed_diagnostics = '<leader>d'
+<
+-------------------------------------------------------------------------------
+The *g:ycm_global_ycm_extra_conf* option
+
+Normally, YCM searches for a '.ycm_extra_conf.py' file for compilation flags
+(see the User Guide for more details on how this works). This option specifies
+a fallback path to a config file which is used if no '.ycm_extra_conf.py' is
+found.
+
+You can place such a global file anywhere in your filesystem.
+
+Default: "''"
+>
+ let g:ycm_global_ycm_extra_conf = ''
+<
+-------------------------------------------------------------------------------
+The *g:ycm_confirm_extra_conf* option
+
+When this option is set to '1' YCM will ask once per '.ycm_extra_conf.py' file
+if it is safe to be loaded. This is to prevent execution of malicious code from
+a '.ycm_extra_conf.py' file you didn't write.
+
+To selectively get YCM to ask/not ask about loading certain
+'.ycm_extra_conf.py' files, see the |g:ycm_extra_conf_globlist| option.
+
+Default: '1'
+>
+ let g:ycm_confirm_extra_conf = 1
+<
+-------------------------------------------------------------------------------
+The *g:ycm_extra_conf_globlist* option
+
+This option is a list that may contain several globbing patterns. If a pattern
+starts with a '!' all '.ycm_extra_conf.py' files matching that pattern will be
+blacklisted, that is they won't be loaded and no confirmation dialog will be
+shown. If a pattern does not start with a '!' all files matching that pattern
+will be whitelisted. Note that this option is not used when confirmation is
+disabled using |g:ycm_confirm_extra_conf| and that items earlier in the list
+will take precedence over the later ones.
+
+Rules:
+
+- '*' matches everything
+- '?' matches any single character
+- '[seq]' matches any character in seq
+- '[!seq]' matches any char not in seq
+
+Example:
+>
+ let g:ycm_extra_conf_globlist = ['~/dev/*','!~/*']
+<
+- The first rule will match everything contained in the '~/dev' directory so
+ '.ycm_extra_conf.py' files from there will be loaded.
+
+- The second rule will match everything in the home directory so a
+ '.ycm_extra_conf.py' file from there won't be loaded.
+
+- As the first rule takes precedence everything in the home directory
+ excluding the '~/dev' directory will be blacklisted.
+
+NOTE: The glob pattern is first expanded with Python's 'os.path.expanduser()'
+and then resolved with 'os.path.abspath()' before being matched against the
+filename.
+
+Default: '[]'
+>
+ let g:ycm_extra_conf_globlist = []
+<
+-------------------------------------------------------------------------------
+The *g:ycm_filepath_completion_use_working_dir* option
+
+By default, YCM's filepath completion will interpret relative paths like '../'
+as being relative to the folder of the file of the currently active buffer.
+Setting this option will force YCM to always interpret relative paths as being
+relative to Vim's current working directory.
+
+Default: '0'
+>
+ let g:ycm_filepath_completion_use_working_dir = 0
+<
+-------------------------------------------------------------------------------
+The *g:ycm_semantic_triggers* option
+
+This option controls the character-based triggers for the various semantic
+completion engines. The option holds a dictionary of key-values, where the keys
+are Vim's filetype strings delimited by commas and values are lists of strings,
+where the strings are the triggers.
+
+Setting key-value pairs on the dictionary _adds_ semantic triggers to the
+internal default set (listed below). You cannot remove the default triggers,
+only add new ones.
+
+A "trigger" is a sequence of one or more characters that trigger semantic
+completion when typed. For instance, C++ ('cpp' filetype) has '.' listed as a
+trigger. So when the user types 'foo.', the semantic engine will trigger and
+serve 'foo''s list of member functions and variables. Since C++ also has '->'
+listed as a trigger, the same thing would happen when the user typed 'foo->'.
+
+It's also possible to use a regular expression as a trigger. You have to prefix
+your trigger with 're!' to signify it's a regex trigger. For instance,
+'re!\w+\.' would only trigger after the '\w+\.' regex matches.
+
+NOTE: The regex syntax is **NOT** Vim's, it's Python's [53].
+
+Default: '[see next line]'
+>
+ let g:ycm_semantic_triggers = {
+ \ 'c' : ['->', '.'],
+ \ 'objc' : ['->', '.', 're!\[[_a-zA-Z]+\w*\s', 're!^\s*[^\W\d]\w*\s',
+ \ 're!\[.*\]\s'],
+ \ 'ocaml' : ['.', '#'],
+ \ 'cpp,objcpp' : ['->', '.', '::'],
+ \ 'perl' : ['->'],
+ \ 'php' : ['->', '::'],
+ \ 'cs,java,javascript,typescript,d,python,perl6,scala,vb,elixir,go' : ['.'],
+ \ 'ruby' : ['.', '::'],
+ \ 'lua' : ['.', ':'],
+ \ 'erlang' : [':'],
+ \ }
+<
+-------------------------------------------------------------------------------
+The *g:ycm_cache_omnifunc* option
+
+Some omnicompletion engines do not work well with the YCM cache—in particular,
+they might not produce all possible results for a given prefix. By unsetting
+this option you can ensure that the omnicompletion engine is re-queried on
+every keypress. That will ensure all completions will be presented, but might
+cause stuttering and lagginess if the omnifunc is slow.
+
+Default: '1'
+>
+ let g:ycm_cache_omnifunc = 1
+<
+-------------------------------------------------------------------------------
+The *g:ycm_use_ultisnips_completer* option
+
+By default, YCM will query the UltiSnips plugin for possible completions of
+snippet triggers. This option can turn that behavior off.
+
+Default: '1'
+>
+ let g:ycm_use_ultisnips_completer = 1
+<
+-------------------------------------------------------------------------------
+The *g:ycm_goto_buffer_command* option
+
+Defines where 'GoTo*' commands result should be opened. Can take one of the
+following values: "[ 'same-buffer', 'horizontal-split', 'vertical-split', 'new-
+tab', 'new-or-existing-tab' ]" If this option is set to the "'same-buffer'" but
+current buffer can not be switched (when buffer is modified and 'nohidden'
+option is set), then result will be opened in horizontal split.
+
+Default: "'same-buffer'"
+>
+ let g:ycm_goto_buffer_command = 'same-buffer'
+<
+-------------------------------------------------------------------------------
+The *g:ycm_disable_for_files_larger_than_kb* option
+
+Defines the max size (in Kb) for a file to be considered for completion. If
+this option is set to 0 then no check is made on the size of the file you're
+opening.
+
+Default: 1000
+>
+ let g:ycm_disable_for_files_larger_than_kb = 1000
+<
+-------------------------------------------------------------------------------
+The *g:ycm_python_binary_path* option
+
+This option specifies the Python interpreter to use to run the jedi [6]
+completion library. Specify the Python interpreter to use to get completions.
+By default the Python under which ycmd [39] runs is used (ycmd [39] runs on
+Python 2.6, 2.7 or 3.3+).
+
+Default: "''"
+>
+ let g:ycm_python_binary_path = 'python'
+<
+NOTE: the settings above will make YCM use the first 'python' executable found
+through the PATH.
+
+===============================================================================
+ *youcompleteme-faq*
+FAQ ~
+
+-------------------------------------------------------------------------------
+ *import-vim*
+I used to be able to 'import vim' in '.ycm_extra_conf.py', but now can't ~
+
+YCM was rewritten to use a client-server architecture where most of the logic
+is in the ycmd server [39]. So the magic 'vim' module you could have previously
+imported in your '.ycm_extra_conf.py' files doesn't exist anymore.
+
+To be fair, importing the magic 'vim' module in extra conf files was never
+supported in the first place; it only ever worked by accident and was never a
+part of the extra conf API.
+
+But fear not, you should be able to tweak your extra conf files to continue
+working by using the |g:ycm_extra_conf_vim_data| option. See the docs on that
+option for details.
+
+-------------------------------------------------------------------------------
+*youcompleteme-on-very-rare-occasions-vim-crashes-when-i-tab-through-completion-menu*
+On very rare occasions Vim crashes when I tab through the completion menu ~
+
+That's a very rare Vim bug most users never encounter. It's fixed in Vim
+7.4.72. Update to that version (or above) to resolve the issue.
+
+-------------------------------------------------------------------------------
+I get *ImportError* exceptions that mention 'PyInit_ycm_core' or 'initycm_core'
+
+These errors are caused by building the YCM native libraries for Python 2 and
+trying to load them into a Python 3 process (or the other way around).
+
+For instance, if building for Python 2 but loading in Python 3:
+>
+ ImportError: dynamic module does not define init function (PyInit_ycm_core)
+<
+If building for Python 3 but loading in Python 2:
+>
+ ImportError: dynamic module does not define init function (initycm_core)
+<
+Setting the |g:ycm_server_python_interpreter| option to force the use of a
+specific Python interpreter for 'ycmd' is usually the easiest way to solve the
+problem. Common values for that option are '/usr/bin/python' and
+'/usr/bin/python3'.
+
+-------------------------------------------------------------------------------
+I get a linker warning regarding *libpython* on Mac when compiling YCM
+
+If the warning is "ld: warning: path '/usr/lib/libpython2.7.dylib' following -L
+not a directory", then feel free to ignore it; it's caused by a limitation of
+CMake and is not an issue. Everything should still work fine.
+
+-------------------------------------------------------------------------------
+*youcompleteme-i-get-weird-window-at-top-of-my-file-when-i-use-semantic-engine*
+I get a weird window at the top of my file when I use the semantic engine ~
+
+This is Vim's 'preview' window. Vim uses it to show you extra information about
+something if such information is available. YCM provides Vim with such extra
+information. For instance, when you select a function in the completion list,
+the 'preview' window will hold that function's prototype and the prototypes of
+any overloads of the function. It will stay there after you select the
+completion so that you can use the information about the parameters and their
+types to write the function call.
+
+If you would like this window to auto-close after you select a completion
+string, set the |g:ycm_autoclose_preview_window_after_completion| option to '1'
+in your 'vimrc' file. Similarly, the
+|g:ycm_autoclose_preview_window_after_insertion| option can be set to close the
+'preview' window after leaving insert mode.
+
+If you don't want this window to ever show up, add 'set completeopt-=preview'
+to your 'vimrc'. Also make sure that the |g:ycm_add_preview_to_completeopt|
+option is set to '0'.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-it-appears-that-ycm-is-not-working*
+It appears that YCM is not working ~
+
+In Vim, run ':messages' and carefully read the output. YCM will echo messages
+to the message log if it encounters problems. It's likely you misconfigured
+something and YCM is complaining about it.
+
+Also, you may want to run the |:YcmDebugInfo| command; it will make YCM spew
+out various debugging information, including the ycmd [39] logfile paths and
+the compile flags for the current file if the file is a C-family language file
+and you have compiled in Clang support. Logfiles can be automatically opened in
+the editor using the |:YcmToggleLogs| command.
+
+-------------------------------------------------------------------------------
+*youcompleteme-sometimes-it-takes-much-longer-to-get-semantic-completions-than-normal*
+Sometimes it takes much longer to get semantic completions than normal ~
+
+This means that libclang (which YCM uses for C-family semantic completion)
+failed to pre-compile your file's preamble. In other words, there was an error
+compiling some of the source code you pulled in through your header files. I
+suggest calling the |:YcmDiags| command to see what they were.
+
+Bottom line, if libclang can't pre-compile your file's preamble because there
+were errors in it, you're going to get slow completions because there's no AST
+cache.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-ycm-auto-inserts-completion-strings-i-dont-want*
+YCM auto-inserts completion strings I don't want! ~
+
+This means you probably have some mappings that interfere with YCM's internal
+ones. Make sure you don't have something mapped to '<C-p>', '<C-x>' or '<C-u>'
+(in insert mode).
+
+YCM _never_ selects something for you; it just shows you a menu and the user
+has to explicitly select something. If something is being selected
+automatically, this means there's a bug or a misconfiguration somewhere.
+
+-------------------------------------------------------------------------------
+ *E227:-mapping-already-exists-for-blah*
+I get a 'E227: mapping already exists for <blah>' error when I start Vim ~
+
+This means that YCM tried to set up a key mapping but failed because you
+already had something mapped to that key combination. The '<blah>' part of the
+message will tell you what was the key combination that failed.
+
+Look in the _Options_ section and see if any of the default mappings conflict
+with your own. Then change that option value to something else so that the
+conflict goes away.
+
+-------------------------------------------------------------------------------
+ *GLIBC_2.XX-not-found()*
+I get "'GLIBC_2.XX' not found (required by libclang.so)" when starting Vim ~
+
+Your system is too old for the precompiled binaries from llvm.org. Compile
+Clang on your machine and then link against the 'libclang.so' you just
+produced. See the full installation guide for help.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-im-trying-to-use-homebrew-vim-with-ycm-im-getting-segfaults*
+I'm trying to use a Homebrew Vim with YCM and I'm getting segfaults ~
+
+Something (I don't know what) is wrong with the way that Homebrew configures
+and builds Vim. I recommend using MacVim [18]. Even if you don't like the
+MacVim GUI, you can use the Vim binary that is inside the MacVim.app package
+(it's 'MacVim.app/Contents/MacOS/Vim') and get the Vim console experience.
+
+-------------------------------------------------------------------------------
+*youcompleteme-i-have-homebrew-python-and-or-macvim-cant-compile-sigabrt-when-starting*
+I have a Homebrew Python and/or MacVim; can't compile/SIGABRT when starting ~
+
+You should probably run 'brew rm python; brew install python' to get the latest
+fixes that should make YCM work with such a configuration. Also rebuild Macvim
+then. If you still get problems with this, see issue #18 [54] for suggestions.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-vim-segfaults-when-i-use-semantic-completer-in-ruby-files*
+Vim segfaults when I use the semantic completer in Ruby files ~
+
+This was caused by a Vim bug. Update your version of Vim (Vim 7.3.874 is known
+to work, earlier versions may also fix this issue).
+
+-------------------------------------------------------------------------------
+ *LONG_BIT-definition-appears-wrong-for-platform*
+I get 'LONG_BIT definition appears wrong for platform' when compiling ~
+
+Look at the output of your CMake call. There should be a line in it like the
+following (with '.dylib' in place of '.so' on a Mac):
+>
+ -- Found PythonLibs: /usr/lib/libpython2.7.so (Required is at least version "2.5")
+<
+That would be the **correct** output. An example of **incorrect** output would
+be the following:
+>
+ -- Found PythonLibs: /usr/lib/libpython2.7.so (found suitable version "2.5.1", minimum required is "2.5")
+<
+Notice how there's an extra bit of output there, the 'found suitable version
+"<version>"' part, where '<version>' is not the same as the version of the
+dynamic library. In the example shown, the library is version 2.7 but the
+second string is version '2.5.1'.
+
+This means that CMake found one version of Python headers and a different
+version for the library. This is wrong. It can happen when you have multiple
+versions of Python installed on your machine.
+
+You should probably add the following flags to your cmake call (again, 'dylib'
+instead of 'so' on a Mac):
+>
+ -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so
+<
+This will force the paths to the Python include directory and the Python
+library to use. You may need to set these flags to something else, but you need
+to make sure you use the same version of Python that your Vim binary is built
+against, which is highly likely to be the system's default Python.
+
+-------------------------------------------------------------------------------
+ *libpython2.7.a-...-relocation-R_X86_64_32*
+I get 'libpython2.7.a [...] relocation R_X86_64_32' when compiling ~
+
+The error is usually encountered when compiling YCM on Centos or RHEL. The full
+error looks something like the following:
+>
+ /usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
+<
+It's possible to get a slightly different error that's similar to the one
+above. Here's the problem and how you solve it:
+
+Your 'libpython2.7.a' was not compiled with '-fPIC' so it can't be linked into
+'ycm_core.so'. Use the '-DPYTHON_LIBRARY=' CMake flag to point it to a '.so'
+version of libpython on your machine (for instance,
+'-DPYTHON_LIBRARY=/usr/lib/libpython2.7.so'). Naturally, this means you'll have
+to go through the full installation guide by hand.
+
+-------------------------------------------------------------------------------
+ *Vim:-Caught-deadly-signal-SEGV*
+I get 'Vim: Caught deadly signal SEGV' on Vim startup ~
+
+This can happen on some Linux distros. If you encounter this situation, run Vim
+under 'gdb'. You'll probably see something like this in the output when Vim
+crashes:
+>
+ undefined symbol: clang_CompileCommands_dispose
+<
+This means that Vim is trying to load a 'libclang.so' that is too old. You need
+at least a 3.8 libclang. Just go through the installation guide and make sure
+you are using a correct 'libclang.so'. We recommend downloading prebuilt
+binaries from llvm.org.
+
+-------------------------------------------------------------------------------
+ *Fatal-Python-error:-PyThreadState_Get:-no-current-thread*
+I get 'Fatal Python error: PyThreadState_Get: no current thread' on startup ~
+
+This is caused by linking a static version of |libpython| into ycmd's
+'ycm_core.so'. This leads to multiple copies of the python interpreter loaded
+when 'python' loads 'ycmd_core.so' and this messes up python's global state.
+The details aren't important.
+
+The solution is that the version of Python linked and run against must be built
+with either '--enable-shared' or '--enable-framework' (on OS X). This is
+achieved as follows (NOTE: for Mac, replace '--enable-shared' with '--enable-
+framework'):
+
+- When building python from source: './configure --enable-shared {options}'
+- When building python from pyenv: 'PYTHON_CONFIGURE_OPTS="--enable-shared"
+ pyenv install {version}'
+
+===============================================================================
+*install.py* says python must be compiled with '--enable-framework'. Wat?
+
+See the previous answer for how to ensure your python is built to support
+dynamic modules.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-ycm-does-not-read-identifiers-from-my-tags-files*
+YCM does not read identifiers from my tags files ~
+
+First, put 'let g:ycm_collect_identifiers_from_tags_files = 1' in your vimrc.
+
+Make sure you are using Exuberant Ctags [55] to produce your tags files since
+the only supported tag format is the Exuberant Ctags format [52]. The format
+from "plain" ctags is NOT supported. The output of 'ctags --version' should
+list "Exuberant Ctags".
+
+Ctags needs to be called with the '--fields=+l' (that's a lowercase 'L', not a
+one) option because YCM needs the 'language:<lang>' field in the tags output.
+
+NOTE: Exuberant Ctags [55] by default sets language tag for '*.h' files as
+'C++'. If you have C (not C++) project, consider giving parameter '--
+langmap=c:.c.h' to ctags to see tags from '*.h' files.
+
+NOTE: Mac OS X comes with "plain" ctags installed by default. 'brew install
+ctags' will get you the Exuberant Ctags version.
+
+Also make sure that your Vim 'tags' option is set correctly. See ":h 'tags'"
+for details. If you want to see which tag files YCM will read for a given
+buffer, run ':echo tagfiles()' with the relevant buffer active. Note that that
+function will only list tag files that already exist.
+
+-------------------------------------------------------------------------------
+ *CTRL-sub-U*
+'CTRL-U' in insert mode does not work ~
+
+YCM keeps you in a 'completefunc' completion mode when you're typing in insert
+mode and Vim disables '<C-U>' in completion mode as a "feature." Sadly there's
+nothing I can do about this.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-ycm-conflicts-with-ultisnips-tab-key-usage*
+YCM conflicts with UltiSnips TAB key usage ~
+
+YCM comes with support for UltiSnips (snippet suggestions in the popup menu),
+but you'll have to change the UltiSnips mappings. See ':h UltiSnips-triggers'
+in Vim for details. You'll probably want to change some/all of the following
+options:
+>
+ g:UltiSnipsExpandTrigger
+ g:UltiSnipsJumpForwardTrigger
+ g:UltiSnipsJumpBackwardTrigger
+<
+-------------------------------------------------------------------------------
+ *youcompleteme-why-isnt-ycm-just-written-in-plain-vimscript-ffs*
+Why isn't YCM just written in plain VimScript, FFS? ~
+
+Because of the identifier completion engine and subsequence-based filtering.
+Let's say you have _many_ dozens of files open in a single Vim instance (I
+often do); the identifier-based engine then needs to store thousands (if not
+tens of thousands) of identifiers in its internal data-structures. When the
+user types, YCM needs to perform subsequence-based filtering on _all_ of those
+identifiers (every single one!) in less than 10 milliseconds.
+
+I'm sorry, but that level of performance is just plain impossible to achieve
+with VimScript. I've tried, and the language is just too slow. No, you can't
+get acceptable performance even if you limit yourself to just the identifiers
+in the current file and simple prefix-based filtering.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-why-does-ycm-demand-such-recent-version-of-vim*
+Why does YCM demand such a recent version of Vim? ~
+
+During YCM's development several show-stopper bugs were encountered in Vim.
+Those needed to be fixed upstream (and were). A few months after those bugs
+were fixed, Vim trunk landed the 'pyeval()' function which improved YCM
+performance even more since less time was spent serializing and deserializing
+data between Vim and the embedded Python interpreter. A few critical bugfixes
+for 'pyeval()' landed in Vim 7.3.584 (and a few commits before that).
+
+-------------------------------------------------------------------------------
+ *youcompleteme-i-get-annoying-messages-in-vims-status-area-when-i-type*
+I get annoying messages in Vim's status area when I type ~
+
+If you're referring to the 'User defined completion <bla bla> back at original'
+and similar, then just update to Vim 7.4.314 (or later) and they'll go away.
+
+-------------------------------------------------------------------------------
+ *vim-sub-autoclose*
+Nasty bugs happen if I have the 'vim-autoclose' plugin installed ~
+
+Use the delimitMate [56] plugin instead. It does the same thing without
+conflicting with YCM.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-is-there-sort-of-ycm-mailing-list-i-have-questions*
+Is there some sort of YCM mailing list? I have questions ~
+
+If you have questions about the plugin or need help, please use the ycm-users
+[57] mailing list, _don't_ create issues on the tracker. The tracker is for bug
+reports and feature requests.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-i-get-an-internal-compiler-error-when-installing*
+I get an internal compiler error when installing ~
+
+This can be a problem on virtual servers with limited memory. A possible
+solution is to add more swap memory. A more practical solution would be to
+force the build script to run only one compile job at a time. You can do this
+by setting the 'YCM_CORES' environment variable to '1'. Example:
+>
+ YCM_CORES=1 ./install.py --clang-completer
+<
+-------------------------------------------------------------------------------
+ *Ctrl-sub-C*
+I get weird errors when I press 'Ctrl-C' in Vim ~
+
+_Never_ use 'Ctrl-C' in Vim.
+
+Using 'Ctrl-C' to exit insert mode in Vim is a bad idea. The main issue here is
+that 'Ctrl-C' in Vim doesn't just leave insert mode, it leaves it without
+triggering 'InsertLeave' autocommands (as per Vim docs). This is a bad idea and
+is likely to break many other things and not just YCM.
+
+Bottom line, if you use 'Ctrl-C' to exit insert mode in Vim, you're gonna have
+a bad time.
+
+If pressing '<esc>' is too annoying (agreed, it is), we suggest mapping it to
+something more convenient. On a QWERTY keyboard, a good pick for the '<esc>'
+map is 'inoremap jk <Esc>'. This is right on the home row, it's an incredibly
+rare digraph in English and if you ever need to type those two chars in
+sequence in insert mode, you just type 'j', then wait 500ms, then type 'k'.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-why-did-ycm-stop-using-syntastic-for-diagnostics-display*
+Why did YCM stop using Syntastic for diagnostics display? ~
+
+Previously, YCM would send any diagnostics it would receive from the libclang
+semantic engine to Syntastic for display as signs in the gutter, red squiggles
+etc. Today, YCM uses its own code to do that.
+
+Using Syntastic for this was always a kludge. Syntastic assumes its "checker"
+plugins behave in a certain way; those assumptions have never fit YCM. For
+instance, YCM continuously recompiles your code in the background for C-family
+languages and tries to push new diagnostics to the user as fast as possible,
+even while the user types.
+
+Syntastic assumes that a checker only runs on file save ("active" mode) or even
+less frequently, when the user explicitly invokes it ("passive" mode). This
+mismatch in assumptions causes performance problems since Syntastic code isn't
+optimized for this use case of constant diagnostic refreshing.
+
+Poor support for this use case also led to crash bugs in Vim caused by
+Syntastic-Vim interactions (issue #593 [58]) and other problems, like random
+Vim flickering. Attempts were made to resolve these issues in Syntastic, but
+ultimately some of them failed (for various reasons).
+
+Implementing diagnostic display code directly in YCM resolves all of these
+problems. Performance also improved substantially since the relevant code is
+now written in Python instead of VimScript (which is very slow) and is tailored
+only for YCM's use-cases. We were also able to introduce new features in this
+area since we're now not limited to the Syntastic checker API.
+
+We've tried to implement this in the most backwards-compatible way possible;
+YCM options that control diagnostic display fall back to Syntastic options that
+control the same concepts if the user has those set.
+
+Still, some Syntastic-specific configuration you might have had might not be
+supported by the new code. Please file issues on the tracker in such cases; if
+we find the request to be reasonable, we'll find a way to address it.
+
+-------------------------------------------------------------------------------
+ *youcompleteme-completion-doesnt-work-with-c-standard-library-headers*
+Completion doesn't work with the C++ standard library headers ~
+
+This is caused by an issue with libclang that only affects some operating
+systems. Compiling with 'clang' the binary will use the correct default header
+search paths but compiling with 'libclang.so' (which YCM uses) does not.
+
+Mac OS X is normally affected, but there's a workaround in YCM for that
+specific OS. If you're not running that OS but still have the same problem,
+continue reading.
+
+The workaround is to call 'echo | clang -v -E -x c++ -' and look at the paths
+under the '#include <...> search starts here:' heading. You should take those
+paths, prepend '-isystem' to each individual path and append them all to the
+list of flags you return from your 'FlagsForFile' function in your
+'.ycm_extra_conf.py' file.
+
+See issue #303 [59] for details.
+
+-------------------------------------------------------------------------------
+ *.tern-sub-project*
+When I open a JavaScript file, I get an annoying warning about '.tern- ~
+project' file ~
+
+Take a look at the instructions for using the JavaScript completer.
+
+If this is still really annoying, and you have a good reason not to have a
+'.tern-project' file, create an empty '.tern-config' file in your home
+directory and YCM will stop complaining.
+
+-------------------------------------------------------------------------------
+*R6034-An-application-has-made-an-attempt-to-load-the-C-runtime-library-incorrectly.*
+When I start vim I get a runtime error saying 'R6034 An application has made ~
+an attempt to load the C runtime library incorrectly.' ~
+
+CMake and other things seem to screw up the PATH with their own msvcrXX.dll
+versions. [60] Add the following to the very top of your vimrc to remove these
+entries from the path.
+>
+ python << EOF
+ import os
+ import re
+ path = os.environ['PATH'].split(';')
+
+ def contains_msvcr_lib(folder):
+ try:
+ for item in os.listdir(folder):
+ if re.match(r'msvcr\d+\.dll', item):
+ return True
+ except:
+ pass
+ return False
+
+ path = [folder for folder in path if not contains_msvcr_lib(folder)]
+ os.environ['PATH'] = ';'.join(path)
+ EOF
+<
+-------------------------------------------------------------------------------
+ *youcompleteme-i-hear-that-ycm-only-supports-python-2-is-that-true*
+I hear that YCM only supports Python 2, is that true? ~
+
+**No.** Both the Vim client and the ycmd server [39] run on Python 2 or 3. If
+you work on a Python 3 project, you may need to set |g:ycm_python_binary_path|
+to the Python interpreter you use for your project to get completions for that
+version of Python.
+
+-------------------------------------------------------------------------------
+*E887:-Sorry-this-command-is-disabled-the-Python-s-site-module-could-not-be-loaded*
+On Windows I get "E887: Sorry, this command is disabled, the Python's site ~
+module could not be loaded" ~
+
+If you are running vim on Windows with Python 2.7.11, this is likely caused by
+a bug [61]. Follow this workaround [62] or use a different version (Python
+2.7.9 does not suffer from the bug).
+
+-------------------------------------------------------------------------------
+ *youcompleteme-i-cant-complete-python-packages-in-virtual-environment.*
+I can't complete python packages in a virtual environment. ~
+
+This means that the Python used to run JediHTTP [7] is not the Python of the
+virtual environment you're in. To resolve this you either set
+|g:ycm_python_binary_path| to the absolute path of the Python binary in your
+virtual environment or since virtual environment will put that Python
+executable first in your PATH when the virtual environment is active then if
+you set |g:ycm_python_binary_path| to just "'python'" it will be found as the
+first Python and used to run JediHTTP [7].
+
+===============================================================================
+ *youcompleteme-contributor-code-of-conduct*
+Contributor Code of Conduct ~
+
+Please note that this project is released with a Contributor Code of Conduct
+[63]. By participating in this project you agree to abide by its terms.
+
+===============================================================================
+ *youcompleteme-contact*
+Contact ~
+
+If you have questions about the plugin or need help, please use the ycm-users
+[57] mailing list.
+
+If you have bug reports or feature suggestions, please use the issue tracker
+[64].
+
+The latest version of the plugin is available at
+http://valloric.github.io/YouCompleteMe/.
+
+The author's homepage is http://val.markovic.io.
+
+===============================================================================
+ *youcompleteme-license*
+License ~
+
+This software is licensed under the GPL v3 license [65]. © 2015-2016
+YouCompleteMe contributors
+
+===============================================================================
+ *youcompleteme-references*
+References ~
+
+[1] https://travis-ci.org/Valloric/YouCompleteMe
+[2] https://travis-ci.org/Valloric/YouCompleteMe.svg?branch=master
+[3] https://ci.appveyor.com/project/Valloric/YouCompleteMe
+[4] https://ci.appveyor.com/api/projects/status/ag9uqwi8s6btwjd8/branch/master?svg=true
+[5] http://clang.llvm.org/
+[6] https://github.com/davidhalter/jedi
+[7] https://github.com/vheon/JediHTTP
+[8] https://github.com/OmniSharp/omnisharp-server
+[9] https://github.com/nsf/gocode
+[10] https://github.com/Manishearth/godef
+[11] https://github.com/Microsoft/TypeScript/tree/master/src/server
+[12] http://ternjs.net
+[13] https://github.com/phildawes/racer
+[14] http://i.imgur.com/0OP4ood.gif
+[15] https://en.wikipedia.org/wiki/Subsequence
+[16] https://github.com/scrooloose/syntastic
+[17] https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt
+[18] https://github.com/macvim-dev/macvim/releases
+[19] https://github.com/VundleVim/Vundle.vim#about
+[20] http://brew.sh
+[21] https://cmake.org/download/
+[22] http://www.mono-project.com/docs/getting-started/install/mac/
+[23] https://golang.org/doc/install
+[24] https://docs.npmjs.com/getting-started/installing-node
+[25] https://www.rust-lang.org/
+[26] https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
+[27] http://www.mono-project.com/docs/getting-started/install/linux/#debian-ubuntu-and-derivatives
+[28] http://www.mono-project.com/docs/getting-started/install/linux/#centos-7-fedora-19-and-later-and-derivatives
+[29] https://bintray.com/micbou/generic/vim
+[30] https://www.python.org/downloads/windows/
+[31] https://www.visualstudio.com/products/free-developer-offers-vs.aspx
+[32] http://www.7-zip.org/download.html
+[33] http://stackoverflow.com/questions/6319274/how-do-i-run-msbuild-from-the-command-line-using-windows-sdk-7-1
+[34] https://github.com/tpope/vim-pathogen#pathogenvim
+[35] http://vimhelp.appspot.com/starting.txt.html#vimrc
+[36] http://llvm.org/releases/download.html
+[37] http://www.mono-project.com/docs/getting-started/install/
+[38] https://github.com/Valloric/YouCompleteMe#options
+[39] https://github.com/Valloric/ycmd
+[40] https://github.com/Valloric/ycmd/blob/master/cpp/ycm/.ycm_extra_conf.py
+[41] http://clang.llvm.org/docs/JSONCompilationDatabase.html
+[42] https://github.com/rizsotto/Bear
+[43] https://github.com/rdnetto/YCM-Generator
+[44] http://ternjs.net/doc/manual.html#configuration
+[45] http://ternjs.net/doc/manual.html#server
+[46] http://ternjs.net/doc/manual.html#plugins
+[47] https://www.rust-lang.org/downloads.html
+[48] http://eclim.org/
+[49] https://github.com/Valloric/ycmd/blob/master/ycmd/completers/completer.py
+[50] https://github.com/Valloric/ListToggle
+[51] https://github.com/itchyny/lightline.vim
+[52] http://ctags.sourceforge.net/FORMAT
+[53] https://docs.python.org/2/library/re.html#regular-expression-syntax
+[54] https://github.com/Valloric/YouCompleteMe/issues/18
+[55] http://ctags.sourceforge.net/
+[56] https://github.com/Raimondi/delimitMate
+[57] https://groups.google.com/forum/?hl=en#!forum/ycm-users
+[58] https://github.com/Valloric/YouCompleteMe/issues/593
+[59] https://github.com/Valloric/YouCompleteMe/issues/303
+[60] http://stackoverflow.com/questions/14552348/runtime-error-r6034-in-embedded-python-application/34696022
+[61] https://github.com/vim/vim/issues/717
+[62] https://github.com/vim/vim-win32-installer/blob/master/appveyor.bat#L90
+[63] https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md
+[64] https://github.com/Valloric/YouCompleteMe/issues?state=open
+[65] http://www.gnu.org/copyleft/gpl.html
+
+vim: ft=help
diff --git a/vim/bundle/YouCompleteMe/install.py b/vim/bundle/YouCompleteMe/install.py
new file mode 100755
index 0000000..36bb70e
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/install.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env python
+
+from __future__ import print_function
+from __future__ import division
+from __future__ import unicode_literals
+from __future__ import absolute_import
+
+import os
+import subprocess
+import sys
+import os.path as p
+import glob
+
+PY_MAJOR, PY_MINOR = sys.version_info[ 0 : 2 ]
+if not ( ( PY_MAJOR == 2 and PY_MINOR >= 6 ) or
+ ( PY_MAJOR == 3 and PY_MINOR >= 3 ) or
+ PY_MAJOR > 3 ):
+ sys.exit( 'YouCompleteMe requires Python >= 2.6 or >= 3.3; '
+ 'your version of Python is ' + sys.version )
+
+DIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) )
+DIR_OF_OLD_LIBS = p.join( DIR_OF_THIS_SCRIPT, 'python' )
+
+
+def Main():
+ build_file = p.join( DIR_OF_THIS_SCRIPT, 'third_party', 'ycmd', 'build.py' )
+
+ if not p.isfile( build_file ):
+ sys.exit( 'File ' + build_file + ' does not exist; you probably forgot '
+ 'to run:\n\tgit submodule update --init --recursive\n\n' )
+
+ python_binary = sys.executable
+ subprocess.check_call( [ python_binary, build_file ] + sys.argv[1:] )
+
+ # Remove old YCM libs if present so that YCM can start.
+ old_libs = (
+ glob.glob( p.join( DIR_OF_OLD_LIBS, '*ycm_core.*' ) ) +
+ glob.glob( p.join( DIR_OF_OLD_LIBS, '*ycm_client_support.*' ) ) +
+ glob.glob( p.join( DIR_OF_OLD_LIBS, '*clang*.*') ) )
+ for lib in old_libs:
+ os.remove( lib )
+
+if __name__ == "__main__":
+ Main()
diff --git a/vim/bundle/YouCompleteMe/install.sh b/vim/bundle/YouCompleteMe/install.sh
new file mode 100755
index 0000000..8c9c2fd
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/install.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+echo "WARNING: this script is deprecated. Use the install.py script instead." 1>&2
+
+
+SCRIPT_DIR=$(dirname $0 || exit $?)
+
+command_exists() {
+ command -v "$1" >/dev/null 2>&1 ;
+}
+
+PYTHON_BINARY=python
+if command_exists python2; then
+ PYTHON_BINARY=python2
+fi
+
+$PYTHON_BINARY "$SCRIPT_DIR/install.py" "$@" || exit $?
diff --git a/vim/bundle/YouCompleteMe/plugin/youcompleteme.vim b/vim/bundle/YouCompleteMe/plugin/youcompleteme.vim
new file mode 100644
index 0000000..4aa5c33
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/plugin/youcompleteme.vim
@@ -0,0 +1,138 @@
+" Copyright (C) 2011, 2012 Google Inc.
+"
+" This file is part of YouCompleteMe.
+"
+" YouCompleteMe is free software: you can redistribute it and/or modify
+" it under the terms of the GNU General Public License as published by
+" the Free Software Foundation, either version 3 of the License, or
+" (at your option) any later version.
+"
+" YouCompleteMe is distributed in the hope that it will be useful,
+" but WITHOUT ANY WARRANTY; without even the implied warranty of
+" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+" GNU General Public License for more details.
+"
+" You should have received a copy of the GNU General Public License
+" along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+" This is basic vim plugin boilerplate
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! s:restore_cpo()
+ let &cpo = s:save_cpo
+ unlet s:save_cpo
+endfunction
+
+if exists( "g:loaded_youcompleteme" )
+ call s:restore_cpo()
+ finish
+elseif v:version < 703 || (v:version == 703 && !has('patch598'))
+ echohl WarningMsg |
+ \ echomsg "YouCompleteMe unavailable: requires Vim 7.3.598+" |
+ \ echohl None
+ call s:restore_cpo()
+ finish
+elseif !has( 'python' ) && !has( 'python3' )
+ echohl WarningMsg |
+ \ echomsg "YouCompleteMe unavailable: requires Vim compiled with " .
+ \ "Python (2.6+ or 3.3+) support" |
+ \ echohl None
+ call s:restore_cpo()
+ finish
+endif
+
+let g:loaded_youcompleteme = 1
+
+" NOTE: Most defaults are in third_party/ycmd/ycmd/default_settings.json. They
+" are loaded into Vim globals with the 'ycm_' prefix if such a key does not
+" already exist; thus, the user can override the defaults.
+" The only defaults that are here are the ones that are only relevant to the YCM
+" Vim client and not the ycmd server.
+
+let g:ycm_allow_changing_updatetime =
+ \ get( g:, 'ycm_allow_changing_updatetime', 1 )
+
+let g:ycm_open_loclist_on_ycm_diags =
+ \ get( g:, 'ycm_open_loclist_on_ycm_diags', 1 )
+
+let g:ycm_add_preview_to_completeopt =
+ \ get( g:, 'ycm_add_preview_to_completeopt', 0 )
+
+let g:ycm_autoclose_preview_window_after_completion =
+ \ get( g:, 'ycm_autoclose_preview_window_after_completion', 0 )
+
+let g:ycm_autoclose_preview_window_after_insertion =
+ \ get( g:, 'ycm_autoclose_preview_window_after_insertion', 0 )
+
+let g:ycm_key_list_select_completion =
+ \ get( g:, 'ycm_key_list_select_completion', ['<TAB>', '<Down>'] )
+
+let g:ycm_key_list_previous_completion =
+ \ get( g:, 'ycm_key_list_previous_completion', ['<S-TAB>', '<Up>'] )
+
+let g:ycm_key_invoke_completion =
+ \ get( g:, 'ycm_key_invoke_completion', '<C-Space>' )
+
+let g:ycm_key_detailed_diagnostics =
+ \ get( g:, 'ycm_key_detailed_diagnostics', '<leader>d' )
+
+let g:ycm_cache_omnifunc =
+ \ get( g:, 'ycm_cache_omnifunc', 1 )
+
+let g:ycm_server_log_level =
+ \ get( g:, 'ycm_server_log_level', 'info' )
+
+let g:ycm_server_keep_logfiles =
+ \ get( g:, 'ycm_server_keep_logfiles', 0 )
+
+let g:ycm_extra_conf_vim_data =
+ \ get( g:, 'ycm_extra_conf_vim_data', [] )
+
+let g:ycm_server_python_interpreter =
+ \ get( g:, 'ycm_server_python_interpreter',
+ \ get( g:, 'ycm_path_to_python_interpreter', '' ) )
+
+let g:ycm_show_diagnostics_ui =
+ \ get( g:, 'ycm_show_diagnostics_ui',
+ \ get( g:, 'ycm_register_as_syntastic_checker', 1 ) )
+
+let g:ycm_enable_diagnostic_signs =
+ \ get( g:, 'ycm_enable_diagnostic_signs',
+ \ get( g:, 'syntastic_enable_signs', 1 ) )
+
+let g:ycm_enable_diagnostic_highlighting =
+ \ get( g:, 'ycm_enable_diagnostic_highlighting',
+ \ get( g:, 'syntastic_enable_highlighting', 1 ) )
+
+let g:ycm_echo_current_diagnostic =
+ \ get( g:, 'ycm_echo_current_diagnostic',
+ \ get( g:, 'syntastic_echo_current_error', 1 ) )
+
+let g:ycm_always_populate_location_list =
+ \ get( g:, 'ycm_always_populate_location_list',
+ \ get( g:, 'syntastic_always_populate_loc_list', 0 ) )
+
+let g:ycm_error_symbol =
+ \ get( g:, 'ycm_error_symbol',
+ \ get( g:, 'syntastic_error_symbol', '>>' ) )
+
+let g:ycm_warning_symbol =
+ \ get( g:, 'ycm_warning_symbol',
+ \ get( g:, 'syntastic_warning_symbol', '>>' ) )
+
+let g:ycm_goto_buffer_command =
+ \ get( g:, 'ycm_goto_buffer_command', 'same-buffer' )
+
+let g:ycm_disable_for_files_larger_than_kb =
+ \ get( g:, 'ycm_disable_for_files_larger_than_kb', 1000 )
+
+" On-demand loading. Let's use the autoload folder and not slow down vim's
+" startup procedure.
+augroup youcompletemeStart
+ autocmd!
+ autocmd VimEnter * call youcompleteme#Enable()
+augroup END
+
+" This is basic vim plugin boilerplate
+call s:restore_cpo()
diff --git a/vim/bundle/YouCompleteMe/print_todos.sh b/vim/bundle/YouCompleteMe/print_todos.sh
new file mode 100755
index 0000000..c07471c
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/print_todos.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+ag \
+--ignore gmock \
+--ignore jedi/ \
+--ignore OmniSharpServer \
+--ignore testdata \
+TODO \
+third_party/ycmd/cpp/ycm python autoload plugin
diff --git a/vim/bundle/YouCompleteMe/python/test_requirements.txt b/vim/bundle/YouCompleteMe/python/test_requirements.txt
new file mode 100644
index 0000000..b67c013
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/test_requirements.txt
@@ -0,0 +1,6 @@
+flake8>=2.0
+mock>=1.0.1
+nose>=1.3.0
+PyHamcrest>=1.8.0
+# This needs to be kept in sync with submodule checkout in third_party/ycmd/third_party
+future==0.15.2
diff --git a/vim/bundle/YouCompleteMe/python/ycm/__init__.py b/vim/bundle/YouCompleteMe/python/ycm/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/__init__.py
diff --git a/vim/bundle/YouCompleteMe/python/ycm/base.py b/vim/bundle/YouCompleteMe/python/ycm/base.py
new file mode 100644
index 0000000..4de4c0b
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/base.py
@@ -0,0 +1,175 @@
+# Copyright (C) 2011, 2012 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from future.utils import iteritems
+from ycm import vimsupport
+from ycmd import user_options_store
+from ycmd import request_wrap
+from ycmd import identifier_utils
+
+YCM_VAR_PREFIX = 'ycm_'
+
+
+def BuildServerConf():
+ """Builds a dictionary mapping YCM Vim user options to values. Option names
+ don't have the 'ycm_' prefix."""
+ # We only evaluate the keys of the vim globals and not the whole dictionary
+ # to avoid unicode issues.
+ # See https://github.com/Valloric/YouCompleteMe/pull/2151 for details.
+ keys = vimsupport.GetVimGlobalsKeys()
+ server_conf = {}
+ for key in keys:
+ if not key.startswith( YCM_VAR_PREFIX ):
+ continue
+ new_key = key[ len( YCM_VAR_PREFIX ): ]
+ new_value = vimsupport.VimExpressionToPythonType( 'g:' + key )
+ server_conf[ new_key ] = new_value
+
+ return server_conf
+
+
+def LoadJsonDefaultsIntoVim():
+ defaults = user_options_store.DefaultOptions()
+ for key, value in iteritems( defaults ):
+ new_key = 'g:ycm_' + key
+ if not vimsupport.VariableExists( new_key ):
+ vimsupport.SetVariableValue( new_key, value )
+
+
+def CompletionStartColumn():
+ return ( request_wrap.CompletionStartColumn(
+ vimsupport.CurrentLineContents(),
+ vimsupport.CurrentColumn() + 1,
+ vimsupport.CurrentFiletypes()[ 0 ] ) - 1 )
+
+
+def CurrentIdentifierFinished():
+ current_column = vimsupport.CurrentColumn()
+ previous_char_index = current_column - 1
+ if previous_char_index < 0:
+ return True
+ line = vimsupport.CurrentLineContents()
+ filetype = vimsupport.CurrentFiletypes()[ 0 ]
+ regex = identifier_utils.IdentifierRegexForFiletype( filetype )
+
+ for match in regex.finditer( line ):
+ if match.end() == previous_char_index:
+ return True
+ # If the whole line is whitespace, that means the user probably finished an
+ # identifier on the previous line.
+ return line[ : current_column ].isspace()
+
+
+def LastEnteredCharIsIdentifierChar():
+ current_column = vimsupport.CurrentColumn()
+ if current_column - 1 < 0:
+ return False
+ line = vimsupport.CurrentLineContents()
+ filetype = vimsupport.CurrentFiletypes()[ 0 ]
+ return (
+ identifier_utils.StartOfLongestIdentifierEndingAtIndex(
+ line, current_column, filetype ) != current_column )
+
+
+def AdjustCandidateInsertionText( candidates ):
+ """This function adjusts the candidate insertion text to take into account the
+ text that's currently in front of the cursor.
+
+ For instance ('|' represents the cursor):
+ 1. Buffer state: 'foo.|bar'
+ 2. A completion candidate of 'zoobar' is shown and the user selects it.
+ 3. Buffer state: 'foo.zoobar|bar' instead of 'foo.zoo|bar' which is what the
+ user wanted.
+
+ This function changes candidates to resolve that issue.
+
+ It could be argued that the user actually wants the final buffer state to be
+ 'foo.zoobar|' (the cursor at the end), but that would be much more difficult
+ to implement and is probably not worth doing.
+ """
+
+ def NewCandidateInsertionText( to_insert, text_after_cursor ):
+ overlap_len = OverlapLength( to_insert, text_after_cursor )
+ if overlap_len:
+ return to_insert[ :-overlap_len ]
+ return to_insert
+
+ text_after_cursor = vimsupport.TextAfterCursor()
+ if not text_after_cursor:
+ return candidates
+
+ new_candidates = []
+ for candidate in candidates:
+ if isinstance( candidate, dict ):
+ new_candidate = candidate.copy()
+
+ if 'abbr' not in new_candidate:
+ new_candidate[ 'abbr' ] = new_candidate[ 'word' ]
+
+ new_candidate[ 'word' ] = NewCandidateInsertionText(
+ new_candidate[ 'word' ],
+ text_after_cursor )
+
+ new_candidates.append( new_candidate )
+
+ elif isinstance( candidate, str ) or isinstance( candidate, bytes ):
+ new_candidates.append(
+ { 'abbr': candidate,
+ 'word': NewCandidateInsertionText( candidate, text_after_cursor ) } )
+ return new_candidates
+
+
+def OverlapLength( left_string, right_string ):
+ """Returns the length of the overlap between two strings.
+ Example: "foo baro" and "baro zoo" -> 4
+ """
+ left_string_length = len( left_string )
+ right_string_length = len( right_string )
+
+ if not left_string_length or not right_string_length:
+ return 0
+
+ # Truncate the longer string.
+ if left_string_length > right_string_length:
+ left_string = left_string[ -right_string_length: ]
+ elif left_string_length < right_string_length:
+ right_string = right_string[ :left_string_length ]
+
+ if left_string == right_string:
+ return min( left_string_length, right_string_length )
+
+ # Start by looking for a single character match
+ # and increase length until no match is found.
+ best = 0
+ length = 1
+ while True:
+ pattern = left_string[ -length: ]
+ found = right_string.find( pattern )
+ if found < 0:
+ return best
+ length += found
+ if left_string[ -length: ] == right_string[ :length ]:
+ best = length
+ length += 1
diff --git a/vim/bundle/YouCompleteMe/python/ycm/client/__init__.py b/vim/bundle/YouCompleteMe/python/ycm/client/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/client/__init__.py
diff --git a/vim/bundle/YouCompleteMe/python/ycm/client/base_request.py b/vim/bundle/YouCompleteMe/python/ycm/client/base_request.py
new file mode 100644
index 0000000..ffc3fac
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/client/base_request.py
@@ -0,0 +1,244 @@
+# Copyright (C) 2013 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+import requests
+import urllib.parse
+import json
+from future.utils import native
+from base64 import b64decode, b64encode
+from retries import retries
+from requests_futures.sessions import FuturesSession
+from ycm.unsafe_thread_pool_executor import UnsafeThreadPoolExecutor
+from ycm import vimsupport
+from ycmd.utils import ToBytes
+from ycmd.hmac_utils import CreateRequestHmac, CreateHmac, SecureBytesEqual
+from ycmd.responses import ServerError, UnknownExtraConf
+
+_HEADERS = {'content-type': 'application/json'}
+_EXECUTOR = UnsafeThreadPoolExecutor( max_workers = 30 )
+# Setting this to None seems to screw up the Requests/urllib3 libs.
+_DEFAULT_TIMEOUT_SEC = 30
+_HMAC_HEADER = 'x-ycm-hmac'
+
+
+class BaseRequest( object ):
+
+ def __init__( self ):
+ pass
+
+
+ def Start( self ):
+ pass
+
+
+ def Done( self ):
+ return True
+
+
+ def Response( self ):
+ return {}
+
+ # This method blocks
+ # |timeout| is num seconds to tolerate no response from server before giving
+ # up; see Requests docs for details (we just pass the param along).
+ @staticmethod
+ def GetDataFromHandler( handler, timeout = _DEFAULT_TIMEOUT_SEC ):
+ return JsonFromFuture( BaseRequest._TalkToHandlerAsync( '',
+ handler,
+ 'GET',
+ timeout ) )
+
+
+ # This is the blocking version of the method. See below for async.
+ # |timeout| is num seconds to tolerate no response from server before giving
+ # up; see Requests docs for details (we just pass the param along).
+ @staticmethod
+ def PostDataToHandler( data, handler, timeout = _DEFAULT_TIMEOUT_SEC ):
+ return JsonFromFuture( BaseRequest.PostDataToHandlerAsync( data,
+ handler,
+ timeout ) )
+
+
+ # This returns a future! Use JsonFromFuture to get the value.
+ # |timeout| is num seconds to tolerate no response from server before giving
+ # up; see Requests docs for details (we just pass the param along).
+ @staticmethod
+ def PostDataToHandlerAsync( data, handler, timeout = _DEFAULT_TIMEOUT_SEC ):
+ return BaseRequest._TalkToHandlerAsync( data, handler, 'POST', timeout )
+
+
+ # This returns a future! Use JsonFromFuture to get the value.
+ # |method| is either 'POST' or 'GET'.
+ # |timeout| is num seconds to tolerate no response from server before giving
+ # up; see Requests docs for details (we just pass the param along).
+ @staticmethod
+ def _TalkToHandlerAsync( data,
+ handler,
+ method,
+ timeout = _DEFAULT_TIMEOUT_SEC ):
+ def SendRequest( data, handler, method, timeout ):
+ request_uri = _BuildUri( handler )
+ if method == 'POST':
+ sent_data = _ToUtf8Json( data )
+ return BaseRequest.session.post(
+ request_uri,
+ data = sent_data,
+ headers = BaseRequest._ExtraHeaders( method,
+ request_uri,
+ sent_data ),
+ timeout = timeout )
+ if method == 'GET':
+ return BaseRequest.session.get(
+ request_uri,
+ headers = BaseRequest._ExtraHeaders( method, request_uri ),
+ timeout = timeout )
+
+ @retries( 5, delay = 0.5, backoff = 1.5 )
+ def DelayedSendRequest( data, handler, method ):
+ request_uri = _BuildUri( handler )
+ if method == 'POST':
+ sent_data = _ToUtf8Json( data )
+ return requests.post(
+ request_uri,
+ data = sent_data,
+ headers = BaseRequest._ExtraHeaders( method,
+ request_uri,
+ sent_data ) )
+ if method == 'GET':
+ return requests.get(
+ request_uri,
+ headers = BaseRequest._ExtraHeaders( method, request_uri ) )
+
+ if not _CheckServerIsHealthyWithCache():
+ return _EXECUTOR.submit( DelayedSendRequest, data, handler, method )
+
+ return SendRequest( data, handler, method, timeout )
+
+
+ @staticmethod
+ def _ExtraHeaders( method, request_uri, request_body = None ):
+ if not request_body:
+ request_body = bytes( b'' )
+ headers = dict( _HEADERS )
+ headers[ _HMAC_HEADER ] = b64encode(
+ CreateRequestHmac( ToBytes( method ),
+ ToBytes( urllib.parse.urlparse( request_uri ).path ),
+ request_body,
+ BaseRequest.hmac_secret ) )
+ return headers
+
+ session = FuturesSession( executor = _EXECUTOR )
+ server_location = ''
+ hmac_secret = ''
+
+
+def BuildRequestData( include_buffer_data = True ):
+ line, column = vimsupport.CurrentLineAndColumn()
+ filepath = vimsupport.GetCurrentBufferFilepath()
+ request_data = {
+ 'line_num': line + 1,
+ 'column_num': column + 1,
+ 'filepath': filepath
+ }
+
+ if include_buffer_data:
+ request_data[ 'file_data' ] = vimsupport.GetUnsavedAndCurrentBufferData()
+
+ return request_data
+
+
+def JsonFromFuture( future ):
+ response = future.result()
+ _ValidateResponseObject( response )
+ if response.status_code == requests.codes.server_error:
+ raise MakeServerException( response.json() )
+
+ # We let Requests handle the other status types, we only handle the 500
+ # error code.
+ response.raise_for_status()
+
+ if response.text:
+ return response.json()
+ return None
+
+
+def HandleServerException( exception ):
+ serialized_exception = str( exception )
+
+ # We ignore the exception about the file already being parsed since it comes
+ # up often and isn't something that's actionable by the user.
+ if 'already being parsed' in serialized_exception:
+ return
+ vimsupport.PostMultiLineNotice( serialized_exception )
+
+
+def _ToUtf8Json( data ):
+ return ToBytes( json.dumps( data ) if data else None )
+
+
+def _ValidateResponseObject( response ):
+ our_hmac = CreateHmac( response.content, BaseRequest.hmac_secret )
+ their_hmac = ToBytes( b64decode( response.headers[ _HMAC_HEADER ] ) )
+ if not SecureBytesEqual( our_hmac, their_hmac ):
+ raise RuntimeError( 'Received invalid HMAC for response!' )
+ return True
+
+
+def _BuildUri( handler ):
+ return native( ToBytes( urllib.parse.urljoin( BaseRequest.server_location,
+ handler ) ) )
+
+
+SERVER_HEALTHY = False
+
+
+def _CheckServerIsHealthyWithCache():
+ global SERVER_HEALTHY
+
+ def _ServerIsHealthy():
+ request_uri = _BuildUri( 'healthy' )
+ response = requests.get( request_uri,
+ headers = BaseRequest._ExtraHeaders(
+ 'GET', request_uri, bytes( b'' ) ) )
+ _ValidateResponseObject( response )
+ response.raise_for_status()
+ return response.json()
+
+ if SERVER_HEALTHY:
+ return True
+
+ try:
+ SERVER_HEALTHY = _ServerIsHealthy()
+ return SERVER_HEALTHY
+ except:
+ return False
+
+
+def MakeServerException( data ):
+ if data[ 'exception' ][ 'TYPE' ] == UnknownExtraConf.__name__:
+ return UnknownExtraConf( data[ 'exception' ][ 'extra_conf_file' ] )
+
+ return ServerError( '{0}: {1}'.format( data[ 'exception' ][ 'TYPE' ],
+ data[ 'message' ] ) )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/client/command_request.py b/vim/bundle/YouCompleteMe/python/ycm/client/command_request.py
new file mode 100644
index 0000000..6c5bc66
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/client/command_request.py
@@ -0,0 +1,153 @@
+# Copyright (C) 2013 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from requests.exceptions import ReadTimeout
+
+from ycmd.responses import ServerError
+from ycm.client.base_request import ( BaseRequest, BuildRequestData,
+ HandleServerException )
+from ycm import vimsupport
+from ycmd.utils import ToUnicode
+
+
+def _EnsureBackwardsCompatibility( arguments ):
+ if arguments and arguments[ 0 ] == 'GoToDefinitionElseDeclaration':
+ arguments[ 0 ] = 'GoTo'
+ return arguments
+
+
+class CommandRequest( BaseRequest ):
+ def __init__( self, arguments, completer_target = None ):
+ super( CommandRequest, self ).__init__()
+ self._arguments = _EnsureBackwardsCompatibility( arguments )
+ self._completer_target = ( completer_target if completer_target
+ else 'filetype_default' )
+ self._response = None
+
+
+ def Start( self ):
+ request_data = BuildRequestData()
+ request_data.update( {
+ 'completer_target': self._completer_target,
+ 'command_arguments': self._arguments
+ } )
+ try:
+ self._response = self.PostDataToHandler( request_data,
+ 'run_completer_command' )
+ except ( ServerError, ReadTimeout ) as e:
+ HandleServerException( e )
+
+
+ def Response( self ):
+ return self._response
+
+
+ def RunPostCommandActionsIfNeeded( self ):
+ if not self.Done() or self._response is None:
+ return
+
+ # If not a dictionary or a list, the response is necessarily a
+ # scalar: boolean, number, string, etc. In this case, we print
+ # it to the user.
+ if not isinstance( self._response, ( dict, list ) ):
+ return self._HandleBasicResponse()
+
+ if 'fixits' in self._response:
+ return self._HandleFixitResponse()
+
+ if 'message' in self._response:
+ return self._HandleMessageResponse()
+
+ if 'detailed_info' in self._response:
+ return self._HandleDetailedInfoResponse()
+
+ # The only other type of response we understand is GoTo, and that is the
+ # only one that we can't detect just by inspecting the response (it should
+ # either be a single location or a list)
+ return self._HandleGotoResponse()
+
+
+ def _HandleGotoResponse( self ):
+ if isinstance( self._response, list ):
+ vimsupport.SetQuickFixList(
+ [ _BuildQfListItem( x ) for x in self._response ],
+ focus = True,
+ autoclose = True )
+ else:
+ vimsupport.JumpToLocation( self._response[ 'filepath' ],
+ self._response[ 'line_num' ],
+ self._response[ 'column_num' ] )
+
+
+ def _HandleFixitResponse( self ):
+ if not len( self._response[ 'fixits' ] ):
+ vimsupport.EchoText( "No fixits found for current line" )
+ else:
+ chunks = self._response[ 'fixits' ][ 0 ][ 'chunks' ]
+ try:
+ vimsupport.ReplaceChunks( chunks )
+ except RuntimeError as e:
+ vimsupport.PostMultiLineNotice( str( e ) )
+
+
+ def _HandleBasicResponse( self ):
+ vimsupport.EchoText( self._response )
+
+
+ def _HandleMessageResponse( self ):
+ vimsupport.EchoText( self._response[ 'message' ] )
+
+
+ def _HandleDetailedInfoResponse( self ):
+ vimsupport.WriteToPreviewWindow( self._response[ 'detailed_info' ] )
+
+
+def SendCommandRequest( arguments, completer ):
+ request = CommandRequest( arguments, completer )
+ # This is a blocking call.
+ request.Start()
+ request.RunPostCommandActionsIfNeeded()
+ return request.Response()
+
+
+def _BuildQfListItem( goto_data_item ):
+ qf_item = {}
+ if 'filepath' in goto_data_item:
+ qf_item[ 'filename' ] = ToUnicode( goto_data_item[ 'filepath' ] )
+ if 'description' in goto_data_item:
+ qf_item[ 'text' ] = ToUnicode( goto_data_item[ 'description' ] )
+ if 'line_num' in goto_data_item:
+ qf_item[ 'lnum' ] = goto_data_item[ 'line_num' ]
+ if 'column_num' in goto_data_item:
+ # ycmd returns columns 1-based, and QuickFix lists require "byte offsets".
+ # See :help getqflist and equivalent comment in
+ # vimsupport.ConvertDiagnosticsToQfList.
+ #
+ # When the Vim help says "byte index", it really means "1-based column
+ # number" (which is somewhat confusing). :help getqflist states "first
+ # column is 1".
+ qf_item[ 'col' ] = goto_data_item[ 'column_num' ]
+
+ return qf_item
diff --git a/vim/bundle/YouCompleteMe/python/ycm/client/completer_available_request.py b/vim/bundle/YouCompleteMe/python/ycm/client/completer_available_request.py
new file mode 100644
index 0000000..3a480ca
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/client/completer_available_request.py
@@ -0,0 +1,58 @@
+# Copyright (C) 2013 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from requests.exceptions import ReadTimeout
+
+from ycm.client.base_request import ( BaseRequest, BuildRequestData,
+ HandleServerException )
+from ycmd.responses import ServerError
+
+
+class CompleterAvailableRequest( BaseRequest ):
+ def __init__( self, filetypes ):
+ super( CompleterAvailableRequest, self ).__init__()
+ self.filetypes = filetypes
+ self._response = None
+
+
+ def Start( self ):
+ request_data = BuildRequestData()
+ request_data.update( { 'filetypes': self.filetypes } )
+ try:
+ self._response = self.PostDataToHandler( request_data,
+ 'semantic_completion_available' )
+ except ( ServerError, ReadTimeout ) as e:
+ HandleServerException( e )
+
+
+ def Response( self ):
+ return self._response
+
+
+def SendCompleterAvailableRequest( filetypes ):
+ request = CompleterAvailableRequest( filetypes )
+ # This is a blocking call.
+ request.Start()
+ return request.Response()
diff --git a/vim/bundle/YouCompleteMe/python/ycm/client/completion_request.py b/vim/bundle/YouCompleteMe/python/ycm/client/completion_request.py
new file mode 100644
index 0000000..bf16912
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/client/completion_request.py
@@ -0,0 +1,109 @@
+# Copyright (C) 2013 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from requests.exceptions import ReadTimeout
+
+from ycmd.utils import ToUnicode
+from ycm.client.base_request import ( BaseRequest, JsonFromFuture,
+ HandleServerException,
+ MakeServerException )
+from ycmd.responses import ServerError
+
+TIMEOUT_SECONDS = 0.5
+
+
+class CompletionRequest( BaseRequest ):
+ def __init__( self, request_data ):
+ super( CompletionRequest, self ).__init__()
+ self.request_data = request_data
+
+
+ def Start( self ):
+ self._response_future = self.PostDataToHandlerAsync( self.request_data,
+ 'completions',
+ TIMEOUT_SECONDS )
+
+
+ def Done( self ):
+ return self._response_future.done()
+
+
+ def RawResponse( self ):
+ if not self._response_future:
+ return []
+ try:
+ response = JsonFromFuture( self._response_future )
+
+ errors = response[ 'errors' ] if 'errors' in response else []
+ for e in errors:
+ HandleServerException( MakeServerException( e ) )
+
+ return JsonFromFuture( self._response_future )[ 'completions' ]
+ except ( ServerError, ReadTimeout ) as e:
+ HandleServerException( e )
+ return []
+
+
+ def Response( self ):
+ return _ConvertCompletionDatasToVimDatas( self.RawResponse() )
+
+
+def ConvertCompletionDataToVimData( completion_data ):
+ # see :h complete-items for a description of the dictionary fields
+ vim_data = {
+ 'word' : '',
+ 'dup' : 1,
+ 'empty' : 1,
+ }
+
+ if ( 'extra_data' in completion_data and
+ 'doc_string' in completion_data[ 'extra_data' ] ):
+ doc_string = completion_data[ 'extra_data' ][ 'doc_string' ]
+ else:
+ doc_string = ""
+
+ if 'insertion_text' in completion_data:
+ vim_data[ 'word' ] = completion_data[ 'insertion_text' ]
+ if 'menu_text' in completion_data:
+ vim_data[ 'abbr' ] = completion_data[ 'menu_text' ]
+ if 'extra_menu_info' in completion_data:
+ vim_data[ 'menu' ] = completion_data[ 'extra_menu_info' ]
+ if 'kind' in completion_data:
+ kind = ToUnicode( completion_data[ 'kind' ] )
+ if kind:
+ vim_data[ 'kind' ] = kind[ 0 ].lower()
+ if 'detailed_info' in completion_data:
+ vim_data[ 'info' ] = completion_data[ 'detailed_info' ]
+ if doc_string:
+ vim_data[ 'info' ] += '\n' + doc_string
+ elif doc_string:
+ vim_data[ 'info' ] = doc_string
+
+ return vim_data
+
+
+def _ConvertCompletionDatasToVimDatas( response_data ):
+ return [ ConvertCompletionDataToVimData( x )
+ for x in response_data ]
diff --git a/vim/bundle/YouCompleteMe/python/ycm/client/event_notification.py b/vim/bundle/YouCompleteMe/python/ycm/client/event_notification.py
new file mode 100644
index 0000000..b9a60d1
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/client/event_notification.py
@@ -0,0 +1,89 @@
+# Copyright (C) 2013 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from requests.exceptions import ReadTimeout
+
+from ycm import vimsupport
+from ycmd.responses import UnknownExtraConf, ServerError
+from ycm.client.base_request import ( BaseRequest, BuildRequestData,
+ JsonFromFuture, HandleServerException )
+
+
+class EventNotification( BaseRequest ):
+ def __init__( self, event_name, extra_data = None ):
+ super( EventNotification, self ).__init__()
+ self._event_name = event_name
+ self._extra_data = extra_data
+ self._cached_response = None
+
+
+ def Start( self ):
+ request_data = BuildRequestData()
+ if self._extra_data:
+ request_data.update( self._extra_data )
+ request_data[ 'event_name' ] = self._event_name
+
+ self._response_future = self.PostDataToHandlerAsync( request_data,
+ 'event_notification' )
+
+
+ def Done( self ):
+ return self._response_future.done()
+
+
+ def Response( self ):
+ if self._cached_response:
+ return self._cached_response
+
+ if not self._response_future or self._event_name != 'FileReadyToParse':
+ return []
+
+ try:
+ try:
+ self._cached_response = JsonFromFuture( self._response_future )
+ except UnknownExtraConf as e:
+ if vimsupport.Confirm( str( e ) ):
+ _LoadExtraConfFile( e.extra_conf_file )
+ else:
+ _IgnoreExtraConfFile( e.extra_conf_file )
+ except ( ServerError, ReadTimeout ) as e:
+ HandleServerException( e )
+
+ return self._cached_response if self._cached_response else []
+
+
+def SendEventNotificationAsync( event_name, extra_data = None ):
+ event = EventNotification( event_name, extra_data )
+ event.Start()
+
+
+def _LoadExtraConfFile( filepath ):
+ BaseRequest.PostDataToHandler( { 'filepath': filepath },
+ 'load_extra_conf_file' )
+
+
+def _IgnoreExtraConfFile( filepath ):
+ BaseRequest.PostDataToHandler( { 'filepath': filepath },
+ 'ignore_extra_conf_file' )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/client/omni_completion_request.py b/vim/bundle/YouCompleteMe/python/ycm/client/omni_completion_request.py
new file mode 100644
index 0000000..2bcb291
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/client/omni_completion_request.py
@@ -0,0 +1,71 @@
+# Copyright (C) 2013 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from ycm.client.completion_request import CompletionRequest
+
+
+class OmniCompletionRequest( CompletionRequest ):
+ def __init__( self, omni_completer, request_data ):
+ super( OmniCompletionRequest, self ).__init__( request_data )
+ self._omni_completer = omni_completer
+
+
+ def Start( self ):
+ self._results = self._omni_completer.ComputeCandidates( self.request_data )
+
+
+ def Done( self ):
+ return True
+
+
+ def RawResponse( self ):
+ return _ConvertVimDatasToCompletionDatas( self._results )
+
+
+ def Response( self ):
+ return self._results
+
+
+def ConvertVimDataToCompletionData( vim_data ):
+ # see :h complete-items for a description of the dictionary fields
+ completion_data = {}
+
+ if 'word' in vim_data:
+ completion_data[ 'insertion_text' ] = vim_data[ 'word' ]
+ if 'abbr' in vim_data:
+ completion_data[ 'menu_text' ] = vim_data[ 'abbr' ]
+ if 'menu' in vim_data:
+ completion_data[ 'extra_menu_info' ] = vim_data[ 'menu' ]
+ if 'kind' in vim_data:
+ completion_data[ 'kind' ] = [ vim_data[ 'kind' ] ]
+ if 'info' in vim_data:
+ completion_data[ 'detailed_info' ] = vim_data[ 'info' ]
+
+ return completion_data
+
+
+def _ConvertVimDatasToCompletionDatas( response_data ):
+ return [ ConvertVimDataToCompletionData( x )
+ for x in response_data ]
diff --git a/vim/bundle/YouCompleteMe/python/ycm/client/tests/__init__.py b/vim/bundle/YouCompleteMe/python/ycm/client/tests/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/client/tests/__init__.py
diff --git a/vim/bundle/YouCompleteMe/python/ycm/client/tests/command_request_test.py b/vim/bundle/YouCompleteMe/python/ycm/client/tests/command_request_test.py
new file mode 100644
index 0000000..dfc55e0
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/client/tests/command_request_test.py
@@ -0,0 +1,283 @@
+# Copyright (C) 2016 YouCompleteMe Contributors
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from ycm.test_utils import ExtendedMock, MockVimModule
+MockVimModule()
+
+import json
+from mock import patch, call
+from nose.tools import ok_
+from ycm.client.command_request import CommandRequest
+
+
+class GoToResponse_QuickFix_test( object ):
+ """This class tests the generation of QuickFix lists for GoTo responses which
+ return multiple locations, such as the Python completer and JavaScript
+ completer. It mostly proves that we use 1-based indexing for the column
+ number."""
+
+ def setUp( self ):
+ self._request = CommandRequest( [ 'GoToTest' ] )
+
+
+ def tearDown( self ):
+ self._request = None
+
+
+ def GoTo_EmptyList_test( self ):
+ self._CheckGoToList( [], [] )
+
+
+ def GoTo_SingleItem_List_test( self ):
+ self._CheckGoToList( [ {
+ 'filepath': 'dummy_file',
+ 'line_num': 10,
+ 'column_num': 1,
+ 'description': 'this is some text',
+ } ], [ {
+ 'filename': 'dummy_file',
+ 'text': 'this is some text',
+ 'lnum': 10,
+ 'col': 1
+ } ] )
+
+
+ def GoTo_MultiItem_List_test( self ):
+ self._CheckGoToList( [ {
+ 'filepath': 'dummy_file',
+ 'line_num': 10,
+ 'column_num': 1,
+ 'description': 'this is some other text',
+ }, {
+ 'filepath': 'dummy_file2',
+ 'line_num': 1,
+ 'column_num': 21,
+ 'description': 'this is some text',
+ } ], [ {
+ 'filename': 'dummy_file',
+ 'text': 'this is some other text',
+ 'lnum': 10,
+ 'col': 1
+ }, {
+ 'filename': 'dummy_file2',
+ 'text': 'this is some text',
+ 'lnum': 1,
+ 'col': 21
+ } ] )
+
+
+ @patch( 'ycm.vimsupport.VariableExists', return_value = True )
+ @patch( 'ycm.vimsupport.SetFittingHeightForCurrentWindow' )
+ @patch( 'vim.command', new_callable = ExtendedMock )
+ @patch( 'vim.eval', new_callable = ExtendedMock )
+ def _CheckGoToList( self,
+ completer_response,
+ expected_qf_list,
+ vim_eval,
+ vim_command,
+ set_fitting_height,
+ variable_exists ):
+ self._request._response = completer_response
+
+ self._request.RunPostCommandActionsIfNeeded()
+
+ vim_eval.assert_has_exact_calls( [
+ call( 'setqflist( {0} )'.format( json.dumps( expected_qf_list ) ) )
+ ] )
+ vim_command.assert_has_exact_calls( [
+ call( 'botright copen' ),
+ call( 'au WinLeave <buffer> q' ),
+ call( 'doautocmd User YcmQuickFixOpened' )
+ ] )
+ set_fitting_height.assert_called_once_with()
+
+
+class Response_Detection_test( object ):
+
+ def BasicResponse_test( self ):
+ def _BasicResponseTest( command, response ):
+ with patch( 'vim.command' ) as vim_command:
+ request = CommandRequest( [ command ] )
+ request._response = response
+ request.RunPostCommandActionsIfNeeded()
+ vim_command.assert_called_with( "echom '{0}'".format( response ) )
+
+ tests = [
+ [ 'AnythingYouLike', True ],
+ [ 'GoToEvenWorks', 10 ],
+ [ 'FixItWorks', 'String!' ],
+ [ 'and8434fd andy garbag!', 10.3 ],
+ ]
+
+ for test in tests:
+ yield _BasicResponseTest, test[ 0 ], test[ 1 ]
+
+
+ def FixIt_Response_Empty_test( self ):
+ # Ensures we recognise and handle fixit responses which indicate that there
+ # are no fixits available
+ def EmptyFixItTest( command ):
+ with patch( 'ycm.vimsupport.ReplaceChunks' ) as replace_chunks:
+ with patch( 'ycm.vimsupport.EchoText' ) as echo_text:
+ request = CommandRequest( [ command ] )
+ request._response = {
+ 'fixits': []
+ }
+ request.RunPostCommandActionsIfNeeded()
+
+ echo_text.assert_called_with( 'No fixits found for current line' )
+ replace_chunks.assert_not_called()
+
+ for test in [ 'FixIt', 'Refactor', 'GoToHell', 'any_old_garbade!!!21' ]:
+ yield EmptyFixItTest, test
+
+
+ def FixIt_Response_test( self ):
+ # Ensures we recognise and handle fixit responses with some dummy chunk data
+ def FixItTest( command, response, chunks ):
+ with patch( 'ycm.vimsupport.ReplaceChunks' ) as replace_chunks:
+ with patch( 'ycm.vimsupport.EchoText' ) as echo_text:
+ request = CommandRequest( [ command ] )
+ request._response = response
+ request.RunPostCommandActionsIfNeeded()
+
+ replace_chunks.assert_called_with( chunks )
+ echo_text.assert_not_called()
+
+ basic_fixit = {
+ 'fixits': [ {
+ 'chunks': [ {
+ 'dummy chunk contents': True
+ } ]
+ } ]
+ }
+ basic_fixit_chunks = basic_fixit[ 'fixits' ][ 0 ][ 'chunks' ]
+
+ multi_fixit = {
+ 'fixits': [ {
+ 'chunks': [ {
+ 'dummy chunk contents': True
+ } ]
+ }, {
+ 'additional fixits are ignored currently': True
+ } ]
+ }
+ multi_fixit_first_chunks = multi_fixit[ 'fixits' ][ 0 ][ 'chunks' ]
+
+ tests = [
+ [ 'AnythingYouLike', basic_fixit, basic_fixit_chunks ],
+ [ 'GoToEvenWorks', basic_fixit, basic_fixit_chunks ],
+ [ 'FixItWorks', basic_fixit, basic_fixit_chunks ],
+ [ 'and8434fd andy garbag!', basic_fixit, basic_fixit_chunks ],
+ [ 'additional fixits ignored', multi_fixit, multi_fixit_first_chunks ],
+ ]
+
+ for test in tests:
+ yield FixItTest, test[ 0 ], test[ 1 ], test[ 2 ]
+
+
+ def Message_Response_test( self ):
+ # Ensures we correctly recognise and handle responses with a message to show
+ # to the user
+
+ def MessageTest( command, message ):
+ with patch( 'ycm.vimsupport.EchoText' ) as echo_text:
+ request = CommandRequest( [ command ] )
+ request._response = { 'message': message }
+ request.RunPostCommandActionsIfNeeded()
+ echo_text.assert_called_with( message )
+
+ tests = [
+ [ '___________', 'This is a message' ],
+ [ '', 'this is also a message' ],
+ [ 'GetType', 'std::string' ],
+ ]
+
+ for test in tests:
+ yield MessageTest, test[ 0 ], test[ 1 ]
+
+
+ def Detailed_Info_test( self ):
+ # Ensures we correctly detect and handle detailed_info responses which are
+ # used to display information in the preview window
+
+ def DetailedInfoTest( command, info ):
+ with patch( 'ycm.vimsupport.WriteToPreviewWindow' ) as write_to_preview:
+ request = CommandRequest( [ command ] )
+ request._response = { 'detailed_info': info }
+ request.RunPostCommandActionsIfNeeded()
+ write_to_preview.assert_called_with( info )
+
+ tests = [
+ [ '___________', 'This is a message' ],
+ [ '', 'this is also a message' ],
+ [ 'GetDoc', 'std::string\netc\netc' ],
+ ]
+
+ for test in tests:
+ yield DetailedInfoTest, test[ 0 ], test[ 1 ]
+
+
+ def GoTo_Single_test( self ):
+ # Ensures we handle any unknown type of response as a GoTo response
+
+ def GoToTest( command, response ):
+ with patch( 'ycm.vimsupport.JumpToLocation' ) as jump_to_location:
+ request = CommandRequest( [ command ] )
+ request._response = response
+ request.RunPostCommandActionsIfNeeded()
+ jump_to_location.assert_called_with(
+ response[ 'filepath' ],
+ response[ 'line_num' ],
+ response[ 'column_num' ] )
+
+ def GoToListTest( command, response ):
+ # Note: the detail of these called are tested by
+ # GoToResponse_QuickFix_test, so here we just check that the right call is
+ # made
+ with patch( 'ycm.vimsupport.SetQuickFixList' ) as set_qf_list:
+ request = CommandRequest( [ command ] )
+ request._response = response
+ request.RunPostCommandActionsIfNeeded()
+ ok_( set_qf_list.called )
+
+ basic_goto = {
+ 'filepath': 'test',
+ 'line_num': 10,
+ 'column_num': 100,
+ }
+
+ tests = [
+ [ GoToTest, 'AnythingYouLike', basic_goto ],
+ [ GoToTest, 'GoTo', basic_goto ],
+ [ GoToTest, 'FindAThing', basic_goto ],
+ [ GoToTest, 'FixItGoto', basic_goto ],
+ [ GoToListTest, 'AnythingYouLike', [ basic_goto ] ],
+ [ GoToListTest, 'GoTo', [] ],
+ [ GoToListTest, 'FixItGoto', [ basic_goto, basic_goto ] ],
+ ]
+
+ for test in tests:
+ yield test[ 0 ], test[ 1 ], test[ 2 ]
diff --git a/vim/bundle/YouCompleteMe/python/ycm/client/tests/completion_request_test.py b/vim/bundle/YouCompleteMe/python/ycm/client/tests/completion_request_test.py
new file mode 100644
index 0000000..acf0252
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/client/tests/completion_request_test.py
@@ -0,0 +1,186 @@
+# Copyright (C) 2015 YouCompleteMe Contributors
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from nose.tools import eq_
+from ycm.test_utils import MockVimModule
+vim_mock = MockVimModule()
+
+from .. import completion_request
+
+
+class ConvertCompletionResponseToVimDatas_test( object ):
+ """ This class tests the
+ completion_request._ConvertCompletionResponseToVimDatas method """
+
+ def _Check( self, completion_data, expected_vim_data ):
+ vim_data = completion_request.ConvertCompletionDataToVimData(
+ completion_data )
+
+ try:
+ eq_( expected_vim_data, vim_data )
+ except:
+ print( "Expected:\n'{0}'\nwhen parsing:\n'{1}'\nBut found:\n'{2}'".format(
+ expected_vim_data,
+ completion_data,
+ vim_data ) )
+ raise
+
+
+ def All_Fields_test( self ):
+ self._Check( {
+ 'insertion_text': 'INSERTION TEXT',
+ 'menu_text': 'MENU TEXT',
+ 'extra_menu_info': 'EXTRA MENU INFO',
+ 'kind': 'K',
+ 'detailed_info': 'DETAILED INFO',
+ 'extra_data': {
+ 'doc_string': 'DOC STRING',
+ },
+ }, {
+ 'word' : 'INSERTION TEXT',
+ 'abbr' : 'MENU TEXT',
+ 'menu' : 'EXTRA MENU INFO',
+ 'kind' : 'k',
+ 'info' : 'DETAILED INFO\nDOC STRING',
+ 'dup' : 1,
+ 'empty': 1,
+ } )
+
+
+ def Just_Detailed_Info_test( self ):
+ self._Check( {
+ 'insertion_text': 'INSERTION TEXT',
+ 'menu_text': 'MENU TEXT',
+ 'extra_menu_info': 'EXTRA MENU INFO',
+ 'kind': 'K',
+ 'detailed_info': 'DETAILED INFO',
+ }, {
+ 'word' : 'INSERTION TEXT',
+ 'abbr' : 'MENU TEXT',
+ 'menu' : 'EXTRA MENU INFO',
+ 'kind' : 'k',
+ 'info' : 'DETAILED INFO',
+ 'dup' : 1,
+ 'empty': 1,
+ } )
+
+
+ def Just_Doc_String_test( self ):
+ self._Check( {
+ 'insertion_text': 'INSERTION TEXT',
+ 'menu_text': 'MENU TEXT',
+ 'extra_menu_info': 'EXTRA MENU INFO',
+ 'kind': 'K',
+ 'extra_data': {
+ 'doc_string': 'DOC STRING',
+ },
+ }, {
+ 'word' : 'INSERTION TEXT',
+ 'abbr' : 'MENU TEXT',
+ 'menu' : 'EXTRA MENU INFO',
+ 'kind' : 'k',
+ 'info' : 'DOC STRING',
+ 'dup' : 1,
+ 'empty': 1,
+ } )
+
+
+ def Extra_Info_No_Doc_String_test( self ):
+ self._Check( {
+ 'insertion_text': 'INSERTION TEXT',
+ 'menu_text': 'MENU TEXT',
+ 'extra_menu_info': 'EXTRA MENU INFO',
+ 'kind': 'K',
+ 'extra_data': {
+ },
+ }, {
+ 'word' : 'INSERTION TEXT',
+ 'abbr' : 'MENU TEXT',
+ 'menu' : 'EXTRA MENU INFO',
+ 'kind' : 'k',
+ 'dup' : 1,
+ 'empty': 1,
+ } )
+
+
+ def Extra_Info_No_Doc_String_With_Detailed_Info_test( self ):
+ self._Check( {
+ 'insertion_text': 'INSERTION TEXT',
+ 'menu_text': 'MENU TEXT',
+ 'extra_menu_info': 'EXTRA MENU INFO',
+ 'kind': 'K',
+ 'detailed_info': 'DETAILED INFO',
+ 'extra_data': {
+ },
+ }, {
+ 'word' : 'INSERTION TEXT',
+ 'abbr' : 'MENU TEXT',
+ 'menu' : 'EXTRA MENU INFO',
+ 'kind' : 'k',
+ 'info' : 'DETAILED INFO',
+ 'dup' : 1,
+ 'empty': 1,
+ } )
+
+
+ def Empty_Insertion_Text_test( self ):
+ self._Check( {
+ 'insertion_text': '',
+ 'menu_text': 'MENU TEXT',
+ 'extra_menu_info': 'EXTRA MENU INFO',
+ 'kind': 'K',
+ 'detailed_info': 'DETAILED INFO',
+ 'extra_data': {
+ 'doc_string': 'DOC STRING',
+ },
+ }, {
+ 'word' : '',
+ 'abbr' : 'MENU TEXT',
+ 'menu' : 'EXTRA MENU INFO',
+ 'kind' : 'k',
+ 'info' : 'DETAILED INFO\nDOC STRING',
+ 'dup' : 1,
+ 'empty': 1,
+ } )
+
+
+ def No_Insertion_Text_test( self ):
+ self._Check( {
+ 'menu_text': 'MENU TEXT',
+ 'extra_menu_info': 'EXTRA MENU INFO',
+ 'kind': 'K',
+ 'detailed_info': 'DETAILED INFO',
+ 'extra_data': {
+ 'doc_string': 'DOC STRING',
+ },
+ }, {
+ 'word' : '',
+ 'abbr' : 'MENU TEXT',
+ 'menu' : 'EXTRA MENU INFO',
+ 'kind' : 'k',
+ 'info' : 'DETAILED INFO\nDOC STRING',
+ 'dup' : 1,
+ 'empty': 1,
+ } )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/client/tests/omni_completion_request_tests.py b/vim/bundle/YouCompleteMe/python/ycm/client/tests/omni_completion_request_tests.py
new file mode 100644
index 0000000..02fb2e9
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/client/tests/omni_completion_request_tests.py
@@ -0,0 +1,81 @@
+# Copyright (C) 2016 YouCompleteMe contributors
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from mock import MagicMock
+from nose.tools import eq_
+from hamcrest import assert_that, has_entries
+
+from ycm.client.omni_completion_request import OmniCompletionRequest
+
+
+def BuildOmnicompletionRequest( results ):
+ omni_completer = MagicMock()
+ omni_completer.ComputeCandidates = MagicMock( return_value = results )
+
+ request = OmniCompletionRequest( omni_completer, None )
+ request.Start()
+
+ return request
+
+
+def Done_AlwaysTrue_test():
+ request = BuildOmnicompletionRequest( [] )
+
+ eq_( request.Done(), True )
+
+
+def Response_FromOmniCompleter_test():
+ results = [ { "word": "test" } ]
+ request = BuildOmnicompletionRequest( results )
+
+ eq_( request.Response(), results )
+
+
+def RawResponse_ConvertedFromOmniCompleter_test():
+ vim_results = [
+ { "word": "WORD", "abbr": "ABBR", "menu": "MENU",
+ "kind": "KIND", "info": "INFO" },
+ { "word": "WORD2", "abbr": "ABBR2", "menu": "MENU2",
+ "kind": "KIND2", "info": "INFO" },
+ { "word": "WORD", "abbr": "ABBR", },
+ { },
+ ]
+ expected_results = [
+ has_entries( { "insertion_text": "WORD", "menu_text": "ABBR",
+ "extra_menu_info": "MENU", "kind": [ "KIND" ],
+ "detailed_info": "INFO" } ),
+ has_entries( { "insertion_text": "WORD2", "menu_text": "ABBR2",
+ "extra_menu_info": "MENU2", "kind": [ "KIND2" ],
+ "detailed_info": "INFO" } ),
+ has_entries( { "insertion_text": "WORD", "menu_text": "ABBR", } ),
+ has_entries( { } ),
+ ]
+ request = BuildOmnicompletionRequest( vim_results )
+
+ results = request.RawResponse()
+
+ eq_( len( results ), len( expected_results ) )
+ for result, expected_result in zip( results, expected_results ):
+ assert_that( result, expected_result )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/client/ycmd_keepalive.py b/vim/bundle/YouCompleteMe/python/ycm/client/ycmd_keepalive.py
new file mode 100644
index 0000000..fca59f4
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/client/ycmd_keepalive.py
@@ -0,0 +1,54 @@
+# Copyright (C) 2013 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+import time
+from threading import Thread
+from ycm.client.base_request import BaseRequest
+
+
+# This class can be used to keep the ycmd server alive for the duration of the
+# life of the client. By default, ycmd shuts down if it doesn't see a request in
+# a while.
+class YcmdKeepalive( object ):
+ def __init__( self, ping_interval_seconds = 60 * 10 ):
+ self._keepalive_thread = Thread( target = self._ThreadMain )
+ self._keepalive_thread.daemon = True
+ self._ping_interval_seconds = ping_interval_seconds
+
+
+ def Start( self ):
+ self._keepalive_thread.start()
+
+
+ def _ThreadMain( self ):
+ while True:
+ time.sleep( self._ping_interval_seconds )
+
+ # We don't care if there's an intermittent problem in contacting the
+ # server; it's fine to just skip this ping.
+ try:
+ BaseRequest.GetDataFromHandler( 'healthy' )
+ except:
+ pass
diff --git a/vim/bundle/YouCompleteMe/python/ycm/diagnostic_interface.py b/vim/bundle/YouCompleteMe/python/ycm/diagnostic_interface.py
new file mode 100644
index 0000000..7f7de53
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/diagnostic_interface.py
@@ -0,0 +1,265 @@
+# Copyright (C) 2013 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from future.utils import itervalues, iteritems
+from collections import defaultdict, namedtuple
+from ycm import vimsupport
+import vim
+
+
+class DiagnosticInterface( object ):
+ def __init__( self, user_options ):
+ self._user_options = user_options
+ # Line and column numbers are 1-based
+ self._buffer_number_to_line_to_diags = defaultdict(
+ lambda: defaultdict( list ) )
+ self._next_sign_id = 1
+ self._previous_line_number = -1
+ self._diag_message_needs_clearing = False
+ self._placed_signs = []
+
+
+ def OnCursorMoved( self ):
+ line, _ = vimsupport.CurrentLineAndColumn()
+ line += 1 # Convert to 1-based
+ if line != self._previous_line_number:
+ self._previous_line_number = line
+
+ if self._user_options[ 'echo_current_diagnostic' ]:
+ self._EchoDiagnosticForLine( line )
+
+
+ def GetErrorCount( self ):
+ return len( self._FilterDiagnostics( _DiagnosticIsError ) )
+
+
+ def GetWarningCount( self ):
+ return len( self._FilterDiagnostics( _DiagnosticIsWarning ) )
+
+
+ def PopulateLocationList( self, diags ):
+ vimsupport.SetLocationList(
+ vimsupport.ConvertDiagnosticsToQfList( diags ) )
+
+
+ def UpdateWithNewDiagnostics( self, diags ):
+ normalized_diags = [ _NormalizeDiagnostic( x ) for x in diags ]
+ self._buffer_number_to_line_to_diags = _ConvertDiagListToDict(
+ normalized_diags )
+
+ if self._user_options[ 'enable_diagnostic_signs' ]:
+ self._placed_signs, self._next_sign_id = _UpdateSigns(
+ self._placed_signs,
+ self._buffer_number_to_line_to_diags,
+ self._next_sign_id )
+
+ if self._user_options[ 'enable_diagnostic_highlighting' ]:
+ _UpdateSquiggles( self._buffer_number_to_line_to_diags )
+
+ if self._user_options[ 'always_populate_location_list' ]:
+ self.PopulateLocationList( normalized_diags )
+
+ def _EchoDiagnosticForLine( self, line_num ):
+ buffer_num = vim.current.buffer.number
+ diags = self._buffer_number_to_line_to_diags[ buffer_num ][ line_num ]
+ if not diags:
+ if self._diag_message_needs_clearing:
+ # Clear any previous diag echo
+ vimsupport.EchoText( '', False )
+ self._diag_message_needs_clearing = False
+ return
+
+ text = diags[ 0 ][ 'text' ]
+ if diags[ 0 ].get( 'fixit_available', False ):
+ text += ' (FixIt)'
+
+ vimsupport.EchoTextVimWidth( text )
+ self._diag_message_needs_clearing = True
+
+
+ def _FilterDiagnostics( self, predicate ):
+ matched_diags = []
+ line_to_diags = self._buffer_number_to_line_to_diags[
+ vim.current.buffer.number ]
+
+ for diags in itervalues( line_to_diags ):
+ matched_diags.extend( list( filter( predicate, diags ) ) )
+ return matched_diags
+
+
+def _UpdateSquiggles( buffer_number_to_line_to_diags ):
+ vimsupport.ClearYcmSyntaxMatches()
+ line_to_diags = buffer_number_to_line_to_diags[ vim.current.buffer.number ]
+
+ for diags in itervalues( line_to_diags ):
+ for diag in diags:
+ location_extent = diag[ 'location_extent' ]
+ is_error = _DiagnosticIsError( diag )
+
+ if location_extent[ 'start' ][ 'line_num' ] < 0:
+ location = diag[ 'location' ]
+ vimsupport.AddDiagnosticSyntaxMatch(
+ location[ 'line_num' ],
+ location[ 'column_num' ] )
+ else:
+ vimsupport.AddDiagnosticSyntaxMatch(
+ location_extent[ 'start' ][ 'line_num' ],
+ location_extent[ 'start' ][ 'column_num' ],
+ location_extent[ 'end' ][ 'line_num' ],
+ location_extent[ 'end' ][ 'column_num' ],
+ is_error = is_error )
+
+ for diag_range in diag[ 'ranges' ]:
+ vimsupport.AddDiagnosticSyntaxMatch(
+ diag_range[ 'start' ][ 'line_num' ],
+ diag_range[ 'start' ][ 'column_num' ],
+ diag_range[ 'end' ][ 'line_num' ],
+ diag_range[ 'end' ][ 'column_num' ],
+ is_error = is_error )
+
+
+def _UpdateSigns( placed_signs, buffer_number_to_line_to_diags, next_sign_id ):
+ new_signs, kept_signs, next_sign_id = _GetKeptAndNewSigns(
+ placed_signs, buffer_number_to_line_to_diags, next_sign_id
+ )
+ # Dummy sign used to prevent "flickering" in Vim when last mark gets
+ # deleted from buffer. Dummy sign prevents Vim to collapsing the sign column
+ # in that case.
+ # There's also a vim bug which causes the whole window to redraw in some
+ # conditions (vim redraw logic is very complex). But, somehow, if we place a
+ # dummy sign before placing other "real" signs, it will not redraw the
+ # buffer (patch to vim pending).
+ dummy_sign_needed = not kept_signs and new_signs
+
+ if dummy_sign_needed:
+ vimsupport.PlaceDummySign( next_sign_id + 1,
+ vim.current.buffer.number,
+ new_signs[ 0 ].line )
+
+ # We place only those signs that haven't been placed yet.
+ new_placed_signs = _PlaceNewSigns( kept_signs, new_signs )
+
+ # We use incremental placement, so signs that already placed on the correct
+ # lines will not be deleted and placed again, which should improve performance
+ # in case of many diags. Signs which don't exist in the current diag should be
+ # deleted.
+ _UnplaceObsoleteSigns( kept_signs, placed_signs )
+
+ if dummy_sign_needed:
+ vimsupport.UnPlaceDummySign( next_sign_id + 1, vim.current.buffer.number )
+
+ return new_placed_signs, next_sign_id
+
+
+def _GetKeptAndNewSigns( placed_signs, buffer_number_to_line_to_diags,
+ next_sign_id ):
+ new_signs = []
+ kept_signs = []
+ for buffer_number, line_to_diags in iteritems(
+ buffer_number_to_line_to_diags ):
+ if not vimsupport.BufferIsVisible( buffer_number ):
+ continue
+
+ for line, diags in iteritems( line_to_diags ):
+ for diag in diags:
+ sign = _DiagSignPlacement( next_sign_id,
+ line,
+ buffer_number,
+ _DiagnosticIsError( diag ) )
+ if sign not in placed_signs:
+ new_signs += [ sign ]
+ next_sign_id += 1
+ else:
+ # We use .index here because `sign` contains a new id, but
+ # we need the sign with the old id to unplace it later on.
+ # We won't be placing the new sign.
+ kept_signs += [ placed_signs[ placed_signs.index( sign ) ] ]
+ return new_signs, kept_signs, next_sign_id
+
+
+
+def _PlaceNewSigns( kept_signs, new_signs ):
+ placed_signs = kept_signs[:]
+ for sign in new_signs:
+ # Do not set two signs on the same line, it will screw up storing sign
+ # locations.
+ if sign in placed_signs:
+ continue
+ vimsupport.PlaceSign( sign.id, sign.line, sign.buffer, sign.is_error )
+ placed_signs.append(sign)
+ return placed_signs
+
+
+def _UnplaceObsoleteSigns( kept_signs, placed_signs ):
+ for sign in placed_signs:
+ if sign not in kept_signs:
+ vimsupport.UnplaceSignInBuffer( sign.buffer, sign.id )
+
+
+def _ConvertDiagListToDict( diag_list ):
+ buffer_to_line_to_diags = defaultdict( lambda: defaultdict( list ) )
+ for diag in diag_list:
+ location = diag[ 'location' ]
+ buffer_number = vimsupport.GetBufferNumberForFilename(
+ location[ 'filepath' ] )
+ line_number = location[ 'line_num' ]
+ buffer_to_line_to_diags[ buffer_number ][ line_number ].append( diag )
+
+ for line_to_diags in itervalues( buffer_to_line_to_diags ):
+ for diags in itervalues( line_to_diags ):
+ # We also want errors to be listed before warnings so that errors aren't
+ # hidden by the warnings; Vim won't place a sign oven an existing one.
+ diags.sort( key = lambda diag: ( diag[ 'location' ][ 'column_num' ],
+ diag[ 'kind' ] ) )
+ return buffer_to_line_to_diags
+
+
+def _DiagnosticIsError( diag ):
+ return diag[ 'kind' ] == 'ERROR'
+
+
+def _DiagnosticIsWarning( diag ):
+ return diag[ 'kind' ] == 'WARNING'
+
+
+def _NormalizeDiagnostic( diag ):
+ def ClampToOne( value ):
+ return value if value > 0 else 1
+
+ location = diag[ 'location' ]
+ location[ 'column_num' ] = ClampToOne( location[ 'column_num' ] )
+ location[ 'line_num' ] = ClampToOne( location[ 'line_num' ] )
+ return diag
+
+
+class _DiagSignPlacement(
+ namedtuple( "_DiagSignPlacement",
+ [ 'id', 'line', 'buffer', 'is_error' ] ) ):
+ # We want two signs that have different ids but the same location to compare
+ # equal. ID doesn't matter.
+ def __eq__( self, other ):
+ return ( self.line == other.line and
+ self.buffer == other.buffer and
+ self.is_error == other.is_error )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/omni_completer.py b/vim/bundle/YouCompleteMe/python/ycm/omni_completer.py
new file mode 100644
index 0000000..df3a51c
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/omni_completer.py
@@ -0,0 +1,123 @@
+# Copyright (C) 2011, 2012, 2013 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+import vim
+from ycm import vimsupport
+from ycmd import utils
+from ycmd.responses import ServerError
+from ycmd.completers.completer import Completer
+from ycm.client.base_request import BaseRequest, HandleServerException
+
+OMNIFUNC_RETURNED_BAD_VALUE = 'Omnifunc returned bad value to YCM!'
+OMNIFUNC_NOT_LIST = ( 'Omnifunc did not return a list or a dict with a "words" '
+ ' list when expected.' )
+
+
+class OmniCompleter( Completer ):
+ def __init__( self, user_options ):
+ super( OmniCompleter, self ).__init__( user_options )
+ self._omnifunc = None
+
+
+ def SupportedFiletypes( self ):
+ return []
+
+
+ def ShouldUseCache( self ):
+ return bool( self.user_options[ 'cache_omnifunc' ] )
+
+
+ def ShouldUseNow( self, request_data ):
+ if not self._omnifunc:
+ return False
+
+ if self.ShouldUseCache():
+ return super( OmniCompleter, self ).ShouldUseNow( request_data )
+ return self.ShouldUseNowInner( request_data )
+
+
+ def ShouldUseNowInner( self, request_data ):
+ if not self._omnifunc:
+ return False
+ return super( OmniCompleter, self ).ShouldUseNowInner( request_data )
+
+
+ def ComputeCandidates( self, request_data ):
+ if self.ShouldUseCache():
+ return super( OmniCompleter, self ).ComputeCandidates( request_data )
+ else:
+ if self.ShouldUseNowInner( request_data ):
+ return self.ComputeCandidatesInner( request_data )
+ return []
+
+
+ def ComputeCandidatesInner( self, request_data ):
+ if not self._omnifunc:
+ return []
+
+ try:
+ return_value = int( vim.eval( self._omnifunc + '(1,"")' ) )
+ if return_value < 0:
+ # FIXME: Technically, if the return is -1 we should raise an error
+ return []
+
+ omnifunc_call = [ self._omnifunc,
+ "(0,'",
+ vimsupport.EscapeForVim( request_data[ 'query' ] ),
+ "')" ]
+
+ items = vim.eval( ''.join( omnifunc_call ) )
+
+ if isinstance( items, dict ) and 'words' in items:
+ items = items[ 'words' ]
+
+ if not hasattr( items, '__iter__' ):
+ raise TypeError( OMNIFUNC_NOT_LIST )
+
+ return list( filter( bool, items ) )
+
+ except ( TypeError, ValueError, vim.error ) as error:
+ vimsupport.PostVimMessage(
+ OMNIFUNC_RETURNED_BAD_VALUE + ' ' + str( error ) )
+ return []
+
+
+ def OnFileReadyToParse( self, request_data ):
+ self._omnifunc = utils.ToUnicode( vim.eval( '&omnifunc' ) )
+
+
+ def FilterAndSortCandidatesInner( self, candidates, sort_property, query ):
+ request_data = {
+ 'candidates': candidates,
+ 'sort_property': sort_property,
+ 'query': query
+ }
+
+ try:
+ return BaseRequest.PostDataToHandler( request_data,
+ 'filter_and_sort_candidates' )
+ except ServerError as e:
+ HandleServerException( e )
+ return candidates
diff --git a/vim/bundle/YouCompleteMe/python/ycm/paths.py b/vim/bundle/YouCompleteMe/python/ycm/paths.py
new file mode 100644
index 0000000..17edafa
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/paths.py
@@ -0,0 +1,135 @@
+# Copyright (C) 2015 YouCompleteMe contributors.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+import os
+import sys
+import vim
+import functools
+import re
+
+# Can't import these from setup.py because it makes nosetests go crazy.
+DIR_OF_CURRENT_SCRIPT = os.path.dirname( os.path.abspath( __file__ ) )
+DIR_OF_YCMD = os.path.join( DIR_OF_CURRENT_SCRIPT, '..', '..', 'third_party',
+ 'ycmd' )
+WIN_PYTHON_PATH = os.path.join( sys.exec_prefix, 'python.exe' )
+PYTHON_BINARY_REGEX = re.compile(
+ r'python((2(\.[67])?)|(3(\.[3-9])?))?(.exe)?$' )
+
+
+def Memoize( obj ):
+ cache = obj.cache = {}
+
+ @functools.wraps( obj )
+ def memoizer( *args, **kwargs ):
+ key = str( args ) + str( kwargs )
+ if key not in cache:
+ cache[ key ] = obj( *args, **kwargs )
+ return cache[ key ]
+ return memoizer
+
+
+@Memoize
+def PathToPythonInterpreter():
+ from ycmd import utils
+
+ python_interpreter = vim.eval( 'g:ycm_server_python_interpreter' )
+
+ if python_interpreter:
+ if IsPythonVersionCorrect( python_interpreter ):
+ return python_interpreter
+
+ raise RuntimeError( "Path in 'g:ycm_server_python_interpreter' option "
+ "does not point to a valid Python 2.6+ or 3.3+." )
+
+ python_interpreter = _PathToPythonUsedDuringBuild()
+ if IsPythonVersionCorrect( python_interpreter ):
+ return python_interpreter
+
+ # On UNIX platforms, we use sys.executable as the Python interpreter path.
+ # We cannot use sys.executable on Windows because for unknown reasons, it
+ # returns the Vim executable. Instead, we use sys.exec_prefix to deduce the
+ # interpreter path.
+ python_interpreter = ( WIN_PYTHON_PATH if utils.OnWindows() else
+ sys.executable )
+
+ if IsPythonVersionCorrect( python_interpreter ):
+ return python_interpreter
+
+ # As a last resort, we search python in the PATH. We prefer Python 2 over 3
+ # for the sake of backwards compatibility with ycm_extra_conf.py files out
+ # there; few people wrote theirs to work on py3.
+ # So we check 'python2' before 'python' because on some distributions (Arch
+ # Linux for example), python refers to python3.
+ python_interpreter = utils.PathToFirstExistingExecutable( [ 'python2',
+ 'python',
+ 'python3' ] )
+
+ if IsPythonVersionCorrect( python_interpreter ):
+ return python_interpreter
+
+ raise RuntimeError( "Cannot find Python 2.6+ or 3.3+. You can set its path "
+ "using the 'g:ycm_server_python_interpreter' "
+ "option." )
+
+
+def _PathToPythonUsedDuringBuild():
+ from ycmd import utils
+
+ try:
+ filepath = os.path.join( DIR_OF_YCMD, 'PYTHON_USED_DURING_BUILDING' )
+ return utils.ReadFile( filepath ).strip()
+ # We need to check for IOError for Python2 and OSError for Python3
+ except ( IOError, OSError ):
+ return None
+
+
+def EndsWithPython( path ):
+ """Check if given path ends with a python 2.6+ or 3.3+ name."""
+ return path and PYTHON_BINARY_REGEX.search( path ) is not None
+
+
+def IsPythonVersionCorrect( path ):
+ """Check if given path is the Python interpreter version 2.6+ or 3.3+."""
+ from ycmd import utils
+
+ if not EndsWithPython( path ):
+ return False
+
+ command = [ path,
+ '-c',
+ "import sys;"
+ "major, minor = sys.version_info[ :2 ];"
+ "good_python = ( major == 2 and minor >= 6 ) "
+ "or ( major == 3 and minor >= 3 ) or major > 3;"
+ # If this looks weird, remember that:
+ # int( True ) == 1
+ # int( False ) == 0
+ "sys.exit( not good_python )" ]
+
+ return utils.SafePopen( command ).wait() == 0
+
+
+def PathToServerScript():
+ return os.path.join( DIR_OF_YCMD, 'ycmd' )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/setup.py b/vim/bundle/YouCompleteMe/python/ycm/setup.py
new file mode 100644
index 0000000..7fc9132
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/setup.py
@@ -0,0 +1,53 @@
+# Copyright (C) 2016 YouCompleteMe contributors
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+# No imports from `future` because when this is loaded, sys.path hasn't been set
+# up yet!
+
+import sys
+import os
+
+# Can't import these from paths.py because that uses `future` imports
+DIR_OF_CURRENT_SCRIPT = os.path.dirname( os.path.abspath( __file__ ) )
+DIR_OF_YCMD = os.path.join( DIR_OF_CURRENT_SCRIPT, '..', '..', 'third_party',
+ 'ycmd' )
+
+
+def SetUpSystemPaths():
+ sys.path.insert( 0, os.path.join( DIR_OF_YCMD ) )
+
+ from ycmd import server_utils as su
+ su.AddNearestThirdPartyFoldersToSysPath( DIR_OF_CURRENT_SCRIPT )
+ # We need to import ycmd's third_party folders as well since we import and
+ # use ycmd code in the client.
+ su.AddNearestThirdPartyFoldersToSysPath( su.__file__ )
+
+
+def SetUpYCM():
+ from ycm import base
+ from ycmd import user_options_store
+ from ycm.youcompleteme import YouCompleteMe
+
+ base.LoadJsonDefaultsIntoVim()
+
+ user_options_store.SetAll( base.BuildServerConf() )
+
+ return YouCompleteMe( user_options_store.GetAll() )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/syntax_parse.py b/vim/bundle/YouCompleteMe/python/ycm/syntax_parse.py
new file mode 100644
index 0000000..e6ea1d5
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/syntax_parse.py
@@ -0,0 +1,224 @@
+# Copyright (C) 2013 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from future.utils import itervalues
+import re
+import vim
+from ycm import vimsupport
+
+SYNTAX_GROUP_REGEX = re.compile(
+ r"""^
+ (?P<group_name>\w+)
+ \s+
+ xxx
+ \s+
+ (?P<content>.+?)
+ $""",
+ re.VERBOSE )
+
+KEYWORD_REGEX = re.compile( r'^[\w,]+$' )
+
+SYNTAX_ARGUMENT_REGEX = re.compile(
+ r"^\w+=.*$" )
+
+SYNTAX_ARGUMENTS = set([
+ 'cchar',
+ 'conceal',
+ 'contained',
+ 'containedin',
+ 'nextgroup',
+ 'skipempty',
+ 'skipnl',
+ 'skipwhite',
+ 'transparent',
+ 'concealends',
+ 'contains',
+ 'display',
+ 'extend',
+ 'fold',
+ 'oneline',
+ 'keepend',
+ 'excludenl',
+])
+
+# We want to parse lines starting with these args
+ALLOWED_SYNTAX_ARGUMENTS = set([
+ 'contained',
+])
+
+# These are the parent groups from which we want to extract keywords
+ROOT_GROUPS = set([
+ 'Statement',
+ 'Boolean',
+ 'Include',
+ 'Type',
+ 'Identifier',
+])
+
+
+class SyntaxGroup( object ):
+ def __init__( self, name, lines = None ):
+ self.name = name
+ self.lines = lines if lines else []
+ self.children = []
+
+
+def SyntaxKeywordsForCurrentBuffer():
+ vim.command( 'redir => b:ycm_syntax' )
+ vim.command( 'silent! syntax list' )
+ vim.command( 'redir END' )
+ syntax_output = vimsupport.VimExpressionToPythonType( 'b:ycm_syntax' )
+ return _KeywordsFromSyntaxListOutput( syntax_output )
+
+
+def _KeywordsFromSyntaxListOutput( syntax_output ):
+ group_name_to_group = _SyntaxGroupsFromOutput( syntax_output )
+ _ConnectGroupChildren( group_name_to_group )
+
+ groups_with_keywords = []
+ for root_group in ROOT_GROUPS:
+ groups_with_keywords.extend(
+ _GetAllDescendentats( group_name_to_group[ root_group ] ) )
+
+ keywords = []
+ for group in groups_with_keywords:
+ keywords.extend( _ExtractKeywordsFromGroup( group ) )
+ return set( keywords )
+
+
+def _SyntaxGroupsFromOutput( syntax_output ):
+ group_name_to_group = _CreateInitialGroupMap()
+ lines = syntax_output.split( '\n' )
+ looking_for_group = True
+
+ current_group = None
+ for line in lines:
+ if not line:
+ continue
+
+ match = SYNTAX_GROUP_REGEX.search( line )
+ if match:
+ if looking_for_group:
+ looking_for_group = False
+ else:
+ group_name_to_group[ current_group.name ] = current_group
+
+ current_group = SyntaxGroup( match.group( 'group_name' ),
+ [ match.group( 'content').strip() ] )
+ else:
+ if looking_for_group:
+ continue
+
+ if line[ 0 ] == ' ' or line[ 0 ] == '\t':
+ current_group.lines.append( line.strip() )
+
+ if current_group:
+ group_name_to_group[ current_group.name ] = current_group
+ return group_name_to_group
+
+
+def _CreateInitialGroupMap():
+ def AddToGroupMap( name, parent ):
+ new_group = SyntaxGroup( name )
+ group_name_to_group[ name ] = new_group
+ parent.children.append( new_group )
+
+ statement_group = SyntaxGroup( 'Statement' )
+ type_group = SyntaxGroup( 'Type' )
+ identifier_group = SyntaxGroup( 'Identifier' )
+
+ # See `:h group-name` for details on how the initial group hierarchy is built
+ group_name_to_group = {
+ 'Statement': statement_group,
+ 'Type': type_group,
+ 'Boolean': SyntaxGroup( 'Boolean' ),
+ 'Include': SyntaxGroup( 'Include' ),
+ 'Identifier': identifier_group,
+ }
+
+ AddToGroupMap( 'Conditional', statement_group )
+ AddToGroupMap( 'Repeat' , statement_group )
+ AddToGroupMap( 'Label' , statement_group )
+ AddToGroupMap( 'Operator' , statement_group )
+ AddToGroupMap( 'Keyword' , statement_group )
+ AddToGroupMap( 'Exception' , statement_group )
+
+ AddToGroupMap( 'StorageClass', type_group )
+ AddToGroupMap( 'Structure' , type_group )
+ AddToGroupMap( 'Typedef' , type_group )
+
+ AddToGroupMap( 'Function', identifier_group )
+
+ return group_name_to_group
+
+
+def _ConnectGroupChildren( group_name_to_group ):
+ def GetParentNames( group ):
+ links_to = 'links to '
+ parent_names = []
+ for line in group.lines:
+ if line.startswith( links_to ):
+ parent_names.append( line[ len( links_to ): ] )
+ return parent_names
+
+ for group in itervalues( group_name_to_group ):
+ parent_names = GetParentNames( group )
+
+ for parent_name in parent_names:
+ try:
+ parent_group = group_name_to_group[ parent_name ]
+ except KeyError:
+ continue
+ parent_group.children.append( group )
+
+
+def _GetAllDescendentats( root_group ):
+ descendants = []
+ for child in root_group.children:
+ descendants.append( child )
+ descendants.extend( _GetAllDescendentats( child ) )
+ return descendants
+
+
+def _ExtractKeywordsFromGroup( group ):
+ keywords = []
+ for line in group.lines:
+ if line.startswith( 'links to ' ):
+ continue
+
+ words = line.split()
+ if not words or ( words[ 0 ] in SYNTAX_ARGUMENTS and
+ words[ 0 ] not in ALLOWED_SYNTAX_ARGUMENTS ):
+ continue
+
+ for word in words:
+ if ( word not in SYNTAX_ARGUMENTS and
+ not SYNTAX_ARGUMENT_REGEX.match( word ) and
+ KEYWORD_REGEX.match( word ) ):
+
+ if word.endswith( ',' ):
+ word = word[ :-1 ]
+ keywords.append( word )
+ return keywords
diff --git a/vim/bundle/YouCompleteMe/python/ycm/test_utils.py b/vim/bundle/YouCompleteMe/python/ycm/test_utils.py
new file mode 100644
index 0000000..3a16255
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/test_utils.py
@@ -0,0 +1,201 @@
+# Copyright (C) 2011, 2012 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from mock import MagicMock
+from hamcrest import assert_that, equal_to
+import re
+import sys
+import nose
+import functools
+
+from ycmd.utils import ToUnicode
+
+
+BUFNR_REGEX = re.compile( r"^bufnr\('(.+)', ([0-9]+)\)$" )
+BUFWINNR_REGEX = re.compile( r"^bufwinnr\(([0-9]+)\)$" )
+BWIPEOUT_REGEX = re.compile( r"^(?:silent! )bwipeout!? ([0-9]+)$" )
+
+# One-and only instance of mocked Vim object. The first 'import vim' that is
+# executed binds the vim module to the instance of MagicMock that is created,
+# and subsquent assignments to sys.modules[ 'vim' ] don't retrospectively
+# update them. The result is that while running the tests, we must assign only
+# one instance of MagicMock to sys.modules[ 'vim' ] and always return it.
+#
+# More explanation is available:
+# https://github.com/Valloric/YouCompleteMe/pull/1694
+VIM_MOCK = MagicMock()
+
+# The default options which are only relevant to the client, not the server and
+# thus are not part of default_options.json, but are required for a working
+# YouCompleteMe or OmniCompleter object.
+DEFAULT_CLIENT_OPTIONS = {
+ 'server_log_level': 'info',
+ 'extra_conf_vim_data': [],
+ 'show_diagnostics_ui': 1,
+ 'enable_diagnostic_signs': 1,
+ 'enable_diagnostic_highlighting': 0,
+ 'always_populate_location_list': 0,
+}
+
+
+def MockGetBufferNumber( buffer_filename ):
+ for buffer in VIM_MOCK.buffers:
+ if buffer[ 'filename' ] == buffer_filename:
+ return buffer[ 'number' ]
+ return -1
+
+
+def MockGetBufferWindowNumber( buffer_number ):
+ for buffer in VIM_MOCK.buffers:
+ if buffer[ 'number' ] == buffer_number and 'window' in buffer:
+ return buffer[ 'window' ]
+ return -1
+
+
+def MockVimEval( value ):
+ if value == "g:ycm_min_num_of_chars_for_completion":
+ return 0
+ if value == "g:ycm_server_python_interpreter":
+ return ''
+ if value == "tempname()":
+ return '_TEMP_FILE_'
+ if value == "&previewheight":
+ # Default value from Vim
+ return 12
+
+ match = BUFNR_REGEX.search( value )
+ if match:
+ return MockGetBufferNumber( match.group( 1 ) )
+
+ match = BUFWINNR_REGEX.search( value )
+ if match:
+ return MockGetBufferWindowNumber( int( match.group( 1 ) ) )
+
+ raise ValueError( 'Unexpected evaluation: ' + value )
+
+
+def MockWipeoutBuffer( buffer_number ):
+ buffers = VIM_MOCK.buffers
+
+ for index, buffer in enumerate( buffers ):
+ if buffer[ 'number' ] == buffer_number:
+ return buffers.pop( index )
+
+
+def MockVimCommand( command ):
+ match = BWIPEOUT_REGEX.search( command )
+ if match:
+ return MockWipeoutBuffer( int( match.group( 1 ) ) )
+
+ raise RuntimeError( 'Unexpected command: ' + command )
+
+
+def MockVimModule():
+ """The 'vim' module is something that is only present when running inside the
+ Vim Python interpreter, so we replace it with a MagicMock for tests. If you
+ need to add additional mocks to vim module functions, then use 'patch' from
+ mock module, to ensure that the state of the vim mock is returned before the
+ next test. That is:
+
+ from ycm.test_utils import MockVimModule
+ from mock import patch
+
+ # Do this once
+ MockVimModule()
+
+ @patch( 'vim.eval', return_value='test' )
+ @patch( 'vim.command', side_effect=ValueError )
+ def test( vim_command, vim_eval ):
+ # use vim.command via vim_command, e.g.:
+ vim_command.assert_has_calls( ... )
+
+ Failure to use this approach may lead to unexpected failures in other
+ tests."""
+
+ VIM_MOCK.buffers = {}
+ VIM_MOCK.eval = MagicMock( side_effect = MockVimEval )
+ sys.modules[ 'vim' ] = VIM_MOCK
+
+ return VIM_MOCK
+
+
+class ExtendedMock( MagicMock ):
+ """An extension to the MagicMock class which adds the ability to check that a
+ callable is called with a precise set of calls in a precise order.
+
+ Example Usage:
+ from ycm.test_utils import ExtendedMock
+ @patch( 'test.testing', new_callable = ExtendedMock, ... )
+ def my_test( test_testing ):
+ ...
+ """
+
+ def assert_has_exact_calls( self, calls, any_order = False ):
+ self.assert_has_calls( calls, any_order )
+ assert_that( self.call_count, equal_to( len( calls ) ) )
+
+
+def ExpectedFailure( reason, *exception_matchers ):
+ """Defines a decorator to be attached to tests. This decorator
+ marks the test as being known to fail, e.g. where documenting or exercising
+ known incorrect behaviour.
+
+ The parameters are:
+ - |reason| a textual description of the reason for the known issue. This
+ is used for the skip reason
+ - |exception_matchers| additional arguments are hamcrest matchers to apply
+ to the exception thrown. If the matchers don't match, then the
+ test is marked as error, with the original exception.
+
+ If the test fails (for the correct reason), then it is marked as skipped.
+ If it fails for any other reason, it is marked as failed.
+ If the test passes, then it is also marked as failed."""
+ def decorator( test ):
+ @functools.wraps( test )
+ def Wrapper( *args, **kwargs ):
+ try:
+ test( *args, **kwargs )
+ except Exception as test_exception:
+ # Ensure that we failed for the right reason
+ test_exception_message = ToUnicode( test_exception )
+ try:
+ for matcher in exception_matchers:
+ assert_that( test_exception_message, matcher )
+ except AssertionError:
+ # Failed for the wrong reason!
+ import traceback
+ print( 'Test failed for the wrong reason: ' + traceback.format_exc() )
+ # Real failure reason is the *original* exception, we're only trapping
+ # and ignoring the exception that is expected.
+ raise test_exception
+
+ # Failed for the right reason
+ raise nose.SkipTest( reason )
+ else:
+ raise AssertionError( 'Test was expected to fail: {0}'.format(
+ reason ) )
+ return Wrapper
+
+ return decorator
diff --git a/vim/bundle/YouCompleteMe/python/ycm/tests/__init__.py b/vim/bundle/YouCompleteMe/python/ycm/tests/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/tests/__init__.py
diff --git a/vim/bundle/YouCompleteMe/python/ycm/tests/base_test.py b/vim/bundle/YouCompleteMe/python/ycm/tests/base_test.py
new file mode 100644
index 0000000..9d1ba27
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/tests/base_test.py
@@ -0,0 +1,270 @@
+# coding: utf-8
+#
+# Copyright (C) 2013 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+import contextlib
+from nose.tools import eq_, ok_
+from mock import patch
+
+from ycm.test_utils import MockVimModule
+vim_mock = MockVimModule()
+from ycm import base
+
+
+@contextlib.contextmanager
+def MockCurrentFiletypes( filetypes = [''] ):
+ with patch( 'ycm.vimsupport.CurrentFiletypes', return_value = filetypes ):
+ yield
+
+
+@contextlib.contextmanager
+def MockCurrentColumnAndLineContents( column, line_contents ):
+ with patch( 'ycm.vimsupport.CurrentColumn', return_value = column ):
+ with patch( 'ycm.vimsupport.CurrentLineContents',
+ return_value = line_contents ):
+ yield
+
+
+@contextlib.contextmanager
+def MockTextAfterCursor( text ):
+ with patch( 'ycm.vimsupport.TextAfterCursor', return_value = text ):
+ yield
+
+
+def AdjustCandidateInsertionText_Basic_test():
+ with MockTextAfterCursor( 'bar' ):
+ eq_( [ { 'abbr': 'foobar', 'word': 'foo' } ],
+ base.AdjustCandidateInsertionText( [ 'foobar' ] ) )
+
+
+def AdjustCandidateInsertionText_ParenInTextAfterCursor_test():
+ with MockTextAfterCursor( 'bar(zoo' ):
+ eq_( [ { 'abbr': 'foobar', 'word': 'foo' } ],
+ base.AdjustCandidateInsertionText( [ 'foobar' ] ) )
+
+
+def AdjustCandidateInsertionText_PlusInTextAfterCursor_test():
+ with MockTextAfterCursor( 'bar+zoo' ):
+ eq_( [ { 'abbr': 'foobar', 'word': 'foo' } ],
+ base.AdjustCandidateInsertionText( [ 'foobar' ] ) )
+
+
+def AdjustCandidateInsertionText_WhitespaceInTextAfterCursor_test():
+ with MockTextAfterCursor( 'bar zoo' ):
+ eq_( [ { 'abbr': 'foobar', 'word': 'foo' } ],
+ base.AdjustCandidateInsertionText( [ 'foobar' ] ) )
+
+
+def AdjustCandidateInsertionText_MoreThanWordMatchingAfterCursor_test():
+ with MockTextAfterCursor( 'bar.h' ):
+ eq_( [ { 'abbr': 'foobar.h', 'word': 'foo' } ],
+ base.AdjustCandidateInsertionText( [ 'foobar.h' ] ) )
+
+ with MockTextAfterCursor( 'bar(zoo' ):
+ eq_( [ { 'abbr': 'foobar(zoo', 'word': 'foo' } ],
+ base.AdjustCandidateInsertionText( [ 'foobar(zoo' ] ) )
+
+
+def AdjustCandidateInsertionText_NotSuffix_test():
+ with MockTextAfterCursor( 'bar' ):
+ eq_( [ { 'abbr': 'foofoo', 'word': 'foofoo' } ],
+ base.AdjustCandidateInsertionText( [ 'foofoo' ] ) )
+
+
+def AdjustCandidateInsertionText_NothingAfterCursor_test():
+ with MockTextAfterCursor( '' ):
+ eq_( [ 'foofoo',
+ 'zobar' ],
+ base.AdjustCandidateInsertionText( [ 'foofoo',
+ 'zobar' ] ) )
+
+
+def AdjustCandidateInsertionText_MultipleStrings_test():
+ with MockTextAfterCursor( 'bar' ):
+ eq_( [ { 'abbr': 'foobar', 'word': 'foo' },
+ { 'abbr': 'zobar', 'word': 'zo' },
+ { 'abbr': 'qbar', 'word': 'q' },
+ { 'abbr': 'bar', 'word': '' }, ],
+ base.AdjustCandidateInsertionText( [ 'foobar',
+ 'zobar',
+ 'qbar',
+ 'bar' ] ) )
+
+
+def AdjustCandidateInsertionText_DictInput_test():
+ with MockTextAfterCursor( 'bar' ):
+ eq_( [ { 'abbr': 'foobar', 'word': 'foo' } ],
+ base.AdjustCandidateInsertionText(
+ [ { 'word': 'foobar' } ] ) )
+
+
+def AdjustCandidateInsertionText_DontTouchAbbr_test():
+ with MockTextAfterCursor( 'bar' ):
+ eq_( [ { 'abbr': '1234', 'word': 'foo' } ],
+ base.AdjustCandidateInsertionText(
+ [ { 'abbr': '1234', 'word': 'foobar' } ] ) )
+
+
+def OverlapLength_Basic_test():
+ eq_( 3, base.OverlapLength( 'foo bar', 'bar zoo' ) )
+ eq_( 3, base.OverlapLength( 'foobar', 'barzoo' ) )
+
+
+def OverlapLength_BasicWithUnicode_test():
+ eq_( 3, base.OverlapLength( u'bar fäö', u'fäö bar' ) )
+ eq_( 3, base.OverlapLength( u'zoofäö', u'fäözoo' ) )
+
+
+def OverlapLength_OneCharOverlap_test():
+ eq_( 1, base.OverlapLength( 'foo b', 'b zoo' ) )
+
+
+def OverlapLength_SameStrings_test():
+ eq_( 6, base.OverlapLength( 'foobar', 'foobar' ) )
+
+
+def OverlapLength_Substring_test():
+ eq_( 6, base.OverlapLength( 'foobar', 'foobarzoo' ) )
+ eq_( 6, base.OverlapLength( 'zoofoobar', 'foobar' ) )
+
+
+def OverlapLength_LongestOverlap_test():
+ eq_( 7, base.OverlapLength( 'bar foo foo', 'foo foo bar' ) )
+
+
+def OverlapLength_EmptyInput_test():
+ eq_( 0, base.OverlapLength( '', 'goobar' ) )
+ eq_( 0, base.OverlapLength( 'foobar', '' ) )
+ eq_( 0, base.OverlapLength( '', '' ) )
+
+
+def OverlapLength_NoOverlap_test():
+ eq_( 0, base.OverlapLength( 'foobar', 'goobar' ) )
+ eq_( 0, base.OverlapLength( 'foobar', '(^($@#$#@' ) )
+ eq_( 0, base.OverlapLength( 'foo bar zoo', 'foo zoo bar' ) )
+
+
+def LastEnteredCharIsIdentifierChar_Basic_test():
+ with MockCurrentFiletypes():
+ with MockCurrentColumnAndLineContents( 3, 'abc' ):
+ ok_( base.LastEnteredCharIsIdentifierChar() )
+
+ with MockCurrentColumnAndLineContents( 2, 'abc' ):
+ ok_( base.LastEnteredCharIsIdentifierChar() )
+
+ with MockCurrentColumnAndLineContents( 1, 'abc' ):
+ ok_( base.LastEnteredCharIsIdentifierChar() )
+
+
+def LastEnteredCharIsIdentifierChar_FiletypeHtml_test():
+ with MockCurrentFiletypes( ['html'] ):
+ with MockCurrentColumnAndLineContents( 3, 'ab-' ):
+ ok_( base.LastEnteredCharIsIdentifierChar() )
+
+
+def LastEnteredCharIsIdentifierChar_ColumnIsZero_test():
+ with MockCurrentColumnAndLineContents( 0, 'abc' ):
+ ok_( not base.LastEnteredCharIsIdentifierChar() )
+
+
+def LastEnteredCharIsIdentifierChar_LineEmpty_test():
+ with MockCurrentFiletypes():
+ with MockCurrentColumnAndLineContents( 3, '' ):
+ ok_( not base.LastEnteredCharIsIdentifierChar() )
+
+ with MockCurrentColumnAndLineContents( 0, '' ):
+ ok_( not base.LastEnteredCharIsIdentifierChar() )
+
+
+def LastEnteredCharIsIdentifierChar_NotIdentChar_test():
+ with MockCurrentFiletypes():
+ with MockCurrentColumnAndLineContents( 3, 'ab;' ):
+ ok_( not base.LastEnteredCharIsIdentifierChar() )
+
+ with MockCurrentColumnAndLineContents( 1, ';' ):
+ ok_( not base.LastEnteredCharIsIdentifierChar() )
+
+ with MockCurrentColumnAndLineContents( 3, 'ab-' ):
+ ok_( not base.LastEnteredCharIsIdentifierChar() )
+
+
+def CurrentIdentifierFinished_Basic_test():
+ with MockCurrentFiletypes():
+ with MockCurrentColumnAndLineContents( 3, 'ab;' ):
+ ok_( base.CurrentIdentifierFinished() )
+
+ with MockCurrentColumnAndLineContents( 2, 'ab;' ):
+ ok_( not base.CurrentIdentifierFinished() )
+
+ with MockCurrentColumnAndLineContents( 1, 'ab;' ):
+ ok_( not base.CurrentIdentifierFinished() )
+
+
+def CurrentIdentifierFinished_NothingBeforeColumn_test():
+ with MockCurrentColumnAndLineContents( 0, 'ab;' ):
+ ok_( base.CurrentIdentifierFinished() )
+
+ with MockCurrentColumnAndLineContents( 0, '' ):
+ ok_( base.CurrentIdentifierFinished() )
+
+
+def CurrentIdentifierFinished_InvalidColumn_test():
+ with MockCurrentFiletypes():
+ with MockCurrentColumnAndLineContents( 5, '' ):
+ ok_( not base.CurrentIdentifierFinished() )
+
+ with MockCurrentColumnAndLineContents( 5, 'abc' ):
+ ok_( not base.CurrentIdentifierFinished() )
+
+
+def CurrentIdentifierFinished_InMiddleOfLine_test():
+ with MockCurrentFiletypes():
+ with MockCurrentColumnAndLineContents( 4, 'bar.zoo' ):
+ ok_( base.CurrentIdentifierFinished() )
+
+ with MockCurrentColumnAndLineContents( 4, 'bar(zoo' ):
+ ok_( base.CurrentIdentifierFinished() )
+
+ with MockCurrentColumnAndLineContents( 4, 'bar-zoo' ):
+ ok_( base.CurrentIdentifierFinished() )
+
+
+def CurrentIdentifierFinished_Html_test():
+ with MockCurrentFiletypes( ['html'] ):
+ with MockCurrentColumnAndLineContents( 4, 'bar-zoo' ):
+ ok_( not base.CurrentIdentifierFinished() )
+
+
+def CurrentIdentifierFinished_WhitespaceOnly_test():
+ with MockCurrentFiletypes():
+ with MockCurrentColumnAndLineContents( 1, '\n' ):
+ ok_( base.CurrentIdentifierFinished() )
+
+ with MockCurrentColumnAndLineContents( 3, '\n ' ):
+ ok_( base.CurrentIdentifierFinished() )
+
+ with MockCurrentColumnAndLineContents( 3, '\t\t\t\t' ):
+ ok_( base.CurrentIdentifierFinished() )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/tests/event_notification_test.py b/vim/bundle/YouCompleteMe/python/ycm/tests/event_notification_test.py
new file mode 100644
index 0000000..c065a1e
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/tests/event_notification_test.py
@@ -0,0 +1,406 @@
+# Copyright (C) 2015 YouCompleteMe contributors
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from ycm.test_utils import MockVimModule, ExtendedMock, DEFAULT_CLIENT_OPTIONS
+MockVimModule()
+
+import contextlib
+import os
+
+from ycm.youcompleteme import YouCompleteMe
+from ycmd import user_options_store
+from ycmd.responses import ( BuildDiagnosticData, Diagnostic, Location, Range,
+ UnknownExtraConf, ServerError )
+
+from mock import call, MagicMock, patch
+from nose.tools import eq_, ok_
+
+
+def PostVimMessage_Call( message ):
+ """Return a mock.call object for a call to vimsupport.PostVimMesasge with the
+ supplied message"""
+ return call( 'redraw | echohl WarningMsg | echom \''
+ + message +
+ '\' | echohl None' )
+
+
+def PostMultiLineNotice_Call( message ):
+ """Return a mock.call object for a call to vimsupport.PostMultiLineNotice with
+ the supplied message"""
+ return call( 'echohl WarningMsg | echo \''
+ + message +
+ '\' | echohl None' )
+
+
+def PresentDialog_Confirm_Call( message ):
+ """Return a mock.call object for a call to vimsupport.PresentDialog, as called
+ why vimsupport.Confirm with the supplied confirmation message"""
+ return call( message, [ 'Ok', 'Cancel' ] )
+
+
+def PlaceSign_Call( sign_id, line_num, buffer_num, is_error ):
+ sign_name = 'YcmError' if is_error else 'YcmWarning'
+ return call( 'sign place {0} line={1} name={2} buffer={3}'
+ .format( sign_id, line_num, sign_name, buffer_num ) )
+
+
+def UnplaceSign_Call( sign_id, buffer_num ):
+ return call( 'try | exec "sign unplace {0} buffer={1}" |'
+ ' catch /E158/ | endtry'.format( sign_id, buffer_num ) )
+
+
+@contextlib.contextmanager
+def MockArbitraryBuffer( filetype, native_available = True ):
+ """Used via the with statement, set up mocked versions of the vim module such
+ that a single buffer is open with an arbitrary name and arbirary contents. Its
+ filetype is set to the supplied filetype"""
+ with patch( 'vim.current' ) as vim_current:
+ def VimEval( value ):
+ """Local mock of the vim.eval() function, used to ensure we get the
+ correct behvaiour"""
+
+ if value == '&omnifunc':
+ # The omnicompleter is not required here
+ return ''
+
+ if value == 'getbufvar(0, "&mod")':
+ # Ensure that we actually send the even to the server
+ return 1
+
+ if value == 'getbufvar(0, "&ft")' or value == '&filetype':
+ return filetype
+
+ if value.startswith( 'bufnr(' ):
+ return 0
+
+ if value.startswith( 'bufwinnr(' ):
+ return 0
+
+ raise ValueError( 'Unexpected evaluation' )
+
+ # Arbitrary, but valid, cursor position
+ vim_current.window.cursor = ( 1, 2 )
+
+ # Arbitrary, but valid, single buffer open
+ current_buffer = MagicMock()
+ current_buffer.number = 0
+ current_buffer.filename = os.path.realpath( 'TEST_BUFFER' )
+ current_buffer.name = 'TEST_BUFFER'
+ current_buffer.window = 0
+
+ # The rest just mock up the Vim module so that our single arbitrary buffer
+ # makes sense to vimsupport module.
+ with patch( 'vim.buffers', [ current_buffer ] ):
+ with patch( 'vim.current.buffer', current_buffer ):
+ with patch( 'vim.eval', side_effect=VimEval ):
+ yield
+
+
+@contextlib.contextmanager
+def MockEventNotification( response_method, native_filetype_completer = True ):
+ """Mock out the EventNotification client request object, replacing the
+ Response handler's JsonFromFuture with the supplied |response_method|.
+ Additionally mock out YouCompleteMe's FiletypeCompleterExistsForFiletype
+ method to return the supplied |native_filetype_completer| parameter, rather
+ than querying the server"""
+
+ # We don't want the event to actually be sent to the server, just have it
+ # return success
+ with patch( 'ycm.client.base_request.BaseRequest.PostDataToHandlerAsync',
+ return_value = MagicMock( return_value=True ) ):
+
+ # We set up a fake a Response (as called by EventNotification.Response)
+ # which calls the supplied callback method. Generally this callback just
+ # raises an apropriate exception, otherwise it would have to return a mock
+ # future object.
+ #
+ # Note: JsonFromFuture is actually part of ycm.client.base_request, but we
+ # must patch where an object is looked up, not where it is defined.
+ # See https://docs.python.org/dev/library/unittest.mock.html#where-to-patch
+ # for details.
+ with patch( 'ycm.client.event_notification.JsonFromFuture',
+ side_effect = response_method ):
+
+ # Filetype available information comes from the server, so rather than
+ # relying on that request, we mock out the check. The caller decides if
+ # filetype completion is available
+ with patch(
+ 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',
+ return_value = native_filetype_completer ):
+
+ yield
+
+
+class EventNotification_test( object ):
+
+ def setUp( self ):
+ options = dict( user_options_store.DefaultOptions() )
+ options.update( DEFAULT_CLIENT_OPTIONS )
+ user_options_store.SetAll( options )
+
+ self.server_state = YouCompleteMe( user_options_store.GetAll() )
+ pass
+
+
+ def tearDown( self ):
+ if self.server_state:
+ self.server_state.OnVimLeave()
+
+
+ @patch( 'vim.command', new_callable = ExtendedMock )
+ def FileReadyToParse_NonDiagnostic_Error_test( self, vim_command ):
+ # This test validates the behaviour of YouCompleteMe.HandleFileParseRequest
+ # in combination with YouCompleteMe.OnFileReadyToParse when the completer
+ # raises an exception handling FileReadyToParse event notification
+ ERROR_TEXT = 'Some completer response text'
+
+ def ErrorResponse( *args ):
+ raise ServerError( ERROR_TEXT )
+
+ with MockArbitraryBuffer( 'javascript' ):
+ with MockEventNotification( ErrorResponse ):
+ self.server_state.OnFileReadyToParse()
+ assert self.server_state.FileParseRequestReady()
+ self.server_state.HandleFileParseRequest()
+
+ # The first call raises a warning
+ vim_command.assert_has_exact_calls( [
+ PostMultiLineNotice_Call( ERROR_TEXT ),
+ ] )
+
+ # Subsequent calls don't re-raise the warning
+ self.server_state.HandleFileParseRequest()
+ vim_command.assert_has_exact_calls( [
+ PostMultiLineNotice_Call( ERROR_TEXT ),
+ ] )
+
+ # But it does if a subsequent event raises again
+ self.server_state.OnFileReadyToParse()
+ assert self.server_state.FileParseRequestReady()
+ self.server_state.HandleFileParseRequest()
+ vim_command.assert_has_exact_calls( [
+ PostMultiLineNotice_Call( ERROR_TEXT ),
+ PostMultiLineNotice_Call( ERROR_TEXT ),
+ ] )
+
+
+ @patch( 'vim.command' )
+ def FileReadyToParse_NonDiagnostic_Error_NonNative_test( self, vim_command ):
+ with MockArbitraryBuffer( 'javascript' ):
+ with MockEventNotification( None, False ):
+ self.server_state.OnFileReadyToParse()
+ self.server_state.HandleFileParseRequest()
+ vim_command.assert_not_called()
+
+
+ @patch( 'ycm.client.event_notification._LoadExtraConfFile',
+ new_callable = ExtendedMock )
+ @patch( 'ycm.client.event_notification._IgnoreExtraConfFile',
+ new_callable = ExtendedMock )
+ def FileReadyToParse_NonDiagnostic_ConfirmExtraConf_test(
+ self,
+ ignore_extra_conf,
+ load_extra_conf,
+ *args ):
+
+ # This test validates the behaviour of YouCompleteMe.HandleFileParseRequest
+ # in combination with YouCompleteMe.OnFileReadyToParse when the completer
+ # raises the (special) UnknownExtraConf exception
+
+ FILE_NAME = 'a_file'
+ MESSAGE = ( 'Found ' + FILE_NAME + '. Load? \n\n(Question can be '
+ 'turned off with options, see YCM docs)' )
+
+ def UnknownExtraConfResponse( *args ):
+ raise UnknownExtraConf( FILE_NAME )
+
+ with MockArbitraryBuffer( 'javascript' ):
+ with MockEventNotification( UnknownExtraConfResponse ):
+
+ # When the user accepts the extra conf, we load it
+ with patch( 'ycm.vimsupport.PresentDialog',
+ return_value = 0,
+ new_callable = ExtendedMock ) as present_dialog:
+ self.server_state.OnFileReadyToParse()
+ assert self.server_state.FileParseRequestReady()
+ self.server_state.HandleFileParseRequest()
+
+ present_dialog.assert_has_exact_calls( [
+ PresentDialog_Confirm_Call( MESSAGE ),
+ ] )
+ load_extra_conf.assert_has_exact_calls( [
+ call( FILE_NAME ),
+ ] )
+
+ # Subsequent calls don't re-raise the warning
+ self.server_state.HandleFileParseRequest()
+
+ present_dialog.assert_has_exact_calls( [
+ PresentDialog_Confirm_Call( MESSAGE )
+ ] )
+ load_extra_conf.assert_has_exact_calls( [
+ call( FILE_NAME ),
+ ] )
+
+ # But it does if a subsequent event raises again
+ self.server_state.OnFileReadyToParse()
+ assert self.server_state.FileParseRequestReady()
+ self.server_state.HandleFileParseRequest()
+
+ present_dialog.assert_has_exact_calls( [
+ PresentDialog_Confirm_Call( MESSAGE ),
+ PresentDialog_Confirm_Call( MESSAGE ),
+ ] )
+ load_extra_conf.assert_has_exact_calls( [
+ call( FILE_NAME ),
+ call( FILE_NAME ),
+ ] )
+
+ # When the user rejects the extra conf, we reject it
+ with patch( 'ycm.vimsupport.PresentDialog',
+ return_value = 1,
+ new_callable = ExtendedMock ) as present_dialog:
+ self.server_state.OnFileReadyToParse()
+ assert self.server_state.FileParseRequestReady()
+ self.server_state.HandleFileParseRequest()
+
+ present_dialog.assert_has_exact_calls( [
+ PresentDialog_Confirm_Call( MESSAGE ),
+ ] )
+ ignore_extra_conf.assert_has_exact_calls( [
+ call( FILE_NAME ),
+ ] )
+
+ # Subsequent calls don't re-raise the warning
+ self.server_state.HandleFileParseRequest()
+
+ present_dialog.assert_has_exact_calls( [
+ PresentDialog_Confirm_Call( MESSAGE )
+ ] )
+ ignore_extra_conf.assert_has_exact_calls( [
+ call( FILE_NAME ),
+ ] )
+
+ # But it does if a subsequent event raises again
+ self.server_state.OnFileReadyToParse()
+ assert self.server_state.FileParseRequestReady()
+ self.server_state.HandleFileParseRequest()
+
+ present_dialog.assert_has_exact_calls( [
+ PresentDialog_Confirm_Call( MESSAGE ),
+ PresentDialog_Confirm_Call( MESSAGE ),
+ ] )
+ ignore_extra_conf.assert_has_exact_calls( [
+ call( FILE_NAME ),
+ call( FILE_NAME ),
+ ] )
+
+
+ def FileReadyToParse_Diagnostic_Error_Native_test( self ):
+ self._Check_FileReadyToParse_Diagnostic_Error()
+ self._Check_FileReadyToParse_Diagnostic_Warning()
+ self._Check_FileReadyToParse_Diagnostic_Clean()
+
+
+ @patch( 'vim.command' )
+ def _Check_FileReadyToParse_Diagnostic_Error( self, vim_command ):
+ # Tests Vim sign placement and error/warning count python API
+ # when one error is returned.
+ def DiagnosticResponse( *args ):
+ start = Location( 1, 2, 'TEST_BUFFER' )
+ end = Location( 1, 4, 'TEST_BUFFER' )
+ extent = Range( start, end )
+ diagnostic = Diagnostic( [], start, extent, 'expected ;', 'ERROR' )
+ return [ BuildDiagnosticData( diagnostic ) ]
+
+ with MockArbitraryBuffer( 'cpp' ):
+ with MockEventNotification( DiagnosticResponse ):
+ self.server_state.OnFileReadyToParse()
+ ok_( self.server_state.FileParseRequestReady() )
+ self.server_state.HandleFileParseRequest()
+ vim_command.assert_has_calls( [
+ PlaceSign_Call( 1, 1, 0, True )
+ ] )
+ eq_( self.server_state.GetErrorCount(), 1 )
+ eq_( self.server_state.GetWarningCount(), 0 )
+
+ # Consequent calls to HandleFileParseRequest shouldn't mess with
+ # existing diagnostics, when there is no new parse request.
+ vim_command.reset_mock()
+ ok_( not self.server_state.FileParseRequestReady() )
+ self.server_state.HandleFileParseRequest()
+ vim_command.assert_not_called()
+ eq_( self.server_state.GetErrorCount(), 1 )
+ eq_( self.server_state.GetWarningCount(), 0 )
+
+
+ @patch( 'vim.command' )
+ def _Check_FileReadyToParse_Diagnostic_Warning( self, vim_command ):
+ # Tests Vim sign placement/unplacement and error/warning count python API
+ # when one warning is returned.
+ # Should be called after _Check_FileReadyToParse_Diagnostic_Error
+ def DiagnosticResponse( *args ):
+ start = Location( 2, 2, 'TEST_BUFFER' )
+ end = Location( 2, 4, 'TEST_BUFFER' )
+ extent = Range( start, end )
+ diagnostic = Diagnostic( [], start, extent, 'cast', 'WARNING' )
+ return [ BuildDiagnosticData( diagnostic ) ]
+
+ with MockArbitraryBuffer( 'cpp' ):
+ with MockEventNotification( DiagnosticResponse ):
+ self.server_state.OnFileReadyToParse()
+ ok_( self.server_state.FileParseRequestReady() )
+ self.server_state.HandleFileParseRequest()
+ vim_command.assert_has_calls( [
+ PlaceSign_Call( 2, 2, 0, False ),
+ UnplaceSign_Call( 1, 0 )
+ ] )
+ eq_( self.server_state.GetErrorCount(), 0 )
+ eq_( self.server_state.GetWarningCount(), 1 )
+
+ # Consequent calls to HandleFileParseRequest shouldn't mess with
+ # existing diagnostics, when there is no new parse request.
+ vim_command.reset_mock()
+ ok_( not self.server_state.FileParseRequestReady() )
+ self.server_state.HandleFileParseRequest()
+ vim_command.assert_not_called()
+ eq_( self.server_state.GetErrorCount(), 0 )
+ eq_( self.server_state.GetWarningCount(), 1 )
+
+
+ @patch( 'vim.command' )
+ def _Check_FileReadyToParse_Diagnostic_Clean( self, vim_command ):
+ # Tests Vim sign unplacement and error/warning count python API
+ # when there are no errors/warnings left.
+ # Should be called after _Check_FileReadyToParse_Diagnostic_Warning
+ with MockArbitraryBuffer( 'cpp' ):
+ with MockEventNotification( MagicMock( return_value = [] ) ):
+ self.server_state.OnFileReadyToParse()
+ self.server_state.HandleFileParseRequest()
+ vim_command.assert_has_calls( [
+ UnplaceSign_Call( 2, 0 )
+ ] )
+ eq_( self.server_state.GetErrorCount(), 0 )
+ eq_( self.server_state.GetWarningCount(), 0 )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/tests/omni_completer_test.py b/vim/bundle/YouCompleteMe/python/ycm/tests/omni_completer_test.py
new file mode 100644
index 0000000..e590847
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/tests/omni_completer_test.py
@@ -0,0 +1,758 @@
+# encoding: utf-8
+#
+# Copyright (C) 2016 YouCompleteMe contributors
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+from future.utils import PY2
+
+from mock import patch, call
+from nose.tools import eq_
+from hamcrest import contains_string
+
+from ycm.test_utils import MockVimModule, ExtendedMock
+MockVimModule()
+
+from ycm.test_utils import DEFAULT_CLIENT_OPTIONS, ExpectedFailure
+from ycm.omni_completer import OmniCompleter
+from ycm.youcompleteme import YouCompleteMe
+
+from ycmd import user_options_store
+from ycmd.utils import ToBytes
+from ycmd.request_wrap import RequestWrap
+
+
+def ToBytesOnPY2( data ):
+ # To test the omnifunc, etc. returning strings, which can be of different
+ # types depending on python version, we use ToBytes on PY2 and just the native
+ # str on python3. This roughly matches what happens between py2 and py3
+ # versions within Vim
+ if PY2:
+ return ToBytes( data )
+
+ return data
+
+
+def BuildRequest( line_num, column_num, contents ):
+ # Note: it would be nice to use ycmd.test_utils.BuildRequest directly here,
+ # but we can't import ycmd.test_utils because that in turn imports ycm_core,
+ # which would cause our "ycm_core not imported" test to fail.
+ return {
+ 'line_num': line_num,
+ 'column_num': column_num,
+ 'filepath': '/test',
+ 'file_data': {
+ '/test': {
+ 'contents': contents,
+ 'filetypes': [ 'java' ] # We need a filetype with a trigger, so we just
+ # use java
+ }
+ }
+ }
+
+
+def BuildRequestWrap( line_num, column_num, contents ):
+ return RequestWrap( BuildRequest( line_num, column_num, contents ) )
+
+
+def MakeUserOptions( custom_options = {} ):
+ options = dict( user_options_store.DefaultOptions() )
+ options.update( DEFAULT_CLIENT_OPTIONS )
+ options.update( custom_options )
+ return options
+
+
+class OmniCompleter_test( object ):
+
+ def setUp( self ):
+ # We need a server instance for FilterAndSortCandidates
+ self._server_state = YouCompleteMe( MakeUserOptions() )
+
+
+ def tearDown( self ):
+ self._server_state.OnVimLeave()
+
+
+ def OmniCompleter_GetCompletions_Cache_List_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 1
+ } ) )
+
+ contents = 'test.'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 6,
+ contents = contents )
+
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = [ ToBytesOnPY2( 'a' ),
+ ToBytesOnPY2( 'b' ),
+ ToBytesOnPY2( 'cdef' ) ]
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'')" ),
+ ] )
+
+ eq_( results, omnifunc_result )
+
+
+ def OmniCompleter_GetCompletions_Cache_ListFilter_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 1
+ } ) )
+
+ contents = 'test.t'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 7,
+ contents = contents )
+
+ eq_( request_data[ 'query' ], 't' )
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = [ ToBytesOnPY2( 'a' ),
+ ToBytesOnPY2( 'b' ),
+ ToBytesOnPY2( 'cdef' ) ]
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'t')" ),
+ ] )
+
+ eq_( results, [] )
+
+
+ def OmniCompleter_GetCompletions_NoCache_List_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 0
+ } ) )
+
+ contents = 'test.'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 6,
+ contents = contents )
+
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = [ ToBytesOnPY2( 'a' ),
+ ToBytesOnPY2( 'b' ),
+ ToBytesOnPY2( 'cdef' ) ]
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'')" ),
+ ] )
+
+ eq_( results, omnifunc_result )
+
+
+ def OmniCompleter_GetCompletions_NoCache_ListFilter_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 0
+ } ) )
+
+ contents = 'test.t'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 7,
+ contents = contents )
+
+ eq_( request_data[ 'query' ], 't' )
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = [ ToBytesOnPY2( 'a' ),
+ ToBytesOnPY2( 'b' ),
+ ToBytesOnPY2( 'cdef' ) ]
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'t')" ),
+ ] )
+
+ # actual result is that the results are not filtered, as we expect the
+ # omniufunc or vim itself to do this filtering
+ eq_( results, omnifunc_result )
+
+
+ @ExpectedFailure( 'We ignore the result of the call to findstart and use our '
+ 'own interpretation of where the identifier should be',
+ contains_string( "test_omnifunc(0,'t')" ) )
+ def OmniCompleter_GetCompletsions_UseFindStart_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 1
+ } ) )
+
+ contents = 'test.t'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 7,
+ contents = contents )
+
+ eq_( request_data[ 'query' ], 't' )
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = [ ToBytesOnPY2( 'a' ),
+ ToBytesOnPY2( 'b' ),
+ ToBytesOnPY2( 'cdef' ) ]
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 1, omnifunc_result ] ) as vim_eval:
+ results = omni_completer.ComputeCandidates( request_data )
+
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+
+ # Fails here: actual result is that the findstart result (1) is ignored
+ # and we use the 't' query as we normally would on the server side
+ call( "test_omnifunc(0,'test.t')" ),
+ ] )
+
+ eq_( results, omnifunc_result )
+
+
+ def OmniCompleter_GetCompletions_Cache_Object_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 1
+ } ) )
+
+ contents = 'test.t'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 7,
+ contents = contents )
+
+ eq_( request_data[ 'query' ], 't' )
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = {
+ 'words': [
+ ToBytesOnPY2( 'a' ),
+ ToBytesOnPY2( 'b' ),
+ ToBytesOnPY2( 'CDtEF' )
+ ]
+ }
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'t')" ),
+ ] )
+
+ eq_( results, [ ToBytesOnPY2( 'CDtEF' ) ] )
+
+
+ def OmniCompleter_GetCompletions_Cache_ObjectList_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 1
+ } ) )
+
+ contents = 'test.tt'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 8,
+ contents = contents )
+
+ eq_( request_data[ 'query' ], 'tt' )
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = [
+ {
+ 'word': ToBytesOnPY2( 'a' ),
+ 'abbr': ToBytesOnPY2( 'ABBR'),
+ 'menu': ToBytesOnPY2( 'MENU' ),
+ 'info': ToBytesOnPY2( 'INFO' ),
+ 'kind': ToBytesOnPY2( 'K' )
+ },
+ {
+ 'word': ToBytesOnPY2( 'test' ),
+ 'abbr': ToBytesOnPY2( 'ABBRTEST'),
+ 'menu': ToBytesOnPY2( 'MENUTEST' ),
+ 'info': ToBytesOnPY2( 'INFOTEST' ),
+ 'kind': ToBytesOnPY2( 'T' )
+ }
+ ]
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'tt')" ),
+ ] )
+
+ eq_( results, [ omnifunc_result[ 1 ] ] )
+
+
+ def OmniCompleter_GetCompletions_NoCache_ObjectList_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 0
+ } ) )
+
+ contents = 'test.tt'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 8,
+ contents = contents )
+
+ eq_( request_data[ 'query' ], 'tt' )
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = [
+ {
+ 'word': ToBytesOnPY2( 'a' ),
+ 'abbr': ToBytesOnPY2( 'ABBR'),
+ 'menu': ToBytesOnPY2( 'MENU' ),
+ 'info': ToBytesOnPY2( 'INFO' ),
+ 'kind': ToBytesOnPY2( 'K' )
+ },
+ {
+ 'word': ToBytesOnPY2( 'test' ),
+ 'abbr': ToBytesOnPY2( 'ABBRTEST'),
+ 'menu': ToBytesOnPY2( 'MENUTEST' ),
+ 'info': ToBytesOnPY2( 'INFOTEST' ),
+ 'kind': ToBytesOnPY2( 'T' )
+ }
+ ]
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'tt')" ),
+ ] )
+
+ # We don't filter the result - we expect the omnifunc to do that
+ # based on the query we supplied (Note: that means no fuzzy matching!)
+ eq_( results, omnifunc_result )
+
+
+ def OmniCompleter_GetCompletions_Cache_ObjectListObject_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 1
+ } ) )
+
+ contents = 'test.tt'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 8,
+ contents = contents )
+
+ eq_( request_data[ 'query' ], 'tt' )
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = {
+ 'words': [
+ {
+ 'word': ToBytesOnPY2( 'a' ),
+ 'abbr': ToBytesOnPY2( 'ABBR'),
+ 'menu': ToBytesOnPY2( 'MENU' ),
+ 'info': ToBytesOnPY2( 'INFO' ),
+ 'kind': ToBytesOnPY2( 'K' )
+ },
+ {
+ 'word': ToBytesOnPY2( 'test' ),
+ 'abbr': ToBytesOnPY2( 'ABBRTEST'),
+ 'menu': ToBytesOnPY2( 'MENUTEST' ),
+ 'info': ToBytesOnPY2( 'INFOTEST' ),
+ 'kind': ToBytesOnPY2( 'T' )
+ }
+ ]
+ }
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'tt')" ),
+ ] )
+
+ eq_( results, [ omnifunc_result[ 'words' ][ 1 ] ] )
+
+
+ def OmniCompleter_GetCompletions_NoCache_ObjectListObject_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 0
+ } ) )
+
+ contents = 'test.tt'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 8,
+ contents = contents )
+
+ eq_( request_data[ 'query' ], 'tt' )
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = {
+ 'words': [
+ {
+ 'word': ToBytesOnPY2( 'a' ),
+ 'abbr': ToBytesOnPY2( 'ABBR'),
+ 'menu': ToBytesOnPY2( 'MENU' ),
+ 'info': ToBytesOnPY2( 'INFO' ),
+ 'kind': ToBytesOnPY2( 'K' )
+ },
+ {
+ 'word': ToBytesOnPY2( 'test' ),
+ 'abbr': ToBytesOnPY2( 'ABBRTEST'),
+ 'menu': ToBytesOnPY2( 'MENUTEST' ),
+ 'info': ToBytesOnPY2( 'INFOTEST' ),
+ 'kind': ToBytesOnPY2( 'T' )
+ }
+ ]
+ }
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'tt')" ),
+ ] )
+
+ # No FilterAndSortCandidates for cache_omnifunc=0 (we expect the omnifunc
+ # to do the filtering?)
+ eq_( results, omnifunc_result[ 'words' ] )
+
+
+ def OmniCompleter_GetCompletions_Cache_List_Unicode_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 1
+ } ) )
+
+ contents = '†åsty_π.'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 13,
+ contents = contents )
+
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = [ ToBytesOnPY2( '†est' ),
+ ToBytesOnPY2( 'å_unicode_identifier' ),
+ ToBytesOnPY2( 'πππππππ yummy πie' ) ]
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'')" ),
+ ] )
+
+ eq_( results, omnifunc_result )
+
+
+ def OmniCompleter_GetCompletions_NoCache_List_Unicode_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 0
+ } ) )
+
+ contents = '†åsty_π.'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 13,
+ contents = contents )
+
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = [ ToBytesOnPY2( '†est' ),
+ ToBytesOnPY2( 'å_unicode_identifier' ),
+ ToBytesOnPY2( 'πππππππ yummy πie' ) ]
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'')" ),
+ ] )
+
+ eq_( results, omnifunc_result )
+
+
+ @ExpectedFailure( 'Filtering on unicode is not supported by the server' )
+ def OmniCompleter_GetCompletions_Cache_List_Filter_Unicode_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 1
+ } ) )
+
+ contents = '†åsty_π.ππ'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 17,
+ contents = contents )
+
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = [ ToBytesOnPY2( '†est' ),
+ ToBytesOnPY2( 'å_unicode_identifier' ),
+ ToBytesOnPY2( 'πππππππ yummy πie' ) ]
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'ππ')" ),
+ ] )
+
+ # Fails here: Filtering on unicode is not supported
+ eq_( results, [ omnifunc_result[ 2 ] ] )
+
+
+ def OmniCompleter_GetCompletions_NoCache_List_Filter_Unicode_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 0
+ } ) )
+
+ contents = '†åsty_π.ππ'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 17,
+ contents = contents )
+
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = [ ToBytesOnPY2( 'πππππππ yummy πie' ) ]
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'ππ')" ),
+ ] )
+
+ eq_( results, omnifunc_result )
+
+
+ @ExpectedFailure( 'Filtering on unicode is not supported by the server' )
+ def OmniCompleter_GetCompletions_Cache_ObjectList_Unicode_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 1
+ } ) )
+
+ contents = '†åsty_π.ππ'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 17,
+ contents = contents )
+
+
+ eq_( request_data[ 'query' ], 'ππ' )
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = [
+ {
+ 'word': ToBytesOnPY2( 'ålpha∫et' ),
+ 'abbr': ToBytesOnPY2( 'å∫∫®'),
+ 'menu': ToBytesOnPY2( 'µ´~¨á' ),
+ 'info': ToBytesOnPY2( '^~fo' ),
+ 'kind': ToBytesOnPY2( '˚' )
+ },
+ {
+ 'word': ToBytesOnPY2( 'π†´ß†π' ),
+ 'abbr': ToBytesOnPY2( 'ÅııÂʉÍÊ'),
+ 'menu': ToBytesOnPY2( '˜‰ˆËʉÍÊ' ),
+ 'info': ToBytesOnPY2( 'ȈÏØʉÍÊ' ),
+ 'kind': ToBytesOnPY2( 'Ê' )
+ }
+ ]
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'ππ')" ),
+ ] )
+
+ # Fails here: Filtering on unicode is not supported
+ eq_( results, [ omnifunc_result[ 1 ] ] )
+
+
+ def OmniCompleter_GetCompletions_Cache_ObjectListObject_Unicode_test( self ):
+ omni_completer = OmniCompleter( MakeUserOptions( {
+ 'cache_omnifunc': 1
+ } ) )
+
+ contents = '†åsty_π.t'
+ request_data = BuildRequestWrap( line_num = 1,
+ column_num = 14,
+ contents = contents )
+
+
+ eq_( request_data[ 'query' ], 't' )
+
+ # Make sure there is an omnifunc set up.
+ with patch( 'vim.eval', return_value = ToBytesOnPY2( 'test_omnifunc' ) ):
+ omni_completer.OnFileReadyToParse( request_data )
+
+ omnifunc_result = {
+ 'words': [
+ {
+ 'word': ToBytesOnPY2( 'ålpha∫et' ),
+ 'abbr': ToBytesOnPY2( 'å∫∫®'),
+ 'menu': ToBytesOnPY2( 'µ´~¨á' ),
+ 'info': ToBytesOnPY2( '^~fo' ),
+ 'kind': ToBytesOnPY2( '˚' )
+ },
+ {
+ 'word': ToBytesOnPY2( 'π†´ß†π' ),
+ 'abbr': ToBytesOnPY2( 'ÅııÂʉÍÊ'),
+ 'menu': ToBytesOnPY2( '˜‰ˆËʉÍÊ' ),
+ 'info': ToBytesOnPY2( 'ȈÏØʉÍÊ' ),
+ 'kind': ToBytesOnPY2( 'Ê' )
+ },
+ {
+ 'word': ToBytesOnPY2( 'test' ),
+ 'abbr': ToBytesOnPY2( 'ÅııÂʉÍÊ'),
+ 'menu': ToBytesOnPY2( '˜‰ˆËʉÍÊ' ),
+ 'info': ToBytesOnPY2( 'ȈÏØʉÍÊ' ),
+ 'kind': ToBytesOnPY2( 'Ê' )
+ }
+ ]
+ }
+
+ # And get the completions
+ with patch( 'vim.eval',
+ new_callable = ExtendedMock,
+ side_effect = [ 6, omnifunc_result ] ) as vim_eval:
+
+ results = omni_completer.ComputeCandidates( request_data )
+
+ vim_eval.assert_has_exact_calls( [
+ call( 'test_omnifunc(1,"")' ),
+ call( "test_omnifunc(0,'t')" ),
+ ] )
+
+ # Note: the filtered results are all unicode objects (not bytes) because
+ # they are passed through the FilterAndSortCandidates machinery
+ # (via the server)
+ eq_( results, [ {
+ 'word': 'test',
+ 'abbr': 'ÅııÂʉÍÊ',
+ 'menu': '˜‰ˆËʉÍÊ',
+ 'info': 'ȈÏØʉÍÊ',
+ 'kind': 'Ê'
+ } ] )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/tests/paths_test.py b/vim/bundle/YouCompleteMe/python/ycm/tests/paths_test.py
new file mode 100644
index 0000000..e390f4f
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/tests/paths_test.py
@@ -0,0 +1,78 @@
+# Copyright (C) 2016 YouCompleteMe contributors
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from ycm.test_utils import MockVimModule
+MockVimModule()
+
+from nose.tools import ok_
+from ycm.paths import EndsWithPython
+
+
+def EndsWithPython_Good( path ):
+ ok_( EndsWithPython( path ) )
+
+
+def EndsWithPython_Bad( path ):
+ ok_( not EndsWithPython( path ) )
+
+
+def EndsWithPython_Python2Paths_test():
+ python_paths = [
+ 'python',
+ 'python2',
+ '/usr/bin/python2.6',
+ '/home/user/.pyenv/shims/python2.7',
+ r'C:\Python26\python.exe'
+ ]
+
+ for path in python_paths:
+ yield EndsWithPython_Good, path
+
+
+
+def EndsWithPython_Python3Paths_test():
+ python_paths = [
+ 'python3',
+ '/usr/bin/python3.3',
+ '/home/user/.pyenv/shims/python3.3',
+ r'C:\Python33\python.exe'
+ ]
+
+ for path in python_paths:
+ yield EndsWithPython_Good, path
+
+
+def EndsWithPython_BadPaths_test():
+ not_python_paths = [
+ None,
+ '',
+ '/opt/local/bin/vim',
+ r'C:\Program Files\Vim\vim74\gvim.exe',
+ '/usr/bin/python2.5',
+ '/home/user/.pyenv/shims/python3.2',
+ ]
+
+ for path in not_python_paths:
+ yield EndsWithPython_Bad, path
diff --git a/vim/bundle/YouCompleteMe/python/ycm/tests/postcomplete_tests.py b/vim/bundle/YouCompleteMe/python/ycm/tests/postcomplete_tests.py
new file mode 100644
index 0000000..11225d4
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/tests/postcomplete_tests.py
@@ -0,0 +1,439 @@
+# encoding: utf-8
+#
+# Copyright (C) 2015 YouCompleteMe contributors
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from ycm.test_utils import MockVimModule
+MockVimModule()
+
+import contextlib
+from hamcrest import assert_that, empty
+from mock import MagicMock, DEFAULT, patch
+from nose.tools import eq_, ok_
+
+from ycmd.utils import ToBytes
+from ycm import vimsupport
+from ycm.youcompleteme import YouCompleteMe
+
+
+def GetVariableValue_CompleteItemIs( word, abbr = None, menu = None,
+ info = None, kind = None ):
+ def Result( variable ):
+ if variable == 'v:completed_item':
+ return {
+ 'word': ToBytes( word ),
+ 'abbr': ToBytes( abbr ),
+ 'menu': ToBytes( menu ),
+ 'info': ToBytes( info ),
+ 'kind': ToBytes( kind ),
+ }
+ return DEFAULT
+ return MagicMock( side_effect = Result )
+
+
+def BuildCompletion( namespace = None, insertion_text = 'Test',
+ menu_text = None, extra_menu_info = None,
+ detailed_info = None, kind = None ):
+ return {
+ 'extra_data': { 'required_namespace_import': namespace },
+ 'insertion_text': insertion_text,
+ 'menu_text': menu_text,
+ 'extra_menu_info': extra_menu_info,
+ 'kind': kind,
+ 'detailed_info': detailed_info,
+ }
+
+
+class PostComplete_test():
+
+ def setUp( self ):
+ self.ycm = YouCompleteMe( MagicMock( spec_set = dict ) )
+
+
+ def tearDown( self ):
+ self.ycm.OnVimLeave()
+
+
+ @contextlib.contextmanager
+ def _SetupForCsharpCompletionDone( self, completions ):
+ with patch( 'ycm.vimsupport.InsertNamespace' ):
+ with patch( 'ycm.vimsupport.TextBeforeCursor',
+ return_value = ' Test' ):
+ request = MagicMock()
+ request.Done = MagicMock( return_value = True )
+ request.RawResponse = MagicMock( return_value = completions )
+ self.ycm._latest_completion_request = request
+ yield
+
+
+ @patch( 'ycm.vimsupport.CurrentFiletypes', return_value = [ 'cs' ] )
+ def GetCompleteDoneHooks_ResultOnCsharp_test( self, *args ):
+ result = self.ycm.GetCompleteDoneHooks()
+ eq_( 1, len( list( result ) ) )
+
+
+ @patch( 'ycm.vimsupport.CurrentFiletypes', return_value = [ 'txt' ] )
+ def GetCompleteDoneHooks_EmptyOnOtherFiletype_test( self, *args ):
+ result = self.ycm.GetCompleteDoneHooks()
+ eq_( 0, len( list( result ) ) )
+
+
+ @patch( 'ycm.vimsupport.CurrentFiletypes', return_value = [ 'txt' ] )
+ def OnCompleteDone_WithActionCallsIt_test( self, *args ):
+ action = MagicMock()
+ self.ycm._complete_done_hooks[ 'txt' ] = action
+ self.ycm.OnCompleteDone()
+
+ ok_( action.called )
+
+
+ @patch( 'ycm.vimsupport.CurrentFiletypes', return_value = [ 'txt' ] )
+ def OnCompleteDone_NoActionNoError_test( self, *args ):
+ self.ycm.OnCompleteDone()
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ @patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( 'Test' ) )
+ def FilterToCompletedCompletions_NewVim_MatchIsReturned_test( self, *args ):
+ completions = [ BuildCompletion( insertion_text = 'Test' ) ]
+ result = self.ycm._FilterToMatchingCompletions( completions, False )
+ eq_( list( result ), completions )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ @patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( 'A' ) )
+ def FilterToCompletedCompletions_NewVim_ShortTextDoesntRaise_test( self,
+ *args ):
+ completions = [ BuildCompletion( insertion_text = 'AAA' ) ]
+ self.ycm._FilterToMatchingCompletions( completions, False )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ @patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( 'Test' ) )
+ def FilterToCompletedCompletions_NewVim_ExactMatchIsReturned_test( self,
+ *args ):
+ completions = [ BuildCompletion( insertion_text = 'Test' ) ]
+ result = self.ycm._FilterToMatchingCompletions( completions, False )
+ eq_( list( result ), completions )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ @patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( ' Quote' ) )
+ def FilterToCompletedCompletions_NewVim_NonMatchIsntReturned_test( self,
+ *args ):
+ completions = [ BuildCompletion( insertion_text = 'A' ) ]
+ result = self.ycm._FilterToMatchingCompletions( completions, False )
+ assert_that( list( result ), empty() )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ @patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( '†es†' ) )
+ def FilterToCompletedCompletions_NewVim_Unicode_test( self, *args ):
+ completions = [ BuildCompletion( insertion_text = '†es†' ) ]
+ result = self.ycm._FilterToMatchingCompletions( completions, False )
+ eq_( list( result ), completions )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Test' )
+ def FilterToCompletedCompletions_OldVim_MatchIsReturned_test( self, *args ):
+ completions = [ BuildCompletion( insertion_text = 'Test' ) ]
+ result = self.ycm._FilterToMatchingCompletions( completions, False )
+ eq_( list( result ), completions )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'X' )
+ def FilterToCompletedCompletions_OldVim_ShortTextDoesntRaise_test( self,
+ *args ):
+ completions = [ BuildCompletion( insertion_text = 'AAA' ) ]
+ self.ycm._FilterToMatchingCompletions( completions, False )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'Test' )
+ def FilterToCompletedCompletions_OldVim_ExactMatchIsReturned_test( self,
+ *args ):
+ completions = [ BuildCompletion( insertion_text = 'Test' ) ]
+ result = self.ycm._FilterToMatchingCompletions( completions, False )
+ eq_( list( result ), completions )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
+ def FilterToCompletedCompletions_OldVim_NonMatchIsntReturned_test( self,
+ *args ):
+ completions = [ BuildCompletion( insertion_text = 'A' ) ]
+ result = self.ycm._FilterToMatchingCompletions( completions, False )
+ assert_that( list( result ), empty() )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'Uniçø∂¢' )
+ def FilterToCompletedCompletions_OldVim_Unicode_test( self, *args ):
+ completions = [ BuildCompletion( insertion_text = 'Uniçø∂¢' ) ]
+ result = self.ycm._FilterToMatchingCompletions( completions, False )
+ assert_that( list( result ), empty() )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Te' )
+ def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_MatchIsReturned_test( # noqa
+ self, *args ):
+ completions = [ BuildCompletion( insertion_text = 'Test' ) ]
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
+ eq_( result, True )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'X' )
+ def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_ShortTextDoesntRaise_test( # noqa
+ self, *args ):
+ completions = [ BuildCompletion( insertion_text = "AAA" ) ]
+ self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'Test' )
+ def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_ExactMatchIsntReturned_test( # noqa
+ self, *args ):
+ completions = [ BuildCompletion( insertion_text = 'Test' ) ]
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
+ eq_( result, False )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
+ def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_NonMatchIsntReturned_test( # noqa
+ self, *args ):
+ completions = [ BuildCompletion( insertion_text = 'A' ) ]
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
+ eq_( result, False )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'Uniç' )
+ def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_Unicode_test(
+ self, *args ):
+ completions = [ BuildCompletion( insertion_text = 'Uniçø∂¢' ) ]
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
+ eq_( result, True )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ @patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( 'Te' ) )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
+ def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_MatchIsReturned_test( # noqa
+ self, *args ):
+ completions = [ BuildCompletion( insertion_text = 'Test' ) ]
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
+ eq_( result, True )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ @patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( 'X' ) )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
+ def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_ShortTextDoesntRaise_test( # noqa
+ self, *args ):
+ completions = [ BuildCompletion( insertion_text = 'AAA' ) ]
+ self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ @patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( 'Test' ) )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
+ def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_ExactMatchIsntReturned_test( # noqa
+ self, *args ):
+ completions = [ BuildCompletion( insertion_text = 'Test' ) ]
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
+ eq_( result, False )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ @patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( ' Quote' ) )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Quote' )
+ def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_NonMatchIsntReturned_test( # noqa
+ self, *args ):
+ completions = [ BuildCompletion( insertion_text = "A" ) ]
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
+ eq_( result, False )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ @patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( 'Uniç' ) )
+ @patch( 'ycm.vimsupport.TextBeforeCursor', return_value = 'Uniç' )
+ def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_Unicode_test(
+ self, *args ):
+ completions = [ BuildCompletion( insertion_text = "Uniçø∂¢" ) ]
+ result = self.ycm._HasCompletionsThatCouldBeCompletedWithMoreText(
+ completions )
+ eq_( result, True )
+
+
+ def GetRequiredNamespaceImport_ReturnNoneForNoExtraData_test( self ):
+ eq_( None, self.ycm._GetRequiredNamespaceImport( {} ) )
+
+
+ def GetRequiredNamespaceImport_ReturnNamespaceFromExtraData_test( self ):
+ namespace = 'A_NAMESPACE'
+ eq_( namespace, self.ycm._GetRequiredNamespaceImport(
+ BuildCompletion( namespace )
+ ) )
+
+
+ def GetCompletionsUserMayHaveCompleted_ReturnEmptyIfNotDone_test( self ):
+ with self._SetupForCsharpCompletionDone( [] ):
+ self.ycm._latest_completion_request.Done = MagicMock(
+ return_value = False )
+ eq_( [], self.ycm.GetCompletionsUserMayHaveCompleted() )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ @patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( 'Te' ) )
+ def GetCompletionsUserMayHaveCompleted_ReturnEmptyIfPendingMatches_NewVim_test( # noqa
+ self, *args ):
+ completions = [ BuildCompletion( None ) ]
+ with self._SetupForCsharpCompletionDone( completions ):
+ eq_( [], self.ycm.GetCompletionsUserMayHaveCompleted() )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ def GetCompletionsUserMayHaveCompleted_ReturnEmptyIfPendingMatches_OldVim_test( # noqa
+ self, *args ):
+ completions = [ BuildCompletion( None ) ]
+ with self._SetupForCsharpCompletionDone( completions ):
+ with patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Te' ):
+ eq_( [], self.ycm.GetCompletionsUserMayHaveCompleted() )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ def GetCompletionsUserMayHaveCompleted_ReturnMatchIfExactMatches_NewVim_test(
+ self, *args ):
+ info = [ 'NS', 'Test', 'Abbr', 'Menu', 'Info', 'Kind' ]
+ completions = [ BuildCompletion( *info ) ]
+ with self._SetupForCsharpCompletionDone( completions ):
+ with patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( *info[ 1: ] ) ):
+ eq_( completions, self.ycm.GetCompletionsUserMayHaveCompleted() )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ def GetCompletionsUserMayHaveCompleted_ReturnMatchIfExactMatchesEvenIfPartial_NewVim_test( # noqa
+ self, *args ):
+ info = [ 'NS', 'Test', 'Abbr', 'Menu', 'Info', 'Kind' ]
+ completions = [ BuildCompletion( *info ),
+ BuildCompletion( insertion_text = 'TestTest' ) ]
+ with self._SetupForCsharpCompletionDone( completions ):
+ with patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( *info[ 1: ] ) ):
+ eq_( [ completions[ 0 ] ],
+ self.ycm.GetCompletionsUserMayHaveCompleted() )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ def GetCompletionsUserMayHaveCompleted_DontReturnMatchIfNontExactMatchesAndPartial_NewVim_test( # noqa
+ self, *args ):
+ info = [ 'NS', 'Test', 'Abbr', 'Menu', 'Info', 'Kind' ]
+ completions = [ BuildCompletion( insertion_text = info[ 0 ] ),
+ BuildCompletion( insertion_text = 'TestTest' ) ]
+ with self._SetupForCsharpCompletionDone( completions ):
+ with patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( *info[ 1: ] ) ):
+ eq_( [], self.ycm.GetCompletionsUserMayHaveCompleted() )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = True )
+ @patch( 'ycm.vimsupport.GetVariableValue',
+ GetVariableValue_CompleteItemIs( 'Test' ) )
+ def GetCompletionsUserMayHaveCompleted_ReturnMatchIfMatches_NewVim_test(
+ self, *args ):
+ completions = [ BuildCompletion( None ) ]
+ with self._SetupForCsharpCompletionDone( completions ):
+ eq_( completions, self.ycm.GetCompletionsUserMayHaveCompleted() )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ def GetCompletionsUserMayHaveCompleted_ReturnMatchIfMatches_OldVim_test(
+ self, *args ):
+ completions = [ BuildCompletion( None ) ]
+ with self._SetupForCsharpCompletionDone( completions ):
+ eq_( completions, self.ycm.GetCompletionsUserMayHaveCompleted() )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ def PostCompleteCsharp_EmptyDoesntInsertNamespace_test( self, *args ):
+ with self._SetupForCsharpCompletionDone( [] ):
+ self.ycm._OnCompleteDone_Csharp()
+ ok_( not vimsupport.InsertNamespace.called )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ def PostCompleteCsharp_ExistingWithoutNamespaceDoesntInsertNamespace_test(
+ self, *args ):
+ completions = [ BuildCompletion( None ) ]
+ with self._SetupForCsharpCompletionDone( completions ):
+ self.ycm._OnCompleteDone_Csharp()
+ ok_( not vimsupport.InsertNamespace.called )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ def PostCompleteCsharp_ValueDoesInsertNamespace_test( self, *args ):
+ namespace = 'A_NAMESPACE'
+ completions = [ BuildCompletion( namespace ) ]
+ with self._SetupForCsharpCompletionDone( completions ):
+ self.ycm._OnCompleteDone_Csharp()
+ vimsupport.InsertNamespace.assert_called_once_with( namespace )
+
+
+ @patch( 'ycm.vimsupport.VimVersionAtLeast', return_value = False )
+ @patch( 'ycm.vimsupport.PresentDialog', return_value = 1 )
+ def PostCompleteCsharp_InsertSecondNamespaceIfSelected_test( self, *args ):
+ namespace = 'A_NAMESPACE'
+ namespace2 = 'ANOTHER_NAMESPACE'
+ completions = [
+ BuildCompletion( namespace ),
+ BuildCompletion( namespace2 ),
+ ]
+ with self._SetupForCsharpCompletionDone( completions ):
+ self.ycm._OnCompleteDone_Csharp()
+ vimsupport.InsertNamespace.assert_called_once_with( namespace2 )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/tests/syntax_parse_test.py b/vim/bundle/YouCompleteMe/python/ycm/tests/syntax_parse_test.py
new file mode 100644
index 0000000..8fe5c79
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/tests/syntax_parse_test.py
@@ -0,0 +1,310 @@
+# Copyright (C) 2013 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from ycm.test_utils import MockVimModule
+MockVimModule()
+
+import os
+from nose.tools import eq_
+from hamcrest import assert_that, has_items
+from ycm import syntax_parse
+from ycmd.utils import ReadFile
+
+
+def ContentsOfTestFile( test_file ):
+ dir_of_script = os.path.dirname( os.path.abspath( __file__ ) )
+ full_path_to_test_file = os.path.join( dir_of_script, 'testdata', test_file )
+ return ReadFile( full_path_to_test_file )
+
+
+
+def KeywordsFromSyntaxListOutput_PythonSyntax_test():
+ eq_( set(['bytearray', 'IndexError', 'all', 'help', 'vars',
+ 'SyntaxError', 'global', 'elif', 'unicode', 'sorted', 'memoryview',
+ 'isinstance', 'except', 'nonlocal', 'NameError', 'finally',
+ 'BytesWarning', 'dict', 'IOError', 'pass', 'oct', 'match', 'bin',
+ 'SystemExit', 'return', 'StandardError', 'format', 'TabError',
+ 'break', 'next', 'not', 'UnicodeDecodeError', 'False',
+ 'RuntimeWarning', 'list', 'iter', 'try', 'reload', 'Warning',
+ 'round', 'dir', 'cmp', 'set', 'bytes', 'UnicodeTranslateError',
+ 'intern', 'issubclass', 'yield', 'Ellipsis', 'hash', 'locals',
+ 'BufferError', 'slice', 'for', 'FloatingPointError', 'sum',
+ 'VMSError', 'getattr', 'abs', 'print', 'import', 'True',
+ 'FutureWarning', 'ImportWarning', 'None', 'EOFError', 'len',
+ 'frozenset', 'ord', 'super', 'raise', 'TypeError',
+ 'KeyboardInterrupt', 'UserWarning', 'filter', 'range',
+ 'staticmethod', 'SystemError', 'or', 'BaseException', 'pow',
+ 'RuntimeError', 'float', 'MemoryError', 'StopIteration', 'globals',
+ 'divmod', 'enumerate', 'apply', 'LookupError', 'open', 'basestring',
+ 'from', 'UnicodeError', 'zip', 'hex', 'long', 'IndentationError',
+ 'int', 'chr', '__import__', 'type', 'Exception', 'continue',
+ 'tuple', 'reduce', 'reversed', 'else', 'assert',
+ 'UnicodeEncodeError', 'input', 'with', 'hasattr', 'delattr',
+ 'setattr', 'raw_input', 'PendingDeprecationWarning', 'compile',
+ 'ArithmeticError', 'while', 'del', 'str', 'property', 'def', 'and',
+ 'GeneratorExit', 'ImportError', 'xrange', 'is', 'EnvironmentError',
+ 'KeyError', 'coerce', 'SyntaxWarning', 'file', 'in', 'unichr',
+ 'ascii', 'any', 'as', 'if', 'OSError', 'DeprecationWarning', 'min',
+ 'UnicodeWarning', 'execfile', 'id', 'complex', 'bool', 'ValueError',
+ 'NotImplemented', 'map', 'exec', 'buffer', 'max', 'class', 'object',
+ 'repr', 'callable', 'ZeroDivisionError', 'eval', '__debug__',
+ 'ReferenceError', 'AssertionError', 'classmethod',
+ 'UnboundLocalError', 'NotImplementedError', 'lambda',
+ 'AttributeError', 'OverflowError', 'WindowsError'] ),
+ syntax_parse._KeywordsFromSyntaxListOutput(
+ ContentsOfTestFile( 'python_syntax' ) ) )
+
+
+def KeywordsFromSyntaxListOutput_CppSyntax_test():
+ eq_( set(['int_fast32_t', 'FILE', 'size_t', 'bitor', 'typedef', 'const',
+ 'struct', 'uint8_t', 'fpos_t', 'thread_local', 'unsigned',
+ 'uint_least16_t', 'match', 'do', 'intptr_t', 'uint_least64_t',
+ 'return', 'auto', 'void', '_Complex', 'break', '_Alignof', 'not',
+ 'using', '_Static_assert', '_Thread_local', 'public',
+ 'uint_fast16_t', 'this', 'continue', 'char32_t', 'int16_t',
+ 'intmax_t', 'static', 'clock_t', 'sizeof', 'int_fast64_t',
+ 'mbstate_t', 'try', 'xor', 'uint_fast32_t', 'int_least8_t', 'div_t',
+ 'volatile', 'template', 'char16_t', 'new', 'ldiv_t',
+ 'int_least16_t', 'va_list', 'uint_least8_t', 'goto', 'noreturn',
+ 'enum', 'static_assert', 'bitand', 'compl', 'imaginary', 'jmp_buf',
+ 'throw', 'asm', 'ptrdiff_t', 'uint16_t', 'or', 'uint_fast8_t',
+ '_Bool', 'int32_t', 'float', 'private', 'restrict', 'wint_t',
+ 'operator', 'not_eq', '_Imaginary', 'alignas', 'union', 'long',
+ 'uint_least32_t', 'int_least64_t', 'friend', 'uintptr_t', 'int8_t',
+ 'else', 'export', 'int_fast8_t', 'catch', 'true', 'case', 'default',
+ 'double', '_Noreturn', 'signed', 'typename', 'while', 'protected',
+ 'wchar_t', 'wctrans_t', 'uint64_t', 'delete', 'and', 'register',
+ 'false', 'int', 'uintmax_t', 'off_t', 'char', 'int64_t',
+ 'int_fast16_t', 'DIR', '_Atomic', 'time_t', 'xor_eq', 'namespace',
+ 'virtual', 'complex', 'bool', 'mutable', 'if', 'int_least32_t',
+ 'sig_atomic_t', 'and_eq', 'ssize_t', 'alignof', '_Alignas',
+ '_Generic', 'extern', 'class', 'typeid', 'short', 'for',
+ 'uint_fast64_t', 'wctype_t', 'explicit', 'or_eq', 'switch',
+ 'uint32_t', 'inline']),
+ syntax_parse._KeywordsFromSyntaxListOutput(
+ ContentsOfTestFile( 'cpp_syntax' ) ) )
+
+
+def KeywordsFromSyntaxListOutput_JavaSyntax_test():
+ eq_( set(['code', 'text', 'cols', 'datetime', 'disabled', 'shape', 'codetype',
+ 'alt', 'compact', 'style', 'valuetype', 'short', 'finally',
+ 'continue', 'extends', 'valign', 'match', 'bordercolor', 'do',
+ 'return', 'rel', 'rules', 'void', 'nohref', 'abbr', 'background',
+ 'scrolling', 'instanceof', 'name', 'summary', 'try', 'default',
+ 'noshade', 'coords', 'dir', 'frame', 'usemap', 'ismap', 'static',
+ 'hspace', 'vlink', 'for', 'selected', 'rev', 'vspace', 'content',
+ 'method', 'version', 'volatile', 'above', 'new', 'charoff', 'public',
+ 'alink', 'enum', 'codebase', 'if', 'noresize', 'interface',
+ 'checked', 'byte', 'super', 'throw', 'src', 'language', 'package',
+ 'standby', 'script', 'longdesc', 'maxlength', 'cellpadding',
+ 'throws', 'tabindex', 'color', 'colspan', 'accesskey', 'float',
+ 'while', 'private', 'height', 'boolean', 'wrap', 'prompt', 'nowrap',
+ 'size', 'rows', 'span', 'clip', 'bgcolor', 'top', 'long', 'start',
+ 'scope', 'scheme', 'type', 'final', 'lang', 'visibility', 'else',
+ 'assert', 'transient', 'link', 'catch', 'true', 'serializable',
+ 'target', 'lowsrc', 'this', 'double', 'align', 'value', 'cite',
+ 'headers', 'below', 'protected', 'declare', 'classid', 'defer',
+ 'false', 'synchronized', 'int', 'abstract', 'accept', 'hreflang',
+ 'char', 'border', 'id', 'native', 'rowspan', 'charset', 'archive',
+ 'strictfp', 'readonly', 'axis', 'cellspacing', 'profile', 'multiple',
+ 'object', 'action', 'pagex', 'pagey', 'marginheight', 'data',
+ 'class', 'frameborder', 'enctype', 'implements', 'break', 'gutter',
+ 'url', 'clear', 'face', 'switch', 'marginwidth', 'width', 'left']),
+ syntax_parse._KeywordsFromSyntaxListOutput(
+ ContentsOfTestFile( 'java_syntax' ) ) )
+
+
+def KeywordsFromSyntaxListOutput_PhpSyntax_ContainsFunctions_test():
+ assert_that( syntax_parse._KeywordsFromSyntaxListOutput(
+ ContentsOfTestFile( 'php_syntax' ) ),
+ has_items( 'array_change_key_case' ) )
+
+
+def KeywordsFromSyntaxListOutput_Basic_test():
+ eq_( set([ 'foo', 'bar', 'zoo', 'goo' ]),
+ syntax_parse._KeywordsFromSyntaxListOutput( """
+foogroup xxx foo bar
+ zoo goo
+ links to Statement""" ) )
+
+
+def KeywordsFromSyntaxListOutput_Function_test():
+ eq_( set([ 'foo', 'bar', 'zoo', 'goo' ]),
+ syntax_parse._KeywordsFromSyntaxListOutput( """
+foogroup xxx foo bar
+ zoo goo
+ links to Function""" ) )
+
+
+def KeywordsFromSyntaxListOutput_ContainedArgAllowed_test():
+ assert_that( syntax_parse._KeywordsFromSyntaxListOutput( """
+phpFunctions xxx contained gzclose yaz_syntax html_entity_decode fbsql_read_blob png2wbmp mssql_init cpdf_set_title gztell fbsql_insert_id empty cpdf_restore mysql_field_type closelog swftext ldap_search curl_errno gmp_div_r mssql_data_seek getmyinode printer_draw_pie mcve_initconn ncurses_getmaxyx defined
+ contained replace_child has_attributes specified insertdocument assign node_name hwstat addshape get_attribute_node html_dump_mem userlist
+ links to Function""" ), # noqa
+ has_items( 'gzclose', 'userlist', 'ldap_search' ) )
+
+
+def KeywordsFromSyntaxListOutput_JunkIgnored_test():
+ eq_( set([ 'foo', 'bar', 'zoo', 'goo' ]),
+ syntax_parse._KeywordsFromSyntaxListOutput( """
+--- Syntax items ---
+foogroup xxx foo bar
+ zoo goo
+ links to Statement
+Spell cluster=NONE
+NoSpell cluster=NONE""" ) )
+
+
+def KeywordsFromSyntaxListOutput_MultipleStatementGroups_test():
+ eq_( set([ 'foo', 'bar', 'zoo', 'goo' ]),
+ syntax_parse._KeywordsFromSyntaxListOutput( """
+foogroup xxx foo bar
+ links to Statement
+bargroup xxx zoo goo
+ links to Statement""" ) )
+
+
+def KeywordsFromSyntaxListOutput_StatementAndTypeGroups_test():
+ eq_( set([ 'foo', 'bar', 'zoo', 'goo' ]),
+ syntax_parse._KeywordsFromSyntaxListOutput( """
+foogroup xxx foo bar
+ links to Statement
+bargroup xxx zoo goo
+ links to Type""" ) )
+
+
+def KeywordsFromSyntaxListOutput_StatementHierarchy_test():
+ eq_( set([ 'foo', 'bar', 'zoo', 'goo', 'qux', 'moo' ]),
+ syntax_parse._KeywordsFromSyntaxListOutput( """
+baa xxx foo bar
+ links to Foo
+Foo xxx zoo goo
+ links to Bar
+Bar xxx qux moo
+ links to Statement""" ) )
+
+
+def KeywordsFromSyntaxListOutput_TypeHierarchy_test():
+ eq_( set([ 'foo', 'bar', 'zoo', 'goo', 'qux', 'moo' ]),
+ syntax_parse._KeywordsFromSyntaxListOutput( """
+baa xxx foo bar
+ links to Foo
+Foo xxx zoo goo
+ links to Bar
+Bar xxx qux moo
+ links to Type""" ) )
+
+
+def KeywordsFromSyntaxListOutput_StatementAndTypeHierarchy_test():
+ eq_( set([ 'foo', 'bar', 'zoo', 'goo', 'qux', 'moo', 'na', 'nb', 'nc' ]),
+ syntax_parse._KeywordsFromSyntaxListOutput( """
+tBaa xxx foo bar
+ links to tFoo
+tFoo xxx zoo goo
+ links to tBar
+tBar xxx qux moo
+ links to Type
+sBaa xxx na bar
+ links to sFoo
+sFoo xxx zoo nb
+ links to sBar
+sBar xxx qux nc
+ links to Statement""" ) )
+
+
+def SyntaxGroupsFromOutput_Basic_test():
+ groups = syntax_parse._SyntaxGroupsFromOutput(
+ """foogroup xxx foo bar
+ zoo goo
+ links to Statement""" )
+
+ assert 'foogroup' in groups
+
+
+def ExtractKeywordsFromGroup_Basic_test():
+ eq_( ['foo', 'bar', 'zoo', 'goo' ],
+ syntax_parse._ExtractKeywordsFromGroup( syntax_parse.SyntaxGroup('', [
+ 'foo bar',
+ 'zoo goo',
+ ] ) ) )
+
+
+def ExtractKeywordsFromGroup_Commas_test():
+ eq_( ['foo', 'bar', 'zoo', 'goo' ],
+ syntax_parse._ExtractKeywordsFromGroup( syntax_parse.SyntaxGroup('', [
+ 'foo, bar,',
+ 'zoo goo',
+ ] ) ) )
+
+
+def ExtractKeywordsFromGroup_WithLinksTo_test():
+ eq_( ['foo', 'bar', 'zoo', 'goo' ],
+ syntax_parse._ExtractKeywordsFromGroup( syntax_parse.SyntaxGroup('', [
+ 'foo bar',
+ 'zoo goo',
+ 'links to Statement'
+ ] ) ) )
+
+
+def ExtractKeywordsFromGroup_KeywordStarts_test():
+ eq_( ['foo', 'bar', 'zoo', 'goo' ],
+ syntax_parse._ExtractKeywordsFromGroup( syntax_parse.SyntaxGroup('', [
+ 'foo bar',
+ 'transparent boo baa',
+ 'zoo goo',
+ ] ) ) )
+
+
+def ExtractKeywordsFromGroup_KeywordMiddle_test():
+ eq_( ['foo', 'bar', 'zoo', 'goo' ],
+ syntax_parse._ExtractKeywordsFromGroup( syntax_parse.SyntaxGroup('', [
+ 'foo oneline bar',
+ 'zoo goo',
+ ] ) ) )
+
+
+def ExtractKeywordsFromGroup_KeywordAssign_test():
+ eq_( ['foo', 'bar', 'zoo', 'goo' ],
+ syntax_parse._ExtractKeywordsFromGroup( syntax_parse.SyntaxGroup('', [
+ 'foo end=zoo((^^//)) bar',
+ 'zoo goo',
+ ] ) ) )
+
+
+def ExtractKeywordsFromGroup_KeywordAssignAndMiddle_test():
+ eq_( ['foo', 'bar', 'zoo', 'goo' ],
+ syntax_parse._ExtractKeywordsFromGroup( syntax_parse.SyntaxGroup('', [
+ 'foo end=zoo((^^//)) transparent bar',
+ 'zoo goo',
+ ] ) ) )
+
+
+def ExtractKeywordsFromGroup_ContainedSyntaxArgAllowed_test():
+ eq_( ['foo', 'zoq', 'bar', 'goo', 'far' ],
+ syntax_parse._ExtractKeywordsFromGroup( syntax_parse.SyntaxGroup('', [
+ 'contained foo zoq',
+ 'contained bar goo',
+ 'far',
+ ] ) ) )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/tests/testdata/cpp_syntax b/vim/bundle/YouCompleteMe/python/ycm/tests/testdata/cpp_syntax
new file mode 100644
index 0000000..4d111a5
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/tests/testdata/cpp_syntax
@@ -0,0 +1,160 @@
+--- Syntax items ---
+cCustomFunc xxx match /\w\+\s*\((\)\@=/
+ links to Function
+cCustomClass xxx match /\w\+\s*\(::\)\@=/
+ links to Function
+OperatorChars xxx match #?\|+\|-\|\*\|;\|:\|,\|<\|>\|&\||\|!\|\~\|%\|=\|)\|(\|{\|}\|\.\|\[\|\]\|/\(/\|*\)\@!#
+cStatement xxx return goto asm continue break
+ links to Statement
+cLabel xxx default case
+ links to Label
+cConditional xxx if switch else
+ links to Conditional
+cRepeat xxx for while do
+ links to Repeat
+cTodo xxx contained XXX FIXME TODO
+ links to Todo
+cBadContinuation xxx match /\\\s\+$/ contained
+ links to Error
+cSpecial xxx match /\\\(x\x\+\|\o\{1,3}\|.\|$\)/ display contained
+ match /\\\(u\x\{4}\|U\x\{8}\)/ display contained
+ links to SpecialChar
+cFormat xxx match /%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)/ display contained
+ match /%%/ display contained
+ links to cSpecial
+cString xxx start=/L\="/ skip=/\\\\\|\\"/ end=/"/ extend contains=cSpecial,cFormat,@Spell
+ start=/\%(U\|u8\=\)"/ skip=/\\\\\|\\"/ end=/"/ extend contains=cSpecial,cFormat,@Spell
+ links to String
+cCppString xxx start=/L\="/ skip=/\\\\\|\\"\|\\$/ end=/$/ end=/"/ excludenl contains=cSpecial,cFormat,@Spell
+ links to cString
+cCharacter xxx match /L\='[^\\]'/
+ match /L'[^']*'/ contains=cSpecial
+ match /[Uu]'[^\\]'/
+ match /[Uu]'[^']*'/ contains=cSpecial
+ links to Character
+cSpecialError xxx match /L\='\\[^'\"?\\abfnrtv]'/
+ match /[Uu]'\\[^'\"?\\abfnrtv]'/
+ links to cError
+cSpecialCharacter xxx match /L\='\\['\"?\\abfnrtv]'/
+ match /L\='\\\o\{1,3}'/ display
+ match /'\\x\x\{1,2}'/ display
+ match /L'\\x\x\+'/ display
+ match /[Uu]'\\['\"?\\abfnrtv]'/
+ match /[Uu]'\\\o\{1,3}'/ display
+ match /[Uu]'\\x\x\+'/ display
+ links to cSpecial
+cBadBlock xxx start=/{/ end=/}/ contained keepend transparent fold containedin=cParen,cBracket,cBadBlock
+cErrInParen xxx match /[\]{}]\|<%\|%>/ display contained
+ links to cError
+cCppParen xxx start=/(/ skip=/\\$/ end=/$/ end=/)/ contained excludenl transparent contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
+cErrInBracket xxx match /[);{}]\|<%\|%>/ display contained
+ links to cError
+cCppBracket xxx start=/\[\|<::\@!/ skip=/\\$/ end=/$/ end=/]\|:>/ contained excludenl transparent contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
+cBlock xxx start=/{/ end=/}/ transparent fold
+cParenError xxx match /[\])]/ display
+ links to cError
+cIncluded xxx start=/"/ skip=/\\\\\|\\"/ end=/"/ display contained
+ match /<[^>]*>/ display contained
+ links to cString
+cCommentStartError xxx match +/\*+me=e-1 display contained
+ links to cError
+cUserCont xxx match /^\s*\I\i*\s*:$/ display contains=@cLabelGroup
+ match /;\s*\I\i*\s*:$/ display contains=@cLabelGroup
+ match /^\s*\I\i*\s*:[^:]/me=e-1 display contains=@cLabelGroup
+ match /;\s*\I\i*\s*:[^:]/me=e-1 display contains=@cLabelGroup
+cUserLabel xxx match /\I\i*/ display contained
+ links to Label
+cBitField xxx match /^\s*\I\i*\s*:\s*[1-9]/me=e-1 display contains=cType
+ match /;\s*\I\i*\s*:\s*[1-9]/me=e-1 display contains=cType
+cOctalZero xxx match /\<0/ display contained
+ links to PreProc
+cNumber xxx match /\d\+\(u\=l\{0,2}\|ll\=u\)\>/ display contained
+ match /0x\x\+\(u\=l\{0,2}\|ll\=u\)\>/ display contained
+ links to Number
+cFloat xxx match /\d\+f/ display contained
+ match /\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=/ display contained
+ match /\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>/ display contained
+ match /\d\+e[-+]\=\d\+[fl]\=\>/ display contained
+ match /0x\x*\.\x\+p[-+]\=\d\+[fl]\=\>/ display contained
+ match /0x\x\+\.\=p[-+]\=\d\+[fl]\=\>/ display contained
+ links to Float
+cOctal xxx match /0\o\+\(u\=l\{0,2}\|ll\=u\)\>/ display contained contains=cOctalZero
+ links to Number
+cOctalError xxx match /0\o*[89]\d*/ display contained
+ links to cError
+cNumbersCom xxx match /\<\d\|\.\d/ display contained transparent contains=cNumber,cFloat,cOctal
+cParen xxx start=/(/ end=/}/me=s-1 end=/)/ transparent contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
+cBracket xxx start=/\[\|<::\@!/ end=/}/me=s-1 end=/]\|:>/ transparent contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
+cNumbers xxx match /\<\d\|\.\d/ display transparent contains=cNumber,cFloat,cOctalError,cOctal
+cCommentL xxx start=+//+ skip=/\\$/ end=/$/ keepend contains=@cCommentGroup,cSpaceError,@Spell
+ links to cComment
+cComment xxx matchgroup=cCommentStart start=+/\*+ end=+\*/+ extend fold contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell
+ links to Comment
+cCommentError xxx match +\*/+ display
+ links to cError
+cOperator xxx _Generic sizeof _Alignof _Static_assert alignof static_assert
+ links to Operator
+cType xxx wchar_t uint8_t uint_fast32_t _Bool int_fast8_t float off_t _Complex uint_least32_t int_fast16_t int_fast32_t ptrdiff_t uintptr_t uint64_t uint_fast8_t int_least32_t long void wint_t complex uint_least8_t uint16_t uint_fast64_t imaginary int32_t unsigned char16_t FILE uint_least64_t int_least8_t va_list intptr_t int_fast64_t uint_fast16_t fpos_t size_t wctrans_t div_t jmp_buf uintmax_t mbstate_t int_least64_t _Imaginary uint_least16_t int8_t time_t DIR clock_t sig_atomic_t wctype_t int_least16_t ldiv_t bool ssize_t uint32_t double short char intmax_t int64_t char32_t int int16_t signed
+ links to Type
+cStructure xxx struct union typedef enum
+ links to Structure
+cStorageClass xxx inline const volatile alignas register thread_local _Noreturn static extern _Alignas _Atomic restrict noreturn _Thread_local auto
+ links to StorageClass
+cConstant xxx stderr USHRT_MAX CHAR_BIT SIGINT SIGINT EINVAL LDBL_MIN_EXP INT_FAST32_MIN UINT_LEAST16_MAX LONG_MAX EROFS EXIT_FAILURE ENOTSUP SCHAR_MAX SEEK_END EINPROGRESS SLONG_MIN SIGSEGV SIGSEGV UINT_FAST8_MAX EINTR true ENOSYS INT32_MAX ULLONG_MAX SINT_MIN SIGALRM SHRT_MIN INT64_MAX WINT_MAX ENOTDIR INT_FAST16_MAX ESPIPE __FILE__ M_PI TMP_MAX MB_LEN_MAX SIGKILL DBL_MIN_10_EXP INT_LEAST8_MAX LC_COLLATE ENOSPC HUGE_VAL EIO INT8_MAX LC_MONETARY LDBL_MIN INT_LEAST16_MIN INT_FAST64_MIN INT_MAX EILSEQ FLT_MANT_DIG INT_FAST32_MAX __func__ FLT_MIN EOF false DBL_MIN_EXP ETIMEDOUT INT_FAST8_MIN M_LN10 FLT_EPSILON stdin INT_FAST64_MAX EISDIR ENOENT UINTMAX_MAX SIGSTOP UINT_LEAST32_MAX LDBL_MIN_10_EXP SLONG_MAX SIG_ATOMIC_MIN SIZE_MAX SIGTERM SIGTERM EPERM NULL FOPEN_MAX EMFILE UINT_LEAST64_MAX DBL_MAX SIGFPE SIGFPE INT_LEAST32_MIN SIGPIPE SINT_MAX SHRT_MAX __STDC_VERSION__ SIGQUIT UINT16_MAX SSHRT_MIN INT_LEAST64_MIN M_SQRT2 INTPTR_MAX EMSGSIZE DBL_MANT_DIG _IOFBF DBL_MAX_10_EXP stdout SIGUSR2 LC_ALL EMLINK SIGTTOU SIGHUP SIGHUP LDBL_MAX INT_LEAST16_MAX UINT32_MAX __DATE__ FLT_MAX FILENAME_MAX INT_FAST8_MAX BUFSIZ UINT64_MAX EBADMSG INT_MIN UCHAR_MAX LDBL_EPSILON FLT_MIN_10_EXP SIGABRT SIGABRT SIG_ATOMIC_MAX M_E LLONG_MIN UINT_FAST16_MAX ECHILD INT_LEAST32_MAX M_1_PI LDBL_DIG ENOLCK L_tmpnam ENOTTY FLT_DIG SSHRT_MAX INT_LEAST64_MAX EACCES WEOF __LINE__ UINT_LEAST8_MAX __TIME__ CHAR_MIN M_PI_2 _IONBF M_PI_4 __STDC__ UINT_FAST32_MAX FLT_ROUNDS SEEK_SET EBUSY INTMAX_MIN FLT_MAX_10_EXP LC_TIME CLOCKS_PER_SEC ENXIO ERANGE _IOLBF ENODEV EXDEV FLT_MIN_EXP EFAULT M_2_PI WCHAR_MIN LDBL_MAX_EXP DBL_EPSILON ULONG_MAX ENOMEM SIGTRAP UINT_MAX M_LOG2E LLONG_MAX LDBL_MAX_10_EXP SIG_IGN M_SQRT1_2 EDEADLK ENOTEMPTY LC_NUMERIC ENOEXEC INT16_MIN PTRDIFF_MIN ESRCH MB_CUR_MAX RAND_MAX M_LN2 ENFILE INTPTR_MIN EXIT_SUCCESS CHAR_MAX SIGILL SIGILL LONG_MIN INT_LEAST8_MIN SCHAR_MIN SIG_DFL SEEK_CUR SIGTTIN FLT_MAX_EXP EDOM INT32_MIN SIGUSR1 ECANCELED UINT8_MAX EEXIST LDBL_MANT_DIG EAGAIN INT64_MIN WINT_MIN INT_FAST16_MIN LC_CTYPE ENAMETOOLONG EBADF M_LOG10E E2BIG SIGCONT M_2_SQRTPI WCHAR_MAX DBL_MAX_EXP EPIPE SIGTSTP UINTPTR_MAX UINT_FAST64_MAX SIGCHLD INTMAX_MAX EFBIG SIG_ERR INT8_MIN INT16_MAX PTRDIFF_MAX FLT_RADIX DBL_MIN DBL_DIG
+ links to Constant
+cPreCondit xxx start=/^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>/ skip=/\\$/ end=/$/ keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
+ links to PreCondit
+cPreConditMatch xxx match /^\s*\(%:\|#\)\s*\(else\|endif\)\>/ display
+ links to cPreCondit
+cCppInIf xxx matchgroup=cCppInWrapper start=/\d\+/ end=/^\s*\(%:\|#\)\s*endif\>/ contained contains=TOP,cPreCondit
+cCppInElse xxx start==^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)= end=/.\@=\|$/ contained fold contains=cCppInElse2 containedin=cCppInIf
+cCppInElse2 xxx matchgroup=cCppInWrapper start=+^\s*\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*+ end=/^\s*\(%:\|#\)\s*endif\>/me=s-1 contained contains=cSpaceError,cCppOutSkip
+ links to cCppOutIf2
+cCppOutIf xxx start=/0\+/ matchgroup=cCppOutWrapper end=/^\s*\(%:\|#\)\s*endif\>/ contained contains=cCppOutIf2,cCppOutElse
+cCppOutIf2 xxx matchgroup=cCppOutWrapper start=/0\+/ end==^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)=me=s-1 contained fold contains=cSpaceError,cCppOutSkip
+ links to cCppOut2
+cCppOutElse xxx matchgroup=cCppOutWrapper start=/^\s*\(%:\|#\)\s*\(else\|elif\)/ end=/^\s*\(%:\|#\)\s*endif\>/me=s-1 contained contains=TOP,cPreCondit
+cCppInSkip xxx matchgroup=cCppInWrapper start==^\s*\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)= skip=/\\$/ end=/^\s*\(%:\|#\)\s*endif\>/ contained contains=TOP,cPreProc containedin=cCppOutElse,cCppInIf,cCppInSkip
+cCppOutSkip xxx start=/^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)/ skip=/\\$/ end=/^\s*\(%:\|#\)\s*endif\>/ contained contains=cSpaceError,cCppOutSkip
+ links to cCppOutIf2
+cCppOutWrapper xxx start==^\s*\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)= end=/.\@=\|$/ fold contains=cCppOutIf,cCppOutElse
+ links to cPreCondit
+cCppInWrapper xxx start==^\s*\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)= end=/.\@=\|$/ fold contains=cCppInIf,cCppInElse
+ links to cCppOutWrapper
+cPreProc xxx start=/^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)/ skip=/\\$/ end=/$/ keepend contains=ALLBUT,@cPreProcGroup,@Spell
+ links to PreProc
+cInclude xxx match /^\s*\(%:\|#\)\s*include\>\s*["<]/ display contains=cIncluded
+ links to Include
+cDefine xxx start=/^\s*\(%:\|#\)\s*\(define\|undef\)\>/ skip=/\\$/ end=/$/ keepend contains=ALLBUT,@cPreProcGroup,@Spell
+ links to Macro
+cMulti xxx start=/?/ skip=/::/ end=/:/ transparent contains=ALLBUT,@cMultiGroup,@Spell
+cppStatement xxx this delete using friend new
+ links to Statement
+cppAccess xxx public protected private
+ links to cppStatement
+cppType xxx wchar_t inline explicit virtual export bool
+ links to Type
+cppExceptions xxx catch try throw
+ links to Exception
+cppOperator xxx bitand or compl operator and_eq not_eq xor_eq bitor xor and or_eq not typeid
+ links to Operator
+cppCast xxx match /\<\(const\|static\|dynamic\|reinterpret\)_cast\s*</me=e-1
+ match /\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$/
+ links to cppStatement
+cppStorageClass xxx mutable
+ links to StorageClass
+cppStructure xxx class typename template namespace
+ links to Structure
+cppNumber xxx NPOS
+ links to Number
+cppBoolean xxx true false
+ links to Boolean
+cppMinMax xxx match /[<>]?/
+cCommentGroup cluster=cTodo,cBadContinuation
+Spell cluster=NONE
+cParenGroup cluster=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
+cCppOutInGroup cluster=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip
+cPreProcGroup cluster=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock
+cMultiGroup cluster=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
+cLabelGroup cluster=cUserLabel
+
diff --git a/vim/bundle/YouCompleteMe/python/ycm/tests/testdata/java_syntax b/vim/bundle/YouCompleteMe/python/ycm/tests/testdata/java_syntax
new file mode 100644
index 0000000..595f25d
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/tests/testdata/java_syntax
@@ -0,0 +1,231 @@
+--- Syntax items ---
+htmlValue xxx match /=[\t ]*[^'" \t>][^ \t>]*/hs=s+1 contained contains=javaScriptExpression,@htmlPreproc
+ links to Normal
+cCustomFunc xxx match /\w\+\s*\((\)\@=/
+ links to Function
+cCustomClass xxx match /\w\+\s*\(::\)\@=/
+ links to Function
+OperatorChars xxx match #?\|+\|-\|\*\|;\|:\|,\|<\|>\|&\||\|!\|\~\|%\|=\|)\|(\|{\|}\|\.\|\[\|\]\|/\(/\|*\)\@!#
+javaFold xxx start=/{/ end=/}/ transparent fold
+javaError xxx const goto
+ match /[\\@`]/
+ match +<<<\|\.\.\|=>\|||=\|&&=\|[^-]->\|\*\/+
+ links to Error
+javaOK xxx match /\.\.\./
+javaError2 xxx match /#\|=</
+ links to javaError
+javaExternal xxx native package
+ match /\<import\>\(\s\+static\>\)\?/
+ links to Include
+javaConditional xxx if else switch
+ links to Conditional
+javaRepeat xxx do for while
+ links to Repeat
+javaBoolean xxx true false
+ links to Boolean
+javaConstant xxx null
+ links to Constant
+javaTypedef xxx this super
+ match /\.\s*\<class\>/ms=s+1
+ links to Typedef
+javaOperator xxx new instanceof
+ links to Operator
+javaType xxx float boolean long void double short char byte int
+ links to Type
+javaStatement xxx return
+ links to Statement
+javaStorageClass xxx transient strictfp serializable synchronized static final volatile
+ links to StorageClass
+javaExceptions xxx finally catch try throw
+ links to Exception
+javaAssert xxx assert
+ links to Statement
+javaMethodDecl xxx synchronized throws
+ links to javaStorageClass
+javaClassDecl xxx interface implements enum extends
+ match /^class\>/
+ match /[^.]\s*\<class\>/ms=s+1
+ match /@interface\>/
+ links to javaStorageClass
+javaAnnotation xxx match /@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>/
+ links to PreProc
+javaBranch xxx nextgroup=javaUserLabelRef skipwhite continue
+ nextgroup=javaUserLabelRef skipwhite break
+ links to Conditional
+javaUserLabelRef xxx match /\k\+/ contained
+ links to javaUserLabel
+javaVarArg xxx match /\.\.\./
+ links to Function
+javaScopeDecl xxx protected public private abstract
+ links to javaStorageClass
+javaLabel xxx default
+ links to Label
+javaNumber xxx match /\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>/
+ match /\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=/
+ match /\<\d\+[eE][-+]\=\d\+[fFdD]\=\>/
+ match /\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>/
+ links to Number
+javaCharacter xxx match /'[^']*'/ contains=javaSpecialChar,javaSpecialCharError
+ match /'\\''/ contains=javaSpecialChar
+ match /'[^\\]'/
+ links to Character
+javaLabelRegion xxx matchgroup=javaLabel start=/\<case\>/ matchgroup=NONE end=/:/ transparent contains=javaNumber,javaCharacter
+javaUserLabel xxx match /^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:/he=e-1 contains=javaLabel
+ links to Label
+javaTodo xxx contained TODO XXX FIXME
+ links to Todo
+javaSpecial xxx match /\\u\d\{4\}/
+ links to Special
+javaCommentStar xxx match +^\s*\*[^/]+me=e-1 contained
+ match /^\s*\*$/ contained
+ links to javaComment
+javaSpecialChar xxx match /\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\)/ contained
+ links to SpecialChar
+javaComment xxx start=+/\*+ end=+\*/+ contains=@javaCommentSpecial,javaTodo,@Spell
+ match +/\*\*/+
+ links to Comment
+javaLineComment xxx match +//.*+ contains=@javaCommentSpecial2,javaTodo,@Spell
+ links to Comment
+javaString xxx start=/"/ end=/$/ end=/"/ contains=javaSpecialChar,javaSpecialError,@Spell
+ links to String
+htmlError xxx match /[<>&]/ contained
+ links to Error
+htmlSpecialChar xxx match /&#\=[0-9A-Za-z]\{1,8};/ contained
+ links to Special
+htmlString xxx start=/"/ end=/"/ contained contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
+ start=/'/ end=/'/ contained contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
+ links to String
+htmlTagN xxx match /<\s*[-a-zA-Z0-9]\+/hs=s+1 contained contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
+ match =</\s*[-a-zA-Z0-9]\+=hs=s+2 contained contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
+htmlTagError xxx match /[^>]</ms=s+1 contained
+ links to htmlError
+htmlEndTag xxx start=+</+ end=/>/ contained contains=htmlTagN,htmlTagError
+ links to Identifier
+htmlArg xxx contained below color name gutter span classid alt marginheight target rows bgcolor ismap cellspacing object codetype frame noshade data for bordercolor clip rowspan defer cellpadding shape usemap rules multiple start selected language summary hspace lowsrc type valign hreflang noresize scheme
+ contained class visibility checked pagex pagey headers scrolling clear charset id id declare codebase tabindex standby version link accept coords alink background vspace wrap profile width compact marginwidth above content border top maxlength prompt dir value charoff height longdesc nowrap
+ contained accesskey cols cite rel rev style method size src axis vlink valuetype colspan nohref face lang frameborder enctype readonly action left text url char align scope code disabled abbr datetime archive
+ match /\<\(http-equiv\|href\|title\)=/me=e-1 contained
+ match /\<z-index\>/ contained
+ match /\<\(accept-charset\|label\)\>/ contained
+ links to Type
+htmlTag xxx start=+<[^/]+ end=/>/ contained fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
+ links to Function
+htmlTagName xxx contained marquee span ol thead pre blink tbody a p q s object legend frame acronym noframes blockquote var table input hr button bdo font caption sub del sup col basefont xmp iframe dfn html meta nobr fieldset optgroup option applet link area map li td th tr tt param center address small frameset
+ contained label ul dir div kbd cite big layer form textarea base tfoot br strike samp select menu colgroup img nolayer spacer ilayer code abbr isindex dd ins dl dt noscript
+ match /\<\(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title\)\>/ contained
+ links to htmlStatement
+htmlSpecialTagName xxx contained script style
+ links to Exception
+htmlCommentPart xxx start=/--/ end=/--\s*/ contained contains=@htmlPreproc,@Spell
+ links to Comment
+htmlCommentError xxx match /[^><!]/ contained
+ links to htmlError
+htmlComment xxx start=/<!/ end=/>/ contained contains=htmlCommentPart,htmlCommentError,@Spell
+ start=/<!DOCTYPE/ end=/>/ contained keepend
+ links to Comment
+htmlPreStmt xxx match /<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>/ contained
+ links to PreProc
+htmlPreError xxx match /<!--#\S*/ms=s+4 contained
+ links to Error
+htmlPreAttr xxx match /\w\+=[^"]\S\+/ contained contains=htmlPreProcAttrError,htmlPreProcAttrName
+ start=/\w\+="/ skip=/\\\\\|\\"/ end=/"/ contained keepend contains=htmlPreProcAttrName
+ links to String
+htmlPreProc xxx start=/<!--#/ end=/-->/ contained contains=htmlPreStmt,htmlPreError,htmlPreAttr
+ links to PreProc
+htmlPreProcAttrError xxx match /\w\+=/he=e-1 contained
+ links to Error
+htmlPreProcAttrName xxx match /\(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)=/he=e-1 contained
+ links to PreProc
+htmlLink xxx start=/<a\>\_[^>]*\<href\>/ end=+</a>+me=e-4 contained contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLeadingSpace,javaScript,@htmlPreproc
+ links to Underlined
+htmlBoldUnderline xxx start=/<u\>/ end=+</u>+me=e-4 contained contains=@htmlTop,htmlBoldUnderlineItalic
+htmlBoldItalic xxx start=/<i\>/ end=+</i>+me=e-4 contained contains=@htmlTop,htmlBoldItalicUnderline
+ start=/<em\>/ end=+</em>+me=e-5 contained contains=@htmlTop,htmlBoldItalicUnderline
+htmlBold xxx start=/<b\>/ end=+</b>+me=e-4 contained contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
+ start=/<strong\>/ end=+</strong>+me=e-9 contained contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
+htmlBoldUnderlineItalic xxx start=/<i\>/ end=+</i>+me=e-4 contained contains=@htmlTop
+ start=/<em\>/ end=+</em>+me=e-5 contained contains=@htmlTop
+htmlBoldItalicUnderline xxx start=/<u\>/ end=+</u>+me=e-4 contained contains=@htmlTop,htmlBoldUnderlineItalic
+ links to htmlBoldUnderlineItalic
+htmlUnderlineBold xxx start=/<b\>/ end=+</b>+me=e-4 contained contains=@htmlTop,htmlUnderlineBoldItalic
+ start=/<strong\>/ end=+</strong>+me=e-9 contained contains=@htmlTop,htmlUnderlineBoldItalic
+ links to htmlBoldUnderline
+htmlUnderlineItalic xxx start=/<i\>/ end=+</i>+me=e-4 contained contains=@htmlTop,htmlUnderlineItalicBold
+ start=/<em\>/ end=+</em>+me=e-5 contained contains=@htmlTop,htmlUnderlineItalicBold
+htmlUnderline xxx start=/<u\>/ end=+</u>+me=e-4 contained contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic
+htmlUnderlineBoldItalic xxx start=/<i\>/ end=+</i>+me=e-4 contained contains=@htmlTop
+ start=/<em\>/ end=+</em>+me=e-5 contained contains=@htmlTop
+ links to htmlBoldUnderlineItalic
+htmlUnderlineItalicBold xxx start=/<b\>/ end=+</b>+me=e-4 contained contains=@htmlTop
+ start=/<strong\>/ end=+</strong>+me=e-9 contained contains=@htmlTop
+ links to htmlBoldUnderlineItalic
+htmlItalicBold xxx start=/<b\>/ end=+</b>+me=e-4 contained contains=@htmlTop,htmlItalicBoldUnderline
+ start=/<strong\>/ end=+</strong>+me=e-9 contained contains=@htmlTop,htmlItalicBoldUnderline
+ links to htmlBoldItalic
+htmlItalicUnderline xxx start=/<u\>/ end=+</u>+me=e-4 contained contains=@htmlTop,htmlItalicUnderlineBold
+ links to htmlUnderlineItalic
+htmlItalic xxx start=/<i\>/ end=+</i>+me=e-4 contained contains=@htmlTop,htmlItalicBold,htmlItalicUnderline
+ start=/<em\>/ end=+</em>+me=e-5 contained contains=@htmlTop
+htmlItalicBoldUnderline xxx start=/<u\>/ end=+</u>+me=e-4 contained contains=@htmlTop
+ links to htmlBoldUnderlineItalic
+htmlItalicUnderlineBold xxx start=/<b\>/ end=+</b>+me=e-4 contained contains=@htmlTop
+ start=/<strong\>/ end=+</strong>+me=e-9 contained contains=@htmlTop
+ links to htmlBoldUnderlineItalic
+htmlLeadingSpace xxx match /^\s\+/ contained
+ links to None
+htmlH1 xxx start=/<h1\>/ end=+</h1>+me=e-5 contained contains=@htmlTop
+ links to Title
+htmlH2 xxx start=/<h2\>/ end=+</h2>+me=e-5 contained contains=@htmlTop
+ links to htmlH1
+htmlH3 xxx start=/<h3\>/ end=+</h3>+me=e-5 contained contains=@htmlTop
+ links to htmlH2
+htmlH4 xxx start=/<h4\>/ end=+</h4>+me=e-5 contained contains=@htmlTop
+ links to htmlH3
+htmlH5 xxx start=/<h5\>/ end=+</h5>+me=e-5 contained contains=@htmlTop
+ links to htmlH4
+htmlH6 xxx start=/<h6\>/ end=+</h6>+me=e-5 contained contains=@htmlTop
+ links to htmlH5
+htmlTitle xxx start=/<title\>/ end=+</title>+me=e-8 contained contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
+ links to Title
+htmlHead xxx start=/<head\>/ end=/<h[1-6]\>/me=e-3 end=/<body\>/me=e-5 end=+</head>+me=e-7 contained contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc
+ links to PreProc
+javaCommentTitle xxx matchgroup=javaDocComment start=+/\*\*+ matchgroup=javaCommentTitle end=+\*/+me=s-1,he=s-1 end=/[^{]@/me=s-2,he=s-1 end=/\.[ \t\r<&]/me=e-1 end=/\.$/ contained keepend contains=@javaHtml,javaCommentStar,javaTodo,@Spell,javaDocTags,javaDocSeeTag
+ links to SpecialComment
+javaDocTags xxx start=/{@\(code\|link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)/ end=/}/ contained
+ match /@\(param\|exception\|throws\|since\)\s\+\S\+/ contained contains=javaDocParam
+ match /@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>/ contained
+ links to Special
+javaDocSeeTag xxx matchgroup=javaDocTags start=/@see\s\+/ matchgroup=NONE end=/\_./re=e-1 contained contains=javaDocSeeTagParam
+javaDocComment xxx start=+/\*\*+ end=+\*/+ keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaTodo,@Spell
+ links to Comment
+javaDocParam xxx match /\s\S\+/ contained
+ links to Function
+javaDocSeeTagParam xxx match @"\_[^"]\+"\|<a\s\+\_.\{-}</a>\|\(\k\|\.\)*\(#\k\+\((\_[^)]\+)\)\=\)\=@ contained extend
+ links to Function
+javaSpecialError xxx match /\\./ contained
+ links to Error
+javaSpecialCharError xxx match /[^']/ contained
+ links to Error
+javaParenT1 xxx matchgroup=javaParen1 start=/(/ end=/)/ contained transparent contains=@javaTop,javaParenT2
+ matchgroup=javaParen1 start=/\[/ end=/\]/ contained transparent contains=@javaTop,javaParenT2
+javaParenT xxx matchgroup=javaParen start=/(/ end=/)/ transparent contains=@javaTop,javaParenT1
+ matchgroup=javaParen start=/\[/ end=/\]/ transparent contains=@javaTop,javaParenT1
+javaParenT2 xxx matchgroup=javaParen2 start=/(/ end=/)/ contained transparent contains=@javaTop,javaParenT
+ matchgroup=javaParen2 start=/\[/ end=/\]/ contained transparent contains=@javaTop,javaParenT
+javaParenError xxx match /)/
+ match /\]/
+ links to javaError
+javaTop cluster=javaError,javaError,javaError,javaError2,javaExternal,javaConditional,javaRepeat,javaBoolean,javaConstant,javaTypedef,javaOperator,javaType,javaType,javaStatement,javaStorageClass,javaExceptions,javaAssert,javaMethodDecl,javaClassDecl,javaClassDecl,javaClassDecl,javaAnnotation,javaBranch,javaVarArg,javaScopeDecl,javaLangObject,javaLabel,javaNumber,javaCharacter,javaLabelRegion,javaUserLabel,javaSpecial,javaComment,javaLineComment,javaString,javaStringError
+Spell cluster=NONE
+javaCommentSpecial cluster=NONE
+javaCommentSpecial2 cluster=NONE
+javaHtml cluster=htmlError,htmlSpecialChar,htmlEndTag,htmlTag,htmlComment,htmlPreProc,htmlLink,htmlBold,htmlUnderline,htmlItalic,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,htmlTitle,htmlHead
+htmlPreproc cluster=NONE
+htmlArgCluster cluster=NONE
+htmlTagNameCluster cluster=NONE
+htmlTop cluster=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
+htmlJavaScript cluster=@htmlPreproc
+htmlVbScript cluster=NONE
+htmlCss cluster=NONE
+javaClasses cluster=NONE
+
diff --git a/vim/bundle/YouCompleteMe/python/ycm/tests/testdata/php_syntax b/vim/bundle/YouCompleteMe/python/ycm/tests/testdata/php_syntax
new file mode 100644
index 0000000..10105dc
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/tests/testdata/php_syntax
@@ -0,0 +1,1862 @@
+
+
+--- Syntax items ---
+htmlValue xxx match /=[\t ]*[^'" \t>][^ \t>]*/hs=s+1 contained contains=javaScriptExpression,@htmlPreproc
+ links to Normal
+trailingWhitespace xxx match /\v\s+%#@<!$/ containedin=ALLBUT,trailingWhitespace,literalTab
+ match /\v\s+%#@<!$/ contained containedin=ALLBUT,trailingWhitespace,literalTab
+ match /\v\s+%#@<!$/ contained containedin=ALLBUT,trailingWhitespace,literalTab
+ match /\v\s+%#@<!$/ contained containedin=ALLBUT,trailingWhitespace,literalTab
+ links to Todo
+literalTab xxx match /\v\t/ containedin=ALL
+ match /\v\t/ contained containedin=ALL
+ match /\v\t/ contained containedin=ALL
+ match /\v\t/ contained containedin=ALL
+ links to Todo
+cCustomFunc xxx match /\w\+\s*\((\)\@=/
+ links to Function
+cCustomClass xxx match /\w\+\s*\(::\)\@=/
+ links to Function
+OperatorChars xxx match #?\|+\|-\|\*\|;\|:\|,\|<\|>\|&\||\|!\|\~\|%\|=\|)\|(\|{\|}\|\.\|\[\|\]\|/\(/\|*\)\@!#
+htmlTagName xxx contained path hgroup feBlend animateTransform glyphRef altGlyphItem feImage altGlyph embed feOffset glyph g ellipse feMerge symbol details clipPath canvas section view data vkern command altGlyphDef radialGradient bdi output image feSpecularLighting meter filter stop font-face-format header
+ contained textPath feConvolveMatrix tspan rp rt svg polygon mark font hkern figure datalist feComposite template font-face-name feDisplacementMap feMergeNode circle feSpotLight mask wbr main nav font-face tref line rect foreignObject missing-glyph audio figcaption pattern content video article time
+ contained footer fePointLight feGaussianBlur defs switch aside feComponentTransfer animate source feFlood set animateMotion linearGradient feTile font-face-uri polyline marker feDiffuseLighting ruby font-face-src dialog menu feDistantLight feTurbulence summary feColorMatrix text color-profile
+ contained feFuncA feFuncB feFuncG progress feFuncR keygen mpath desc feMorphology track shadow cursor animateColor use
+ contained marquee a p q s noframes blockquote button caption big meta address form img ilayer ins var fieldset option applet link frameset br dd dl dt noscript bdo tbody nobr cite li strike colgroup acronym select ol blink td th tr tt ul kbd textarea thead table input param center layer base tfoot
+ contained samp nolayer code font sub sup col optgroup iframe menu object hr span del xmp dfn html legend small dir div abbr isindex pre basefont spacer area map frame label
+ match /\<[a-z_]\+\(\-[a-z_]\+\)\+\>/ contained
+ match /\<\(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title\)\>/ contained
+ links to htmlStatement
+htmlArg xxx contained accumulate font-stretch font-stretch stdDeviation keySplines color list strikethrough-position clip-path path edgeMode marker-mid maskContentUnits opacity media media onselect local onloadeddata glyphRef onvolumechange scale ondragstart onseeking transform targetX targetY primitiveUnits
+ contained fx text-anchor v-mathematical onkeypress onmousemove onmousemove direction additive string onsuspend d contenteditable ascent format format glyph-orientation-vertical numOctaves in2 r u x y operator kind srclang name pubdate spreadMethod xlink:href marker-end glyph-orientation-horizontal
+ contained k onloadstart preserveAspectRatio itemprop xlink:role color-interpolation-filters stitchTiles formtarget orientation placeholder diffuseConstant onforminput azimuth fy onafterprint writing-mode onresize onresize onfocusin onplaying attributeType onzoom alignment-baseline stroke-linecap
+ contained contextmenu zoomAndPan g1 g2 onreadystatechange ondblclick patternTransform spacing onblur onblur ry ononline itemid tabindex origin ondragover repeatDur dominant-baseline limitingConeAngle intercept method font-variant font-variant onmessage requiredFeatures filter onredo vert-origin-x
+ contained kernelMatrix step markerUnits 1 slope async ideographic oncanplaythrough offset offset result alphabetic icon controls onended x2 descent onemptied min min onpause type ondrag x1 gradientUnits ondragenter divisor keyPoints v-alphabetic overline-thickness preload stroke-dasharray
+ contained xlink:type overline-position attributeName from elevation bbox rx formnovalidate font-size-adjust class class externalResourcesRequired visibility accent-height stroke rotate amplitude vert-adv-y viewBox oninput onmouseout onmouseout onerror onerror onerror loop lengthAdjust
+ contained enable-background fill fill onshow xml:space xml:space radius onabort onabort mathematical onplay k2 contentScriptType onprogress onoffline unicode-bidi word-spacing maskUnits onfocusout charset mode lighting-color stroke-width id id onmouseover onmouseover poster restart in mask
+ contained fill-opacity is onscroll onscroll formaction underline-thickness v-ideographic markerWidth version oncontextmenu onchange onmousewheel patternUnits clip max max target hanging font-family font-family calcMode arabic-form begin vert-origin-y color-interpolation rendering-intent to onsubmit
+ contained stroke-opacity pointsAtX pointsAtY pointsAtZ requiredExtensions exponent pathLength onrepeat stroke-linejoin onstalled onfocus onfocus onwaiting z baseline-shift itemtype u2 width oncanplay flood-opacity underline-position xlink:title units-per-em onformchange k1 onpopstate k3 end stemh
+ contained specularConstant onbeforeprint order stemv label unicode-range onkeyup points oninvalid onmouseup onmouseup text-decoration itemscope onclick onclick dir baseProfile onload onload onload onload onbeforeunload contentStyleType values onactivate specularExponent widths hidden autofocus
+ contained autofocus cap-height repeatCount onloadedmetadata height translate strikethrough-thickness draggable bias startOffset xlink:actuate xlink:actuate ondrop accesskey systemLanguage xChannelSelector shape-rendering stop-opacity color-rendering clipPathUnits formmethod title title ondragleave
+ contained panose-1 horiz-origin-y text-rendering glyph-name pointer-events overflow flood-color onhashchange stop-color autoplay xlink:show xlink:show onbegin font-size font-size form letter-spacing filterUnits fill-rule clip-rule refX refY by onkeydown markerHeight stroke-dashoffset xmlns lang
+ contained lang kernelUnitLength font-style font-style orient open style unicode gradientTransform horiz-adv-x v-hanging preserveAlpha onend onmousedown onmousedown display dur patternContentUnits seed kerning k4 onunload onunload ondragend y1 baseFrequency textLength cx cy dx spellcheck
+ contained autocomplete x-height font-weight font-weight color-profile ontimeupdate itemref onstorage viewTarget onseeked image-rendering ondurationchange marker-start xml:base xml:base required yChannelSelector track keyTimes filterRes surfaceScale select datetime xml:lang xml:lang cursor
+ contained stroke-miterlimit onratechange formenctype dy y2 xlink:arcrole tableValues onundo
+ contained usemap target bgcolor ismap shape language scheme headers content axis noshade style vlink nohref left disabled color classid alt marginheight data cellpadding gutter class scrolling link codebase longdesc rel rev lang datetime archive media noresize start hspace cols hreflang visibility
+ contained charset id id version width compact border charoff accesskey cite codetype valuetype enctype rows for valign profile value face text bordercolor defer multiple lowsrc pagex pagey checked declare above maxlength nowrap colspan align scope code src cellspacing standby accept coords wrap
+ contained alink size action prompt type below name object readonly rowspan span selected vspace top dir height frameborder summary char abbr method rules tabindex background clear clip url marginwidth frame
+ match /\<\(data\(\-[a-z]\+\)\+\)\=\>/ contained
+ match /\<\(http-equiv\|href\|title\)=/me=e-1 contained
+ match /\<z-index\>/ contained
+ match /\<\(accept-charset\|label\)\>/ contained
+ links to Type
+htmlError xxx match /[<>&]/
+ links to Error
+htmlSpecialChar xxx match /&#\=[0-9A-Za-z]\{1,8};/
+ links to Special
+javaScriptExpression xxx start=/&{/ end=/};/ contained keepend contains=@htmlJavaScript,@htmlPreproc
+ links to javaScript
+htmlString xxx start=/"/ end=/"/ contained contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
+ start=/'/ end=/'/ contained contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
+ links to String
+htmlTagN xxx match /<\s*[-a-zA-Z0-9]\+/hs=s+1 contained contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
+ match =</\s*[-a-zA-Z0-9]\+=hs=s+2 contained contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
+htmlTagError xxx match /[^>]</ms=s+1 contained
+ links to htmlError
+htmlEndTag xxx start=+</+ end=/>/ contains=htmlTagN,htmlTagError
+ links to Identifier
+htmlEvent xxx start=/\<on\a\+\s*=[\t ]*'/ end=/'/ contained keepend contains=htmlEventSQ
+ start=/\<on\a\+\s*=[\t ]*"/ end=/"/ contained keepend contains=htmlEventDQ
+ links to javaScript
+htmlCssDefinition xxx matchgroup=htmlArg start=/style="/ matchgroup=htmlString end=/"/ keepend contains=cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString,@htmlPreproc
+ links to Special
+htmlTag xxx start=+<[^/]+ end=/>/ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
+ links to Function
+htmlSpecialTagName xxx contained style script
+ links to Exception
+htmlCommentPart xxx start=/--/ end=/--\s*/ contained contains=@htmlPreproc,@Spell
+ links to Comment
+htmlCommentError xxx match /[^><!]/ contained
+ links to htmlError
+htmlComment xxx start=/<!/ end=/>/ contains=htmlCommentPart,htmlCommentError,@Spell
+ start=/<!DOCTYPE/ end=/>/ keepend
+ links to Comment
+htmlPreStmt xxx match /<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>/ contained
+ links to PreProc
+htmlPreError xxx match /<!--#\S*/ms=s+4 contained
+ links to Error
+htmlPreAttr xxx match /\w\+=[^"]\S\+/ contained contains=htmlPreProcAttrError,htmlPreProcAttrName
+ start=/\w\+="/ skip=/\\\\\|\\"/ end=/"/ contained keepend contains=htmlPreProcAttrName
+ links to String
+htmlPreProc xxx start=/<!--#/ end=/-->/ contains=htmlPreStmt,htmlPreError,htmlPreAttr
+ links to PreProc
+htmlPreProcAttrError xxx match /\w\+=/he=e-1 contained
+ links to Error
+htmlPreProcAttrName xxx match /\(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)=/he=e-1 contained
+ links to PreProc
+htmlLink xxx start=/<a\>\_[^>]*\<href\>/ end=+</a>+me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLeadingSpace,javaScript,@htmlPreproc
+ links to Underlined
+javaScript xxx start=/<script\_[^>]*>/ end=+</script>+me=s-1 keepend contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
+ start=/<script \_[^>]*language *=\_[^>]*vbscript\_[^>]*>/ end=+</script>+me=s-1 keepend contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
+ links to Special
+htmlBoldUnderline xxx start=/<u\>/ end=+</u>+me=e-4 contained contains=@htmlTop,htmlBoldUnderlineItalic
+htmlBoldItalic xxx start=/<i\>/ end=+</i>+me=e-4 contained contains=@htmlTop,htmlBoldItalicUnderline
+ start=/<em\>/ end=+</em>+me=e-5 contained contains=@htmlTop,htmlBoldItalicUnderline
+htmlBold xxx start=/<b\>/ end=+</b>+me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
+ start=/<strong\>/ end=+</strong>+me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
+htmlBoldUnderlineItalic xxx start=/<i\>/ end=+</i>+me=e-4 contained contains=@htmlTop
+ start=/<em\>/ end=+</em>+me=e-5 contained contains=@htmlTop
+htmlBoldItalicUnderline xxx start=/<u\>/ end=+</u>+me=e-4 contained contains=@htmlTop,htmlBoldUnderlineItalic
+ links to htmlBoldUnderlineItalic
+htmlUnderlineBold xxx start=/<b\>/ end=+</b>+me=e-4 contained contains=@htmlTop,htmlUnderlineBoldItalic
+ start=/<strong\>/ end=+</strong>+me=e-9 contained contains=@htmlTop,htmlUnderlineBoldItalic
+ links to htmlBoldUnderline
+htmlUnderlineItalic xxx start=/<i\>/ end=+</i>+me=e-4 contained contains=@htmlTop,htmlUnderlineItalicBold
+ start=/<em\>/ end=+</em>+me=e-5 contained contains=@htmlTop,htmlUnderlineItalicBold
+htmlUnderline xxx start=/<u\>/ end=+</u>+me=e-4 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic
+htmlUnderlineBoldItalic xxx start=/<i\>/ end=+</i>+me=e-4 contained contains=@htmlTop
+ start=/<em\>/ end=+</em>+me=e-5 contained contains=@htmlTop
+ links to htmlBoldUnderlineItalic
+htmlUnderlineItalicBold xxx start=/<b\>/ end=+</b>+me=e-4 contained contains=@htmlTop
+ start=/<strong\>/ end=+</strong>+me=e-9 contained contains=@htmlTop
+ links to htmlBoldUnderlineItalic
+htmlItalicBold xxx start=/<b\>/ end=+</b>+me=e-4 contained contains=@htmlTop,htmlItalicBoldUnderline
+ start=/<strong\>/ end=+</strong>+me=e-9 contained contains=@htmlTop,htmlItalicBoldUnderline
+ links to htmlBoldItalic
+htmlItalicUnderline xxx start=/<u\>/ end=+</u>+me=e-4 contained contains=@htmlTop,htmlItalicUnderlineBold
+ links to htmlUnderlineItalic
+htmlItalic xxx start=/<i\>/ end=+</i>+me=e-4 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline
+ start=/<em\>/ end=+</em>+me=e-5 contains=@htmlTop
+htmlItalicBoldUnderline xxx start=/<u\>/ end=+</u>+me=e-4 contained contains=@htmlTop
+ links to htmlBoldUnderlineItalic
+htmlItalicUnderlineBold xxx start=/<b\>/ end=+</b>+me=e-4 contained contains=@htmlTop
+ start=/<strong\>/ end=+</strong>+me=e-9 contained contains=@htmlTop
+ links to htmlBoldUnderlineItalic
+htmlLeadingSpace xxx match /^\s\+/ contained
+ links to None
+htmlH1 xxx start=/<h1\>/ end=+</h1>+me=e-5 contains=@htmlTop
+ links to Title
+htmlH2 xxx start=/<h2\>/ end=+</h2>+me=e-5 contains=@htmlTop
+ links to htmlH1
+htmlH3 xxx start=/<h3\>/ end=+</h3>+me=e-5 contains=@htmlTop
+ links to htmlH2
+htmlH4 xxx start=/<h4\>/ end=+</h4>+me=e-5 contains=@htmlTop
+ links to htmlH3
+htmlH5 xxx start=/<h5\>/ end=+</h5>+me=e-5 contains=@htmlTop
+ links to htmlH4
+htmlH6 xxx start=/<h6\>/ end=+</h6>+me=e-5 contains=@htmlTop
+ links to htmlH5
+htmlTitle xxx start=/<title\>/ end=+</title>+me=e-8 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
+ links to Title
+cssStyle xxx start=/<style/ end=+</style>+ keepend contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc
+htmlHead xxx start=/<head\>/ end=/<h[1-6]\>/me=e-3 end=/<body\>/me=e-5 end=+</head>+me=e-7 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc
+ links to PreProc
+javaScriptCommentTodo xxx contained tbd todo fixme xxx
+ links to Todo
+javaScriptLineComment xxx match +\/\/.*+ contained contains=@Spell,javaScriptCommentTodo
+ links to Comment
+javaScriptCommentSkip xxx match /^[ \t]*\*\($\|[ \t]\+\)/ contained
+javaScriptComment xxx start=+/\*+ end=+\*/+ contained contains=@Spell,javaScriptCommentTodo
+ links to Comment
+javaScriptSpecial xxx match /\\\d\d\d\|\\./ contained
+ links to Special
+javaScriptStringD xxx start=/"/ skip=/\\\\\|\\"/ end=/"\|$/ contained contains=javaScriptSpecial,@htmlPreproc
+ links to String
+javaScriptStringS xxx start=/'/ skip=/\\\\\|\\'/ end=/'\|$/ contained contains=javaScriptSpecial,@htmlPreproc
+ links to String
+javaScriptSpecialCharacter xxx match /'\\.'/ contained
+ links to javaScriptSpecial
+javaScriptNumber xxx match /-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>/ contained
+ links to javaScriptValue
+javaScriptRegexpString xxx start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gim]\{0,2\}\s*[;.,)\]}]+me=e-1 end=+/[gim]\{0,2\}\s*$+ contained oneline contains=@htmlPreproc
+ links to String
+javaScriptConditional xxx contained switch if else
+ links to Conditional
+javaScriptRepeat xxx contained do for while in
+ links to Repeat
+javaScriptBranch xxx contained continue break
+ links to Conditional
+javaScriptOperator xxx contained new typeof instanceof delete
+ links to Operator
+javaScriptType xxx contained number function array string boolean regexp object date
+ links to Type
+javaScriptStatement xxx contained return with
+ links to Statement
+javaScriptBoolean xxx contained false true
+ links to Boolean
+javaScriptNull xxx contained undefined null
+ links to Keyword
+javaScriptIdentifier xxx contained this var arguments let
+ links to Identifier
+javaScriptLabel xxx contained case default
+ links to Label
+javaScriptException xxx contained catch try finally throw
+ links to Exception
+javaScriptMessage xxx contained status confirm prompt alert
+ links to Keyword
+javaScriptGlobal xxx contained window self parent top
+ links to Keyword
+javaScriptMember xxx contained event location document
+ links to Keyword
+javaScriptDeprecated xxx contained unescape escape
+ links to Exception
+javaScriptReserved xxx contained const import enum debugger int implements extends class synchronized final goto static boolean float interface short byte super protected export long public native double package transient private volatile char abstract throws
+ links to Keyword
+javaScriptFunction xxx contained function
+ links to Function
+javaScriptBraces xxx match /[{}\[\]]/ contained
+ links to Function
+javaScriptParens xxx match /[()]/ contained
+htmlCssStyleComment xxx match /\(<!--\|-->\)/ contained
+ links to Comment
+htmlScriptTag xxx start=/<script/ end=/>/ contained fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
+ links to htmlTag
+htmlEventSQ xxx start=/'/ms=s+1 end=/'/me=s-1 contained contains=@htmlJavaScript
+ links to htmlEvent
+htmlEventDQ xxx start=/"/ms=s+1 end=/"/me=s-1 contained contains=@htmlJavaScript
+ links to htmlEvent
+vbConditional xxx contained elseif if case select then else
+ links to Conditional
+vbOperator xxx contained addressof imp mod like and eqv or is to not byref byval xor in
+ match #[()+.,\-/*=&]# contained
+ match /[<>]=\=/ contained
+ match /<>/ contained
+ match /\s\+_$/ contained
+ links to Operator
+vbBoolean xxx contained false true
+ links to Boolean
+vbConst xxx contained null nothing
+ links to Constant
+vbRepeat xxx contained wend step do to for next until loop while foreach
+ links to Repeat
+vbEvents xxx contained devicequeryremovefailed nodeclick queryclose seriesselected deactivate endrequest pointlabelupdated gotfocus begintrans devmodechange dataarrival splitchange linkclose infomessage dblclick beginrequest afterwritefile expand powerquerysuspend keyup devicearrival displaychanged oncomm
+ contained heightchanged seriesupdated pointlabelselected itemactivated processingtimeout rollbacktrans buttonlostfocus footnoteselected powersuspend validationerror beforeupdate willchangedata deviceremovecomplete unboundadddata willupdaterows columnclick scroll asyncreadprogress change
+ contained querycompleted querytimeout validate buttongotfocus axislabelselected decommandremoved retainedproject willassociate rowcurrencychange asyncreadcomplete titleactivated beforecoledit axistitleupdated dataupdated beforeinsert plotactivated visiblerecordchanged keypress settingchanged
+ contained deconnectionpropertychanged unformat sendcomplete editquery afterlabeledit start plotselected timer configchanged dragover activerowchanged dogetnewfilename chartupdated configchagecancelled requestwritefile footnoteupdated show resultschanged statechanged panelclick objectmove
+ contained dateclicked dragdrop legendselected deconnectionremoved beforelabeledit mouseup devicequeryremove iniproperties pointlabelactivated exitfocus userevent itemrenamed willdissociate afterclosefile beforedelete closeup connect pathchange committrans itemseletected beforeclick dropdown
+ contained terminate itemcheck enterfocus rowstatuschanged unload associate querycomplete statusupdate ambientchanged olecompletedrag legendupdated aftercoledit fontchanged format decommandpropertychanged requestchangefilename unboundreaddata done compare buttonclick callbackkeydown afterupdate
+ contained paint afterremovefile itemclick itemremoved connectionrequest keydown leavecell accesskeypress writeproperties axisupdated axisselected axistitleselected footnoteactivated dissociate onaddnew close editproperty axislabelupdated click afterinsert deviceotherevent oledragdrop buttondropdown
+ contained disconnect entercell currentrecordchanged chartselected olesetdata seriesactivated titleselected mousemove rowresize beforeloadfile afteraddfile beforeconnect datachanged donepainting linkexecute linknotify changed patternchange formatsize updated sendprogress titleupdated mousedown
+ contained lostfocus linkerror readproperties axislabelactivated afterchangefilename aftercolupdate selectionchanged repeatedcontrolloaded upclick resize axisactivated olegivefeedback initproperties axistitleactivated applychanges powerstatuschanged paneldblclick repeatedcontrolunloaded itemadded
+ contained headclick configchangedcancelled activate legendactivated afterdelete initialize queryunload selchange processtag pointactivated buttoncompleted itemreloaded olestartdrag asyncprogress chartactivated beforecolupdate linkopen unboundgetrelativebookmark syscolorschanged pointselected
+ contained unboundwritedata plotupdated downclick collapse deconnectionadded querychangeconfig powerresume rowcolchange oledragover timechanged nodecheck unbounddeleterow closequery reposition willexecute pointupdated colresize objectevent deviceremovepending coledit hide decommandadded load
+ links to Special
+vbFunction xxx contained clng nper vartype mirr abs doevents isnull space weekdayname msgbox cdate second mid min trim ascb ascw year iif cvdate join ismissing chrb chrw createobject switch loadresstring left int inputbox weekday isempty var eof command now ubound environ leftb lenb tab inputb atn rgb syd ltrim
+ contained instr avg instrb cint minute fileattr datepart fv error formatdatetime hex timer isobject cvar asc count fix rnd time loadrespicture cdbl imestatus array npv cbyte qbcolor string freefile replace lcase loadresdata strreverse cstr oct lbound seek right sgn timeserial format sin isdate
+ contained input month getallstrings partition sln chr callbyname ipmt filterfix ucase spc sqr monthname round loadpicture formatcurrency typename dateadd str max rtrim getobject tan sum cos hour dateserial strcomp csng strconv filedatetime day stdevp isnumeric curdir len iserror split timevalue ddb
+ contained getautoserversettings cverr dir midb isarray exp datediff stdev cbool bof loc lof log ccur date val formatnumber pv getsetting filelen rate cdec choose datevalue pmt formatpercent rightb shell getattr varp ppmt
+ links to Identifier
+vbMethods xxx contained skip createtoolwindow addfromfile getfile movenext folderexists showwhatsthis propertychanged removeaddinfromtoolbar savetoolbar createfolder navigateto add copyfolder getclipstring import paste openquerydef finditem begintrans settext findprevious registerdatabase appendchunk enddoc
+ contained writeproperty drag readall refresh createrelation expand urlfor establishconnection loadresstring oledrag open captureimage edit editcopy rollbacktrans scale getselection resolvename printreport makereplica gettempname showcolor writetemplate createpreparedstatement whatsthismode
+ contained printform scroll pastspecialdlg repairdatabase line exists arrange createembed bind nextrecordset createindex randomdatafill rowbookmark startlogging peekdata linkrequest paintpicture savetofile tag execute trace rebind makecompilefile updaterecord removeitem readline ensurevisible rowtop
+ contained fileexists showsave rowcontaining scalex scaley stop startlabeledit setsize point saveas createdatabase newpage lines createquerydef fetch loadfile circle savetoole1file doverb compactdatabase count deselectall show columnsize loadrespicture fillcache initializelabels getdrive
+ contained deletecolumnlabels clearstructure linksend findfirst getformat zorder setselection validatecontrols selectall addnew deletelines hittest buildpath colcontaining loadresdata listen editpaste driveexists render movelast files connect findnext value committrans set item createquery
+ contained refreshlink linkpoke update getselectedpart releaseinstance draw cancelasyncread beginqueryedit removeall goback move deletefile layout onaddinsupdate moveprevious restoretoolbar getbookmark deletefolder addfromstring resync clone insertrows replyall reload openastextstream updatecontrols
+ contained todefaults onstartupcomplete deleterows cancelupdate showprinter clearfields remove aboutbox find keys export append appendappendchunk getabsolutepathname insert clearselcols copy send openresultset refill insertlines print onconnection writeblanklines newpassword close showfont
+ contained insertrowlabels pset getvisiblecount getdata write randomfillcolumns getfolder requery signon cls createfield idle randomfillrows extracticon createlink opendatabase addfromtemplate additem cancel addcustom showopen holdfields read reply canpropertychange populatepartial showhelp
+ contained writeline ondisconnection fetchverbs exportreport selprint customize linkexecute readfromfile getspecialfolder addfromguid accept movefile gettext insertfile goforward addtoolboxprogid deleterowlabels save readproperty createpropery setdata size deletecolumns clearsel cut addfile delete
+ contained openrecordset typebycharttype movefolder openurl setfocus skipline split setviewport signoff replaceline textwidth span selectpart resetcustomlabel addtoaddintoolbar popupmenu creategroup synchronize getfilename getheader insertcolumnlabels textheight activate rollback cancelbatch
+ contained savefile getchunk rdocreateenvironment getlinefromchar play getdrivename rdoregisterdatasource updaterow forward movedata getrows createtextfile logevent makecompiledfile collapseall insertobjdlg findlast insertcolumns createworkspace splitcontaining copyfile senddata getbasename
+ contained createtabledef upto setoption celltext createuser designerwindow openconnection copyquerydef quit resetcustom movefirst overlay clear batchupdate cellvalue asyncread createdragimage compose raise twipstochartpart getparentfoldername getnumticks getfirstvisible assert setautoserversettings
+ contained hide moreresults killdoc
+ links to PreProc
+vbStatement xxx contained const wend mid setattr defint elseif open enum randomize implements end event erase step explicit function option as rem raiseevent do savepicture error call stop preserve reset defbool width sendkeys sendkeys time goto static return on kill for beep defobj exit deletesetting next begin
+ contained savesetting set unload seek lineinput defdate unlock get lock lset filecopy defsng alias resume onerror declare until base close defstr write deftype sub gosub gosub loop public while redim redim defcur chdir chdrive each defdbl with property type defdec let name private lib foreach
+ contained deflng dim rmdir mkdir rset date defvar put appactivate load defbyte
+ links to Statement
+vbKeyword xxx contained empty publicnotcreateable mid onnewprocesssingleuse globalmultiuse step option as new optional error is time static withevents me on string byref byval set insameprocessmultiuse seek get lock input resume binary paramarray print null nothing friend public property len private date
+ links to Statement
+vbTodo xxx contained todo
+ links to Todo
+vbTypes xxx contained currency empty single string boolean byte variant long double integer object date decimal
+ links to Type
+vbDefine xxx contained vbkeyback vbyesno vbcyan vbcr vbcurrency vbhidden vbkeyf10 vbkeyf11 vbkeyf13 vbkeyf14 vbkeyf15 vbkeyf16 vbfirstfourdays vbmonday vbimeoff vbcalgreg vbinformation vbdesktop vbkeytab dbfloat dbcurrency vbblack vbkeyseparator vbvolume dblong vbwednesday vbimenoop dbsingle vblf vbgreen
+ contained vbkeynumlock vbkeyhome vbkeypagedown vbno vbarray vbok vbokonly vb3dshadow vbimemodekatakana vbimemodealphafull vbimemodekatakanahalf vbexclamation vbmsgboxrtlreading vbkeydivide vbkeydown vbsystem vbthursday vbwindowbackground vb3dlight vbretrycancel vbkeyright vbsystemmodal vbfirstjan1
+ contained dbchar vbkeypause vbyes vbsingle vbvariant vbabort vbformfeed vbmenubar vbdataobject vbsaturday vbkeydecimal vbhighlighttext vbalias vbkeylbutton vbscrollbars vbimemodealpha vbgraytext vbwindowtext vbinfotext vbfirstfullweek vbkeyselect vbkeysnapshot vbkeyreturn vbnormalnofocus vbback
+ contained vbmagenta vbkeyprint vbnarrow vbkey6 vbkeyrbutton vbkeydelete dbinteger vbapplicationmodal vbcancel vbdefaultbutton2 vbbuttonshadow vblowercase dbdecimal vbbinarycompare vbkeyi vbmsgboxsetforeground vbformmdiform dbbinary vbkeyo vbkeyp vbwindowframe vbkeycapital vbkeyadd vbkatakana
+ contained vbkeyf12 vbstring vbverticaltab vbformcode vbignore vberror vbquestion vbbyte vbkeypageup vbimemodehiragana vbfriday vbred dbmemo dbboolean vbretry vbmenutext vbwide vbimedisable vbimemodeoff vbinactivetitlebar vbkeyinsert vbokcancel vbmsgboxright vbkeyend vbkey0 vbkey1 vbkey2 vbkey3
+ contained vbkey4 vbkey5 vbkey7 vbkey8 vbkey9 vbkeya vbkeyb vbkeyc vbkeyd vbkeye vbkeyf vbkeyg vbkeyh vbkeyj vbkeyk vbkeyl vbkeym vbkeyn vbkeyq vbkeyr vbkeys vbkeyt vbkeyu vbkeyv vbkeyw vbkeyx vbkeyy vbkeyz vbwhite vbnormal vbinactiveborder dbdate vbformcontrolmenu vbkeymenu vbkeyexecute
+ contained vbyesnocancel vbtitlebartext vbtextcompare dbdouble vbunicode vbnull vbimekatakanasng vbkeymultiply vbinteger vbkeysubtract vbkeyshift vbmsgboxhelpbutton vbkeycancel vbimemodehangulfull vb3dhighlight dbnumeric vbminimizednofocus dbguid vbdecimal vbcrlf vbsunday vbimealphasng
+ contained vbminimizedfocus vbapplicationworkspace vbimemodedisable vbkeyescape vbobjecterror vbimemodenocontrol vbtuesday vbkeyclear vbcritical vbusesystem vbkeyhelp vbkeyleft vbnormalfocus dblongbinary vbhiragana vbfromunicode vbcalhijri vbboolean vbkeycontrol vbmsgboxtext vbnullchar
+ contained vbinfobackground vbactiveborder dbtime vb3ddkshadow vbimeon vbkeyf1 vbkeyf2 vbkeyf3 vbkeyf4 vbkeyf5 vbkeyf6 vbkeyf7 vbkeyf8 vbkeyf9 vbkeynumpad3 vbreadonly vbkeynumpad5 vbkeynumpad0 vbkeynumpad1 vbkeynumpad2 vbkeynumpad4 vbkeynumpad6 vbkeynumpad7 vbkeynumpad8 vbkeynumpad9 vbempty vbdouble
+ contained vbkeyspace vbappwindows vbimekatakanadbl vbmsgbox vbactivetitlebar vbyellow vbapptaskmanager vbobject vbkeymbutton vbmaximizedfocus dbvarbinary vbimealphadbl vbdatabasecompare vbimehiragana vbusesystemdayofweek vbdate vbhighlight vbpropercase vbdirectory dbtimestamp vbuppercase
+ contained vbnullstring vbblue vbdefaultbutton1 vbdefaultbutton3 vbdefaultbutton4 vbbuttonface vbimemodehangul vbimemodeon vbbuttontext dbtext vbarchive vbtab dbbyte vblong vbabortretryignore vbinactivecaptiontext vbnewline dbbigint vbkeyup vbhide vb3dface
+ links to Constant
+vbNumber xxx match /\<\d\+\>/ contained
+ match /\<\d\+\.\d*\>/ contained
+ match /\.\d\+\>/ contained
+ links to Number
+vbFloat xxx match /[-+]\=\<\d\+[eE][\-+]\=\d\+/ contained
+ match /[-+]\=\<\d\+\.\d*\([eE][\-+]\=\d\+\)\=/ contained
+ match /[-+]\=\<\.\d\+\([eE][\-+]\=\d\+\)\=/ contained
+ links to Float
+vbString xxx start=/"/ end=/"\|$/ contained
+ links to String
+vbComment xxx start=/\(^\|\s\)REM\s/ end=/$/ contained contains=vbTodo
+ start=/\(^\|\s\)\'/ end=/$/ contained contains=vbTodo
+ links to Comment
+vbLineNumber xxx match /^\d\+\(\s\|$\)/ contained
+ links to Comment
+vbTypeSpecifier xxx match /[a-zA-Z0-9][\$%&!#]/ms=s+1 contained
+ match /#[a-zA-Z0-9]/me=e-1 contained
+ links to Type
+cssTagName xxx contained a a b b p p q q s s u u noframes noframes blockquote blockquote source source source source button button caption caption big big mark mark mark mark meta meta mask mask address address i i article article article article title title style style form form img img img img ins ins meter
+ contained meter meter meter data data data data var var command command fieldset fieldset option option applet applet nav nav nav nav link link frameset frameset br br track track track track dd dd dl dl dt dt noscript noscript bdo bdo em em canvas canvas canvas canvas section section section
+ contained section bdi bdi bdi bdi h1 h1 h2 h2 h3 h3 h4 h4 h5 h5 tbody tbody time time time time audio audio audio audio cite cite li li strike strike colgroup colgroup acronym acronym progress progress progress progress select select ol ol embed embed embed embed rtc rtc output output output output
+ contained wbr wbr wbr wbr rb rb rp rp rp rp datalist datalist datalist datalist template template td td th th tr tr tt tt ul ul kbd kbd textarea textarea menuitem menuitem thead thead rt rt rt rt hgroup hgroup table table input input param param center center base base tfoot tfoot samp samp ruby
+ contained ruby ruby ruby code code details details font font sub sub sup sup col col svg svg optgroup optgroup figcaption figcaption figcaption figcaption iframe iframe video video video video dialog dialog h6 h6 menu menu script script object object hr hr span span del del dfn dfn html html legend
+ contained legend small small dir dir div div body body strong strong summary summary keygen keygen keygen keygen abbr abbr isindex isindex figure figure figure figure pre pre basefont basefont header header header header main main main main area area map map frame frame label label footer footer
+ contained footer footer aside aside aside aside head head
+ match /\*/ contained
+ match /\*/ contained
+ links to Statement
+cssDeprecated xxx contained noframes noframes big big applet applet frameset frameset strike strike acronym acronym tt tt center center font font dir dir basefont basefont frame frame
+ links to Error
+cssSelectorOp xxx match /[,>+~]/ contained
+ match /[,>+~]/ contained
+ match /[|]/ contained
+ match /[|]/ contained
+ links to Special
+cssSelectorOp2 xxx match /[~|^$*]\?=/ contained
+ match /[~|^$*]\?=/ contained
+ match +/deep/+ contained
+ match +/deep/+ contained
+ links to Special
+cssUnicodeEscape xxx match /\\\x\{1,6}\s\?/ contained
+ match /\\\x\{1,6}\s\?/ contained
+ links to Special
+cssStringQ xxx start=/'/ skip=/\\\\\|\\'/ end=/'/ contained contains=cssUnicodeEscape,cssSpecialCharQ
+ start=/'/ skip=/\\\\\|\\'/ end=/'/ contained contains=cssUnicodeEscape,cssSpecialCharQ
+ links to String
+cssStringQQ xxx start=/"/ skip=/\\\\\|\\"/ end=/"/ contained contains=cssUnicodeEscape,cssSpecialCharQQ
+ start=/"/ skip=/\\\\\|\\"/ end=/"/ contained contains=cssUnicodeEscape,cssSpecialCharQQ
+ links to String
+cssAttributeSelector xxx matchgroup=cssSelectorOp start=/\[/ end=/]/ contained contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
+ matchgroup=cssSelectorOp start=/\[/ end=/]/ contained contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
+ links to String
+cssClassNameDot xxx match /\./ contained
+ match /\./ contained
+ links to Function
+cssClassName xxx match /\.[A-Za-z][A-Za-z0-9_-]\+/ contained contains=cssClassNameDot
+ match /\.[A-Za-z][A-Za-z0-9_-]\+/ contained contains=cssClassNameDot
+ links to Function
+cssIdentifier xxx match /#[A-Za-z<c0>-<ff>_@][A-Za-z<c0>-<ff>0-9_@-]*/ contained
+ match /#[A-Za-z<c0>-<ff>_@][A-Za-z<c0>-<ff>0-9_@-]*/ contained
+ links to Function
+cssUnitDecorators xxx match /\(#\|-\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)/ contained
+ match /\(#\|-\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)/ contained
+ links to Number
+cssValueInteger xxx match /[-+]\=\d\+/ contained contains=cssUnitDecorators
+ match /[-+]\=\d\+/ contained contains=cssUnitDecorators
+ links to Number
+cssValueNumber xxx match /[-+]\=\d\+\(\.\d*\)\=/ contained contains=cssUnitDecorators
+ match /[-+]\=\d\+\(\.\d*\)\=/ contained contains=cssUnitDecorators
+ match /[01]\(.\d\+\)\=fr/ contained
+ match /\d\+gd/ contained
+ match /[-+]\=\d\+\(dB\|st\)/ contained
+ match /[-+]\=\d\+\(\.\d*\)\=dp\(i\|cm\|px\)/ contained
+ match /[-+]\=\d\+\(dB\|st\)/ contained
+ match /[-+]\=\d\+\(\.\d*\)\=dp\(i\|cm\|px\)/ contained
+ match /[01]\(.\d\+\)\=fr/ contained
+ match /\d\+gd/ contained
+ links to Number
+cssValueLength xxx match /[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\)/ contained contains=cssUnitDecorators
+ match /[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\)/ contained contains=cssUnitDecorators
+ match /[-+]\=\d\+\(\.\d*\)\=\(ch\|rem\|vw\|vh\|vmin\|vmax\)/ contained
+ match /[-+]\=\d\+\(\.\d*\)\=\(ch\|rem\|vw\|vh\|vmin\|vmax\)/ contained
+ links to Number
+cssValueAngle xxx match /[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)/ contained contains=cssUnitDecorators
+ match /[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)/ contained contains=cssUnitDecorators
+ match /[-+]\=\d\+\(\.\d*\)\=turn/ contained
+ match /[-+]\=\d\+\(\.\d*\)\=turn/ contained
+ links to Number
+cssValueTime xxx match /+\=\d\+\(\.\d*\)\=\(ms\|s\)/ contained contains=cssUnitDecorators
+ match /+\=\d\+\(\.\d*\)\=\(ms\|s\)/ contained contains=cssUnitDecorators
+ links to Number
+cssValueFrequency xxx match /+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)/ contained contains=cssUnitDecorators
+ match /+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)/ contained contains=cssUnitDecorators
+ links to Number
+cssIncludeKeyword xxx match /@\(-[a-z]+-\)\=\(media\|keyframes\|import\|charset\|namespace\|page\)/ contained
+ match /@\(-[a-z]+-\)\=\(media\|keyframes\|import\|charset\|namespace\|page\)/ contained
+ links to atKeyword
+cssMediaProp xxx contained orientation orientation width width grid grid height height scan scan
+ match /\(\(device\)-\)\=aspect-ratio/ contained
+ match /\(\(max\|min\)-\)\=device-pixel-ratio/ contained
+ match /\(\(max\|min\)-\)\=device-\(height\|width\)/ contained
+ match /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/ contained
+ match /\(\(device\)-\)\=aspect-ratio/ contained
+ match /\(\(max\|min\)-\)\=device-pixel-ratio/ contained
+ match /\(\(max\|min\)-\)\=device-\(height\|width\)/ contained
+ match /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/ contained
+ links to cssProp
+cssMediaKeyword xxx contained and and not not only only
+ links to Statement
+cssMediaAttr xxx contained interlace interlace portrait portrait progressive progressive landscape landscape
+ links to cssAttr
+cssVendor xxx match /\(-\(webkit\|moz\|o\|ms\)-\)/ contained
+ match /\(-\(webkit\|moz\|o\|ms\)-\)/ contained
+ links to Comment
+cssMediaType xxx contained all
+ contained all
+ contained aural
+ contained aural
+ contained tv
+ contained tv
+ contained speech
+ contained speech
+ contained handheld
+ contained handheld
+ contained print
+ contained print
+ contained screen
+ contained screen
+ contained embossed
+ contained embossed
+ contained projection
+ contained projection
+ contained braille
+ contained braille
+ contained tty
+ contained tty
+ links to Special
+cssMediaComma xxx match /,/ contained
+ match /,/ contained
+ links to Normal
+cssComment xxx start=+/\*+ end=+\*/+ contained fold contains=@Spell
+ start=+/\*+ end=+\*/+ contained fold contains=@Spell
+ links to Comment
+cssMediaBlock xxx matchgroup=cssBraces start=/{/ end=/}/ contained transparent fold contains=cssMediaAttr,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssTagName,cssClassName,cssIdentifier,cssPseudoClass,cssSelectorOp,cssSelectorOp2,cssAttributeSelector
+ matchgroup=cssBraces start=/{/ end=/}/ contained transparent fold contains=cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssTagName,cssClassName,cssIdentifier,cssPseudoClass,cssSelectorOp,cssSelectorOp2,cssAttributeSelector
+cssInclude xxx start=/@media\>/ end=/\ze{/ contained contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType,cssIncludeKeyword,cssMediaComma,cssComment nextgroup=cssMediaBlock skipwhite skipnl
+ start=/@import\>/ end=/\ze;/ contained transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword,cssURL,cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType
+ start=/@charset\>/ end=/\ze;/ contained transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword
+ start=/@namespace\>/ end=/\ze;/ contained transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword
+ start=/@media\>/ end=/\ze{/ contained contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType,cssIncludeKeyword,cssMediaComma,cssComment nextgroup=cssMediaBlock skipwhite skipnl
+ start=/@import\>/ end=/\ze;/ contained transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword,cssURL,cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType
+ start=/@charset\>/ end=/\ze;/ contained transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword
+ start=/@namespace\>/ end=/\ze;/ contained transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword
+ start=/@counter-style\>/ end=/\ze{/ contained contains=cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssValueInteger,cssValueLength,cssMediaKeyword,cssVendor,cssIncludeKeyword,cssComment nextgroup=cssMediaBlock skipwhite skipnl
+ start=/@scope\>/ end=/\ze{/ contained nextgroup=cssMediaBlock skipwhite skipnl
+ start=/@supports\>/ end=/\ze{/ contained contains=cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssValueInteger,cssValueLength,cssMediaKeyword,cssVendor,cssIncludeKeyword,cssComment nextgroup=cssMediaBlock skipwhite skipnl
+ start=/@supports\>/ end=/\ze{/ contained contains=cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssValueInteger,cssValueLength,cssMediaKeyword,cssVendor,cssIncludeKeyword,cssComment nextgroup=cssMediaBlock skipwhite skipnl
+ start=/@counter-style\>/ end=/\ze{/ contained contains=cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssValueInteger,cssValueLength,cssMediaKeyword,cssVendor,cssIncludeKeyword,cssComment nextgroup=cssMediaBlock skipwhite skipnl
+ start=/@scope\>/ end=/\ze{/ contained nextgroup=cssMediaBlock skipwhite skipnl
+ links to Include
+cssBraces xxx match /[{}]/ contained
+ match /[{}]/ contained
+ links to Function
+cssColor xxx contained GrayText GrayText ThreeDShadow ThreeDShadow ThreeDFace ThreeDFace ButtonHighlight ButtonHighlight Scrollbar Scrollbar ActiveBorder ActiveBorder ThreeDDarkShadow ThreeDDarkShadow ButtonShadow ButtonShadow InfoBackground InfoBackground Highlight Highlight ThreeDLightShadow ThreeDLightShadow
+ contained Background Background InfoText InfoText CaptionText CaptionText ButtonText ButtonText ThreeDHighlight ThreeDHighlight ButtonFace ButtonFace ActiveCaption ActiveCaption WindowText WindowText HighlightText HighlightText MenuText MenuText InactiveCaptionText InactiveCaptionText Window Window
+ contained AppWorkspace AppWorkspace WindowFrame WindowFrame Menu Menu InactiveBorder InactiveBorder InactiveCaption InactiveCaption
+ contained indianred indianred purple purple lavender lavender cyan cyan linen linen cornflowerblue cornflowerblue lemonchiffon lemonchiffon orange orange sienna sienna plum plum moccasin moccasin midnightblue midnightblue cornsilk cornsilk orchid orchid lime lime chartreuse chartreuse teal teal red
+ contained red deepskyblue deepskyblue peru peru blanchedalmond blanchedalmond thistle thistle aliceblue aliceblue pink pink black black silver silver papayawhip papayawhip blue blue maroon maroon slategray slategray gainsboro gainsboro chocolate chocolate indigo indigo bisque bisque gray gray olive
+ contained olive ivory ivory antiquewhite antiquewhite cadetblue cadetblue coral coral seagreen seagreen firebrick firebrick aquamarine aquamarine olivedrab olivedrab azure azure rosybrown rosybrown tomato tomato khaki khaki dimgray dimgray oldlace oldlace wheat wheat brown brown dimgrey dimgrey
+ contained crimson crimson peachpuff peachpuff springgreen springgreen burlywood burlywood goldenrod goldenrod grey grey tan tan hotpink hotpink mintcream mintcream magenta magenta yellowgreen yellowgreen ghostwhite ghostwhite sandybrown sandybrown floralwhite floralwhite slateblue slateblue
+ contained royalblue royalblue salmon salmon yellow yellow blueviolet blueviolet aqua aqua limegreen limegreen gold gold snow snow turquoise turquoise deeppink deeppink skyblue skyblue slategrey slategrey fuchsia fuchsia powderblue powderblue seashell seashell navy navy whitesmoke whitesmoke green
+ contained green beige beige greenyellow greenyellow lavenderblush lavenderblush violet violet navajowhite navajowhite orangered orangered lawngreen lawngreen saddlebrown saddlebrown steelblue steelblue forestgreen forestgreen honeydew honeydew dodgerblue dodgerblue mistyrose mistyrose
+ match /dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)/ contained
+ match /dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)/ contained
+ match /darkslate\(blue\|gray\|grey\)/ contained
+ match /dark\(turquoise\|violet\)/ contained
+ match /light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)/ contained
+ match /light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)/ contained
+ match /light\(slategray\|slategrey\|steelblue\)/ contained
+ match /medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)/ contained
+ match /medium\(slateblue\|springgreen\|turquoise\|violetred\)/ contained
+ match /pale\(goldenrod\|green\|turquoise\|violetred\)/ contained
+ match /\<transparent\>/ contained
+ match /\<white\>/ contained
+ match /#[0-9A-Fa-f]\{3\}\>/ contained contains=cssUnitDecorators
+ match /#[0-9A-Fa-f]\{6\}\>/ contained contains=cssUnitDecorators
+ match /dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)/ contained
+ match /dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)/ contained
+ match /darkslate\(blue\|gray\|grey\)/ contained
+ match /dark\(turquoise\|violet\)/ contained
+ match /light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)/ contained
+ match /light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)/ contained
+ match /light\(slategray\|slategrey\|steelblue\)/ contained
+ match /medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)/ contained
+ match /medium\(slateblue\|springgreen\|turquoise\|violetred\)/ contained
+ match /pale\(goldenrod\|green\|turquoise\|violetred\)/ contained
+ match /\<transparent\>/ contained
+ match /\<white\>/ contained
+ match /#[0-9A-Fa-f]\{3\}\>/ contained contains=cssUnitDecorators
+ match /#[0-9A-Fa-f]\{6\}\>/ contained contains=cssUnitDecorators
+ match /\<currentColor\>/ contained
+ match /\<currentColor\>/ contained
+ links to Constant
+cssURL xxx matchgroup=cssFunctionName start=/\<url\s*(/ end=/)/ contained oneline extend
+ matchgroup=cssFunctionName start=/\<url\s*(/ end=/)/ contained oneline extend
+ links to String
+cssImportant xxx match /!\s*important\>/ contained
+ match /!\s*important\>/ contained
+ links to Special
+cssError xxx match /{@<>/ contained
+ match /{@<>/ contained
+ links to Error
+cssFunction xxx matchgroup=cssFunctionName start=/\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(/ end=/)/ contained oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma
+ matchgroup=cssFunctionName start=/\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(/ end=/)/ contained oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction
+ matchgroup=cssFunctionName start=/\<\(linear-\|radial-\)\=\gradient\s*(/ end=/)/ contained oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma
+ matchgroup=cssFunctionName start=/\<\(matrix\(3d\)\=\|scale\(3d\|X\|Y\|Z\)\=\|translate\(3d\|X\|Y\|Z\)\=\|skew\(X\|Y\)\=\|rotate\(3d\|X\|Y\|Z\)\=\|perspective\)\s*(/ end=/)/ contained oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma
+ matchgroup=cssFunctionName start=/\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(/ end=/)/ contained oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma
+ matchgroup=cssFunctionName start=/\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(/ end=/)/ contained oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction
+ matchgroup=cssFunctionName start=/\<\(linear-\|radial-\)\=\gradient\s*(/ end=/)/ contained oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma
+ matchgroup=cssFunctionName start=/\<\(matrix\(3d\)\=\|scale\(3d\|X\|Y\|Z\)\=\|translate\(3d\|X\|Y\|Z\)\=\|skew\(X\|Y\)\=\|rotate\(3d\|X\|Y\|Z\)\=\|perspective\)\s*(/ end=/)/ contained oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma
+ matchgroup=cssFunctionName start=/\<symbols\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(string\|running\|element\|leader\|target-\(counter\|counters\|text\)\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(minmax\|repeat\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<round\(down\|up\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<counters\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(inset\|circle\|ellipse\|polygon\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<var\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(rgba\|hsla\=\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(stylistic\|styleset\|character-variant\|swash\|ornaments\|annotation\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(image\|\(repeating-\)\=\(linear\|radial\)-gradient\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(matrix\(3d\)\=\|translate\(3d\|X\|Y\|Z\)\=\|scale\(3d\|X\|Y\|Z\)\=\|rotate\(3d\|X\|Y\|Z\)\=\|skew\(X\|Y\)\=\|perspective\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(steps\|cubic-bezier\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(calc\|toggle\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(rgba\|hsla\=\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(stylistic\|styleset\|character-variant\|swash\|ornaments\|annotation\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(image\|\(repeating-\)\=\(linear\|radial\)-gradient\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(matrix\(3d\)\=\|translate\(3d\|X\|Y\|Z\)\=\|scale\(3d\|X\|Y\|Z\)\=\|rotate\(3d\|X\|Y\|Z\)\=\|skew\(X\|Y\)\=\|perspective\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(steps\|cubic-bezier\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(calc\|toggle\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<symbols\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(string\|running\|element\|leader\|target-\(counter\|counters\|text\)\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(minmax\|repeat\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<round\(down\|up\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<counters\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<\(inset\|circle\|ellipse\|polygon\)\s*(/ end=/)/ contained oneline keepend
+ matchgroup=cssFunctionName start=/\<var\s*(/ end=/)/ contained oneline keepend
+ links to Constant
+cssDefinition xxx matchgroup=cssBraces start=/{/ end=/}/ contained keepend transparent fold contains=cssAttrRegion,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks
+ matchgroup=cssBraces start=/{/ end=/}/ contained keepend transparent fold contains=cssAttrRegion,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,@cssColors
+ matchgroup=cssBraces start=/{/ end=/}/ contained keepend transparent fold contains=cssAttrRegion,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks
+ matchgroup=cssBraces start=/{/ end=/}/ contained keepend transparent fold contains=cssAttrRegion,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,@cssColors
+ matchgroup=cssBraces start=/{/ end=/}/ contained keepend transparent fold contains=cssAttrRegion,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,@cssColors,@cssColors
+cssPseudoClass xxx match /:[A-Za-z0-9_-]*/ contained contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn
+ match /:[A-Za-z0-9_-]*/ contained contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn
+cssPagePseudo xxx match /:\(left\|right\|first\|blank\)/ contained
+ match /:\(left\|right\|first\|blank\)/ contained
+ links to PreProc
+cssPageWrap xxx matchgroup=cssBraces start=/{/ end=/}/ contained transparent contains=cssPageMargin,cssPageProp,cssAttrRegion,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks
+ matchgroup=cssBraces start=/{/ end=/}/ contained transparent contains=cssPageMargin,cssPageProp,cssAttrRegion,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks
+cssPage xxx match /@page\>[^{]*{\@=/ contained transparent contains=cssPagePseudo,cssIncludeKeyword nextgroup=cssPageWrap skipwhite skipnl
+ match /@page\>[^{]*{\@=/ contained transparent contains=cssPagePseudo,cssIncludeKeyword nextgroup=cssPageWrap skipwhite skipnl
+ links to atKeyword
+cssPageMargin xxx match /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition skipwhite skipnl
+ match /@\(\(top\|left\|right\|bottom\)-\(left\|center\|right\|middle\|bottom\)\)\(-corner\)\=/ contained nextgroup=cssDefinition skipwhite skipnl
+ links to atKeyword
+cssPageProp xxx contained content content orphans orphans widows widows size size
+ links to cssProp
+cssAttrRegion xxx start=/:/ end=/;/ contained keepend contains=cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssColor,cssImportant,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssFunction,cssStringQQ,cssStringQ,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
+ start=/transition\s*:/ end=/;/ contained keepend contains=cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssColor,cssImportant,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssFunction,cssStringQQ,cssStringQ,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
+ start=/:/ end=/;/ contained keepend contains=cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssColor,cssImportant,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssFunction,cssString,cssStringQQ,cssStringQ,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
+ start=/transition\s*:/ end=/;/ contained keepend contains=cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssColor,cssImportant,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssFunction,cssString,cssStringQQ,cssStringQ,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
+cssHacks xxx match /\(_\|*\)/ contained
+ match /\(_\|*\)/ contained
+ links to Comment
+cssKeyFrameWrap xxx matchgroup=cssBraces start=/{/ end=/}/ contained transparent contains=cssKeyFrameSelector
+ matchgroup=cssBraces start=/{/ end=/}/ contained transparent contains=cssKeyFrameSelector
+cssKeyFrame xxx match /@\(-[a-z]+-\)\=keyframes\>[^{]*{\@=/ contained transparent contains=cssVendor,cssIncludeKeyword nextgroup=cssKeyFrameWrap skipwhite skipnl
+ match /@\(-[a-z]+-\)\=keyframes\>[^{]*{\@=/ contained transparent contains=cssVendor,cssIncludeKeyword nextgroup=cssKeyFrameWrap skipwhite skipnl
+ links to atKeyword
+cssKeyFrameSelector xxx match /\(\d*%\|from\|to\)\=/ contained nextgroup=cssDefinition skipwhite skipnl
+ match /\(\d*%\|from\|to\)\=/ contained nextgroup=cssDefinition skipwhite skipnl
+ links to Constant
+cssFontDescriptorBlock xxx matchgroup=cssBraces start=/{/ end=/}/ contained transparent contains=cssComment,cssError,cssUnicodeEscape,cssFontProp,cssFontAttr,cssCommonAttr,cssStringQ,cssStringQQ,cssFontDescriptorProp,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssFontDescriptorFunction,cssUnicodeRange,cssFontDescriptorAttr
+ matchgroup=cssBraces start=/{/ end=/}/ contained transparent contains=cssComment,cssError,cssUnicodeEscape,cssFontProp,cssFontAttr,cssCommonAttr,cssStringQ,cssStringQQ,cssFontDescriptorProp,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssFontDescriptorFunction,cssUnicodeRange,cssFontDescriptorAttr
+cssFontDescriptor xxx match /@font-face\>/ contained nextgroup=cssFontDescriptorBlock skipwhite skipnl
+ match /@font-face\>/ contained nextgroup=cssFontDescriptorBlock skipwhite skipnl
+ links to Special
+cssFontProp xxx contained all all columns columns order order isolation isolation
+ match /\<font\(-\(family\|\|feature-settings\|kerning\|language-override\|size\(-adjust\)\=\|stretch\|style\|synthesis\|variant\(-\(alternates\|caps\|east-asian\|ligatures\|numeric\|position\)\)\=\|weight\)\)\=\>/ contained
+ match /\<font-smooth\>/ contained
+ match /\<font\(-\(family\|\|feature-settings\|kerning\|language-override\|size\(-adjust\)\=\|stretch\|style\|synthesis\|variant\(-\(alternates\|caps\|east-asian\|ligatures\|numeric\|position\)\)\=\|weight\)\)\=\>/ contained
+ match /\<font-smooth\>/ contained
+ match /\<\(mix\|background\)-blend-mode\>/ contained
+ match /\<display-\(inside\|outside\|extras\|box\)\>/ contained
+ match /\<flex\(-\(basis\|direction\|flow\|grow\|shrink\|wrap\)\)\=\>/ contained
+ match /\<grid-template\(-\(columns\|rows\|areas\)\)\=\>/ contained
+ match /\<grid-auto-\(columns\|rows\|flow\|position\)\>/ contained
+ match /\<grid-\(row\|column\)\(-\(start\|end\)\)\=\>/ contained
+ match /\<grid-area\>/ contained
+ match /\<line-\(grid\|snap\|slack\)/ contained
+ match /\<box-snap\>/ contained
+ match /\<clip-\(path\|rule\)\>/ contained
+ match /\<mask\(-\(image\|mode\|repeat\|position\|clip\|origin\|size\|composite\|type\)\)\=\>/ contained
+ match /\<mask-border\(-\(source\|mode\|slice\|width\|outset\|repeat\)\)\=\>/ contained
+ match /\<max-lines\>/ contained
+ match /\<ruby-\(position\|merge\|align\)/ contained
+ match /\<shape-\(outside\|image-threshold\|margin\)\>/ contained
+ match /\<var-[A-Za-z_][A-Za-z0-9_-]\+\>/ contained
+ match /\<will-change\>/ contained
+ match /\<text-\(orientation\|combine-horizontal\)\>/ contained
+ match /\<writing-mode\>/ contained
+ match /\<\(justify\|align\)-\(self\|content\|items\)\>/ contained
+ match /\<animation\(-\(name\|duration\|timing-function\|iteration-count\|direction\|play-state\|delay\|fill-mode\)\)\=\>/ contained
+ match /\<background-\(clip\|origin\|size\)\>/ contained
+ match /\<border-image\(-\(source\|slice\|width\|outset\|repeat\)\)\=\>/ contained
+ match /\<border-\(\(top-right\|bottom-right\|bottom-left\|top-left\)-\)\=radius\>/ contained
+ match /\<box-shadow\>/ contained
+ match /\<break-\(after\|before\|inside\)\>/ contained
+ match /\<box-decoration-break\>/ contained
+ match /\<wrap-\(flow\|through\)\>/ contained
+ match /\<font-feature-settings\>/ contained
+ match /\<font-kerning\>/ contained
+ match /\<font-language-override\>/ contained
+ match /\<font-synthesis\>/ contained
+ match /\<font-variant-\(alternates\|caps\|east-asian\|ligatures\|numeric\|position\)\>/ contained
+ match /\<target\(-\(name\|new\|position\)\)\=\>/ contained
+ match /\<object-\(fit\|position\)\>/ contained
+ match /\<image-\(resolution\|orientation\)\>/ contained
+ match /\<alignment-\(adjust\|baseline\)\>/ contained
+ match /\<baseline-shift\>/ contained
+ match /\<dominate-baseline\>/ contained
+ match /\<drop-initial-\(after-\(adjust\|align\)\|before-\(adjust\|align\)\|size\|value\)\>/ contained
+ match /\<inline-box-align\>/ contained
+ match /\<line-stacking\(-\(ruby\|shift\|strategy\)\)\=\>/ contained
+ match /\<text-height\>/ contained
+ match /\<marquee-\(direction\|play-count\|speed\|style\)\>/ contained
+ match /\<column-\(count\|fill\|gap\|rule\(-\(color\|style\|width\)\)\=\|span\|width\)\>/ contained
+ match /\<presentation-level\>/ contained
+ match /\<flow-\(into\|from\)\>/ contained
+ match /\<region-fragment\>/ contained
+ match /\<backface-visibility\>/ contained
+ match /\<perspective\(-origin\)\=\>/ contained
+ match /\<transform\(-\(origin\|style\)\)\=\>/ contained
+ match /\<transition\(-\(property\|duration\|timing-function\|delay\)\)\=\>/ contained
+ match /\<\(mix\|background\)-blend-mode\>/ contained
+ match /\<\(justify\|align\)-\(self\|content\|items\)\>/ contained
+ match /\<animation\(-\(name\|duration\|timing-function\|iteration-count\|direction\|play-state\|delay\|fill-mode\)\)\=\>/ contained
+ match /\<background-\(clip\|origin\|size\)\>/ contained
+ match /\<border-image\(-\(source\|slice\|width\|outset\|repeat\)\)\=\>/ contained
+ match /\<border-\(\(top-right\|bottom-right\|bottom-left\|top-left\)-\)\=radius\>/ contained
+ match /\<box-shadow\>/ contained
+ match /\<break-\(after\|before\|inside\)\>/ contained
+ match /\<box-decoration-break\>/ contained
+ match /\<wrap-\(flow\|through\)\>/ contained
+ match /\<font-feature-settings\>/ contained
+ match /\<font-kerning\>/ contained
+ match /\<font-language-override\>/ contained
+ match /\<font-synthesis\>/ contained
+ match /\<font-variant-\(alternates\|caps\|east-asian\|ligatures\|numeric\|position\)\>/ contained
+ match /\<target\(-\(name\|new\|position\)\)\=\>/ contained
+ match /\<object-\(fit\|position\)\>/ contained
+ match /\<image-\(resolution\|orientation\)\>/ contained
+ match /\<alignment-\(adjust\|baseline\)\>/ contained
+ match /\<baseline-shift\>/ contained
+ match /\<dominate-baseline\>/ contained
+ match /\<drop-initial-\(after-\(adjust\|align\)\|before-\(adjust\|align\)\|size\|value\)\>/ contained
+ match /\<inline-box-align\>/ contained
+ match /\<line-stacking\(-\(ruby\|shift\|strategy\)\)\=\>/ contained
+ match /\<text-height\>/ contained
+ match /\<marquee-\(direction\|play-count\|speed\|style\)\>/ contained
+ match /\<column-\(count\|fill\|gap\|rule\(-\(color\|style\|width\)\)\=\|span\|width\)\>/ contained
+ match /\<presentation-level\>/ contained
+ match /\<flow-\(into\|from\)\>/ contained
+ match /\<region-fragment\>/ contained
+ match /\<backface-visibility\>/ contained
+ match /\<perspective\(-origin\)\=\>/ contained
+ match /\<transform\(-\(origin\|style\)\)\=\>/ contained
+ match /\<transition\(-\(property\|duration\|timing-function\|delay\)\)\=\>/ contained
+ match /\<display-\(inside\|outside\|extras\|box\)\>/ contained
+ match /\<flex\(-\(basis\|direction\|flow\|grow\|shrink\|wrap\)\)\=\>/ contained
+ match /\<grid-template\(-\(columns\|rows\|areas\)\)\=\>/ contained
+ match /\<grid-auto-\(columns\|rows\|flow\|position\)\>/ contained
+ match /\<grid-\(row\|column\)\(-\(start\|end\)\)\=\>/ contained
+ match /\<grid-area\>/ contained
+ match /\<line-\(grid\|snap\|slack\)/ contained
+ match /\<box-snap\>/ contained
+ match /\<clip-\(path\|rule\)\>/ contained
+ match /\<mask\(-\(image\|mode\|repeat\|position\|clip\|origin\|size\|composite\|type\)\)\=\>/ contained
+ match /\<mask-border\(-\(source\|mode\|slice\|width\|outset\|repeat\)\)\=\>/ contained
+ match /\<max-lines\>/ contained
+ match /\<ruby-\(position\|merge\|align\)/ contained
+ match /\<shape-\(outside\|image-threshold\|margin\)\>/ contained
+ match /\<var-[A-Za-z_][A-Za-z0-9_-]\+\>/ contained
+ match /\<will-change\>/ contained
+ match /\<text-\(orientation\|combine-horizontal\)\>/ contained
+ match /\<writing-mode\>/ contained
+ links to cssProp
+cssFontAttr xxx contained grande grande space space zapf zapf caption caption add add backwards backwards content content create create geneva geneva color color flat flat arial arial any any contain contain mathematical mathematical mixed mixed maximum maximum flex flex front front tab tab oblique oblique
+ contained simplified simplified new new new new balance balance jis04 jis04 paused paused york york symbol symbol fantasy fantasy saturation saturation georgia georgia black black times times unset unset palatino palatino monospace monospace row row alpha alpha jis83 jis83 webdings webdings jis90
+ contained jis90 stretch stretch ms ms minimum minimum comic comic tahoma tahoma smaller smaller on on rows rows back back icon icon impact impact plaintext plaintext difference difference recto recto dingbats dingbats cover cover italic italic nonzero nonzero wingdings wingdings helvetica helvetica
+ contained roman roman grid grid off off forwards forwards luminance luminance courier courier local local reverse reverse safe safe contents contents evenodd evenodd multiply multiply infinite infinite clone clone subtract subtract fill fill color-burn color-burn columns columns window window
+ contained traditional traditional trebuchet trebuchet luminosity luminosity before before exclude exclude same same antiqua antiqua monaco monaco round round true true screen screen snap snap after after unicase unicase unicase unicase wrap wrap central central bolder bolder running running
+ contained exclusion exclusion menu menu subgrid subgrid cursive cursive hard-light hard-light charcoal charcoal span span alternate alternate ordinal ordinal verdana verdana lighten lighten lighter lighter linotype linotype neue neue forward forward modal modal lucida lucida break break linear
+ contained linear color-dodge color-dodge fragments fragments increment increment soft-light soft-light isolate isolate slice slice element element slide slide current current overlay overlay unicode unicode bold bold roboto roboto darken darken dense dense intersect intersect gadget gadget hue hue
+ contained book book verso verso jis78 jis78 larger larger
+ match /\<small-\(caps\|caption\)\>/ contained
+ match /\<message-box\>/ contained
+ match /\<status-bar\>/ contained
+ match /\<\(x\{1,2\}-\)\=\(large\|small\)\>/ contained
+ match /\<\(sans-\)\=serif\>/ contained
+ match /\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>/ contained
+ match /\<\(all-\)\=\(small-\|petite-\|titling-\)caps\>/ contained
+ match /\<\(subpixel-\)\=\antialiased\>/ contained
+ match /\<small-\(caps\|caption\)\>/ contained
+ match /\<message-box\>/ contained
+ match /\<status-bar\>/ contained
+ match /\<\(x\{1,2\}-\)\=\(large\|small\)\>/ contained
+ match /\<\(sans-\)\=serif\>/ contained
+ match /\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>/ contained
+ match /\<\(all-\)\=\(small-\|petite-\|titling-\)caps\>/ contained
+ match /\<\(subpixel-\)\=\antialiased\>/ contained
+ match /\<\(block\|inline\)-level\>/ contained
+ match /\<inline-list-item\>/ contained
+ match /\<inline-flex\>/ contained
+ match /\<\(row\|column\|wrap\)-reverse\>/ contained
+ match /\<inline-grid\>/ contained
+ match /\<half-border\>/ contained
+ match /\<\(fill\|stroke\|view\)-box\>/ contained
+ match /\<no-clip\>/ contained
+ match /\<paged-\(x\|y\)\(-controls\)\=\>/ contained
+ match /\<ruby-\(base\|text\)-container\>/ contained
+ match /\<inter-character\>/ contained
+ match /\<margin-box\>/ contained
+ match /\<scroll-position\>/ contained
+ match /\<\(upright\|sideways\(-right\|-left\)\=\|use-glyph-orientation\)\>/ contained
+ match /\<isolate-override\>/ contained
+ match /\<\(horizontal-tb\|vertical-\(rl\|lr\)\)\>/ contained
+ match /\<\(self\|flex\)-\(start\|end\)\>/ contained
+ match /\<space-\(between\|around\|evenly\)\>/ contained
+ match /\<alternate-reverse\>/ contained
+ match /\<\(padding\|border\|content\)-box\>/ contained
+ match /\<\(no-\)\=\(common\|discretionary\|historical\)-ligatures\>/ contained
+ match /\<\(no-\)\=contextual\>/ contained
+ match /\<historical-forms\>/ contained
+ match /\<all-small-caps\>/ contained
+ match /\<\(all-\)\=petite-caps\>/ contained
+ match /\<titling-caps\>/ contained
+ match /\<\(lining\|oldstyle\|proportional\|tabular\)-nums\>/ contained
+ match /\<\(diagonal\|stacked\)-fractions\>/ contained
+ match /\<slashed-zero\>/ contained
+ match /\<proportional-width\>/ contained
+ match /\<from-image\>/ contained
+ match /\<scale-down\>/ contained
+ match /\<\(text-\)\=\(before\|after\)-edge\>/ contained
+ match /\<use-script\>/ contained
+ match /\<caps-height\>/ contained
+ match /\<\(exclude\|include\)-ruby\>/ contained
+ match /\<\(consider\|disregard\)-shift\>/ contained
+ match /\<\(\(inline\|block\)-line\|max\|grid\)-height\>/ contained
+ match /\<\(font\|text\|max\)-size\>/ contained
+ match /\<marquee-\(line\|block\)\>/ contained
+ match /\<\(avoid-\)\=column\>/ contained
+ match /\<\(avoid-\)\=page\>/ contained
+ match /\<\(avoid-\)\=region\>/ contained
+ match /\<\(\(min\|max\|fit\)-content\|fill-available\|repudiate-floats\)\>/ contained
+ match /\<contain-floats\>/ contained
+ match /\<preserve-3d\>/ contained
+ match /\<ease\(-\(in\|out\|in-out\)\)\=\>/ contained
+ match /\<step-\(start\|end\)\>/ contained
+ match /\<\(self\|flex\)-\(start\|end\)\>/ contained
+ match /\<space-\(between\|around\|evenly\)\>/ contained
+ match /\<alternate-reverse\>/ contained
+ match /\<\(padding\|border\|content\)-box\>/ contained
+ match /\<\(no-\)\=\(common\|discretionary\|historical\)-ligatures\>/ contained
+ match /\<\(no-\)\=contextual\>/ contained
+ match /\<historical-forms\>/ contained
+ match /\<all-small-caps\>/ contained
+ match /\<\(all-\)\=petite-caps\>/ contained
+ match /\<titling-caps\>/ contained
+ match /\<\(lining\|oldstyle\|proportional\|tabular\)-nums\>/ contained
+ match /\<\(diagonal\|stacked\)-fractions\>/ contained
+ match /\<slashed-zero\>/ contained
+ match /\<proportional-width\>/ contained
+ match /\<from-image\>/ contained
+ match /\<scale-down\>/ contained
+ match /\<\(text-\)\=\(before\|after\)-edge\>/ contained
+ match /\<use-script\>/ contained
+ match /\<caps-height\>/ contained
+ match /\<\(exclude\|include\)-ruby\>/ contained
+ match /\<\(consider\|disregard\)-shift\>/ contained
+ match /\<\(\(inline\|block\)-line\|max\|grid\)-height\>/ contained
+ match /\<\(font\|text\|max\)-size\>/ contained
+ match /\<marquee-\(line\|block\)\>/ contained
+ match /\<\(avoid-\)\=column\>/ contained
+ match /\<\(avoid-\)\=page\>/ contained
+ match /\<\(avoid-\)\=region\>/ contained
+ match /\<\(\(min\|max\|fit\)-content\|fill-available\|repudiate-floats\)\>/ contained
+ match /\<contain-floats\>/ contained
+ match /\<preserve-3d\>/ contained
+ match /\<ease\(-\(in\|out\|in-out\)\)\=\>/ contained
+ match /\<step-\(start\|end\)\>/ contained
+ match /\<\(block\|inline\)-level\>/ contained
+ match /\<inline-list-item\>/ contained
+ match /\<inline-flex\>/ contained
+ match /\<\(row\|column\|wrap\)-reverse\>/ contained
+ match /\<inline-grid\>/ contained
+ match /\<half-border\>/ contained
+ match /\<\(fill\|stroke\|view\)-box\>/ contained
+ match /\<no-clip\>/ contained
+ match /\<paged-\(x\|y\)\(-controls\)\=\>/ contained
+ match /\<ruby-\(base\|text\)-container\>/ contained
+ match /\<inter-character\>/ contained
+ match /\<margin-box\>/ contained
+ match /\<scroll-position\>/ contained
+ match /\<\(upright\|sideways\(-right\|-left\)\=\|use-glyph-orientation\)\>/ contained
+ match /\<isolate-override\>/ contained
+ match /\<\(horizontal-tb\|vertical-\(rl\|lr\)\)\>/ contained
+ links to cssAttr
+cssCommonAttr xxx contained all all none none stretch stretch initial initial auto auto inherit inherit bottom bottom normal normal visible visible center center top top hidden hidden default default
+ links to cssAttr
+cssFontDescriptorProp xxx contained src src
+ match /\<unicode-range\>/ contained
+ match /\<unicode-range\>/ contained
+ links to cssProp
+cssFontDescriptorFunction xxx matchgroup=cssFunctionName start=/\<\(uri\|url\|local\|format\)\s*(/ end=/)/ contained oneline keepend contains=cssStringQ,cssStringQQ
+ matchgroup=cssFunctionName start=/\<\(uri\|url\|local\|format\)\s*(/ end=/)/ contained oneline keepend contains=cssStringQ,cssStringQQ
+ links to Constant
+cssUnicodeRange xxx match /U+[0-9A-Fa-f?]\+/ contained
+ match /U+\x\+-\x\+/ contained
+ match /U+[0-9A-Fa-f?]\+/ contained
+ match /U+\x\+-\x\+/ contained
+ links to Constant
+cssFontDescriptorAttr xxx contained all all
+ links to cssAttr
+cssFunctionComma xxx match /,/ contained
+ match /,/ contained
+ links to Function
+cssGradientAttr xxx contained left left at at ellipse ellipse cover cover bottom bottom right right center center top top middle middle
+ links to cssAttr
+cssAnimationProp xxx match /\<animation\(-\(delay\|direction\|duration\|fill-mode\|name\|play-state\|timing-function\|iteration-count\)\)\=\>/ contained
+ match /\<animation\(-\(delay\|direction\|duration\|fill-mode\|name\|play-state\|timing-function\|iteration-count\)\)\=\>/ contained
+ links to cssProp
+cssAnimationAttr xxx contained both both backwards backwards paused paused forwards forwards reverse reverse running running alternate alternate
+ match /\<alternate-reverse\>/ contained
+ match /\<alternate-reverse\>/ contained
+ links to cssAttr
+cssBackgroundProp xxx match /\<background\(-\(attachment\|clip\|color\|image\|origin\|position\|repeat\|size\)\)\=\>/ contained
+ match /\<background\(-\(attachment\|clip\|color\|image\|origin\|position\|repeat\|size\)\)\=\>/ contained
+ links to cssProp
+cssBackgroundAttr xxx contained space space left left contain contain scroll scroll fixed fixed cover cover bottom bottom right right local local center center round round top top
+ match /\<no-repeat\>/ contained
+ match /\<repeat\(-[xy]\)\=\>/ contained
+ match /\<no-repeat\>/ contained
+ match /\<repeat\(-[xy]\)\=\>/ contained
+ links to cssAttr
+cssBorderProp xxx match /\<border\(-\(top\|right\|bottom\|left\)\)\=\(-\(width\|color\|style\)\)\=\>/ contained
+ match /\<border\(-\(top\|bottom\)-\(left\|right\)\)\=-radius\>/ contained
+ match /\<border-image\(-\(outset\|repeat\|slice\|source\|width\)\)\=\>/ contained
+ match /\<box-decoration-break\>/ contained
+ match /\<box-shadow\>/ contained
+ match /\<border\(-\(top\|right\|bottom\|left\)\)\=\(-\(width\|color\|style\)\)\=\>/ contained
+ match /\<border\(-\(top\|bottom\)-\(left\|right\)\)\=-radius\>/ contained
+ match /\<border-image\(-\(outset\|repeat\|slice\|source\|width\)\)\=\>/ contained
+ match /\<box-decoration-break\>/ contained
+ match /\<box-shadow\>/ contained
+ links to cssProp
+cssBorderAttr xxx contained space space solid solid thin thin inset inset groove groove stretch stretch thick thick clone clone fill fill round round ridge ridge double double dashed dashed slice slice outset outset dotted dotted medium medium
+ links to cssAttr
+cssBoxProp xxx match /\<padding\(-\(top\|right\|bottom\|left\)\)\=\>/ contained
+ match /\<margin\(-\(top\|right\|bottom\|left\)\)\=\>/ contained
+ match /\<overflow\(-\(x\|y\|style\)\)\=\>/ contained
+ match /\<rotation\(-point\)\=\>/ contained
+ match /\<padding\(-\(top\|right\|bottom\|left\)\)\=\>/ contained
+ match /\<margin\(-\(top\|right\|bottom\|left\)\)\=\>/ contained
+ match /\<overflow\(-\(x\|y\|style\)\)\=\>/ contained
+ match /\<rotation\(-point\)\=\>/ contained
+ match /\<overflow-\(style\|x\|y\)\>/ contained
+ match /\<rotation\(-point\)\=\>/ contained
+ match /\<overflow-\(style\|x\|y\)\>/ contained
+ match /\<rotation\(-point\)\=\>/ contained
+ links to cssProp
+cssBoxAttr xxx contained marquee marquee scroll scroll auto auto visible visible panner panner scrollbar scrollbar hidden hidden
+ match /\<no-\(display\|content\)\>/ contained
+ match /\<no-\(display\|content\)\>/ contained
+ match /\<ruby\(-\(base\(-group\)\=\|text\(-group\)\=\)\)\=\>/ contained
+ match /\<no-\(display\|content\)\>/ contained
+ match /\<ruby\(-\(base\(-group\)\=\|text\(-group\)\=\)\)\=\>/ contained
+ match /\<no-\(display\|content\)\>/ contained
+ links to cssAttr
+cssColorProp xxx contained opacity opacity opacity opacity
+ match /\<color-profile\>/ contained
+ match /\<rendering-intent\>/ contained
+ match /\<color-profile\>/ contained
+ match /\<rendering-intent\>/ contained
+ links to cssProp
+cssDimensionProp xxx contained width width height height
+ match /\<\(min\|max\)-\(width\|height\)\>/ contained
+ match /\<\(min\|max\)-\(width\|height\)\>/ contained
+ links to cssProp
+cssFlexibleBoxProp xxx match /\<box-\(align\|direction\|flex\|ordinal-group\|orient\|pack\|shadow\|sizing\)\>/ contained
+ match /\<box-\(align\|direction\|flex\|ordinal-group\|orient\|pack\|shadow\|sizing\)\>/ contained
+ links to cssProp
+cssFlexibleBoxAttr xxx contained baseline baseline end end single single start start horizontal horizontal mulitple mulitple reverse reverse
+ match /\<vertical\(-align\)\@!\>/ contained
+ match /\<\(inline\|block\)-axis\>/ contained
+ match /\<vertical\(-align\)\@!\>/ contained
+ match /\<\(inline\|block\)-axis\>/ contained
+ links to cssAttr
+cssMultiColumnProp xxx contained columns columns
+ match /\<break-\(after\|before\|inside\)\>/ contained
+ match /\<column-\(count\|fill\|gap\|rule\(-\(color\|style\|width\)\)\=\|span\|width\)\>/ contained
+ match /\<page\(-break-\(before\|after\|inside\)\)\=\>/ contained
+ match /\<break-\(after\|before\|inside\)\>/ contained
+ match /\<column-\(count\|fill\|gap\|rule\(-\(color\|style\|width\)\)\=\|span\|width\)\>/ contained
+ match /\<page\(-break-\(before\|after\|inside\)\)\=\>/ contained
+ links to cssProp
+cssMultiColumnAttr xxx contained left left column column balance balance always always right right page page avoid avoid medium medium
+ match /\<avoid-\(page\|column\)\>/ contained
+ match /\<avoid-\(page\|column\)\>/ contained
+ links to cssAttr
+cssGeneratedContentProp xxx contained system system range range negative negative prefix prefix crop crop pad pad running running quotes quotes suffix suffix fallback fallback
+ match /\<counter-\(reset\|increment\)\>/ contained
+ match /\<move-to\>/ contained
+ match /\<page-policy\>/ contained
+ match /\<counter-\(reset\|increment\)\>/ contained
+ match /\<move-to\>/ contained
+ match /\<page-policy\>/ contained
+ match /\<\(additive-\)\=symbols\>/ contained
+ match /\<speak-as\>/ contained
+ match /\<string-set\>/ contained
+ match /\<footnote-\(display\|policy\)\>/ contained
+ match /\<bookmark-\(label\|level\|state\)\>/ contained
+ match /\<marker-side\>/ contained
+ match /\<counter-set\>/ contained
+ match /\<move-to\>/ contained
+ match /\<page-policy\>/ contained
+ match /\<move-to\>/ contained
+ match /\<page-policy\>/ contained
+ match /\<\(additive-\)\=symbols\>/ contained
+ match /\<speak-as\>/ contained
+ match /\<string-set\>/ contained
+ match /\<footnote-\(display\|policy\)\>/ contained
+ match /\<bookmark-\(label\|level\|state\)\>/ contained
+ match /\<marker-side\>/ contained
+ match /\<counter-set\>/ contained
+ links to cssProp
+cssGeneratedContentAttr xxx contained words words first first open open footnote footnote extends extends here here line line marker marker last last additive additive symbolic symbolic inhibit inhibit bullets bullets numbers numbers closed closed cyclic cyclic
+ match /\<\(no-\)\=\(open\|close\)-quote\>/ contained
+ match /\<\(no-\)\=\(open\|close\)-quote\>/ contained
+ match /\<cjk-decimal\>/ contained
+ match /\<disclosure-\(open\|closed\)\>/ contained
+ match /\<simp-chinese-\(in\)\=formal\>/ contained
+ match /\<trad-chinese-\(in\)\=formal\>/ contained
+ match /\<ethiopic-numeric\>/ contained
+ match /\<list-container\>/ contained
+ match /\<cjk-decimal\>/ contained
+ match /\<disclosure-\(open\|closed\)\>/ contained
+ match /\<simp-chinese-\(in\)\=formal\>/ contained
+ match /\<trad-chinese-\(in\)\=formal\>/ contained
+ match /\<ethiopic-numeric\>/ contained
+ match /\<list-container\>/ contained
+ links to cssAttr
+cssGridProp xxx match /\<grid-\(columns\|rows\)\>/ contained
+ match /\<grid-\(columns\|rows\)\>/ contained
+ links to cssProp
+cssHyerlinkProp xxx match /\<target\(-\(name\|new\|position\)\)\=\>/ contained
+ match /\<target\(-\(name\|new\|position\)\)\=\>/ contained
+ links to cssProp
+cssListProp xxx match /\<list-style\(-\(type\|position\|image\)\)\=\>/ contained
+ match /\<list-style\(-\(type\|position\|image\)\)\=\>/ contained
+ links to cssProp
+cssListAttr xxx contained outside outside disc disc hebrew hebrew armenian armenian circle circle inside inside square square georgian georgian
+ match /\<\(lower\|upper\)-\(roman\|alpha\|greek\|latin\)\>/ contained
+ match /\<\(hiragana\|katakana\)\(-iroha\)\=\>/ contained
+ match /\<\(decimal\(-leading-zero\)\=\|cjk-ideographic\)\>/ contained
+ match /\<\(lower\|upper\)-\(roman\|alpha\|greek\|latin\)\>/ contained
+ match /\<\(hiragana\|katakana\)\(-iroha\)\=\>/ contained
+ match /\<\(decimal\(-leading-zero\)\=\|cjk-ideographic\)\>/ contained
+ links to cssAttr
+cssPositioningProp xxx contained display display left left visibility visibility float float bottom bottom right right top top clear clear clip clip position position
+ match /\<z-index\>/ contained
+ match /\<z-index\>/ contained
+ links to cssProp
+cssPositioningAttr xxx contained absolute absolute both both left left relative relative compact compact static static fixed fixed block block right right
+ match /\<table\(-\(row-group\|\(header\|footer\)-group\|row\|column\(-group\)\=\|cell\|caption\)\)\=\>/ contained
+ match /\<list-item\>/ contained
+ match /\<inline\(-\(block\|box\|table\)\)\=\>/ contained
+ match /\<table\(-\(row-group\|\(header\|footer\)-group\|row\|column\(-group\)\=\|cell\|caption\)\)\=\>/ contained
+ match /\<list-item\>/ contained
+ match /\<inline\(-\(block\|box\|table\)\)\=\>/ contained
+ links to cssAttr
+cssPrintAttr xxx contained cross cross always always portrait portrait crop crop landscape landscape avoid avoid
+ links to cssAttr
+cssTableProp xxx match /\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\)\>/ contained
+ match /\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\)\>/ contained
+ links to cssProp
+cssTableAttr xxx contained separate separate show show always always fixed fixed once once collapse collapse hide hide
+ links to cssAttr
+cssTextProp xxx contained direction direction color color hyphens hyphens
+ match /\<\(\(word\|letter\)-spacing\|text\(-\(decoration\|transform\|align\|index\|shadow\)\)\=\|vertical-align\|unicode-bidi\|line-height\)\>/ contained
+ match /\<text-\(justify\|outline\|warp\|align-last\|size-adjust\|rendering\|stroke\|indent\)\>/ contained
+ match /\<word-\(break\|\wrap\)\>/ contained
+ match /\<white-space\>/ contained
+ match /\<hanging-punctuation\>/ contained
+ match /\<punctuation-trim\>/ contained
+ match /\<\(\(word\|letter\)-spacing\|text\(-\(decoration\|transform\|align\|index\|shadow\)\)\=\|vertical-align\|unicode-bidi\|line-height\)\>/ contained
+ match /\<text-\(justify\|outline\|warp\|align-last\|size-adjust\|rendering\|stroke\|indent\)\>/ contained
+ match /\<word-\(break\|\wrap\)\>/ contained
+ match /\<white-space\>/ contained
+ match /\<hanging-punctuation\>/ contained
+ match /\<punctuation-trim\>/ contained
+ match /\<line-break\>/ contained
+ match /\<overflow-wrap\>/ contained
+ match /\<tab-size\>/ contained
+ match /\<text-\(decoration\(-\(color\|line\|skip\|style\)\)\=\|underline-position\|emphasis\(-\(color\|position\|style\)\)\=\)\>/ contained
+ match /\<line-break\>/ contained
+ match /\<overflow-wrap\>/ contained
+ match /\<tab-size\>/ contained
+ match /\<text-\(decoration\(-\(color\|line\|skip\|style\)\)\=\|underline-position\|emphasis\(-\(color\|position\|style\)\)\=\)\>/ contained
+ links to cssProp
+cssTextAttr xxx contained baseline baseline optimizespeed optimizespeed loose loose first first ink ink end end hanging hanging optimizelegibility optimizelegibility strict strict start start alphabetic alphabetic last last ellipsis ellipsis overline overline objects objects embed embed blink blink rtl rtl dot dot
+ contained lowercase lowercase distribute distribute suppress suppress manual manual filled filled super super super super over over nowrap nowrap justify justify under under hyphenate hyphenate sub sub sub sub triangle triangle capitalize capitalize edges edges wavy wavy kashida kashida adjacent
+ contained adjacent underline underline middle middle unrestricted unrestricted sesame sesame ltr ltr uppercase uppercase clip clip spaces spaces
+ match /\<line-through\>/ contained
+ match /\<\(text-\)\=\(top\|bottom\)\>/ contained
+ match /\<pre\(-\(line\|wrap\)\)\=\>/ contained
+ match /\<\(allow\|force\)-end\>/ contained
+ match /\<inter-\(word\|ideographic\|cluster\)\>/ contained
+ match /\<break-all\>/ contained
+ match /\<break-word\>/ contained
+ match /\<bidi-override\>/ contained
+ match /\<line-through\>/ contained
+ match /\<\(text-\)\=\(top\|bottom\)\>/ contained
+ match /\<pre\(-\(line\|wrap\)\)\=\>/ contained
+ match /\<\(allow\|force\)-end\>/ contained
+ match /\<inter-\(word\|ideographic\|cluster\)\>/ contained
+ match /\<break-all\>/ contained
+ match /\<break-word\>/ contained
+ match /\<bidi-override\>/ contained
+ match /\<match-parent\>/ contained
+ match /\<each-line\>/ contained
+ match /\<full-width\>/ contained
+ match /\<box-decoration\>/ contained
+ match /\<match-parent\>/ contained
+ match /\<each-line\>/ contained
+ match /\<full-width\>/ contained
+ match /\<box-decoration\>/ contained
+ links to cssAttr
+cssTransformProp xxx match /\<transform\(-\(origin\|style\)\)\=\>/ contained
+ match /\<perspective\(-origin\)\=\>/ contained
+ match /\<backface-visibility\>/ contained
+ match /\<transform\(-\(origin\|style\)\)\=\>/ contained
+ match /\<perspective\(-origin\)\=\>/ contained
+ match /\<backface-visibility\>/ contained
+ links to cssProp
+cssTransitionProp xxx match /\<transition\(-\(delay\|duration\|property\|timing-function\)\)\=\>/ contained
+ match /\<transition\(-\(delay\|duration\|property\|timing-function\)\)\=\>/ contained
+ links to cssProp
+cssTransitionAttr xxx match /\<linear\(-gradient\)\@!\>/ contained
+ match /\<ease\(-\(in-out\|out\|in\)\)\=\>/ contained
+ match /\<step\(-start\|-end\)\=\>/ contained
+ match /\<linear\(-gradient\)\@!\>/ contained
+ match /\<ease\(-\(in-out\|out\|in\)\)\=\>/ contained
+ match /\<step\(-start\|-end\)\=\>/ contained
+ links to cssAttr
+cssUIProp xxx contained icon icon icon icon cursor cursor appearance appearance resize resize resize resize
+ match /\<box-sizing\>/ contained
+ match /\<ime-mode\>/ contained
+ match /\<nav-\(down\|index\|left\|right\|up\)\=\>/ contained
+ match /\<outline\(-\(width\|style\|color\|offset\)\)\=\>/ contained
+ match /\<text-overflow\>/ contained
+ match /\(tap-highlight-color\|user-select\|touch-callout\)/ contained
+ match /\<box-sizing\>/ contained
+ match /\<ime-mode\>/ contained
+ match /\<nav-\(down\|index\|left\|right\|up\)\=\>/ contained
+ match /\<outline\(-\(width\|style\|color\|offset\)\)\=\>/ contained
+ match /\<text-overflow\>/ contained
+ match /\(tap-highlight-color\|user-select\|touch-callout\)/ contained
+ match /\<box-sizing\>/ contained
+ match /\<ime-mode\>/ contained
+ match /\<nav-\(index\|up\|right\|down\|left\)/ contained
+ match /\<outline-offset\>/ contained
+ match /\<text-overflow\>/ contained
+ match /\<box-sizing\>/ contained
+ match /\<ime-mode\>/ contained
+ match /\<nav-\(index\|up\|right\|down\|left\)/ contained
+ match /\<outline-offset\>/ contained
+ match /\<text-overflow\>/ contained
+ links to cssProp
+cssUIAttr xxx contained button button both both help help disabled disabled disabled disabled vertical vertical vertical vertical cell cell root root ellipsis ellipsis ellipsis ellipsis pointer pointer progress progress horizontal horizontal horizontal horizontal icon icon invert invert text text move move move
+ contained move alias alias window window copy copy wait wait document document menu menu field field inactive inactive inactive inactive active active active active crosshair crosshair clip clip clip clip
+ match /\<\(content\|padding\|border\)\(-box\)\=\>/ contained
+ match /\<\(\([ns]\=[ew]\=\)\|col\|row\|nesw\|nwse\)-resize\>/ contained
+ match /\<context-menu\>/ contained
+ match /\<no-drop\>/ contained
+ match /\<not-allowed\>/ contained
+ match /\<all-scroll\>/ contained
+ match /\<\(vertical-\)\=text\>/ contained
+ match /\<zoom\(-in\|-out\)\=\>/ contained
+ match /\(preserve-3d\)/ contained
+ match /\<\(content\|padding\|border\)\(-box\)\=\>/ contained
+ match /\<\(\([ns]\=[ew]\=\)\|col\|row\|nesw\|nwse\)-resize\>/ contained
+ match /\<context-menu\>/ contained
+ match /\<no-drop\>/ contained
+ match /\<not-allowed\>/ contained
+ match /\<all-scroll\>/ contained
+ match /\<\(vertical-\)\=text\>/ contained
+ match /\<zoom\(-in\|-out\)\=\>/ contained
+ match /\(preserve-3d\)/ contained
+ links to cssAttr
+cssIEUIAttr xxx match /\(bicubic\)/ contained
+ match /\(bicubic\)/ contained
+ links to cssAttr
+cssIEUIProp xxx match /\(interpolation-mode\|zoom\|filter\)/ contained
+ match /\(interpolation-mode\|zoom\|filter\)/ contained
+ links to cssProp
+cssAuralProp xxx contained volume volume richness richness stress stress during during azimuth azimuth elevation elevation
+ match /\<\(pause\|cue\)\(-\(before\|after\)\)\=\>/ contained
+ match /\<\(play-during\|speech-rate\|voice-family\|pitch\(-range\)\=\|speak\(-\(punctuation\|numeral\|header\)\)\=\)\>/ contained
+ match /\<\(pause\|cue\)\(-\(before\|after\)\)\=\>/ contained
+ match /\<\(play-during\|speech-rate\|voice-family\|pitch\(-range\)\=\|speak\(-\(punctuation\|numeral\|header\)\)\=\)\>/ contained
+ match /\<voice-\(volume\|balance\|rate\|pitch\|range\|stress\|duration\)\>/ contained
+ match /\<rest\(-\(before\|after\)\)\=\>/ contained
+ match /\<voice-\(volume\|balance\|rate\|pitch\|range\|stress\|duration\)\>/ contained
+ match /\<rest\(-\(before\|after\)\)\=\>/ contained
+ links to cssProp
+cssAuralAttr xxx contained mix mix rightwards rightwards neutral neutral behind behind moderate moderate silent silent higher higher preserve preserve non non young young faster faster leftwards leftwards female female old old above above continuous continuous code code reduced reduced below below lower lower
+ contained digits digits slower slower level level child child male male
+ match /\<\(x-\)\=\(soft\|loud\)\>/ contained
+ match /\<spell-out\>/ contained
+ match /\<\(left\|right\)-side\>/ contained
+ match /\<\(far\|center\)-\(left\|center\|right\)\>/ contained
+ match /\<\(x-\)\=\(slow\|fast\|low\|high\)\>/ contained
+ match /\<\(x-\)\=\(soft\|loud\)\>/ contained
+ match /\<spell-out\>/ contained
+ match /\<\(left\|right\)-side\>/ contained
+ match /\<\(far\|center\)-\(left\|center\|right\)\>/ contained
+ match /\<\(x-\)\=\(slow\|fast\|low\|high\)\>/ contained
+ match /\<\(literal\|no\)-punctuation\>/ contained
+ match /\<\(x-\)\=\(weak\|strong\)\>/ contained
+ match /\<\(literal\|no\)-punctuation\>/ contained
+ match /\<\(x-\)\=\(weak\|strong\)\>/ contained
+ links to cssAttr
+cssMobileTextProp xxx match /\<text-size-adjust\>/ contained
+ match /\<text-size-adjust\>/ contained
+ links to cssProp
+cssBraceError xxx match /}/ contained
+ match /}/ contained
+ links to Error
+cssAttrComma xxx match /,/ contained
+ match /,/ contained
+ links to Special
+cssNoise xxx match +\(:\|;\|\/\)+ contained
+ match +\(:\|;\|\/\)+ contained
+ links to Noise
+cssPseudoClassId xxx contained empty empty empty empty target target target target content content left left disabled disabled disabled disabled link link marker marker optional optional root root root root valid valid future future slot slot past past region region blank blank right right invalid invalid invalid
+ contained invalid checked checked checked checked before before scope scope host host after after required required indeterminate indeterminate active active shadow shadow enabled enabled hover hover visited visited enable enable current current default default
+ match /\<first-\(line\|letter\)\>/ contained
+ match /\<\(first\|last\|only\)-\(of-type\|child\)\>/ contained
+ match /\<selection\>/ contained
+ match /\<focus\(-inner\)\=\>/ contained
+ match /\<\(input-\)\=placeholder\>/ contained
+ match /\<first-\(line\|letter\)\>/ contained
+ match /\<\(first\|last\|only\)-\(of-type\|child\)\>/ contained
+ match /\<selection\>/ contained
+ match /\<focus\(-inner\)\=\>/ contained
+ match /\<\(input-\)\=placeholder\>/ contained
+ match /\<footnote-\(call\|marker\)\>/ contained
+ match /\<\(scope\|host\)-context\>/ contained
+ match /\<last-\(child\|of-type\)\>/ contained
+ match /\<first-of-type\>/ contained
+ match /\<only-\(child\|of-type\)\>/ contained
+ match /\<\(any\|local\)-link\>/ contained
+ match /\<read-\(only\|write\)\>/ contained
+ match /\<placeholder-shown\>/ contained
+ match /\<\(in\|out-of\)-range\>/ contained
+ match /\<user-error\>/ contained
+ match /\<\(active\|valid\|invalid\)-drop-target\>/ contained
+ match /\<last-\(child\|of-type\)\>/ contained
+ match /\<first-of-type\>/ contained
+ match /\<only-\(child\|of-type\)\>/ contained
+ match /\<footnote-\(call\|marker\)\>/ contained
+ match /\<\(scope\|host\)-context\>/ contained
+ match /\<\(any\|local\)-link\>/ contained
+ match /\<read-\(only\|write\)\>/ contained
+ match /\<placeholder-shown\>/ contained
+ match /\<\(in\|out-of\)-range\>/ contained
+ match /\<user-error\>/ contained
+ match /\<\(active\|valid\|invalid\)-drop-target\>/ contained
+ links to PreProc
+cssPseudoClassFn xxx matchgroup=cssFunctionName start=/\<\(not\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(/ end=/)/ contained
+ matchgroup=cssFunctionName start=/\<\(not\|lang\|\(nth\|nth-last\)-\(of-type\|child\)\)(/ end=/)/ contained
+cssSpecialCharQQ xxx match /\\\\\|\\"/ contained
+ match /\\\\\|\\"/ contained
+cssSpecialCharQ xxx match /\\\\\|\\'/ contained
+ match /\\\\\|\\'/ contained
+cssPseudoClassLang xxx matchgroup=cssPseudoClassId start=/:\(host\)(/ end=/)/ contained oneline
+ matchgroup=cssPseudoClassId start=/:\(nth\(-last\)\=-\(child\|of-type\)\|not\)(/ end=/)/ contained oneline
+ matchgroup=cssPseudoClassId start=/:\(matches\|dir\|local-link\|current\|nth\(-last\)\=-\(match\|column\)\|column\)(/ end=/)/ contained oneline
+ matchgroup=cssPseudoClassId start=/:\(nth\(-last\)\=-\(child\|of-type\)\|not\)(/ end=/)/ contained oneline
+ matchgroup=cssPseudoClassId start=/:\(host\)(/ end=/)/ contained oneline
+ matchgroup=cssPseudoClassId start=/:\(matches\|dir\|local-link\|current\|nth\(-last\)\=-\(match\|column\)\|column\)(/ end=/)/ contained oneline
+ links to Constant
+cssColor800000 xxx contained maroon maroon maroon
+cssColorff0000 xxx contained red red red
+cssColorffA500 xxx contained orange orange orange
+cssColorffff00 xxx contained yellow yellow yellow
+cssColor808000 xxx contained olive olive olive
+cssColor800080 xxx contained purple purple purple
+cssColorff00ff xxx contained magenta magenta magenta fuchsia fuchsia fuchsia
+cssColorffffff xxx contained white white white
+cssColor00ff00 xxx contained lime lime lime
+cssColor008000 xxx contained green green green
+cssColor000080 xxx contained navy navy navy
+cssColor0000ff xxx contained blue blue blue
+cssColor00ffff xxx contained cyan cyan cyan aqua aqua aqua
+cssColor008080 xxx contained teal teal teal
+cssColor000000 xxx contained black black black
+cssColorc0c0c0 xxx contained silver silver silver
+cssColor808080 xxx contained gray gray gray grey grey grey
+cssColorF0F8FF xxx contained aliceblue aliceblue aliceblue
+cssColorFAEBD7 xxx contained antiquewhite antiquewhite antiquewhite
+cssColor7FFFD4 xxx contained aquamarine aquamarine aquamarine
+cssColorF0FFFF xxx contained azure azure azure
+cssColorF5F5DC xxx contained beige beige beige
+cssColorFFE4C4 xxx contained bisque bisque bisque
+cssColorFFEBCD xxx contained blanchedalmond blanchedalmond blanchedalmond
+cssColor8A2BE2 xxx contained blueviolet blueviolet blueviolet
+cssColorA52A2A xxx contained brown brown brown
+cssColorDEB887 xxx contained burlywood burlywood burlywood
+cssColor5F9EA0 xxx contained cadetblue cadetblue cadetblue
+cssColor7FFF00 xxx contained chartreuse chartreuse chartreuse
+cssColorD2691E xxx contained chocolate chocolate chocolate
+cssColorFF7F50 xxx contained coral coral coral
+cssColor6495ED xxx contained cornflowerblue cornflowerblue cornflowerblue
+cssColorFFF8DC xxx contained cornsilk cornsilk cornsilk
+cssColorDC143C xxx contained crimson crimson crimson
+cssColor00008B xxx contained darkblue darkblue darkblue
+cssColor008B8B xxx contained darkcyan darkcyan darkcyan
+cssColorB8860B xxx contained darkgoldenrod darkgoldenrod darkgoldenrod
+cssColorA9A9A9 xxx contained darkgray darkgray darkgray darkgrey darkgrey darkgrey
+cssColor006400 xxx contained darkgreen darkgreen darkgreen
+cssColorBDB76B xxx contained darkkhaki darkkhaki darkkhaki
+cssColor8B008B xxx contained darkmagenta darkmagenta darkmagenta
+cssColor556B2F xxx contained darkolivegreen darkolivegreen darkolivegreen
+cssColorFF8C00 xxx contained darkorange darkorange darkorange
+cssColor9932CC xxx contained darkorchid darkorchid darkorchid
+cssColor8B0000 xxx contained darkred darkred darkred
+cssColorE9967A xxx contained darksalmon darksalmon darksalmon
+cssColor8FBC8F xxx contained darkseagreen darkseagreen darkseagreen
+cssColor483D8B xxx contained darkslateblue darkslateblue darkslateblue
+cssColor2F4F4F xxx contained darkslategray darkslategray darkslategray darkslategrey darkslategrey darkslategrey
+cssColor00CED1 xxx contained darkturquoise darkturquoise darkturquoise
+cssColor9400D3 xxx contained darkviolet darkviolet darkviolet
+cssColorFF1493 xxx contained deeppink deeppink deeppink
+cssColor00BFFF xxx contained deepskyblue deepskyblue deepskyblue
+cssColor696969 xxx contained dimgray dimgray dimgray dimgrey dimgrey dimgrey
+cssColor1E90FF xxx contained dodgerblue dodgerblue dodgerblue
+cssColorB22222 xxx contained firebrick firebrick firebrick
+cssColorFFFAF0 xxx contained floralwhite floralwhite floralwhite
+cssColor228B22 xxx contained forestgreen forestgreen forestgreen
+cssColorDCDCDC xxx contained gainsboro gainsboro gainsboro
+cssColorF8F8FF xxx contained ghostwhite ghostwhite ghostwhite
+cssColorFFD700 xxx contained gold gold gold
+cssColorDAA520 xxx contained goldenrod goldenrod goldenrod
+cssColorADFF2F xxx contained greenyellow greenyellow greenyellow
+cssColorF0FFF0 xxx contained honeydew honeydew honeydew
+cssColorFF69B4 xxx contained hotpink hotpink hotpink
+cssColorCD5C5C xxx contained indianred indianred indianred
+cssColor4B0082 xxx contained indigo indigo indigo
+cssColorFFFFF0 xxx contained ivory ivory ivory
+cssColorF0E68C xxx contained khaki khaki khaki
+cssColorE6E6FA xxx contained lavender lavender lavender
+cssColorFFF0F5 xxx contained lavenderblush lavenderblush lavenderblush
+cssColor7CFC00 xxx contained lawngreen lawngreen lawngreen
+cssColorFFFACD xxx contained lemonchiffon lemonchiffon lemonchiffon
+cssColorADD8E6 xxx contained lightblue lightblue lightblue
+cssColorF08080 xxx contained lightcoral lightcoral lightcoral
+cssColorE0FFFF xxx contained lightcyan lightcyan lightcyan
+cssColorFAFAD2 xxx contained lightgoldenrodyellow lightgoldenrodyellow lightgoldenrodyellow
+cssColorD3D3D3 xxx contained lightgray lightgray lightgray lightgrey lightgrey lightgrey
+cssColor90EE90 xxx contained lightgreen lightgreen lightgreen
+cssColorFFB6C1 xxx contained lightpink lightpink lightpink
+cssColorFFA07A xxx contained lightsalmon lightsalmon lightsalmon
+cssColor20B2AA xxx contained lightseagreen lightseagreen lightseagreen
+cssColor87CEFA xxx contained lightskyblue lightskyblue lightskyblue
+cssColor778899 xxx contained lightslategrey lightslategrey lightslategrey lightslategray lightslategray lightslategray
+cssColorB0C4DE xxx contained lightsteelblue lightsteelblue lightsteelblue
+cssColorFFFFE0 xxx contained lightyellow lightyellow lightyellow
+cssColor32CD32 xxx contained limegreen limegreen limegreen
+cssColorFAF0E6 xxx contained linen linen linen
+cssColor66CDAA xxx contained mediumaquamarine mediumaquamarine mediumaquamarine
+cssColor0000CD xxx contained mediumblue mediumblue mediumblue
+cssColorBA55D3 xxx contained mediumorchid mediumorchid mediumorchid
+cssColor9370D8 xxx contained mediumpurple mediumpurple mediumpurple
+cssColor3CB371 xxx contained mediumseagreen mediumseagreen mediumseagreen
+cssColor7B68EE xxx contained mediumslateblue mediumslateblue mediumslateblue
+cssColor00FA9A xxx contained mediumspringgreen mediumspringgreen mediumspringgreen
+cssColor48D1CC xxx contained mediumturquoise mediumturquoise mediumturquoise
+cssColorC71585 xxx contained mediumvioletred mediumvioletred mediumvioletred
+cssColor191970 xxx contained midnightblue midnightblue midnightblue
+cssColorF5FFFA xxx contained mintcream mintcream mintcream
+cssColorFFE4E1 xxx contained mistyrose mistyrose mistyrose
+cssColorFFE4B5 xxx contained moccasin moccasin moccasin
+cssColorFFDEAD xxx contained navajowhite navajowhite navajowhite
+cssColorFDF5E6 xxx contained oldlace oldlace oldlace
+cssColor6B8E23 xxx contained olivedrab olivedrab olivedrab
+cssColorFF4500 xxx contained orangered orangered orangered
+cssColorDA70D6 xxx contained orchid orchid orchid
+cssColorEEE8AA xxx contained palegoldenrod palegoldenrod palegoldenrod
+cssColor98FB98 xxx contained palegreen palegreen palegreen
+cssColorAFEEEE xxx contained paleturquoise paleturquoise paleturquoise
+cssColorD87093 xxx contained palevioletred palevioletred palevioletred
+cssColorFFEFD5 xxx contained papayawhip papayawhip papayawhip
+cssColorFFDAB9 xxx contained peachpuff peachpuff peachpuff
+cssColorCD853F xxx contained peru peru peru
+cssColorFFC0CB xxx contained pink pink pink
+cssColorDDA0DD xxx contained plum plum plum
+cssColorB0E0E6 xxx contained powderblue powderblue powderblue
+cssColorBC8F8F xxx contained rosybrown rosybrown rosybrown
+cssColor4169E1 xxx contained royalblue royalblue royalblue
+cssColor8B4513 xxx contained saddlebrown saddlebrown saddlebrown
+cssColorFA8072 xxx contained salmon salmon salmon
+cssColorF4A460 xxx contained sandybrown sandybrown sandybrown
+cssColor2E8B57 xxx contained seagreen seagreen seagreen
+cssColorFFF5EE xxx contained seashell seashell seashell
+cssColorA0522D xxx contained sienna sienna sienna
+cssColor87CEEB xxx contained skyblue skyblue skyblue
+cssColor6A5ACD xxx contained slateblue slateblue slateblue
+cssColor708090 xxx contained slategray slategray slategray slategrey slategrey slategrey
+cssColorFFFAFA xxx contained snow snow snow
+cssColor00FF7F xxx contained springgreen springgreen springgreen
+cssColor4682B4 xxx contained steelblue steelblue steelblue
+cssColorD2B48C xxx contained tan tan tan
+cssColorD8BFD8 xxx contained thistle thistle thistle
+cssColorFF6347 xxx contained tomato tomato tomato
+cssColor40E0D0 xxx contained turquoise turquoise turquoise
+cssColorEE82EE xxx contained violet violet violet
+cssColorF5DEB3 xxx contained wheat wheat wheat
+cssColorF5F5F5 xxx contained whitesmoke whitesmoke whitesmoke
+cssColor9ACD32 xxx contained yellowgreen yellowgreen yellowgreen
+lessDefinition xxx matchgroup=cssBraces start=/{/ end=/}/ contained transparent fold contains=cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssTagName,cssPseudoClass,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,lessDefinition,lessComment,lessClassChar,lessVariable,lessMixinChar,lessAmpersandChar,lessFunction,lessNestedSelector,@cssColors
+lessComment xxx match +//.*$+ contained contains=@Spell
+ links to Comment
+lessVariable xxx match /@[[:alnum:]_-]\+/ contained
+ match /@[[:alnum:]_-]\+/ contained nextgroup=lessVariableAssignment skipwhite
+ links to Special
+lessMixinChar xxx match /\.[[:alnum:]_-]\@=/ contained nextgroup=lessClass
+ links to Special
+lessAmpersandChar xxx match /&/ contained nextgroup=lessClass,cssPseudoClass
+ links to Special
+lessFunction xxx contained containedin=cssDefinition %
+ contained containedin=cssDefinition e
+ contained containedin=cssDefinition mix
+ contained containedin=cssDefinition luma
+ contained containedin=cssDefinition greyscale
+ contained containedin=cssDefinition rgba
+ contained containedin=cssDefinition average
+ contained containedin=cssDefinition red
+ contained containedin=cssDefinition ceil
+ contained containedin=cssDefinition spin
+ contained containedin=cssDefinition rgb
+ contained containedin=cssDefinition fadein
+ contained containedin=cssDefinition unit
+ contained containedin=cssDefinition negation
+ contained containedin=cssDefinition saturation
+ contained containedin=cssDefinition contrast
+ contained containedin=cssDefinition blue
+ contained containedin=cssDefinition fadeout
+ contained containedin=cssDefinition alpha
+ contained containedin=cssDefinition desaturate
+ contained containedin=cssDefinition difference
+ contained containedin=cssDefinition lightness
+ contained containedin=cssDefinition multiply
+ contained containedin=cssDefinition hsla
+ contained containedin=cssDefinition percentage
+ contained containedin=cssDefinition softlight
+ contained containedin=cssDefinition floor
+ contained containedin=cssDefinition round
+ contained containedin=cssDefinition screen
+ contained containedin=cssDefinition hsva
+ contained containedin=cssDefinition exclusion
+ contained containedin=cssDefinition saturate
+ contained containedin=cssDefinition lighten
+ contained containedin=cssDefinition hardlight
+ contained containedin=cssDefinition argb
+ contained containedin=cssDefinition green
+ contained containedin=cssDefinition escape
+ contained containedin=cssDefinition overlay
+ contained containedin=cssDefinition fade
+ contained containedin=cssDefinition hsl
+ contained containedin=cssDefinition hsv
+ contained containedin=cssDefinition darken
+ contained containedin=cssDefinition hue
+ links to Function
+lessNestedSelector xxx match +[^/]* {+me=e-1 contained contains=cssTagName,cssAttributeSelector,lessAmpersandChar,lessVariable,lessMixinChar,lessFunction,lessNestedProperty
+lessVariableAssignment xxx match /:/ contained nextgroup=lessVariableValue skipwhite
+lessVariableValue xxx match /.*;/me=e-1 contained contains=lessVariable,lessOperator,lessDefault,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,@cssColors
+ links to Constant
+lessOperator xxx match /+/ contained
+ match /-/ contained
+ match +/+ contained
+ match /*/ contained
+lessDefault xxx match /!default/ contained
+ links to Special
+lessNestedProperty xxx match /[[:alnum:]]\+:/me=e-1 contained
+ links to Type
+lessClass xxx match /[[:alnum:]_-]\+/ contained
+ links to PreProc
+lessStyle xxx start=+<style [^>]*type *=[^>]*text/less[^>]*>+ end=+</style>+ keepend contains=@htmlLess,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc containedin=htmlHead
+phpRegion xxx matchgroup=Delimiter start=/<?\(php\)\=/ end=/?>/ keepend contains=@phpClTop
+phpRegionSc xxx matchgroup=Delimiter start=/<script language="php">/ end=+</script>+ keepend contains=@phpClTop
+sqlSpecial xxx contained false true null
+ links to Special
+sqlKeyword xxx contained add cluster share rowlabel desc end maxextents function into option validate synonym exclusive pctfree as smallint by column start compress if is asc values resource row whenever to nocompress offline return then of on index rows procedure initial for immediate privileges unique begin
+ contained connect user modify session cursor nowait table identified file trigger order else having loop public exception size with access type view where from using elsif mode rownum check increment online current level decimal default group successful uid
+ links to sqlSpecial
+sqlOperator xxx contained some all like and any exists or not between sysdate prior out in escape minus intersect union distinct
+ links to sqlStatement
+sqlStatement xxx contained create comment execute alter audit noaudit revoke select set grant update lock drop insert truncate explain delete rename rollback analyze savepoint commit
+ links to Statement
+sqlType xxx contained rowid number varray raw boolean varchar2 float varchar long integer char mlslabel date character
+ links to Type
+sqlString xxx start=/"/ skip=/\\\\\|\\"/ end=/"/ contained
+ start=/'/ skip=/\\\\\|\\'/ end=/'/ contained
+ links to String
+sqlNumber xxx match /-\=\<\d*\.\=[0-9_]\>/ contained
+ links to Number
+sqlTodo xxx contained note todo debug fixme xxx
+ links to Todo
+sqlComment xxx start=+/\*+ end=+\*/+ contained contains=sqlTodo
+ match /--.*$/ contained contains=sqlTodo
+ links to Comment
+phpEnvVar xxx contained SERVER_SIGNATURE HTTP_USER_AGENT SERVER_NAME SERVER_PROTOCOL SERVER_SOFTWARE GATEWAY_INTERFACE HTTP_ENCODING SCRIPT_FILENAME SERVER_PORT REQUEST_METHOD SERVER_ADMIN HTTP_ACCEPT_CHARSET REMOTE_PORT HTTP_HOST HTTP_CONNECTION QUERY_STRING HTTP_ACCEPT_LANGUAGE HTTP_REFERER HTTP_ACCEPT
+ contained DOCUMENT_ROOT REQUEST_URI SCRIPT_NAME PATH_TRANSLATED REMOTE_ADDR
+ links to Identifier
+phpIntVar xxx contained _COOKIE HTTP_ENV_VARS GLOBALS _SERVER _SERVER HTTP_SESSION_VARS _REQUEST HTTP_RAW_POST_DATA _SESSION _GET HTTP_SERVER_VARS PHP_SELF HTTP_GET_VARS HTTP_STATE_VARS _FILES PHP_ERRMSG HTTP_COOKIE_VARS _ENV _POST HTTP_POST_FILES HTTP_POST_VARS
+ links to Identifier
+phpCoreConstant xxx contained E_PARSE E_WARNING PHP_VERSION E_ALL PHP_OUTPUT_HANDLER_CONT PHP_LOCALSTATEDIR PHP_OUTPUT_HANDLER_START E_NOTICE E_USER_ERROR E_CORE_WARNING PHP_SYSCONFDIR E_USER_WARNING PHP_BINDIR DEFAULT_INCLUDE_PATH E_STRICT E_COMPILE_ERROR E_CORE_ERROR PEAR_EXTENSION_DIR E_COMPILE_WARNING E_ERROR
+ contained PHP_OUTPUT_HANDLER_END PHP_EXTENSION_DIR PHP_OS PHP_LIBDIR PHP_CONFIG_FILE_PATH PHP_DATADIR E_USER_NOTICE PEAR_INSTALL_DIR
+ links to Constant
+phpConstant xxx contained __function__ __line__ __class__ __namespace__ __method__ __dir__ __file__
+ links to Constant
+phpFunctions xxx contained gzclose yaz_syntax html_entity_decode fbsql_read_blob png2wbmp mssql_init cpdf_set_title gztell fbsql_insert_id empty cpdf_restore mysql_field_type closelog swftext ldap_search curl_errno gmp_div_r mssql_data_seek getmyinode printer_draw_pie mcve_initconn ncurses_getmaxyx defined
+ contained localeconv socket_set_block is_file dio_close dbmclose array_change_key_case bcscale mysqli_use_result tidy_parse_file dba_sync bzcompress udm_alloc_agent fdf_set_flags ftp_nb_put ncurses_update_panels abs mb_regex_set_options msql_fetch_object stream_context_set_params cpdf_lineto uksort
+ contained symlink mcve_destroyconn mcal_event_set_class mssql_field_type sqlite_escape_string php_sapi_name ncurses_mvgetch pdf_open mb_convert_variables mssql_fetch_row sql_regcase fsockopen ncurses_slk_refresh imagecolorallocatealpha mcve_setssl ftp_pwd fbsql_autocommit vpopmail_alias_add
+ contained shm_remove mysqli_info msession_set_array ncurses_move_panel pdf_close_image mailparse_msg_create mysqli_fetch_field_direct mb_ereg_search_getregs pg_tty ccvs_status dbplus_freerlocks hw_getchildcoll get_extension_funcs tidy_get_head mcve_preauth fdf_enum_values yaz_ccl_conf
+ contained mysqli_get_server_info ora_errorcode ctype_alnum session_id cpdf_set_subject pdf_close_pdi stat mailparse_msg_extract_part_file dbplus_info mysql_list_processes pspell_check mcve_transinqueue dbplus_rcreate sizeof imap_renamemailbox ncurses_pnoutrefresh tidy_get_root stream_get_transports
+ contained addcslashes imap_fetch_overview mcve_liststats openssl_x509_checkpurpose get_resource_type ibase_timefmt ctype_space imap_set_quota openssl_private_encrypt ifx_prepare chop imagecreatetruecolor hw_insertanchors pdf_set_text_pos udm_crc32 socket_strerror mb_decode_mimeheader xpath_eval
+ contained quoted_printable_decode session_is_registered msql_fieldlen dbplus_undoprepare ob_get_status mcve_uwait ncurses_keypad mysqli_profiler swf_rotate stream_get_filters posix_ctermid min explode mcve_setssl_files trim hw_getobjectbyqueryobj fopen socket_create_pair pdf_setpolydash
+ contained pg_lo_unlink imap_get_quotaroot array_pop imagefill printer_select_font ifxus_write_slob ncurses_mouse_trafo imagecopymergegray mysql_error clearstatcache mssql_result ob_get_contents msql_listfields msession_create pg_free_result ini_restore cpdf_closepath_stroke ftp_close getmyuid
+ contained pg_field_type ftp_get_option ibase_blob_info fstat openssl_pkey_get_private ircg_set_on_die filepro ocicloselob sqlite_fetch_array mime_content_type pg_connection_reset mssql_close imagecreatefromjpeg get_browser sqlite_next array_fill file_exists get_class is_int swf_posround
+ contained posix_mkfifo yp_err_string mb_regex_encoding imap_clearflag_full mysqli_init ldap_dn2ufn filetype dbx_escape_string mysqli_param_count easter_date fmod sybase_pconnect msql_free_result ocinewcollection ifxus_free_slob join is_double udm_api_version ncurses_bottom_panel fbsql_field_name
+ contained swf_setfont ncurses_wgetch odbc_exec pdf_get_value imagecolorclosestalpha pg_cancel_query log1p recode_string mcve_setblocking bzread dbase_create ncurses_ungetch swf_translate ora_commit ncurses_init_color sesam_field_name imap_last_error pdf_open_file serialize cpdf_place_inline_image
+ contained swffill wddx_deserialize ocicollassign ftp_mdtm ncurses_nocbreak ociwritetemporarylob fbsql_result phpinfo preg_split mssql_fetch_batch mcal_event_set_recur_daily pdf_set_horiz_scaling printer_start_page filegroup cpdf_arc imagepsencodefont dbplus_close vpopmail_add_alias_domain_ex
+ contained stream_get_line ncurses_mvaddchstr ibase_pconnect ncurses_newwin notes_header_info strrpos openssl_x509_read sha1_file com_addref msql_pconnect yaz_wait closedir odbc_field_num mysql_errno udm_add_search_limit mb_send_mail floatval aspell_new pdf_place_pdi_page array_keys fdf_get_flags
+ contained imagesavealpha dba_insert swf_startsymbol is_readable printer_set_option zend_version jpeg2wbmp pdf_set_border_style ncurses_slk_clear is_object pg_put_line mcrypt_list_modes fdf_get_status strip_tags fbsql_list_fields ftp_systype fbsql_fetch_object pg_affected_rows cpdf_set_creator
+ contained ncurses_delwin ncurses_new_panel ob_list_handlers imap_errors filepro_fieldname hw_document_bodytag glob pdf_set_info_subject dio_seek strnatcmp ldap_modify hw_document_content ncurses_slk_attroff wddx_packet_end ibase_affected_rows sqlite_fetch_string mcve_transactionbatch
+ contained pg_fetch_object ociparse ncurses_pair_content imap_headerinfo deaggregate strftime ncurses_attrset pg_host disk_total_space socket_iovec_delete unregister_tick_function mb_ereg_search_init zip_entry_read w32api_deftype ezmlm_hash mysql_num_fields openssl_pkey_export tidy_is_xhtml
+ contained yaz_set_option gzgetc odbc_execute hw_getobjectbyquerycoll msql_connect ircg_register_format_messages image_type_to_mime_type spliti swf_ortho2 connection_aborted stream_set_write_buffer is_scalar ncurses_flushinp pdf_set_parameter set_include_path dbplus_runlink ncurses_mouseinterval
+ contained imagefilledpolygon ncurses_panel_window xml_set_character_data_handler vpopmail_auth_user ifx_connect getopt ncurses_mvaddstr stream_get_wrappers hw_insdoc gzuncompress fbsql_select_db get_include_path ctype_upper pcntl_wstopsig fgetcsv swfmovie dbplus_setindexbynumber jddayofweek
+ contained xmlrpc_server_add_introspection_data fbsql_create_blob odbc_errormsg fam_monitor_file mssql_query ocifreedesc rand cpdf_output_buffer pcntl_wexitstatus ifxus_close_slob dbx_close output_add_rewrite_var debug_print_backtrace ldap_set_option socket_create_listen socket_recvmsg
+ contained xml_get_error_code cpdf_setrgbcolor vprintf mb_preferred_mime_name imagepng mcal_date_compare session_set_save_handler stream_wrapper_register mb_strimwidth asin mb_output_handler cybercash_base64_encode pdf_stroke mysqli_stat socket_set_option ibase_blob_import ftp_nlist ncurses_mvvline
+ contained vpopmail_alias_get_all mcve_deluser easter_days imap_headers mysqli_slave_query ldap_mod_replace create_function readline_info udm_check_charset cpdf_rotate_text fbsql_database_password ncurses_has_key curl_init shm_remove_var mysql_create_db ncurses_attroff udm_close_stored cpdf_rect
+ contained set_file_buffer hw_new_document ncurses_wstandend set_magic_quotes_runtime hw_incollections array_udiff sybase_fetch_assoc printer_create_dc pdf_get_image_width hw_info cpdf_continue_text msql_drop_db ibase_free_result gmp_hamdist localtime mt_getrandmax ircg_html_encode posix_getsid
+ contained array_map nsapi_request_headers cal_to_jd ocicollgetelem ircg_set_current pdf_continue_text ibase_rollback_ret bindec socket_iovec_free ldap_compare imap_thread stripcslashes end odbc_free_result ocifreecollection mb_encode_mimeheader swf_shapemoveto mysqli_commit gregoriantojd
+ contained sybase_min_server_severity msession_get_array hw_identify ovrimos_prepare unpack fbsql_close connection_timeout ccvs_count sesam_fetch_row pdf_fill mcal_fetch_event ibase_gen_id ming_setscale sybase_fetch_row ncurses_curs_set iconv_mime_encode mcal_event_set_recur_yearly
+ contained ingres_field_scale mysql_pconnect ldap_next_reference gmp_init cpdf_save checkdnsrr strncmp is_a wordwrap pg_options domxml_xslt_stylesheet imagefontwidth stream_copy_to_stream imap_fetchstructure printer_end_doc readline_write_history imap_listsubscribed preg_quote swf_definepoly
+ contained swf_getbitmapinfo ftp_chdir mhash_count var_export pdf_endpath printer_select_brush get_magic_quotes_runtime mcve_initengine uasort pdf_add_locallink ifx_update_char ifxus_open_slob pdf_setrgbcolor_stroke mcal_expunge pdf_setgray_stroke swf_placeobject mcrypt_ofb bzwrite
+ contained mcve_iscommadelimited mcrypt_decrypt ircg_nickname_escape aggregate odbc_autocommit mcve_verifyconnection memory_get_usage notes_find_note mysqli_execute str_ireplace cpdf_set_action_url msession_get strstr unlink ircg_whois swf_closefile pdf_get_pdi_value session_decode lstat swfgradient
+ contained is_finite pcntl_exec http_build_query mcve_transactionauth tidy_setopt openssl_public_decrypt array_walk pack get_meta_tags ncurses_noecho mysql_field_seek pdf_add_launchlink cyrus_close ncurses_instr ncurses_wvline dbase_close vpopmail_del_domain crack_closedict ncurses_color_content
+ contained system odbc_tableprivileges ora_rollback diskfreespace recode_file tidy_get_status posix_getuid pg_field_prtlen posix_getpgid getmygid dbx_query imagecreatefromwbmp soundex fbsql_drop_db apache_child_terminate mcve_settle bcdiv ora_logoff ldap_err2str dbplus_restorepos
+ contained pdf_set_border_color fdf_open ftp_quit hw_inscoll curl_error mcve_deletetrans ociloadlob jdtogregorian odbc_setoption metaphone pdf_lineto gmp_intval pg_last_oid shmop_write imap_search shm_get_var ingres_connect pdf_place_image mysqli_bind_result srand mcrypt_enc_get_algorithms_name
+ contained checkdate mssql_field_name cpdf_set_char_spacing ibase_commit_ret mcal_event_set_title ovrimos_field_type openssl_x509_check_private_key pdf_get_font ccvs_done mysql_field_name xml_set_element_handler ingres_field_name ocibindbyname cpdf_page_init cpdf_moveto link mysqli_error
+ contained ifx_textasvarchar swf_addcolor array_diff_uassoc java_last_exception_get mysql_fetch_lengths iconv swf_definefont nl2br mssql_fetch_assoc msql_num_rows pdf_close_pdi_page gmp_prob_prime dbplus_tremove dbplus_sql ncurses_addnstr gmp_clrbit ovrimos_field_num sesam_execimm ob_clean
+ contained imap_getsubscribed hw_getobjectbyquery gmp_scan0 gmp_scan1 sqlite_current call_user_func ovrimos_connect mssql_fetch_array ifx_copy_blob dngettext shm_detach ldap_count_entries posix_geteuid ocicollassignelem urlencode parse_ini_file dns_get_record ovrimos_rollback odbc_error
+ contained msession_list swf_actiongotolabel yp_first fbsql_query ming_useswfversion range readline_list_history mysql_result odbc_result_all mysqli_thread_id sort dbase_get_header_info stream_filter_prepend swf_shapefilloff cpdf_set_word_spacing mhash_keygen_s2k sscanf mb_strpos gethostbyaddr
+ contained ncurses_delay_output ncurses_mvaddch ereg_replace posix_getpwuid dbplus_undo hw_document_size tidy_repair_string pg_insert pg_fetch_array pdf_show_xy passthru dbplus_rkeys juliantojd pdf_moveto lzf_decompress mcal_event_set_recur_weekly sleep tidy_config_count mssql_free_statement expm1
+ contained gzfile ocistatementtype mysql_fetch_array mysql_data_seek ibase_param_info pdf_set_info_title muscat_setup_net mysqli_fetch hw_childrenobj is_writeable cpdf_set_keywords mysqli_fetch_array bcsqrt swfdisplayitem yp_master ncurses_slk_attron ftp_rawlist notes_create_note fdf_errno
+ contained ncurses_bkgd debugger_off dbx_fetch_row jdmonthname dio_write aggregate_methods_by_list import_request_variables pg_pconnect imap_get_quota ceil ocicancel socket_set_nonblock cpdf_circle ocicolumnscale cpdf_newpath php_ini_scanned_files com_release posix_setgid fdf_create imap_qprint
+ contained imap_deletemailbox pdf_show_boxed dbplus_freealllocks xmlrpc_get_type hypot swf_shapearc mcrypt_enc_is_block_algorithm cyrus_query fbsql_rollback mcve_numrows fileinode imagedestroy ncurses_panel_below socket_set_timeout ora_open mcal_event_init hw_stat str_word_count mcal_date_valid
+ contained fwrite imap_mail_move stream_set_timeout imap_reopen array_reverse pdf_set_value hw_errormsg nl_langinfo vpopmail_set_user_quota bin2hex java_last_exception_clear token_get_all dio_fcntl cpdf_set_leading imagepsloadfont hw_getremotechildren pdf_set_text_rise ascii2ebcdic aggregate_info
+ contained imagepsfreefont ftp_raw putenv msql_dbname hw_output_document ocinumcols mcve_transactionavs imagefontheight msession_count mssql_rows_affected printer_start_doc ltrim mcve_return openssl_pkcs7_verify imap_status xmlrpc_encode_request array_merge_recursive ifx_getsqlca ovrimos_longreadlen
+ contained dl printer_get_option strrchr msg_set_queue fdf_get_encoding fbsql_password mysqli_free_result mysqli_rpl_probe list pg_fetch_row domxml_open_file com_propset openssl_free_key mysql_connect atan2 odbc_prepare fgets pdf_open_image mcal_store_event array_diff_assoc mysqli_fetch_lengths
+ contained dbplus_curr ifx_nullformat fdf_add_doc_javascript posix_setegid readline mb_get_info imagecopy swf_textwidth ncurses_newpad readlink bcpow socket_getsockname pg_query com_load vpopmail_del_user ifxus_create_slob printer_draw_elipse swfbutton_keypress iconv_strpos msql_fieldtype
+ contained unserialize rsort yaz_addinfo mb_ereg call_user_method_array bzdecompress mb_split fpassthru imap_listscan pdf_rect printer_delete_brush ncurses_standout ifx_pconnect printer_end_page mysqli_disable_reads_from_master dbplus_tcl ncurses_wcolor_set atan pspell_save_wordlist domxml_new_doc
+ contained pspell_new_config pg_client_encoding ccvs_sale mysqli_num_fields odbc_cursor fbsql_affected_rows mcal_event_set_category array_udiff_uassoc ifx_create_blob acos imap_lsub mysql_close apache_getenv ovrimos_exec lzf_compress gzdeflate fbsql_pconnect ifx_byteasvarchar pg_lo_write dio_read
+ contained imagecreatefromgd2 cpdf_begin_text pg_update cpdf_rotate exif_imagetype is_dir mysqli_ping ncurses_reset_shell_mode pdf_setlinewidth ftell sybase_set_message_handler mysqli_prepare_result textdomain imagecreatefromstring hw_mapid mb_substr posix_setsid swf_startdoaction
+ contained mysqli_enable_reads_from_master cpdf_finalize posix_getppid imagecolorexact cpdf_set_viewer_preferences msql_listtables ncurses_slk_color mysqli_stmt_errno imagecolorresolve gmp_neg ncurses_def_prog_mode mysql_drop_db ovrimos_num_fields crack_opendict disk_free_space cpdf_setgray_fill
+ contained mcrypt_enc_self_test gmp_strval dbplus_last curl_multi_getcontent fam_pending krsort ldap_set_rebind_proc pdf_get_image_height imap_createmailbox getprotobynumber odbc_num_rows pg_result_seek mcve_gft stream_get_contents bzclose odbc_data_source pdf_skew mb_detect_order mcrypt_cfb
+ contained swf_fontslant ob_get_level swf_modifyobject readgzfile ociserverversion mysql_field_flags swf_endbutton ncurses_inch ifx_get_blob unset iconv_mime_decode_headers msession_timeout ini_set msg_stat_queue ncurses_noraw bzerrstr escapeshellarg domxml_xmltree implode func_get_args str_rot13
+ contained ncurses_typeahead ibase_wait_event imagecolorset pdf_concat get_parent_class log10 fdf_get_attachment printer_draw_text xml_set_end_namespace_decl_handler pdf_get_parameter pdf_stringwidth filepro_fieldcount mysqli_field_count ifx_do pspell_config_runtogether ircg_lookup_format_messages
+ contained apache_setenv imagepalettecopy posix_setpgid hw_children filepro_fieldwidth fdf_save imap_num_msg hw_api_content yaz_database mysql_insert_id hw_unlock ftp_ssl_connect msql_numrows gmp_gcd get_included_files udm_free_ispell_data sybase_result mssql_select_db udm_error ircg_pconnect
+ contained socket_clear_error set_error_handler odbc_result acosh is_callable ifx_free_char xml_set_default_handler com_propget odbc_connect mysqli_query pspell_new getservbyname mysqli_stmt_close curl_multi_exec hebrevc ingres_fetch_object intval mysqli_prepare reset odbc_close_all session_destroy
+ contained print_r printer_delete_pen mcrypt_module_is_block_mode pdf_setfont convert_cyr_string ingres_field_precision mysqli_master_query ncurses_mvhline msql_tablename ftp_mkdir ldap_first_reference ibase_blob_add dbminsert ncurses_getch fdf_set_javascript_action tidy_warning_count hebrev usort
+ contained sqlite_last_error fdf_next_field_name sprintf ncurses_wnoutrefresh ncurses_mvaddchnstr dbplus_lockrel hw_getchilddoccoll fileperms rad2deg pcntl_wtermsig restore_include_path count ncurses_flash posix_getrlimit mt_srand compact base64_encode hw_pconnect htmlspecialchars imagefttext
+ contained mailparse_determine_best_xfer_encoding apache_get_version cpdf_setlinewidth zip_read swf_ortho ldap_get_option fbsql_list_dbs gzread session_register hw_getobjectbyquerycollobj ncurses_panel_above mcve_transactionssent dirname time sybase_min_error_severity fbsql_fetch_lengths
+ contained udm_get_doc_count mysql_affected_rows fputs fbsql_free_result snmpset imap_num_recent ldap_first_entry mcal_time_valid sybase_connect udm_find iconv_mime_decode json_last_error ucwords curl_setopt fbsql_warnings imagettftext call_user_func_array sqlite_column ldap_explode_dn
+ contained mcrypt_enc_get_block_size xpath_new_context ifx_fetch_row msession_connect mailparse_stream_encode pfpro_process in_array array_count_values pclose mcve_getcell msession_set atanh imagecreatefromgif mcve_getuserarg mcal_days_in_month ob_start iconv_get_encoding mcve_transactionitem
+ contained odbc_fetch_into sqlite_rewind wddx_serialize_vars ociwritelobtofile ingres_field_length mcal_create_calendar openssl_verify printer_logical_fontheight ncurses_border array_rand odbc_pconnect unixtojd getservbyport pspell_config_mode hw_gettext curl_version ociexecute ldap_rename
+ contained mssql_fetch_object pdf_setrgbcolor_fill aggregate_methods_by_regexp preg_replace_callback mysqli_stmt_store_result hwapi_hgcsp ncurses_nl xml_set_external_entity_ref_handler swfshape ob_get_clean get_html_translation_table swf_actiongeturl cal_info hw_getanchors ora_commitoff
+ contained socket_getpeername array_filter mktime domxml_open_mem xslt_set_sax_handler printer_open mcal_open pdf_add_bookmark ldap_sort ctype_alpha imagechar mcrypt_enc_get_modes_name mssql_get_last_message ncurses_reset_prog_mode odbc_primarykeys swf_polarview bzerrno udm_get_res_param
+ contained fbsql_tablename dbplus_prev ocinewdescriptor imageistruecolor bccomp mcal_reopen dbmreplace mcve_adduserarg udm_clear_search_limits msession_uniq ibase_add_user msql_numfields mysql_fetch_row mb_strwidth sem_get odbc_field_name mcal_delete_event vsprintf mysqli_field_seek array
+ contained msql_selectdb pdf_restore prev cpdf_set_font_map_file extension_loaded ncurses_insstr fclose imap_utf7_encode pcntl_waitpid socket_last_error fileatime pdf_arcn mysql_get_proto_info ncurses_insch ncurses_init com_isenum snmpwalkoid cpdf_scale mssql_guid_string imageantialias func_get_arg
+ contained ctype_cntrl openssl_pkey_export_to_file register_tick_function ncurses_meta socket_send sesam_diagnostic mysqli_connect imap_utf8 fbsql_field_flags exec session_get_cookie_params ip2long hw_cp pdf_circle printer_create_pen cpdf_import_jpeg php_uname xslt_set_scheme_handlers mb_strtolower
+ contained fgetc printer_create_brush is_integer parse_url sqlite_busy_timeout msql_fetch_array mysql_list_tables ocilogon ocisavelob pdf_add_pdflink bcadd imagepolygon cpdf_set_text_matrix mb_substitute_character levenshtein yaz_es_result ldap_unbind imagesetbrush class_exists cpdf_clip mysql_info
+ contained fdf_set_submit_form_action array_combine socket_sendto tanh strtoupper ibase_free_query zip_entry_close mysqli_dump_debug_info mcve_listusers pg_get_notify debugger_on sybase_select_db setlocale ncurses_slk_attrset pdf_open_memory_image ccvs_lookup pdf_save pcntl_fork iconv_substr
+ contained ncurses_wclear imagecolormatch xmlrpc_server_register_introspection_callback pg_lo_open fdf_set_value swf_perspective openssl_private_decrypt ncurses_vidattr ftp_cdup gzpassthru ocinlogon swf_enddoaction cpdf_setrgbcolor_stroke posix_uname ncurses_mousemask
+ contained mcal_event_set_recur_monthly_wday cpdf_rmoveto dbplus_savepos ingres_rollback pi ocinewcursor cpdf_set_font udm_free_agent aggregate_methods yaz_get_option ncurses_waddch ibase_blob_create pg_escape_string fbsql_get_autostart_info is_executable pg_lo_import msql_num_fields stristr
+ contained ifx_blobinfile_mode tidy_get_body get_defined_functions getrandmax mcal_rename_calendar mb_http_output ob_flush fdf_error ifxus_read_slob ldap_errno imap_8bit mysqli_fetch_assoc session_module_name yp_get_default_domain str_pad mcal_delete_calendar fileowner ovrimos_commit ncurses_timeout
+ contained strcoll error_log strncasecmp posix_ttyname udm_check_stored xml_parser_create_ns ifx_error cpdf_closepath ncurses_slk_restore hw_root dba_close com_load_typelib pdf_set_leading ibase_errmsg hw_who imageellipse ibase_fetch_object sybase_min_client_severity sesam_seek_row
+ contained ncurses_replace_panel ncurses_mvaddnstr cyrus_authenticate proc_open udm_open_stored imagewbmp ftp_fget strval hw_free_document ldap_error ingres_commit swf_shapecurveto imap_close pg_ping preg_match dbx_sort ircg_nickname_unescape is_numeric openssl_csr_sign stream_context_get_options
+ contained pg_set_client_encoding pdf_fill_stroke yaz_ccl_parse ftp_nb_continue fseek gzgetss mb_strcut ibase_field_info array_intersect_assoc odbc_columns dechex mssql_execute imap_list set_time_limit mysql_client_encoding yp_match ncurses_whline exit ora_close mcrypt_generic dbase_open
+ contained get_loaded_extensions ncurses_vline imagecreatefromxbm msql_list_fields strtolower ccvs_auth dba_delete fbsql_set_lob_mode substr_compare mcve_numcolumns mysqli_kill ora_exec ncurses_mvinch ifx_fieldproperties com_invoke mysqli_affected_rows cybercash_encr sybase_close mb_strlen
+ contained fam_suspend_monitor pdf_set_duration curl_multi_select hw_insertdocument pspell_store_replacement hw_setlinkroot array_chunk sesam_connect session_regenerate_id ftp_chmod imap_listmailbox ora_plogon hw_docbyanchor hw_error muscat_give utf8_encode pdf_open_ccitt ncurses_keyok mcve_ping
+ contained pdf_makespotcolor mysqli_ssl_set gmp_legendre mysql_escape_string stream_socket_accept sinh next strtotime ncurses_werase mcal_day_of_week mssql_field_length pdf_setgray dbase_replace_record imap_rfc822_parse_headers array_diff msql_result dba_replace dbmnextkey mcrypt_module_open
+ contained ftp_login fbsql_hostname dbx_connect pg_escape_bytea swf_fontsize odbc_statistics mysqli_real_escape_string ibase_num_fields odbc_field_scale mb_encode_numericentity ncurses_wattron msql stream_socket_get_name xslt_create fdf_remove_item gmp_cmp mssql_next_result mcal_next_recurrence
+ contained mb_strtoupper curl_exec xslt_free ncurses_qiflush udm_set_agent_param ncurses_slk_set mssql_bind dotnet_load pg_lo_close cybercash_decr ncurses_slk_attr openssl_x509_free mcve_connectionerror parse_str bcmod snmp_get_quick_print ncurses_termattrs pg_lo_export preg_replace hw_getrellink
+ contained headers_list qdom_tree ncurses_show_panel ncurses_termname ircg_join imap_timeout ereg mb_eregi ocirowcount hw_getparents mcve_void w32api_invoke_function imap_base64 imagecreatefromgd ksort sybase_num_fields pspell_add_to_session flock ingres_close pg_field_num hw_getusername
+ contained ncurses_scr_init dbmfirstkey msql_createdb ora_commiton hw_getremote openssl_x509_export socket_write mb_http_input aspell_suggest ctype_digit pdf_arc opendir cpdf_stringwidth ldap_free_result gmp_sub imap_mail_copy cpdf_setdash ncurses_has_colors imagerotate mailparse_msg_get_part
+ contained func_num_args fbsql_change_user imagefilltoborder mcrypt_module_get_algo_block_size imagecolorstotal vpopmail_alias_del imagepsbbox msession_lock notes_unread msql_select_db gethostbynamel odbc_columnprivileges mcal_popen natsort scandir zip_entry_compressedsize pg_copy_to getmypid
+ contained ctype_punct mysql_query iptcembed curl_multi_add_handle notes_list_msgs xml_parser_create ncurses_addchnstr ncurses_erase quotemeta imagetypes msql_close fbsql_start_db swf_popmatrix mcve_responseparam microtime pdf_findfont sqlite_libversion cpdf_setflat getcwd yp_cat cpdf_add_annotation
+ contained filesize dbplus_xunlockrel ldap_8859_to_t61 str_split odbc_fetch_row dbase_pack ifx_free_result fdf_add_template socket_connect array_udiff_assoc domxml_xslt_stylesheet_doc pg_lo_seek udm_load_ispell_data json_decode mysqli_change_user ldap_connect mysqli_select_db getprotobyname define
+ contained ncurses_can_change_color extract ociresult mb_ereg_search hw_mv get_current_user tidy_getopt ora_do zip_entry_filesize asinh ocicolumnisnull ircg_is_conn_alive imap_body swf_removeobject get_declared_classes ingres_pconnect usleep key gmp_div_q imap_fetchheader socket_get_status
+ contained shm_put_var imap_ping tidy_access_count openlog ctype_graph hexdec bzopen curl_close proc_get_status aggregation_info odbc_procedurecolumns get_defined_constants get_class_vars curl_getinfo fdf_header odbc_foreignkeys xptr_new_context dbase_numrecords sin pdf_curveto ldap_list
+ contained readline_clear_history odbc_field_type xmlrpc_set_type pspell_add_to_personal mb_ereg_search_pos dbplus_rcrtexact curl_multi_info_read swfsprite openssl_x509_parse stream_filter_register ibase_fetch_assoc sybase_fetch_field file_get_contents mysqli_close imageline ldap_get_entries
+ contained ocicolumnname stream_set_blocking mysqli_field_tell dbase_get_record ocifreecursor ncurses_nonl imap_mail pdf_closepath_stroke domxml_version ncurses_killchar ociinternaldebug cal_days_in_month gmp_sign swf_scale cal_from_jd ingres_fetch_array method_exists msession_find fbsql_commit
+ contained mcve_getheader dba_nextkey ifx_fieldtypes array_intersect mcal_event_set_end pdf_get_pdi_parameter socket_listen uniqid posix_times bcmul xmlrpc_server_register_method fbsql_fetch_array swfaction mysql_get_server_info mcve_transactioncv call_user_method ibase_free_event_handler
+ contained xml_parser_set_option openssl_pkcs7_decrypt mssql_num_rows cpdf_save_to_file stream_socket_recvfrom pdf_clip rewinddir zip_close cpdf_set_page_animation xmlrpc_server_create mysql_db_query imagecopyresized pdf_open_png mysql_num_rows ifx_update_blob sybase_fetch_object gmp_sqrtrem
+ contained wddx_packet_start zip_entry_open cpdf_open ncurses_clear mcve_chkpwd printer_draw_chord posix_getlogin ob_get_flush output_reset_rewrite_vars fprintf frenchtojd filepro_retrieve ora_getcolumn imap_mime_header_decode strnatcasecmp register_shutdown_function mysqli_real_query
+ contained mssql_min_error_severity msql_dropdb openssl_pkcs7_sign filepro_rowcount fbsql_db_query file openssl_pkey_get_public getmxrr ncurses_filter fribidi_log2vis imap_getmailboxes sybase_min_message_severity mysql_free_result getlastmod ibase_blob_echo ibase_prepare mcve_destroyengine
+ contained openssl_seal chgrp stream_socket_server odbc_fetch_array ora_parse yaz_record swf_actionplay ldap_mod_del posix_isatty imap_expunge mcve_getcommadelimited sybase_field_seek swf_pushmatrix fdf_get_value ncurses_use_default_colors yp_all ncurses_deleteln fdf_close dbplus_first
+ contained mysqli_rollback mcrypt_module_is_block_algorithm ncurses_mvcur sybase_unbuffered_query imagecopymerge xml_get_current_line_number openssl_pkey_new posix_getpwnam pdf_open_pdi_page crack_getlastmessage odbc_field_len fdf_set_version ocisetprefetch swffont msql_fieldtable
+ contained wddx_serialize_value mysqli_fetch_fields is_infinite imagecolorclosesthwb dbplus_find stream_context_set_option odbc_specialcolumns msql_affected_rows openssl_csr_export_to_file pg_copy_from pdf_open_tiff pfpro_cleanup substr_replace chr mysql_field_table getallheaders ibase_trans
+ contained imap_rfc822_parse_adrlist odbc_commit chown gd_info mysqli_get_client_info gmp_fact ora_numrows pdf_set_text_matrix gmp_or gethostbyname pfpro_process_raw strtok xmlrpc_parse_method_descriptions ncurses_echo getrusage is_null sem_release ocierror swf_setframe ncurses_insertln
+ contained swf_shapefillsolid ncurses_clrtoeol pg_delete aggregate_properties cpdf_global_set_document_limits yaz_schema mcve_preauthcompletion pdf_close printer_delete_font hw_objrec2array mb_ereg_search_getpos ovrimos_num_rows openssl_csr_new dbplus_open sqlite_unbuffered_query sqrt ctype_xdigit
+ contained mysqli_options xmlrpc_encode mcve_getuserparam ob_iconv_handler copy sqlite_create_function mhash gmp_div_qr ldap_close iconv_set_encoding restore_error_handler mysqli_real_connect mysqli_autocommit dbplus_rchperm ncurses_refresh mcve_bt pdf_add_weblink ncurses_getyx ftp_get iconv_strrpos
+ contained mcal_event_set_recur_none sqlite_popen filemtime pdf_closepath fdf_save_string imagedashedline imagecolorat ncurses_slk_noutrefresh fdf_get_ap pspell_new_personal mysqli_num_rows mhash_get_block_size swf_shapefillbitmaptile imagecreatefromxpm ncurses_init_pair ovrimos_free_result
+ contained udm_get_res_field imap_getacl imagecolorallocate ncurses_scr_restore mysql_get_client_info print is_bool mailparse_msg_get_structure dbplus_flush pg_connect fread chroot mcrypt_generic_deinit ncurses_putp dbplus_setindex imap_mailboxmsginfo pg_num_fields jewishtojd feof asort
+ contained msession_randstr apache_response_headers ignore_user_abort cpdf_set_text_rise strripos fdf_get_opt odbc_num_fields substr cyrus_connect sesam_errormsg ifxus_seek_slob count_chars pdf_begin_template hw_api_attribute is_array ncurses_insdelln mysql_change_user mysqli_enable_rpl_parse
+ contained mysqli_stmt_affected_rows imagefilledellipse ifx_num_rows getdate floor gzeof tempnam ncurses_addch imap_rfc822_write_address ctype_print vpopmail_add_alias_domain yaz_range mb_ereg_search_setpos dba_open printer_draw_rectangle ncurses_attron yp_errno basename dba_key_split
+ contained ibase_modify_user readfile dbplus_add fbsql_num_rows gzgets ob_implicit_flush swf_shapelinesolid stream_filter_append xpath_eval_expression dbplus_freelock mcve_transactionid pg_lo_tell assert_options curl_multi_close imap_setflag_full imap_bodystruct number_format gmp_xor pdf_setlinecap
+ contained posix_getgrgid ob_end_flush pg_send_query dbplus_unlockrel swf_shapefillbitmapclip ocicolumnprecision fdf_set_ap mysqli_disable_rpl_parse filepro_fieldtype imagecreate version_compare sybase_num_rows is_nan pdf_set_info ftp_pasv overload ovrimos_fetch_row posix_setuid ccvs_command
+ contained imap_setacl round pg_port mssql_connect iconv_strlen array_merge pdf_open_image_file mcve_override lcg_value odbc_do ftp_nb_get ftp_exec ncurses_prefresh imap_msgno ircg_notice printer_close crypt mysql_ping mcve_deleteresponse mb_ereg_match ucfirst ingres_query variant
+ contained imagecolorexactalpha swf_actionprevframe isset ibase_drop_db pdf_setcolor ncurses_waddstr ibase_rollback mysql_unbuffered_query ftp_fput ncurses_start_color trigger_error ncurses_scr_dump pdf_closepath_fill_stroke pspell_config_create socket_accept dns_check_record ircg_set_file
+ contained mcal_event_add_attribute is_subclass_of gzinflate constant sqlite_libencoding base_convert cpdf_setrgbcolor_fill notes_create_db socket_bind mcrypt_encrypt imagettfbbox ircg_fetch_error_msg gmp_div ncurses_addstr get_cfg_var socket_iovec_set posix_kill xml_parse_into_struct
+ contained imagepsextendfont shell_exec ovrimos_field_name tidy_get_config sqlite_query max mysqli_character_set_name imap_binary mcve_gl ncurses_bkgdset dbase_get_record_with_names odbc_gettypeinfo mysql_fetch_object pdf_set_border_dash mcrypt_get_iv_size sqlite_close mysqli_debug
+ contained swf_addbuttonrecord ibase_connect ibase_delete_user rtrim pdf_set_text_rendering get_defined_vars swf_startbutton ibase_commit tan xmlrpc_server_destroy ifx_get_char zip_entry_compressionmethod pg_end_copy mysql_tablename mailparse_msg_get_part_data printer_create_font mcve_disableuser
+ contained com yaz_scan odbc_fetch_object msql_field_seek cos chunk_split imagecreatefrompng swf_mulcolor gmp_pow udm_cat_list xslt_errno sqlite_array_query sqlite_seek imap_append pdf_set_font phpversion pdf_rotate mysqli_rpl_query_type mysqli_send_long_data zlib_get_coding_type mcve_text_code
+ contained sybase_fetch_array pg_fetch_all ncurses_wstandout mcrypt_ecb mysqli_fetch_field fbsql_db_status imagerectangle yaz_connect dbplus_unselect notes_mark_read dba_fetch fam_next_event dns_get_mx preg_grep ob_end_clean pdf_get_majorversion msql_freeresult vpopmail_passwd md5_file
+ contained mcrypt_get_block_size jdtojewish ocidefinebyname ncurses_longname imap_undelete mcve_deleteusersetup pdf_scale pg_result_status is_long apache_request_headers swf_showframe xslt_error shmop_read session_start ocifetchstatement ldap_start_tls exif_read_data dbplus_update ircg_kick
+ contained sesam_fetch_array swf_actiongotoframe vpopmail_add_user swf_actiontogglequality printer_draw_line hw_getobject mysqli_read_query_result imap_unsubscribe error_reporting gmp_sqrt wddx_add_vars gmp_random msql_list_tables com_set xmlrpc_decode_request umask pdf_setrgbcolor get_class_methods
+ contained cyrus_unbind mysqli_fetch_object ncurses_cbreak imap_check xslt_set_log posix_seteuid str_shuffle ncurses_isendwin mysqli_reload mcve_force xml_set_start_namespace_decl_handler is_real highlight_string dba_exists ncurses_halfdelay rewind pdf_setdash ldap_next_entry yaz_element
+ contained ncurses_wmove tidy_get_html gzputs fbsql_num_fields cybercash_base64_decode mcal_event_set_start ncurses_use_extended_names ldap_delete vpopmail_alias_del_domain swf_definebitmap fam_cancel_monitor ocicollmax ncurses_baudrate strpos sesam_rollback ircg_get_username gmp_abs
+ contained tidy_get_error_buffer mcal_event_set_recur_monthly_mday odbc_tables bind_textdomain_codeset muscat_setup dcngettext gettext mb_ereg_replace gzwrite ftp_nb_fget shmop_open session_encode vpopmail_del_domain_ex ocicommit dblist sesam_fetch_result dba_popen notes_nav_create pg_get_result
+ contained ora_logon swfbitmap ncurses_resetty msql_create_db array_reduce chdir mcrypt_get_key_size each ifx_errormsg hw_getchilddoccollobj get_required_files fdf_set_opt fbsql_set_transaction shmop_close mssql_min_message_severity pfsockopen dbmfetch snmpget dbmdelete yaz_present dbmexists
+ contained array_splice imagesetpixel imagesettile mcve_transsend ncurses_ungetmouse md5 mysqli_rpl_parse_enabled dio_open com_propput fbsql_fetch_assoc hw_getanchorsobj stream_socket_sendto msession_getdata pg_fetch_assoc imagejpeg apache_lookup_uri array_multisort ccvs_delete pg_num_rows
+ contained swf_endsymbol swf_shapelineto xslt_output_process ifx_num_fields posix_getpgrp mb_strrpos fnmatch gettimeofday aggregate_properties_by_regexp socket_iovec_alloc session_unset swf_fonttracking posix_getgrnam gmp_popcount socket_iovec_fetch array_unique tidy_set_encoding mcrypt_module_close
+ contained dio_stat ccvs_textvalue msql_fieldname ob_gzhandler escapeshellcmd imap_subscribe imap_alerts hw_array2objrec socket_sendmsg ingres_field_type mailparse_msg_parse_file ncurses_beep ifx_close cpdf_setgray shmop_delete ccvs_init mcve_transactiontext ifx_htmltbl_result socket_set_blocking
+ contained pspell_config_repl snmprealwalk gmp_setbit ircg_topic qdom_error pdf_add_thumbnail dbplus_errno shmop_size filectime openssl_error_string addslashes proc_terminate printer_draw_bmp mcve_monitor cpdf_stroke dbplus_ropen dbplus_rrename pg_convert posix_getgid vpopmail_error
+ contained xslt_set_sax_handlers msg_remove_queue bcpowmod mysql_fetch_field gmp_jacobi delete ccvs_add com_get cpdf_setlinecap readline_add_history pdf_set_char_spacing xml_parser_get_option pg_trace mb_language sybase_free_result ldap_parse_reference sesam_query imap_sort sem_acquire
+ contained mcrypt_enc_get_key_size ibase_name_result mssql_fetch_field xml_set_object money_format pg_get_pid pdf_open_gif imagegd ob_get_length ircg_part exif_thumbnail ncurses_noqiflush mysqli_store_result mcve_chngpwd pg_meta_data yaz_close mysql_get_host_info array_flip setcookie
+ contained xml_error_string posix_get_last_error imap_open dba_handlers yaz_itemorder ldap_bind mcve_sale session_write_close mcal_event_set_description tidy_repair_file split ccvs_report hw_close pdf_add_outline msession_unlock arsort sybase_deadlock_retry_count jdtofrench mcve_edituser
+ contained msession_inc imagefilledarc imagecolorresolvealpha gmp_invert is_float xslt_set_scheme_handler hw_modifyobject cpdf_fill_stroke dba_list mcve_checkstatus ftp_rmdir pspell_config_personal mysql_field_len msg_get_queue ibase_blob_open gzopen array_values ncurses_addchstr fbsql_read_clob
+ contained imap_scanmailbox cpdf_closepath_fill_stroke msql_list_dbs mcrypt_module_get_algo_key_size pg_last_error swf_nextid fbsql_username mcve_qc ncurses_wattrset pg_connection_status pdf_end_pattern msg_receive connection_status pdf_end_page mcal_snooze ncurses_wrefresh array_push
+ contained imagefilledrectangle ncurses_end ibase_errcode mcal_fetch_current_stream_event pdf_setmiterlimit pdf_initgraphics swf_shapecurveto3 getenv dbplus_chdir session_name dbplus_aql odbc_rollback swf_endshape cyrus_bind cpdf_show socket_iovec_add swf_actionnextframe imagegd2 swf_getframe
+ contained ldap_first_attribute swf_definetext session_set_cookie_params pspell_clear_session mcrypt_enc_get_supported_key_sizes zend_logo_guid pdf_setlinejoin readdir mdecrypt_generic pathinfo pfpro_init ibase_blob_close read_exif_data mcal_append_event cpdf_translate printer_list swf_startshape
+ contained socket_readv ifx_query crack_check dba_firstkey zip_open fbsql_database pdf_setflat pg_fetch_result ocicollsize sqlite_create_aggregate udm_cat_path dbx_error xml_get_current_byte_index flush sqlite_num_rows sybase_get_last_message ncurses_del_panel swfmorph pspell_config_ignore
+ contained fbsql_field_seek ncurses_delch readline_completion_function msql_error mcve_text_cv printer_draw_roundrect dbx_compare fdf_set_file hw_deleteobject stripslashes linkinfo ora_fetch_into rename ibase_close dbplus_resolve ocifreestatement mcve_text_avs headers_sent mb_internal_encoding
+ contained ingres_field_nullable sqlite_error_string sqlite_last_insert_rowid ncurses_use_env preg_match_all notes_mark_unread sqlite_changes ini_get recode ibase_blob_get hw_changeobject imap_mail_compose pcntl_wifsignaled posix_getgroups imagesetstyle odbc_field_precision session_unregister
+ contained fbsql_errno pdf_set_info_creator ncurses_assume_default_colors sesam_field_array hw_dummy is_uploaded_file pdf_get_buffer swf_defineline ldap_mod_add ora_numcols ncurses_doupdate ocicollappend printf is_link dbplus_rzap msession_listvar mssql_free_result mt_rand ovrimos_close
+ contained file_put_contents php_logo_guid hw_getparentsobj pdf_end_template sem_remove w32api_register_function str_repeat yaz_sort tidy_get_release dbplus_rsecindex ncurses_def_shell_mode fbsql_field_table mcrypt_create_iv ncurses_define_key ncurses_wattroff posix_getegid yaz_scan_result
+ contained mysqli_get_host_info ftp_nb_fput fbsql_error gmstrftime function_exists bzflush sqlite_has_more mysql_select_db ldap_parse_result mssql_num_fields udm_errno yaz_search cpdf_set_font_directories strlen session_cache_expire ftruncate mcve_ub imagestringup bindtextdomain swfbutton
+ contained apache_get_modules imagepscopyfont ncurses_hline sesam_affected_rows fbsql_create_db ifxus_tell_slob stream_register_wrapper msql_fetch_field fbsql_field_len mcve_gut zip_entry_name mcal_list_events shuffle mcve_getcellbynum doubleval ftp_delete ncurses_scrl imagecopyresampled pg_dbname
+ contained ociplogon mb_decode_numericentity die odbc_close ocicolumntyperaw tidy_diagnose imagecolorsforindex imap_fetchbody dir ccvs_return mysqli_get_server_version eval urldecode mcrypt_generic_init fdf_set_status cpdf_finalize_page mcve_completeauthorizations array_shift ftp_rename ord
+ contained pcntl_wifexited gzencode ncurses_standend cpdf_curveto ncurses_wborder rmdir imap_uid ftp_set_option gzcompress pg_untrace token_name cpdf_close openssl_sign pdf_add_note gmp_com mcrypt_module_get_supported_key_sizes touch fbsql_list_tables strchr xslt_set_encoding var_dump
+ contained hw_insertobject tidy_clean_repair rawurlencode ingres_num_rows muscat_get yaz_errno mysql_list_fields gmp_add ncurses_echochar cpdf_set_text_pos mysql_fetch_assoc utf8_decode exp ncurses_move sesam_settransaction imagegif hw_connect pos mcrypt_get_cipher_name sqlite_field_name pow
+ contained imagecolordeallocate printer_write imagesetthickness msql_query stream_context_create tidy_error_count array_sum mcve_transparam mb_convert_case mysqli_data_seek ncurses_has_ic cosh ncurses_has_il mcve_transnew gmp_divexact ibase_fetch_row ircg_disconnect tidy_get_html_ver
+ contained sybase_affected_rows ming_setcubicthreshold mcrypt_module_self_test ibase_query fam_resume_monitor mcve_adduser fdf_set_target_frame fam_monitor_directory ldap_get_values mysql_thread_id printer_select_pen pg_close msession_plugin ibase_execute sqlite_udf_encode_binary
+ contained mysql_real_escape_string settype ini_get_all virtual muscat_close pg_field_name strspn mcve_returnstatus mb_convert_encoding cpdf_set_current_page ingres_autocommit nsapi_virtual printer_abort dbplus_next notes_drop_db pfpro_version log ocirollback array_pad pcntl_signal ftp_connect
+ contained ncurses_scr_set socket_shutdown mysqli_warning_count imageloadfont gmp_perfect_square sesam_num_fields mkdir mysqli_errno msg_send ifx_affected_rows fdf_open_string swf_labelframe cpdf_rlineto array_slice mysqli_insert_id debug_backtrace fbsql_connect msql_data_seek pdf_set_info_keywords
+ contained udm_free_res tidy_parse_string imagecharup mcal_event_set_alarm tidy_reset_config pg_connection_busy imap_delete crc32 socket_select ircg_msg ovrimos_result_all pdf_delete mb_eregi_replace socket_read mcve_settimeout ocilogoff fbsql_create_clob hw_document_setcontent stripos mcve_setip
+ contained pdf_get_fontname highlight_file xmlrpc_server_call_method mailparse_rfc822_parse_addresses date array_key_exists ocifetch mailparse_msg_extract_part pdf_begin_page msql_fetch_row imagegammacorrect stream_get_meta_data deg2rad ctype_lower mhash_get_hash_name swf_viewport tidy_get_output
+ contained ifx_create_char imagestring xslt_set_base stream_socket_client swftextfield domxml_xslt_stylesheet_file cpdf_set_text_rendering mysql_stat phpcredits iptcparse openssl_pkcs7_encrypt pdf_get_fontsize swf_actionsettarget ftp_alloc pdf_get_minorversion gzseek imageftbbox mysqli_stmt_error
+ contained fflush ncurses_mvwaddstr openssl_x509_export_to_file ldap_get_dn str_replace xslt_set_error_handler cpdf_set_horiz_scaling pg_result_error mcve_maxconntimeout pdf_open_pdi xptr_eval pcntl_wifstopped pg_unescape_bytea swf_lookat gettype fbsql_field_type shm_attach sesam_free_result popen
+ contained dbmopen dbplus_errcode mcve_returncode ocicolltrim gmdate gmmktime ovrimos_fetch_into ibase_num_params pg_last_notice imagesx imagesy base64_decode proc_nice mysqli_fetch_row mysqli_thread_safe notes_body apache_note ocicolumnsize printer_delete_dc pdf_set_info_author swf_oncondition
+ contained strrev imagecreatefromgd2part hw_edittext yaz_hits mcve_enableuser mysqli_get_proto_info socket_recv tmpfile ingres_fetch_row ftp_site ocifetchinto snmp_set_quick_print show_source sybase_data_seek dbplus_rquery ldap_get_attributes pdf_set_word_spacing ovrimos_cursor
+ contained mcrypt_list_algorithms user_error header dcgettext ora_error similar_text socket_writev cpdf_setgray_stroke dbplus_xlockrel dio_truncate mssql_field_seek strcmp fbsql_data_seek notes_copy_db dbplus_getlock array_search json_encode mb_detect_encoding odbc_procedures fscanf fdf_get_version
+ contained mailparse_msg_free hw_getsrcbydestobj msession_destroy array_unshift cpdf_end_text octdec imagealphablending ora_columnsize ldap_read fam_close openssl_open fbsql_stop_db mcal_list_alarms current mb_ereg_search_regs cpdf_text ovrimos_field_len gmp_mod imagecolortransparent socket_close
+ contained curl_multi_remove_handle dbase_add_record fbsql_fetch_row mcal_is_leap_year imagearc cpdf_add_outline hw_getandlock mysql_list_dbs mcal_day_of_year imageinterlace mailparse_msg_parse posix_getcwd realpath openssl_get_privatekey w32api_set_call_method swf_actionstop msession_setdata
+ contained pdf_begin_pattern dbplus_getunique sybase_query vpopmail_add_domain ora_columntype swf_actionwaitforframe ingres_num_fields hw_api_object mail main pdf_show sesam_disconnect ircg_channel_mode get_magic_quotes_gpc ircg_ignore_del fam_open mcrypt_enc_is_block_mode pg_field_size
+ contained hw_document_attributes ora_fetch imagetruecolortopalette ncurses_top_panel imap_utf7_decode get_object_vars ibase_set_event_handler cpdf_setmiterlimit ncurses_clrtobot mb_convert_kana pg_field_is_null mcrypt_enc_is_block_algorithm_mode mcrypt_cbc gmp_gcdext vpopmail_alias_get notes_search
+ contained readline_read_history ccvs_new dio_tcsetattr posix_getpid gmp_sqrtrm pg_lo_read msession_disconnect rawurldecode gmp_powm ldap_add strcspn openssl_public_encrypt fgetss ovrimos_result mb_parse_str mcal_close mssql_pconnect cpdf_setlinejoin msql_listdbs ora_columnname dgettext ngettext
+ contained fdf_set_encoding pdf_attach_file posix_strerror mailparse_uudecode_all proc_close xml_parser_free w32api_init_dtype ldap_t61_to_8859 ifx_free_blob ncurses_hide_panel ircg_ignore_add stream_select pdf_open_jpeg xml_parse mb_substr_count yp_next substr_count sqlite_fetch_single assert
+ contained mcve_setdropfile htmlentities jdtojulian ncurses_getmouse dbase_numfields ncurses_wmouse_trafo bzerror openssl_csr_export pdf_translate xml_set_processing_instruction_handler getimagesize sha1 strtr pg_lo_create ldap_next_attribute pspell_config_save_repl odbc_longreadlen ora_bind
+ contained ibase_blob_cancel sqlite_udf_decode_binary hw_getchildcollobj gmp_and sesam_commit sqlite_open pdf_setmatrix ncurses_napms mysql_db_name mcve_initusersetup snmpwalk aspell_check ccvs_void mcve_parsecommadelimited yp_order mcve_connect fbsql_next_result fdf_get_file ftok socket_recvfrom
+ contained mcrypt_module_is_block_algorithm_mode hw_connection_info vpopmail_add_domain_ex xml_set_unparsed_entity_decl_handler notes_version eregi_replace xmlrpc_decode pdf_setgray_fill ini_alter is_writable ncurses_savetty jdtounix hw_docbyanchorobj yaz_error is_resource pdf_add_annotation
+ contained dba_optimize odbc_binmode long2ip nsapi_response_headers socket_create ocisavelobfile fbsql_fetch_field ldap_get_values_len session_cache_limiter hw_pipedocument ftp_size dbplus_rcrtlike mysqli_bind_param mcal_week_of_year msql_regcase gzrewind strcasecmp xml_set_notation_decl_handler
+ contained ncurses_color_set define_syslog_variables ocicolumntype imagepsslantfont ccvs_reverse chmod move_uploaded_file cpdf_show_xy cpdf_fill curl_multi_init ircg_nick sqlite_num_fields natcasesort eregi ovrimos_execute mcrypt_enc_get_iv_size openssl_get_publickey syslog
+ contained xml_get_current_column_number imap_header aggregate_properties_by_list lzf_optimized_for mcrypt_generic_end ebcdic2ascii fam_monitor_collection dbase_delete_record mysqli_send_query msql_fieldflags mcve_verifysslcert imagepstext ncurses_raw tidy_save_config pspell_suggest is_string
+ contained pg_lo_read_all tidy_load_config socket_get_option ftp_put image2wbmp swf_openfile ncurses_slk_touch ncurses_mvdelch pg_select pdf_new odbc_next_result session_save_path ncurses_erasechar decbin decoct swf_definerect swf_getfontinfo imagecolorclosest ncurses_slk_init gmp_mul bcsub
+ links to Function
+phpMethods xxx contained target dump_node next_sibling setbackground add add setlinespacing multcolor content streammp3 identify addcolor drawcurveto title doctype notations previous_sibling xinclude append_child scale last_child set_attribute setover data create_cdata_section setmargins link setdown insertanchor
+ contained system_id is_xhtml getwidth getwidth getwidth setratio langdepvalue children children reason drawlineto setframes setframes process dstanchors owner_document child_nodes setcommitedversion has_children info drawline count count has_siblings setname setname get_attribute values
+ contained result_dump_mem rotateto rotateto tidy_node rotate getshape2 insert_before prev is_xml skewxto skewxto setleftfill document_element skewx skewy output is_asp replace ftstat setdimension is_html setspacing set_namespace next setup create_text_node setindentation user setaction value value
+ contained value insertcollection prefix dstofsrcanchors get_nodes get_elements_by_tagname get_elements_by_tagname attributes attributes create_comment get_content dump_file dcstat unlock key node_type description first_child lock move move get_attr create_attribute setheight setheight dbstat
+ contained drawcurve remove remove remove remove remove find insert insert copy set_name get_element_by_id checkin objectbyanchor moveto moveto moveto align setfont setfont setleftmargin setrightfill addstring addstring read mimetype addaction getshape1 addentry result_dump_file has_attribute
+ contained has_child_nodes skewyto skewyto save getheight create_processing_instruction addfill create_entity_reference type is_text name name remove_child setline parent_node object parents public_id is_blank_node setrightmargin srcanchors is_jste setbounds nextframe nextframe sethit set_content
+ contained create_element_ns movepen setcolor setcolor clone_node srcsofdst replace_node movepento create_element setdepth is_comment is_jsp unlink_node checkout append_sibling entities tagname remove_attribute setrate node_value attreditable scaleto scaleto add_namespace dump_mem internal_subset
+ contained replace_child has_attributes specified insertdocument assign node_name hwstat addshape get_attribute_node html_dump_mem userlist
+ links to Function
+phpConditional xxx contained switch switch elseif if enddeclare declare else endswitch endif
+ links to Conditional
+phpRepeat xxx contained as endfor do endforeach for endwhile while foreach
+ links to Repeat
+phpLabel xxx contained switch case default
+ links to Label
+phpStatement xxx contained goto return exit continue die break
+ links to Statement
+phpKeyword xxx contained const var
+ links to Statement
+phpType xxx contained inte int boole intege array string boolean float integ null double integer object bool real boolea
+ links to Type
+phpStructure xxx contained implements extends class list
+ trait
+ contained interface namespace self parent instanceof abstract
+ links to Structure
+phpOperator xxx match /[-=+%^&|*!.~?:]/ display contained
+ match #[-+*/%^&|.]=# display contained
+ match +/[^*/]+me=e-1 display contained
+ match /\$/ display contained
+ match /&&\|\<and\>/ display contained
+ match /||\|\<x\=or\>/ display contained
+ links to Operator
+phpRelation xxx match /[!=<>]=/ display contained
+ match /[<>]/ display contained
+ links to Operator
+phpMemberSelector xxx match /->/ display contained
+ links to Structure
+phpVarSelector xxx match /\$/ display contained
+ links to Operator
+phpIdentifier xxx match /$\h\w*/ display contained contains=phpEnvVar,phpIntVar,phpVarSelector
+ links to Identifier
+phpParent xxx match /[({[\]})]/ contained
+ links to Delimiter
+phpIdentifierSimply xxx match /${\h\w*}/ display contained contains=phpOperator,phpParent
+ links to Identifier
+phpIdentifierComplexP xxx matchgroup=phpParent start=/\[/ end=/]/ contained contains=@phpClInside
+ matchgroup=phpParent start=/\[/ end=/]/ contained contains=@phpClInside
+phpIdentifierComplex xxx matchgroup=phpParent start=/{\$/rs=e-1 end=/}/ contained extend contains=phpIdentifier,phpMemberSelector,phpVarSelector,phpIdentifierComplexP
+phpBrackets xxx match /[][}{]/ display contained
+ links to Delimiter
+phpInterpSimpleError xxx match /\[[^]]*\]/ display contained
+ match /->[^a-zA-Z_]/ display contained
+ links to Error
+phpInterpBogusDollarCurley xxx match /${[^}]*}/ display contained
+ match /${\h\w*->}/ display contained
+ match /${\h\w*\[]}/ display contained
+ links to Error
+phpinterpSimpleBracketsInner xxx match /\w\+/ contained
+ links to String
+phpInterpSimpleBrackets xxx match /\[\h\w*]/ contained contains=phpBrackets,phpinterpSimpleBracketsInner
+ match /\[\d\+]/ contained contains=phpBrackets,phpinterpSimpleBracketsInner
+ match /\[0[xX]\x\+]/ contained contains=phpBrackets,phpinterpSimpleBracketsInner
+phpInterpSimple xxx match /\$\h\w*\(\[[^]]*\]\|->\h\w*\)\?/ display contained contains=phpInterpSimpleBrackets,phpIdentifier,phpInterpSimpleError,phpMethods,phpMemberSelector
+phpInterpVarname xxx match /\h\w*/ contained
+ links to Identifier
+phpInterpMethodName xxx match /\h\w*/ contained
+phpInterpSimpleCurly xxx match /\${\h\w*}/ contained extend contains=phpInterpVarname
+ links to Delimiter
+phpInterpDollarCurley1Helper xxx matchgroup=phpParent start=/{/ end=/\[/ contained contains=phpInterpVarname
+phpInterpDollarCurly1 xxx matchgroup=phpParent start=/\${\h\w*\[/rs=s+1 end=/]}/ contained extend contains=phpInterpDollarCurley1Helper,@phpClConst
+ links to Error
+phpInterpDollarCurley2Helper xxx match /{\h\w*->/ contained contains=phpBrackets,phpInterpVarname,phpMemberSelector
+phpInterpDollarCurly2 xxx matchgroup=phpParent start=/\${\h\w*->/rs=s+1 end=/}/ contained contains=phpInterpDollarCurley2Helper,phpInterpMethodName
+ links to Error
+phpInterpComplex xxx matchgroup=phpParent start=/{\$/rs=e-1 end=/}/ contained extend contains=phpIdentifier,phpMemberSelector,phpVarSelector,phpIdentifierComplexP
+phpMethodsVar xxx match /->\h\w*/ display contained contains=phpMethods,phpMemberSelector
+phpInclude xxx contained use require require_once include include_once
+ links to Include
+phpDefine xxx contained function new clone print echo
+ links to Define
+phpBoolean xxx contained false true
+ links to Boolean
+phpNumber xxx match /-\=\<\d\+\>/ display contained
+ match /\<0x\x\{1,8}\>/ display contained
+ links to Number
+phpFloat xxx match /\(-\=\<\d+\|-\=\)\.\d\+\>/ display contained
+ links to Float
+phpBackslashSequences xxx match /\\[fnrtv\\\"$]/ display contained
+ match /\\\d\{1,3}/ display contained contains=phpOctalError
+ match /\\x\x\{1,2}/ display contained
+ links to SpecialChar
+phpOctalError xxx match /[89]/ display contained
+ links to Error
+phpBackslashDoubleQuote xxx match /\\[\"]/ display contained
+ links to SpecialChar
+phpBackslashSingleQuote xxx match /\\[\\']/ display contained
+ links to SpecialChar
+phpTodo xxx contained todo fixme xxx
+ links to Todo
+phpComment xxx start=+/\*+ end=+\*/+ contained extend contains=phpTodo
+ match /#.\{-}\(?>\|$\)\@=/ contained contains=phpTodo
+ match +//.\{-}\(?>\|$\)\@=+ contained contains=phpTodo
+ links to Comment
+phpStringDouble xxx matchgroup=None start=/"/ skip=/\\\\\|\\"/ end=/"/ contained keepend extend contains=@phpAddStrings,phpBackslashSequences,phpBackslashDoubleQuote,@phpInterpDouble
+ links to String
+phpBacktick xxx matchgroup=None start=/`/ skip=/\\\\\|\\"/ end=/`/ contained keepend extend contains=@phpAddStrings,phpIdentifier,phpBackslashSequences,phpIdentifierSimply,phpIdentifierComplex
+ links to String
+phpStringSingle xxx matchgroup=None start=/'/ skip=/\\\\\|\\'/ end=/'/ contained keepend extend contains=@phpAddStrings,phpBackslashSingleQuote
+ links to String
+phpHereDoc xxx matchgroup=Delimiter start=/\(<<<\)\@<=\(\"\=\)\z(\I\i*\)\2$/ end=/^\z1\(;\=$\)\@=/ contained keepend extend contains=phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar
+ matchgroup=Delimiter start=/\(<<<\)\@<=\(\"\=\)\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)\2$/ end=/^\z1\(;\=$\)\@=/ contained keepend extend contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar
+ matchgroup=Delimiter start=/\(<<<\)\@<=\(\"\=\)\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)\2$/ end=/^\z1\(;\=$\)\@=/ contained keepend extend contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar
+ matchgroup=Delimiter start=/\(<<<\)\@<=\(\"\=\)\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)\2$/ end=/^\z1\(;\=$\)\@=/ contained keepend extend contains=@htmlJavaScript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar
+phpNowDoc xxx matchgroup=Delimiter start=/\(<<<\)\@<='\z(\I\i*\)'$/ end=/^\z1\(;\=$\)\@=/ contained keepend extend
+ matchgroup=Delimiter start=/\(<<<\)\@<='\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)'$/ end=/^\z1\(;\=$\)\@=/ contained keepend extend contains=@htmlTop
+ matchgroup=Delimiter start=/\(<<<\)\@<='\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)'$/ end=/^\z1\(;\=$\)\@=/ contained keepend extend contains=@sqlTop
+ matchgroup=Delimiter start=/\(<<<\)\@<='\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)'$/ end=/^\z1\(;\=$\)\@=/ contained keepend extend contains=@htmlJavaScript
+phpException xxx contained catch try throw
+ links to Exception
+phpStorageClass xxx contained final static protected public private global
+ links to StorageClass
+phpSpecialFunction xxx containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle empty
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier __construct
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier __set
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier __tostring
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier __wakeup
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier __set_state
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier __isset
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier __clone
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier __call
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle unset
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle compact
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier __get
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier __destruct
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle extract
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier __unset
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle isset
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle trigger_error
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier __sleep
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle eval
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar __autoload
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle user_error
+ links to phpOperator
+phpClasses xxx containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar php_user_filter
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domprocessinginstruction
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar emptyiterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar simplexmlelement
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar errorexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar directoryiterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar reflectionextension
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domelement
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar recursivedirectoryiterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar reflectionparameter
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar unexpectedvalueexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domdomerror
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domimplementationsource
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar pdorow
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domnotation
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar invalidargumentexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar limititerator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar badmethodcallexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar spltempfileobject
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domcharacterdata
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domnamednodemap
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar arrayobject
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domstringextend
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar arrayiterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar reflectionexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar pdo
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domuserdatahandler
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar xmlreader
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domerrorhandler
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domcomment
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domnamespacenode
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domimplementation
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar reflectionmethod
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domconfiguration
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar recursivefilteriterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domentityreference
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar norewinditerator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar libxmlerror
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar underflowexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar reflectionfunction
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domtext
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar pdoexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar infiniteiterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar splfileobject
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar runtimeexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar cachingiterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar directory
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar badfunctioncallexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar reflectionclass
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar outofrangeexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domlocator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domdocumentfragment
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domentity
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domnodelist
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar recursiveiteratoriterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar pdostatement
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar overflowexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar reflectionobject
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar splfileinfo
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar simplexmliterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domxpath
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domcdatasection
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar __php_incomplete_class
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domainexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar exception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domnamelist
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar parentiterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar xmlwriter
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar appenditerator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domnode
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar rangeexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar logicexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar iteratoriterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar reflectionproperty
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domstringlist
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domtypeinfo
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar outofboundsexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domimplementationlist
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar splobjectstorage
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar recursivearrayiterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar lengthexception
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar stdclass
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar recursivecachingiterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar filteriterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar reflection
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domdocumenttype
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domattr
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar domdocument
+ links to phpFunctions
+phpInterfaces xxx containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar countable
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar iteratoraggregate
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar outeriterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar iterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar serializable
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar splobserver
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar arrayaccess
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar traversable
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar recursiveiterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar seekableiterator
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar reflector
+ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar splsubject
+ links to phpConstant
+phpAssignByRef xxx match /=\s*&/ containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle
+ links to Type
+phpComparison xxx contained containedin=phpRegion instanceof
+ match /\v[=!]\=\=?/ contained containedin=phpRegion
+ match /\v[=<>-]@<![<>]\=?[<>]@!/ contained containedin=phpRegion
+ links to Statement
+phpDocCustomTags xxx match /@[a-zA-Z]*\(\s\+\|\n\|\r\)/ containedin=phpComment
+ links to Type
+phpDocTags xxx start=/{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)/ end=/}/ containedin=phpComment
+ match /@\(abstract\|access\|author\|category\|copyright\|deprecated\|example\|final\|global\|ignore\|internal\|license\|link\|method\|name\|package\|param\|property\|return\|see\|since\|static\|staticvar\|subpackage\|tutorial\|uses\|var\|version\|contributor\|modified\|filename\|description\|filesource\|throws\)\(\s\+\)\?/ containedin=phpComment
+ links to PreProc
+phpDocTodo xxx match /@\(todo\|fixme\|xxx\)\(\s\+\)\?/ containedin=phpComment
+ links to Todo
+htmlPreproc cluster=phpRegion,phpRegionAsp,phpRegionSc
+htmlArgCluster cluster=NONE
+htmlTagNameCluster cluster=NONE
+Spell cluster=NONE
+htmlTop cluster=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
+htmlJavaScript cluster=trailingWhitespace,literalTab,javaScriptLineComment,javaScriptCommentSkip,javaScriptComment,javaScriptSpecial,javaScriptStringD,javaScriptStringS,javaScriptSpecialCharacter,javaScriptNumber,javaScriptRegexpString,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptOperator,javaScriptType,javaScriptStatement,javaScriptBoolean,javaScriptNull,javaScriptIdentifier,javaScriptLabel,javaScriptException,javaScriptMessage,javaScriptGlobal,javaScriptMember,javaScriptDeprecated,javaScriptReserved,javaScriptFunction,javaScriptBraces,javaScriptParens,@htmlPreproc
+htmlVbScript cluster=vbConditional,vbOperator,vbBoolean,vbConst,vbRepeat,vbEvents,vbFunction,vbMethods,vbStatement,vbKeyword,vbTypes,vbDefine,vbNumber,vbFloat,vbString,vbComment,vbLineNumber,vbTypeSpecifier
+htmlCss cluster=trailingWhitespace,literalTab,cssTagName,cssDeprecated,cssSelectorOp,cssSelectorOp2,cssUnicodeEscape,cssStringQ,cssStringQQ,cssAttributeSelector,cssClassName,cssIdentifier,cssComment,cssMediaBlock,cssInclude,cssDefinition,cssPseudoClass,cssPage,cssKeyFrame,cssFontDescriptor,cssFontProp,cssFontAttr,cssTextProp,cssBraceError,cssAttrComma,cssPseudoClassLang
+cssColors cluster=cssColor800000,cssColorff0000,cssColorffA500,cssColorffff00,cssColor808000,cssColor800080,cssColorff00ff,cssColorffffff,cssColor00ff00,cssColor008000,cssColor000080,cssColor0000ff,cssColor00ffff,cssColor008080,cssColor000000,cssColorc0c0c0,cssColor808080,cssColorF0F8FF,cssColorFAEBD7,cssColor7FFFD4,cssColorF0FFFF,cssColorF5F5DC,cssColorFFE4C4,cssColorFFEBCD,cssColor8A2BE2,cssColorA52A2A,cssColorDEB887,cssColor5F9EA0,cssColor7FFF00,cssColorD2691E,cssColorFF7F50,cssColor6495ED,cssColorFFF8DC,cssColorDC143C,cssColor00008B,cssColor008B8B,cssColorB8860B,cssColorA9A9A9,cssColor006400,cssColorBDB76B,cssColor8B008B,cssColor556B2F,cssColorFF8C00,cssColor9932CC,cssColor8B0000,cssColorE9967A,cssColor8FBC8F,cssColor483D8B,cssColor2F4F4F,cssColor00CED1,cssColor9400D3,cssColorFF1493,cssColor00BFFF,cssColor696969,cssColor1E90FF,cssColorB22222,cssColorFFFAF0,cssColor228B22,cssColorDCDCDC,cssColorF8F8FF,cssColorFFD700,cssColorDAA520,cssColorADFF2F,cssColorF0FFF0,cssColorFF69B4,cssColorCD5C5C,cssColor4B0082,cssColorFFFFF0,cssColorF0E68C,cssColorE6E6FA,cssColorFFF0F5,cssColor7CFC00,cssColorFFFACD,cssColorADD8E6,cssColorF08080,cssColorE0FFFF,cssColorFAFAD2,cssColorD3D3D3,cssColor90EE90,cssColorFFB6C1,cssColorFFA07A,cssColor20B2AA,cssColor87CEFA,cssColor778899,cssColorB0C4DE,cssColorFFFFE0,cssColor32CD32,cssColorFAF0E6,cssColor66CDAA,cssColor0000CD,cssColorBA55D3,cssColor9370D8,cssColor3CB371,cssColor7B68EE,cssColor00FA9A,cssColor48D1CC,cssColorC71585,cssColor191970,cssColorF5FFFA,cssColorFFE4E1,cssColorFFE4B5,cssColorFFDEAD,cssColorFDF5E6,cssColor6B8E23,cssColorFF4500,cssColorDA70D6,cssColorEEE8AA,cssColor98FB98,cssColorAFEEEE,cssColorD87093,cssColorFFEFD5,cssColorFFDAB9,cssColorCD853F,cssColorFFC0CB,cssColorDDA0DD,cssColorB0E0E6,cssColorBC8F8F,cssColor4169E1,cssColor8B4513,cssColorFA8072,cssColorF4A460,cssColor2E8B57,cssColorFFF5EE,cssColorA0522D,cssColor87CEEB,cssColor6A5ACD,cssColor708090,cssColorFFFAFA,cssColor00FF7F,cssColor4682B4,cssColorD2B48C,cssColorD8BFD8,cssColorFF6347,cssColor40E0D0,cssColorEE82EE,cssColorF5DEB3,cssColorF5F5F5,cssColor9ACD32
+htmlLess cluster=trailingWhitespace,literalTab,cssTagName,cssDeprecated,cssSelectorOp,cssSelectorOp2,cssUnicodeEscape,cssStringQ,cssStringQQ,cssAttributeSelector,cssClassName,cssIdentifier,cssComment,cssMediaBlock,cssInclude,cssDefinition,cssPseudoClass,cssPage,cssKeyFrame,cssFontDescriptor,cssFontProp,cssFontAttr,cssTextProp,cssBraceError,cssAttrComma,cssPseudoClassLang,lessDefinition,lessComment,lessVariable
+sqlTop cluster=sqlSpecial,sqlKeyword,sqlOperator,sqlStatement,sqlType,sqlNumber
+phpClInside cluster=@phpClConst,phpComment,phpLabel,phpParent,phpParentError,phpInclude,phpHereDoc,phpNowDoc
+phpClConst cluster=phpFunctions,phpIdentifier,phpConditional,phpRepeat,phpStatement,phpOperator,phpRelation,phpStringSingle,phpStringDouble,phpBacktick,phpNumber,phpFloat,phpKeyword,phpType,phpBoolean,phpStructure,phpMethodsVar,phpConstant,phpCoreConstant,phpException
+phpInterpDouble cluster=phpInterpSimple,phpInterpSimpleCurly,phpInterpDollarCurly1,phpInterpDollarCurly2,phpInterpBogusDollarCurley,phpInterpComplex
+phpAddStrings cluster=NONE
+phpClFunction cluster=@phpClInside,phpDefine,phpParentError,phpStorageClass
+phpClTop cluster=@phpClFunction,phpFoldFunction,phpFoldClass,phpFoldInterface,phpFoldTry,phpFoldCatch
diff --git a/vim/bundle/YouCompleteMe/python/ycm/tests/testdata/python_syntax b/vim/bundle/YouCompleteMe/python/ycm/tests/testdata/python_syntax
new file mode 100644
index 0000000..ec38776
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/tests/testdata/python_syntax
@@ -0,0 +1,63 @@
+--- Syntax items ---
+cCustomFunc xxx match /\w\+\s*\((\)\@=/
+ links to Function
+cCustomClass xxx match /\w\+\s*\(::\)\@=/
+ links to Function
+pythonStatement xxx return True lambda
+ nextgroup=pythonFunction skipwhite def
+ del
+ nextgroup=pythonFunction skipwhite class
+ global nonlocal as None, False, yield with print continue break pass assert exec
+ links to Statement
+pythonFunction xxx match /\%(\%(def\s\|class\s\|@\)\s*\)\@<=\h\%(\w\|\.\)*/ contained
+ links to Function
+pythonConditional xxx if else elif
+ links to Conditional
+pythonRepeat xxx for while
+ links to Repeat
+pythonOperator xxx or is and in not
+ links to Operator
+pythonException xxx finally raise except try
+ links to Exception
+pythonInclude xxx from import
+ links to Include
+pythonDecorator xxx match /@/ display nextgroup=pythonFunction skipwhite
+ links to Define
+pythonTodo xxx contained NOTE XXX TODO NOTES FIXME
+ links to Todo
+pythonComment xxx match /#.*$/ contains=pythonTodo,@Spell
+ links to Comment
+pythonEscape xxx match /\\[abfnrtv'"\\]/ contained
+ match /\\\o\{1,3}/ contained
+ match /\\x\x\{2}/ contained
+ match /\%(\\u\x\{4}\|\\U\x\{8}\)/ contained
+ match /\\N{\a\+\%(\s\a\+\)*}/ contained
+ match /\\$/
+ links to Special
+pythonString xxx start=/[uU]\=\z(['"]\)/ skip=/\\\\\|\\\z1/ end=/\z1/ contains=pythonEscape,@Spell
+ start=/[uU]\=\z('''\|"""\)/ end=/\z1/ keepend contains=pythonEscape,pythonSpaceError,pythonDoctest,@Spell
+ links to String
+pythonDoctest xxx start=/^\s*>>>\s/ end=/^\s*$/ contained contains=ALLBUT,pythonDoctest,@Spell
+ links to Special
+pythonRawString xxx start=/[uU]\=[rR]\z(['"]\)/ skip=/\\\\\|\\\z1/ end=/\z1/ contains=@Spell
+ start=/[uU]\=[rR]\z('''\|"""\)/ end=/\z1/ keepend contains=pythonSpaceError,pythonDoctest,@Spell
+ links to String
+pythonNumber xxx match /\<0[oO]\=\o\+[Ll]\=\>/
+ match /\<0[xX]\x\+[Ll]\=\>/
+ match /\<0[bB][01]\+[Ll]\=\>/
+ match /\<\%([1-9]\d*\|0\)[Ll]\=\>/
+ match /\<\d\+[jJ]\>/
+ match /\<\d\+[eE][+-]\=\d\+[jJ]\=\>/
+ match /\<\d\+\.\%([eE][+-]\=\d\+\)\=[jJ]\=\%(\W\|$\)\@=/
+ match /\%(^\|\W\)\@<=\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>/
+ links to Number
+pythonBuiltin xxx list locals all classmethod None abs cmp reduce ord hex object memoryview enumerate __debug__ compile str False True issubclass input hasattr frozenset slice callable sum filter range any long execfile min type sorted reload super complex xrange file ascii setattr unicode staticmethod basestring unichr float iter map globals max isinstance dict chr reversed buffer delattr __import__ oct dir eval raw_input hash getattr tuple id bin vars apply bytes repr pow print zip open NotImplemented intern round format bool help property coerce Ellipsis len int next exec set bytearray divmod
+ links to Function
+pythonExceptions xxx OSError EnvironmentError UserWarning NameError ArithmeticError NotImplementedError ReferenceError BaseException LookupError ImportWarning OverflowError SystemExit IndentationError GeneratorExit Warning RuntimeError MemoryError WindowsError AssertionError UnicodeWarning KeyError TypeError TabError ImportError SyntaxWarning SyntaxError UnboundLocalError KeyboardInterrupt UnicodeDecodeError IOError Exception FutureWarning AttributeError UnicodeTranslateError VMSError EOFError FloatingPointError ValueError IndexError RuntimeWarning DeprecationWarning PendingDeprecationWarning UnicodeEncodeError StopIteration UnicodeError BytesWarning StandardError SystemError ZeroDivisionError BufferError
+ links to Structure
+pythonDoctestValue xxx start=/^\s*\%(>>>\s\|\.\.\.\s\|"""\|'''\)\@!\S\+/ end=/$/ contained
+ links to Define
+OperatorChars xxx match #?\|+\|-\|\*\|;\|:\|,\|<\|>\|&\||\|!\|\~\|%\|=\|)\|(\|{\|}\|\.\|\[\|\]\|/\(/\|*\)\@!#
+Spell cluster=NONE
+NoSpell cluster=NONE
+
diff --git a/vim/bundle/YouCompleteMe/python/ycm/tests/vimsupport_test.py b/vim/bundle/YouCompleteMe/python/ycm/tests/vimsupport_test.py
new file mode 100644
index 0000000..6840235
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/tests/vimsupport_test.py
@@ -0,0 +1,1434 @@
+# coding: utf-8
+#
+# Copyright (C) 2015 YouCompleteMe contributors
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from ycm.test_utils import ExtendedMock, MockVimModule, MockVimCommand
+MockVimModule()
+
+from ycm import vimsupport
+from nose.tools import eq_
+from hamcrest import assert_that, calling, raises, none, has_entry
+from mock import MagicMock, call, patch
+from ycmd.utils import ToBytes, ToUnicode
+import os
+import json
+
+
+def ReplaceChunk_SingleLine_Repl_1_test():
+ # Replace with longer range
+ result_buffer = [ ToBytes( "This is a string" ) ]
+ start, end = _BuildLocations( 1, 1, 1, 5 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'How long',
+ 0,
+ 0,
+ result_buffer )
+
+ eq_( [ ToBytes( "How long is a string" ) ], result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, 4 )
+
+ # and replace again, using delta
+ start, end = _BuildLocations( 1, 10, 1, 11 )
+ ( new_line_offset, new_char_offset ) = vimsupport.ReplaceChunk(
+ start,
+ end,
+ ' piece of ',
+ line_offset,
+ char_offset,
+ result_buffer )
+
+ line_offset += new_line_offset
+ char_offset += new_char_offset
+
+ eq_( [ ToBytes( 'How long is a piece of string' ) ], result_buffer )
+ eq_( new_line_offset, 0 )
+ eq_( new_char_offset, 9 )
+ eq_( line_offset, 0 )
+ eq_( char_offset, 13 )
+
+ # and once more, for luck
+ start, end = _BuildLocations( 1, 11, 1, 17 )
+
+ ( new_line_offset, new_char_offset ) = vimsupport.ReplaceChunk(
+ start,
+ end,
+ 'pie',
+ line_offset,
+ char_offset,
+ result_buffer )
+
+ line_offset += new_line_offset
+ char_offset += new_char_offset
+
+ eq_( [ ToBytes( 'How long is a piece of pie' ) ], result_buffer )
+ eq_( new_line_offset, 0 )
+ eq_( new_char_offset, -3 )
+ eq_( line_offset, 0 )
+ eq_( char_offset, 10 )
+
+
+def ReplaceChunk_SingleLine_Repl_2_test():
+ # Replace with shorter range
+ result_buffer = [ ToBytes( "This is a string" ) ]
+ start, end = _BuildLocations( 1, 11, 1, 17 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'test',
+ 0,
+ 0,
+ result_buffer )
+
+ eq_( [ ToBytes( "This is a test" ) ], result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, -2 )
+
+
+def ReplaceChunk_SingleLine_Repl_3_test():
+ # Replace with equal range
+ result_buffer = [ ToBytes( "This is a string" ) ]
+ start, end = _BuildLocations( 1, 6, 1, 8 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'be',
+ 0,
+ 0,
+ result_buffer )
+
+ eq_( [ ToBytes( "This be a string" ) ], result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, 0 )
+
+
+def ReplaceChunk_SingleLine_Add_1_test():
+ # Insert at start
+ result_buffer = [ ToBytes( "is a string" ) ]
+ start, end = _BuildLocations( 1, 1, 1, 1 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'This ',
+ 0,
+ 0,
+ result_buffer )
+
+ eq_( [ ToBytes( "This is a string" ) ], result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, 5 )
+
+
+def ReplaceChunk_SingleLine_Add_2_test():
+ # Insert at end
+ result_buffer = [ ToBytes( "This is a " ) ]
+ start, end = _BuildLocations( 1, 11, 1, 11 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'string',
+ 0,
+ 0,
+ result_buffer )
+
+ eq_( [ ToBytes( "This is a string" ) ], result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, 6 )
+
+
+def ReplaceChunk_SingleLine_Add_3_test():
+ # Insert in the middle
+ result_buffer = [ ToBytes( "This is a string" ) ]
+ start, end = _BuildLocations( 1, 8, 1, 8 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ ' not',
+ 0,
+ 0,
+ result_buffer )
+
+ eq_( [ ToBytes( "This is not a string" ) ], result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, 4 )
+
+
+def ReplaceChunk_SingleLine_Del_1_test():
+ # Delete from start
+ result_buffer = [ ToBytes( "This is a string" ) ]
+ start, end = _BuildLocations( 1, 1, 1, 6 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ '',
+ 0,
+ 0,
+ result_buffer )
+
+ eq_( [ ToBytes( "is a string" ) ], result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, -5 )
+
+
+def ReplaceChunk_SingleLine_Del_2_test():
+ # Delete from end
+ result_buffer = [ ToBytes( "This is a string" ) ]
+ start, end = _BuildLocations( 1, 10, 1, 18 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ '',
+ 0,
+ 0,
+ result_buffer )
+
+ eq_( [ ToBytes( "This is a" ) ], result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, -8 )
+
+
+def ReplaceChunk_SingleLine_Del_3_test():
+ # Delete from middle
+ result_buffer = [ ToBytes( "This is not a string" ) ]
+ start, end = _BuildLocations( 1, 9, 1, 13 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ '',
+ 0,
+ 0,
+ result_buffer )
+
+ eq_( [ ToBytes( "This is a string" ) ], result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, -4 )
+
+
+def ReplaceChunk_SingleLine_Unicode_ReplaceUnicodeChars_test():
+ # Replace Unicode characters.
+ result_buffer = [ ToBytes( "This Uniçø∂‰ string is in the middle" ) ]
+ start, end = _BuildLocations( 1, 6, 1, 20 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'Unicode ',
+ 0,
+ 0,
+ result_buffer )
+
+ eq_( [ ToBytes( "This Unicode string is in the middle" ) ], result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, -6 )
+
+
+def ReplaceChunk_SingleLine_Unicode_ReplaceAfterUnicode_test():
+ # Replace ASCII characters after Unicode characters in the line.
+ result_buffer = [ ToBytes( "This Uniçø∂‰ string is in the middle" ) ]
+ start, end = _BuildLocations( 1, 30, 1, 43 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'fåke',
+ 0,
+ 0,
+ result_buffer )
+
+ eq_( [ ToBytes( "This Uniçø∂‰ string is fåke" ) ], result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, -8 )
+
+
+def ReplaceChunk_SingleLine_Unicode_Grown_test():
+ # Replace ASCII characters after Unicode characters in the line.
+ result_buffer = [ ToBytes( "a" ) ]
+ start, end = _BuildLocations( 1, 1, 1, 2 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'å',
+ 0,
+ 0,
+ result_buffer )
+
+ eq_( [ ToBytes( "å" ) ], result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, 1 ) # Note: byte difference (a = 1 byte, å = 2 bytes)
+
+
+def ReplaceChunk_RemoveSingleLine_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 2, 1, 3, 1 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start, end, '',
+ 0, 0, result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aCa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, -1 )
+ eq_( char_offset, 0 )
+
+
+def ReplaceChunk_SingleToMultipleLines_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 2, 2, 2, 2 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start, end, 'Eb\nbF',
+ 0, 0, result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aEb" ),
+ ToBytes( "bFBa" ),
+ ToBytes( "aCa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 1 )
+ eq_( char_offset, 1 )
+
+ # now make another change to the "2nd" line
+ start, end = _BuildLocations( 2, 3, 2, 4 )
+ ( new_line_offset, new_char_offset ) = vimsupport.ReplaceChunk(
+ start,
+ end,
+ 'cccc',
+ line_offset,
+ char_offset,
+ result_buffer )
+
+ line_offset += new_line_offset
+ char_offset += new_char_offset
+
+ eq_( [ ToBytes( "aAa" ),
+ ToBytes( "aEb" ),
+ ToBytes( "bFBcccc" ),
+ ToBytes( "aCa" ) ], result_buffer )
+ eq_( line_offset, 1 )
+ eq_( char_offset, 4 )
+
+
+def ReplaceChunk_SingleToMultipleLines2_test():
+ result_buffer = [ ToBytes( "aAa" ), ToBytes( "aBa" ), ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 2, 2, 2, 2 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'Eb\nbFb\nG',
+ 0,
+ 0,
+ result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aEb" ),
+ ToBytes( "bFb" ),
+ ToBytes( "GBa" ),
+ ToBytes( "aCa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 2 )
+ eq_( char_offset, 0 )
+
+
+def ReplaceChunk_SingleToMultipleLines3_test():
+ result_buffer = [ ToBytes( "aAa" ), ToBytes( "aBa" ), ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 2, 2, 2, 2 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'Eb\nbFb\nbGb',
+ 0,
+ 0,
+ result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aEb" ),
+ ToBytes( "bFb" ),
+ ToBytes( "bGbBa" ),
+ ToBytes( "aCa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 2 )
+ eq_( char_offset, 2 )
+
+
+def ReplaceChunk_SingleToMultipleLinesReplace_test():
+ result_buffer = [ ToBytes( "aAa" ), ToBytes( "aBa" ), ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 1, 2, 1, 4 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'Eb\nbFb\nbGb',
+ 0,
+ 0,
+ result_buffer )
+ expected_buffer = [ ToBytes( "aEb" ),
+ ToBytes( "bFb" ),
+ ToBytes( "bGb" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 2 )
+ eq_( char_offset, 0 )
+
+
+def ReplaceChunk_SingleToMultipleLinesReplace_2_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 1, 2, 1, 4 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'Eb\nbFb\nbGb',
+ 0,
+ 0,
+ result_buffer )
+ expected_buffer = [ ToBytes( "aEb" ),
+ ToBytes( "bFb" ),
+ ToBytes( "bGb" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 2 )
+ eq_( char_offset, 0 )
+
+ # now do a subsequent change (insert at end of line "1")
+ start, end = _BuildLocations( 1, 4, 1, 4 )
+ ( new_line_offset, new_char_offset ) = vimsupport.ReplaceChunk(
+ start,
+ end,
+ 'cccc',
+ line_offset,
+ char_offset,
+ result_buffer )
+
+ line_offset += new_line_offset
+ char_offset += new_char_offset
+
+ eq_( [ ToBytes( "aEb" ),
+ ToBytes( "bFb" ),
+ ToBytes( "bGbcccc" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ], result_buffer )
+
+ eq_( line_offset, 2 )
+ eq_( char_offset, 4 )
+
+
+def ReplaceChunk_MultipleLinesToSingleLine_test():
+ result_buffer = [ ToBytes( "aAa" ), ToBytes( "aBa" ), ToBytes( "aCaaaa" ) ]
+ start, end = _BuildLocations( 2, 2, 3, 2 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start, end, 'E',
+ 0, 0, result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ), ToBytes( "aECaaaa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, -1 )
+ eq_( char_offset, 1 )
+
+ # make another modification applying offsets
+ start, end = _BuildLocations( 3, 3, 3, 4 )
+ ( new_line_offset, new_char_offset ) = vimsupport.ReplaceChunk(
+ start,
+ end,
+ 'cccc',
+ line_offset,
+ char_offset,
+ result_buffer )
+
+ line_offset += new_line_offset
+ char_offset += new_char_offset
+
+ eq_( [ ToBytes( "aAa" ),
+ ToBytes( "aECccccaaa" ) ], result_buffer )
+ eq_( line_offset, -1 )
+ eq_( char_offset, 4 )
+
+ # and another, for luck
+ start, end = _BuildLocations( 3, 4, 3, 5 )
+ ( new_line_offset, new_char_offset ) = vimsupport.ReplaceChunk(
+ start,
+ end,
+ 'dd\ndd',
+ line_offset,
+ char_offset,
+ result_buffer )
+
+ line_offset += new_line_offset
+ char_offset += new_char_offset
+
+ eq_( [ ToBytes( "aAa" ),
+ ToBytes( "aECccccdd" ),
+ ToBytes( "ddaa" ) ],
+ result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, -2 )
+
+
+def ReplaceChunk_MultipleLinesToSameMultipleLines_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ),
+ ToBytes( "aDe" ) ]
+ start, end = _BuildLocations( 2, 2, 3, 2 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start, end, 'Eb\nbF',
+ 0, 0, result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aEb" ),
+ ToBytes( "bFCa" ),
+ ToBytes( "aDe" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, 1 )
+
+
+def ReplaceChunk_MultipleLinesToMoreMultipleLines_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ),
+ ToBytes( "aDe" ) ]
+ start, end = _BuildLocations( 2, 2, 3, 2 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'Eb\nbFb\nbG',
+ 0,
+ 0,
+ result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aEb" ),
+ ToBytes( "bFb" ),
+ ToBytes( "bGCa" ),
+ ToBytes( "aDe" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 1 )
+ eq_( char_offset, 1 )
+
+
+def ReplaceChunk_MultipleLinesToLessMultipleLines_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ),
+ ToBytes( "aDe" ) ]
+ start, end = _BuildLocations( 1, 2, 3, 2 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start, end, 'Eb\nbF',
+ 0, 0, result_buffer )
+ expected_buffer = [ ToBytes( "aEb" ), ToBytes( "bFCa" ), ToBytes( "aDe" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, -1 )
+ eq_( char_offset, 1 )
+
+
+def ReplaceChunk_MultipleLinesToEvenLessMultipleLines_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ),
+ ToBytes( "aDe" ) ]
+ start, end = _BuildLocations( 1, 2, 4, 2 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start, end, 'Eb\nbF',
+ 0, 0, result_buffer )
+ expected_buffer = [ ToBytes( "aEb" ), ToBytes( "bFDe" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, -2 )
+ eq_( char_offset, 1 )
+
+
+def ReplaceChunk_SpanBufferEdge_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 1, 1, 1, 3 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start, end, 'bDb',
+ 0, 0, result_buffer )
+ expected_buffer = [ ToBytes( "bDba" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, 1 )
+
+
+def ReplaceChunk_DeleteTextInLine_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 2, 2, 2, 3 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start, end, '',
+ 0, 0, result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aa" ),
+ ToBytes( "aCa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, -1 )
+
+
+def ReplaceChunk_AddTextInLine_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 2, 2, 2, 2 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start, end, 'bDb',
+ 0, 0, result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "abDbBa" ),
+ ToBytes( "aCa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, 3 )
+
+
+def ReplaceChunk_ReplaceTextInLine_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 2, 2, 2, 3 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start, end, 'bDb',
+ 0, 0, result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "abDba" ),
+ ToBytes( "aCa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, 2 )
+
+
+def ReplaceChunk_SingleLineOffsetWorks_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 1, 1, 1, 2 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start, end, 'bDb',
+ 1, 1, result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "abDba" ),
+ ToBytes( "aCa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 0 )
+ eq_( char_offset, 2 )
+
+
+def ReplaceChunk_SingleLineToMultipleLinesOffsetWorks_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 1, 1, 1, 2 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start, end, 'Db\nE',
+ 1, 1, result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aDb" ),
+ ToBytes( "Ea" ),
+ ToBytes( "aCa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 1 )
+ eq_( char_offset, -1 )
+
+
+def ReplaceChunk_MultipleLinesToSingleLineOffsetWorks_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 1, 1, 2, 2 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start, end, 'bDb',
+ 1, 1, result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "abDbCa" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, -1 )
+ eq_( char_offset, 3 )
+
+
+def ReplaceChunk_MultipleLineOffsetWorks_test():
+ result_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "aBa" ),
+ ToBytes( "aCa" ) ]
+ start, end = _BuildLocations( 3, 1, 4, 3 )
+ ( line_offset, char_offset ) = vimsupport.ReplaceChunk( start,
+ end,
+ 'bDb\nbEb\nbFb',
+ -1,
+ 1,
+ result_buffer )
+ expected_buffer = [ ToBytes( "aAa" ),
+ ToBytes( "abDb" ),
+ ToBytes( "bEb" ),
+ ToBytes( "bFba" ) ]
+ eq_( expected_buffer, result_buffer )
+ eq_( line_offset, 1 )
+ eq_( char_offset, 1 )
+
+
+def _BuildLocations( start_line, start_column, end_line, end_column ):
+ return {
+ 'line_num' : start_line,
+ 'column_num': start_column,
+ }, {
+ 'line_num' : end_line,
+ 'column_num': end_column,
+ }
+
+
+def ReplaceChunksInBuffer_SortedChunks_test():
+ chunks = [
+ _BuildChunk( 1, 4, 1, 4, '('),
+ _BuildChunk( 1, 11, 1, 11, ')' )
+ ]
+
+ result_buffer = [ ToBytes( "CT<10 >> 2> ct" ) ]
+ vimsupport.ReplaceChunksInBuffer( chunks, result_buffer, None )
+
+ expected_buffer = [ ToBytes( "CT<(10 >> 2)> ct" ) ]
+ eq_( expected_buffer, result_buffer )
+
+
+def ReplaceChunksInBuffer_UnsortedChunks_test():
+ chunks = [
+ _BuildChunk( 1, 11, 1, 11, ')'),
+ _BuildChunk( 1, 4, 1, 4, '(' )
+ ]
+
+ result_buffer = [ ToBytes( "CT<10 >> 2> ct" ) ]
+ vimsupport.ReplaceChunksInBuffer( chunks, result_buffer, None )
+
+ expected_buffer = [ ToBytes( "CT<(10 >> 2)> ct" ) ]
+ eq_( expected_buffer, result_buffer )
+
+
+class MockBuffer( object ):
+ """An object that looks like a vim.buffer object, enough for ReplaceChunk to
+ generate a location list"""
+
+ def __init__( self, lines, name, number ):
+ self.lines = [ ToBytes( x ) for x in lines ]
+ self.name = name
+ self.number = number
+
+
+ def __getitem__( self, index ):
+ """ Return the bytes for a given line at index |index| """
+ return self.lines[ index ]
+
+
+ def __len__( self ):
+ return len( self.lines )
+
+
+ def __setitem__( self, key, value ):
+ return self.lines.__setitem__( key, value )
+
+
+ def GetLines( self ):
+ """ Return the contents of the buffer as a list of unicode strings"""
+ return [ ToUnicode( x ) for x in self.lines ]
+
+
+@patch( 'ycm.vimsupport.VariableExists', return_value = False )
+@patch( 'ycm.vimsupport.SetFittingHeightForCurrentWindow' )
+@patch( 'ycm.vimsupport.GetBufferNumberForFilename',
+ return_value=1,
+ new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.BufferIsVisible',
+ return_value=True,
+ new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.OpenFilename' )
+@patch( 'ycm.vimsupport.EchoTextVimWidth', new_callable=ExtendedMock )
+@patch( 'vim.eval', new_callable=ExtendedMock )
+@patch( 'vim.command', new_callable=ExtendedMock )
+def ReplaceChunks_SingleFile_Open_test( vim_command,
+ vim_eval,
+ echo_text_vim_width,
+ open_filename,
+ buffer_is_visible,
+ get_buffer_number_for_filename,
+ set_fitting_height,
+ variable_exists ):
+
+ chunks = [
+ _BuildChunk( 1, 1, 2, 1, 'replacement', 'single_file' )
+ ]
+
+ result_buffer = MockBuffer( [
+ 'line1',
+ 'line2',
+ 'line3',
+ ], 'single_file', 1 )
+
+ with patch( 'vim.buffers', [ None, result_buffer, None ] ):
+ vimsupport.ReplaceChunks( chunks )
+
+ # Ensure that we applied the replacement correctly
+ eq_( result_buffer.GetLines(), [
+ 'replacementline2',
+ 'line3',
+ ] )
+
+ # GetBufferNumberForFilename is called twice:
+ # - once to the check if we would require opening the file (so that we can
+ # raise a warning)
+ # - once whilst applying the changes
+ get_buffer_number_for_filename.assert_has_exact_calls( [
+ call( 'single_file', False ),
+ call( 'single_file', False ),
+ ] )
+
+ # BufferIsVisible is called twice for the same reasons as above
+ buffer_is_visible.assert_has_exact_calls( [
+ call( 1 ),
+ call( 1 ),
+ ] )
+
+ # we don't attempt to open any files
+ open_filename.assert_not_called()
+
+ # But we do set the quickfix list
+ vim_eval.assert_has_exact_calls( [
+ call( 'setqflist( {0} )'.format( json.dumps( [ {
+ 'bufnr': 1,
+ 'filename': 'single_file',
+ 'lnum': 1,
+ 'col': 1,
+ 'text': 'replacement',
+ 'type': 'F'
+ } ] ) ) ),
+ ] )
+ vim_command.assert_has_exact_calls( [
+ call( 'botright copen' ),
+ call( 'silent! wincmd p' )
+ ] )
+ set_fitting_height.assert_called_once_with()
+
+ # And it is ReplaceChunks that prints the message showing the number of
+ # changes
+ echo_text_vim_width.assert_has_exact_calls( [
+ call( 'Applied 1 changes' ),
+ ] )
+
+
+@patch( 'ycm.vimsupport.VariableExists', return_value = False )
+@patch( 'ycm.vimsupport.SetFittingHeightForCurrentWindow' )
+@patch( 'ycm.vimsupport.GetBufferNumberForFilename',
+ side_effect=[ -1, -1, 1 ],
+ new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.BufferIsVisible',
+ side_effect=[ False, False, True ],
+ new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.OpenFilename',
+ new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.EchoTextVimWidth', new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.Confirm',
+ return_value=True,
+ new_callable=ExtendedMock )
+@patch( 'vim.eval', return_value=10, new_callable=ExtendedMock )
+@patch( 'vim.command', new_callable=ExtendedMock )
+def ReplaceChunks_SingleFile_NotOpen_test( vim_command,
+ vim_eval,
+ confirm,
+ echo_text_vim_width,
+ open_filename,
+ buffer_is_visible,
+ get_buffer_number_for_filename,
+ set_fitting_height,
+ variable_exists ):
+
+ chunks = [
+ _BuildChunk( 1, 1, 2, 1, 'replacement', 'single_file' )
+ ]
+
+ result_buffer = MockBuffer( [
+ 'line1',
+ 'line2',
+ 'line3',
+ ], 'single_file', 1 )
+
+ with patch( 'vim.buffers', [ None, result_buffer, None ] ):
+ vimsupport.ReplaceChunks( chunks )
+
+ # We checked if it was OK to open the file
+ confirm.assert_has_exact_calls( [
+ call( vimsupport.FIXIT_OPENING_BUFFERS_MESSAGE_FORMAT.format( 1 ) )
+ ] )
+
+ # Ensure that we applied the replacement correctly
+ eq_( result_buffer.GetLines(), [
+ 'replacementline2',
+ 'line3',
+ ] )
+
+ # GetBufferNumberForFilename is called 3 times. The return values are set in
+ # the @patch call above:
+ # - once to the check if we would require opening the file (so that we can
+ # raise a warning) (-1 return)
+ # - once whilst applying the changes (-1 return)
+ # - finally after calling OpenFilename (1 return)
+ get_buffer_number_for_filename.assert_has_exact_calls( [
+ call( 'single_file', False ),
+ call( 'single_file', False ),
+ call( 'single_file', False ),
+ ] )
+
+ # BufferIsVisible is called 3 times for the same reasons as above, with the
+ # return of each one
+ buffer_is_visible.assert_has_exact_calls( [
+ call( -1 ),
+ call( -1 ),
+ call( 1 ),
+ ] )
+
+ # We open 'single_file' as expected.
+ open_filename.assert_called_with( 'single_file', {
+ 'focus': True,
+ 'fix': True,
+ 'size': 10
+ } )
+
+ # And close it again, then show the quickfix window.
+ vim_command.assert_has_exact_calls( [
+ call( 'lclose' ),
+ call( 'hide' ),
+ call( 'botright copen' ),
+ call( 'silent! wincmd p' )
+ ] )
+ set_fitting_height.assert_called_once_with()
+
+ # And update the quickfix list
+ vim_eval.assert_has_exact_calls( [
+ call( '&previewheight' ),
+ call( 'setqflist( {0} )'.format( json.dumps( [ {
+ 'bufnr': 1,
+ 'filename': 'single_file',
+ 'lnum': 1,
+ 'col': 1,
+ 'text': 'replacement',
+ 'type': 'F'
+ } ] ) ) ),
+ ] )
+
+ # And it is ReplaceChunks that prints the message showing the number of
+ # changes
+ echo_text_vim_width.assert_has_exact_calls( [
+ call( 'Applied 1 changes' ),
+ ] )
+
+
+@patch( 'ycm.vimsupport.GetBufferNumberForFilename',
+ side_effect=[ -1, -1, 1 ],
+ new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.BufferIsVisible',
+ side_effect=[ False, False, True ],
+ new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.OpenFilename',
+ new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.EchoTextVimWidth',
+ new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.Confirm',
+ return_value=False,
+ new_callable=ExtendedMock )
+@patch( 'vim.eval',
+ return_value=10,
+ new_callable=ExtendedMock )
+@patch( 'vim.command', new_callable=ExtendedMock )
+def ReplaceChunks_User_Declines_To_Open_File_test(
+ vim_command,
+ vim_eval,
+ confirm,
+ echo_text_vim_width,
+ open_filename,
+ buffer_is_visible,
+ get_buffer_number_for_filename ):
+
+ # Same as above, except the user selects Cancel when asked if they should
+ # allow us to open lots of (ahem, 1) file.
+
+ chunks = [
+ _BuildChunk( 1, 1, 2, 1, 'replacement', 'single_file' )
+ ]
+
+ result_buffer = MockBuffer( [
+ 'line1',
+ 'line2',
+ 'line3',
+ ], 'single_file', 1 )
+
+ with patch( 'vim.buffers', [ None, result_buffer, None ] ):
+ vimsupport.ReplaceChunks( chunks )
+
+ # We checked if it was OK to open the file
+ confirm.assert_has_exact_calls( [
+ call( vimsupport.FIXIT_OPENING_BUFFERS_MESSAGE_FORMAT.format( 1 ) )
+ ] )
+
+ # Ensure that buffer is not changed
+ eq_( result_buffer.GetLines(), [
+ 'line1',
+ 'line2',
+ 'line3',
+ ] )
+
+ # GetBufferNumberForFilename is called once. The return values are set in
+ # the @patch call above:
+ # - once to the check if we would require opening the file (so that we can
+ # raise a warning) (-1 return)
+ get_buffer_number_for_filename.assert_has_exact_calls( [
+ call( 'single_file', False ),
+ ] )
+
+ # BufferIsVisible is called once for the above file, which wasn't visible.
+ buffer_is_visible.assert_has_exact_calls( [
+ call( -1 ),
+ ] )
+
+ # We don't attempt to open any files or update any quickfix list or anything
+ # like that
+ open_filename.assert_not_called()
+ vim_eval.assert_not_called()
+ vim_command.assert_not_called()
+ echo_text_vim_width.assert_not_called()
+
+
+@patch( 'ycm.vimsupport.GetBufferNumberForFilename',
+ side_effect=[ -1, -1, 1 ],
+ new_callable=ExtendedMock )
+# Key difference is here: In the final check, BufferIsVisible returns False
+@patch( 'ycm.vimsupport.BufferIsVisible',
+ side_effect=[ False, False, False ],
+ new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.OpenFilename',
+ new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.EchoTextVimWidth',
+ new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.Confirm',
+ return_value=True,
+ new_callable=ExtendedMock )
+@patch( 'vim.eval',
+ return_value=10,
+ new_callable=ExtendedMock )
+@patch( 'vim.command',
+ new_callable=ExtendedMock )
+def ReplaceChunks_User_Aborts_Opening_File_test(
+ vim_command,
+ vim_eval,
+ confirm,
+ echo_text_vim_width,
+ open_filename,
+ buffer_is_visible,
+ get_buffer_number_for_filename ):
+
+ # Same as above, except the user selects Abort or Quick during the
+ # "swap-file-found" dialog
+
+ chunks = [
+ _BuildChunk( 1, 1, 2, 1, 'replacement', 'single_file' )
+ ]
+
+ result_buffer = MockBuffer( [
+ 'line1',
+ 'line2',
+ 'line3',
+ ], 'single_file', 1 )
+
+ with patch( 'vim.buffers', [ None, result_buffer, None ] ):
+ assert_that( calling( vimsupport.ReplaceChunks ).with_args( chunks ),
+ raises( RuntimeError,
+ 'Unable to open file: single_file\nFixIt/Refactor operation '
+ 'aborted prior to completion. Your files have not been '
+ 'fully updated. Please use undo commands to revert the '
+ 'applied changes.' ) )
+
+ # We checked if it was OK to open the file
+ confirm.assert_has_exact_calls( [
+ call( vimsupport.FIXIT_OPENING_BUFFERS_MESSAGE_FORMAT.format( 1 ) )
+ ] )
+
+ # Ensure that buffer is not changed
+ eq_( result_buffer.GetLines(), [
+ 'line1',
+ 'line2',
+ 'line3',
+ ] )
+
+ # We tried to open this file
+ open_filename.assert_called_with( "single_file", {
+ 'focus': True,
+ 'fix': True,
+ 'size': 10
+ } )
+ vim_eval.assert_called_with( "&previewheight" )
+
+ # But raised an exception before issuing the message at the end
+ echo_text_vim_width.assert_not_called()
+
+
+@patch( 'ycm.vimsupport.VariableExists', return_value = False )
+@patch( 'ycm.vimsupport.SetFittingHeightForCurrentWindow' )
+@patch( 'ycm.vimsupport.GetBufferNumberForFilename', side_effect=[
+ 22, # first_file (check)
+ -1, # another_file (check)
+ 22, # first_file (apply)
+ -1, # another_file (apply)
+ 19, # another_file (check after open)
+ ],
+ new_callable=ExtendedMock )
+@patch( 'ycm.vimsupport.BufferIsVisible', side_effect=[
+ True, # first_file (check)
+ False, # second_file (check)
+ True, # first_file (apply)
+ False, # second_file (apply)
+ True, # side_effect (check after open)
+ ],
+ new_callable=ExtendedMock)
+@patch( 'ycm.vimsupport.OpenFilename',
+ new_callable=ExtendedMock)
+@patch( 'ycm.vimsupport.EchoTextVimWidth',
+ new_callable=ExtendedMock)
+@patch( 'ycm.vimsupport.Confirm', return_value=True,
+ new_callable=ExtendedMock)
+@patch( 'vim.eval', return_value=10,
+ new_callable=ExtendedMock)
+@patch( 'vim.command',
+ new_callable=ExtendedMock)
+def ReplaceChunks_MultiFile_Open_test( vim_command,
+ vim_eval,
+ confirm,
+ echo_text_vim_width,
+ open_filename,
+ buffer_is_visible,
+ get_buffer_number_for_filename,
+ set_fitting_height,
+ variable_exists ):
+
+ # Chunks are split across 2 files, one is already open, one isn't
+
+ chunks = [
+ _BuildChunk( 1, 1, 2, 1, 'first_file_replacement ', '1_first_file' ),
+ _BuildChunk( 2, 1, 2, 1, 'second_file_replacement ', '2_another_file' ),
+ ]
+
+ first_file = MockBuffer( [
+ 'line1',
+ 'line2',
+ 'line3',
+ ], '1_first_file', 22 )
+ another_file = MockBuffer( [
+ 'another line1',
+ 'ACME line2',
+ ], '2_another_file', 19 )
+
+ vim_buffers = [ None ] * 23
+ vim_buffers[ 22 ] = first_file
+ vim_buffers[ 19 ] = another_file
+
+ with patch( 'vim.buffers', vim_buffers ):
+ vimsupport.ReplaceChunks( chunks )
+
+ # We checked for the right file names
+ get_buffer_number_for_filename.assert_has_exact_calls( [
+ call( '1_first_file', False ),
+ call( '2_another_file', False ),
+ call( '1_first_file', False ),
+ call( '2_another_file', False ),
+ call( '2_another_file', False ),
+ ] )
+
+ # We checked if it was OK to open the file
+ confirm.assert_has_exact_calls( [
+ call( vimsupport.FIXIT_OPENING_BUFFERS_MESSAGE_FORMAT.format( 1 ) )
+ ] )
+
+ # Ensure that buffers are updated
+ eq_( another_file.GetLines(), [
+ 'another line1',
+ 'second_file_replacement ACME line2',
+ ] )
+ eq_( first_file.GetLines(), [
+ 'first_file_replacement line2',
+ 'line3',
+ ] )
+
+ # We open '2_another_file' as expected.
+ open_filename.assert_called_with( '2_another_file', {
+ 'focus': True,
+ 'fix': True,
+ 'size': 10
+ } )
+
+ # And close it again, then show the quickfix window.
+ vim_command.assert_has_exact_calls( [
+ call( 'lclose' ),
+ call( 'hide' ),
+ call( 'botright copen' ),
+ call( 'silent! wincmd p' )
+ ] )
+ set_fitting_height.assert_called_once_with()
+
+ # And update the quickfix list with each entry
+ vim_eval.assert_has_exact_calls( [
+ call( '&previewheight' ),
+ call( 'setqflist( {0} )'.format( json.dumps( [ {
+ 'bufnr': 22,
+ 'filename': '1_first_file',
+ 'lnum': 1,
+ 'col': 1,
+ 'text': 'first_file_replacement ',
+ 'type': 'F'
+ }, {
+ 'bufnr': 19,
+ 'filename': '2_another_file',
+ 'lnum': 2,
+ 'col': 1,
+ 'text': 'second_file_replacement ',
+ 'type': 'F'
+ } ] ) ) ),
+ ] )
+
+ # And it is ReplaceChunks that prints the message showing the number of
+ # changes
+ echo_text_vim_width.assert_has_exact_calls( [
+ call( 'Applied 2 changes' ),
+ ] )
+
+
+def _BuildChunk( start_line,
+ start_column,
+ end_line,
+ end_column,
+ replacement_text, filepath='test_file_name' ):
+ return {
+ 'range': {
+ 'start': {
+ 'filepath': filepath,
+ 'line_num': start_line,
+ 'column_num': start_column,
+ },
+ 'end': {
+ 'filepath': filepath,
+ 'line_num': end_line,
+ 'column_num': end_column,
+ },
+ },
+ 'replacement_text': replacement_text
+ }
+
+
+@patch( 'vim.command', new_callable=ExtendedMock )
+@patch( 'vim.current', new_callable=ExtendedMock)
+def WriteToPreviewWindow_test( vim_current, vim_command ):
+ vim_current.window.options.__getitem__ = MagicMock( return_value = True )
+
+ vimsupport.WriteToPreviewWindow( "test" )
+
+ vim_command.assert_has_exact_calls( [
+ call( 'silent! pclose!' ),
+ call( 'silent! pedit! _TEMP_FILE_' ),
+ call( 'silent! wincmd P' ),
+ call( 'silent! wincmd p' ) ] )
+
+ vim_current.buffer.__setitem__.assert_called_with(
+ slice( None, None, None ), [ 'test' ] )
+
+ vim_current.buffer.options.__setitem__.assert_has_exact_calls( [
+ call( 'modifiable', True ),
+ call( 'readonly', False ),
+ call( 'buftype', 'nofile' ),
+ call( 'swapfile', False ),
+ call( 'modifiable', False ),
+ call( 'modified', False ),
+ call( 'readonly', True ),
+ ], any_order = True )
+
+
+@patch( 'vim.current' )
+def WriteToPreviewWindow_MultiLine_test( vim_current ):
+ vim_current.window.options.__getitem__ = MagicMock( return_value = True )
+ vimsupport.WriteToPreviewWindow( "test\ntest2" )
+
+ vim_current.buffer.__setitem__.assert_called_with(
+ slice( None, None, None ), [ 'test', 'test2' ] )
+
+
+@patch( 'vim.command', new_callable=ExtendedMock )
+@patch( 'vim.current', new_callable=ExtendedMock )
+def WriteToPreviewWindow_JumpFail_test( vim_current, vim_command ):
+ vim_current.window.options.__getitem__ = MagicMock( return_value = False )
+
+ vimsupport.WriteToPreviewWindow( "test" )
+
+ vim_command.assert_has_exact_calls( [
+ call( 'silent! pclose!' ),
+ call( 'silent! pedit! _TEMP_FILE_' ),
+ call( 'silent! wincmd P' ),
+ call( "echom 'test'" ),
+ ] )
+
+ vim_current.buffer.__setitem__.assert_not_called()
+ vim_current.buffer.options.__setitem__.assert_not_called()
+
+
+@patch( 'vim.command', new_callable=ExtendedMock )
+@patch( 'vim.current', new_callable=ExtendedMock )
+def WriteToPreviewWindow_JumpFail_MultiLine_test( vim_current, vim_command ):
+
+ vim_current.window.options.__getitem__ = MagicMock( return_value = False )
+
+ vimsupport.WriteToPreviewWindow( "test\ntest2" )
+
+ vim_command.assert_has_exact_calls( [
+ call( 'silent! pclose!' ),
+ call( 'silent! pedit! _TEMP_FILE_' ),
+ call( 'silent! wincmd P' ),
+ call( "echom 'test'" ),
+ call( "echom 'test2'" ),
+ ] )
+
+ vim_current.buffer.__setitem__.assert_not_called()
+ vim_current.buffer.options.__setitem__.assert_not_called()
+
+
+def CheckFilename_test():
+ assert_that(
+ calling( vimsupport.CheckFilename ).with_args( None ),
+ raises( RuntimeError, "'None' is not a valid filename" )
+ )
+
+ assert_that(
+ calling( vimsupport.CheckFilename ).with_args( 'nonexistent_file' ),
+ raises( RuntimeError,
+ "filename 'nonexistent_file' cannot be opened. "
+ "No such file or directory." )
+ )
+
+ assert_that( vimsupport.CheckFilename( __file__ ), none() )
+
+
+def BufferIsVisibleForFilename_test():
+ buffers = [
+ {
+ 'number': 1,
+ 'filename': os.path.realpath( 'visible_filename' ),
+ 'window': 1
+ },
+ {
+ 'number': 2,
+ 'filename': os.path.realpath( 'hidden_filename' ),
+ }
+ ]
+
+ with patch( 'vim.buffers', buffers ):
+ eq_( vimsupport.BufferIsVisibleForFilename( 'visible_filename' ), True )
+ eq_( vimsupport.BufferIsVisibleForFilename( 'hidden_filename' ), False )
+ eq_( vimsupport.BufferIsVisibleForFilename( 'another_filename' ), False )
+
+
+@patch( 'ycm.vimsupport.GetBufferNumberForFilename',
+ side_effect = [ 2, 5, -1 ] )
+@patch( 'vim.command',
+ side_effect = MockVimCommand,
+ new_callable = ExtendedMock )
+def CloseBuffersForFilename_test( vim_command, *args ):
+ vimsupport.CloseBuffersForFilename( 'some_filename' )
+
+ vim_command.assert_has_exact_calls( [
+ call( 'silent! bwipeout! 2' ),
+ call( 'silent! bwipeout! 5' )
+ ], any_order = True )
+
+
+@patch( 'vim.command', new_callable = ExtendedMock )
+@patch( 'vim.current', new_callable = ExtendedMock )
+def OpenFilename_test( vim_current, vim_command ):
+ # Options used to open a logfile
+ options = {
+ 'size': vimsupport.GetIntValue( '&previewheight' ),
+ 'fix': True,
+ 'watch': True,
+ 'position': 'end'
+ }
+
+ vimsupport.OpenFilename( __file__, options )
+
+ vim_command.assert_has_exact_calls( [
+ call( '12split {0}'.format( __file__ ) ),
+ call( "exec "
+ "'au BufEnter <buffer> :silent! checktime {0}'".format( __file__ ) ),
+ call( 'silent! normal G zz' ),
+ call( 'silent! wincmd p' )
+ ] )
+
+ vim_current.buffer.options.__setitem__.assert_has_exact_calls( [
+ call( 'autoread', True ),
+ ] )
+
+ vim_current.window.options.__setitem__.assert_has_exact_calls( [
+ call( 'winfixheight', True )
+ ] )
+
+
+@patch( 'ycm.vimsupport.BufferModified', side_effect = [ True ] )
+@patch( 'ycm.vimsupport.FiletypesForBuffer', side_effect = [ [ 'cpp' ] ] )
+def GetUnsavedAndCurrentBufferData_EncodedUnicodeCharsInBuffers_test( *args ):
+ mock_buffer = MagicMock()
+ mock_buffer.name = os.path.realpath( 'filename' )
+ mock_buffer.number = 1
+ mock_buffer.__iter__.return_value = [ u'abc', ToBytes( u'fДa' ) ]
+
+ with patch( 'vim.buffers', [ mock_buffer ] ):
+ assert_that( vimsupport.GetUnsavedAndCurrentBufferData(),
+ has_entry( mock_buffer.name,
+ has_entry( u'contents', u'abc\nfДa\n' ) ) )
+
+
+# NOTE: Vim returns byte offsets for columns, not actual character columns. This
+# makes 'ДД' have 4 columns: column 0, column 2 and column 4.
+@patch( 'vim.current.line', ToBytes( 'ДДaa' ) )
+@patch( 'ycm.vimsupport.CurrentColumn', side_effect = [ 4 ] )
+def TextBeforeCursor_EncodedUnicode_test( *args ):
+ eq_( vimsupport.TextBeforeCursor(), u'ДД' )
+
+
+# NOTE: Vim returns byte offsets for columns, not actual character columns. This
+# makes 'ДД' have 4 columns: column 0, column 2 and column 4.
+@patch( 'vim.current.line', ToBytes( 'aaДД' ) )
+@patch( 'ycm.vimsupport.CurrentColumn', side_effect = [ 2 ] )
+def TextAfterCursor_EncodedUnicode_test( *args ):
+ eq_( vimsupport.TextAfterCursor(), u'ДД' )
+
+
+@patch( 'vim.current.line', ToBytes( 'fДa' ) )
+def CurrentLineContents_EncodedUnicode_test( *args ):
+ eq_( vimsupport.CurrentLineContents(), u'fДa' )
+
+
+@patch( 'vim.eval', side_effect = lambda x: x )
+def VimExpressionToPythonType_IntAsUnicode_test( *args ):
+ eq_( vimsupport.VimExpressionToPythonType( '123' ), 123 )
+
+
+@patch( 'vim.eval', side_effect = lambda x: x )
+def VimExpressionToPythonType_IntAsBytes_test( *args ):
+ eq_( vimsupport.VimExpressionToPythonType( ToBytes( '123' ) ), 123 )
+
+
+@patch( 'vim.eval', side_effect = lambda x: x )
+def VimExpressionToPythonType_StringAsUnicode_test( *args ):
+ eq_( vimsupport.VimExpressionToPythonType( 'foo' ), 'foo' )
+
+
+@patch( 'vim.eval', side_effect = lambda x: x )
+def VimExpressionToPythonType_StringAsBytes_test( *args ):
+ eq_( vimsupport.VimExpressionToPythonType( ToBytes( 'foo' ) ), 'foo' )
+
+
+@patch( 'vim.eval', side_effect = lambda x: x )
+def VimExpressionToPythonType_ListPassthrough_test( *args ):
+ eq_( vimsupport.VimExpressionToPythonType( [ 1, 2 ] ), [ 1, 2 ] )
+
+
+@patch( 'vim.eval', side_effect = lambda x: x )
+def VimExpressionToPythonType_ObjectPassthrough_test( *args ):
+ eq_( vimsupport.VimExpressionToPythonType( { 1: 2 } ), { 1: 2 } )
+
+
+@patch( 'vim.eval', side_effect = lambda x: x )
+def VimExpressionToPythonType_GeneratorPassthrough_test( *args ):
+ gen = ( x**2 for x in [ 1, 2, 3 ] )
+ eq_( vimsupport.VimExpressionToPythonType( gen ), gen )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/tests/youcompleteme_test.py b/vim/bundle/YouCompleteMe/python/ycm/tests/youcompleteme_test.py
new file mode 100644
index 0000000..eb04b80
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/tests/youcompleteme_test.py
@@ -0,0 +1,47 @@
+# Copyright (C) 2016 YouCompleteMe contributors
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from ycm.test_utils import MockVimModule
+MockVimModule()
+
+import sys
+from mock import MagicMock
+from hamcrest import assert_that, is_in, is_not
+
+from ycm.youcompleteme import YouCompleteMe
+
+
+class YouCompleteMe_test():
+
+ def setUp( self ):
+ self.ycm = YouCompleteMe( MagicMock( spec_set = dict ) )
+
+
+ def tearDown( self ):
+ self.ycm.OnVimLeave()
+
+
+ def YcmCoreNotImported_test( self ):
+ assert_that( 'ycm_core', is_not( is_in( sys.modules ) ) )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/unsafe_thread_pool_executor.py b/vim/bundle/YouCompleteMe/python/ycm/unsafe_thread_pool_executor.py
new file mode 100644
index 0000000..666aebc
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/unsafe_thread_pool_executor.py
@@ -0,0 +1,120 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+#
+# Copyright (C) 2013 Google Inc.
+# Changes to this file are licensed under the same terms as the original file
+# (the Python Software Foundation License).
+
+
+from __future__ import with_statement
+import threading
+import weakref
+import sys
+
+from concurrent.futures import _base
+
+try:
+ import queue
+except ImportError:
+ import Queue as queue
+
+
+# This file provides an UnsafeThreadPoolExecutor, which operates exactly like
+# the upstream Python version of ThreadPoolExecutor with one exception: it
+# doesn't wait for worker threads to finish before shutting down the Python
+# interpreter.
+#
+# This is dangerous for many workloads, but fine for some (like when threads
+# only send network requests). The YCM workload is one of those workloads where
+# it's safe (the aforementioned network requests case).
+
+class _WorkItem(object):
+ def __init__(self, future, fn, args, kwargs):
+ self.future = future
+ self.fn = fn
+ self.args = args
+ self.kwargs = kwargs
+
+ def run(self):
+ if not self.future.set_running_or_notify_cancel():
+ return
+
+ try:
+ result = self.fn(*self.args, **self.kwargs)
+ except BaseException:
+ e = sys.exc_info()[1]
+ self.future.set_exception(e)
+ else:
+ self.future.set_result(result)
+
+
+def _worker(executor_reference, work_queue):
+ try:
+ while True:
+ work_item = work_queue.get(block=True)
+ if work_item is not None:
+ work_item.run()
+ continue
+ executor = executor_reference()
+ # Exit if:
+ # - The executor that owns the worker has been collected OR
+ # - The executor that owns the worker has been shutdown.
+ if executor is None or executor._shutdown:
+ # Notice other workers
+ work_queue.put(None)
+ return
+ del executor
+ except BaseException:
+ _base.LOGGER.critical('Exception in worker', exc_info=True)
+
+
+class UnsafeThreadPoolExecutor(_base.Executor):
+ def __init__(self, max_workers):
+ """Initializes a new ThreadPoolExecutor instance.
+
+ Args:
+ max_workers: The maximum number of threads that can be used to
+ execute the given calls.
+ """
+ self._max_workers = max_workers
+ self._work_queue = queue.Queue()
+ self._threads = set()
+ self._shutdown = False
+ self._shutdown_lock = threading.Lock()
+
+ def submit(self, fn, *args, **kwargs):
+ with self._shutdown_lock:
+ if self._shutdown:
+ raise RuntimeError('cannot schedule new futures after shutdown')
+
+ f = _base.Future()
+ w = _WorkItem(f, fn, args, kwargs)
+
+ self._work_queue.put(w)
+ self._adjust_thread_count()
+ return f
+ submit.__doc__ = _base.Executor.submit.__doc__
+
+ def _adjust_thread_count(self):
+ # When the executor gets lost, the weakref callback will wake up
+ # the worker threads.
+ def weakref_cb(_, q=self._work_queue):
+ q.put(None)
+ # TODO(bquinlan): Should avoid creating new threads if there are more
+ # idle threads than items in the work queue.
+ if len(self._threads) < self._max_workers:
+ t = threading.Thread(target=_worker,
+ args=(weakref.ref(self, weakref_cb),
+ self._work_queue))
+ t.daemon = True
+ t.start()
+ self._threads.add(t)
+
+ def shutdown(self, wait=True):
+ with self._shutdown_lock:
+ self._shutdown = True
+ self._work_queue.put(None)
+ if wait:
+ for t in self._threads:
+ t.join()
+ shutdown.__doc__ = _base.Executor.shutdown.__doc__
diff --git a/vim/bundle/YouCompleteMe/python/ycm/vimsupport.py b/vim/bundle/YouCompleteMe/python/ycm/vimsupport.py
new file mode 100644
index 0000000..c4a600c
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/vimsupport.py
@@ -0,0 +1,978 @@
+# Copyright (C) 2011, 2012 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from future.utils import iterkeys
+import vim
+import os
+import tempfile
+import json
+import re
+from collections import defaultdict
+from ycmd.utils import ToUnicode, ToBytes
+from ycmd import user_options_store
+
+BUFFER_COMMAND_MAP = { 'same-buffer' : 'edit',
+ 'horizontal-split' : 'split',
+ 'vertical-split' : 'vsplit',
+ 'new-tab' : 'tabedit' }
+
+FIXIT_OPENING_BUFFERS_MESSAGE_FORMAT = (
+ 'The requested operation will apply changes to {0} files which are not '
+ 'currently open. This will therefore open {0} new files in the hidden '
+ 'buffers. The quickfix list can then be used to review the changes. No '
+ 'files will be written to disk. Do you wish to continue?' )
+
+
+def CurrentLineAndColumn():
+ """Returns the 0-based current line and 0-based current column."""
+ # See the comment in CurrentColumn about the calculation for the line and
+ # column number
+ line, column = vim.current.window.cursor
+ line -= 1
+ return line, column
+
+
+def CurrentColumn():
+ """Returns the 0-based current column. Do NOT access the CurrentColumn in
+ vim.current.line. It doesn't exist yet when the cursor is at the end of the
+ line. Only the chars before the current column exist in vim.current.line."""
+
+ # vim's columns are 1-based while vim.current.line columns are 0-based
+ # ... but vim.current.window.cursor (which returns a (line, column) tuple)
+ # columns are 0-based, while the line from that same tuple is 1-based.
+ # vim.buffers buffer objects OTOH have 0-based lines and columns.
+ # Pigs have wings and I'm a loopy purple duck. Everything makes sense now.
+ return vim.current.window.cursor[ 1 ]
+
+
+def CurrentLineContents():
+ return ToUnicode( vim.current.line )
+
+
+def TextAfterCursor():
+ """Returns the text after CurrentColumn."""
+ return ToUnicode( vim.current.line[ CurrentColumn(): ] )
+
+
+def TextBeforeCursor():
+ """Returns the text before CurrentColumn."""
+ return ToUnicode( vim.current.line[ :CurrentColumn() ] )
+
+
+# Expects version_string in 'MAJOR.MINOR.PATCH' format, e.g. '7.4.301'
+def VimVersionAtLeast( version_string ):
+ major, minor, patch = [ int( x ) for x in version_string.split( '.' ) ]
+
+ # For Vim 7.4.301, v:version is '704'
+ actual_major_and_minor = GetIntValue( 'v:version' )
+ matching_major_and_minor = major * 100 + minor
+ if actual_major_and_minor != matching_major_and_minor:
+ return actual_major_and_minor > matching_major_and_minor
+
+ return GetBoolValue( 'has("patch{0}")'.format( patch ) )
+
+
+# Note the difference between buffer OPTIONS and VARIABLES; the two are not
+# the same.
+def GetBufferOption( buffer_object, option ):
+ # NOTE: We used to check for the 'options' property on the buffer_object which
+ # is available in recent versions of Vim and would then use:
+ #
+ # buffer_object.options[ option ]
+ #
+ # to read the value, BUT this caused annoying flickering when the
+ # buffer_object was a hidden buffer (with option = 'ft'). This was all due to
+ # a Vim bug. Until this is fixed, we won't use it.
+
+ to_eval = 'getbufvar({0}, "&{1}")'.format( buffer_object.number, option )
+ return GetVariableValue( to_eval )
+
+
+def BufferModified( buffer_object ):
+ return bool( int( GetBufferOption( buffer_object, 'mod' ) ) )
+
+
+def GetUnsavedAndCurrentBufferData():
+ buffers_data = {}
+ for buffer_object in vim.buffers:
+ if not ( BufferModified( buffer_object ) or
+ buffer_object == vim.current.buffer ):
+ continue
+
+ buffers_data[ GetBufferFilepath( buffer_object ) ] = {
+ # Add a newline to match what gets saved to disk. See #1455 for details.
+ 'contents': '\n'.join( ToUnicode( x ) for x in buffer_object ) + '\n',
+ 'filetypes': FiletypesForBuffer( buffer_object )
+ }
+
+ return buffers_data
+
+
+def GetBufferNumberForFilename( filename, open_file_if_needed = True ):
+ return GetIntValue( u"bufnr('{0}', {1})".format(
+ EscapeForVim( os.path.realpath( filename ) ),
+ int( open_file_if_needed ) ) )
+
+
+def GetCurrentBufferFilepath():
+ return GetBufferFilepath( vim.current.buffer )
+
+
+def BufferIsVisible( buffer_number ):
+ if buffer_number < 0:
+ return False
+ window_number = GetIntValue( "bufwinnr({0})".format( buffer_number ) )
+ return window_number != -1
+
+
+def GetBufferFilepath( buffer_object ):
+ if buffer_object.name:
+ return buffer_object.name
+ # Buffers that have just been created by a command like :enew don't have any
+ # buffer name so we use the buffer number for that. Also, os.getcwd() throws
+ # an exception when the CWD has been deleted so we handle that.
+ try:
+ folder_path = os.getcwd()
+ except OSError:
+ folder_path = tempfile.gettempdir()
+ return os.path.join( folder_path, str( buffer_object.number ) )
+
+
+def UnplaceSignInBuffer( buffer_number, sign_id ):
+ if buffer_number < 0:
+ return
+ vim.command(
+ 'try | exec "sign unplace {0} buffer={1}" | catch /E158/ | endtry'.format(
+ sign_id, buffer_number ) )
+
+
+def PlaceSign( sign_id, line_num, buffer_num, is_error = True ):
+ # libclang can give us diagnostics that point "outside" the file; Vim borks
+ # on these.
+ if line_num < 1:
+ line_num = 1
+
+ sign_name = 'YcmError' if is_error else 'YcmWarning'
+ vim.command( 'sign place {0} line={1} name={2} buffer={3}'.format(
+ sign_id, line_num, sign_name, buffer_num ) )
+
+
+def PlaceDummySign( sign_id, buffer_num, line_num ):
+ if buffer_num < 0 or line_num < 0:
+ return
+ vim.command( 'sign define ycm_dummy_sign' )
+ vim.command(
+ 'sign place {0} name=ycm_dummy_sign line={1} buffer={2}'.format(
+ sign_id,
+ line_num,
+ buffer_num,
+ )
+ )
+
+
+def UnPlaceDummySign( sign_id, buffer_num ):
+ if buffer_num < 0:
+ return
+ vim.command( 'sign undefine ycm_dummy_sign' )
+ vim.command( 'sign unplace {0} buffer={1}'.format( sign_id, buffer_num ) )
+
+
+def ClearYcmSyntaxMatches():
+ matches = VimExpressionToPythonType( 'getmatches()' )
+ for match in matches:
+ if match[ 'group' ].startswith( 'Ycm' ):
+ vim.eval( 'matchdelete({0})'.format( match[ 'id' ] ) )
+
+
+# Returns the ID of the newly added match
+# Both line and column numbers are 1-based
+def AddDiagnosticSyntaxMatch( line_num,
+ column_num,
+ line_end_num = None,
+ column_end_num = None,
+ is_error = True ):
+ group = 'YcmErrorSection' if is_error else 'YcmWarningSection'
+
+ if not line_end_num:
+ line_end_num = line_num
+
+ line_num, column_num = LineAndColumnNumbersClamped( line_num, column_num )
+ line_end_num, column_end_num = LineAndColumnNumbersClamped( line_end_num,
+ column_end_num )
+
+ if not column_end_num:
+ return GetIntValue(
+ "matchadd('{0}', '\%{1}l\%{2}c')".format( group, line_num, column_num ) )
+ else:
+ return GetIntValue(
+ "matchadd('{0}', '\%{1}l\%{2}c\_.\\{{-}}\%{3}l\%{4}c')".format(
+ group, line_num, column_num, line_end_num, column_end_num ) )
+
+
+# Clamps the line and column numbers so that they are not past the contents of
+# the buffer. Numbers are 1-based byte offsets.
+def LineAndColumnNumbersClamped( line_num, column_num ):
+ new_line_num = line_num
+ new_column_num = column_num
+
+ max_line = len( vim.current.buffer )
+ if line_num and line_num > max_line:
+ new_line_num = max_line
+
+ max_column = len( vim.current.buffer[ new_line_num - 1 ] )
+ if column_num and column_num > max_column:
+ new_column_num = max_column
+
+ return new_line_num, new_column_num
+
+
+def SetLocationList( diagnostics ):
+ """Diagnostics should be in qflist format; see ":h setqflist" for details."""
+ vim.eval( 'setloclist( 0, {0} )'.format( json.dumps( diagnostics ) ) )
+
+
+def SetQuickFixList( quickfix_list, focus = False, autoclose = False ):
+ """Populate the quickfix list and open it. List should be in qflist format:
+ see ":h setqflist" for details. When focus is set to True, the quickfix
+ window becomes the active window. When autoclose is set to True, the quickfix
+ window is automatically closed after an entry is selected."""
+ vim.eval( 'setqflist( {0} )'.format( json.dumps( quickfix_list ) ) )
+ OpenQuickFixList( focus, autoclose )
+
+
+def OpenQuickFixList( focus = False, autoclose = False ):
+ """Open the quickfix list to full width at the bottom of the screen with its
+ height automatically set to fit all entries. This behavior can be overridden
+ by using the YcmQuickFixOpened autocommand.
+ See the SetQuickFixList function for the focus and autoclose options."""
+ vim.command( 'botright copen' )
+
+ SetFittingHeightForCurrentWindow()
+
+ if autoclose:
+ # This autocommand is automatically removed when the quickfix window is
+ # closed.
+ vim.command( 'au WinLeave <buffer> q' )
+
+ if VariableExists( '#User#YcmQuickFixOpened' ):
+ vim.command( 'doautocmd User YcmQuickFixOpened' )
+
+ if not focus:
+ JumpToPreviousWindow()
+
+
+def SetFittingHeightForCurrentWindow():
+ window_width = GetIntValue( 'winwidth( 0 )' )
+ fitting_height = 0
+ for line in vim.current.buffer:
+ fitting_height += len( line ) // window_width + 1
+ vim.command( '{0}wincmd _'.format( fitting_height ) )
+
+
+def ConvertDiagnosticsToQfList( diagnostics ):
+ def ConvertDiagnosticToQfFormat( diagnostic ):
+ # See :h getqflist for a description of the dictionary fields.
+ # Note that, as usual, Vim is completely inconsistent about whether
+ # line/column numbers are 1 or 0 based in its various APIs. Here, it wants
+ # them to be 1-based. The documentation states quite clearly that it
+ # expects a byte offset, by which it means "1-based column number" as
+ # described in :h getqflist ("the first column is 1").
+ location = diagnostic[ 'location' ]
+ line_num = location[ 'line_num' ]
+
+ # libclang can give us diagnostics that point "outside" the file; Vim borks
+ # on these.
+ if line_num < 1:
+ line_num = 1
+
+ text = diagnostic[ 'text' ]
+ if diagnostic.get( 'fixit_available', False ):
+ text += ' (FixIt available)'
+
+ return {
+ 'bufnr' : GetBufferNumberForFilename( location[ 'filepath' ] ),
+ 'lnum' : line_num,
+ 'col' : location[ 'column_num' ],
+ 'text' : text,
+ 'type' : diagnostic[ 'kind' ][ 0 ],
+ 'valid' : 1
+ }
+
+ return [ ConvertDiagnosticToQfFormat( x ) for x in diagnostics ]
+
+
+def GetVimGlobalsKeys():
+ return vim.eval( 'keys( g: )' )
+
+
+def VimExpressionToPythonType( vim_expression ):
+ """Returns a Python type from the return value of the supplied Vim expression.
+ If the expression returns a list, dict or other non-string type, then it is
+ returned unmodified. If the string return can be converted to an
+ integer, returns an integer, otherwise returns the result converted to a
+ Unicode string."""
+
+ result = vim.eval( vim_expression )
+ if not ( isinstance( result, str ) or isinstance( result, bytes ) ):
+ return result
+
+ try:
+ return int( result )
+ except ValueError:
+ return ToUnicode( result )
+
+
+def HiddenEnabled( buffer_object ):
+ return bool( int( GetBufferOption( buffer_object, 'hid' ) ) )
+
+
+def BufferIsUsable( buffer_object ):
+ return not BufferModified( buffer_object ) or HiddenEnabled( buffer_object )
+
+
+def EscapedFilepath( filepath ):
+ return filepath.replace( ' ' , r'\ ' )
+
+
+# Both |line| and |column| need to be 1-based
+def TryJumpLocationInOpenedTab( filename, line, column ):
+ filepath = os.path.realpath( filename )
+
+ for tab in vim.tabpages:
+ for win in tab.windows:
+ if win.buffer.name == filepath:
+ vim.current.tabpage = tab
+ vim.current.window = win
+ vim.current.window.cursor = ( line, column - 1 )
+
+ # Center the screen on the jumped-to location
+ vim.command( 'normal! zz' )
+ return True
+ # 'filename' is not opened in any tab pages
+ return False
+
+
+# Maps User command to vim command
+def GetVimCommand( user_command, default = 'edit' ):
+ vim_command = BUFFER_COMMAND_MAP.get( user_command, default )
+ if vim_command == 'edit' and not BufferIsUsable( vim.current.buffer ):
+ vim_command = 'split'
+ return vim_command
+
+
+# Both |line| and |column| need to be 1-based
+def JumpToLocation( filename, line, column ):
+ # Add an entry to the jumplist
+ vim.command( "normal! m'" )
+
+ if filename != GetCurrentBufferFilepath():
+ # We prefix the command with 'keepjumps' so that opening the file is not
+ # recorded in the jumplist. So when we open the file and move the cursor to
+ # a location in it, the user can use CTRL-O to jump back to the original
+ # location, not to the start of the newly opened file.
+ # Sadly this fails on random occasions and the undesired jump remains in the
+ # jumplist.
+ user_command = user_options_store.Value( 'goto_buffer_command' )
+
+ if user_command == 'new-or-existing-tab':
+ if TryJumpLocationInOpenedTab( filename, line, column ):
+ return
+ user_command = 'new-tab'
+
+ vim_command = GetVimCommand( user_command )
+ try:
+ vim.command( 'keepjumps {0} {1}'.format( vim_command,
+ EscapedFilepath( filename ) ) )
+ # When the file we are trying to jump to has a swap file
+ # Vim opens swap-exists-choices dialog and throws vim.error with E325 error,
+ # or KeyboardInterrupt after user selects one of the options.
+ except vim.error as e:
+ if 'E325' not in str( e ):
+ raise
+ # Do nothing if the target file is still not opened (user chose (Q)uit)
+ if filename != GetCurrentBufferFilepath():
+ return
+ # Thrown when user chooses (A)bort in .swp message box
+ except KeyboardInterrupt:
+ return
+ vim.current.window.cursor = ( line, column - 1 )
+
+ # Center the screen on the jumped-to location
+ vim.command( 'normal! zz' )
+
+
+def NumLinesInBuffer( buffer_object ):
+ # This is actually less than obvious, that's why it's wrapped in a function
+ return len( buffer_object )
+
+
+# Calling this function from the non-GUI thread will sometimes crash Vim. At
+# the time of writing, YCM only uses the GUI thread inside Vim (this used to
+# not be the case).
+# We redraw the screen before displaying the message to avoid the "Press ENTER
+# or type command to continue" prompt when editing a new C-family file.
+def PostVimMessage( message ):
+ vim.command( "redraw | echohl WarningMsg | echom '{0}' | echohl None"
+ .format( EscapeForVim( ToUnicode( message ) ) ) )
+
+
+# Unlike PostVimMesasge, this supports messages with newlines in them because it
+# uses 'echo' instead of 'echomsg'. This also means that the message will NOT
+# appear in Vim's message log.
+def PostMultiLineNotice( message ):
+ vim.command( "echohl WarningMsg | echo '{0}' | echohl None"
+ .format( EscapeForVim( ToUnicode( message ) ) ) )
+
+
+def PresentDialog( message, choices, default_choice_index = 0 ):
+ """Presents the user with a dialog where a choice can be made.
+ This will be a dialog for gvim users or a question in the message buffer
+ for vim users or if `set guioptions+=c` was used.
+
+ choices is list of alternatives.
+ default_choice_index is the 0-based index of the default element
+ that will get choosen if the user hits <CR>. Use -1 for no default.
+
+ PresentDialog will return a 0-based index into the list
+ or -1 if the dialog was dismissed by using <Esc>, Ctrl-C, etc.
+
+ See also:
+ :help confirm() in vim (Note that vim uses 1-based indexes)
+
+ Example call:
+ PresentDialog("Is this a nice example?", ["Yes", "No", "May&be"])
+ Is this a nice example?
+ [Y]es, (N)o, May(b)e:"""
+ to_eval = "confirm('{0}', '{1}', {2})".format(
+ EscapeForVim( ToUnicode( message ) ),
+ EscapeForVim( ToUnicode( "\n" .join( choices ) ) ),
+ default_choice_index + 1 )
+ return int( vim.eval( to_eval ) ) - 1
+
+
+def Confirm( message ):
+ """Display |message| with Ok/Cancel operations. Returns True if the user
+ selects Ok"""
+ return bool( PresentDialog( message, [ "Ok", "Cancel" ] ) == 0 )
+
+
+def EchoText( text, log_as_message = True ):
+ def EchoLine( text ):
+ command = 'echom' if log_as_message else 'echo'
+ vim.command( "{0} '{1}'".format( command,
+ EscapeForVim( text ) ) )
+
+ for line in ToUnicode( text ).split( '\n' ):
+ EchoLine( line )
+
+
+# Echos text but truncates it so that it all fits on one line
+def EchoTextVimWidth( text ):
+ vim_width = GetIntValue( '&columns' )
+ truncated_text = ToUnicode( text )[ : int( vim_width * 0.9 ) ]
+ truncated_text.replace( '\n', ' ' )
+
+ old_ruler = GetIntValue( '&ruler' )
+ old_showcmd = GetIntValue( '&showcmd' )
+ vim.command( 'set noruler noshowcmd' )
+ vim.command( 'redraw' )
+
+ EchoText( truncated_text, False )
+
+ SetVariableValue( '&ruler', old_ruler )
+ SetVariableValue( '&showcmd', old_showcmd )
+
+
+def EscapeForVim( text ):
+ return ToUnicode( text.replace( "'", "''" ) )
+
+
+def CurrentFiletypes():
+ return VimExpressionToPythonType( "&filetype" ).split( '.' )
+
+
+def FiletypesForBuffer( buffer_object ):
+ # NOTE: Getting &ft for other buffers only works when the buffer has been
+ # visited by the user at least once, which is true for modified buffers
+ return GetBufferOption( buffer_object, 'ft' ).split( '.' )
+
+
+def VariableExists( variable ):
+ return GetBoolValue( "exists( '{0}' )".format( EscapeForVim( variable ) ) )
+
+
+def SetVariableValue( variable, value ):
+ vim.command( "let {0} = {1}".format( variable, json.dumps( value ) ) )
+
+
+def GetVariableValue( variable ):
+ return vim.eval( variable )
+
+
+def GetBoolValue( variable ):
+ return bool( int( vim.eval( variable ) ) )
+
+
+def GetIntValue( variable ):
+ return int( vim.eval( variable ) )
+
+
+def _SortChunksByFile( chunks ):
+ """Sort the members of the list |chunks| (which must be a list of dictionaries
+ conforming to ycmd.responses.FixItChunk) by their filepath. Returns a new
+ list in arbitrary order."""
+
+ chunks_by_file = defaultdict( list )
+
+ for chunk in chunks:
+ filepath = chunk[ 'range' ][ 'start' ][ 'filepath' ]
+ chunks_by_file[ filepath ].append( chunk )
+
+ return chunks_by_file
+
+
+def _GetNumNonVisibleFiles( file_list ):
+ """Returns the number of file in the iterable list of files |file_list| which
+ are not curerntly open in visible windows"""
+ return len(
+ [ f for f in file_list
+ if not BufferIsVisible( GetBufferNumberForFilename( f, False ) ) ] )
+
+
+def _OpenFileInSplitIfNeeded( filepath ):
+ """Ensure that the supplied filepath is open in a visible window, opening a
+ new split if required. Returns the buffer number of the file and an indication
+ of whether or not a new split was opened.
+
+ If the supplied filename is already open in a visible window, return just
+ return its buffer number. If the supplied file is not visible in a window
+ in the current tab, opens it in a new vertical split.
+
+ Returns a tuple of ( buffer_num, split_was_opened ) indicating the buffer
+ number and whether or not this method created a new split. If the user opts
+ not to open a file, or if opening fails, this method raises RuntimeError,
+ otherwise, guarantees to return a visible buffer number in buffer_num."""
+
+ buffer_num = GetBufferNumberForFilename( filepath, False )
+
+ # We only apply changes in the current tab page (i.e. "visible" windows).
+ # Applying changes in tabs does not lead to a better user experience, as the
+ # quickfix list no longer works as you might expect (doesn't jump into other
+ # tabs), and the complexity of choosing where to apply edits is significant.
+ if BufferIsVisible( buffer_num ):
+ # file is already open and visible, just return that buffer number (and an
+ # idicator that we *didn't* open a split)
+ return ( buffer_num, False )
+
+ # The file is not open in a visible window, so we open it in a split.
+ # We open the file with a small, fixed height. This means that we don't
+ # make the current buffer the smallest after a series of splits.
+ OpenFilename( filepath, {
+ 'focus': True,
+ 'fix': True,
+ 'size': GetIntValue( '&previewheight' ),
+ } )
+
+ # OpenFilename returns us to the original cursor location. This is what we
+ # want, because we don't want to disorientate the user, but we do need to
+ # know the (now open) buffer number for the filename
+ buffer_num = GetBufferNumberForFilename( filepath, False )
+ if not BufferIsVisible( buffer_num ):
+ # This happens, for example, if there is a swap file and the user
+ # selects the "Quit" or "Abort" options. We just raise an exception to
+ # make it clear to the user that the abort has left potentially
+ # partially-applied changes.
+ raise RuntimeError(
+ 'Unable to open file: {0}\nFixIt/Refactor operation '
+ 'aborted prior to completion. Your files have not been '
+ 'fully updated. Please use undo commands to revert the '
+ 'applied changes.'.format( filepath ) )
+
+ # We opened this file in a split
+ return ( buffer_num, True )
+
+
+def ReplaceChunks( chunks ):
+ """Apply the source file deltas supplied in |chunks| to arbitrary files.
+ |chunks| is a list of changes defined by ycmd.responses.FixItChunk,
+ which may apply arbitrary modifications to arbitrary files.
+
+ If a file specified in a particular chunk is not currently open in a visible
+ buffer (i.e., one in a window visible in the current tab), we:
+ - issue a warning to the user that we're going to open new files (and offer
+ her the option to abort cleanly)
+ - open the file in a new split, make the changes, then hide the buffer.
+
+ If for some reason a file could not be opened or changed, raises RuntimeError.
+ Otherwise, returns no meaningful value."""
+
+ # We apply the edits file-wise for efficiency, and because we must track the
+ # file-wise offset deltas (caused by the modifications to the text).
+ chunks_by_file = _SortChunksByFile( chunks )
+
+ # We sort the file list simply to enable repeatable testing
+ sorted_file_list = sorted( iterkeys( chunks_by_file ) )
+
+ # Make sure the user is prepared to have her screen mutilated by the new
+ # buffers
+ num_files_to_open = _GetNumNonVisibleFiles( sorted_file_list )
+
+ if num_files_to_open > 0:
+ if not Confirm(
+ FIXIT_OPENING_BUFFERS_MESSAGE_FORMAT.format( num_files_to_open ) ):
+ return
+
+ # Store the list of locations where we applied changes. We use this to display
+ # the quickfix window showing the user where we applied changes.
+ locations = []
+
+ for filepath in sorted_file_list:
+ ( buffer_num, close_window ) = _OpenFileInSplitIfNeeded( filepath )
+
+ ReplaceChunksInBuffer( chunks_by_file[ filepath ],
+ vim.buffers[ buffer_num ],
+ locations )
+
+ # When opening tons of files, we don't want to have a split for each new
+ # file, as this simply does not scale, so we open the window, make the
+ # edits, then hide the window.
+ if close_window:
+ # Some plugins (I'm looking at you, syntastic) might open a location list
+ # for the window we just opened. We don't want that location list hanging
+ # around, so we close it. lclose is a no-op if there is no location list.
+ vim.command( 'lclose' )
+
+ # Note that this doesn't lose our changes. It simply "hides" the buffer,
+ # which can later be re-accessed via the quickfix list or `:ls`
+ vim.command( 'hide' )
+
+ # Open the quickfix list, populated with entries for each location we changed.
+ if locations:
+ SetQuickFixList( locations )
+
+ EchoTextVimWidth( "Applied " + str( len( chunks ) ) + " changes" )
+
+
+def ReplaceChunksInBuffer( chunks, vim_buffer, locations ):
+ """Apply changes in |chunks| to the buffer-like object |buffer|. Append each
+ chunk's start to the list |locations|"""
+
+ # We need to track the difference in length, but ensuring we apply fixes
+ # in ascending order of insertion point.
+ chunks.sort( key = lambda chunk: (
+ chunk[ 'range' ][ 'start' ][ 'line_num' ],
+ chunk[ 'range' ][ 'start' ][ 'column_num' ]
+ ) )
+
+ # Remember the line number we're processing. Negative line number means we
+ # haven't processed any lines yet (by nature of being not equal to any
+ # real line number).
+ last_line = -1
+
+ line_delta = 0
+ for chunk in chunks:
+ if chunk[ 'range' ][ 'start' ][ 'line_num' ] != last_line:
+ # If this chunk is on a different line than the previous chunk,
+ # then ignore previous deltas (as offsets won't have changed).
+ last_line = chunk[ 'range' ][ 'end' ][ 'line_num' ]
+ char_delta = 0
+
+ ( new_line_delta, new_char_delta ) = ReplaceChunk(
+ chunk[ 'range' ][ 'start' ],
+ chunk[ 'range' ][ 'end' ],
+ chunk[ 'replacement_text' ],
+ line_delta, char_delta,
+ vim_buffer,
+ locations )
+ line_delta += new_line_delta
+ char_delta += new_char_delta
+
+
+# Replace the chunk of text specified by a contiguous range with the supplied
+# text.
+# * start and end are objects with line_num and column_num properties
+# * the range is inclusive
+# * indices are all 1-based
+# * the returned character delta is the delta for the last line
+#
+# returns the delta (in lines and characters) that any position after the end
+# needs to be adjusted by.
+#
+# NOTE: Works exclusively with bytes() instances and byte offsets as returned
+# by ycmd and used within the Vim buffers
+def ReplaceChunk( start, end, replacement_text, line_delta, char_delta,
+ vim_buffer, locations = None ):
+ # ycmd's results are all 1-based, but vim's/python's are all 0-based
+ # (so we do -1 on all of the values)
+ start_line = start[ 'line_num' ] - 1 + line_delta
+ end_line = end[ 'line_num' ] - 1 + line_delta
+
+ source_lines_count = end_line - start_line + 1
+ start_column = start[ 'column_num' ] - 1 + char_delta
+ end_column = end[ 'column_num' ] - 1
+ if source_lines_count == 1:
+ end_column += char_delta
+
+ # NOTE: replacement_text is unicode, but all our offsets are byte offsets,
+ # so we convert to bytes
+ replacement_lines = ToBytes( replacement_text ).splitlines( False )
+ if not replacement_lines:
+ replacement_lines = [ bytes( b'' ) ]
+ replacement_lines_count = len( replacement_lines )
+
+ end_existing_text = vim_buffer[ end_line ][ end_column : ]
+ start_existing_text = vim_buffer[ start_line ][ : start_column ]
+
+ new_char_delta = ( len( replacement_lines[ -1 ] )
+ - ( end_column - start_column ) )
+ if replacement_lines_count > 1:
+ new_char_delta -= start_column
+
+ replacement_lines[ 0 ] = start_existing_text + replacement_lines[ 0 ]
+ replacement_lines[ -1 ] = replacement_lines[ -1 ] + end_existing_text
+
+ vim_buffer[ start_line : end_line + 1 ] = replacement_lines[:]
+
+ if locations is not None:
+ locations.append( {
+ 'bufnr': vim_buffer.number,
+ 'filename': vim_buffer.name,
+ # line and column numbers are 1-based in qflist
+ 'lnum': start_line + 1,
+ 'col': start_column + 1,
+ 'text': replacement_text,
+ 'type': 'F',
+ } )
+
+ new_line_delta = replacement_lines_count - source_lines_count
+ return ( new_line_delta, new_char_delta )
+
+
+def InsertNamespace( namespace ):
+ if VariableExists( 'g:ycm_csharp_insert_namespace_expr' ):
+ expr = GetVariableValue( 'g:ycm_csharp_insert_namespace_expr' )
+ if expr:
+ SetVariableValue( "g:ycm_namespace_to_insert", namespace )
+ vim.eval( expr )
+ return
+
+ pattern = '^\s*using\(\s\+[a-zA-Z0-9]\+\s\+=\)\?\s\+[a-zA-Z0-9.]\+\s*;\s*'
+ line = SearchInCurrentBuffer( pattern )
+ existing_line = LineTextInCurrentBuffer( line )
+ existing_indent = re.sub( r"\S.*", "", existing_line )
+ new_line = "{0}using {1};\n\n".format( existing_indent, namespace )
+ replace_pos = { 'line_num': line + 1, 'column_num': 1 }
+ ReplaceChunk( replace_pos, replace_pos, new_line, 0, 0 )
+ PostVimMessage( "Add namespace: {0}".format( namespace ) )
+
+
+def SearchInCurrentBuffer( pattern ):
+ return GetIntValue( "search('{0}', 'Wcnb')".format( EscapeForVim( pattern )))
+
+
+def LineTextInCurrentBuffer( line ):
+ return vim.current.buffer[ line ]
+
+
+def ClosePreviewWindow():
+ """ Close the preview window if it is present, otherwise do nothing """
+ vim.command( 'silent! pclose!' )
+
+
+def JumpToPreviewWindow():
+ """ Jump the vim cursor to the preview window, which must be active. Returns
+ boolean indicating if the cursor ended up in the preview window """
+ vim.command( 'silent! wincmd P' )
+ return vim.current.window.options[ 'previewwindow' ]
+
+
+def JumpToPreviousWindow():
+ """ Jump the vim cursor to its previous window position """
+ vim.command( 'silent! wincmd p' )
+
+
+def JumpToTab( tab_number ):
+ """Jump to Vim tab with corresponding number """
+ vim.command( 'silent! tabn {0}'.format( tab_number ) )
+
+
+def OpenFileInPreviewWindow( filename ):
+ """ Open the supplied filename in the preview window """
+ vim.command( 'silent! pedit! ' + filename )
+
+
+def WriteToPreviewWindow( message ):
+ """ Display the supplied message in the preview window """
+
+ # This isn't something that comes naturally to Vim. Vim only wants to show
+ # tags and/or actual files in the preview window, so we have to hack it a
+ # little bit. We generate a temporary file name and "open" that, then write
+ # the data to it. We make sure the buffer can't be edited or saved. Other
+ # approaches include simply opening a split, but we want to take advantage of
+ # the existing Vim options for preview window height, etc.
+
+ ClosePreviewWindow()
+
+ OpenFileInPreviewWindow( vim.eval( 'tempname()' ) )
+
+ if JumpToPreviewWindow():
+ # We actually got to the preview window. By default the preview window can't
+ # be changed, so we make it writable, write to it, then make it read only
+ # again.
+ vim.current.buffer.options[ 'modifiable' ] = True
+ vim.current.buffer.options[ 'readonly' ] = False
+
+ vim.current.buffer[:] = message.splitlines()
+
+ vim.current.buffer.options[ 'buftype' ] = 'nofile'
+ vim.current.buffer.options[ 'swapfile' ] = False
+ vim.current.buffer.options[ 'modifiable' ] = False
+ vim.current.buffer.options[ 'readonly' ] = True
+
+ # We need to prevent closing the window causing a warning about unsaved
+ # file, so we pretend to Vim that the buffer has not been changed.
+ vim.current.buffer.options[ 'modified' ] = False
+
+ JumpToPreviousWindow()
+ else:
+ # We couldn't get to the preview window, but we still want to give the user
+ # the information we have. The only remaining option is to echo to the
+ # status area.
+ EchoText( message )
+
+
+def CheckFilename( filename ):
+ """Check if filename is openable."""
+ try:
+ # We don't want to check for encoding issues when trying to open the file
+ # so we open it in binary mode.
+ open( filename, mode = 'rb' ).close()
+ except TypeError:
+ raise RuntimeError( "'{0}' is not a valid filename".format( filename ) )
+ except IOError as error:
+ raise RuntimeError(
+ "filename '{0}' cannot be opened. {1}.".format( filename,
+ error.strerror ) )
+
+
+def BufferIsVisibleForFilename( filename ):
+ """Check if a buffer exists for a specific file."""
+ buffer_number = GetBufferNumberForFilename( filename, False )
+ return BufferIsVisible( buffer_number )
+
+
+def CloseBuffersForFilename( filename ):
+ """Close all buffers for a specific file."""
+ buffer_number = GetBufferNumberForFilename( filename, False )
+ while buffer_number != -1:
+ vim.command( 'silent! bwipeout! {0}'.format( buffer_number ) )
+ new_buffer_number = GetBufferNumberForFilename( filename, False )
+ if buffer_number == new_buffer_number:
+ raise RuntimeError( "Buffer {0} for filename '{1}' should already be "
+ "wiped out.".format( buffer_number, filename ) )
+ buffer_number = new_buffer_number
+
+
+def OpenFilename( filename, options = {} ):
+ """Open a file in Vim. Following options are available:
+ - command: specify which Vim command is used to open the file. Choices
+ are same-buffer, horizontal-split, vertical-split, and new-tab (default:
+ horizontal-split);
+ - size: set the height of the window for a horizontal split or the width for
+ a vertical one (default: '');
+ - fix: set the winfixheight option for a horizontal split or winfixwidth for
+ a vertical one (default: False). See :h winfix for details;
+ - focus: focus the opened file (default: False);
+ - watch: automatically watch for changes (default: False). This is useful
+ for logs;
+ - position: set the position where the file is opened (default: start).
+ Choices are start and end."""
+
+ # Set the options.
+ command = GetVimCommand( options.get( 'command', 'horizontal-split' ),
+ 'horizontal-split' )
+ size = ( options.get( 'size', '' ) if command in [ 'split', 'vsplit' ] else
+ '' )
+ focus = options.get( 'focus', False )
+
+ # There is no command in Vim to return to the previous tab so we need to
+ # remember the current tab if needed.
+ if not focus and command == 'tabedit':
+ previous_tab = GetIntValue( 'tabpagenr()' )
+ else:
+ previous_tab = None
+
+ # Open the file
+ CheckFilename( filename )
+ try:
+ vim.command( '{0}{1} {2}'.format( size, command, filename ) )
+ # When the file we are trying to jump to has a swap file,
+ # Vim opens swap-exists-choices dialog and throws vim.error with E325 error,
+ # or KeyboardInterrupt after user selects one of the options which actually
+ # opens the file (Open read-only/Edit anyway).
+ except vim.error as e:
+ if 'E325' not in str( e ):
+ raise
+
+ # Otherwise, the user might have chosen Quit. This is detectable by the
+ # current file not being the target file
+ if filename != GetCurrentBufferFilepath():
+ return
+ except KeyboardInterrupt:
+ # Raised when the user selects "Abort" after swap-exists-choices
+ return
+
+ _SetUpLoadedBuffer( command,
+ filename,
+ options.get( 'fix', False ),
+ options.get( 'position', 'start' ),
+ options.get( 'watch', False ) )
+
+ # Vim automatically set the focus to the opened file so we need to get the
+ # focus back (if the focus option is disabled) when opening a new tab or
+ # window.
+ if not focus:
+ if command == 'tabedit':
+ JumpToTab( previous_tab )
+ if command in [ 'split', 'vsplit' ]:
+ JumpToPreviousWindow()
+
+
+def _SetUpLoadedBuffer( command, filename, fix, position, watch ):
+ """After opening a buffer, configure it according to the supplied options,
+ which are as defined by the OpenFilename method."""
+
+ if command == 'split':
+ vim.current.window.options[ 'winfixheight' ] = fix
+ if command == 'vsplit':
+ vim.current.window.options[ 'winfixwidth' ] = fix
+
+ if watch:
+ vim.current.buffer.options[ 'autoread' ] = True
+ vim.command( "exec 'au BufEnter <buffer> :silent! checktime {0}'"
+ .format( filename ) )
+
+ if position == 'end':
+ vim.command( 'silent! normal G zz' )
diff --git a/vim/bundle/YouCompleteMe/python/ycm/youcompleteme.py b/vim/bundle/YouCompleteMe/python/ycm/youcompleteme.py
new file mode 100644
index 0000000..fa4bcf1
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/python/ycm/youcompleteme.py
@@ -0,0 +1,711 @@
+# Copyright (C) 2011, 2012 Google Inc.
+#
+# This file is part of YouCompleteMe.
+#
+# YouCompleteMe is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# YouCompleteMe is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import unicode_literals
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+from future import standard_library
+standard_library.install_aliases()
+from builtins import * # noqa
+
+from future.utils import iteritems
+import os
+import vim
+import json
+import re
+import signal
+import base64
+from subprocess import PIPE
+from tempfile import NamedTemporaryFile
+from ycm import paths, vimsupport
+from ycmd import utils
+from ycmd import server_utils
+from ycmd.request_wrap import RequestWrap
+from ycmd.responses import ServerError
+from ycm.diagnostic_interface import DiagnosticInterface
+from ycm.omni_completer import OmniCompleter
+from ycm import syntax_parse
+from ycm.client.ycmd_keepalive import YcmdKeepalive
+from ycm.client.base_request import BaseRequest, BuildRequestData
+from ycm.client.completer_available_request import SendCompleterAvailableRequest
+from ycm.client.command_request import SendCommandRequest
+from ycm.client.completion_request import ( CompletionRequest,
+ ConvertCompletionDataToVimData )
+from ycm.client.omni_completion_request import OmniCompletionRequest
+from ycm.client.event_notification import ( SendEventNotificationAsync,
+ EventNotification )
+
+try:
+ from UltiSnips import UltiSnips_Manager
+ USE_ULTISNIPS_DATA = True
+except ImportError:
+ USE_ULTISNIPS_DATA = False
+
+
+def PatchNoProxy():
+ current_value = os.environ.get('no_proxy', '')
+ additions = '127.0.0.1,localhost'
+ os.environ['no_proxy'] = ( additions if not current_value
+ else current_value + ',' + additions )
+
+# We need this so that Requests doesn't end up using the local HTTP proxy when
+# talking to ycmd. Users should actually be setting this themselves when
+# configuring a proxy server on their machine, but most don't know they need to
+# or how to do it, so we do it for them.
+# Relevant issues:
+# https://github.com/Valloric/YouCompleteMe/issues/641
+# https://github.com/kennethreitz/requests/issues/879
+PatchNoProxy()
+
+# Force the Python interpreter embedded in Vim (in which we are running) to
+# ignore the SIGINT signal. This helps reduce the fallout of a user pressing
+# Ctrl-C in Vim.
+signal.signal( signal.SIGINT, signal.SIG_IGN )
+
+HMAC_SECRET_LENGTH = 16
+SERVER_SHUTDOWN_MESSAGE = (
+ "The ycmd server SHUT DOWN (restart with ':YcmRestartServer')." )
+STDERR_FILE_MESSAGE = (
+ "Run ':YcmToggleLogs stderr' to check the logs." )
+STDERR_FILE_DELETED_MESSAGE = (
+ "Logfile was deleted; set 'g:ycm_server_keep_logfiles' to see errors "
+ "in the future." )
+CORE_UNEXPECTED_MESSAGE = (
+ 'Unexpected error while loading the YCM core library.' )
+CORE_MISSING_MESSAGE = (
+ 'YCM core library not detected; you need to compile YCM before using it. '
+ 'Follow the instructions in the documentation.' )
+CORE_PYTHON2_MESSAGE = (
+ "YCM core library compiled for Python 2 but loaded in Python 3. "
+ "Set the 'g:ycm_server_python_interpreter' option to a Python 2 "
+ "interpreter path." )
+CORE_PYTHON3_MESSAGE = (
+ "YCM core library compiled for Python 3 but loaded in Python 2. "
+ "Set the 'g:ycm_server_python_interpreter' option to a Python 3 "
+ "interpreter path." )
+CORE_OUTDATED_MESSAGE = (
+ 'YCM core library too old; PLEASE RECOMPILE by running the install.py '
+ 'script. See the documentation for more details.' )
+SERVER_IDLE_SUICIDE_SECONDS = 10800 # 3 hours
+DIAGNOSTIC_UI_FILETYPES = set( [ 'cpp', 'cs', 'c', 'objc', 'objcpp' ] )
+
+
+class YouCompleteMe( object ):
+ def __init__( self, user_options ):
+ self._user_options = user_options
+ self._user_notified_about_crash = False
+ self._diag_interface = DiagnosticInterface( user_options )
+ self._omnicomp = OmniCompleter( user_options )
+ self._latest_file_parse_request = None
+ self._latest_completion_request = None
+ self._latest_diagnostics = []
+ self._server_stdout = None
+ self._server_stderr = None
+ self._server_popen = None
+ self._filetypes_with_keywords_loaded = set()
+ self._ycmd_keepalive = YcmdKeepalive()
+ self._SetupServer()
+ self._ycmd_keepalive.Start()
+ self._complete_done_hooks = {
+ 'cs': lambda self: self._OnCompleteDone_Csharp()
+ }
+
+ def _SetupServer( self ):
+ self._available_completers = {}
+ server_port = utils.GetUnusedLocalhostPort()
+ # The temp options file is deleted by ycmd during startup
+ with NamedTemporaryFile( delete = False, mode = 'w+' ) as options_file:
+ hmac_secret = os.urandom( HMAC_SECRET_LENGTH )
+ options_dict = dict( self._user_options )
+ options_dict[ 'hmac_secret' ] = utils.ToUnicode(
+ base64.b64encode( hmac_secret ) )
+ json.dump( options_dict, options_file )
+ options_file.flush()
+
+ args = [ paths.PathToPythonInterpreter(),
+ paths.PathToServerScript(),
+ '--port={0}'.format( server_port ),
+ '--options_file={0}'.format( options_file.name ),
+ '--log={0}'.format( self._user_options[ 'server_log_level' ] ),
+ '--idle_suicide_seconds={0}'.format(
+ SERVER_IDLE_SUICIDE_SECONDS )]
+
+ filename_format = os.path.join( utils.PathToCreatedTempDir(),
+ 'server_{port}_{std}.log' )
+
+ self._server_stdout = filename_format.format( port = server_port,
+ std = 'stdout' )
+ self._server_stderr = filename_format.format( port = server_port,
+ std = 'stderr' )
+ args.append( '--stdout={0}'.format( self._server_stdout ) )
+ args.append( '--stderr={0}'.format( self._server_stderr ) )
+
+ if self._user_options[ 'server_keep_logfiles' ]:
+ args.append( '--keep_logfiles' )
+
+ self._server_popen = utils.SafePopen( args, stdin_windows = PIPE,
+ stdout = PIPE, stderr = PIPE )
+ BaseRequest.server_location = 'http://127.0.0.1:' + str( server_port )
+ BaseRequest.hmac_secret = hmac_secret
+
+ self._NotifyUserIfServerCrashed()
+
+
+ def IsServerAlive( self ):
+ returncode = self._server_popen.poll()
+ # When the process hasn't finished yet, poll() returns None.
+ return returncode is None
+
+
+ def _NotifyUserIfServerCrashed( self ):
+ if self._user_notified_about_crash or self.IsServerAlive():
+ return
+ self._user_notified_about_crash = True
+
+ try:
+ vimsupport.CheckFilename( self._server_stderr )
+ stderr_message = STDERR_FILE_MESSAGE
+ except RuntimeError:
+ stderr_message = STDERR_FILE_DELETED_MESSAGE
+
+ message = SERVER_SHUTDOWN_MESSAGE
+ return_code = self._server_popen.poll()
+ if return_code == server_utils.CORE_UNEXPECTED_STATUS:
+ message += ' ' + CORE_UNEXPECTED_MESSAGE + ' ' + stderr_message
+ elif return_code == server_utils.CORE_MISSING_STATUS:
+ message += ' ' + CORE_MISSING_MESSAGE
+ elif return_code == server_utils.CORE_PYTHON2_STATUS:
+ message += ' ' + CORE_PYTHON2_MESSAGE
+ elif return_code == server_utils.CORE_PYTHON3_STATUS:
+ message += ' ' + CORE_PYTHON3_MESSAGE
+ elif return_code == server_utils.CORE_OUTDATED_STATUS:
+ message += ' ' + CORE_OUTDATED_MESSAGE
+ else:
+ message += ' ' + stderr_message
+ vimsupport.PostVimMessage( message )
+
+
+ def ServerPid( self ):
+ if not self._server_popen:
+ return -1
+ return self._server_popen.pid
+
+
+ def _ServerCleanup( self ):
+ if self.IsServerAlive():
+ self._server_popen.terminate()
+
+
+ def RestartServer( self ):
+ self._CloseLogs()
+ vimsupport.PostVimMessage( 'Restarting ycmd server...' )
+ self._user_notified_about_crash = False
+ self._ServerCleanup()
+ self._SetupServer()
+
+
+ def CreateCompletionRequest( self, force_semantic = False ):
+ request_data = BuildRequestData()
+ if ( not self.NativeFiletypeCompletionAvailable() and
+ self.CurrentFiletypeCompletionEnabled() ):
+ wrapped_request_data = RequestWrap( request_data )
+ if self._omnicomp.ShouldUseNow( wrapped_request_data ):
+ self._latest_completion_request = OmniCompletionRequest(
+ self._omnicomp, wrapped_request_data )
+ return self._latest_completion_request
+
+ request_data[ 'working_dir' ] = os.getcwd()
+
+ self._AddExtraConfDataIfNeeded( request_data )
+ if force_semantic:
+ request_data[ 'force_semantic' ] = True
+ self._latest_completion_request = CompletionRequest( request_data )
+ return self._latest_completion_request
+
+
+ def SendCommandRequest( self, arguments, completer ):
+ if self.IsServerAlive():
+ return SendCommandRequest( arguments, completer )
+
+
+ def GetDefinedSubcommands( self ):
+ if self.IsServerAlive():
+ try:
+ return BaseRequest.PostDataToHandler( BuildRequestData(),
+ 'defined_subcommands' )
+ except ServerError:
+ return []
+ else:
+ return []
+
+
+ def GetCurrentCompletionRequest( self ):
+ return self._latest_completion_request
+
+
+ def GetOmniCompleter( self ):
+ return self._omnicomp
+
+
+ def FiletypeCompleterExistsForFiletype( self, filetype ):
+ try:
+ return self._available_completers[ filetype ]
+ except KeyError:
+ pass
+
+ if not self.IsServerAlive():
+ return False
+
+ exists_completer = SendCompleterAvailableRequest( filetype )
+ if exists_completer is None:
+ return False
+
+ self._available_completers[ filetype ] = exists_completer
+ return exists_completer
+
+
+ def NativeFiletypeCompletionAvailable( self ):
+ return any( [ self.FiletypeCompleterExistsForFiletype( x ) for x in
+ vimsupport.CurrentFiletypes() ] )
+
+
+ def NativeFiletypeCompletionUsable( self ):
+ return ( self.CurrentFiletypeCompletionEnabled() and
+ self.NativeFiletypeCompletionAvailable() )
+
+
+ def OnFileReadyToParse( self ):
+ if not self.IsServerAlive():
+ self._NotifyUserIfServerCrashed()
+ return
+
+ self._omnicomp.OnFileReadyToParse( None )
+
+ extra_data = {}
+ self._AddTagsFilesIfNeeded( extra_data )
+ self._AddSyntaxDataIfNeeded( extra_data )
+ self._AddExtraConfDataIfNeeded( extra_data )
+
+ self._latest_file_parse_request = EventNotification( 'FileReadyToParse',
+ extra_data )
+ self._latest_file_parse_request.Start()
+
+
+ def OnBufferUnload( self, deleted_buffer_file ):
+ if not self.IsServerAlive():
+ return
+ SendEventNotificationAsync( 'BufferUnload',
+ { 'unloaded_buffer': deleted_buffer_file } )
+
+
+ def OnBufferVisit( self ):
+ if not self.IsServerAlive():
+ return
+ extra_data = {}
+ _AddUltiSnipsDataIfNeeded( extra_data )
+ SendEventNotificationAsync( 'BufferVisit', extra_data )
+
+
+ def OnInsertLeave( self ):
+ if not self.IsServerAlive():
+ return
+ SendEventNotificationAsync( 'InsertLeave' )
+
+
+ def OnCursorMoved( self ):
+ self._diag_interface.OnCursorMoved()
+
+
+ def OnVimLeave( self ):
+ self._ServerCleanup()
+
+
+ def OnCurrentIdentifierFinished( self ):
+ if not self.IsServerAlive():
+ return
+ SendEventNotificationAsync( 'CurrentIdentifierFinished' )
+
+
+ def OnCompleteDone( self ):
+ complete_done_actions = self.GetCompleteDoneHooks()
+ for action in complete_done_actions:
+ action(self)
+
+
+ def GetCompleteDoneHooks( self ):
+ filetypes = vimsupport.CurrentFiletypes()
+ for key, value in iteritems( self._complete_done_hooks ):
+ if key in filetypes:
+ yield value
+
+
+ def GetCompletionsUserMayHaveCompleted( self ):
+ latest_completion_request = self.GetCurrentCompletionRequest()
+ if not latest_completion_request or not latest_completion_request.Done():
+ return []
+
+ completions = latest_completion_request.RawResponse()
+
+ result = self._FilterToMatchingCompletions( completions, True )
+ result = list( result )
+ if result:
+ return result
+
+ if self._HasCompletionsThatCouldBeCompletedWithMoreText( completions ):
+ # Since the way that YCM works leads to CompleteDone called on every
+ # character, return blank if the completion might not be done. This won't
+ # match if the completion is ended with typing a non-keyword character.
+ return []
+
+ result = self._FilterToMatchingCompletions( completions, False )
+
+ return list( result )
+
+
+ def _FilterToMatchingCompletions( self, completions, full_match_only ):
+ self._PatchBasedOnVimVersion()
+ return self._FilterToMatchingCompletions( completions, full_match_only)
+
+
+ def _HasCompletionsThatCouldBeCompletedWithMoreText( self, completions ):
+ self._PatchBasedOnVimVersion()
+ return self._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
+
+
+ def _PatchBasedOnVimVersion( self ):
+ if vimsupport.VimVersionAtLeast( "7.4.774" ):
+ self._HasCompletionsThatCouldBeCompletedWithMoreText = \
+ self._HasCompletionsThatCouldBeCompletedWithMoreText_NewerVim
+ self._FilterToMatchingCompletions = \
+ self._FilterToMatchingCompletions_NewerVim
+ else:
+ self._FilterToMatchingCompletions = \
+ self._FilterToMatchingCompletions_OlderVim
+ self._HasCompletionsThatCouldBeCompletedWithMoreText = \
+ self._HasCompletionsThatCouldBeCompletedWithMoreText_OlderVim
+
+
+ def _FilterToMatchingCompletions_NewerVim( self,
+ completions,
+ full_match_only ):
+ """Filter to completions matching the item Vim said was completed"""
+ completed = vimsupport.GetVariableValue( 'v:completed_item' )
+ for completion in completions:
+ item = ConvertCompletionDataToVimData( completion )
+ match_keys = ( [ "word", "abbr", "menu", "info" ] if full_match_only
+ else [ 'word' ] )
+
+ def matcher( key ):
+ return ( utils.ToUnicode( completed.get( key, "" ) ) ==
+ utils.ToUnicode( item.get( key, "" ) ) )
+
+ if all( [ matcher( i ) for i in match_keys ] ):
+ yield completion
+
+
+ def _FilterToMatchingCompletions_OlderVim( self, completions,
+ full_match_only ):
+ """ Filter to completions matching the buffer text """
+ if full_match_only:
+ return # Only supported in 7.4.774+
+ # No support for multiple line completions
+ text = vimsupport.TextBeforeCursor()
+ for completion in completions:
+ word = completion[ "insertion_text" ]
+ # Trim complete-ending character if needed
+ text = re.sub( r"[^a-zA-Z0-9_]$", "", text )
+ buffer_text = text[ -1 * len( word ) : ]
+ if buffer_text == word:
+ yield completion
+
+
+ def _HasCompletionsThatCouldBeCompletedWithMoreText_NewerVim( self,
+ completions ):
+ completed_item = vimsupport.GetVariableValue( 'v:completed_item' )
+ if not completed_item:
+ return False
+
+ completed_word = utils.ToUnicode( completed_item[ 'word' ] )
+ if not completed_word:
+ return False
+
+ # Sometimes CompleteDone is called after the next character is inserted.
+ # If so, use inserted character to filter possible completions further.
+ text = vimsupport.TextBeforeCursor()
+ reject_exact_match = True
+ if text and text[ -1 ] != completed_word[ -1 ]:
+ reject_exact_match = False
+ completed_word += text[ -1 ]
+
+ for completion in completions:
+ word = utils.ToUnicode(
+ ConvertCompletionDataToVimData( completion )[ 'word' ] )
+ if reject_exact_match and word == completed_word:
+ continue
+ if word.startswith( completed_word ):
+ return True
+ return False
+
+
+ def _HasCompletionsThatCouldBeCompletedWithMoreText_OlderVim( self,
+ completions ):
+ # No support for multiple line completions
+ text = vimsupport.TextBeforeCursor()
+ for completion in completions:
+ word = utils.ToUnicode(
+ ConvertCompletionDataToVimData( completion )[ 'word' ] )
+ for i in range( 1, len( word ) - 1 ): # Excluding full word
+ if text[ -1 * i : ] == word[ : i ]:
+ return True
+ return False
+
+
+ def _OnCompleteDone_Csharp( self ):
+ completions = self.GetCompletionsUserMayHaveCompleted()
+ namespaces = [ self._GetRequiredNamespaceImport( c )
+ for c in completions ]
+ namespaces = [ n for n in namespaces if n ]
+ if not namespaces:
+ return
+
+ if len( namespaces ) > 1:
+ choices = [ "{0} {1}".format( i + 1, n )
+ for i, n in enumerate( namespaces ) ]
+ choice = vimsupport.PresentDialog( "Insert which namespace:", choices )
+ if choice < 0:
+ return
+ namespace = namespaces[ choice ]
+ else:
+ namespace = namespaces[ 0 ]
+
+ vimsupport.InsertNamespace( namespace )
+
+
+ def _GetRequiredNamespaceImport( self, completion ):
+ if ( "extra_data" not in completion
+ or "required_namespace_import" not in completion[ "extra_data" ] ):
+ return None
+ return completion[ "extra_data" ][ "required_namespace_import" ]
+
+
+ def GetErrorCount( self ):
+ return self._diag_interface.GetErrorCount()
+
+
+ def GetWarningCount( self ):
+ return self._diag_interface.GetWarningCount()
+
+
+ def DiagnosticUiSupportedForCurrentFiletype( self ):
+ return any( [ x in DIAGNOSTIC_UI_FILETYPES
+ for x in vimsupport.CurrentFiletypes() ] )
+
+
+ def ShouldDisplayDiagnostics( self ):
+ return bool( self._user_options[ 'show_diagnostics_ui' ] and
+ self.DiagnosticUiSupportedForCurrentFiletype() )
+
+
+ def PopulateLocationListWithLatestDiagnostics( self ):
+ # Do nothing if loc list is already populated by diag_interface
+ if not self._user_options[ 'always_populate_location_list' ]:
+ self._diag_interface.PopulateLocationList( self._latest_diagnostics )
+ return bool( self._latest_diagnostics )
+
+
+ def UpdateDiagnosticInterface( self ):
+ self._diag_interface.UpdateWithNewDiagnostics( self._latest_diagnostics )
+
+
+ def FileParseRequestReady( self, block = False ):
+ return bool( self._latest_file_parse_request and
+ ( block or self._latest_file_parse_request.Done() ) )
+
+
+ def HandleFileParseRequest( self, block = False ):
+ # Order is important here:
+ # FileParseRequestReady has a low cost, while
+ # NativeFiletypeCompletionUsable is a blocking server request
+ if ( self.FileParseRequestReady( block ) and
+ self.NativeFiletypeCompletionUsable() ):
+
+ if self.ShouldDisplayDiagnostics():
+ self._latest_diagnostics = self._latest_file_parse_request.Response()
+ self.UpdateDiagnosticInterface()
+ else:
+ # YCM client has a hard-coded list of filetypes which are known
+ # to support diagnostics, self.DiagnosticUiSupportedForCurrentFiletype()
+ #
+ # For filetypes which don't support diagnostics, we just want to check
+ # the _latest_file_parse_request for any exception or UnknownExtraConf
+ # response, to allow the server to raise configuration warnings, etc.
+ # to the user. We ignore any other supplied data.
+ self._latest_file_parse_request.Response()
+
+ # We set the file parse request to None because we want to prevent
+ # repeated issuing of the same warnings/errors/prompts. Setting this to
+ # None makes FileParseRequestReady return False until the next
+ # request is created.
+ #
+ # Note: it is the server's responsibility to determine the frequency of
+ # error/warning/prompts when receiving a FileReadyToParse event, but
+ # it our responsibility to ensure that we only apply the
+ # warning/error/prompt received once (for each event).
+ self._latest_file_parse_request = None
+
+
+ def ShowDetailedDiagnostic( self ):
+ if not self.IsServerAlive():
+ return
+ try:
+ debug_info = BaseRequest.PostDataToHandler( BuildRequestData(),
+ 'detailed_diagnostic' )
+ if 'message' in debug_info:
+ vimsupport.EchoText( debug_info[ 'message' ] )
+ except ServerError as e:
+ vimsupport.PostVimMessage( str( e ) )
+
+
+ def DebugInfo( self ):
+ if self.IsServerAlive():
+ debug_info = BaseRequest.PostDataToHandler( BuildRequestData(),
+ 'debug_info' )
+ else:
+ debug_info = 'Server crashed, no debug info from server'
+ debug_info += '\nServer running at: {0}'.format(
+ BaseRequest.server_location )
+ debug_info += '\nServer process ID: {0}'.format( self._server_popen.pid )
+ if self._server_stderr or self._server_stdout:
+ debug_info += '\nServer logfiles:\n {0}\n {1}'.format(
+ self._server_stdout,
+ self._server_stderr )
+
+ return debug_info
+
+
+ def _OpenLogs( self, stdout = True, stderr = True ):
+ # Open log files in a horizontal window with the same behavior as the
+ # preview window (same height and winfixheight enabled). Automatically
+ # watch for changes. Set the cursor position at the end of the file.
+ options = {
+ 'size': vimsupport.GetIntValue( '&previewheight' ),
+ 'fix': True,
+ 'watch': True,
+ 'position': 'end'
+ }
+
+ if stdout:
+ vimsupport.OpenFilename( self._server_stdout, options )
+ if stderr:
+ vimsupport.OpenFilename( self._server_stderr, options )
+
+
+ def _CloseLogs( self, stdout = True, stderr = True ):
+ if stdout:
+ vimsupport.CloseBuffersForFilename( self._server_stdout )
+ if stderr:
+ vimsupport.CloseBuffersForFilename( self._server_stderr )
+
+
+ def ToggleLogs( self, stdout = True, stderr = True ):
+ if ( stdout and
+ vimsupport.BufferIsVisibleForFilename( self._server_stdout ) or
+ stderr and
+ vimsupport.BufferIsVisibleForFilename( self._server_stderr ) ):
+ return self._CloseLogs( stdout = stdout, stderr = stderr )
+
+ # Close hidden logfile buffers if any to keep a clean state
+ self._CloseLogs( stdout = stdout, stderr = stderr )
+
+ try:
+ self._OpenLogs( stdout = stdout, stderr = stderr )
+ except RuntimeError as error:
+ vimsupport.PostVimMessage( 'YouCompleteMe encountered an error when '
+ 'opening logs: {0}.'.format( error ) )
+
+
+ def CurrentFiletypeCompletionEnabled( self ):
+ filetypes = vimsupport.CurrentFiletypes()
+ filetype_to_disable = self._user_options[
+ 'filetype_specific_completion_to_disable' ]
+ if '*' in filetype_to_disable:
+ return False
+ else:
+ return not any([ x in filetype_to_disable for x in filetypes ])
+
+
+ def _AddSyntaxDataIfNeeded( self, extra_data ):
+ if not self._user_options[ 'seed_identifiers_with_syntax' ]:
+ return
+ filetype = vimsupport.CurrentFiletypes()[ 0 ]
+ if filetype in self._filetypes_with_keywords_loaded:
+ return
+
+ self._filetypes_with_keywords_loaded.add( filetype )
+ extra_data[ 'syntax_keywords' ] = list(
+ syntax_parse.SyntaxKeywordsForCurrentBuffer() )
+
+
+ def _AddTagsFilesIfNeeded( self, extra_data ):
+ def GetTagFiles():
+ tag_files = vim.eval( 'tagfiles()' )
+ # getcwd() throws an exception when the CWD has been deleted.
+ try:
+ current_working_directory = os.getcwd()
+ except OSError:
+ return []
+ return [ os.path.join( current_working_directory, x ) for x in tag_files ]
+
+ if not self._user_options[ 'collect_identifiers_from_tags_files' ]:
+ return
+ extra_data[ 'tag_files' ] = GetTagFiles()
+
+
+ def _AddExtraConfDataIfNeeded( self, extra_data ):
+ def BuildExtraConfData( extra_conf_vim_data ):
+ return dict( ( expr, vimsupport.VimExpressionToPythonType( expr ) )
+ for expr in extra_conf_vim_data )
+
+ extra_conf_vim_data = self._user_options[ 'extra_conf_vim_data' ]
+ if extra_conf_vim_data:
+ extra_data[ 'extra_conf_data' ] = BuildExtraConfData(
+ extra_conf_vim_data )
+
+
+def _AddUltiSnipsDataIfNeeded( extra_data ):
+ if not USE_ULTISNIPS_DATA:
+ return
+
+ try:
+ # Since UltiSnips may run in a different python interpreter (python 3) than
+ # YCM, UltiSnips_Manager singleton is not necessary the same as the one
+ # used by YCM. In particular, it means that we cannot rely on UltiSnips to
+ # set the current filetypes to the singleton. We need to do it ourself.
+ UltiSnips_Manager.reset_buffer_filetypes()
+ UltiSnips_Manager.add_buffer_filetypes(
+ vimsupport.GetVariableValue( '&filetype' ) )
+ rawsnips = UltiSnips_Manager._snips( '', True )
+ except:
+ return
+
+ # UltiSnips_Manager._snips() returns a class instance where:
+ # class.trigger - name of snippet trigger word ( e.g. defn or testcase )
+ # class.description - description of the snippet
+ extra_data[ 'ultisnips_snippets' ] = [
+ { 'trigger': x.trigger, 'description': x.description } for x in rawsnips
+ ]
diff --git a/vim/bundle/YouCompleteMe/run_tests.py b/vim/bundle/YouCompleteMe/run_tests.py
new file mode 100755
index 0000000..c837b9f
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/run_tests.py
@@ -0,0 +1,81 @@
+#!/usr/bin/env python
+
+import os
+import subprocess
+import os.path as p
+import sys
+
+DIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) )
+DIR_OF_THIRD_PARTY = p.join( DIR_OF_THIS_SCRIPT, 'third_party' )
+DIR_OF_YCMD_THIRD_PARTY = p.join( DIR_OF_THIRD_PARTY, 'ycmd', 'third_party' )
+
+python_path = []
+for folder in os.listdir( DIR_OF_THIRD_PARTY ):
+ python_path.append( p.abspath( p.join( DIR_OF_THIRD_PARTY, folder ) ) )
+for folder in os.listdir( DIR_OF_YCMD_THIRD_PARTY ):
+ # We skip python-future because it needs to be inserted in sys.path AFTER
+ # the standard library imports but we can't do that with PYTHONPATH because
+ # the std lib paths are always appended to PYTHONPATH. We do it correctly in
+ # prod in ycmd/utils.py because we have access to the right sys.path.
+ # So for dev, we rely on python-future being installed correctly with
+ # pip install -r test_requirements.txt
+ #
+ # Pip knows how to install this correctly so that it doesn't matter where in
+ # sys.path the path is.
+ if folder == 'python-future':
+ continue
+ python_path.append( p.abspath( p.join( DIR_OF_YCMD_THIRD_PARTY, folder ) ) )
+if os.environ.get( 'PYTHONPATH' ):
+ python_path.append( os.environ[ 'PYTHONPATH' ] )
+os.environ[ 'PYTHONPATH' ] = os.pathsep.join( python_path )
+
+sys.path.insert( 1, p.abspath( p.join( DIR_OF_YCMD_THIRD_PARTY,
+ 'argparse' ) ) )
+
+import argparse
+
+
+def RunFlake8():
+ print( 'Running flake8' )
+ subprocess.check_call( [
+ 'flake8',
+ p.join( DIR_OF_THIS_SCRIPT, 'python' )
+ ] )
+
+
+def ParseArguments():
+ parser = argparse.ArgumentParser()
+ parser.add_argument( '--skip-build', action = 'store_true',
+ help = 'Do not build ycmd before testing.' )
+ parser.add_argument( '--no-flake8', action = 'store_true',
+ help = 'Do not run flake8' )
+
+ return parser.parse_known_args()
+
+
+def BuildYcmdLibs( args ):
+ if not args.skip_build:
+ subprocess.check_call( [
+ sys.executable,
+ p.join( DIR_OF_THIS_SCRIPT, 'third_party', 'ycmd', 'build.py' )
+ ] )
+
+
+def NoseTests( extra_args ):
+ subprocess.check_call( [
+ 'nosetests',
+ '-v',
+ '-w',
+ p.join( DIR_OF_THIS_SCRIPT, 'python' )
+ ] + extra_args )
+
+
+def Main():
+ ( parsed_args, extra_args ) = ParseArguments()
+ if not parsed_args.no_flake8:
+ RunFlake8()
+ BuildYcmdLibs( parsed_args )
+ NoseTests( extra_args )
+
+if __name__ == "__main__":
+ Main()
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/CHANGES b/vim/bundle/YouCompleteMe/third_party/pythonfutures/CHANGES
new file mode 100755
index 0000000..81df636
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/CHANGES
@@ -0,0 +1,44 @@
+2.1.4
+=====
+
+- Ported the library again from Python 3.2.5 to get the latest bug fixes
+
+
+2.1.3
+=====
+
+- Fixed race condition in wait(return_when=ALL_COMPLETED)
+ (http://bugs.python.org/issue14406) -- thanks Ralf Schmitt
+- Added missing setUp() methods to several test classes
+
+
+2.1.2
+=====
+
+- Fixed installation problem on Python 3.1
+
+
+2.1.1
+=====
+
+- Fixed missing 'concurrent' package declaration in setup.py
+
+
+2.1
+===
+
+- Moved the code from the 'futures' package to 'concurrent.futures' to provide
+ a drop in backport that matches the code in Python 3.2 standard library
+- Deprecated the old 'futures' package
+
+
+2.0
+===
+
+- Changed implementation to match PEP 3148
+
+
+1.0
+===
+
+Initial release.
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/LICENSE b/vim/bundle/YouCompleteMe/third_party/pythonfutures/LICENSE
new file mode 100755
index 0000000..c430db0
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/LICENSE
@@ -0,0 +1,21 @@
+Copyright 2009 Brian Quinlan. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY BRIAN QUINLAN "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+HALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/__init__.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/__init__.py
new file mode 100755
index 0000000..b36383a
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/__init__.py
@@ -0,0 +1,3 @@
+from pkgutil import extend_path
+
+__path__ = extend_path(__path__, __name__)
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/__init__.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/__init__.py
new file mode 100755
index 0000000..b5231f8
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/__init__.py
@@ -0,0 +1,18 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+"""Execute computations asynchronously using threads or processes."""
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+from concurrent.futures._base import (FIRST_COMPLETED,
+ FIRST_EXCEPTION,
+ ALL_COMPLETED,
+ CancelledError,
+ TimeoutError,
+ Future,
+ Executor,
+ wait,
+ as_completed)
+from concurrent.futures.process import ProcessPoolExecutor
+from concurrent.futures.thread import ThreadPoolExecutor
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py
new file mode 100755
index 0000000..8ed69b7
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_base.py
@@ -0,0 +1,574 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+from __future__ import with_statement
+import logging
+import threading
+import time
+
+try:
+ from collections import namedtuple
+except ImportError:
+ from concurrent.futures._compat import namedtuple
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+FIRST_COMPLETED = 'FIRST_COMPLETED'
+FIRST_EXCEPTION = 'FIRST_EXCEPTION'
+ALL_COMPLETED = 'ALL_COMPLETED'
+_AS_COMPLETED = '_AS_COMPLETED'
+
+# Possible future states (for internal use by the futures package).
+PENDING = 'PENDING'
+RUNNING = 'RUNNING'
+# The future was cancelled by the user...
+CANCELLED = 'CANCELLED'
+# ...and _Waiter.add_cancelled() was called by a worker.
+CANCELLED_AND_NOTIFIED = 'CANCELLED_AND_NOTIFIED'
+FINISHED = 'FINISHED'
+
+_FUTURE_STATES = [
+ PENDING,
+ RUNNING,
+ CANCELLED,
+ CANCELLED_AND_NOTIFIED,
+ FINISHED
+]
+
+_STATE_TO_DESCRIPTION_MAP = {
+ PENDING: "pending",
+ RUNNING: "running",
+ CANCELLED: "cancelled",
+ CANCELLED_AND_NOTIFIED: "cancelled",
+ FINISHED: "finished"
+}
+
+# Logger for internal use by the futures package.
+LOGGER = logging.getLogger("concurrent.futures")
+
+class Error(Exception):
+ """Base class for all future-related exceptions."""
+ pass
+
+class CancelledError(Error):
+ """The Future was cancelled."""
+ pass
+
+class TimeoutError(Error):
+ """The operation exceeded the given deadline."""
+ pass
+
+class _Waiter(object):
+ """Provides the event that wait() and as_completed() block on."""
+ def __init__(self):
+ self.event = threading.Event()
+ self.finished_futures = []
+
+ def add_result(self, future):
+ self.finished_futures.append(future)
+
+ def add_exception(self, future):
+ self.finished_futures.append(future)
+
+ def add_cancelled(self, future):
+ self.finished_futures.append(future)
+
+class _AsCompletedWaiter(_Waiter):
+ """Used by as_completed()."""
+
+ def __init__(self):
+ super(_AsCompletedWaiter, self).__init__()
+ self.lock = threading.Lock()
+
+ def add_result(self, future):
+ with self.lock:
+ super(_AsCompletedWaiter, self).add_result(future)
+ self.event.set()
+
+ def add_exception(self, future):
+ with self.lock:
+ super(_AsCompletedWaiter, self).add_exception(future)
+ self.event.set()
+
+ def add_cancelled(self, future):
+ with self.lock:
+ super(_AsCompletedWaiter, self).add_cancelled(future)
+ self.event.set()
+
+class _FirstCompletedWaiter(_Waiter):
+ """Used by wait(return_when=FIRST_COMPLETED)."""
+
+ def add_result(self, future):
+ super(_FirstCompletedWaiter, self).add_result(future)
+ self.event.set()
+
+ def add_exception(self, future):
+ super(_FirstCompletedWaiter, self).add_exception(future)
+ self.event.set()
+
+ def add_cancelled(self, future):
+ super(_FirstCompletedWaiter, self).add_cancelled(future)
+ self.event.set()
+
+class _AllCompletedWaiter(_Waiter):
+ """Used by wait(return_when=FIRST_EXCEPTION and ALL_COMPLETED)."""
+
+ def __init__(self, num_pending_calls, stop_on_exception):
+ self.num_pending_calls = num_pending_calls
+ self.stop_on_exception = stop_on_exception
+ self.lock = threading.Lock()
+ super(_AllCompletedWaiter, self).__init__()
+
+ def _decrement_pending_calls(self):
+ with self.lock:
+ self.num_pending_calls -= 1
+ if not self.num_pending_calls:
+ self.event.set()
+
+ def add_result(self, future):
+ super(_AllCompletedWaiter, self).add_result(future)
+ self._decrement_pending_calls()
+
+ def add_exception(self, future):
+ super(_AllCompletedWaiter, self).add_exception(future)
+ if self.stop_on_exception:
+ self.event.set()
+ else:
+ self._decrement_pending_calls()
+
+ def add_cancelled(self, future):
+ super(_AllCompletedWaiter, self).add_cancelled(future)
+ self._decrement_pending_calls()
+
+class _AcquireFutures(object):
+ """A context manager that does an ordered acquire of Future conditions."""
+
+ def __init__(self, futures):
+ self.futures = sorted(futures, key=id)
+
+ def __enter__(self):
+ for future in self.futures:
+ future._condition.acquire()
+
+ def __exit__(self, *args):
+ for future in self.futures:
+ future._condition.release()
+
+def _create_and_install_waiters(fs, return_when):
+ if return_when == _AS_COMPLETED:
+ waiter = _AsCompletedWaiter()
+ elif return_when == FIRST_COMPLETED:
+ waiter = _FirstCompletedWaiter()
+ else:
+ pending_count = sum(
+ f._state not in [CANCELLED_AND_NOTIFIED, FINISHED] for f in fs)
+
+ if return_when == FIRST_EXCEPTION:
+ waiter = _AllCompletedWaiter(pending_count, stop_on_exception=True)
+ elif return_when == ALL_COMPLETED:
+ waiter = _AllCompletedWaiter(pending_count, stop_on_exception=False)
+ else:
+ raise ValueError("Invalid return condition: %r" % return_when)
+
+ for f in fs:
+ f._waiters.append(waiter)
+
+ return waiter
+
+def as_completed(fs, timeout=None):
+ """An iterator over the given futures that yields each as it completes.
+
+ Args:
+ fs: The sequence of Futures (possibly created by different Executors) to
+ iterate over.
+ timeout: The maximum number of seconds to wait. If None, then there
+ is no limit on the wait time.
+
+ Returns:
+ An iterator that yields the given Futures as they complete (finished or
+ cancelled).
+
+ Raises:
+ TimeoutError: If the entire result iterator could not be generated
+ before the given timeout.
+ """
+ if timeout is not None:
+ end_time = timeout + time.time()
+
+ with _AcquireFutures(fs):
+ finished = set(
+ f for f in fs
+ if f._state in [CANCELLED_AND_NOTIFIED, FINISHED])
+ pending = set(fs) - finished
+ waiter = _create_and_install_waiters(fs, _AS_COMPLETED)
+
+ try:
+ for future in finished:
+ yield future
+
+ while pending:
+ if timeout is None:
+ wait_timeout = None
+ else:
+ wait_timeout = end_time - time.time()
+ if wait_timeout < 0:
+ raise TimeoutError(
+ '%d (of %d) futures unfinished' % (
+ len(pending), len(fs)))
+
+ waiter.event.wait(wait_timeout)
+
+ with waiter.lock:
+ finished = waiter.finished_futures
+ waiter.finished_futures = []
+ waiter.event.clear()
+
+ for future in finished:
+ yield future
+ pending.remove(future)
+
+ finally:
+ for f in fs:
+ f._waiters.remove(waiter)
+
+DoneAndNotDoneFutures = namedtuple(
+ 'DoneAndNotDoneFutures', 'done not_done')
+def wait(fs, timeout=None, return_when=ALL_COMPLETED):
+ """Wait for the futures in the given sequence to complete.
+
+ Args:
+ fs: The sequence of Futures (possibly created by different Executors) to
+ wait upon.
+ timeout: The maximum number of seconds to wait. If None, then there
+ is no limit on the wait time.
+ return_when: Indicates when this function should return. The options
+ are:
+
+ FIRST_COMPLETED - Return when any future finishes or is
+ cancelled.
+ FIRST_EXCEPTION - Return when any future finishes by raising an
+ exception. If no future raises an exception
+ then it is equivalent to ALL_COMPLETED.
+ ALL_COMPLETED - Return when all futures finish or are cancelled.
+
+ Returns:
+ A named 2-tuple of sets. The first set, named 'done', contains the
+ futures that completed (is finished or cancelled) before the wait
+ completed. The second set, named 'not_done', contains uncompleted
+ futures.
+ """
+ with _AcquireFutures(fs):
+ done = set(f for f in fs
+ if f._state in [CANCELLED_AND_NOTIFIED, FINISHED])
+ not_done = set(fs) - done
+
+ if (return_when == FIRST_COMPLETED) and done:
+ return DoneAndNotDoneFutures(done, not_done)
+ elif (return_when == FIRST_EXCEPTION) and done:
+ if any(f for f in done
+ if not f.cancelled() and f.exception() is not None):
+ return DoneAndNotDoneFutures(done, not_done)
+
+ if len(done) == len(fs):
+ return DoneAndNotDoneFutures(done, not_done)
+
+ waiter = _create_and_install_waiters(fs, return_when)
+
+ waiter.event.wait(timeout)
+ for f in fs:
+ f._waiters.remove(waiter)
+
+ done.update(waiter.finished_futures)
+ return DoneAndNotDoneFutures(done, set(fs) - done)
+
+class Future(object):
+ """Represents the result of an asynchronous computation."""
+
+ def __init__(self):
+ """Initializes the future. Should not be called by clients."""
+ self._condition = threading.Condition()
+ self._state = PENDING
+ self._result = None
+ self._exception = None
+ self._waiters = []
+ self._done_callbacks = []
+
+ def _invoke_callbacks(self):
+ for callback in self._done_callbacks:
+ try:
+ callback(self)
+ except Exception:
+ LOGGER.exception('exception calling callback for %r', self)
+
+ def __repr__(self):
+ with self._condition:
+ if self._state == FINISHED:
+ if self._exception:
+ return '<Future at %s state=%s raised %s>' % (
+ hex(id(self)),
+ _STATE_TO_DESCRIPTION_MAP[self._state],
+ self._exception.__class__.__name__)
+ else:
+ return '<Future at %s state=%s returned %s>' % (
+ hex(id(self)),
+ _STATE_TO_DESCRIPTION_MAP[self._state],
+ self._result.__class__.__name__)
+ return '<Future at %s state=%s>' % (
+ hex(id(self)),
+ _STATE_TO_DESCRIPTION_MAP[self._state])
+
+ def cancel(self):
+ """Cancel the future if possible.
+
+ Returns True if the future was cancelled, False otherwise. A future
+ cannot be cancelled if it is running or has already completed.
+ """
+ with self._condition:
+ if self._state in [RUNNING, FINISHED]:
+ return False
+
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ return True
+
+ self._state = CANCELLED
+ self._condition.notify_all()
+
+ self._invoke_callbacks()
+ return True
+
+ def cancelled(self):
+ """Return True if the future has cancelled."""
+ with self._condition:
+ return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]
+
+ def running(self):
+ """Return True if the future is currently executing."""
+ with self._condition:
+ return self._state == RUNNING
+
+ def done(self):
+ """Return True of the future was cancelled or finished executing."""
+ with self._condition:
+ return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]
+
+ def __get_result(self):
+ if self._exception:
+ raise self._exception
+ else:
+ return self._result
+
+ def add_done_callback(self, fn):
+ """Attaches a callable that will be called when the future finishes.
+
+ Args:
+ fn: A callable that will be called with this future as its only
+ argument when the future completes or is cancelled. The callable
+ will always be called by a thread in the same process in which
+ it was added. If the future has already completed or been
+ cancelled then the callable will be called immediately. These
+ callables are called in the order that they were added.
+ """
+ with self._condition:
+ if self._state not in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]:
+ self._done_callbacks.append(fn)
+ return
+ fn(self)
+
+ def result(self, timeout=None):
+ """Return the result of the call that the future represents.
+
+ Args:
+ timeout: The number of seconds to wait for the result if the future
+ isn't done. If None, then there is no limit on the wait time.
+
+ Returns:
+ The result of the call that the future represents.
+
+ Raises:
+ CancelledError: If the future was cancelled.
+ TimeoutError: If the future didn't finish executing before the given
+ timeout.
+ Exception: If the call raised then that exception will be raised.
+ """
+ with self._condition:
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ raise CancelledError()
+ elif self._state == FINISHED:
+ return self.__get_result()
+
+ self._condition.wait(timeout)
+
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ raise CancelledError()
+ elif self._state == FINISHED:
+ return self.__get_result()
+ else:
+ raise TimeoutError()
+
+ def exception(self, timeout=None):
+ """Return the exception raised by the call that the future represents.
+
+ Args:
+ timeout: The number of seconds to wait for the exception if the
+ future isn't done. If None, then there is no limit on the wait
+ time.
+
+ Returns:
+ The exception raised by the call that the future represents or None
+ if the call completed without raising.
+
+ Raises:
+ CancelledError: If the future was cancelled.
+ TimeoutError: If the future didn't finish executing before the given
+ timeout.
+ """
+
+ with self._condition:
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ raise CancelledError()
+ elif self._state == FINISHED:
+ return self._exception
+
+ self._condition.wait(timeout)
+
+ if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
+ raise CancelledError()
+ elif self._state == FINISHED:
+ return self._exception
+ else:
+ raise TimeoutError()
+
+ # The following methods should only be used by Executors and in tests.
+ def set_running_or_notify_cancel(self):
+ """Mark the future as running or process any cancel notifications.
+
+ Should only be used by Executor implementations and unit tests.
+
+ If the future has been cancelled (cancel() was called and returned
+ True) then any threads waiting on the future completing (though calls
+ to as_completed() or wait()) are notified and False is returned.
+
+ If the future was not cancelled then it is put in the running state
+ (future calls to running() will return True) and True is returned.
+
+ This method should be called by Executor implementations before
+ executing the work associated with this future. If this method returns
+ False then the work should not be executed.
+
+ Returns:
+ False if the Future was cancelled, True otherwise.
+
+ Raises:
+ RuntimeError: if this method was already called or if set_result()
+ or set_exception() was called.
+ """
+ with self._condition:
+ if self._state == CANCELLED:
+ self._state = CANCELLED_AND_NOTIFIED
+ for waiter in self._waiters:
+ waiter.add_cancelled(self)
+ # self._condition.notify_all() is not necessary because
+ # self.cancel() triggers a notification.
+ return False
+ elif self._state == PENDING:
+ self._state = RUNNING
+ return True
+ else:
+ LOGGER.critical('Future %s in unexpected state: %s',
+ id(self.future),
+ self.future._state)
+ raise RuntimeError('Future in unexpected state')
+
+ def set_result(self, result):
+ """Sets the return value of work associated with the future.
+
+ Should only be used by Executor implementations and unit tests.
+ """
+ with self._condition:
+ self._result = result
+ self._state = FINISHED
+ for waiter in self._waiters:
+ waiter.add_result(self)
+ self._condition.notify_all()
+ self._invoke_callbacks()
+
+ def set_exception(self, exception):
+ """Sets the result of the future as being the given exception.
+
+ Should only be used by Executor implementations and unit tests.
+ """
+ with self._condition:
+ self._exception = exception
+ self._state = FINISHED
+ for waiter in self._waiters:
+ waiter.add_exception(self)
+ self._condition.notify_all()
+ self._invoke_callbacks()
+
+class Executor(object):
+ """This is an abstract base class for concrete asynchronous executors."""
+
+ def submit(self, fn, *args, **kwargs):
+ """Submits a callable to be executed with the given arguments.
+
+ Schedules the callable to be executed as fn(*args, **kwargs) and returns
+ a Future instance representing the execution of the callable.
+
+ Returns:
+ A Future representing the given call.
+ """
+ raise NotImplementedError()
+
+ def map(self, fn, *iterables, **kwargs):
+ """Returns a iterator equivalent to map(fn, iter).
+
+ Args:
+ fn: A callable that will take as many arguments as there are
+ passed iterables.
+ timeout: The maximum number of seconds to wait. If None, then there
+ is no limit on the wait time.
+
+ Returns:
+ An iterator equivalent to: map(func, *iterables) but the calls may
+ be evaluated out-of-order.
+
+ Raises:
+ TimeoutError: If the entire result iterator could not be generated
+ before the given timeout.
+ Exception: If fn(*args) raises for any values.
+ """
+ timeout = kwargs.get('timeout')
+ if timeout is not None:
+ end_time = timeout + time.time()
+
+ fs = [self.submit(fn, *args) for args in zip(*iterables)]
+
+ try:
+ for future in fs:
+ if timeout is None:
+ yield future.result()
+ else:
+ yield future.result(end_time - time.time())
+ finally:
+ for future in fs:
+ future.cancel()
+
+ def shutdown(self, wait=True):
+ """Clean-up the resources associated with the Executor.
+
+ It is safe to call this method several times. Otherwise, no other
+ methods can be called after this one.
+
+ Args:
+ wait: If True then shutdown will not return until all running
+ futures have finished executing and the resources used by the
+ executor have been reclaimed.
+ """
+ pass
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ self.shutdown(wait=True)
+ return False
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_compat.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_compat.py
new file mode 100755
index 0000000..1146232
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/_compat.py
@@ -0,0 +1,101 @@
+from keyword import iskeyword as _iskeyword
+from operator import itemgetter as _itemgetter
+import sys as _sys
+
+
+def namedtuple(typename, field_names):
+ """Returns a new subclass of tuple with named fields.
+
+ >>> Point = namedtuple('Point', 'x y')
+ >>> Point.__doc__ # docstring for the new class
+ 'Point(x, y)'
+ >>> p = Point(11, y=22) # instantiate with positional args or keywords
+ >>> p[0] + p[1] # indexable like a plain tuple
+ 33
+ >>> x, y = p # unpack like a regular tuple
+ >>> x, y
+ (11, 22)
+ >>> p.x + p.y # fields also accessable by name
+ 33
+ >>> d = p._asdict() # convert to a dictionary
+ >>> d['x']
+ 11
+ >>> Point(**d) # convert from a dictionary
+ Point(x=11, y=22)
+ >>> p._replace(x=100) # _replace() is like str.replace() but targets named fields
+ Point(x=100, y=22)
+
+ """
+
+ # Parse and validate the field names. Validation serves two purposes,
+ # generating informative error messages and preventing template injection attacks.
+ if isinstance(field_names, basestring):
+ field_names = field_names.replace(',', ' ').split() # names separated by whitespace and/or commas
+ field_names = tuple(map(str, field_names))
+ for name in (typename,) + field_names:
+ if not all(c.isalnum() or c=='_' for c in name):
+ raise ValueError('Type names and field names can only contain alphanumeric characters and underscores: %r' % name)
+ if _iskeyword(name):
+ raise ValueError('Type names and field names cannot be a keyword: %r' % name)
+ if name[0].isdigit():
+ raise ValueError('Type names and field names cannot start with a number: %r' % name)
+ seen_names = set()
+ for name in field_names:
+ if name.startswith('_'):
+ raise ValueError('Field names cannot start with an underscore: %r' % name)
+ if name in seen_names:
+ raise ValueError('Encountered duplicate field name: %r' % name)
+ seen_names.add(name)
+
+ # Create and fill-in the class template
+ numfields = len(field_names)
+ argtxt = repr(field_names).replace("'", "")[1:-1] # tuple repr without parens or quotes
+ reprtxt = ', '.join('%s=%%r' % name for name in field_names)
+ dicttxt = ', '.join('%r: t[%d]' % (name, pos) for pos, name in enumerate(field_names))
+ template = '''class %(typename)s(tuple):
+ '%(typename)s(%(argtxt)s)' \n
+ __slots__ = () \n
+ _fields = %(field_names)r \n
+ def __new__(_cls, %(argtxt)s):
+ return _tuple.__new__(_cls, (%(argtxt)s)) \n
+ @classmethod
+ def _make(cls, iterable, new=tuple.__new__, len=len):
+ 'Make a new %(typename)s object from a sequence or iterable'
+ result = new(cls, iterable)
+ if len(result) != %(numfields)d:
+ raise TypeError('Expected %(numfields)d arguments, got %%d' %% len(result))
+ return result \n
+ def __repr__(self):
+ return '%(typename)s(%(reprtxt)s)' %% self \n
+ def _asdict(t):
+ 'Return a new dict which maps field names to their values'
+ return {%(dicttxt)s} \n
+ def _replace(_self, **kwds):
+ 'Return a new %(typename)s object replacing specified fields with new values'
+ result = _self._make(map(kwds.pop, %(field_names)r, _self))
+ if kwds:
+ raise ValueError('Got unexpected field names: %%r' %% kwds.keys())
+ return result \n
+ def __getnewargs__(self):
+ return tuple(self) \n\n''' % locals()
+ for i, name in enumerate(field_names):
+ template += ' %s = _property(_itemgetter(%d))\n' % (name, i)
+
+ # Execute the template string in a temporary namespace and
+ # support tracing utilities by setting a value for frame.f_globals['__name__']
+ namespace = dict(_itemgetter=_itemgetter, __name__='namedtuple_%s' % typename,
+ _property=property, _tuple=tuple)
+ try:
+ exec(template, namespace)
+ except SyntaxError:
+ e = _sys.exc_info()[1]
+ raise SyntaxError(e.message + ':\n' + template)
+ result = namespace[typename]
+
+ # For pickling to work, the __module__ variable needs to be set to the frame
+ # where the named tuple is created. Bypass this step in enviroments where
+ # sys._getframe is not defined (Jython for example).
+ if hasattr(_sys, '_getframe'):
+ result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__')
+
+ return result
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/process.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/process.py
new file mode 100755
index 0000000..98684f8
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/process.py
@@ -0,0 +1,363 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+"""Implements ProcessPoolExecutor.
+
+The follow diagram and text describe the data-flow through the system:
+
+|======================= In-process =====================|== Out-of-process ==|
+
++----------+ +----------+ +--------+ +-----------+ +---------+
+| | => | Work Ids | => | | => | Call Q | => | |
+| | +----------+ | | +-----------+ | |
+| | | ... | | | | ... | | |
+| | | 6 | | | | 5, call() | | |
+| | | 7 | | | | ... | | |
+| Process | | ... | | Local | +-----------+ | Process |
+| Pool | +----------+ | Worker | | #1..n |
+| Executor | | Thread | | |
+| | +----------- + | | +-----------+ | |
+| | <=> | Work Items | <=> | | <= | Result Q | <= | |
+| | +------------+ | | +-----------+ | |
+| | | 6: call() | | | | ... | | |
+| | | future | | | | 4, result | | |
+| | | ... | | | | 3, except | | |
++----------+ +------------+ +--------+ +-----------+ +---------+
+
+Executor.submit() called:
+- creates a uniquely numbered _WorkItem and adds it to the "Work Items" dict
+- adds the id of the _WorkItem to the "Work Ids" queue
+
+Local worker thread:
+- reads work ids from the "Work Ids" queue and looks up the corresponding
+ WorkItem from the "Work Items" dict: if the work item has been cancelled then
+ it is simply removed from the dict, otherwise it is repackaged as a
+ _CallItem and put in the "Call Q". New _CallItems are put in the "Call Q"
+ until "Call Q" is full. NOTE: the size of the "Call Q" is kept small because
+ calls placed in the "Call Q" can no longer be cancelled with Future.cancel().
+- reads _ResultItems from "Result Q", updates the future stored in the
+ "Work Items" dict and deletes the dict entry
+
+Process #1..n:
+- reads _CallItems from "Call Q", executes the calls, and puts the resulting
+ _ResultItems in "Request Q"
+"""
+
+from __future__ import with_statement
+import atexit
+import multiprocessing
+import threading
+import weakref
+import sys
+
+from concurrent.futures import _base
+
+try:
+ import queue
+except ImportError:
+ import Queue as queue
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+# Workers are created as daemon threads and processes. This is done to allow the
+# interpreter to exit when there are still idle processes in a
+# ProcessPoolExecutor's process pool (i.e. shutdown() was not called). However,
+# allowing workers to die with the interpreter has two undesirable properties:
+# - The workers would still be running during interpretor shutdown,
+# meaning that they would fail in unpredictable ways.
+# - The workers could be killed while evaluating a work item, which could
+# be bad if the callable being evaluated has external side-effects e.g.
+# writing to a file.
+#
+# To work around this problem, an exit handler is installed which tells the
+# workers to exit when their work queues are empty and then waits until the
+# threads/processes finish.
+
+_threads_queues = weakref.WeakKeyDictionary()
+_shutdown = False
+
+def _python_exit():
+ global _shutdown
+ _shutdown = True
+ items = list(_threads_queues.items())
+ for t, q in items:
+ q.put(None)
+ for t, q in items:
+ t.join()
+
+# Controls how many more calls than processes will be queued in the call queue.
+# A smaller number will mean that processes spend more time idle waiting for
+# work while a larger number will make Future.cancel() succeed less frequently
+# (Futures in the call queue cannot be cancelled).
+EXTRA_QUEUED_CALLS = 1
+
+class _WorkItem(object):
+ def __init__(self, future, fn, args, kwargs):
+ self.future = future
+ self.fn = fn
+ self.args = args
+ self.kwargs = kwargs
+
+class _ResultItem(object):
+ def __init__(self, work_id, exception=None, result=None):
+ self.work_id = work_id
+ self.exception = exception
+ self.result = result
+
+class _CallItem(object):
+ def __init__(self, work_id, fn, args, kwargs):
+ self.work_id = work_id
+ self.fn = fn
+ self.args = args
+ self.kwargs = kwargs
+
+def _process_worker(call_queue, result_queue):
+ """Evaluates calls from call_queue and places the results in result_queue.
+
+ This worker is run in a separate process.
+
+ Args:
+ call_queue: A multiprocessing.Queue of _CallItems that will be read and
+ evaluated by the worker.
+ result_queue: A multiprocessing.Queue of _ResultItems that will written
+ to by the worker.
+ shutdown: A multiprocessing.Event that will be set as a signal to the
+ worker that it should exit when call_queue is empty.
+ """
+ while True:
+ call_item = call_queue.get(block=True)
+ if call_item is None:
+ # Wake up queue management thread
+ result_queue.put(None)
+ return
+ try:
+ r = call_item.fn(*call_item.args, **call_item.kwargs)
+ except BaseException:
+ e = sys.exc_info()[1]
+ result_queue.put(_ResultItem(call_item.work_id,
+ exception=e))
+ else:
+ result_queue.put(_ResultItem(call_item.work_id,
+ result=r))
+
+def _add_call_item_to_queue(pending_work_items,
+ work_ids,
+ call_queue):
+ """Fills call_queue with _WorkItems from pending_work_items.
+
+ This function never blocks.
+
+ Args:
+ pending_work_items: A dict mapping work ids to _WorkItems e.g.
+ {5: <_WorkItem...>, 6: <_WorkItem...>, ...}
+ work_ids: A queue.Queue of work ids e.g. Queue([5, 6, ...]). Work ids
+ are consumed and the corresponding _WorkItems from
+ pending_work_items are transformed into _CallItems and put in
+ call_queue.
+ call_queue: A multiprocessing.Queue that will be filled with _CallItems
+ derived from _WorkItems.
+ """
+ while True:
+ if call_queue.full():
+ return
+ try:
+ work_id = work_ids.get(block=False)
+ except queue.Empty:
+ return
+ else:
+ work_item = pending_work_items[work_id]
+
+ if work_item.future.set_running_or_notify_cancel():
+ call_queue.put(_CallItem(work_id,
+ work_item.fn,
+ work_item.args,
+ work_item.kwargs),
+ block=True)
+ else:
+ del pending_work_items[work_id]
+ continue
+
+def _queue_management_worker(executor_reference,
+ processes,
+ pending_work_items,
+ work_ids_queue,
+ call_queue,
+ result_queue):
+ """Manages the communication between this process and the worker processes.
+
+ This function is run in a local thread.
+
+ Args:
+ executor_reference: A weakref.ref to the ProcessPoolExecutor that owns
+ this thread. Used to determine if the ProcessPoolExecutor has been
+ garbage collected and that this function can exit.
+ process: A list of the multiprocessing.Process instances used as
+ workers.
+ pending_work_items: A dict mapping work ids to _WorkItems e.g.
+ {5: <_WorkItem...>, 6: <_WorkItem...>, ...}
+ work_ids_queue: A queue.Queue of work ids e.g. Queue([5, 6, ...]).
+ call_queue: A multiprocessing.Queue that will be filled with _CallItems
+ derived from _WorkItems for processing by the process workers.
+ result_queue: A multiprocessing.Queue of _ResultItems generated by the
+ process workers.
+ """
+ nb_shutdown_processes = [0]
+ def shutdown_one_process():
+ """Tell a worker to terminate, which will in turn wake us again"""
+ call_queue.put(None)
+ nb_shutdown_processes[0] += 1
+ while True:
+ _add_call_item_to_queue(pending_work_items,
+ work_ids_queue,
+ call_queue)
+
+ result_item = result_queue.get(block=True)
+ if result_item is not None:
+ work_item = pending_work_items[result_item.work_id]
+ del pending_work_items[result_item.work_id]
+
+ if result_item.exception:
+ work_item.future.set_exception(result_item.exception)
+ else:
+ work_item.future.set_result(result_item.result)
+ # Check whether we should start shutting down.
+ executor = executor_reference()
+ # No more work items can be added if:
+ # - The interpreter is shutting down OR
+ # - The executor that owns this worker has been collected OR
+ # - The executor that owns this worker has been shutdown.
+ if _shutdown or executor is None or executor._shutdown_thread:
+ # Since no new work items can be added, it is safe to shutdown
+ # this thread if there are no pending work items.
+ if not pending_work_items:
+ while nb_shutdown_processes[0] < len(processes):
+ shutdown_one_process()
+ # If .join() is not called on the created processes then
+ # some multiprocessing.Queue methods may deadlock on Mac OS
+ # X.
+ for p in processes:
+ p.join()
+ call_queue.close()
+ return
+ del executor
+
+_system_limits_checked = False
+_system_limited = None
+def _check_system_limits():
+ global _system_limits_checked, _system_limited
+ if _system_limits_checked:
+ if _system_limited:
+ raise NotImplementedError(_system_limited)
+ _system_limits_checked = True
+ try:
+ import os
+ nsems_max = os.sysconf("SC_SEM_NSEMS_MAX")
+ except (AttributeError, ValueError):
+ # sysconf not available or setting not available
+ return
+ if nsems_max == -1:
+ # indetermine limit, assume that limit is determined
+ # by available memory only
+ return
+ if nsems_max >= 256:
+ # minimum number of semaphores available
+ # according to POSIX
+ return
+ _system_limited = "system provides too few semaphores (%d available, 256 necessary)" % nsems_max
+ raise NotImplementedError(_system_limited)
+
+class ProcessPoolExecutor(_base.Executor):
+ def __init__(self, max_workers=None):
+ """Initializes a new ProcessPoolExecutor instance.
+
+ Args:
+ max_workers: The maximum number of processes that can be used to
+ execute the given calls. If None or not given then as many
+ worker processes will be created as the machine has processors.
+ """
+ _check_system_limits()
+
+ if max_workers is None:
+ self._max_workers = multiprocessing.cpu_count()
+ else:
+ self._max_workers = max_workers
+
+ # Make the call queue slightly larger than the number of processes to
+ # prevent the worker processes from idling. But don't make it too big
+ # because futures in the call queue cannot be cancelled.
+ self._call_queue = multiprocessing.Queue(self._max_workers +
+ EXTRA_QUEUED_CALLS)
+ self._result_queue = multiprocessing.Queue()
+ self._work_ids = queue.Queue()
+ self._queue_management_thread = None
+ self._processes = set()
+
+ # Shutdown is a two-step process.
+ self._shutdown_thread = False
+ self._shutdown_lock = threading.Lock()
+ self._queue_count = 0
+ self._pending_work_items = {}
+
+ def _start_queue_management_thread(self):
+ # When the executor gets lost, the weakref callback will wake up
+ # the queue management thread.
+ def weakref_cb(_, q=self._result_queue):
+ q.put(None)
+ if self._queue_management_thread is None:
+ self._queue_management_thread = threading.Thread(
+ target=_queue_management_worker,
+ args=(weakref.ref(self, weakref_cb),
+ self._processes,
+ self._pending_work_items,
+ self._work_ids,
+ self._call_queue,
+ self._result_queue))
+ self._queue_management_thread.daemon = True
+ self._queue_management_thread.start()
+ _threads_queues[self._queue_management_thread] = self._result_queue
+
+ def _adjust_process_count(self):
+ for _ in range(len(self._processes), self._max_workers):
+ p = multiprocessing.Process(
+ target=_process_worker,
+ args=(self._call_queue,
+ self._result_queue))
+ p.start()
+ self._processes.add(p)
+
+ def submit(self, fn, *args, **kwargs):
+ with self._shutdown_lock:
+ if self._shutdown_thread:
+ raise RuntimeError('cannot schedule new futures after shutdown')
+
+ f = _base.Future()
+ w = _WorkItem(f, fn, args, kwargs)
+
+ self._pending_work_items[self._queue_count] = w
+ self._work_ids.put(self._queue_count)
+ self._queue_count += 1
+ # Wake up queue management thread
+ self._result_queue.put(None)
+
+ self._start_queue_management_thread()
+ self._adjust_process_count()
+ return f
+ submit.__doc__ = _base.Executor.submit.__doc__
+
+ def shutdown(self, wait=True):
+ with self._shutdown_lock:
+ self._shutdown_thread = True
+ if self._queue_management_thread:
+ # Wake up queue management thread
+ self._result_queue.put(None)
+ if wait:
+ self._queue_management_thread.join()
+ # To reduce the risk of openning too many files, remove references to
+ # objects that use file descriptors.
+ self._queue_management_thread = None
+ self._call_queue = None
+ self._result_queue = None
+ self._processes = None
+ shutdown.__doc__ = _base.Executor.shutdown.__doc__
+
+atexit.register(_python_exit)
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/thread.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/thread.py
new file mode 100755
index 0000000..a45959d
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/concurrent/futures/thread.py
@@ -0,0 +1,138 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+"""Implements ThreadPoolExecutor."""
+
+from __future__ import with_statement
+import atexit
+import threading
+import weakref
+import sys
+
+from concurrent.futures import _base
+
+try:
+ import queue
+except ImportError:
+ import Queue as queue
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+# Workers are created as daemon threads. This is done to allow the interpreter
+# to exit when there are still idle threads in a ThreadPoolExecutor's thread
+# pool (i.e. shutdown() was not called). However, allowing workers to die with
+# the interpreter has two undesirable properties:
+# - The workers would still be running during interpretor shutdown,
+# meaning that they would fail in unpredictable ways.
+# - The workers could be killed while evaluating a work item, which could
+# be bad if the callable being evaluated has external side-effects e.g.
+# writing to a file.
+#
+# To work around this problem, an exit handler is installed which tells the
+# workers to exit when their work queues are empty and then waits until the
+# threads finish.
+
+_threads_queues = weakref.WeakKeyDictionary()
+_shutdown = False
+
+def _python_exit():
+ global _shutdown
+ _shutdown = True
+ items = list(_threads_queues.items())
+ for t, q in items:
+ q.put(None)
+ for t, q in items:
+ t.join()
+
+atexit.register(_python_exit)
+
+class _WorkItem(object):
+ def __init__(self, future, fn, args, kwargs):
+ self.future = future
+ self.fn = fn
+ self.args = args
+ self.kwargs = kwargs
+
+ def run(self):
+ if not self.future.set_running_or_notify_cancel():
+ return
+
+ try:
+ result = self.fn(*self.args, **self.kwargs)
+ except BaseException:
+ e = sys.exc_info()[1]
+ self.future.set_exception(e)
+ else:
+ self.future.set_result(result)
+
+def _worker(executor_reference, work_queue):
+ try:
+ while True:
+ work_item = work_queue.get(block=True)
+ if work_item is not None:
+ work_item.run()
+ continue
+ executor = executor_reference()
+ # Exit if:
+ # - The interpreter is shutting down OR
+ # - The executor that owns the worker has been collected OR
+ # - The executor that owns the worker has been shutdown.
+ if _shutdown or executor is None or executor._shutdown:
+ # Notice other workers
+ work_queue.put(None)
+ return
+ del executor
+ except BaseException:
+ _base.LOGGER.critical('Exception in worker', exc_info=True)
+
+class ThreadPoolExecutor(_base.Executor):
+ def __init__(self, max_workers):
+ """Initializes a new ThreadPoolExecutor instance.
+
+ Args:
+ max_workers: The maximum number of threads that can be used to
+ execute the given calls.
+ """
+ self._max_workers = max_workers
+ self._work_queue = queue.Queue()
+ self._threads = set()
+ self._shutdown = False
+ self._shutdown_lock = threading.Lock()
+
+ def submit(self, fn, *args, **kwargs):
+ with self._shutdown_lock:
+ if self._shutdown:
+ raise RuntimeError('cannot schedule new futures after shutdown')
+
+ f = _base.Future()
+ w = _WorkItem(f, fn, args, kwargs)
+
+ self._work_queue.put(w)
+ self._adjust_thread_count()
+ return f
+ submit.__doc__ = _base.Executor.submit.__doc__
+
+ def _adjust_thread_count(self):
+ # When the executor gets lost, the weakref callback will wake up
+ # the worker threads.
+ def weakref_cb(_, q=self._work_queue):
+ q.put(None)
+ # TODO(bquinlan): Should avoid creating new threads if there are more
+ # idle threads than items in the work queue.
+ if len(self._threads) < self._max_workers:
+ t = threading.Thread(target=_worker,
+ args=(weakref.ref(self, weakref_cb),
+ self._work_queue))
+ t.daemon = True
+ t.start()
+ self._threads.add(t)
+ _threads_queues[t] = self._work_queue
+
+ def shutdown(self, wait=True):
+ with self._shutdown_lock:
+ self._shutdown = True
+ self._work_queue.put(None)
+ if wait:
+ for t in self._threads:
+ t.join()
+ shutdown.__doc__ = _base.Executor.shutdown.__doc__
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/crawl.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/crawl.py
new file mode 100755
index 0000000..86e0af7
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/crawl.py
@@ -0,0 +1,74 @@
+"""Compare the speed of downloading URLs sequentially vs. using futures."""
+
+import functools
+import time
+import timeit
+import sys
+
+try:
+ from urllib2 import urlopen
+except ImportError:
+ from urllib.request import urlopen
+
+from concurrent.futures import (as_completed, ThreadPoolExecutor,
+ ProcessPoolExecutor)
+
+URLS = ['http://www.google.com/',
+ 'http://www.apple.com/',
+ 'http://www.ibm.com',
+ 'http://www.thisurlprobablydoesnotexist.com',
+ 'http://www.slashdot.org/',
+ 'http://www.python.org/',
+ 'http://www.bing.com/',
+ 'http://www.facebook.com/',
+ 'http://www.yahoo.com/',
+ 'http://www.youtube.com/',
+ 'http://www.blogger.com/']
+
+def load_url(url, timeout):
+ kwargs = {'timeout': timeout} if sys.version_info >= (2, 6) else {}
+ return urlopen(url, **kwargs).read()
+
+def download_urls_sequential(urls, timeout=60):
+ url_to_content = {}
+ for url in urls:
+ try:
+ url_to_content[url] = load_url(url, timeout=timeout)
+ except:
+ pass
+ return url_to_content
+
+def download_urls_with_executor(urls, executor, timeout=60):
+ try:
+ url_to_content = {}
+ future_to_url = dict((executor.submit(load_url, url, timeout), url)
+ for url in urls)
+
+ for future in as_completed(future_to_url):
+ try:
+ url_to_content[future_to_url[future]] = future.result()
+ except:
+ pass
+ return url_to_content
+ finally:
+ executor.shutdown()
+
+def main():
+ for name, fn in [('sequential',
+ functools.partial(download_urls_sequential, URLS)),
+ ('processes',
+ functools.partial(download_urls_with_executor,
+ URLS,
+ ProcessPoolExecutor(10))),
+ ('threads',
+ functools.partial(download_urls_with_executor,
+ URLS,
+ ThreadPoolExecutor(10)))]:
+ sys.stdout.write('%s: ' % name.ljust(12))
+ start = time.time()
+ url_map = fn()
+ sys.stdout.write('%.2f seconds (%d of %d downloaded)\n' %
+ (time.time() - start, len(url_map), len(URLS)))
+
+if __name__ == '__main__':
+ main()
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/docs/conf.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/docs/conf.py
new file mode 100755
index 0000000..124cd51
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/docs/conf.py
@@ -0,0 +1,194 @@
+# -*- coding: utf-8 -*-
+#
+# futures documentation build configuration file, created by
+# sphinx-quickstart on Wed Jun 3 19:35:34 2009.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.append(os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = []
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'futures'
+copyright = u'2009-2011, Brian Quinlan'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '2.1.3'
+# The full version, including alpha/beta/rc tags.
+release = '2.1.3'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directory, that shouldn't be searched
+# for source files.
+exclude_trees = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. Major themes that come with
+# Sphinx are currently 'default' and 'sphinxdoc'.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'futuresdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'futures.tex', u'futures Documentation',
+ u'Brian Quinlan', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/docs/index.rst b/vim/bundle/YouCompleteMe/third_party/pythonfutures/docs/index.rst
new file mode 100755
index 0000000..525ce6a
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/docs/index.rst
@@ -0,0 +1,345 @@
+:mod:`concurrent.futures` --- Asynchronous computation
+======================================================
+
+.. module:: concurrent.futures
+ :synopsis: Execute computations asynchronously using threads or processes.
+
+The :mod:`concurrent.futures` module provides a high-level interface for
+asynchronously executing callables.
+
+The asynchronous execution can be be performed by threads using
+:class:`ThreadPoolExecutor` or seperate processes using
+:class:`ProcessPoolExecutor`. Both implement the same interface, which is
+defined by the abstract :class:`Executor` class.
+
+Executor Objects
+----------------
+
+:class:`Executor` is an abstract class that provides methods to execute calls
+asynchronously. It should not be used directly, but through its two
+subclasses: :class:`ThreadPoolExecutor` and :class:`ProcessPoolExecutor`.
+
+.. method:: Executor.submit(fn, *args, **kwargs)
+
+ Schedules the callable to be executed as *fn*(*\*args*, *\*\*kwargs*) and
+ returns a :class:`Future` representing the execution of the callable.
+
+::
+
+ with ThreadPoolExecutor(max_workers=1) as executor:
+ future = executor.submit(pow, 323, 1235)
+ print(future.result())
+
+.. method:: Executor.map(func, *iterables, timeout=None)
+
+ Equivalent to map(*func*, *\*iterables*) but func is executed asynchronously
+ and several calls to *func* may be made concurrently. The returned iterator
+ raises a :exc:`TimeoutError` if :meth:`__next__()` is called and the result
+ isn't available after *timeout* seconds from the original call to
+ :meth:`map()`. *timeout* can be an int or float. If *timeout* is not
+ specified or ``None`` then there is no limit to the wait time. If a call
+ raises an exception then that exception will be raised when its value is
+ retrieved from the iterator.
+
+.. method:: Executor.shutdown(wait=True)
+
+ Signal the executor that it should free any resources that it is using when
+ the currently pending futures are done executing. Calls to
+ :meth:`Executor.submit` and :meth:`Executor.map` made after shutdown will
+ raise :exc:`RuntimeError`.
+
+ If *wait* is `True` then this method will not return until all the pending
+ futures are done executing and the resources associated with the executor
+ have been freed. If *wait* is `False` then this method will return
+ immediately and the resources associated with the executor will be freed
+ when all pending futures are done executing. Regardless of the value of
+ *wait*, the entire Python program will not exit until all pending futures
+ are done executing.
+
+ You can avoid having to call this method explicitly if you use the `with`
+ statement, which will shutdown the `Executor` (waiting as if
+ `Executor.shutdown` were called with *wait* set to `True`):
+
+::
+
+ import shutil
+ with ThreadPoolExecutor(max_workers=4) as e:
+ e.submit(shutil.copy, 'src1.txt', 'dest1.txt')
+ e.submit(shutil.copy, 'src2.txt', 'dest2.txt')
+ e.submit(shutil.copy, 'src3.txt', 'dest3.txt')
+ e.submit(shutil.copy, 'src3.txt', 'dest4.txt')
+
+
+ThreadPoolExecutor Objects
+--------------------------
+
+The :class:`ThreadPoolExecutor` class is an :class:`Executor` subclass that uses
+a pool of threads to execute calls asynchronously.
+
+Deadlock can occur when the callable associated with a :class:`Future` waits on
+the results of another :class:`Future`. For example:
+
+::
+
+ import time
+ def wait_on_b():
+ time.sleep(5)
+ print(b.result()) # b will never complete because it is waiting on a.
+ return 5
+
+ def wait_on_a():
+ time.sleep(5)
+ print(a.result()) # a will never complete because it is waiting on b.
+ return 6
+
+
+ executor = ThreadPoolExecutor(max_workers=2)
+ a = executor.submit(wait_on_b)
+ b = executor.submit(wait_on_a)
+
+And:
+
+::
+
+ def wait_on_future():
+ f = executor.submit(pow, 5, 2)
+ # This will never complete because there is only one worker thread and
+ # it is executing this function.
+ print(f.result())
+
+ executor = ThreadPoolExecutor(max_workers=1)
+ executor.submit(wait_on_future)
+
+.. class:: ThreadPoolExecutor(max_workers)
+
+ Executes calls asynchronously using at pool of at most *max_workers* threads.
+
+.. _threadpoolexecutor-example:
+
+ThreadPoolExecutor Example
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+::
+
+ from concurrent import futures
+ import urllib.request
+
+ URLS = ['http://www.foxnews.com/',
+ 'http://www.cnn.com/',
+ 'http://europe.wsj.com/',
+ 'http://www.bbc.co.uk/',
+ 'http://some-made-up-domain.com/']
+
+ def load_url(url, timeout):
+ return urllib.request.urlopen(url, timeout=timeout).read()
+
+ with futures.ThreadPoolExecutor(max_workers=5) as executor:
+ future_to_url = dict((executor.submit(load_url, url, 60), url)
+ for url in URLS)
+
+ for future in futures.as_completed(future_to_url):
+ url = future_to_url[future]
+ if future.exception() is not None:
+ print('%r generated an exception: %s' % (url,
+ future.exception()))
+ else:
+ print('%r page is %d bytes' % (url, len(future.result())))
+
+ProcessPoolExecutor Objects
+---------------------------
+
+The :class:`ProcessPoolExecutor` class is an :class:`Executor` subclass that
+uses a pool of processes to execute calls asynchronously.
+:class:`ProcessPoolExecutor` uses the :mod:`multiprocessing` module, which
+allows it to side-step the :term:`Global Interpreter Lock` but also means that
+only picklable objects can be executed and returned.
+
+Calling :class:`Executor` or :class:`Future` methods from a callable submitted
+to a :class:`ProcessPoolExecutor` will result in deadlock.
+
+.. class:: ProcessPoolExecutor(max_workers=None)
+
+ Executes calls asynchronously using a pool of at most *max_workers*
+ processes. If *max_workers* is ``None`` or not given then as many worker
+ processes will be created as the machine has processors.
+
+.. _processpoolexecutor-example:
+
+ProcessPoolExecutor Example
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+::
+
+ import math
+
+ PRIMES = [
+ 112272535095293,
+ 112582705942171,
+ 112272535095293,
+ 115280095190773,
+ 115797848077099,
+ 1099726899285419]
+
+ def is_prime(n):
+ if n % 2 == 0:
+ return False
+
+ sqrt_n = int(math.floor(math.sqrt(n)))
+ for i in range(3, sqrt_n + 1, 2):
+ if n % i == 0:
+ return False
+ return True
+
+ def main():
+ with futures.ProcessPoolExecutor() as executor:
+ for number, prime in zip(PRIMES, executor.map(is_prime, PRIMES)):
+ print('%d is prime: %s' % (number, prime))
+
+ if __name__ == '__main__':
+ main()
+
+Future Objects
+--------------
+
+The :class:`Future` class encapulates the asynchronous execution of a callable.
+:class:`Future` instances are created by :meth:`Executor.submit`.
+
+.. method:: Future.cancel()
+
+ Attempt to cancel the call. If the call is currently being executed then
+ it cannot be cancelled and the method will return `False`, otherwise the call
+ will be cancelled and the method will return `True`.
+
+.. method:: Future.cancelled()
+
+ Return `True` if the call was successfully cancelled.
+
+.. method:: Future.running()
+
+ Return `True` if the call is currently being executed and cannot be
+ cancelled.
+
+.. method:: Future.done()
+
+ Return `True` if the call was successfully cancelled or finished running.
+
+.. method:: Future.result(timeout=None)
+
+ Return the value returned by the call. If the call hasn't yet completed then
+ this method will wait up to *timeout* seconds. If the call hasn't completed
+ in *timeout* seconds then a :exc:`TimeoutError` will be raised. *timeout* can
+ be an int or float.If *timeout* is not specified or ``None`` then there is no
+ limit to the wait time.
+
+ If the future is cancelled before completing then :exc:`CancelledError` will
+ be raised.
+
+ If the call raised then this method will raise the same exception.
+
+.. method:: Future.exception(timeout=None)
+
+ Return the exception raised by the call. If the call hasn't yet completed
+ then this method will wait up to *timeout* seconds. If the call hasn't
+ completed in *timeout* seconds then a :exc:`TimeoutError` will be raised.
+ *timeout* can be an int or float. If *timeout* is not specified or ``None``
+ then there is no limit to the wait time.
+
+ If the future is cancelled before completing then :exc:`CancelledError` will
+ be raised.
+
+ If the call completed without raising then ``None`` is returned.
+
+.. method:: Future.add_done_callback(fn)
+
+ Attaches the callable *fn* to the future. *fn* will be called, with the
+ future as its only argument, when the future is cancelled or finishes
+ running.
+
+ Added callables are called in the order that they were added and are always
+ called in a thread belonging to the process that added them. If the callable
+ raises an :exc:`Exception` then it will be logged and ignored. If the
+ callable raises another :exc:`BaseException` then the behavior is not
+ defined.
+
+ If the future has already completed or been cancelled then *fn* will be
+ called immediately.
+
+Internal Future Methods
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The following :class:`Future` methods are meant for use in unit tests and
+:class:`Executor` implementations.
+
+.. method:: Future.set_running_or_notify_cancel()
+
+ This method should only be called by :class:`Executor` implementations before
+ executing the work associated with the :class:`Future` and by unit tests.
+
+ If the method returns `False` then the :class:`Future` was cancelled i.e.
+ :meth:`Future.cancel` was called and returned `True`. Any threads waiting
+ on the :class:`Future` completing (i.e. through :func:`as_completed` or
+ :func:`wait`) will be woken up.
+
+ If the method returns `True` then the :class:`Future` was not cancelled
+ and has been put in the running state i.e. calls to
+ :meth:`Future.running` will return `True`.
+
+ This method can only be called once and cannot be called after
+ :meth:`Future.set_result` or :meth:`Future.set_exception` have been
+ called.
+
+.. method:: Future.set_result(result)
+
+ Sets the result of the work associated with the :class:`Future` to *result*.
+
+ This method should only be used by Executor implementations and unit tests.
+
+.. method:: Future.set_exception(exception)
+
+ Sets the result of the work associated with the :class:`Future` to the
+ :class:`Exception` *exception*.
+
+ This method should only be used by Executor implementations and unit tests.
+
+Module Functions
+----------------
+
+.. function:: wait(fs, timeout=None, return_when=ALL_COMPLETED)
+
+ Wait for the :class:`Future` instances (possibly created by different
+ :class:`Executor` instances) given by *fs* to complete. Returns a named
+ 2-tuple of sets. The first set, named "done", contains the futures that
+ completed (finished or were cancelled) before the wait completed. The second
+ set, named "not_done", contains uncompleted futures.
+
+ *timeout* can be used to control the maximum number of seconds to wait before
+ returning. *timeout* can be an int or float. If *timeout* is not specified or
+ ``None`` then there is no limit to the wait time.
+
+ *return_when* indicates when this function should return. It must be one of
+ the following constants:
+
+ +-----------------------------+----------------------------------------+
+ | Constant | Description |
+ +=============================+========================================+
+ | :const:`FIRST_COMPLETED` | The function will return when any |
+ | | future finishes or is cancelled. |
+ +-----------------------------+----------------------------------------+
+ | :const:`FIRST_EXCEPTION` | The function will return when any |
+ | | future finishes by raising an |
+ | | exception. If no future raises an |
+ | | exception then it is equivalent to |
+ | | `ALL_COMPLETED`. |
+ +-----------------------------+----------------------------------------+
+ | :const:`ALL_COMPLETED` | The function will return when all |
+ | | futures finish or are cancelled. |
+ +-----------------------------+----------------------------------------+
+
+.. function:: as_completed(fs, timeout=None)
+
+ Returns an iterator over the :class:`Future` instances (possibly created
+ by different :class:`Executor` instances) given by *fs* that yields futures
+ as they complete (finished or were cancelled). Any futures that completed
+ before :func:`as_completed()` was called will be yielded first. The returned
+ iterator raises a :exc:`TimeoutError` if :meth:`__next__()` is called and
+ the result isn't available after *timeout* seconds from the original call
+ to :func:`as_completed()`. *timeout* can be an int or float. If *timeout*
+ is not specified or ``None`` then there is no limit to the wait time.
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/docs/make.bat b/vim/bundle/YouCompleteMe/third_party/pythonfutures/docs/make.bat
new file mode 100755
index 0000000..3e8021b
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/docs/make.bat
@@ -0,0 +1,112 @@
+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+set SPHINXBUILD=sphinx-build
+set ALLSPHINXOPTS=-d _build/doctrees %SPHINXOPTS% .
+if NOT "%PAPER%" == "" (
+ set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+ :help
+ echo.Please use `make ^<target^>` where ^<target^> is one of
+ echo. html to make standalone HTML files
+ echo. dirhtml to make HTML files named index.html in directories
+ echo. pickle to make pickle files
+ echo. json to make JSON files
+ echo. htmlhelp to make HTML files and a HTML help project
+ echo. qthelp to make HTML files and a qthelp project
+ echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+ echo. changes to make an overview over all changed/added/deprecated items
+ echo. linkcheck to check all external links for integrity
+ echo. doctest to run all doctests embedded in the documentation if enabled
+ goto end
+)
+
+if "%1" == "clean" (
+ for /d %%i in (_build\*) do rmdir /q /s %%i
+ del /q /s _build\*
+ goto end
+)
+
+if "%1" == "html" (
+ %SPHINXBUILD% -b html %ALLSPHINXOPTS% _build/html
+ echo.
+ echo.Build finished. The HTML pages are in _build/html.
+ goto end
+)
+
+if "%1" == "dirhtml" (
+ %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% _build/dirhtml
+ echo.
+ echo.Build finished. The HTML pages are in _build/dirhtml.
+ goto end
+)
+
+if "%1" == "pickle" (
+ %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% _build/pickle
+ echo.
+ echo.Build finished; now you can process the pickle files.
+ goto end
+)
+
+if "%1" == "json" (
+ %SPHINXBUILD% -b json %ALLSPHINXOPTS% _build/json
+ echo.
+ echo.Build finished; now you can process the JSON files.
+ goto end
+)
+
+if "%1" == "htmlhelp" (
+ %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% _build/htmlhelp
+ echo.
+ echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in _build/htmlhelp.
+ goto end
+)
+
+if "%1" == "qthelp" (
+ %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% _build/qthelp
+ echo.
+ echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in _build/qthelp, like this:
+ echo.^> qcollectiongenerator _build\qthelp\futures.qhcp
+ echo.To view the help file:
+ echo.^> assistant -collectionFile _build\qthelp\futures.ghc
+ goto end
+)
+
+if "%1" == "latex" (
+ %SPHINXBUILD% -b latex %ALLSPHINXOPTS% _build/latex
+ echo.
+ echo.Build finished; the LaTeX files are in _build/latex.
+ goto end
+)
+
+if "%1" == "changes" (
+ %SPHINXBUILD% -b changes %ALLSPHINXOPTS% _build/changes
+ echo.
+ echo.The overview file is in _build/changes.
+ goto end
+)
+
+if "%1" == "linkcheck" (
+ %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% _build/linkcheck
+ echo.
+ echo.Link check complete; look for any errors in the above output ^
+or in _build/linkcheck/output.txt.
+ goto end
+)
+
+if "%1" == "doctest" (
+ %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% _build/doctest
+ echo.
+ echo.Testing of doctests in the sources finished, look at the ^
+results in _build/doctest/output.txt.
+ goto end
+)
+
+:end
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/futures/__init__.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/futures/__init__.py
new file mode 100755
index 0000000..8f8b234
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/futures/__init__.py
@@ -0,0 +1,24 @@
+# Copyright 2009 Brian Quinlan. All Rights Reserved.
+# Licensed to PSF under a Contributor Agreement.
+
+"""Execute computations asynchronously using threads or processes."""
+
+import warnings
+
+from concurrent.futures import (FIRST_COMPLETED,
+ FIRST_EXCEPTION,
+ ALL_COMPLETED,
+ CancelledError,
+ TimeoutError,
+ Future,
+ Executor,
+ wait,
+ as_completed,
+ ProcessPoolExecutor,
+ ThreadPoolExecutor)
+
+__author__ = 'Brian Quinlan (brian@sweetapp.com)'
+
+warnings.warn('The futures package has been deprecated. '
+ 'Use the concurrent.futures package instead.',
+ DeprecationWarning)
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/futures/process.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/futures/process.py
new file mode 100755
index 0000000..e9d37b1
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/futures/process.py
@@ -0,0 +1 @@
+from concurrent.futures import ProcessPoolExecutor
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/futures/thread.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/futures/thread.py
new file mode 100755
index 0000000..f6bd05d
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/futures/thread.py
@@ -0,0 +1 @@
+from concurrent.futures import ThreadPoolExecutor
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/primes.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/primes.py
new file mode 100755
index 0000000..0da2b3e
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/primes.py
@@ -0,0 +1,50 @@
+from __future__ import with_statement
+import math
+import time
+import sys
+
+from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
+
+PRIMES = [
+ 112272535095293,
+ 112582705942171,
+ 112272535095293,
+ 115280095190773,
+ 115797848077099,
+ 117450548693743,
+ 993960000099397]
+
+def is_prime(n):
+ if n % 2 == 0:
+ return False
+
+ sqrt_n = int(math.floor(math.sqrt(n)))
+ for i in range(3, sqrt_n + 1, 2):
+ if n % i == 0:
+ return False
+ return True
+
+def sequential():
+ return list(map(is_prime, PRIMES))
+
+def with_process_pool_executor():
+ with ProcessPoolExecutor(10) as executor:
+ return list(executor.map(is_prime, PRIMES))
+
+def with_thread_pool_executor():
+ with ThreadPoolExecutor(10) as executor:
+ return list(executor.map(is_prime, PRIMES))
+
+def main():
+ for name, fn in [('sequential', sequential),
+ ('processes', with_process_pool_executor),
+ ('threads', with_thread_pool_executor)]:
+ sys.stdout.write('%s: ' % name.ljust(12))
+ start = time.time()
+ if fn() != [True] * len(PRIMES):
+ sys.stdout.write('failed\n')
+ else:
+ sys.stdout.write('%.2f seconds\n' % (time.time() - start))
+
+if __name__ == '__main__':
+ main()
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/setup.cfg b/vim/bundle/YouCompleteMe/third_party/pythonfutures/setup.cfg
new file mode 100755
index 0000000..0a9f4f5
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/setup.cfg
@@ -0,0 +1,6 @@
+[build_sphinx]
+source-dir = docs
+build-dir = build/sphinx
+
+[upload_docs]
+upload-dir = build/sphinx/html
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/setup.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/setup.py
new file mode 100755
index 0000000..c08461e
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/setup.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+import sys
+
+extras = {}
+try:
+ from setuptools import setup
+ extras['zip_safe'] = False
+ if sys.version_info < (2, 6):
+ extras['install_requires'] = ['multiprocessing']
+except ImportError:
+ from distutils.core import setup
+
+setup(name='futures',
+ version='2.1.4',
+ description='Backport of the concurrent.futures package from Python 3.2',
+ author='Brian Quinlan',
+ author_email='brian@sweetapp.com',
+ maintainer='Alex Gronholm',
+ maintainer_email='alex.gronholm+pypi@nextday.fi',
+ url='http://code.google.com/p/pythonfutures',
+ download_url='http://pypi.python.org/pypi/futures/',
+ packages=['futures', 'concurrent', 'concurrent.futures'],
+ license='BSD',
+ classifiers=['License :: OSI Approved :: BSD License',
+ 'Development Status :: 5 - Production/Stable',
+ 'Intended Audience :: Developers',
+ 'Programming Language :: Python :: 2.5',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.1'],
+ **extras
+ )
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/test_futures.py b/vim/bundle/YouCompleteMe/third_party/pythonfutures/test_futures.py
new file mode 100755
index 0000000..dd7fd3e
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/test_futures.py
@@ -0,0 +1,723 @@
+from __future__ import with_statement
+import os
+import subprocess
+import sys
+import threading
+import functools
+import contextlib
+import logging
+import re
+import time
+
+from concurrent import futures
+from concurrent.futures._base import (
+ PENDING, RUNNING, CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED, Future)
+
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
+
+try:
+ from StringIO import StringIO
+except ImportError:
+ from io import StringIO
+
+try:
+ from test import test_support
+except ImportError:
+ from test import support as test_support
+
+try:
+ next
+except NameError:
+ next = lambda x: x.next()
+
+
+def reap_threads(func):
+ """Use this function when threads are being used. This will
+ ensure that the threads are cleaned up even when the test fails.
+ If threading is unavailable this function does nothing.
+ """
+ @functools.wraps(func)
+ def decorator(*args):
+ key = test_support.threading_setup()
+ try:
+ return func(*args)
+ finally:
+ test_support.threading_cleanup(*key)
+ return decorator
+
+
+# Executing the interpreter in a subprocess
+def _assert_python(expected_success, *args, **env_vars):
+ cmd_line = [sys.executable]
+ if not env_vars:
+ cmd_line.append('-E')
+ # Need to preserve the original environment, for in-place testing of
+ # shared library builds.
+ env = os.environ.copy()
+ # But a special flag that can be set to override -- in this case, the
+ # caller is responsible to pass the full environment.
+ if env_vars.pop('__cleanenv', None):
+ env = {}
+ env.update(env_vars)
+ cmd_line.extend(args)
+ p = subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+ env=env)
+ try:
+ out, err = p.communicate()
+ finally:
+ subprocess._cleanup()
+ p.stdout.close()
+ p.stderr.close()
+ rc = p.returncode
+ err = strip_python_stderr(err)
+ if (rc and expected_success) or (not rc and not expected_success):
+ raise AssertionError(
+ "Process return code is %d, "
+ "stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore')))
+ return rc, out, err
+
+
+def assert_python_ok(*args, **env_vars):
+ """
+ Assert that running the interpreter with `args` and optional environment
+ variables `env_vars` is ok and return a (return code, stdout, stderr) tuple.
+ """
+ return _assert_python(True, *args, **env_vars)
+
+
+def strip_python_stderr(stderr):
+ """Strip the stderr of a Python process from potential debug output
+ emitted by the interpreter.
+
+ This will typically be run on the result of the communicate() method
+ of a subprocess.Popen object.
+ """
+ stderr = re.sub(r"\[\d+ refs\]\r?\n?$".encode(), "".encode(), stderr).strip()
+ return stderr
+
+
+@contextlib.contextmanager
+def captured_stderr():
+ """Return a context manager used by captured_stdout/stdin/stderr
+ that temporarily replaces the sys stream *stream_name* with a StringIO."""
+ logging_stream = StringIO()
+ handler = logging.StreamHandler(logging_stream)
+ logging.root.addHandler(handler)
+
+ try:
+ yield logging_stream
+ finally:
+ logging.root.removeHandler(handler)
+
+
+def create_future(state=PENDING, exception=None, result=None):
+ f = Future()
+ f._state = state
+ f._exception = exception
+ f._result = result
+ return f
+
+
+PENDING_FUTURE = create_future(state=PENDING)
+RUNNING_FUTURE = create_future(state=RUNNING)
+CANCELLED_FUTURE = create_future(state=CANCELLED)
+CANCELLED_AND_NOTIFIED_FUTURE = create_future(state=CANCELLED_AND_NOTIFIED)
+EXCEPTION_FUTURE = create_future(state=FINISHED, exception=IOError())
+SUCCESSFUL_FUTURE = create_future(state=FINISHED, result=42)
+
+
+def mul(x, y):
+ return x * y
+
+
+def sleep_and_raise(t):
+ time.sleep(t)
+ raise Exception('this is an exception')
+
+def sleep_and_print(t, msg):
+ time.sleep(t)
+ print(msg)
+ sys.stdout.flush()
+
+
+class ExecutorMixin:
+ worker_count = 5
+
+ def setUp(self):
+ self.t1 = time.time()
+ try:
+ self.executor = self.executor_type(max_workers=self.worker_count)
+ except NotImplementedError:
+ e = sys.exc_info()[1]
+ self.skipTest(str(e))
+ self._prime_executor()
+
+ def tearDown(self):
+ self.executor.shutdown(wait=True)
+ dt = time.time() - self.t1
+ if test_support.verbose:
+ print("%.2fs" % dt)
+ self.assertLess(dt, 60, "synchronization issue: test lasted too long")
+
+ def _prime_executor(self):
+ # Make sure that the executor is ready to do work before running the
+ # tests. This should reduce the probability of timeouts in the tests.
+ futures = [self.executor.submit(time.sleep, 0.1)
+ for _ in range(self.worker_count)]
+
+ for f in futures:
+ f.result()
+
+
+class ThreadPoolMixin(ExecutorMixin):
+ executor_type = futures.ThreadPoolExecutor
+
+
+class ProcessPoolMixin(ExecutorMixin):
+ executor_type = futures.ProcessPoolExecutor
+
+
+class ExecutorShutdownTest(unittest.TestCase):
+ def test_run_after_shutdown(self):
+ self.executor.shutdown()
+ self.assertRaises(RuntimeError,
+ self.executor.submit,
+ pow, 2, 5)
+
+ def test_interpreter_shutdown(self):
+ # Test the atexit hook for shutdown of worker threads and processes
+ rc, out, err = assert_python_ok('-c', """if 1:
+ from concurrent.futures import %s
+ from time import sleep
+ from test_futures import sleep_and_print
+ t = %s(5)
+ t.submit(sleep_and_print, 1.0, "apple")
+ """ % (self.executor_type.__name__, self.executor_type.__name__))
+ # Errors in atexit hooks don't change the process exit code, check
+ # stderr manually.
+ self.assertFalse(err)
+ self.assertEqual(out.strip(), "apple".encode())
+
+ def test_hang_issue12364(self):
+ fs = [self.executor.submit(time.sleep, 0.1) for _ in range(50)]
+ self.executor.shutdown()
+ for f in fs:
+ f.result()
+
+
+class ThreadPoolShutdownTest(ThreadPoolMixin, ExecutorShutdownTest):
+ def _prime_executor(self):
+ pass
+
+ def test_threads_terminate(self):
+ self.executor.submit(mul, 21, 2)
+ self.executor.submit(mul, 6, 7)
+ self.executor.submit(mul, 3, 14)
+ self.assertEqual(len(self.executor._threads), 3)
+ self.executor.shutdown()
+ for t in self.executor._threads:
+ t.join()
+
+ def test_context_manager_shutdown(self):
+ with futures.ThreadPoolExecutor(max_workers=5) as e:
+ executor = e
+ self.assertEqual(list(e.map(abs, range(-5, 5))),
+ [5, 4, 3, 2, 1, 0, 1, 2, 3, 4])
+
+ for t in executor._threads:
+ t.join()
+
+ def test_del_shutdown(self):
+ executor = futures.ThreadPoolExecutor(max_workers=5)
+ executor.map(abs, range(-5, 5))
+ threads = executor._threads
+ del executor
+
+ for t in threads:
+ t.join()
+
+
+class ProcessPoolShutdownTest(ProcessPoolMixin, ExecutorShutdownTest):
+ def _prime_executor(self):
+ pass
+
+ def test_processes_terminate(self):
+ self.executor.submit(mul, 21, 2)
+ self.executor.submit(mul, 6, 7)
+ self.executor.submit(mul, 3, 14)
+ self.assertEqual(len(self.executor._processes), 5)
+ processes = self.executor._processes
+ self.executor.shutdown()
+
+ for p in processes:
+ p.join()
+
+ def test_context_manager_shutdown(self):
+ with futures.ProcessPoolExecutor(max_workers=5) as e:
+ processes = e._processes
+ self.assertEqual(list(e.map(abs, range(-5, 5))),
+ [5, 4, 3, 2, 1, 0, 1, 2, 3, 4])
+
+ for p in processes:
+ p.join()
+
+ def test_del_shutdown(self):
+ executor = futures.ProcessPoolExecutor(max_workers=5)
+ list(executor.map(abs, range(-5, 5)))
+ queue_management_thread = executor._queue_management_thread
+ processes = executor._processes
+ del executor
+
+ queue_management_thread.join()
+ for p in processes:
+ p.join()
+
+
+class WaitTests(unittest.TestCase):
+
+ def test_first_completed(self):
+ future1 = self.executor.submit(mul, 21, 2)
+ future2 = self.executor.submit(time.sleep, 1.5)
+
+ done, not_done = futures.wait(
+ [CANCELLED_FUTURE, future1, future2],
+ return_when=futures.FIRST_COMPLETED)
+
+ self.assertEqual(set([future1]), done)
+ self.assertEqual(set([CANCELLED_FUTURE, future2]), not_done)
+
+ def test_first_completed_some_already_completed(self):
+ future1 = self.executor.submit(time.sleep, 1.5)
+
+ finished, pending = futures.wait(
+ [CANCELLED_AND_NOTIFIED_FUTURE, SUCCESSFUL_FUTURE, future1],
+ return_when=futures.FIRST_COMPLETED)
+
+ self.assertEqual(
+ set([CANCELLED_AND_NOTIFIED_FUTURE, SUCCESSFUL_FUTURE]),
+ finished)
+ self.assertEqual(set([future1]), pending)
+
+ def test_first_exception(self):
+ future1 = self.executor.submit(mul, 2, 21)
+ future2 = self.executor.submit(sleep_and_raise, 1.5)
+ future3 = self.executor.submit(time.sleep, 3)
+
+ finished, pending = futures.wait(
+ [future1, future2, future3],
+ return_when=futures.FIRST_EXCEPTION)
+
+ self.assertEqual(set([future1, future2]), finished)
+ self.assertEqual(set([future3]), pending)
+
+ def test_first_exception_some_already_complete(self):
+ future1 = self.executor.submit(divmod, 21, 0)
+ future2 = self.executor.submit(time.sleep, 1.5)
+
+ finished, pending = futures.wait(
+ [SUCCESSFUL_FUTURE,
+ CANCELLED_FUTURE,
+ CANCELLED_AND_NOTIFIED_FUTURE,
+ future1, future2],
+ return_when=futures.FIRST_EXCEPTION)
+
+ self.assertEqual(set([SUCCESSFUL_FUTURE,
+ CANCELLED_AND_NOTIFIED_FUTURE,
+ future1]), finished)
+ self.assertEqual(set([CANCELLED_FUTURE, future2]), pending)
+
+ def test_first_exception_one_already_failed(self):
+ future1 = self.executor.submit(time.sleep, 2)
+
+ finished, pending = futures.wait(
+ [EXCEPTION_FUTURE, future1],
+ return_when=futures.FIRST_EXCEPTION)
+
+ self.assertEqual(set([EXCEPTION_FUTURE]), finished)
+ self.assertEqual(set([future1]), pending)
+
+ def test_all_completed(self):
+ future1 = self.executor.submit(divmod, 2, 0)
+ future2 = self.executor.submit(mul, 2, 21)
+
+ finished, pending = futures.wait(
+ [SUCCESSFUL_FUTURE,
+ CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ future1,
+ future2],
+ return_when=futures.ALL_COMPLETED)
+
+ self.assertEqual(set([SUCCESSFUL_FUTURE,
+ CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ future1,
+ future2]), finished)
+ self.assertEqual(set(), pending)
+
+ def test_timeout(self):
+ future1 = self.executor.submit(mul, 6, 7)
+ future2 = self.executor.submit(time.sleep, 3)
+
+ finished, pending = futures.wait(
+ [CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ SUCCESSFUL_FUTURE,
+ future1, future2],
+ timeout=1.5,
+ return_when=futures.ALL_COMPLETED)
+
+ self.assertEqual(set([CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ SUCCESSFUL_FUTURE,
+ future1]), finished)
+ self.assertEqual(set([future2]), pending)
+
+
+class ThreadPoolWaitTests(ThreadPoolMixin, WaitTests):
+
+ def test_pending_calls_race(self):
+ # Issue #14406: multi-threaded race condition when waiting on all
+ # futures.
+ event = threading.Event()
+ def future_func():
+ event.wait()
+ oldswitchinterval = sys.getcheckinterval()
+ sys.setcheckinterval(1)
+ try:
+ fs = set(self.executor.submit(future_func) for i in range(100))
+ event.set()
+ futures.wait(fs, return_when=futures.ALL_COMPLETED)
+ finally:
+ sys.setcheckinterval(oldswitchinterval)
+
+
+class ProcessPoolWaitTests(ProcessPoolMixin, WaitTests):
+ pass
+
+
+class AsCompletedTests(unittest.TestCase):
+ # TODO(brian@sweetapp.com): Should have a test with a non-zero timeout.
+ def test_no_timeout(self):
+ future1 = self.executor.submit(mul, 2, 21)
+ future2 = self.executor.submit(mul, 7, 6)
+
+ completed = set(futures.as_completed(
+ [CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ SUCCESSFUL_FUTURE,
+ future1, future2]))
+ self.assertEqual(set(
+ [CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ SUCCESSFUL_FUTURE,
+ future1, future2]),
+ completed)
+
+ def test_zero_timeout(self):
+ future1 = self.executor.submit(time.sleep, 2)
+ completed_futures = set()
+ try:
+ for future in futures.as_completed(
+ [CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ SUCCESSFUL_FUTURE,
+ future1],
+ timeout=0):
+ completed_futures.add(future)
+ except futures.TimeoutError:
+ pass
+
+ self.assertEqual(set([CANCELLED_AND_NOTIFIED_FUTURE,
+ EXCEPTION_FUTURE,
+ SUCCESSFUL_FUTURE]),
+ completed_futures)
+
+
+class ThreadPoolAsCompletedTests(ThreadPoolMixin, AsCompletedTests):
+ pass
+
+
+class ProcessPoolAsCompletedTests(ProcessPoolMixin, AsCompletedTests):
+ pass
+
+
+class ExecutorTest(unittest.TestCase):
+ # Executor.shutdown() and context manager usage is tested by
+ # ExecutorShutdownTest.
+ def test_submit(self):
+ future = self.executor.submit(pow, 2, 8)
+ self.assertEqual(256, future.result())
+
+ def test_submit_keyword(self):
+ future = self.executor.submit(mul, 2, y=8)
+ self.assertEqual(16, future.result())
+
+ def test_map(self):
+ self.assertEqual(
+ list(self.executor.map(pow, range(10), range(10))),
+ list(map(pow, range(10), range(10))))
+
+ def test_map_exception(self):
+ i = self.executor.map(divmod, [1, 1, 1, 1], [2, 3, 0, 5])
+ self.assertEqual(next(i), (0, 1))
+ self.assertEqual(next(i), (0, 1))
+ self.assertRaises(ZeroDivisionError, next, i)
+
+ def test_map_timeout(self):
+ results = []
+ try:
+ for i in self.executor.map(time.sleep,
+ [0, 0, 3],
+ timeout=1.5):
+ results.append(i)
+ except futures.TimeoutError:
+ pass
+ else:
+ self.fail('expected TimeoutError')
+
+ self.assertEqual([None, None], results)
+
+
+class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest):
+ pass
+
+
+class ProcessPoolExecutorTest(ProcessPoolMixin, ExecutorTest):
+ pass
+
+
+class FutureTests(unittest.TestCase):
+ def test_done_callback_with_result(self):
+ callback_result = [None]
+ def fn(callback_future):
+ callback_result[0] = callback_future.result()
+
+ f = Future()
+ f.add_done_callback(fn)
+ f.set_result(5)
+ self.assertEqual(5, callback_result[0])
+
+ def test_done_callback_with_exception(self):
+ callback_exception = [None]
+ def fn(callback_future):
+ callback_exception[0] = callback_future.exception()
+
+ f = Future()
+ f.add_done_callback(fn)
+ f.set_exception(Exception('test'))
+ self.assertEqual(('test',), callback_exception[0].args)
+
+ def test_done_callback_with_cancel(self):
+ was_cancelled = [None]
+ def fn(callback_future):
+ was_cancelled[0] = callback_future.cancelled()
+
+ f = Future()
+ f.add_done_callback(fn)
+ self.assertTrue(f.cancel())
+ self.assertTrue(was_cancelled[0])
+
+ def test_done_callback_raises(self):
+ with captured_stderr() as stderr:
+ raising_was_called = [False]
+ fn_was_called = [False]
+
+ def raising_fn(callback_future):
+ raising_was_called[0] = True
+ raise Exception('doh!')
+
+ def fn(callback_future):
+ fn_was_called[0] = True
+
+ f = Future()
+ f.add_done_callback(raising_fn)
+ f.add_done_callback(fn)
+ f.set_result(5)
+ self.assertTrue(raising_was_called)
+ self.assertTrue(fn_was_called)
+ self.assertIn('Exception: doh!', stderr.getvalue())
+
+ def test_done_callback_already_successful(self):
+ callback_result = [None]
+ def fn(callback_future):
+ callback_result[0] = callback_future.result()
+
+ f = Future()
+ f.set_result(5)
+ f.add_done_callback(fn)
+ self.assertEqual(5, callback_result[0])
+
+ def test_done_callback_already_failed(self):
+ callback_exception = [None]
+ def fn(callback_future):
+ callback_exception[0] = callback_future.exception()
+
+ f = Future()
+ f.set_exception(Exception('test'))
+ f.add_done_callback(fn)
+ self.assertEqual(('test',), callback_exception[0].args)
+
+ def test_done_callback_already_cancelled(self):
+ was_cancelled = [None]
+ def fn(callback_future):
+ was_cancelled[0] = callback_future.cancelled()
+
+ f = Future()
+ self.assertTrue(f.cancel())
+ f.add_done_callback(fn)
+ self.assertTrue(was_cancelled[0])
+
+ def test_repr(self):
+ self.assertRegexpMatches(repr(PENDING_FUTURE),
+ '<Future at 0x[0-9a-f]+ state=pending>')
+ self.assertRegexpMatches(repr(RUNNING_FUTURE),
+ '<Future at 0x[0-9a-f]+ state=running>')
+ self.assertRegexpMatches(repr(CANCELLED_FUTURE),
+ '<Future at 0x[0-9a-f]+ state=cancelled>')
+ self.assertRegexpMatches(repr(CANCELLED_AND_NOTIFIED_FUTURE),
+ '<Future at 0x[0-9a-f]+ state=cancelled>')
+ self.assertRegexpMatches(
+ repr(EXCEPTION_FUTURE),
+ '<Future at 0x[0-9a-f]+ state=finished raised IOError>')
+ self.assertRegexpMatches(
+ repr(SUCCESSFUL_FUTURE),
+ '<Future at 0x[0-9a-f]+ state=finished returned int>')
+
+ def test_cancel(self):
+ f1 = create_future(state=PENDING)
+ f2 = create_future(state=RUNNING)
+ f3 = create_future(state=CANCELLED)
+ f4 = create_future(state=CANCELLED_AND_NOTIFIED)
+ f5 = create_future(state=FINISHED, exception=IOError())
+ f6 = create_future(state=FINISHED, result=5)
+
+ self.assertTrue(f1.cancel())
+ self.assertEqual(f1._state, CANCELLED)
+
+ self.assertFalse(f2.cancel())
+ self.assertEqual(f2._state, RUNNING)
+
+ self.assertTrue(f3.cancel())
+ self.assertEqual(f3._state, CANCELLED)
+
+ self.assertTrue(f4.cancel())
+ self.assertEqual(f4._state, CANCELLED_AND_NOTIFIED)
+
+ self.assertFalse(f5.cancel())
+ self.assertEqual(f5._state, FINISHED)
+
+ self.assertFalse(f6.cancel())
+ self.assertEqual(f6._state, FINISHED)
+
+ def test_cancelled(self):
+ self.assertFalse(PENDING_FUTURE.cancelled())
+ self.assertFalse(RUNNING_FUTURE.cancelled())
+ self.assertTrue(CANCELLED_FUTURE.cancelled())
+ self.assertTrue(CANCELLED_AND_NOTIFIED_FUTURE.cancelled())
+ self.assertFalse(EXCEPTION_FUTURE.cancelled())
+ self.assertFalse(SUCCESSFUL_FUTURE.cancelled())
+
+ def test_done(self):
+ self.assertFalse(PENDING_FUTURE.done())
+ self.assertFalse(RUNNING_FUTURE.done())
+ self.assertTrue(CANCELLED_FUTURE.done())
+ self.assertTrue(CANCELLED_AND_NOTIFIED_FUTURE.done())
+ self.assertTrue(EXCEPTION_FUTURE.done())
+ self.assertTrue(SUCCESSFUL_FUTURE.done())
+
+ def test_running(self):
+ self.assertFalse(PENDING_FUTURE.running())
+ self.assertTrue(RUNNING_FUTURE.running())
+ self.assertFalse(CANCELLED_FUTURE.running())
+ self.assertFalse(CANCELLED_AND_NOTIFIED_FUTURE.running())
+ self.assertFalse(EXCEPTION_FUTURE.running())
+ self.assertFalse(SUCCESSFUL_FUTURE.running())
+
+ def test_result_with_timeout(self):
+ self.assertRaises(futures.TimeoutError,
+ PENDING_FUTURE.result, timeout=0)
+ self.assertRaises(futures.TimeoutError,
+ RUNNING_FUTURE.result, timeout=0)
+ self.assertRaises(futures.CancelledError,
+ CANCELLED_FUTURE.result, timeout=0)
+ self.assertRaises(futures.CancelledError,
+ CANCELLED_AND_NOTIFIED_FUTURE.result, timeout=0)
+ self.assertRaises(IOError, EXCEPTION_FUTURE.result, timeout=0)
+ self.assertEqual(SUCCESSFUL_FUTURE.result(timeout=0), 42)
+
+ def test_result_with_success(self):
+ # TODO(brian@sweetapp.com): This test is timing dependant.
+ def notification():
+ # Wait until the main thread is waiting for the result.
+ time.sleep(1)
+ f1.set_result(42)
+
+ f1 = create_future(state=PENDING)
+ t = threading.Thread(target=notification)
+ t.start()
+
+ self.assertEqual(f1.result(timeout=5), 42)
+
+ def test_result_with_cancel(self):
+ # TODO(brian@sweetapp.com): This test is timing dependant.
+ def notification():
+ # Wait until the main thread is waiting for the result.
+ time.sleep(1)
+ f1.cancel()
+
+ f1 = create_future(state=PENDING)
+ t = threading.Thread(target=notification)
+ t.start()
+
+ self.assertRaises(futures.CancelledError, f1.result, timeout=5)
+
+ def test_exception_with_timeout(self):
+ self.assertRaises(futures.TimeoutError,
+ PENDING_FUTURE.exception, timeout=0)
+ self.assertRaises(futures.TimeoutError,
+ RUNNING_FUTURE.exception, timeout=0)
+ self.assertRaises(futures.CancelledError,
+ CANCELLED_FUTURE.exception, timeout=0)
+ self.assertRaises(futures.CancelledError,
+ CANCELLED_AND_NOTIFIED_FUTURE.exception, timeout=0)
+ self.assertTrue(isinstance(EXCEPTION_FUTURE.exception(timeout=0),
+ IOError))
+ self.assertEqual(SUCCESSFUL_FUTURE.exception(timeout=0), None)
+
+ def test_exception_with_success(self):
+ def notification():
+ # Wait until the main thread is waiting for the exception.
+ time.sleep(1)
+ with f1._condition:
+ f1._state = FINISHED
+ f1._exception = IOError()
+ f1._condition.notify_all()
+
+ f1 = create_future(state=PENDING)
+ t = threading.Thread(target=notification)
+ t.start()
+
+ self.assertTrue(isinstance(f1.exception(timeout=5), IOError))
+
+@reap_threads
+def test_main():
+ try:
+ test_support.run_unittest(ProcessPoolExecutorTest,
+ ThreadPoolExecutorTest,
+ ProcessPoolWaitTests,
+ ThreadPoolWaitTests,
+ ProcessPoolAsCompletedTests,
+ ThreadPoolAsCompletedTests,
+ FutureTests,
+ ProcessPoolShutdownTest,
+ ThreadPoolShutdownTest)
+ finally:
+ test_support.reap_children()
+
+if __name__ == "__main__":
+ test_main()
diff --git a/vim/bundle/YouCompleteMe/third_party/pythonfutures/tox.ini b/vim/bundle/YouCompleteMe/third_party/pythonfutures/tox.ini
new file mode 100755
index 0000000..c1ff2f1
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/pythonfutures/tox.ini
@@ -0,0 +1,8 @@
+[tox]
+envlist = py26,py27,py31
+
+[testenv]
+commands={envpython} test_futures.py []
+
+[testenv:py26]
+deps=unittest2
diff --git a/vim/bundle/YouCompleteMe/third_party/requests-futures/.gitignore b/vim/bundle/YouCompleteMe/third_party/requests-futures/.gitignore
new file mode 100644
index 0000000..0f0a128
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/requests-futures/.gitignore
@@ -0,0 +1,4 @@
+build/
+dist/
+*.egg-info/
+*.pyc
diff --git a/vim/bundle/YouCompleteMe/third_party/requests-futures/.travis.yml b/vim/bundle/YouCompleteMe/third_party/requests-futures/.travis.yml
new file mode 100644
index 0000000..ada4746
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/requests-futures/.travis.yml
@@ -0,0 +1,11 @@
+language: python
+python:
+ - 2.7
+ - 3.2
+ - 3.3
+env: HTTPBIN_URL=http://httpbin.org/
+script: python test_requests_futures.py
+install: pip install -r requirements-python-2.7.txt
+notifications:
+ email:
+ - rwmcfa1@neces.com
diff --git a/vim/bundle/YouCompleteMe/third_party/requests-futures/LICENSE b/vim/bundle/YouCompleteMe/third_party/requests-futures/LICENSE
new file mode 100644
index 0000000..2a2a0c6
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/requests-futures/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2013 Ross McFarland
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/vim/bundle/YouCompleteMe/third_party/requests-futures/MANIFEST.in b/vim/bundle/YouCompleteMe/third_party/requests-futures/MANIFEST.in
new file mode 100644
index 0000000..b9d5079
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/requests-futures/MANIFEST.in
@@ -0,0 +1 @@
+include README.rst LICENSE test_requests_futures.py requirements-python-2.7.txt requirements-python-3.2.txt
diff --git a/vim/bundle/YouCompleteMe/third_party/requests-futures/README.rst b/vim/bundle/YouCompleteMe/third_party/requests-futures/README.rst
new file mode 100644
index 0000000..5a25b22
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/requests-futures/README.rst
@@ -0,0 +1,110 @@
+Asynchronous Python HTTP Requests for Humans
+============================================
+
+.. image:: https://travis-ci.org/ross/requests-futures.png?branch=master
+ :target: https://travis-ci.org/ross/requests-futures
+
+Small add-on for the python requests_ http library. Makes use of python 3.2's
+`concurrent.futures`_ or the backport_ for prior versions of python.
+
+The additional API and changes are minimal and strives to avoid surprises.
+
+The following synchronous code:
+
+.. code-block:: python
+
+ from requests import Session
+
+ session = Session()
+ # first requests starts and blocks until finished
+ response_one = session.get('http://httpbin.org/get')
+ # second request starts once first is finished
+ response_two = session.get('http://httpbin.org/get?foo=bar')
+ # both requests are complete
+ print('response one status: {0}'.format(response_one.status_code))
+ print(response_one.content)
+ print('response two status: {0}'.format(response_two.status_code))
+ print(response_two.content)
+
+Can be translated to make use of futures, and thus be asynchronous by creating
+a FuturesSession and catching the returned Future in place of Response. The
+Response can be retrieved by calling the result method on the Future:
+
+.. code-block:: python
+
+ from requests_futures.sessions import FuturesSession
+
+ session = FuturesSession()
+ # first request is started in background
+ future_one = session.get('http://httpbin.org/get')
+ # second requests is started immediately
+ future_two = session.get('http://httpbin.org/get?foo=bar')
+ # wait for the first request to complete, if it hasn't already
+ response_one = future_one.result()
+ print('response one status: {0}'.format(response_one.status_code))
+ print(response_one.content)
+ # wait for the second request to complete, if it hasn't already
+ response_two = future_two.result()
+ print('response two status: {0}'.format(response_two.status_code))
+ print(response_two.content)
+
+By default a ThreadPoolExecutor is created with 2 workers. If you would like to
+adjust that value or share a executor across multiple sessions you can provide
+one to the FuturesSession constructor.
+
+.. code-block:: python
+
+ from concurrent.futures import ThreadPoolExecutor
+ from requests_futures.sessions import FuturesSession
+
+ session = FuturesSession(executor=ThreadPoolExecutor(max_workers=10))
+ # ...
+
+As a shortcut in case of just increasing workers number you can pass
+`max_workers` straight to the `FuturesSession` constructor:
+
+.. code-block:: python
+
+ from requests_futures.sessions import FuturesSession
+ session = FuturesSession(max_workers=10)
+
+That's it. The api of requests.Session is preserved without any modifications
+beyond returning a Future rather than Response. As with all futures exceptions
+are shifted (thrown) to the future.result() call so try/except blocks should be
+moved there.
+
+Working in the Background
+=========================
+
+There is one additional parameter to the various request functions,
+background_callback, which allows you to work with the Response objects in the
+background thread. This can be useful for shifting work out of the foreground,
+for a simple example take json parsing.
+
+.. code-block:: python
+
+ from pprint import pprint
+ from requests_futures.sessions import FuturesSession
+
+ session = FuturesSession()
+
+ def bg_cb(sess, resp):
+ # parse the json storing the result on the response object
+ resp.data = resp.json()
+
+ future = session.get('http://httpbin.org/get', background_callback=bg_cb)
+ # do some other stuff, send some more requests while this one works
+ response = future.result()
+ print('response status {0}'.format(response.status_code))
+ # data will have been attached to the response object in the background
+ pprint(response.data)
+
+
+Installation
+============
+
+ pip install requests-futures
+
+.. _`requests`: https://github.com/kennethreitz/requests
+.. _`concurrent.futures`: http://docs.python.org/dev/library/concurrent.futures.html
+.. _backport: https://pypi.python.org/pypi/futures
diff --git a/vim/bundle/YouCompleteMe/third_party/requests-futures/requests_futures/__init__.py b/vim/bundle/YouCompleteMe/third_party/requests-futures/requests_futures/__init__.py
new file mode 100644
index 0000000..af7acae
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/requests-futures/requests_futures/__init__.py
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+
+# Requests Futures
+
+"""
+async requests HTTP library
+~~~~~~~~~~~~~~~~~~~~~
+
+
+"""
+
+__title__ = 'requests-futures'
+__version__ = '0.9.4'
+__build__ = 0x000000
+__author__ = 'Ross McFarland'
+__license__ = 'Apache 2.0'
+__copyright__ = 'Copyright 2013 Ross McFarland'
+
+# Set default logging handler to avoid "No handler found" warnings.
+import logging
+try: # Python 2.7+
+ from logging import NullHandler
+except ImportError:
+ class NullHandler(logging.Handler):
+ def emit(self, record):
+ pass
+
+logging.getLogger(__name__).addHandler(NullHandler())
diff --git a/vim/bundle/YouCompleteMe/third_party/requests-futures/requests_futures/sessions.py b/vim/bundle/YouCompleteMe/third_party/requests-futures/requests_futures/sessions.py
new file mode 100644
index 0000000..ad2af1b
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/requests-futures/requests_futures/sessions.py
@@ -0,0 +1,73 @@
+# -*- coding: utf-8 -*-
+"""
+requests_futures
+~~~~~~~~~~~~~~~~
+
+This module provides a small add-on for the requests http library. It makes use
+of python 3.3's concurrent.futures or the futures backport for previous
+releases of python.
+
+ from requests_futures import FuturesSession
+
+ session = FuturesSession()
+ # request is run in the background
+ future = session.get('http://httpbin.org/get')
+ # ... do other stuff ...
+ # wait for the request to complete, if it hasn't already
+ response = future.result()
+ print('response status: {0}'.format(response.status_code))
+ print(response.content)
+
+"""
+
+from concurrent.futures import ThreadPoolExecutor
+from requests import Session
+from requests.adapters import DEFAULT_POOLSIZE, HTTPAdapter
+
+class FuturesSession(Session):
+
+ def __init__(self, executor=None, max_workers=2, *args, **kwargs):
+ """Creates a FuturesSession
+
+ Notes
+ ~~~~~
+
+ * ProcessPoolExecutor is not supported b/c Response objects are
+ not picklable.
+
+ * If you provide both `executor` and `max_workers`, the latter is
+ ignored and provided executor is used as is.
+ """
+ super(FuturesSession, self).__init__(*args, **kwargs)
+ if executor is None:
+ executor = ThreadPoolExecutor(max_workers=max_workers)
+ # set connection pool size equal to max_workers if needed
+ if max_workers > DEFAULT_POOLSIZE:
+ adapter_kwargs = dict(pool_connections=max_workers,
+ pool_maxsize=max_workers)
+ self.mount('https://', HTTPAdapter(**adapter_kwargs))
+ self.mount('http://', HTTPAdapter(**adapter_kwargs))
+
+ self.executor = executor
+
+ def request(self, *args, **kwargs):
+ """Maintains the existing api for Session.request.
+
+ Used by all of the higher level methods, e.g. Session.get.
+
+ The background_callback param allows you to do some processing on the
+ response in the background, e.g. call resp.json() so that json parsing
+ happens in the background thread.
+ """
+ func = sup = super(FuturesSession, self).request
+
+ background_callback = kwargs.pop('background_callback', None)
+ if background_callback:
+ def wrap(*args_, **kwargs_):
+ resp = sup(*args_, **kwargs_)
+ background_callback(self, resp)
+ return resp
+
+ func = wrap
+
+ return self.executor.submit(func, *args, **kwargs)
diff --git a/vim/bundle/YouCompleteMe/third_party/requests-futures/requirements-python-2.7.txt b/vim/bundle/YouCompleteMe/third_party/requests-futures/requirements-python-2.7.txt
new file mode 100644
index 0000000..e70089a
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/requests-futures/requirements-python-2.7.txt
@@ -0,0 +1,2 @@
+futures
+requests>=1.2.0
diff --git a/vim/bundle/YouCompleteMe/third_party/requests-futures/requirements-python-3.2.txt b/vim/bundle/YouCompleteMe/third_party/requests-futures/requirements-python-3.2.txt
new file mode 100644
index 0000000..f250822
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/requests-futures/requirements-python-3.2.txt
@@ -0,0 +1 @@
+requests>=1.2.0
diff --git a/vim/bundle/YouCompleteMe/third_party/requests-futures/setup.py b/vim/bundle/YouCompleteMe/third_party/requests-futures/setup.py
new file mode 100644
index 0000000..3f100d7
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/requests-futures/setup.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+
+import os
+import sys
+
+import requests_futures
+
+try:
+ from setuptools import setup
+except ImportError:
+ from distutils.core import setup
+
+if sys.argv[-1] == 'publish':
+ os.system('python setup.py sdist upload')
+ sys.exit()
+
+packages = [
+ 'requests_futures',
+]
+
+requires = [
+ 'requests>=1.2.0'
+]
+
+if sys.version_info < (3, 2):
+ requires.append('futures>=2.1.3')
+
+setup(
+ name='requests-futures',
+ version=requests_futures.__version__,
+ description='Asynchronous Python HTTP for Humans.',
+ long_description=open('README.rst').read(),
+ author='Ross McFarland',
+ author_email='rwmcfa1@neces.com',
+ packages=packages,
+ package_dir={'requests_futures': 'requests_futures'},
+ package_data={'requests_futures': ['LICENSE', 'README.rst']},
+ include_package_data=True,
+ install_requires=requires,
+ license='Apache License v2',
+ url='https://github.com/ross/requests-futures',
+ zip_safe=False,
+ classifiers=(
+ 'Development Status :: 5 - Production/Stable',
+ 'Intended Audience :: Developers',
+ 'Natural Language :: English',
+ 'License :: OSI Approved :: Apache Software License',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.1',
+ 'Programming Language :: Python :: 3.2',
+ 'Programming Language :: Python :: 3.3',
+ ),
+)
diff --git a/vim/bundle/YouCompleteMe/third_party/requests-futures/test_requests_futures.py b/vim/bundle/YouCompleteMe/third_party/requests-futures/test_requests_futures.py
new file mode 100644
index 0000000..b41836e
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/requests-futures/test_requests_futures.py
@@ -0,0 +1,84 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+"""Tests for Requests."""
+
+from concurrent.futures import Future
+from requests import Response
+from os import environ
+from requests_futures.sessions import FuturesSession
+from unittest import TestCase, main
+
+HTTPBIN = environ.get('HTTPBIN_URL', 'http://httpbin.org/')
+
+def httpbin(*suffix):
+ """Returns url for HTTPBIN resource."""
+ return HTTPBIN + '/'.join(suffix)
+
+
+class RequestsTestCase(TestCase):
+
+ def test_futures_session(self):
+ # basic futures get
+ sess = FuturesSession()
+ future = sess.get(httpbin('get'))
+ self.assertIsInstance(future, Future)
+ resp = future.result()
+ self.assertIsInstance(resp, Response)
+ self.assertEqual(200, resp.status_code)
+
+ # non-200, 404
+ future = sess.get(httpbin('status/404'))
+ resp = future.result()
+ self.assertEqual(404, resp.status_code)
+
+ def cb(s, r):
+ self.assertIsInstance(s, FuturesSession)
+ self.assertIsInstance(r, Response)
+ # add the parsed json data to the response
+ r.data = r.json()
+
+ future = sess.get(httpbin('get'), background_callback=cb)
+ # this should block until complete
+ resp = future.result()
+ self.assertEqual(200, resp.status_code)
+ # make sure the callback was invoked
+ self.assertTrue(hasattr(resp, 'data'))
+
+ def rasing_cb(s, r):
+ raise Exception('boom')
+
+ future = sess.get(httpbin('get'), background_callback=rasing_cb)
+ with self.assertRaises(Exception) as cm:
+ resp = future.result()
+ self.assertEqual('boom', cm.exception.args[0])
+
+ def test_max_workers(self):
+ """ Tests the `max_workers` shortcut. """
+ from concurrent.futures import ThreadPoolExecutor
+ session = FuturesSession()
+ self.assertEqual(session.executor._max_workers, 2)
+ session = FuturesSession(max_workers=5)
+ self.assertEqual(session.executor._max_workers, 5)
+ session = FuturesSession(executor=ThreadPoolExecutor(max_workers=10))
+ self.assertEqual(session.executor._max_workers, 10)
+ session = FuturesSession(executor=ThreadPoolExecutor(max_workers=10),
+ max_workers=5)
+ self.assertEqual(session.executor._max_workers, 10)
+
+ def test_redirect(self):
+ """ Tests for the ability to cleanly handle redirects. """
+ sess = FuturesSession()
+ future = sess.get(httpbin('redirect-to?url=get'))
+ self.assertIsInstance(future, Future)
+ resp = future.result()
+ self.assertIsInstance(resp, Response)
+ self.assertEqual(200, resp.status_code)
+
+ future = sess.get(httpbin('redirect-to?url=status/404'))
+ resp = future.result()
+ self.assertEqual(404, resp.status_code)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/vim/bundle/YouCompleteMe/third_party/retries/retries.py b/vim/bundle/YouCompleteMe/third_party/retries/retries.py
new file mode 100644
index 0000000..da7fa48
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/third_party/retries/retries.py
@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+#
+# Copyright 2012 by Jeff Laughlin Consulting LLC
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+import sys
+from time import sleep
+
+# Source: https://gist.github.com/n1ywb/2570004
+
+def example_exc_handler(tries_remaining, exception, delay):
+ """Example exception handler; prints a warning to stderr.
+
+ tries_remaining: The number of tries remaining.
+ exception: The exception instance which was raised.
+ """
+ print >> sys.stderr, "Caught '%s', %d tries remaining, sleeping for %s seconds" % (exception, tries_remaining, delay)
+
+
+def retries(max_tries, delay=1, backoff=2, exceptions=(Exception,), hook=None):
+ """Function decorator implementing retrying logic.
+
+ delay: Sleep this many seconds * backoff * try number after failure
+ backoff: Multiply delay by this factor after each failure
+ exceptions: A tuple of exception classes; default (Exception,)
+ hook: A function with the signature myhook(tries_remaining, exception);
+ default None
+
+ The decorator will call the function up to max_tries times if it raises
+ an exception.
+
+ By default it catches instances of the Exception class and subclasses.
+ This will recover after all but the most fatal errors. You may specify a
+ custom tuple of exception classes with the 'exceptions' argument; the
+ function will only be retried if it raises one of the specified
+ exceptions.
+
+ Additionally you may specify a hook function which will be called prior
+ to retrying with the number of remaining tries and the exception instance;
+ see given example. This is primarily intended to give the opportunity to
+ log the failure. Hook is not called after failure if no retries remain.
+ """
+ def dec(func):
+ def f2(*args, **kwargs):
+ mydelay = delay
+ tries = reversed(range(max_tries))
+ for tries_remaining in tries:
+ try:
+ return func(*args, **kwargs)
+ except exceptions as e:
+ if tries_remaining > 0:
+ if hook is not None:
+ hook(tries_remaining, e, mydelay)
+ sleep(mydelay)
+ mydelay = mydelay * backoff
+ else:
+ raise
+ else:
+ break
+ return f2
+ return dec
diff --git a/vim/bundle/YouCompleteMe/tox.ini b/vim/bundle/YouCompleteMe/tox.ini
new file mode 100644
index 0000000..70d6d70
--- /dev/null
+++ b/vim/bundle/YouCompleteMe/tox.ini
@@ -0,0 +1,4 @@
+[flake8]
+ignore = E111,E114,E121,E125,E126,E127,E128,E129,E131,E133,E201,E202,E203,E211,E221,E222,E241,E251,E261,E303,E402,W503
+max-complexity = 10
+max-line-length = 80
diff --git a/vim/bundle/lightline.vim/.gitignore b/vim/bundle/lightline.vim/.gitignore
new file mode 100644
index 0000000..0a56e3f
--- /dev/null
+++ b/vim/bundle/lightline.vim/.gitignore
@@ -0,0 +1 @@
+/doc/tags
diff --git a/vim/bundle/lightline.vim/.travis.yml b/vim/bundle/lightline.vim/.travis.yml
new file mode 100644
index 0000000..ae4b73f
--- /dev/null
+++ b/vim/bundle/lightline.vim/.travis.yml
@@ -0,0 +1,22 @@
+language: generic
+
+sudo: false
+
+install:
+ - git clone --depth=1 https://github.com/thinca/vim-themis /tmp/themis
+ - git clone https://github.com/vim/vim $HOME/vim
+ - (if ! test -d $HOME/vim-7.4/bin; then cd $HOME/vim && git checkout . && git checkout v7.4 && ./configure --prefix=$HOME/vim-7.4 && make && make install; fi)
+ - (if ! test -d $HOME/vim-7.3/bin; then cd $HOME/vim && git checkout . && git checkout v7.3 && ./configure --prefix=$HOME/vim-7.3 && make && make install; fi)
+ - (if ! test -d $HOME/vim-7.2.051/bin; then cd $HOME/vim && git checkout . && git checkout v7.2.051 && ./configure --prefix=$HOME/vim-7.2.051 && make && make install; fi)
+
+cache:
+ directories:
+ - $HOME/vim-7.4
+ - $HOME/vim-7.3
+ - $HOME/vim-7.2.051
+
+script:
+ - /tmp/themis/bin/themis --reporter spec
+ - PATH=$HOME/vim-7.4/bin/:$PATH /tmp/themis/bin/themis --reporter spec
+ - PATH=$HOME/vim-7.3/bin/:$PATH /tmp/themis/bin/themis --reporter spec
+ - PATH=$HOME/vim-7.2.051/bin/:$PATH /tmp/themis/bin/themis --reporter spec
diff --git a/vim/bundle/lightline.vim/LICENSE b/vim/bundle/lightline.vim/LICENSE
new file mode 100644
index 0000000..3000b84
--- /dev/null
+++ b/vim/bundle/lightline.vim/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2013-2016 itchyny
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/vim/bundle/lightline.vim/README.md b/vim/bundle/lightline.vim/README.md
new file mode 100644
index 0000000..03f5da1
--- /dev/null
+++ b/vim/bundle/lightline.vim/README.md
@@ -0,0 +1,788 @@
+# lightline.vim
+A light and configurable statusline/tabline for Vim
+
+https://github.com/itchyny/lightline.vim
+
+### powerline theme (default)
+
+![lightline.vim - powerline](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/powerline/0.png)
+
+### wombat (with the patched font)
+
+![lightline.vim - wombat](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/wombat/0.png)
+
+### jellybeans (with the patched font)
+
+![lightline.vim - jellybeans](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/jellybeans/0.png)
+
+### solarized theme (dark)
+
+![lightline.vim - solarized_dark](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_dark/0.png)
+
+### solarized theme (light)
+
+![lightline.vim - solarized_light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_light/0.png)
+
+### PaperColor theme (light)
+
+![lightline.vim - PaperColor](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/PaperColor/0.png)
+
+### seoul256 theme
+
+![lightline.vim - seoul256](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/seoul256/0.png)
+
+### landscape theme (with the patched font)
+
+![lightline.vim - landscape](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/landscape/0.png)
+
+With branch name, read-only mark and modified mark.
+![lightline.vim - landscape - fugitive](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/landscape/5.png)
+
+landscape is my colorscheme, which is a high-contrast cui-supported colorscheme, available at https://github.com/itchyny/landscape.vim
+
+## Why yet another clone of powerline?
++ [vim-powerline](https://github.com/Lokaltog/vim-powerline) is a nice plugin, but deprecated.
++ [powerline](https://github.com/Lokaltog/powerline) is a nice plugin, but difficult to configure.
++ [vim-airline](https://github.com/bling/vim-airline) is a nice plugin, but it uses too much functions of other plugins, which should be done by users in `.vimrc`.
+
+## Spirit of this plugin
++ Minimalism. The core script is very small.
++ Configurability. You can create your own component and easily add to the statusline/tabline.
++ Orthogonality. Any plugin should not change the settings of another plugin. Such plugin-crossing settings should be written by users in `.vimrc`.
+
+## Author
+itchyny (https://github.com/itchyny)
+
+## License
+This software is released under the MIT License, see LICENSE.
+
+## Installation
+### Manually
+1. Put all files under $VIM.
+
+### Pathogen
+1. Install with the following command.
+
+ git clone https://github.com/itchyny/lightline.vim ~/.vim/bundle/lightline.vim
+
+### Vundle (https://github.com/gmarik/Vundle.vim)
+1. Add the following configuration to your `.vimrc`.
+
+ Plugin 'itchyny/lightline.vim'
+
+2. Install with `:PluginInstall`.
+
+### NeoBundle (https://github.com/Shougo/neobundle.vim)
+1. Add the following configuration to your `.vimrc`.
+
+ NeoBundle 'itchyny/lightline.vim'
+
+2. Install with `:NeoBundleInstall`.
+
+### vim-plug (https://github.com/junegunn/vim-plug)
+1. Add the following configuration to your `.vimrc`.
+
+ Plug 'itchyny/lightline.vim'
+
+2. Install with `:PlugInstall`.
+
+## Configuration tutorial
+By default, the statusline looks like:
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/1.png)
+
+If you use the wombat colorscheme, add the following settings to your `.vimrc` (or \_vimrc on Windows):
+```vim
+let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ }
+```
+to get:
+
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/2.png)
+
+
+If your statusline looks like
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/21.png)
+
+and the cool statuslines appear only on `:vsp`, add
+```vim
+set laststatus=2
+```
+to your `.vimrc`.
+
+
+If you have problem like
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/20.png)
+
+then add
+```sh
+export TERM=xterm-256color
+```
+to your `.*shrc` and add
+```vim
+if !has('gui_running')
+ set t_Co=256
+endif
+```
+to your `.vimrc`.
+
+
+If the colors of the statusline do not change from the default colors, move the settings of `g:lightline` before setting the colorscheme.
+
+If you are reloading your `.vimrc` via `autocmd` and get this problem
+
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/20.png)
+
+when saving it you need to add the nested flag to your `autocmd` like so
+
+```vim
+augroup reload_vimrc
+ autocmd!
+ autocmd bufwritepost $MYVIMRC nested source $MYVIMRC
+augroup END
+```
+
+
+Colors appear correctly? Now let's see how to change the appearance.
+
+
+You may think that the default read-only mark is not so cool:
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/3.png)
+
+Then edit the read-only component.
+The lightline components are stored in `g:lightline.component`.
+So you add the settings of `g:lightline.component.readonly` in your `.vimrc`. (the following settings are effective with the patched font for vim-powerline):
+```vim
+let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'component': {
+ \ 'readonly': '%{&readonly?"⭤":""}',
+ \ }
+ \ }
+```
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/4.png)
+
+How nice!
+
+But the boundaries are quadrilateral. You may miss the powerline.
+You have installed a cool font for powerlines, so you can use it.
+```vim
+let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'component': {
+ \ 'readonly': '%{&readonly?"⭤":""}',
+ \ },
+ \ 'separator': { 'left': '⮀', 'right': '⮂' },
+ \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
+ \ }
+```
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/5.png)
+
+Hurrah! Cool!
+
+
+If your statusline looks like:
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/16.png)
+
+the patched font is not installed.
+
+There are two kinds of patched fonts:
+
++ The patched fonts for [vim-powerline](https://github.com/Lokaltog/vim-powerline): see https://github.com/Lokaltog/vim-powerline/tree/develop/fontpatcher
++ The patched fonts for [powerline](https://github.com/Lokaltog/powerline): see https://github.com/Lokaltog/powerline-fonts
+
+Create or download a font and install it.
+And add the `guifont` setting to your `.vimrc` (see `:help 'guifont'` for more detail).
+If you are using the vim in a terminal, the font cannot be controlled in `.vimrc`.
+Open the setting of the terminal and select the patched font.
+
+This tutorial is based on the former, the font for vim-powerline (Inconsolata for Powerline).
+If you have installed the patched font for powerline, use the following settings instead.
+```vim
+let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'component': {
+ \ 'readonly': '%{&readonly?"":""}',
+ \ },
+ \ 'separator': { 'left': '', 'right': '' },
+ \ 'subseparator': { 'left': '', 'right': '' }
+ \ }
+```
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/19.png)
+
+If you have installed the font for powerline and your statusline looks like
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/18.png)
+
+remove
+```vim
+set ambiwidth=double
+```
+from your `.vimrc`. If you want to keep this setting, use the patched font for vim-powerline.
++ https://github.com/Lokaltog/vim-powerline/tree/develop/fontpatcher
+
+
+If you will not install a patched font, use ascii characters like:
+```vim
+let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'component': {
+ \ 'readonly': '%{&readonly?"x":""}',
+ \ },
+ \ 'separator': { 'left': '', 'right': '' },
+ \ 'subseparator': { 'left': '|', 'right': '|' }
+ \ }
+```
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/17.png)
+
+
+
+If the triangles do not appear (but you get some spaces or weird characters like &lt;bf&gt; or ¿), firstly try adding
+```vim
+set encoding=utf-8
+scriptencoding utf-8
+```
+to the head of your `.vimrc`.
+Still you have weird characters, use the unicode numbers. For powerline font
+users:
+```vim
+ \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
+ \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }
+```
+For vim-powerline font users:
+```vim
+ \ 'separator': { 'left': "\u2b80", 'right': "\u2b82" },
+ \ 'subseparator': { 'left': "\u2b81", 'right': "\u2b83" }
+```
+
+
+Almost all of things go well with the patched font but if the triangle looks weird:
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/22.png)
+
+If you are using iTerm2, change the following settings of iTerm2:
++ set `Profiles>Colors>Minimum contrast` to the Lowest.
++ set `Profiles>Window>Transparency` to the Opaquest.
+
+For other terminals, this weird-triangle problem will be resolved by disabling transparency or contrast adjustment.
+
+
+If you want to get rid of the extraneous default vim mode information that is now provided by lightline:
+![lightline.vim - showmode](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/showmode.png)
+```vim
+set noshowmode
+```
+
+
+Now, let us get back to the tutorial (with the patched font for vim-powerline).
+You look into a help file to find the marks annoying.
+
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/6.png)
+
+Help files are read-only and no-modifiable? We know that!
+OK, so you again edit the components.
+```vim
+let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'component': {
+ \ 'readonly': '%{&filetype=="help"?"":&readonly?"⭤":""}',
+ \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}'
+ \ },
+ \ 'separator': { 'left': '⮀', 'right': '⮂' },
+ \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
+ \ }
+```
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/7.png)
+
+Huh? Weird!
+The components do not collapse even if they have no information!
+In order to avoid this situation, you set expressions to `g:lightline.component_visible_condition`, which should become 1 only when the corresponding components have information.
+```vim
+let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'component': {
+ \ 'readonly': '%{&filetype=="help"?"":&readonly?"⭤":""}',
+ \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}'
+ \ },
+ \ 'component_visible_condition': {
+ \ 'readonly': '(&filetype!="help"&& &readonly)',
+ \ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))'
+ \ },
+ \ 'separator': { 'left': '⮀', 'right': '⮂' },
+ \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
+ \ }
+```
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/8.png)
+
+Okay. It works nice.
+
+
+
+How does lightline decide the components to show in the statusline?
+It's very simple.
+The variables to select components are `g:lightline.active.left` and `g:lightline.active.right`.
+For example, you add the `g:lightline.active.left` in `.vimrc`.
+```vim
+let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ],
+ \ [ 'readonly', 'filename', 'modified' ] ]
+ \ },
+ \ 'component': {
+ \ 'readonly': '%{&filetype=="help"?"":&readonly?"⭤":""}',
+ \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}'
+ \ },
+ \ 'component_visible_condition': {
+ \ 'readonly': '(&filetype!="help"&& &readonly)',
+ \ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))'
+ \ },
+ \ 'separator': { 'left': '⮀', 'right': '⮂' },
+ \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
+ \ }
+```
+If the plugin arranges all the components (in a situation you `set paste` and the file `.vimrc` is read-only, try to modify):
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/9.png)
+
+The mode component, the paste component, read-only component, filename component and modified component in a row.
+Normally, the paste component does not show up.
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/10.png)
+
+If the file is not read-only (more common cases), the read-only component does not show up.
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/11.png)
+
+
+Again look into `g:lightline.active.left`.
+```vim
+let g:lightline = {
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ],
+ \ [ 'readonly', 'filename', 'modified' ] ] ...
+```
+And the screen shot of all the components.
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/9.png)
+
+The mode and paste component are displayed in the same group.
+The read-only, filename and modified component are in the second group.
+It corresponds to the structure of `g:lightline.active.left`.
+You can configure the components in the statusline by the following four variables:
++ `g:lightline.active.left`
++ `g:lightline.active.right`
++ `g:lightline.inactive.left`
++ `g:lightline.inactive.right`
+
+Of course, your settings in `.vimrc` have priority over the default settings in lightline.
+
+
+
+GitHub branch is important for us.
+And it is a default component in [powerline](https://github.com/Lokaltog/powerline) and [vim-powerline](https://github.com/Lokaltog/vim-powerline).
+However, lightline does not provide the branch feature by default.
+
+In order to show the branch in the statusline, you firstly install the [vim-fugitive](https://github.com/tpope/vim-fugitive) plugin.
+Then edit the `g:lightline` in your `.vimrc`.
++ Add your fugitive component to `g:lightline.component`.
++ Add the condition when the fugitive component has information to `g:lightline.component_visible_condition`.
++ Add the component by inserting `'fugitive'` to `g:lightline.active.left`.
+
+```vim
+let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ],
+ \ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
+ \ },
+ \ 'component': {
+ \ 'readonly': '%{&filetype=="help"?"":&readonly?"⭤":""}',
+ \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}',
+ \ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'
+ \ },
+ \ 'component_visible_condition': {
+ \ 'readonly': '(&filetype!="help"&& &readonly)',
+ \ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))',
+ \ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'
+ \ },
+ \ 'separator': { 'left': '⮀', 'right': '⮂' },
+ \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
+ \ }
+```
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/12.png)
+
+Okay, the branch component is added!
+
+
+
+Now, you might get tired of setting both `'component'` and `'component_visible_condition'`.
+Or if you want to do something more complicated?
+
+
+In fact, the components can be created using functions.
+Add your function names for components to `g:lightline.component_function`.
+```vim
+let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ],
+ \ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
+ \ },
+ \ 'component_function': {
+ \ 'fugitive': 'LightLineFugitive',
+ \ 'readonly': 'LightLineReadonly',
+ \ 'modified': 'LightLineModified'
+ \ },
+ \ 'separator': { 'left': '⮀', 'right': '⮂' },
+ \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
+ \ }
+
+function! LightLineModified()
+ if &filetype == "help"
+ return ""
+ elseif &modified
+ return "+"
+ elseif &modifiable
+ return ""
+ else
+ return ""
+ endif
+endfunction
+
+function! LightLineReadonly()
+ if &filetype == "help"
+ return ""
+ elseif &readonly
+ return "⭤"
+ else
+ return ""
+ endif
+endfunction
+
+function! LightLineFugitive()
+ return exists('*fugitive#head') ? fugitive#head() : ''
+endfunction
+```
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/13.png)
+
+Fine and readable!
+
+
+Finally, you come up with concatenating the three components: the read-only mark, the filename and the modified mark.
+Now you may know what to do.
+```vim
+let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ],
+ \ [ 'fugitive', 'filename' ] ]
+ \ },
+ \ 'component_function': {
+ \ 'fugitive': 'LightLineFugitive',
+ \ 'readonly': 'LightLineReadonly',
+ \ 'modified': 'LightLineModified',
+ \ 'filename': 'LightLineFilename'
+ \ },
+ \ 'separator': { 'left': '⮀', 'right': '⮂' },
+ \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
+ \ }
+
+function! LightLineModified()
+ if &filetype == "help"
+ return ""
+ elseif &modified
+ return "+"
+ elseif &modifiable
+ return ""
+ else
+ return ""
+ endif
+endfunction
+
+function! LightLineReadonly()
+ if &filetype == "help"
+ return ""
+ elseif &readonly
+ return "⭤"
+ else
+ return ""
+ endif
+endfunction
+
+function! LightLineFugitive()
+ return exists('*fugitive#head') ? fugitive#head() : ''
+endfunction
+
+function! LightLineFilename()
+ return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
+ \ ('' != expand('%:t') ? expand('%:t') : '[No Name]') .
+ \ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
+endfunction
+```
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/14.png)
+
+Oops! We forgot the cool mark for the branch component! (work with the patched font for vim-powerline)
+```vim
+function! LightLineFugitive()
+ if exists("*fugitive#head")
+ let branch = fugitive#head()
+ return branch !=# '' ? '⭠ '.branch : ''
+ endif
+ return ''
+endfunction
+```
+![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/15.png)
+
+How cool!!!
+
+Of course, you can name your component as you wish.
+```vim
+let g:lightline = {
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ],
+ \ [ 'my_component' ] ] },
+ \ 'component_function': {
+ \ 'my_component': 'LightLineComponent', ...
+```
+
+This is the end of the tutorial. For more information, see `:help lightline`. Good luck with your nice statuslines.
+
+### Cool characters for the patched fonts
+
+Symbol | Default | powerline | vim-powerline
+------------------ | ------- | ------------- | -------------
+separator.left | '' | '' (\ue0b0) | '⮀' (\u2b80)
+separator.right | '' | '' (\ue0b2) | '⮂' (\u2b82)
+subseparator.left | '\|' | '' (\ue0b1) | '⮁' (\u2b81)
+subseparator.right | '\|' | '' (\ue0b3) | '⮃' (\u2b83)
+branch symbol | -- | '' (\ue0a0) | '⭠' (\u2b60)
+readonly symbol | -- | '' (\ue0a2) | '⭤' (\u2b64)
+linecolumn symbol | -- | '' (\ue0a1) | '⭡' (\u2b81)
+
+### My settings
+I show my settings. I use the patched font for vim-powerline.
+```vim
+let g:lightline = {
+ \ 'colorscheme': 'landscape',
+ \ 'mode_map': { 'c': 'NORMAL' },
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ]
+ \ },
+ \ 'component_function': {
+ \ 'modified': 'LightLineModified',
+ \ 'readonly': 'LightLineReadonly',
+ \ 'fugitive': 'LightLineFugitive',
+ \ 'filename': 'LightLineFilename',
+ \ 'fileformat': 'LightLineFileformat',
+ \ 'filetype': 'LightLineFiletype',
+ \ 'fileencoding': 'LightLineFileencoding',
+ \ 'mode': 'LightLineMode',
+ \ },
+ \ 'separator': { 'left': '⮀', 'right': '⮂' },
+ \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
+ \ }
+
+function! LightLineModified()
+ return &ft =~ 'help\|vimfiler\|gundo' ? '' : &modified ? '+' : &modifiable ? '' : '-'
+endfunction
+
+function! LightLineReadonly()
+ return &ft !~? 'help\|vimfiler\|gundo' && &readonly ? '⭤' : ''
+endfunction
+
+function! LightLineFilename()
+ return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
+ \ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
+ \ &ft == 'unite' ? unite#get_status_string() :
+ \ &ft == 'vimshell' ? vimshell#get_status_string() :
+ \ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
+ \ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
+endfunction
+
+function! LightLineFugitive()
+ if &ft !~? 'vimfiler\|gundo' && exists("*fugitive#head")
+ let branch = fugitive#head()
+ return branch !=# '' ? '⭠ '.branch : ''
+ endif
+ return ''
+endfunction
+
+function! LightLineFileformat()
+ return winwidth(0) > 70 ? &fileformat : ''
+endfunction
+
+function! LightLineFiletype()
+ return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
+endfunction
+
+function! LightLineFileencoding()
+ return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
+endfunction
+
+function! LightLineMode()
+ return winwidth(0) > 60 ? lightline#mode() : ''
+endfunction
+```
+When the current window width is narrow, the mode component and the file information component collapse.
+For example, the [gundo](https://github.com/sjl/gundo.vim) buffer is narrow.
+
+Before:
+![lightline.vim - gundo](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/gundo0.png)
+
+After:
+![lightline.vim - gundo](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/gundo1.png)
+
+Nice looking, isn't it?
+
+### For power users
+For users who uses following plugins.
+
+- [CtrlP](https://github.com/kien/ctrlp.vim)
+- [Tagbar](https://github.com/majutsushi/tagbar)
+- [Gundo](http://github.com/sjl/gundo.vim)
+- [NERDtree](http://github.com/scrooloose/nerdtree)
+- [Syntastic](https://github.com/scrooloose/syntastic)
+- [unite.vim](https://github.com/Shougo/unite.vim)
+- [vimfiler.vim](https://github.com/Shougo/vimfiler.vim)
+- [vimshell.vim](https://github.com/Shougo/vimshell.vim)
+
+```vim
+let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ], ['ctrlpmark'] ],
+ \ 'right': [ [ 'syntastic', 'lineinfo' ], ['percent'], [ 'fileformat', 'fileencoding', 'filetype' ] ]
+ \ },
+ \ 'component_function': {
+ \ 'fugitive': 'LightLineFugitive',
+ \ 'filename': 'LightLineFilename',
+ \ 'fileformat': 'LightLineFileformat',
+ \ 'filetype': 'LightLineFiletype',
+ \ 'fileencoding': 'LightLineFileencoding',
+ \ 'mode': 'LightLineMode',
+ \ 'ctrlpmark': 'CtrlPMark',
+ \ },
+ \ 'component_expand': {
+ \ 'syntastic': 'SyntasticStatuslineFlag',
+ \ },
+ \ 'component_type': {
+ \ 'syntastic': 'error',
+ \ },
+ \ 'subseparator': { 'left': '|', 'right': '|' }
+ \ }
+
+function! LightLineModified()
+ return &ft =~ 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
+endfunction
+
+function! LightLineReadonly()
+ return &ft !~? 'help' && &readonly ? 'RO' : ''
+endfunction
+
+function! LightLineFilename()
+ let fname = expand('%:t')
+ return fname == 'ControlP' && has_key(g:lightline, 'ctrlp_item') ? g:lightline.ctrlp_item :
+ \ fname == '__Tagbar__' ? g:lightline.fname :
+ \ fname =~ '__Gundo\|NERD_tree' ? '' :
+ \ &ft == 'vimfiler' ? vimfiler#get_status_string() :
+ \ &ft == 'unite' ? unite#get_status_string() :
+ \ &ft == 'vimshell' ? vimshell#get_status_string() :
+ \ ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
+ \ ('' != fname ? fname : '[No Name]') .
+ \ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
+endfunction
+
+function! LightLineFugitive()
+ try
+ if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
+ let mark = '' " edit here for cool mark
+ let branch = fugitive#head()
+ return branch !=# '' ? mark.branch : ''
+ endif
+ catch
+ endtry
+ return ''
+endfunction
+
+function! LightLineFileformat()
+ return winwidth(0) > 70 ? &fileformat : ''
+endfunction
+
+function! LightLineFiletype()
+ return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
+endfunction
+
+function! LightLineFileencoding()
+ return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
+endfunction
+
+function! LightLineMode()
+ let fname = expand('%:t')
+ return fname == '__Tagbar__' ? 'Tagbar' :
+ \ fname == 'ControlP' ? 'CtrlP' :
+ \ fname == '__Gundo__' ? 'Gundo' :
+ \ fname == '__Gundo_Preview__' ? 'Gundo Preview' :
+ \ fname =~ 'NERD_tree' ? 'NERDTree' :
+ \ &ft == 'unite' ? 'Unite' :
+ \ &ft == 'vimfiler' ? 'VimFiler' :
+ \ &ft == 'vimshell' ? 'VimShell' :
+ \ winwidth(0) > 60 ? lightline#mode() : ''
+endfunction
+
+function! CtrlPMark()
+ if expand('%:t') =~ 'ControlP' && has_key(g:lightline, 'ctrlp_item')
+ call lightline#link('iR'[g:lightline.ctrlp_regex])
+ return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item
+ \ , g:lightline.ctrlp_next], 0)
+ else
+ return ''
+ endif
+endfunction
+
+let g:ctrlp_status_func = {
+ \ 'main': 'CtrlPStatusFunc_1',
+ \ 'prog': 'CtrlPStatusFunc_2',
+ \ }
+
+function! CtrlPStatusFunc_1(focus, byfname, regex, prev, item, next, marked)
+ let g:lightline.ctrlp_regex = a:regex
+ let g:lightline.ctrlp_prev = a:prev
+ let g:lightline.ctrlp_item = a:item
+ let g:lightline.ctrlp_next = a:next
+ return lightline#statusline(0)
+endfunction
+
+function! CtrlPStatusFunc_2(str)
+ return lightline#statusline(0)
+endfunction
+
+let g:tagbar_status_func = 'TagbarStatusFunc'
+
+function! TagbarStatusFunc(current, sort, fname, ...) abort
+ let g:lightline.fname = a:fname
+ return lightline#statusline(0)
+endfunction
+
+augroup AutoSyntastic
+ autocmd!
+ autocmd BufWritePost *.c,*.cpp call s:syntastic()
+augroup END
+function! s:syntastic()
+ SyntasticCheck
+ call lightline#update()
+endfunction
+
+let g:unite_force_overwrite_statusline = 0
+let g:vimfiler_force_overwrite_statusline = 0
+let g:vimshell_force_overwrite_statusline = 0
+```
+
+### Note for developers of other plugins
+Appearance consistency matters.
+
+The statusline is an important space for Vim users.
+Overwriting the statusline forcibly in your plugin is not a good idea.
+It is not hospitality, but just an annoying feature.
+If your plugin has such a feature, add an option to be modest.
+
+A good design is the following.
+Firstly, give the users a clue to judge which buffer is the one your plugin creates.
+The filename is a manner and the filetype is another.
+Then, export a function which is useful to be shown in the statusline.
+Lastly, for advanced users, set important information in buffer variables.
+So that the users can obtain the condition of the plugin easily.
diff --git a/vim/bundle/lightline.vim/autoload/lightline.vim b/vim/bundle/lightline.vim/autoload/lightline.vim
new file mode 100644
index 0000000..045e2b8
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline.vim
@@ -0,0 +1,485 @@
+" =============================================================================
+" Filename: autoload/lightline.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2016/06/12 22:40:00.
+" =============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+let s:_ = 1
+
+function! lightline#update() abort
+ if s:_
+ call lightline#init()
+ call lightline#colorscheme()
+ endif
+ if !s:lightline.enable.statusline
+ return
+ endif
+ let w = winnr()
+ let s = winnr('$') == 1 ? [lightline#statusline(0)] : [lightline#statusline(0), lightline#statusline(1)]
+ for n in range(1, winnr('$'))
+ call setwinvar(n, '&statusline', s[n!=w])
+ call setwinvar(n, 'lightline', n!=w)
+ endfor
+endfunction
+
+function! lightline#update_once() abort
+ if !exists('w:lightline') || w:lightline
+ call lightline#update()
+ endif
+endfunction
+
+function! lightline#update_disable() abort
+ if !s:lightline.enable.statusline
+ return
+ endif
+ call setwinvar(0, '&statusline', '')
+endfunction
+
+function! lightline#enable() abort
+ call lightline#colorscheme()
+ call lightline#update()
+ if s:lightline.enable.tabline
+ set tabline=%!lightline#tabline()
+ endif
+ augroup lightline
+ autocmd!
+ autocmd WinEnter,BufWinEnter,FileType,ColorScheme,SessionLoadPost * call lightline#update()
+ autocmd ColorScheme,SessionLoadPost * call lightline#highlight()
+ autocmd CursorMoved,BufUnload * call lightline#update_once()
+ augroup END
+ augroup lightline-disable
+ autocmd!
+ augroup END
+ augroup! lightline-disable
+endfunction
+
+function! lightline#disable() abort
+ let [&statusline, &tabline] = [get(s:, '_statusline', ''), get(s:, '_tabline', '')]
+ for t in range(1, tabpagenr('$'))
+ for n in range(1, tabpagewinnr(t, '$'))
+ call settabwinvar(t, n, '&statusline', '')
+ endfor
+ endfor
+ augroup lightline
+ autocmd!
+ augroup END
+ augroup! lightline
+ augroup lightline-disable
+ autocmd!
+ autocmd WinEnter * call lightline#update_disable()
+ augroup END
+endfunction
+
+function! lightline#toggle() abort
+ if exists('#lightline')
+ call lightline#disable()
+ else
+ call lightline#enable()
+ endif
+endfunction
+
+let s:_lightline = {
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'filename', 'modified' ] ],
+ \ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat', 'fileencoding', 'filetype' ] ]
+ \ },
+ \ 'inactive': {
+ \ 'left': [ [ 'filename' ] ],
+ \ 'right': [ [ 'lineinfo' ], [ 'percent' ] ]
+ \ },
+ \ 'tabline': {
+ \ 'left': [ [ 'tabs' ] ],
+ \ 'right': [ [ 'close' ] ]
+ \ },
+ \ 'tab': {
+ \ 'active': [ 'tabnum', 'filename', 'modified' ],
+ \ 'inactive': [ 'tabnum', 'filename', 'modified' ]
+ \ },
+ \ 'component': {
+ \ 'mode': '%{lightline#mode()}',
+ \ 'absolutepath': '%F', 'relativepath': '%f', 'filename': '%t', 'modified': '%M', 'bufnum': '%n',
+ \ 'paste': '%{&paste?"PASTE":""}', 'readonly': '%R', 'charvalue': '%b', 'charvaluehex': '%B',
+ \ 'spell': '%{&spell?&spelllang:""}', 'fileencoding': '%{&fenc!=#""?&fenc:&enc}', 'fileformat': '%{&ff}',
+ \ 'filetype': '%{&ft!=#""?&ft:"no ft"}', 'percent': '%3p%%', 'percentwin': '%P',
+ \ 'lineinfo': '%3l:%-2v', 'line': '%l', 'column': '%c', 'close': '%999X X '
+ \ },
+ \ 'component_visible_condition': {
+ \ 'modified': '&modified||!&modifiable', 'readonly': '&readonly', 'paste': '&paste', 'spell': '&spell'
+ \ },
+ \ 'component_function': {},
+ \ 'component_expand': {
+ \ 'tabs': 'lightline#tabs'
+ \ },
+ \ 'component_type': {
+ \ 'tabs': 'tabsel', 'close': 'raw'
+ \ },
+ \ 'tab_component': {},
+ \ 'tab_component_function': {
+ \ 'filename': 'lightline#tab#filename', 'modified': 'lightline#tab#modified',
+ \ 'readonly': 'lightline#tab#readonly', 'tabnum': 'lightline#tab#tabnum'
+ \ },
+ \ 'colorscheme': 'default',
+ \ 'mode_map': {
+ \ 'n': 'NORMAL', 'i': 'INSERT', 'R': 'REPLACE', 'v': 'VISUAL', 'V': 'V-LINE', "\<C-v>": 'V-BLOCK',
+ \ 'c': 'COMMAND', 's': 'SELECT', 'S': 'S-LINE', "\<C-s>": 'S-BLOCK', 't': 'TERMINAL'
+ \ },
+ \ 'separator': { 'left': '', 'right': '' },
+ \ 'subseparator': { 'left': '|', 'right': '|' },
+ \ 'tabline_separator': {},
+ \ 'tabline_subseparator': {},
+ \ 'enable': { 'statusline': 1, 'tabline': 1 },
+ \ '_mode_': {
+ \ 'n': 'normal', 'i': 'insert', 'R': 'replace', 'v': 'visual', 'V': 'visual', "\<C-v>": 'visual',
+ \ 'c': 'command', 's': 'select', 'S': 'select', "\<C-s>": 'select', 't': 'terminal'
+ \ },
+ \ 'mode_fallback': { 'replace': 'insert', 'terminal': 'insert', 'select': 'visual' },
+ \ 'palette': {},
+ \ 'winwidth': winwidth(0),
+ \ }
+function! lightline#init() abort
+ let s:lightline = deepcopy(get(g:, 'lightline', {}))
+ for [key, value] in items(s:_lightline)
+ if type(value) == 4
+ if !has_key(s:lightline, key)
+ let s:lightline[key] = {}
+ endif
+ call extend(s:lightline[key], value, 'keep')
+ elseif !has_key(s:lightline, key)
+ let s:lightline[key] = value
+ endif
+ unlet value
+ endfor
+ call extend(s:lightline.tabline_separator, s:lightline.separator, 'keep')
+ call extend(s:lightline.tabline_subseparator, s:lightline.subseparator, 'keep')
+ let s:lightline.tabline_configured = 0
+ for components in deepcopy(s:lightline.tabline.left + s:lightline.tabline.right)
+ if len(filter(components, 'v:val !=# "tabs" && v:val !=# "close"')) > 0
+ let s:lightline.tabline_configured = 1
+ break
+ endif
+ endfor
+ if !exists('s:_statusline')
+ let s:_statusline = &statusline
+ endif
+ if !exists('s:_tabline')
+ let s:_tabline = &tabline
+ endif
+ if s:lightline.enable.tabline
+ set tabline=%!lightline#tabline()
+ else
+ let &tabline = get(s:, '_tabline', '')
+ endif
+ for f in values(s:lightline.component_function)
+ silent! call call(f, [])
+ endfor
+ for f in values(s:lightline.tab_component_function)
+ silent! call call(f, [1])
+ endfor
+ let s:mode = ''
+endfunction
+
+function! lightline#colorscheme() abort
+ try
+ let s:lightline.palette = g:lightline#colorscheme#{s:lightline.colorscheme}#palette
+ catch
+ call lightline#error('Could not load colorscheme ' . s:lightline.colorscheme . '.')
+ let s:lightline.colorscheme = 'default'
+ let s:lightline.palette = g:lightline#colorscheme#{s:lightline.colorscheme}#palette
+ finally
+ let s:highlight = {}
+ call lightline#highlight('normal')
+ call lightline#link()
+ let s:_ = 0
+ if has('win32') && !has('gui_running') && &t_Co < 256
+ for u in values(s:lightline.palette)
+ for v in values(u)
+ for _ in v
+ let [_[2], _[3]] = [lightline#colortable#gui2cui(_[0], _[2]), lightline#colortable#gui2cui(_[1], _[3])]
+ endfor
+ endfor
+ endfor
+ endif
+ endtry
+endfunction
+
+function! lightline#palette() abort
+ return s:lightline.palette
+endfunction
+
+function! lightline#mode() abort
+ return get(s:lightline.mode_map, mode(), '')
+endfunction
+
+let s:mode = ''
+function! lightline#link(...) abort
+ let mode = get(s:lightline._mode_, a:0 ? a:1 : mode(), 'normal')
+ if s:mode == mode
+ return ''
+ endif
+ let s:mode = mode
+ if !has_key(s:highlight, mode)
+ call lightline#highlight(mode)
+ endif
+ let types = map(s:uniq(sort(filter(values(s:lightline.component_type), 'v:val !=# "raw"'))), '[v:val, 1]')
+ for [p, l] in [['Left', len(s:lightline.active.left)], ['Right', len(s:lightline.active.right)]]
+ for [i, t] in map(range(0, l), '[v:val, 0]') + types
+ if i != l
+ exec printf('hi link LightLine%s_active_%s LightLine%s_%s_%s', p, i, p, mode, i)
+ endif
+ for [j, s] in map(range(0, l), '[v:val, 0]') + types
+ if i + 1 == j || t || s && i != l
+ exec printf('hi link LightLine%s_active_%s_%s LightLine%s_%s_%s_%s', p, i, j, p, mode, i, j)
+ endif
+ endfor
+ endfor
+ endfor
+ exec printf('hi link LightLineMiddle_active LightLineMiddle_%s', mode)
+ return ''
+endfunction
+
+function! s:term(p) abort
+ return get(a:p, 4) !=# '' ? 'term='.a:p[4].' cterm='.a:p[4].' gui='.a:p[4] : ''
+endfunction
+
+if exists('*uniq')
+ let s:uniq = function('uniq')
+else
+ function! s:uniq(xs) abort
+ let i = len(a:xs) - 1
+ while i > 0
+ if a:xs[i] ==# a:xs[i - 1]
+ call remove(a:xs, i)
+ endif
+ let i -= 1
+ endwhile
+ return a:xs
+ endfunction
+endif
+
+function! lightline#highlight(...) abort
+ let [c, f] = [s:lightline.palette, s:lightline.mode_fallback]
+ let [s:lightline.llen, s:lightline.rlen] = [len(c.normal.left), len(c.normal.right)]
+ let [s:lightline.tab_llen, s:lightline.tab_rlen] = [len(has_key(get(c, 'tabline', {}), 'left') ? c.tabline.left : c.normal.left), len(has_key(get(c, 'tabline', {}), 'right') ? c.tabline.right : c.normal.right)]
+ let types = map(s:uniq(sort(filter(values(s:lightline.component_type), 'v:val !=# "raw"'))), '[v:val, 1]')
+ let modes = a:0 ? [a:1] : extend(['normal', 'insert', 'replace', 'visual', 'inactive', 'command', 'select', 'tabline'], has('nvim') ? ['terminal'] : [])
+ for mode in modes
+ let s:highlight[mode] = 1
+ let d = has_key(c, mode) ? mode : has_key(f, mode) && has_key(c, f[mode]) ? f[mode] : 'normal'
+ let left = d ==# 'tabline' ? s:lightline.tabline.left : d ==# 'inactive' ? s:lightline.inactive.left : s:lightline.active.left
+ let right = d ==# 'tabline' ? s:lightline.tabline.right : d ==# 'inactive' ? s:lightline.inactive.right : s:lightline.active.right
+ let ls = has_key(get(c, d, {}), 'left') ? c[d].left : has_key(f, d) && has_key(get(c, f[d], {}), 'left') ? c[f[d]].left : c.normal.left
+ let ms = has_key(get(c, d, {}), 'middle') ? c[d].middle[0] : has_key(f, d) && has_key(get(c, f[d], {}), 'middle') ? c[f[d]].middle[0] : c.normal.middle[0]
+ let rs = has_key(get(c, d, {}), 'right') ? c[d].right : has_key(f, d) && has_key(get(c, f[d], {}), 'right') ? c[f[d]].right : c.normal.right
+ for [p, l, zs] in [['Left', len(left), ls], ['Right', len(right), rs]]
+ for [i, t] in map(range(0, l), '[v:val, 0]') + types
+ if i < l || i < 1
+ let r = t ? (has_key(get(c, d, []), i) ? c[d][i][0] : has_key(get(c, 'tabline', {}), i) ? c.tabline[i][0] : get(c.normal, i, zs)[0]) : get(zs, i, ms)
+ exec printf('hi LightLine%s_%s_%s guifg=%s guibg=%s ctermfg=%s ctermbg=%s %s', p, mode, i, r[0], r[1], r[2], r[3], s:term(r))
+ endif
+ for [j, s] in map(range(0, l), '[v:val, 0]') + types
+ if i + 1 == j || t || s && i != l
+ let q = s ? (has_key(get(c, d, []), j) ? c[d][j][0] : has_key(get(c, 'tabline', {}), j) ? c.tabline[j][0] : get(c.normal, j, zs)[0]) : (j != l ? get(zs, j, ms) :ms)
+ exec printf('hi LightLine%s_%s_%s_%s guifg=%s guibg=%s ctermfg=%s ctermbg=%s', p, mode, i, j, r[1], q[1], r[3], q[3])
+ endif
+ endfor
+ endfor
+ endfor
+ exec printf('hi LightLineMiddle_%s guifg=%s guibg=%s ctermfg=%s ctermbg=%s %s', mode, ms[0], ms[1], ms[2], ms[3], s:term(ms))
+ endfor
+endfunction
+
+function! s:subseparator(components, subseparator, expanded) abort
+ let [a, c, f, v] = [ a:components, s:lightline.component, s:lightline.component_function, s:lightline.component_visible_condition ]
+ let xs = map(range(len(a:components)), 'a:expanded[v:val] ? "1" :
+ \ has_key(f, a[v:val]) ? (exists("*".f[a[v:val]]) ? "" : "exists(\"*".f[a[v:val]]."\")&&").f[a[v:val]]."()!=#\"\"" :
+ \ has_key(v, a[v:val]) ? "(" . v[a[v:val]] . ")" : has_key(c, a[v:val]) ? "1" : "0"')
+ return '%{' . (xs[0] ==# '1' ? '' : xs[0] . '&&(') . join(xs[1:], '||') . (xs[0] ==# '1' ? '' : ')') . '?"' . a:subseparator . '":""}'
+endfunction
+
+function! lightline#concatenate(xs, right) abort
+ let separator = a:right ? s:lightline.subseparator.right : s:lightline.subseparator.left
+ return join(filter(copy(a:xs), 'v:val !=# ""'), ' ' . separator . ' ')
+endfunction
+
+function! lightline#statusline(inactive) abort
+ if a:inactive && !has_key(s:highlight, 'inactive')
+ call lightline#highlight('inactive')
+ endif
+ return s:line(0, a:inactive)
+endfunction
+
+function! s:normalize(result) abort
+ if type(a:result) == 3
+ return map(a:result, 'type(v:val) == 1 ? v:val : string(v:val)')
+ elseif type(a:result) == 1
+ return [a:result]
+ else
+ return [string(a:result)]
+ endif
+endfunction
+
+function! s:evaluate_expand(component) abort
+ try
+ let result = call(a:component, [])
+ if type(result) == 1 && result ==# ''
+ return []
+ endif
+ catch
+ return []
+ endtry
+ return map(type(result) == 3 ? (result + [[], [], []])[:2] : [[], [result], []], 'filter(s:normalize(v:val), "v:val !=# ''''")')
+endfunction
+
+function! s:convert(name, index) abort
+ if has_key(s:lightline.component_expand, a:name)
+ let type = get(s:lightline.component_type, a:name, a:index)
+ return filter(s:map(s:evaluate_expand(s:lightline.component_expand[a:name]), '[v:val, 1, v:key == 1 ? "' . type . '" : "' . a:index . '"]'), 'v:val[0] != []')
+ else
+ return [[[a:name], 0, a:index]]
+ endif
+endfunction
+
+function! s:flatten_twice(xss) abort
+ let ys = []
+ for xs in a:xss
+ for x in xs
+ let ys += x
+ endfor
+ endfor
+ return ys
+endfunction
+
+if v:version > 702 || v:version == 702 && has('patch295')
+ let s:map = function('map')
+else
+ function! s:map(xs, f) abort
+ let ys = []
+ for i in range(len(a:xs))
+ call extend(ys, map(a:xs[(i):(i)], substitute(a:f, 'v:key', i, 'g')))
+ endfor
+ return ys
+ endfunction
+endif
+
+function! s:expand(components) abort
+ let components = []
+ let expanded = []
+ let indices = []
+ let previndex = -1
+ let xs = s:flatten_twice(s:map(deepcopy(a:components), 'map(v:val, "s:convert(v:val, ''" . v:key . "'')")'))
+ for [component, expand, index] in xs
+ if previndex != index
+ call add(indices, index)
+ call add(components, [])
+ call add(expanded, [])
+ endif
+ call extend(components[-1], component)
+ call extend(expanded[-1], repeat([expand], len(component)))
+ let previndex = index
+ endfor
+ call add(indices, string(len(a:components)))
+ return [components, expanded, indices]
+endfunction
+
+function! s:line(tabline, inactive) abort
+ let _ = a:tabline ? '' : '%{lightline#link()}'
+ if s:lightline.palette == {}
+ call lightline#colorscheme()
+ endif
+ let [l, r] = a:tabline ? [s:lightline.tab_llen, s:lightline.tab_rlen] : [s:lightline.llen, s:lightline.rlen]
+ let [p, s] = a:tabline ? [s:lightline.tabline_separator, s:lightline.tabline_subseparator] : [s:lightline.separator, s:lightline.subseparator]
+ let [c, f, t] = [s:lightline.component, s:lightline.component_function, s:lightline.component_type]
+ let mode = a:tabline ? 'tabline' : a:inactive ? 'inactive' : 'active'
+ let l_ = has_key(s:lightline, mode) ? s:lightline[mode].left : s:lightline.active.left
+ let [lt, lc, ll] = s:expand(copy(l_))
+ let r_ = has_key(s:lightline, mode) ? s:lightline[mode].right : s:lightline.active.right
+ let [rt, rc, rl] = s:expand(copy(r_))
+ for i in range(len(lt))
+ let _ .= '%#LightLineLeft_' . mode . '_' . ll[i] . '#'
+ for j in range(len(lt[i]))
+ let x = lc[i][j] ? lt[i][j] : has_key(f, lt[i][j]) ? (exists('*' . f[lt[i][j]]) ? '%{' . f[lt[i][j]] . '()}' : '%{exists("*' . f[lt[i][j]] . '")?' . f[lt[i][j]] . '():""}') : get(c, lt[i][j], '')
+ let _ .= has_key(t, lt[i][j]) && t[lt[i][j]] ==# 'raw' || x ==# '' ? x : '%( ' . x . ' %)'
+ if j < len(lt[i]) - 1 && s.left !=# ''
+ let _ .= s:subseparator(lt[i][(j):], s.left, lc[i][(j):])
+ endif
+ endfor
+ let _ .= '%#LightLineLeft_' . mode . '_' . ll[i] . '_' . ll[i + 1] . '#'
+ let _ .= i < l + len(lt) - len(l_) && ll[i] < l || ll[i] != ll[i + 1] ? p.left : len(lt[i]) ? s.left : ''
+ endfor
+ let _ .= '%#LightLineMiddle_' . mode . '#%='
+ for i in reverse(range(len(rt)))
+ let _ .= '%#LightLineRight_' . mode . '_' . rl[i] . '_' . rl[i + 1] . '#'
+ let _ .= i < r + len(rt) - len(r_) && rl[i] < r || rl[i] != rl[i + 1] ? p.right : len(rt[i]) ? s.right : ''
+ let _ .= '%#LightLineRight_' . mode . '_' . rl[i] . '#'
+ for j in range(len(rt[i]))
+ let x = rc[i][j] ? rt[i][j] : has_key(f, rt[i][j]) ? (exists('*' . f[rt[i][j]]) ? '%{' . f[rt[i][j]] . '()}' : '%{exists("*' . f[rt[i][j]] . '")?' . f[rt[i][j]] . '():""}') : get(c, rt[i][j], '')
+ let _ .= has_key(t, rt[i][j]) && t[rt[i][j]] ==# 'raw' || x ==# '' ? x : '%( ' . x . ' %)'
+ if j < len(rt[i]) - 1 && s.right !=# ''
+ let _ .= s:subseparator(rt[i][(j):], s.right, rc[i][(j):])
+ endif
+ endfor
+ endfor
+ return _
+endfunction
+
+let s:tabnr = -1
+let s:tabcnt = -1
+let s:tabline = ''
+function! lightline#tabline() abort
+ if !has_key(s:highlight, 'tabline')
+ call lightline#highlight('tabline')
+ endif
+ if s:lightline.tabline_configured || s:tabnr != tabpagenr() || s:tabcnt != tabpagenr('$')
+ let s:tabnr = tabpagenr()
+ let s:tabcnt = tabpagenr('$')
+ let s:tabline = s:line(1, 0)
+ endif
+ return s:tabline
+endfunction
+
+function! lightline#tabs() abort
+ let [x, y, z] = [[], [], []]
+ let nr = tabpagenr()
+ let cnt = tabpagenr('$')
+ for i in range(1, cnt)
+ call add(i < nr ? x : i == nr ? y : z, '%'. i . 'T%{lightline#onetab(' . i . ',' . (i == nr) . ')}' . (i == cnt ? '%T' : ''))
+ endfor
+ let abbr = '...'
+ let n = min([max([s:lightline.winwidth / 40, 2]), 8])
+ if len(x) > n && len(z) > n
+ let x = extend(add(x[:n/2-1], abbr), x[-(n+1)/2:])
+ let z = extend(add(z[:(n+1)/2-1], abbr), z[-n/2:])
+ elseif len(x) + len(z) > 2 * n
+ if len(x) > n
+ let x = extend(add(x[:(2*n-len(z))/2-1], abbr), x[-(2*n-len(z)+1)/2:])
+ elseif len(z) > n
+ let z = extend(add(z[:(2*n-len(x)+1)/2-1], abbr), z[-(2*n-len(x))/2:])
+ endif
+ endif
+ return [x, y, z]
+endfunction
+
+function! lightline#onetab(n, active) abort
+ let _ = []
+ for name in a:active ? s:lightline.tab.active : s:lightline.tab.inactive
+ if has_key(s:lightline.tab_component_function, name)
+ call add(_, call(s:lightline.tab_component_function[name], [a:n]))
+ else
+ call add(_, get(s:lightline.tab_component, name, ''))
+ endif
+ endfor
+ return join(filter(_, 'v:val !=# ""'), ' ')
+endfunction
+
+function! lightline#error(msg) abort
+ echohl ErrorMsg
+ echomsg 'lightline.vim: '.a:msg
+ echohl None
+endfunction
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme.vim
new file mode 100644
index 0000000..de23eb5
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme.vim
@@ -0,0 +1,228 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2015/03/18 08:37:17.
+" =============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+let s:cuicolor = {
+ \ 'black' : 16,
+ \ 'white' : 231,
+ \
+ \ 'darkestgreen' : 22,
+ \ 'darkgreen' : 28,
+ \ 'mediumgreen' : 70,
+ \ 'brightgreen' : 148,
+ \
+ \ 'darkestcyan' : 23,
+ \ 'mediumcyan' : 117,
+ \
+ \ 'darkestblue' : 24,
+ \ 'darkblue' : 31,
+ \
+ \ 'darkestred' : 52,
+ \ 'darkred' : 88,
+ \ 'mediumred' : 124,
+ \ 'brightred' : 160,
+ \ 'brightestred' : 196,
+ \
+ \ 'darkestpurple' : 55,
+ \ 'mediumpurple' : 98,
+ \ 'brightpurple' : 189,
+ \
+ \ 'brightorange' : 208,
+ \ 'brightestorange': 214,
+ \
+ \ 'gray0' : 233,
+ \ 'gray1' : 235,
+ \ 'gray2' : 236,
+ \ 'gray3' : 239,
+ \ 'gray4' : 240,
+ \ 'gray5' : 241,
+ \ 'gray6' : 244,
+ \ 'gray7' : 245,
+ \ 'gray8' : 247,
+ \ 'gray9' : 250,
+ \ 'gray10' : 252,
+ \
+ \ 'yellow' : 136,
+ \ 'orange' : 166,
+ \ 'red' : 160,
+ \ 'magenta' : 125,
+ \ 'violet' : 61,
+ \ 'blue' : 33,
+ \ 'cyan' : 37,
+ \ 'green' : 64,
+ \ }
+
+let s:guicolor = {
+ \ 'black' : '#000000',
+ \ 'white' : '#ffffff',
+ \
+ \ 'darkestgreen' : '#005f00',
+ \ 'darkgreen' : '#008700',
+ \ 'mediumgreen' : '#5faf00',
+ \ 'brightgreen' : '#afdf00',
+ \
+ \ 'darkestcyan' : '#005f5f',
+ \ 'mediumcyan' : '#87dfff',
+ \
+ \ 'darkestblue' : '#005f87',
+ \ 'darkblue' : '#0087af',
+ \
+ \ 'darkestred' : '#5f0000',
+ \ 'darkred' : '#870000',
+ \ 'mediumred' : '#af0000',
+ \ 'brightred' : '#df0000',
+ \ 'brightestred' : '#ff0000',
+ \
+ \ 'darkestpurple' : '#5f00af',
+ \ 'mediumpurple' : '#875fdf',
+ \ 'brightpurple' : '#dfdfff',
+ \
+ \ 'brightorange' : '#ff8700',
+ \ 'brightestorange': '#ffaf00',
+ \
+ \ 'gray0' : '#121212',
+ \ 'gray1' : '#262626',
+ \ 'gray2' : '#303030',
+ \ 'gray3' : '#4e4e4e',
+ \ 'gray4' : '#585858',
+ \ 'gray5' : '#606060',
+ \ 'gray6' : '#808080',
+ \ 'gray7' : '#8a8a8a',
+ \ 'gray8' : '#9e9e9e',
+ \ 'gray9' : '#bcbcbc',
+ \ 'gray10' : '#d0d0d0',
+ \
+ \ 'yellow' : '#b58900',
+ \ 'orange' : '#cb4b16',
+ \ 'red' : '#dc322f',
+ \ 'magenta' : '#d33682',
+ \ 'violet' : '#6c71c4',
+ \ 'blue' : '#268bd2',
+ \ 'cyan' : '#2aa198',
+ \ 'green' : '#859900',
+ \ }
+
+function! s:convert(rgb) abort
+ let rgb = map(matchlist(a:rgb, '#\(..\)\(..\)\(..\)')[1:3], '0 + ("0x".v:val)')
+ if len(rgb) == 0
+ return 0
+ endif
+ if rgb[0] == 0xc0 && rgb[1] == 0xc0 && rgb[2] == 0xc0
+ return 7
+ elseif rgb[0] == 0x80 && rgb[1] == 0x80 && rgb[2] == 0x80
+ return 8
+ elseif (rgb[0] == 0x80 || rgb[0] == 0x00) && (rgb[1] == 0x80 || rgb[1] == 0x00) && (rgb[2] == 0x80 || rgb[2] == 0x00)
+ return (rgb[0] / 0x80) + (rgb[1] / 0x80) * 2 + (rgb[1] / 0x80) * 4
+ elseif abs(rgb[0]-rgb[1]) < 3 && abs(rgb[1]-rgb[2]) < 3 && abs(rgb[2]-rgb[0]) < 3
+ return s:black((rgb[0] + rgb[1] + rgb[2]) / 3)
+ else
+ return 16 + ((s:nr(rgb[0]) * 6) + s:nr(rgb[1])) * 6 + s:nr(rgb[2])
+ endif
+endfunction
+
+function! s:black(x) abort
+ if a:x < 0x04
+ return 16
+ elseif a:x > 0xf4
+ return 231
+ elseif index([0x00, 0x5f, 0x87, 0xaf, 0xdf, 0xff], a:x) >= 0
+ let l = a:x / 0x30
+ return ((l * 6) + l) * 6 + l + 16
+ else
+ return 232 + (a:x < 8 ? 0 : a:x < 0x60 ? (a:x-8)/10 : a:x < 0x76 ? (a:x-0x60)/6+9 : (a:x-8)/10)
+ endif
+endfunction
+
+function! s:nr(x) abort
+ return a:x < 0x2f ? 0 : a:x < 0x73 ? 1 : a:x < 0x9b ? 2 : a:x < 0xc7 ? 3 : a:x < 0xef ? 4 : 5
+endfunction
+
+function! s:rgb(r, g, b) abort
+ return printf('#%02x%02x%02x', a:r, a:g, a:b)
+endfunction
+
+function! s:upconvert(nr) abort
+ let x = a:nr * 1
+ if x < 7
+ let [b, rg] = [x / 4, x % 4]
+ let [g, r] = [rg / 2, rg % 2]
+ return s:rgb(r * 0x80, g * 0x80, b * 0x80)
+ elseif x == 7
+ return s:rgb(0xc0, 0xc0, 0xc0)
+ elseif x == 8
+ return s:rgb(0x80, 0x80, 0x80)
+ elseif x < 16
+ let y = x - 8
+ let [b, rg] = [y / 4, y % 4]
+ let [g, r] = [rg / 2, rg % 2]
+ return s:rgb(r * 0xff, g * 0xff, b * 0xff)
+ elseif x < 232
+ let y = x - 16
+ let [rg, b] = [y / 6, y % 6]
+ let [r, g] = [rg / 6, rg % 6]
+ let l = [0x00, 0x5f, 0x87, 0xaf, 0xdf, 0xff]
+ return s:rgb(l[r], l[g], l[b])
+ elseif x < 241
+ let k = (x - 232) * 10 + 8
+ return s:rgb(k, k, k)
+ elseif x < 243
+ let k = (x - 241) * 6 + 0x60
+ return s:rgb(k, k, k)
+ else
+ let k = (x - 232) * 10 + 8
+ return s:rgb(k, k, k)
+ endif
+endfunction
+
+function! lightline#colorscheme#fill(p) abort
+ for k in values(a:p)
+ for l in values(k)
+ for m in l
+ if len(m) < 4
+ if type(m[0]) == 1 && type(m[1]) == 1
+ if m[0] =~# '^\d\+$' && m[1] =~# '^\d\+$'
+ call insert(m, s:upconvert(m[1]), 0)
+ call insert(m, s:upconvert(m[1]), 0)
+ else
+ call insert(m, get(s:cuicolor, m[0], s:convert(m[0])), 2)
+ call insert(m, get(s:cuicolor, m[1], s:convert(m[1])), 3)
+ let m[0] = get(s:guicolor, m[0], m[0])
+ let m[1] = get(s:guicolor, m[1], m[1])
+ endif
+ elseif type(m[0]) == 0 && type(m[1]) == 0
+ call insert(m, s:upconvert(m[1]), 0)
+ call insert(m, s:upconvert(m[1]), 0)
+ endif
+ endif
+ endfor
+ endfor
+ endfor
+ return a:p
+endfunction
+
+function! lightline#colorscheme#flatten(p) abort
+ for k in values(a:p)
+ for l in values(k)
+ for m in range(len(l))
+ let attr = ''
+ if len(l[m]) == 3 && type(l[m][2]) == 1
+ let attr = l[m][2]
+ endif
+ let l[m] = [l[m][0][0], l[m][1][0], l[m][0][1], l[m][1][1]]
+ if !empty(attr)
+ call add(l[m], attr)
+ endif
+ endfor
+ endfor
+ endfor
+ return a:p
+endfunction
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/16color.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/16color.vim
new file mode 100644
index 0000000..170aa93
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/16color.vim
@@ -0,0 +1,46 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/16color.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2014/01/02 10:04:03.
+" =============================================================================
+let s:base03 = [ '#808080', 8 ]
+let s:base02 = [ '#000000', 0 ]
+let s:base01 = [ '#00ff00', 10 ]
+let s:base00 = [ '#ffff00', 11 ]
+let s:base0 = [ '#0000ff', 12 ]
+let s:base1 = [ '#00ffff', 14 ]
+let s:base2 = [ '#c0c0c0', 7 ]
+let s:base3 = [ '#ffffff', 15 ]
+let s:yellow = [ '#808000', 3 ]
+let s:orange = [ '#ff0000', 9 ]
+let s:red = [ '#800000', 1 ]
+let s:magenta = [ '#800080', 5 ]
+let s:violet = [ '#ff00ff', 13 ]
+let s:blue = [ '#000080', 4 ]
+let s:cyan = [ '#008080', 6 ]
+let s:green = [ '#008000', 2 ]
+if &background ==# 'light'
+ let [s:base03, s:base3] = [s:base3, s:base03]
+ let [s:base02, s:base2] = [s:base2, s:base02]
+ let [s:base01, s:base1] = [s:base1, s:base01]
+ let [s:base00, s:base0] = [s:base0, s:base00]
+endif
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ [ s:base3, s:blue ], [ s:base3, s:base01 ] ]
+let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
+let s:p.inactive.right = [ [ s:base02, s:base01 ], [ s:base00, s:base02 ] ]
+let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base02 ] ]
+let s:p.insert.left = [ [ s:base3, s:green ], [ s:base3, s:base01 ] ]
+let s:p.replace.left = [ [ s:base3, s:red ], [ s:base3, s:base01 ] ]
+let s:p.visual.left = [ [ s:base3, s:magenta ], [ s:base3, s:base01 ] ]
+let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
+let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
+let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
+let s:p.tabline.tabsel = [ [ s:base2, s:base02 ] ]
+let s:p.tabline.middle = [ [ s:base01, s:base2 ] ]
+let s:p.tabline.right = copy(s:p.normal.right)
+let s:p.normal.error = [ [ s:base2, s:red ] ]
+let s:p.normal.warning = [ [ s:base02, s:yellow ] ]
+
+let g:lightline#colorscheme#16color#palette = lightline#colorscheme#flatten(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/PaperColor.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/PaperColor.vim
new file mode 100644
index 0000000..429439d
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/PaperColor.vim
@@ -0,0 +1,12 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/PaperColor.vim
+" Author: TKNGUE
+" License: MIT License
+" Last Change: 2015/07/28 07:35:00.
+" =============================================================================
+
+if &background ==# 'light'
+ let g:lightline#colorscheme#PaperColor#palette = g:lightline#colorscheme#PaperColor_light#palette
+else
+ let g:lightline#colorscheme#PaperColor#palette = g:lightline#colorscheme#PaperColor_dark#palette
+endif
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/PaperColor_dark.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/PaperColor_dark.vim
new file mode 100644
index 0000000..0a70b34
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/PaperColor_dark.vim
@@ -0,0 +1,60 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/PaperColor_dark.vim
+" Author: TKNGUE
+" License: MIT License
+" Last Change: 2015-07-27 06:01
+" =============================================================================
+
+let s:red = '#df0000'
+let s:green = '#008700'
+let s:blue = '#00afaf'
+
+let s:pink = '#afdf00'
+let s:olive = '#dfaf5f'
+let s:navy = '#df875f'
+
+let s:orange = '#d75f00'
+let s:purple = '#8959a8'
+let s:aqua = '#3e999f'
+
+" Basics:
+let s:foreground = '#d0d0d0'
+let s:background = '#444444'
+let s:window = '#efefef'
+let s:status = '#c6c6c6'
+let s:error = '#5f0000'
+
+" Tabline:
+let s:tabline_bg = '#3a3a3a'
+let s:tabline_active_fg = '#1c1c1c'
+let s:tabline_active_bg = '#00afaf'
+let s:tabline_inactive_fg = '#c6c6c6'
+let s:tabline_inactive_bg = '#585858'
+
+" Statusline:
+let s:statusline_active_fg = '#1c1c1c'
+let s:statusline_active_bg = '#5f8787'
+let s:statusline_inactive_fg = '#c6c6c6'
+let s:statusline_inactive_bg = '#444444'
+
+" Visual:
+let s:visual_fg = '#000000'
+let s:visual_bg = '#8787af'
+
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ [ s:foreground, s:background ], [ s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
+let s:p.normal.right = [ [ s:foreground, s:background ], [ s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
+let s:p.normal.middle = [ [ s:statusline_active_fg, s:statusline_active_bg ]]
+let s:p.inactive.right = [ [ s:foreground, s:background ], [ s:foreground, s:background ] ]
+let s:p.inactive.left = [ [ s:foreground, s:background ], [ s:foreground, s:background ] ]
+let s:p.inactive.middle = [ [ s:foreground, s:background ], ]
+let s:p.insert.left = [ [ s:background, s:blue], [ s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
+let s:p.replace.left = [ [ s:background, s:pink ], [s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
+let s:p.visual.left = [ [ s:visual_fg, s:visual_bg ], [s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
+let s:p.tabline.left = [ [s:tabline_inactive_fg, s:tabline_inactive_bg ]]
+let s:p.tabline.tabsel = [ [s:tabline_active_fg, s:tabline_active_bg ] ]
+let s:p.tabline.middle = [ [s:tabline_bg, s:tabline_bg]]
+let s:p.tabline.right = copy(s:p.normal.right)
+let s:p.normal.error = [ [ s:background, s:error ] ]
+
+let g:lightline#colorscheme#PaperColor_dark#palette = lightline#colorscheme#fill(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/PaperColor_light.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/PaperColor_light.vim
new file mode 100644
index 0000000..aef0b86
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/PaperColor_light.vim
@@ -0,0 +1,55 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/PaperColor_light.vim
+" Author: TKNGUE
+" License: MIT License
+" Last Change: 2015/07/28 07:46:40.
+" =============================================================================
+
+let s:red = '#df0000'
+let s:green = '#008700'
+let s:blue = '#4271ae'
+let s:pink = '#d7005f'
+let s:olive = '#718c00'
+let s:navy = '#005f87'
+let s:orange = '#d75f00'
+let s:purple = '#8959a8'
+let s:aqua = '#3e999f'
+
+" Basics:
+let s:foreground = '#4d4d4c'
+let s:background = '#F5F5F5'
+let s:window = '#efefef'
+let s:status = s:aqua
+let s:error = '#ffafdf'
+
+" Tabline:
+let s:tabline_bg = s:navy
+let s:tabline_active_fg = s:foreground
+let s:tabline_active_bg = s:window
+let s:tabline_inactive_fg = s:background
+let s:tabline_inactive_bg = s:aqua
+
+" Statusline:
+let s:statusline_active_fg = s:window
+let s:statusline_active_bg = s:navy
+let s:statusline_inactive_fg = s:foreground
+let s:statusline_inactive_bg = '#dadada'
+
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ [ s:foreground, s:background ], [ s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
+let s:p.normal.right = [ [ s:foreground, s:background ], [ s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
+let s:p.normal.middle = [ [ s:statusline_active_fg, s:statusline_active_bg ]]
+let s:p.inactive.right = [ [ s:foreground, s:background ], [ s:foreground, s:background ] ]
+let s:p.inactive.left = [ [ s:foreground, s:background ], [ s:foreground, s:background ] ]
+let s:p.inactive.middle = [ [ s:foreground, s:background ], ]
+let s:p.insert.left = [ [ s:blue, s:background ], [ s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
+let s:p.replace.left = [ [ s:background, s:pink ], [s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
+let s:p.visual.left = [ [ s:background, s:orange ], [s:statusline_active_fg, s:status ], [ s:statusline_active_fg, s:statusline_active_bg ] ]
+let s:p.tabline.left = [ [s:tabline_inactive_fg, s:tabline_inactive_bg ]]
+let s:p.tabline.tabsel = [ [s:tabline_active_fg, s:tabline_active_bg ] ]
+let s:p.tabline.middle = [ [s:tabline_bg, s:tabline_bg]]
+let s:p.tabline.right = copy(s:p.normal.right)
+let s:p.normal.error = [ [ s:background, s:error ] ]
+let s:p.normal.warning = [ [ s:background, s:olive ] ]
+
+let g:lightline#colorscheme#PaperColor_light#palette = lightline#colorscheme#fill(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow.vim
new file mode 100644
index 0000000..8255966
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow.vim
@@ -0,0 +1,41 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/Tomorrow.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2013/09/07 12:22:37.
+" =============================================================================
+let s:base03 = '#fafafa'
+let s:base023 = '#dfdfdf'
+let s:base02 = '#c8c8c8'
+let s:base01 = '#b4b4b4'
+let s:base00 = '#808080'
+let s:base0 = '#666666'
+let s:base1 = '#555555'
+let s:base2 = '#4f4f4f'
+let s:base3 = '#4d4d4c'
+let s:red = '#c82829'
+let s:orange = '#f5871f'
+let s:yellow = '#eab700'
+let s:green = '#718c00'
+let s:cyan = '#3e999f'
+let s:blue = '#4271ae'
+let s:magenta = '#8959a8'
+
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
+let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
+let s:p.inactive.right = [ [ s:base02, s:base00 ], [ s:base00, s:base02 ] ]
+let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base03 ] ]
+let s:p.insert.left = [ [ s:base02, s:green ], [ s:base3, s:base01 ] ]
+let s:p.replace.left = [ [ s:base02, s:orange ], [ s:base3, s:base01 ] ]
+let s:p.visual.left = [ [ s:base02, s:magenta ], [ s:base3, s:base01 ] ]
+let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
+let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
+let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
+let s:p.tabline.tabsel = [ [ s:base2, s:base023 ] ]
+let s:p.tabline.middle = [ [ s:base01, s:base00 ] ]
+let s:p.tabline.right = copy(s:p.normal.right)
+let s:p.normal.error = [ [ s:red, s:base01 ] ]
+let s:p.normal.warning = [ [ s:yellow, s:base0 ] ]
+
+let g:lightline#colorscheme#Tomorrow#palette = lightline#colorscheme#fill(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night.vim
new file mode 100644
index 0000000..8903180
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night.vim
@@ -0,0 +1,41 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/Tomorrow_Night.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2013/09/07 12:23:38.
+" =============================================================================
+let s:base3 = '#c5c8c6'
+let s:base2 = '#bababa'
+let s:base1 = '#a0a0a0'
+let s:base0 = '#909090'
+let s:base00 = '#666666'
+let s:base01 = '#555555'
+let s:base02 = '#434343'
+let s:base023 = '#303030'
+let s:base03 = '#1d1f21'
+let s:red = '#cc6666'
+let s:orange = '#de935f'
+let s:yellow = '#f0c674'
+let s:green = '#b5bd68'
+let s:cyan = '#8abeb7'
+let s:blue = '#81a2be'
+let s:magenta = '#b294bb'
+
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
+let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
+let s:p.inactive.right = [ [ s:base02, s:base00 ], [ s:base00, s:base02 ] ]
+let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base03 ] ]
+let s:p.insert.left = [ [ s:base02, s:green ], [ s:base3, s:base01 ] ]
+let s:p.replace.left = [ [ s:base02, s:orange ], [ s:base3, s:base01 ] ]
+let s:p.visual.left = [ [ s:base02, s:magenta ], [ s:base3, s:base01 ] ]
+let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
+let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
+let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
+let s:p.tabline.tabsel = [ [ s:base2, s:base023 ] ]
+let s:p.tabline.middle = [ [ s:base01, s:base0 ] ]
+let s:p.tabline.right = copy(s:p.normal.right)
+let s:p.normal.error = [ [ s:red, s:base023 ] ]
+let s:p.normal.warning = [ [ s:yellow, s:base02 ] ]
+
+let g:lightline#colorscheme#Tomorrow_Night#palette = lightline#colorscheme#fill(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night_Blue.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night_Blue.vim
new file mode 100644
index 0000000..31c27f3
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night_Blue.vim
@@ -0,0 +1,43 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/Tomorrow_Night_Blue.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2013/09/07 14:13:21.
+" =============================================================================
+let s:base3 = '#ffffff'
+let s:base23 = '#ffffff'
+let s:base2 = '#ffffff'
+let s:base1 = '#ffffff'
+let s:base0 = '#ffffff'
+let s:base00 = '#6060df'
+let s:base01 = '#6060af'
+let s:base02 = '#606087'
+let s:base023 = '#202087'
+let s:base03 = '#002451'
+let s:red = '#ff9da4'
+let s:orange = '#ffc58f'
+let s:yellow = '#ffeead'
+let s:green = '#d1f1a9'
+let s:cyan = '#99ffff'
+let s:blue = '#bbdaff'
+let s:magenta = '#ebbbff'
+
+
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ [ s:base023, s:blue ], [ s:base3, s:base01 ] ]
+let s:p.normal.right = [ [ s:base02, s:base1 ], [ s:base2, s:base01 ] ]
+let s:p.inactive.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
+let s:p.inactive.left = [ [ s:base02, s:base0 ], [ s:base00, s:base03 ] ]
+let s:p.insert.left = [ [ s:base023, s:green ], [ s:base3, s:base01 ] ]
+let s:p.replace.left = [ [ s:base023, s:orange ], [ s:base3, s:base01 ] ]
+let s:p.visual.left = [ [ s:base023, s:magenta ], [ s:base3, s:base01 ] ]
+let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
+let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
+let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
+let s:p.tabline.tabsel = [ [ s:base2, s:base03 ] ]
+let s:p.tabline.middle = [ [ s:base01, s:base1 ] ]
+let s:p.tabline.right = copy(s:p.normal.right)
+let s:p.normal.error = [ [ s:base023, s:red ] ]
+let s:p.normal.warning = [ [ s:base023, s:yellow ] ]
+
+let g:lightline#colorscheme#Tomorrow_Night_Blue#palette = lightline#colorscheme#fill(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night_Bright.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night_Bright.vim
new file mode 100644
index 0000000..5b81a31
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night_Bright.vim
@@ -0,0 +1,42 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/Tomorrow_Night_Bright.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2013/09/07 14:13:26.
+" =============================================================================
+let s:base3 = '#eaeaea'
+let s:base23 = '#d0d0d0'
+let s:base2 = '#c6c6c6'
+let s:base1 = '#b2b2b2'
+let s:base0 = '#949494'
+let s:base00 = '#767676'
+let s:base01 = '#606060'
+let s:base02 = '#4e4e4e'
+let s:base023 = '#262626'
+let s:base03 = '#12124c'
+let s:red = '#d54e53'
+let s:orange = '#e78c45'
+let s:yellow = '#e7c547'
+let s:green = '#b9ca4a'
+let s:cyan = '#70c0b1'
+let s:blue = '#7aa6da'
+let s:magenta = '#c397d8'
+
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ [ s:base023, s:blue ], [ s:base3, s:base01 ] ]
+let s:p.normal.right = [ [ s:base02, s:base1 ], [ s:base2, s:base01 ] ]
+let s:p.inactive.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
+let s:p.inactive.left = [ [ s:base02, s:base0 ], [ s:base00, s:base03 ] ]
+let s:p.insert.left = [ [ s:base023, s:green ], [ s:base3, s:base01 ] ]
+let s:p.replace.left = [ [ s:base023, s:orange ], [ s:base3, s:base01 ] ]
+let s:p.visual.left = [ [ s:base023, s:magenta ], [ s:base3, s:base01 ] ]
+let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
+let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
+let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
+let s:p.tabline.tabsel = [ [ s:base2, s:base023 ] ]
+let s:p.tabline.middle = [ [ s:base01, s:base1 ] ]
+let s:p.tabline.right = copy(s:p.normal.right)
+let s:p.normal.error = [ [ s:red, s:base023 ] ]
+let s:p.normal.warning = [ [ s:yellow, s:base02 ] ]
+
+let g:lightline#colorscheme#Tomorrow_Night_Bright#palette = lightline#colorscheme#fill(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night_Eighties.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night_Eighties.vim
new file mode 100644
index 0000000..5124ecc
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night_Eighties.vim
@@ -0,0 +1,42 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/Tomorrow_Night_Eighties.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2013/09/07 14:14:14.
+" =============================================================================
+let s:base3 = '#cccccc'
+let s:base23 = '#bbbbbb'
+let s:base2 = '#aaaaaa'
+let s:base1 = '#999999'
+let s:base0 = '#777777'
+let s:base00 = '#666666'
+let s:base01 = '#555555'
+let s:base02 = '#444444'
+let s:base023 = '#333333'
+let s:base03 = '#2d2d2d'
+let s:red = '#f2777a'
+let s:orange = '#f99157'
+let s:yellow = '#ffcc66'
+let s:green = '#99cc99'
+let s:cyan = '#009999'
+let s:blue = '#99cccc'
+let s:magenta = '#cc99cc'
+
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ [ s:base023, s:blue ], [ s:base3, s:base01 ] ]
+let s:p.normal.right = [ [ s:base02, s:base1 ], [ s:base2, s:base01 ] ]
+let s:p.inactive.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
+let s:p.inactive.left = [ [ s:base02, s:base0 ], [ s:base00, s:base03 ] ]
+let s:p.insert.left = [ [ s:base023, s:green ], [ s:base3, s:base01 ] ]
+let s:p.replace.left = [ [ s:base023, s:orange ], [ s:base3, s:base01 ] ]
+let s:p.visual.left = [ [ s:base023, s:magenta ], [ s:base3, s:base01 ] ]
+let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
+let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
+let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
+let s:p.tabline.tabsel = [ [ s:base2, s:base03 ] ]
+let s:p.tabline.middle = [ [ s:base01, s:base1 ] ]
+let s:p.tabline.right = copy(s:p.normal.right)
+let s:p.normal.error = [ [ s:base023, s:red ] ]
+let s:p.normal.warning = [ [ s:base023, s:yellow ] ]
+
+let g:lightline#colorscheme#Tomorrow_Night_Eighties#palette = lightline#colorscheme#fill(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/default.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/default.vim
new file mode 100644
index 0000000..ee9835c
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/default.vim
@@ -0,0 +1,8 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/default.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2013/08/22 06:05:52.
+" =============================================================================
+
+let g:lightline#colorscheme#default#palette = g:lightline#colorscheme#powerline#palette
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/jellybeans.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/jellybeans.vim
new file mode 100644
index 0000000..15b2b35
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/jellybeans.vim
@@ -0,0 +1,40 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/jellybeans.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2013/09/07 12:21:04.
+" =============================================================================
+let s:base03 = [ '#151513', 233 ]
+let s:base02 = [ '#30302c ', 236 ]
+let s:base01 = [ '#4e4e43', 239 ]
+let s:base00 = [ '#666656', 242 ]
+let s:base0 = [ '#808070', 244 ]
+let s:base1 = [ '#949484', 246 ]
+let s:base2 = [ '#a8a897', 248 ]
+let s:base3 = [ '#e8e8d3', 253 ]
+let s:yellow = [ '#ffb964', 215 ]
+let s:orange = [ '#fad07a', 222 ]
+let s:red = [ '#cf6a4c', 167 ]
+let s:magenta = [ '#f0a0c0', 217 ]
+let s:blue = [ '#8197bf', 103 ]
+let s:cyan = [ '#8fbfdc', 110 ]
+let s:green = [ '#99ad6a', 107 ]
+
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
+let s:p.normal.right = [ [ s:base02, s:base1 ], [ s:base2, s:base01 ] ]
+let s:p.inactive.right = [ [ s:base02, s:base00 ], [ s:base0, s:base02 ] ]
+let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base02 ] ]
+let s:p.insert.left = [ [ s:base02, s:green ], [ s:base3, s:base01 ] ]
+let s:p.replace.left = [ [ s:base02, s:red ], [ s:base3, s:base01 ] ]
+let s:p.visual.left = [ [ s:base02, s:magenta ], [ s:base3, s:base01 ] ]
+let s:p.normal.middle = [ [ s:base0, s:base02 ] ]
+let s:p.inactive.middle = [ [ s:base00, s:base02 ] ]
+let s:p.tabline.left = [ [ s:base3, s:base00 ] ]
+let s:p.tabline.tabsel = [ [ s:base3, s:base02 ] ]
+let s:p.tabline.middle = [ [ s:base01, s:base1 ] ]
+let s:p.tabline.right = copy(s:p.normal.right)
+let s:p.normal.error = [ [ s:red, s:base02 ] ]
+let s:p.normal.warning = [ [ s:yellow, s:base01 ] ]
+
+let g:lightline#colorscheme#jellybeans#palette = lightline#colorscheme#flatten(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/landscape.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/landscape.vim
new file mode 100644
index 0000000..68d0920
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/landscape.vim
@@ -0,0 +1,25 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/landscape.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2015/11/26 21:49:44.
+" =============================================================================
+
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ ['#0000ff', '#ffffff', 21, 231, 'bold' ], [ '#ffffff', '#0000ff', 231, 21 ] ]
+let s:p.normal.right = [ [ '#303030', '#d0d0d0', 236, 252 ], [ '#303030', '#8a8a8a', 236, 245 ], [ '#bcbcbc', '#585858', 250, 240 ] ]
+let s:p.inactive.right = [ [ '#121212', '#606060', 233, 241 ], [ '#121212', '#3a3a3a', 233, 237 ], [ '#121212', '#262626', 233, 235 ] ]
+let s:p.inactive.left = s:p.inactive.right[1:]
+let s:p.insert.left = [ ['#005f00', '#ffffff', 22, 231, 'bold' ], [ '#ffffff', '#005f00', 231, 22 ] ]
+let s:p.replace.left = [ [ '#af0000', '#ffffff', 124, 231, 'bold' ], [ '#ffffff', '#af0000', 231, 124 ] ]
+let s:p.visual.left = [ [ '#5f00ff', '#ffffff', 57, 231, 'bold' ], [ '#ffffff', '#5f00ff', 231, 57 ] ]
+let s:p.normal.middle = [ [ '#8a8a8a', '#303030', 245, 236 ] ]
+let s:p.inactive.middle = [ [ '#303030', '#121212', 236, 233 ] ]
+let s:p.tabline.left = [ [ '#d0d0d0', '#666666', 252, 242 ] ]
+let s:p.tabline.tabsel = [ [ '#dadada', '#121212', 253, 233 ] ]
+let s:p.tabline.middle = [ [ '#8a8a8a', '#3a3a3a', 245, 237 ] ]
+let s:p.tabline.right = [ [ '#d0d0d0', '#666666', 252, 242 ] ]
+let s:p.normal.error = [ [ '#d0d0d0', '#ff0000', 252, 196 ] ]
+let s:p.normal.warning = [ [ '#262626', '#ffff00', 235, 226 ] ]
+
+let g:lightline#colorscheme#landscape#palette = s:p
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/powerline.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/powerline.vim
new file mode 100644
index 0000000..40e48d4
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/powerline.vim
@@ -0,0 +1,28 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/powerline.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2013/09/07 15:54:41.
+" =============================================================================
+
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ ['darkestgreen', 'brightgreen', 'bold'], ['white', 'gray4'] ]
+let s:p.normal.right = [ ['gray5', 'gray10'], ['gray9', 'gray4'], ['gray8', 'gray2'] ]
+let s:p.inactive.right = [ ['gray1', 'gray5'], ['gray4', 'gray1'], ['gray4', 'gray0'] ]
+let s:p.inactive.left = s:p.inactive.right[1:]
+let s:p.insert.left = [ ['darkestcyan', 'white', 'bold'], ['white', 'darkblue'] ]
+let s:p.insert.right = [ [ 'darkestcyan', 'mediumcyan' ], [ 'mediumcyan', 'darkblue' ], [ 'mediumcyan', 'darkestblue' ] ]
+let s:p.replace.left = [ ['white', 'brightred', 'bold'], ['white', 'gray4'] ]
+let s:p.visual.left = [ ['darkred', 'brightorange', 'bold'], ['white', 'gray4'] ]
+let s:p.normal.middle = [ [ 'gray7', 'gray2' ] ]
+let s:p.insert.middle = [ [ 'mediumcyan', 'darkestblue' ] ]
+let s:p.replace.middle = s:p.normal.middle
+let s:p.replace.right = s:p.normal.right
+let s:p.tabline.left = [ [ 'gray9', 'gray4' ] ]
+let s:p.tabline.tabsel = [ [ 'gray9', 'gray1' ] ]
+let s:p.tabline.middle = [ [ 'gray2', 'gray8' ] ]
+let s:p.tabline.right = [ [ 'gray9', 'gray3' ] ]
+let s:p.normal.error = [ [ 'gray9', 'brightestred' ] ]
+let s:p.normal.warning = [ [ 'gray1', 'yellow' ] ]
+
+let g:lightline#colorscheme#powerline#palette = lightline#colorscheme#fill(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/seoul256.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/seoul256.vim
new file mode 100644
index 0000000..ca2d5a0
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/seoul256.vim
@@ -0,0 +1,42 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/seoul256.vim
+" Author: atweiden
+" License: MIT License
+" Last Change: 2015/11/02 08:23:27.
+" =============================================================================
+let s:base03 = [ '#151513', 233 ]
+let s:base02 = [ '#30302c ', 236 ]
+let s:base01 = [ '#4e4e43', 239 ]
+let s:base00 = [ '#666656', 242 ]
+let s:base0 = [ '#808070', 244 ]
+let s:base1 = [ '#949484', 246 ]
+let s:base2 = [ '#a8a897', 248 ]
+let s:base3 = [ '#e8e8d3', 253 ]
+let s:yellow = [ '#d8af5f', 3 ]
+let s:orange = [ '#d7875f', 216 ]
+let s:red = [ '#d68787', 131 ]
+let s:magenta = [ '#df5f87', 168 ]
+let s:peach = [ '#d7afaf', 181 ]
+let s:blue = [ '#87afaf', 109 ]
+let s:cyan = [ '#87d7d7', 23 ]
+let s:green = [ '#87af87', 108 ]
+let s:white = [ '#d0d0d0', 252 ]
+
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
+let s:p.normal.right = [ [ s:base02, s:base1 ], [ s:base2, s:base01 ] ]
+let s:p.inactive.right = [ [ s:base02, s:base00 ], [ s:base0, s:base02 ] ]
+let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base02 ] ]
+let s:p.insert.left = [ [ s:base02, s:green ], [ s:base3, s:base01 ] ]
+let s:p.replace.left = [ [ s:base02, s:magenta ], [ s:base3, s:base01 ] ]
+let s:p.visual.left = [ [ s:base02, s:peach ], [ s:base3, s:base01 ] ]
+let s:p.normal.middle = [ [ s:base0, s:base02 ] ]
+let s:p.inactive.middle = [ [ s:base00, s:base02 ] ]
+let s:p.tabline.left = [ [ s:base3, s:base00 ] ]
+let s:p.tabline.tabsel = [ [ s:base3, s:base02 ] ]
+let s:p.tabline.middle = [ [ s:base01, s:base1 ] ]
+let s:p.tabline.right = copy(s:p.normal.right)
+let s:p.normal.error = [ [ s:red, s:base02 ] ]
+let s:p.normal.warning = [ [ s:yellow, s:base01 ] ]
+
+let g:lightline#colorscheme#seoul256#palette = lightline#colorscheme#flatten(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/solarized.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/solarized.vim
new file mode 100644
index 0000000..2695c35
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/solarized.vim
@@ -0,0 +1,11 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/solarized.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2013/08/27 10:24:28.
+" =============================================================================
+if &background ==# 'light'
+ let g:lightline#colorscheme#solarized#palette = g:lightline#colorscheme#solarized_light#palette
+else
+ let g:lightline#colorscheme#solarized#palette = g:lightline#colorscheme#solarized_dark#palette
+endif
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/solarized_dark.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/solarized_dark.vim
new file mode 100644
index 0000000..37a3dc7
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/solarized_dark.vim
@@ -0,0 +1,73 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/solarized_dark.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2014/05/31 01:04:15.
+" =============================================================================
+
+let s:cuicolors = {
+ \ 'base03': [ '8', '234', 'DarkGray' ],
+ \ 'base02': [ '0', '235', 'Black' ],
+ \ 'base01': [ '10', '239', 'LightGreen' ],
+ \ 'base00': [ '11', '240', 'LightYellow' ],
+ \ 'base0': [ '12', '244', 'LightBlue' ],
+ \ 'base1': [ '14', '245', 'LightCyan' ],
+ \ 'base2': [ '7', '187', 'LightGray' ],
+ \ 'base3': [ '15', '230', 'White' ],
+ \ 'yellow': [ '3', '136', 'DarkYellow' ],
+ \ 'orange': [ '9', '166', 'LightRed' ],
+ \ 'red': [ '1', '124', 'DarkRed' ],
+ \ 'magenta': [ '5', '125', 'DarkMagenta' ],
+ \ 'violet': [ '13', '61', 'LightMagenta' ],
+ \ 'blue': [ '4', '33', 'DarkBlue' ],
+ \ 'cyan': [ '6', '37', 'DarkCyan' ],
+ \ 'green': [ '2', '64', 'DarkGreen' ],
+ \ }
+
+" The following condition only applies for the console and is the same
+" condition vim-colors-solarized uses to determine which set of colors
+" to use.
+let s:solarized_termcolors = get(g:, 'solarized_termcolors', 256)
+if s:solarized_termcolors != 256 && &t_Co >= 16
+ let s:cuiindex = 0
+elseif s:solarized_termcolors == 256
+ let s:cuiindex = 1
+else
+ let s:cuiindex = 2
+endif
+
+let s:base03 = [ '#002b36', s:cuicolors.base03[s:cuiindex] ]
+let s:base02 = [ '#073642', s:cuicolors.base02[s:cuiindex] ]
+let s:base01 = [ '#586e75', s:cuicolors.base01[s:cuiindex] ]
+let s:base00 = [ '#657b83', s:cuicolors.base00[s:cuiindex] ]
+let s:base0 = [ '#839496', s:cuicolors.base0[s:cuiindex] ]
+let s:base1 = [ '#93a1a1', s:cuicolors.base1[s:cuiindex] ]
+let s:base2 = [ '#eee8d5', s:cuicolors.base2[s:cuiindex] ]
+let s:base3 = [ '#fdf6e3', s:cuicolors.base3[s:cuiindex] ]
+let s:yellow = [ '#b58900', s:cuicolors.yellow[s:cuiindex] ]
+let s:orange = [ '#cb4b16', s:cuicolors.orange[s:cuiindex] ]
+let s:red = [ '#dc322f', s:cuicolors.red[s:cuiindex] ]
+let s:magenta = [ '#d33682', s:cuicolors.magenta[s:cuiindex] ]
+let s:violet = [ '#6c71c4', s:cuicolors.violet[s:cuiindex] ]
+let s:blue = [ '#268bd2', s:cuicolors.blue[s:cuiindex] ]
+let s:cyan = [ '#2aa198', s:cuicolors.cyan[s:cuiindex] ]
+let s:green = [ '#859900', s:cuicolors.green[s:cuiindex] ]
+
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ [ s:base3, s:blue ], [ s:base3, s:base01 ] ]
+let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
+let s:p.inactive.right = [ [ s:base02, s:base01 ], [ s:base00, s:base02 ] ]
+let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base02 ] ]
+let s:p.insert.left = [ [ s:base3, s:green ], [ s:base3, s:base01 ] ]
+let s:p.replace.left = [ [ s:base3, s:red ], [ s:base3, s:base01 ] ]
+let s:p.visual.left = [ [ s:base3, s:magenta ], [ s:base3, s:base01 ] ]
+let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
+let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
+let s:p.tabline.left = [ [ s:base1, s:base00 ] ]
+let s:p.tabline.tabsel = [ [ s:base3, s:base0 ] ]
+let s:p.tabline.middle = [ [ s:base01, s:base02 ] ]
+let s:p.tabline.right = copy(s:p.normal.right)
+let s:p.normal.error = [ [ s:base2, s:red ] ]
+let s:p.normal.warning = [ [ s:base02, s:yellow ] ]
+
+let g:lightline#colorscheme#solarized_dark#palette = lightline#colorscheme#flatten(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/solarized_light.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/solarized_light.vim
new file mode 100644
index 0000000..99046af
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/solarized_light.vim
@@ -0,0 +1,80 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/solarized_light.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2014/05/31 01:04:21.
+" =============================================================================
+
+let s:cuicolors = {
+ \ 'base03': [ '8', '234', 'DarkGray' ],
+ \ 'base02': [ '0', '235', 'Black' ],
+ \ 'base01': [ '10', '239', 'LightGreen' ],
+ \ 'base00': [ '11', '240', 'LightYellow' ],
+ \ 'base0': [ '12', '244', 'LightBlue' ],
+ \ 'base1': [ '14', '245', 'LightCyan' ],
+ \ 'base2': [ '7', '187', 'LightGray' ],
+ \ 'base3': [ '15', '230', 'White' ],
+ \ 'yellow': [ '3', '136', 'DarkYellow' ],
+ \ 'orange': [ '9', '166', 'LightRed' ],
+ \ 'red': [ '1', '124', 'DarkRed' ],
+ \ 'magenta': [ '5', '125', 'DarkMagenta' ],
+ \ 'violet': [ '13', '61', 'LightMagenta' ],
+ \ 'blue': [ '4', '33', 'DarkBlue' ],
+ \ 'cyan': [ '6', '37', 'DarkCyan' ],
+ \ 'green': [ '2', '64', 'DarkGreen' ],
+ \ }
+
+" The following condition only applies for the console and is the same
+" condition vim-colors-solarized uses to determine which set of colors
+" to use.
+let s:solarized_termcolors = get(g:, 'solarized_termcolors', 256)
+if s:solarized_termcolors != 256 && &t_Co >= 16
+ let s:cuiindex = 0
+elseif s:solarized_termcolors == 256
+ let s:cuiindex = 1
+else
+ let s:cuiindex = 2
+endif
+
+let s:base03 = [ '#002b36', s:cuicolors.base03[s:cuiindex] ]
+let s:base02 = [ '#073642', s:cuicolors.base02[s:cuiindex] ]
+let s:base01 = [ '#586e75', s:cuicolors.base01[s:cuiindex] ]
+let s:base00 = [ '#657b83', s:cuicolors.base00[s:cuiindex] ]
+let s:base0 = [ '#839496', s:cuicolors.base0[s:cuiindex] ]
+let s:base1 = [ '#93a1a1', s:cuicolors.base1[s:cuiindex] ]
+let s:base2 = [ '#eee8d5', s:cuicolors.base2[s:cuiindex] ]
+let s:base3 = [ '#fdf6e3', s:cuicolors.base3[s:cuiindex] ]
+let s:yellow = [ '#b58900', s:cuicolors.yellow[s:cuiindex] ]
+let s:orange = [ '#cb4b16', s:cuicolors.orange[s:cuiindex] ]
+let s:red = [ '#dc322f', s:cuicolors.red[s:cuiindex] ]
+let s:magenta = [ '#d33682', s:cuicolors.magenta[s:cuiindex] ]
+let s:violet = [ '#6c71c4', s:cuicolors.violet[s:cuiindex] ]
+let s:blue = [ '#268bd2', s:cuicolors.blue[s:cuiindex] ]
+let s:cyan = [ '#2aa198', s:cuicolors.cyan[s:cuiindex] ]
+let s:green = [ '#859900', s:cuicolors.green[s:cuiindex] ]
+
+let [s:base03, s:base3] = [s:base3, s:base03]
+let [s:base02, s:base2] = [s:base2, s:base02]
+let [s:base01, s:base1] = [s:base1, s:base01]
+let [s:base00, s:base0] = [s:base0, s:base00]
+
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ [ s:base3, s:blue ], [ s:base3, s:base01 ] ]
+let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
+let s:p.inactive.right = [ [ s:base02, s:base01 ], [ s:base00, s:base02 ] ]
+let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base02 ] ]
+let s:p.insert.left = [ [ s:base3, s:green ], [ s:base3, s:base01 ] ]
+let s:p.replace.left = [ [ s:base3, s:red ], [ s:base3, s:base01 ] ]
+let s:p.visual.left = [ [ s:base3, s:magenta ], [ s:base3, s:base01 ] ]
+let s:p.normal.middle = [ [ s:base1, s:base02 ] ]
+let s:p.inactive.middle = [ [ s:base0, s:base02 ] ]
+let s:p.tabline.left = [ [ s:base2, s:base01 ] ]
+let s:p.tabline.tabsel = [ [ s:base2, s:base03 ] ]
+let s:p.tabline.middle = [ [ s:base1, s:base02 ] ]
+let s:p.tabline.right = copy(s:p.normal.right)
+let s:p.normal.error = [ [ s:red, s:base01 ] ]
+let s:p.normal.warning = [ [ s:yellow, s:base01 ] ]
+let s:p.normal.error = [ [ s:base02, s:red ] ]
+let s:p.normal.warning = [ [ s:base2, s:yellow ] ]
+
+let g:lightline#colorscheme#solarized_light#palette = lightline#colorscheme#flatten(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colorscheme/wombat.vim b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/wombat.vim
new file mode 100644
index 0000000..9619247
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colorscheme/wombat.vim
@@ -0,0 +1,40 @@
+" =============================================================================
+" Filename: autoload/lightline/colorscheme/wombat.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2015/11/30 08:37:43.
+" =============================================================================
+let s:base03 = [ '#242424', 235 ]
+let s:base023 = [ '#353535 ', 236 ]
+let s:base02 = [ '#444444 ', 238 ]
+let s:base01 = [ '#585858', 240 ]
+let s:base00 = [ '#666666', 242 ]
+let s:base0 = [ '#808080', 244 ]
+let s:base1 = [ '#969696', 247 ]
+let s:base2 = [ '#a8a8a8', 248 ]
+let s:base3 = [ '#d0d0d0', 252 ]
+let s:yellow = [ '#cae682', 180 ]
+let s:orange = [ '#e5786d', 173 ]
+let s:red = [ '#e5786d', 203 ]
+let s:magenta = [ '#f2c68a', 216 ]
+let s:blue = [ '#8ac6f2', 117 ]
+let s:cyan = s:blue
+let s:green = [ '#95e454', 119 ]
+let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
+let s:p.normal.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ]
+let s:p.normal.right = [ [ s:base02, s:base0 ], [ s:base1, s:base01 ] ]
+let s:p.inactive.right = [ [ s:base023, s:base01 ], [ s:base00, s:base02 ] ]
+let s:p.inactive.left = [ [ s:base1, s:base02 ], [ s:base00, s:base023 ] ]
+let s:p.insert.left = [ [ s:base02, s:green ], [ s:base3, s:base01 ] ]
+let s:p.replace.left = [ [ s:base023, s:red ], [ s:base3, s:base01 ] ]
+let s:p.visual.left = [ [ s:base02, s:magenta ], [ s:base3, s:base01 ] ]
+let s:p.normal.middle = [ [ s:base2, s:base02 ] ]
+let s:p.inactive.middle = [ [ s:base1, s:base023 ] ]
+let s:p.tabline.left = [ [ s:base3, s:base00 ] ]
+let s:p.tabline.tabsel = [ [ s:base3, s:base03 ] ]
+let s:p.tabline.middle = [ [ s:base2, s:base02 ] ]
+let s:p.tabline.right = [ [ s:base2, s:base00 ] ]
+let s:p.normal.error = [ [ s:base03, s:red ] ]
+let s:p.normal.warning = [ [ s:base023, s:yellow ] ]
+
+let g:lightline#colorscheme#wombat#palette = lightline#colorscheme#flatten(s:p)
diff --git a/vim/bundle/lightline.vim/autoload/lightline/colortable.vim b/vim/bundle/lightline.vim/autoload/lightline/colortable.vim
new file mode 100644
index 0000000..82617b2
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/colortable.vim
@@ -0,0 +1,42 @@
+" =============================================================================
+" Filename: autoload/lightline/colortable.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2015/03/29 06:21:39.
+" =============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! s:load() abort
+ let rgbfile = $VIMRUNTIME . '/rgb.txt'
+ let table = {}
+ if filereadable(rgbfile)
+ for _ in map(filter(readfile(rgbfile), 'v:val !~# "^!"'), 'matchlist(v:val, "^\\s*\\(\\d\\+\\)\\s\\+\\(\\d\\+\\)\\s\\+\\(\\d\\+\\)\\s\\+\\(.*\\)")[1:4]')
+ let table[tolower(_[3])] = _[0:2]
+ endfor
+ endif
+ return table
+endfunction
+
+let s:table = s:load()
+
+function! lightline#colortable#name_to_rgb(name) abort
+ let name = tolower(a:name)
+ return has_key(s:table, name) ? s:table[name] : []
+endfunction
+
+function! lightline#colortable#gui2cui(rgb, fallback) abort
+ let rgb = map(matchlist(a:rgb, '#\(..\)\(..\)\(..\)')[1:3], '0 + ("0x".v:val)')
+ if len(rgb) == 0
+ let rgb = lightline#colortable#name_to_rgb(a:rgb)
+ if len(rgb) == 0
+ return a:fallback % 128
+ endif
+ endif
+ let rgb = [rgb[0] > 127 ? 4 : 0, rgb[1] > 127 ? 2 : 0, rgb[2] > 127 ? 1 : 0]
+ return rgb[0] + rgb[1] + rgb[2]
+endfunction
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/lightline.vim/autoload/lightline/tab.vim b/vim/bundle/lightline.vim/autoload/lightline/tab.vim
new file mode 100644
index 0000000..f2accc1
--- /dev/null
+++ b/vim/bundle/lightline.vim/autoload/lightline/tab.vim
@@ -0,0 +1,33 @@
+" =============================================================================
+" Filename: autoload/lightline/tab.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2016/05/07 22:31:02.
+" =============================================================================
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! lightline#tab#filename(n) abort
+ let buflist = tabpagebuflist(a:n)
+ let winnr = tabpagewinnr(a:n)
+ let _ = expand('#'.buflist[winnr - 1].':t')
+ return _ !=# '' ? _ : '[No Name]'
+endfunction
+
+function! lightline#tab#modified(n) abort
+ let winnr = tabpagewinnr(a:n)
+ return gettabwinvar(a:n, winnr, '&modified') ? '+' : gettabwinvar(a:n, winnr, '&modifiable') ? '' : '-'
+endfunction
+
+function! lightline#tab#readonly(n) abort
+ let winnr = tabpagewinnr(a:n)
+ return gettabwinvar(a:n, winnr, '&readonly') ? 'RO' : ''
+endfunction
+
+function! lightline#tab#tabnum(n) abort
+ return a:n
+endfunction
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/lightline.vim/doc/lightline.txt b/vim/bundle/lightline.vim/doc/lightline.txt
new file mode 100644
index 0000000..9936725
--- /dev/null
+++ b/vim/bundle/lightline.vim/doc/lightline.txt
@@ -0,0 +1,1281 @@
+*lightline.txt* A light and configurable statusline/tabline for Vim
+
+Version: 0.0
+Author: itchyny (https://github.com/itchyny)
+License: MIT License
+Repository: https://github.com/itchyny/lightline.vim
+Last Change: 2016/05/26 21:57:34.
+
+CONTENTS *lightline-contents*
+
+Introduction |lightline-introduction|
+Spirit |lightline-spirit|
+Option |lightline-option|
+Font |lightline-font|
+Function |lightline-function|
+Component Expansion |lightline-component-expansion|
+Colorscheme |lightline-colorscheme|
+Examples |lightline-examples|
+Nice Examples |lightline-nice-examples|
+Powerful Example |lightline-powerful-example|
+Troubleshooting |lightline-troubleshooting|
+Changelog |lightline-changelog|
+
+==============================================================================
+INTRODUCTION *lightline-introduction*
+
+The *lightline* plugin is a light and configurable statusline/tabline for Vim.
+
+------------------------------------------------------------------------------
+SPIRIT *lightline-spirit*
+
+ Minimalism
+ The core script is very small.
+
+ Configurability
+ You can create your own component and easily add to the
+ statusline/tabline.
+
+ Orthogonality
+ Any plugin should not change the settings of another plugin.
+ Such plugin-crossing settings should be written by users in
+ .vimrc.
+
+ You might find this plugin is not so useful by default. This plugin
+ does not provide the branch information, which is a very basic
+ component in existing plugins. The reason is that branch component is
+ one of plugin-crossing settings so users should write the settings
+ using the APIs of the both plugins. Hospitality makes a plugin messy.
+ Good APIs keep a plugin clean.
+
+------------------------------------------------------------------------------
+OPTIONS *lightline-option*
+
+ g:lightline *g:lightline*
+ All the options are stored into this global variable.
+
+ g:lightline.active *g:lightline.active*
+ g:lightline.inactive *g:lightline.inactive*
+ g:lightline.tabline *g:lightline.tabline*
+ Dictionaries to specify the statusline/tabline components.
+ The components are gathered from either |g:lightline.component|,
+ |g:lightline.component_function| or
+ |g:lightline.component_expand|.
+ Note that right groups of components are stored from right to
+ left. The default values are:
+>
+ let g:lightline.active = {
+ \ 'left': [ [ 'mode', 'paste' ],
+ \ [ 'readonly', 'filename', 'modified' ] ],
+ \ 'right': [ [ 'lineinfo' ],
+ \ [ 'percent' ],
+ \ [ 'fileformat', 'fileencoding', 'filetype' ] ] }
+ let g:lightline.inactive = {
+ \ 'left': [ [ 'filename' ] ],
+ \ 'right': [ [ 'lineinfo' ],
+ \ [ 'percent' ] ] }
+ let g:lightline.tabline = {
+ \ 'left': [ [ 'tabs' ] ],
+ \ 'right': [ [ 'close' ] ] }
+<
+ g:lightline.tab *g:lightline.tab*
+ Dictionaries to specify the components in each tabs.
+ The components are gathered from either
+ |g:lightline.tab_component| or
+ |g:lightline.tab_component_function|.
+ The default values are:
+>
+ let g:lightline.tab = {
+ \ 'active': [ 'tabnum', 'filename', 'modified' ],
+ \ 'inactive': [ 'tabnum', 'filename', 'modified' ] }
+<
+ g:lightline.component *g:lightline.component*
+ Dictionary for statusline/tabline components.
+ The default value is:
+>
+ let g:lightline.component = {
+ \ 'mode': '%{lightline#mode()}',
+ \ 'absolutepath': '%F',
+ \ 'relativepath': '%f',
+ \ 'filename': '%t',
+ \ 'modified': '%M',
+ \ 'bufnum': '%n',
+ \ 'paste': '%{&paste?"PASTE":""}',
+ \ 'readonly': '%R',
+ \ 'charvalue': '%b',
+ \ 'charvaluehex': '%B',
+ \ 'fileencoding': '%{&fenc!=#""?&fenc:&enc}',
+ \ 'fileformat': '%{&ff}',
+ \ 'filetype': '%{&ft!=#""?&ft:"no ft"}',
+ \ 'percent': '%3p%%',
+ \ 'percentwin': '%P',
+ \ 'spell': '%{&spell?&spelllang:""}',
+ \ 'lineinfo': '%3l:%-2v',
+ \ 'line': '%l',
+ \ 'column': '%c'
+ \ 'close': '%999X X ' }
+<
+ g:lightline.component_visible_condition *g:lightline.component_visible_condition*
+ Dictionary of boolean expressions for the components.
+ Each expression should correspond to the condition each
+ component have non-zero length.
+ The default value is:
+>
+ let g:lightline.component_visible_condition = {
+ \ 'modified': '&modified||!&modifiable',
+ \ 'readonly': '&readonly',
+ \ 'paste': '&paste',
+ \ 'spell': '&spell' }
+<
+ Users are recommended to set this option together with the
+ component itself.
+
+ g:lightline.component_function *g:lightline.component_function*
+ Another dictionary for components. This is more convenient
+ because the user does not have to set both component and
+ component_visible_condition. If a component set to both component and
+ component_function, the setting of component_function has priority.
+ For example, if you want a component for read-only mark, which
+ disappears in help windows:
+>
+ let g:lightline = {
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ],
+ \ [ 'myreadonly', 'filename', 'modified' ] ],
+ \ },
+ \ 'component_function': {
+ \ 'myreadonly': 'LightLineReadonly'
+ \ },
+ \ }
+ function! LightLineReadonly()
+ return &ft !~? 'help' && &readonly ? 'RO' : ''
+ endfunction
+<
+ g:lightline.component_expand *g:lightline.component_expand*
+ Another dictionary for components. You can create a component
+ which has a special color. For example, error components or
+ warning components. The functions should return one of:
+ + a string
+ + an array of three elements:
+ [[ left ], [ middle ], [ right ]]
+ The component in this dictionary has priority over
+ |g:lightline.component| and |g:lightline.component_function|.
+ Note that the return string is appended to the statusline
+ string without any conversion. So you should replace all the
+ % signs with %%. Otherwise, lightline will be disabled in case
+ the text has a % sign.
+ (example: return substitute(text, '%', '%%', 'g')).
+ See |lightline-component-expansion| for more detail.
+>
+ let g:lightline.component_expand = {
+ \ 'tabs': 'lightline#tabs' }
+<
+ g:lightline.component_type *g:lightline.component_type*
+ A dictionary to specify the types for components in
+ |g:lightline.component_expand|. The types are used to specify
+ the color. Specifically, the type raw is used to specify a
+ component which should not be wrapped by item group: %(...%).
+ The default value is: >
+
+ let g:lightline.component_type = {
+ \ 'tabs': 'tabsel',
+ \ 'close': 'raw' }
+<
+ g:lightline.tab_component *g:lightline.tab_component*
+ A dictionary for components in one tab.
+ The default value is: >
+
+ let g:lightline.tab_component = {}
+<
+ g:lightline.tab_component_function *g:lightline.tab_component_function*
+ Another dictionary for components in one tab.
+ A function specified as a tab component takes one argument:
+ the tab [count].
+ The default value is:
+>
+ let g:lightline.tab_component_function = {
+ \ 'filename': 'lightline#tab#filename',
+ \ 'modified': 'lightline#tab#modified',
+ \ 'readonly': 'lightline#tab#readonly',
+ \ 'tabnum': 'lightline#tab#tabnum' }
+<
+ g:lightline.colorscheme *g:lightline.colorscheme*
+ The colorscheme for lightline.vim.
+ Currently, wombat, solarized, powerline, jellybeans, Tomorrow,
+ Tomorrow_Night, Tomorrow_Night_Blue, Tomorrow_Night_Eighties,
+ PaperColor, seoul256, landscape and 16color are available.
+ The default value is:
+>
+ let g:lightline.colorscheme = 'default'
+<
+ Note that the default colorscheme is exactly the same as the
+ powerline theme.
+
+ g:lightline.mode_map *g:lightline.mode_map*
+ A dictionary of names for the modes. The keys are the return
+ values of |mode()|.
+ The default value is:
+>
+ let g:lightline.mode_map = {
+ \ 'n' : 'NORMAL',
+ \ 'i' : 'INSERT',
+ \ 'R' : 'REPLACE',
+ \ 'v' : 'VISUAL',
+ \ 'V' : 'V-LINE',
+ \ "\<C-v>": 'V-BLOCK',
+ \ 'c' : 'COMMAND',
+ \ 's' : 'SELECT',
+ \ 'S' : 'S-LINE',
+ \ "\<C-s>": 'S-BLOCK',
+ \ 't': 'TERMINAL',
+ \ }
+<
+ When you search a word, you get into the command mode. But if
+ you want to keep the mode indicator as 'NORMAL', add >
+ let g:lightline = { 'mode_map': { 'c': 'NORMAL' } }
+< to your .vimrc.
+
+ g:lightline.separator *g:lightline.separator*
+ g:lightline.subseparator *g:lightline.subseparator*
+ Dictionaries to store separators.
+ The default value is
+>
+ let g:lightline.separator = { 'left': '', 'right': '' }
+ let g:lightline.subseparator = { 'left': '|', 'right': '|' }
+<
+ g:lightline.tabline_separator *g:lightline.tabline_separator*
+ g:lightline.tabline_subseparator *g:lightline.tabline_subseparator*
+ Dictionaries to store separators for the tabline.
+ The default value is
+>
+ let g:lightline.tabline_separator = g:lightline.separator
+ let g:lightline.tabline_subseparator = g:lightline.subseparator
+<
+ g:lightline.enable *g:lightline.enable*
+ A dictionary to specify which feature is turned on.
+ The default value is
+>
+ let g:lightline.enable = {
+ \ 'statusline': 1,
+ \ 'tabline': 1
+ \ }
+<
+
+==============================================================================
+FONT *lightline-font*
+You can use the patched font you used for |vim-powerline| and |powerline|.
+
+The patched fonts for |powerline| are available at
+https://github.com/Lokaltog/powerline-fonts
+
+A tutorial to create a patched font for |vim-powerline| is available at
+https://github.com/Lokaltog/vim-powerline/tree/develop/fontpatcher
+
+If you have installed the patched font for |powerline|, following settings look
+nice.
+>
+ let g:lightline = {
+ \ 'component': {
+ \ 'lineinfo': ' %3l:%-2v',
+ \ },
+ \ 'component_function': {
+ \ 'readonly': 'LightLineReadonly',
+ \ 'fugitive': 'LightLineFugitive'
+ \ },
+ \ 'separator': { 'left': '', 'right': '' },
+ \ 'subseparator': { 'left': '', 'right': '' }
+ \ }
+ function! LightLineReadonly()
+ return &readonly ? '' : ''
+ endfunction
+ function! LightLineFugitive()
+ if exists('*fugitive#head')
+ let branch = fugitive#head()
+ return branch !=# '' ? ''.branch : ''
+ endif
+ return ''
+ endfunction
+<
+If you have installed the patched font for |vim-powerline|, following settings
+look nice.
+>
+ let g:lightline = {
+ \ 'component': {
+ \ 'lineinfo': '⭡ %3l:%-2v',
+ \ },
+ \ 'component_function': {
+ \ 'readonly': 'LightLineReadonly',
+ \ 'fugitive': 'LightLineFugitive'
+ \ },
+ \ 'separator': { 'left': '⮀', 'right': '⮂' },
+ \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
+ \ }
+ function! LightLineReadonly()
+ return &readonly ? '⭤' : ''
+ endfunction
+ function! LightLineFugitive()
+ if exists('*fugitive#head')
+ let branch = fugitive#head()
+ return branch !=# '' ? '⭠ '.branch : ''
+ endif
+ return ''
+ endfunction
+<
+If the statusline does not correctly show the special characters, use the
+unicode numbers. For |powerline| font users:
+>
+ \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
+ \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }
+<
+For |vim-powerline| font users:
+>
+ \ 'separator': { 'left': "\u2b80", 'right': "\u2b82" },
+ \ 'subseparator': { 'left': "\u2b81", 'right': "\u2b83" }
+<
+See |lightline-problem-9| for more detail.
+==============================================================================
+FUNCTION *lightline-function*
+Exposed functions for lightline.vim.
+
+ lightline#mode() *lightline#mode()*
+ Returns the mode of the Vim using |g:lightline.mode_map|.
+
+ lightline#init() *lightline#init()*
+ Initializes the internal state from |g:lightline|.
+
+ lightline#colorscheme() *lightline#colorscheme()*
+ Initializes the colorscheme and the highlight groups.
+
+ lightline#update() *lightline#update()*
+ Updates all the statuslines of existing windows.
+
+ lightline#update_once() *lightline#update_once()*
+ Updates the statuslines only once.
+
+ lightline#enable() *lightline#enable()*
+ Enables |lightline|.
+
+ lightline#disable() *lightline#disable()*
+ Disables |lightline|.
+
+ lightline#toggle() *lightline#toggle()*
+ Toggles |lightline|.
+
+ lightline#link([mode]) *lightline#link()*
+ Creates links of the highlight groups for the active window.
+ This function accepts an optional argument. It should be one
+ of the return value of |mode()|.
+
+ lightline#highlight() *lightline#highlight()*
+ Set the highlight groups.
+
+ lightline#statusline({inactive}) *lightline#statusline()*
+ Returns |statusline| strings. If the argument is 0, it returns
+ the statusline for active window, and the statusline for
+ inactive window otherwise.
+
+ lightline#tabline() *lightline#tabline()*
+ Returns the tabline string.
+
+ lightline#concatenate({list}, {num}) *lightline#concatenate()*
+ A string concatenation function. Concatenating all the strings
+ in {list} using the sub-separator of lightline. If {num} is 0,
+ then the left sub-separator is used. Otherwise, the right
+ sub-separator is used.
+
+ lightline#palette() *lightline#palette()*
+ Returns the palette data.
+
+==============================================================================
+COMPONENT EXPANSION *lightline-component-expansion*
+You can create components, which have specific colors. This section gives an
+example using |syntastic|.
+
+If you want to add the |syntastic| flag to the statusline, an easy example is:
+>
+ " Example A
+ let g:lightline = {
+ \ 'active': {
+ \ 'right': [ [ 'lineinfo', 'syntastic' ],
+ \ [ 'percent' ],
+ \ [ 'fileformat', 'fileencoding', 'filetype' ] ]
+ \ },
+ \ 'component_function': {
+ \ 'syntastic': 'SyntasticStatuslineFlag',
+ \ }
+ \ }
+ let g:syntastic_mode_map = { 'mode': 'passive',
+ \ 'active_filetypes': ['c', 'cpp'] }
+<
+However, the color of the syntastic component is the same as the lineinfo
+component.
+
+In order to change the syntastic component more outstanding, you have to use
+|g:lightline.component_expand|. See the following example:
+>
+ " Example B
+ let g:lightline = {
+ \ 'active': {
+ \ 'right': [ [ 'syntastic', 'lineinfo' ],
+ \ [ 'percent' ],
+ \ [ 'fileformat', 'fileencoding', 'filetype' ] ]
+ \ },
+ \ 'component_expand': {
+ \ 'syntastic': 'SyntasticStatuslineFlag',
+ \ },
+ \ 'component_type': {
+ \ 'syntastic': 'error',
+ \ }
+ \ }
+ let g:syntastic_mode_map = { 'mode': 'passive' }
+ augroup AutoSyntastic
+ autocmd!
+ autocmd BufWritePost *.c,*.cpp call s:syntastic()
+ augroup END
+ function! s:syntastic()
+ SyntasticCheck
+ call lightline#update()
+ endfunction
+<
+In order to understand the above codes, you firstly should know how the
+colorschemes work in lightline.vim. Open the following file.
+ autoload/lightline/colorscheme/powerline.vim
+The colorscheme is created by one dictionary: s:p (abbreviation for palette).
+See the value of s:p.normal.right.
+>
+ let s:p.normal.right = [ ['gray5', 'gray10'],
+ \ ['gray9', 'gray4'],
+ \ ['gray8', 'gray2'] ]
+<
+This array corresponds to the structure of g:lightline.active.right. Recall
+the example A.
+>
+ " Example A
+ let g:lightline.active.right = [ [ 'lineinfo', 'syntastic' ],
+ \ [ 'percent' ],
+ \ [ 'fileformat', 'fileencoding', 'filetype' ] ]
+<
+The colors are ([fgcolor, bgcolor):
+>
+ (0) [ 'lineinfo', 'syntastic' ] --- s:p.normal.right[0] = ['gray5', 'gray10']
+ (1) [ 'percent' ] --- s:p.normal.right[1] = ['gray9', 'gray4']
+ (2) [ 'fileformat', 'fileencoding', 'filetype' ] --- s:p.normal.right[2] = ['gray8', 'gray2']
+<
+Recall the example B.
+>
+ " Example B
+ let g:lightline.active.right = [ [ 'syntastic', 'lineinfo' ],
+ \ [ 'percent' ],
+ \ [ 'fileformat', 'fileencoding', 'filetype' ] ]
+<
+If a component is specified in |g:lightline.component_expand|, lightline.vim
+expands the components before setting to statusline/tabline. In this example,
+the syntastic component is expanded using the |SyntasticStatuslineFlag| function.
+This function returns a {string}. Let us call it `syntastic_flag`.
+>
+ let syntastic_flag = SyntasticStatuslineFlag()
+<
+The syntastic component is now expanded, so it go up to one component group.
+The type of the syntastic component is error, and the palette has error
+colors, the result is:
+>
+ " Expanded result of Example B
+ (error) [ syntastic_flag ] --- s:p.normal.error[0] = ['gray9', 'brightestred']
+ (0) [ 'lineinfo' ] --- s:p.normal.right[0] = ['gray5', 'gray10']
+ (1) [ 'percent' ] --- s:p.normal.right[1] = ['gray9', 'gray4']
+ (2) [ 'fileformat', 'fileencoding', 'filetype' ] --- s:p.normal.right[2] = ['gray8', 'gray2']
+<
+Thus the syntastic component has the red color.
+
+
+Another example for |g:lightline.component_expand| is the tabs component.
+Actually, the expand feature is created for the tabs component.
+>
+ let g:lightline.tabline.left = [ [ 'tabs' ] ]
+ let g:lightline.component_expand = {
+ \ 'tabs': 'lightline#tabs' }
+<
+Create three tabs and select the middle tab. Then execute
+>
+ echo lightline#tabs()
+ " [['%1T%{lightline#onetab(1,0)}'],
+ " ['%2T%{lightline#onetab(2,1)}'],
+ " ['%3T%{lightline#onetab(3,0)}%T']]
+<
+It returns an array of three elements. The expanded result is:
+>
+ " Expanded result of tabline
+ (0) ['%1T%{lightline#onetab(1,0)}'] --- s:p.tabline.left[0] = ['gray9', 'gray4']
+ (tabsel) ['%2T%{lightline#onetab(2,1)}'] --- s:p.tabline.tabsel[0] = ['gray9', 'gray1']
+ (0) ['%3T%{lightline#onetab(3,0)}%T'] --- s:p.tabline.left[0] = ['gray9', 'gray4']
+<
+If the tabline components are
+>
+ let g:lightline.tabline.left = [ [ 'A', 'B', 'tabs', 'C', 'D' ] ]
+<
+then the expanded result is:
+>
+ (0) ['A', 'B', '%1T%{lightline#onetab(1,0)}'] --- s:p.tabline.left[0]
+ (tabsel) ['%2T%{lightline#onetab(2,1)}'] --- s:p.tabline.tabsel[0]
+ (0) ['%3T%{lightline#onetab(3,0)}%T', 'C', 'D'] --- s:p.tabline.left[0]
+<
+In summary, when a function in |g:lightline.component_expand| returns an
+array of three elements, the first element and the last element remains as a
+part of existing component group. And the middle element goes up to new
+component group.
+------------------------------------------------------------------------------
+COLORSCHEME *lightline-colorscheme*
+You can configure the colorscheme of lightline. For example,
+>
+ let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ }
+<
+The colorscheme files are found in the directory
+
+ lightline.vim/autoload/lightline/colorscheme/
+
+In each file, one global variable is defined. For example, in the landscape.vim
+file, you see
+>
+ let g:lightline#colorscheme#landscape#palette = s:p
+<
+In the file, the colors for the landscape colorscheme are defined. For example,
+>
+ let s:p.normal.left = [ ['#0000ff', '#ffffff', 21, 231, 'bold' ], [ '#ffffff', '#0000ff', 231, 21 ] ]
+<
+defines the colors for the components on the left hand side, in normal mode.
+>
+ let s:p.tabline.tabsel = [ [ '#dadada', '#121212', 253, 233 ] ]
+<
+defines the colors for the selected tab in tabline. In general, each palette
+follows the following style:
+>
+ let s:p.{mode}.{where} = [ [ {guifg}, {guibg}, {cuifg}, {cuibg} ], ... ]
+<
+
+
+Now, you can create your own colorscheme for lightline. Create a
+yourcolorscheme.vim at
+
+ {one of the paths in &rtp}/autoload/lightline/colorscheme/yourcolorscheme.vim
+
+The following code gives the minimal palette definition for lightline.
+>
+ let s:p = {'normal': {}}
+ let s:p.normal.left = [ [ ... ] ]
+ let s:p.normal.right = [ [ ... ] ]
+ let s:p.normal.middle = [ [ ... ] ]
+ let g:lightline#colorscheme#yourcolorscheme#palette = s:p
+<
+And if you add the colorscheme configuration to your .vimrc(_vimrc),
+>
+ let g:lightline = {
+ \ 'colorscheme': 'yourcolorscheme',
+ \ }
+<
+you find it possible to change the lightline colors as you wish.
+
+Moreover, if you want to change the colors based on the mode of vim, write
+something like this:
+>
+ let s:p.insert.left = [ [ ... ] ]
+ let s:p.insert.right = [ [ ... ] ]
+ let s:p.replace.left = [ [ ... ] ]
+ let s:p.replace.right = [ [ ... ] ]
+ ...
+ ...
+<
+For expanded components, you are recommended to define the following two
+colors.
+>
+ let s:p.normal.error = [ [ ... ] ]
+ let s:p.normal.warning = [ [ ... ] ]
+<
+For the complete list of components the color of which you should define in
+your colorscheme, see the colorscheme files in lightline.
+
+It is sometimes painful to write all the colors for both gui and cui.
+Actually, lightline has some useful functions for writing colorschemes. For
+example, see
+ lightline.vim/autoload/lightline/colorscheme/Tomorrow_Night.vim
+this colorscheme is defined using only gui color numbers. And convert to the
+normal colorscheme form using:
+>
+ let g:lightline#colorscheme#Tomorrow_Night#palette = lightline#colorscheme#fill(s:p)
+<
+This function fills the cui colors for a palette which has only gui colors, or
+vice versa. However, note that using the convenient function sources an
+additional Vim script file (autoload/lightline/colorscheme.vim), which causes
+a little slow down. If you want to avoid this situation, write all the colors
+as done in autoload/lightline/colorscheme/landscape.vim; firstly create the
+colorscheme using the fill function, and see the result, in a sense, the
+compiled version of your colorscheme.
+>
+ echo g:lightline#colorscheme#yourcolorscheme#palette
+<
+Then copy and paste the result to the colorscheme file.
+
+==============================================================================
+EXAMPLES *lightline-examples*
+You can configure the appearance of statusline.
+Write the following examples in you .vimrc(_vimrc).
+
+In order to change the colorscheme:
+>
+ let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ }
+<
+
+In order to define your own component:
+>
+ let g:lightline = {
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'myfilename' ] ]
+ \ },
+ \ 'component_function': {
+ \ 'myfilename': 'LightLineFilename',
+ \ 'myreadonly': 'LightLineReadonly',
+ \ 'mymodified': 'LightLineModified',
+ \ }
+ \ }
+ function! LightLineFilename()
+ return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
+ \ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
+ \ &ft == 'unite' ? unite#get_status_string() :
+ \ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
+ \ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
+ endfunction
+ function! LightLineReadonly()
+ return &ft !~? 'help' && &readonly ? 'RO' : ''
+ endfunction
+ function! LightLineModified()
+ return &modifiable && &modified ? '+' : ''
+ endfunction
+<
+
+Separators settings:
+>
+ let g:lightline = {
+ \ 'separator': { 'left': '', 'right': '' },
+ \ 'subseparator': { 'left': '|', 'right': '|' }
+ \ }
+<
+
+For |powerline| font users:
+>
+ let g:lightline = {
+ \ 'separator': { 'left': '', 'right': '' },
+ \ 'subseparator': { 'left': '', 'right': '' }
+ \ }
+<
+
+For |vim-powerline| font users:
+>
+ let g:lightline = {
+ \ 'separator': { 'left': '⮀', 'right': '⮂' },
+ \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
+ \ }
+<
+
+------------------------------------------------------------------------------
+NICE EXAMPLES *lightline-nice-examples*
+
+A nice example for non-patched font users.
+>
+ let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ]
+ \ },
+ \ 'component_function': {
+ \ 'fugitive': 'LightLineFugitive',
+ \ 'filename': 'LightLineFilename'
+ \ }
+ \ }
+ function! LightLineModified()
+ return &ft =~ 'help\|vimfiler' ? '' : &modified ? '+' : &modifiable ? '' : '-'
+ endfunction
+ function! LightLineReadonly()
+ return &ft !~? 'help\|vimfiler' && &readonly ? 'RO' : ''
+ endfunction
+ function! LightLineFilename()
+ return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
+ \ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
+ \ &ft == 'unite' ? unite#get_status_string() :
+ \ &ft == 'vimshell' ? vimshell#get_status_string() :
+ \ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
+ \ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
+ endfunction
+ function! LightLineFugitive()
+ if &ft !~? 'vimfiler' && exists('*fugitive#head')
+ return fugitive#head()
+ endif
+ return ''
+ endfunction
+<
+A nice example for |vim-powerline| font users:
+>
+ let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ]
+ \ },
+ \ 'component_function': {
+ \ 'fugitive': 'LightLineFugitive',
+ \ 'filename': 'LightLineFilename'
+ \ },
+ \ 'separator': { 'left': '⮀', 'right': '⮂' },
+ \ 'subseparator': { 'left': '⮁', 'right': '⮃' }
+ \ }
+ function! LightLineModified()
+ return &ft =~ 'help\|vimfiler' ? '' : &modified ? '+' : &modifiable ? '' : '-'
+ endfunction
+ function! LightLineReadonly()
+ return &ft !~? 'help\|vimfiler' && &readonly ? '⭤' : ''
+ endfunction
+ function! LightLineFilename()
+ return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
+ \ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
+ \ &ft == 'unite' ? unite#get_status_string() :
+ \ &ft == 'vimshell' ? vimshell#get_status_string() :
+ \ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
+ \ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
+ endfunction
+ function! LightLineFugitive()
+ if &ft !~? 'vimfiler' && exists('*fugitive#head')
+ let branch = fugitive#head()
+ return branch !=# '' ? '⭠ '.branch : ''
+ endif
+ return ''
+ endfunction
+<
+
+------------------------------------------------------------------------------
+POWERFUL EXAMPLE *lightline-powerful-example*
+
+For users who uses lots of plugins:
+>
+ let g:lightline = {
+ \ 'colorscheme': 'wombat',
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ], ['ctrlpmark'] ],
+ \ 'right': [ [ 'syntastic', 'lineinfo' ], ['percent'], [ 'fileformat', 'fileencoding', 'filetype' ] ]
+ \ },
+ \ 'component_function': {
+ \ 'fugitive': 'LightLineFugitive',
+ \ 'filename': 'LightLineFilename',
+ \ 'fileformat': 'LightLineFileformat',
+ \ 'filetype': 'LightLineFiletype',
+ \ 'fileencoding': 'LightLineFileencoding',
+ \ 'mode': 'LightLineMode',
+ \ 'ctrlpmark': 'CtrlPMark',
+ \ },
+ \ 'component_expand': {
+ \ 'syntastic': 'SyntasticStatuslineFlag',
+ \ },
+ \ 'component_type': {
+ \ 'syntastic': 'error',
+ \ },
+ \ 'subseparator': { 'left': '|', 'right': '|' }
+ \ }
+
+ function! LightLineModified()
+ return &ft =~ 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
+ endfunction
+
+ function! LightLineReadonly()
+ return &ft !~? 'help' && &readonly ? 'RO' : ''
+ endfunction
+
+ function! LightLineFilename()
+ let fname = expand('%:t')
+ return fname == 'ControlP' && has_key(g:lightline, 'ctrlp_item') ? g:lightline.ctrlp_item :
+ \ fname == '__Tagbar__' ? g:lightline.fname :
+ \ fname =~ '__Gundo\|NERD_tree' ? '' :
+ \ &ft == 'vimfiler' ? vimfiler#get_status_string() :
+ \ &ft == 'unite' ? unite#get_status_string() :
+ \ &ft == 'vimshell' ? vimshell#get_status_string() :
+ \ ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
+ \ ('' != fname ? fname : '[No Name]') .
+ \ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
+ endfunction
+
+ function! LightLineFugitive()
+ try
+ if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
+ let mark = '' " edit here for cool mark
+ let branch = fugitive#head()
+ return branch !=# '' ? mark.branch : ''
+ endif
+ catch
+ endtry
+ return ''
+ endfunction
+
+ function! LightLineFileformat()
+ return winwidth(0) > 70 ? &fileformat : ''
+ endfunction
+
+ function! LightLineFiletype()
+ return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
+ endfunction
+
+ function! LightLineFileencoding()
+ return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
+ endfunction
+
+ function! LightLineMode()
+ let fname = expand('%:t')
+ return fname == '__Tagbar__' ? 'Tagbar' :
+ \ fname == 'ControlP' ? 'CtrlP' :
+ \ fname == '__Gundo__' ? 'Gundo' :
+ \ fname == '__Gundo_Preview__' ? 'Gundo Preview' :
+ \ fname =~ 'NERD_tree' ? 'NERDTree' :
+ \ &ft == 'unite' ? 'Unite' :
+ \ &ft == 'vimfiler' ? 'VimFiler' :
+ \ &ft == 'vimshell' ? 'VimShell' :
+ \ winwidth(0) > 60 ? lightline#mode() : ''
+ endfunction
+
+ function! CtrlPMark()
+ if expand('%:t') =~ 'ControlP' && has_key(g:lightline, 'ctrlp_item')
+ call lightline#link('iR'[g:lightline.ctrlp_regex])
+ return lightline#concatenate([g:lightline.ctrlp_prev, g:lightline.ctrlp_item
+ \ , g:lightline.ctrlp_next], 0)
+ else
+ return ''
+ endif
+ endfunction
+
+ let g:ctrlp_status_func = {
+ \ 'main': 'CtrlPStatusFunc_1',
+ \ 'prog': 'CtrlPStatusFunc_2',
+ \ }
+
+ function! CtrlPStatusFunc_1(focus, byfname, regex, prev, item, next, marked)
+ let g:lightline.ctrlp_regex = a:regex
+ let g:lightline.ctrlp_prev = a:prev
+ let g:lightline.ctrlp_item = a:item
+ let g:lightline.ctrlp_next = a:next
+ return lightline#statusline(0)
+ endfunction
+
+ function! CtrlPStatusFunc_2(str)
+ return lightline#statusline(0)
+ endfunction
+
+ let g:tagbar_status_func = 'TagbarStatusFunc'
+
+ function! TagbarStatusFunc(current, sort, fname, ...) abort
+ let g:lightline.fname = a:fname
+ return lightline#statusline(0)
+ endfunction
+
+ augroup AutoSyntastic
+ autocmd!
+ autocmd BufWritePost *.c,*.cpp call s:syntastic()
+ augroup END
+ function! s:syntastic()
+ SyntasticCheck
+ call lightline#update()
+ endfunction
+
+ let g:unite_force_overwrite_statusline = 0
+ let g:vimfiler_force_overwrite_statusline = 0
+ let g:vimshell_force_overwrite_statusline = 0
+<
+------------------------------------------------------------------------------
+TROUBLESHOOTING *lightline-troubleshooting*
+
+Problem 1: |lightline-problem-1|
+ How to install this plugin.
+
+Problem 2: |lightline-problem-2|
+ How to update this plugin.
+
+Problem 3: |lightline-problem-3|
+ How to uninstall this plugin.
+
+Problem 4: |lightline-problem-4|
+ Cool statuslines appear only on |:vsp|.
+
+Problem 5: |lightline-problem-5|
+ The statusline does not seem to be correctly colored.
+
+Problem 6: |lightline-problem-6|
+ How to install a patched font.
+
+Problem 7: |lightline-problem-7|
+ Right triangles do not stick to the right components with the
+ patched font.
+
+Problem 8: |lightline-problem-8|
+ Triangles do not appear. Triangles look weird.
+
+Problem 9: |lightline-problem-9|
+ Where can I find the list of all the cool characters for patched fonts?
+
+Problem 10: |lightline-problem-10|
+ Cool statusline disappears in |unite|, |vimfiler| and |vimshell|
+ buffers.
+
+Problem 11: |lightline-problem-11|
+ Cool statusline disappears in |CtrlP|, |Tagbar| buffers.
+
+Problem 12: |lightline-problem-12|
+ How to make the plus sign red like |powerline|?
+
+Problem 13: |lightline-problem-13|
+ How to change the lightline colorscheme on the fly.
+
+Problem 14: |lightline-problem-14|
+ The 'E541' warning appears on the right hand side.
+ Many components disable the statusline of lightline.
+
+Problem 15: |lightline-problem-15|
+ Do not deal with the tabline.
+ Do not use the fancy separators in the tabline.
+
+Problem 16: |lightline-problem-16|
+ When changed the component to a function component to an expanding
+ component, the statusline of lightline is sometimes disabled.
+
+Problem 17: |lightline-problem-17|
+ Found a bug of this plugin.
+ Got many errors while using this plugin.
+ Vim hangs while using this plugin.
+ Want this plugin to be more configurable.
+ This troubleshooting is not helpful.
+
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+Problem 1: *lightline-problem-1*
+ How to install this plugin.
+
+ If you are to install this plugin manually:
+
+ 1. Put all the files under $VIM.
+
+ If you are using |vim-pathogen|, install this plugin with the
+ following command.
+>
+ git clone https://github.com/itchyny/lightline.vim \
+ ~/.vim/bundle/lightline.vim
+<
+ If you are to install this plugin using |Vundle|:
+
+ 1. Add the following configuration to your
+ .vimrc(_vimrc).
+>
+ Plugin 'itchyny/lightline.vim'
+<
+ 2. Install with |:PluginInstall|.
+
+ If you are to install this plugin using |NeoBundle|:
+
+ 1. Add the following configuration to your
+ .vimrc(_vimrc).
+>
+ NeoBundle 'itchyny/lightline.vim'
+<
+ 2. Install with |:NeoBundleInstall|.
+
+ If you are to install this plugin using |vim-plug|:
+
+ 1. Add the following configuration to your
+ .vimrc(_vimrc).
+>
+ Plug 'itchyny/lightline.vim'
+<
+ 2. Install with |:PlugInstall|.
+
+Problem 2: *lightline-problem-2*
+ How to update this plugin.
+
+ If you have installed this plugin manually:
+
+ 1. Access https://github.com/itchyny/lightline.vim .
+ 2. Download the latest scripts.
+ 3. Place the scripts as written in Problem 1.
+
+ If you have installed this plugin using Vundle:
+
+ 1. Execute |:PluginUpdate|.
+
+ If you have installed this plugin using NeoBundle:
+
+ 1. Execute |:NeoBundleUpdate|.
+
+ If you have installed this plugin using vim-plug:
+
+ 1. Execute |:PlugUpdate|.
+
+Problem 3: *lightline-problem-3*
+ How to uninstall this plugin.
+
+ If you have installed this plugin manually:
+
+ 1. Remove all the lightline.*s under $VIM.
+
+ If you have installed this plugin using Vundle:
+
+ 1. Remove the :Plugin 'itchyny/lightline.vim'
+ configuration from your .vimrc(_vimrc).
+ 2. Update with |:PluginClean|.
+
+ If you have installed this plugin using NeoBundle:
+
+ 1. Remove the :NeoBundle 'itchyny/lightline.vim'
+ configuration from your .vimrc(_vimrc).
+ 2. Update with |:NeoBundleClean|.
+
+ If you have installed this plugin using vim-plug:
+
+ 1. Remove the :Plug 'itchyny/lightline.vim'
+ configuration from your .vimrc(_vimrc).
+ 2. Update with |:PlugClean|.
+
+Problem 4: *lightline-problem-4*
+ Cool statuslines appear only on |:vsp|.
+
+ Add the following setting to your .vimrc(_vimrc).
+>
+ set laststatus=2
+<
+Problem 5: *lightline-problem-5*
+ The statusline does not seem to be correctly colored.
+
+ Add
+>
+ export TERM=xterm-256color
+<
+ to your .*shrc and add
+>
+ if !has('gui_running')
+ set t_Co=256
+ endif
+<
+ to your .vimrc(_vimrc).
+
+Problem 6: *lightline-problem-6*
+ How to install a patched font.
+
+ There are two kinds of patched fonts:
+
+ + The patched fonts for |vim-powerline|
+ (https://github.com/Lokaltog/vim-powerline):
+ follow the guide https://github.com/Lokaltog/vim-powerline/tree/develop/fontpatcher
+ + The patched fonts for |powerline|
+ (https://github.com/Lokaltog/powerline):
+ download from https://github.com/Lokaltog/powerline-fonts
+
+Problem 7: *lightline-problem-7*
+ Right triangles do not stick to the right components with patched
+ font.
+
+ Remove the following setting from your .vimrc(_vimrc).
+>
+ set ambiwidth=double
+<
+ If you want to keep this setting, try the patched font for
+ |vim-powerline|.
+
+Problem 8: *lightline-problem-8*
+ Triangles do not appear. Triangles look weird.
+
+ If the triangles do not appear (but you get some spaces or
+ weird characters like <bf> or ¿), firstly try adding
+>
+ scriptencoding utf-8
+ set encoding=utf-8
+<
+ to the head of your .vimrc(_vimrc). Still you have weird
+ characters, use the unicode numbers. For |powerline| font
+ users:
+>
+ \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
+ \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }
+<
+ For |vim-powerline| font users:
+>
+ \ 'separator': { 'left': "\u2b80", 'right': "\u2b82" },
+ \ 'subseparator': { 'left': "\u2b81", 'right': "\u2b83" }
+<
+ The full list of unicode numbers for fancy characters is shown
+ in |lightline-problem-9|.
+
+ If the triangles are shown in appropriate characters but the
+ colors do not look correctly, see the following.
+ If you are using iTerm2, change the following settings.
+
+ + set Profiles>Colors>Minimum contrast to the Lowest.
+ + set Profiles>Window>Transparency to the Opaquest.
+
+ For other terminals, this weird-triangle problem will be
+ resolved by disabling transparency or contrast adjustment.
+
+Problem 9: *lightline-problem-9*
+ Where can I find the list of all the cool characters for patched fonts?
+
+ Default powerline vim-powerline
+ separator.left '' '' (\ue0b0) '⮀' (\u2b80)
+ separator.right '' '' (\ue0b2) '⮂' (\u2b82)
+ subseparator.left '|' '' (\ue0b1) '⮁' (\u2b81)
+ subseparator.right '|' '' (\ue0b3) '⮃' (\u2b83)
+ branch symbol -- '' (\ue0a0) '⭠' (\u2b60)
+ readonly symbol -- '' (\ue0a2) '⭤' (\u2b64)
+ linecolumn symbol -- '' (\ue0a1) '⭡' (\u2b81)
+
+Problem 10: *lightline-problem-10*
+ Cool statusline disappears on |unite|, |vimfiler| and |vimshell|
+ buffers.
+
+ Add the following settings to your .vimrc(_vimrc).
+>
+ let g:unite_force_overwrite_statusline = 0
+ let g:vimfiler_force_overwrite_statusline = 0
+ let g:vimshell_force_overwrite_statusline = 0
+<
+Problem 11: *lightline-problem-11*
+ Cool statusline disappears in |CtrlP|, |Tagbar| buffers.
+
+ Add the following settings to your .vimrc(_vimrc).
+>
+ let g:ctrlp_status_func = {
+ \ 'main': 'CtrlPStatusFunc_1',
+ \ 'prog': 'CtrlPStatusFunc_2',
+ \ }
+ function! CtrlPStatusFunc_1(focus, byfname, regex, prev, item, next, marked)
+ return lightline#statusline(0)
+ endfunction
+ function! CtrlPStatusFunc_2(str)
+ return lightline#statusline(0)
+ endfunction
+
+ let g:tagbar_status_func = 'TagbarStatusFunc'
+ function! TagbarStatusFunc(current, sort, fname, ...) abort
+ return lightline#statusline(0)
+ endfunction
+<
+ See |lightline-powerful-example| for more cool settings for
+ these plugins.
+
+Problem 12: *lightline-problem-12*
+ How to make the plus sign red like |powerline|?
+
+ Use the following setings.
+>
+ let g:lightline = {
+ \ 'component': {
+ \ 'modified': '%#ModifiedColor#%{LightLineModified()}',
+ \ }
+ \ }
+ function! LightLineModified()
+ let map = { 'V': 'n', "\<C-v>": 'n', 's': 'n', 'v': 'n', "\<C-s>": 'n', 'c': 'n', 'R': 'n'}
+ let mode = get(map, mode()[0], mode()[0])
+ let bgcolor = {'n': [240, '#585858'], 'i': [31, '#0087af']}
+ let color = get(bgcolor, mode, bgcolor.n)
+ exe printf('hi ModifiedColor ctermfg=196 ctermbg=%d guifg=#ff0000 guibg=%s term=bold cterm=bold',
+ \ color[0], color[1])
+ return &modified ? '+' : &modifiable ? '' : '-'
+ endfunction
+<
+ It's surely complicated. There's no easy API to do a thing
+ like this. But it means that your request does not match
+ the spirit of lightline.
+
+Problem 13: *lightline-problem-13*
+ How to change the lightline colorscheme on the fly.
+
+ Add the following settings to your .vimrc(_vimrc).
+>
+ augroup LightLineColorscheme
+ autocmd!
+ autocmd ColorScheme * call s:lightline_update()
+ augroup END
+ function! s:lightline_update()
+ if !exists('g:loaded_lightline')
+ return
+ endif
+ try
+ if g:colors_name =~# 'wombat\|solarized\|landscape\|jellybeans\|seoul256\|Tomorrow'
+ let g:lightline.colorscheme =
+ \ substitute(substitute(g:colors_name, '-', '_', 'g'), '256.*', '', '') .
+ \ (g:colors_name ==# 'solarized' ? '_' . &background : '')
+ call lightline#init()
+ call lightline#colorscheme()
+ call lightline#update()
+ endif
+ catch
+ endtry
+ endfunction
+<
+Problem 14: *lightline-problem-14*
+ The 'E541' warning appears on the right hand side.
+ Many components disable the statusline of lightline.
+
+ The number of items in statusline/tabline is limited to 80
+ (see |E541|). You cannot register too much components.
+
+Problem 15: *lightline-problem-15*
+ Do not deal with the tabline.
+ Do not use the fancy separators in the tabline.
+
+ You can disable the tabline feature of lightline.vim using:
+>
+ let g:lightline = {
+ \ 'enable': { 'tabline': 0 },
+ \ }
+<
+ If you don't like the separators in the tabline, use:
+>
+ let g:lightline = {
+ \ 'tabline_separator': { 'left': "", 'right': "" },
+ \ 'tabline_subseparator': { 'left': "", 'right': "" },
+ \ }
+<
+Problem 16: *lightline-problem-16*
+ When changed the component to a function component to an expanding
+ component, the statusline of lightline is sometimes disabled.
+
+ When you changed from
+>
+ \ 'component_function': {
+ \ 'my': 'My',
+ \ }
+<
+ to
+>
+ \ 'component_expand': {
+ \ 'my': 'My',
+ \ }
+<
+ the statusline of lightline is disabled unexpectedly.
+ In such a case, the text returned by 'My' function may include
+ the '%' character. Replace all the '%' signs with '%%'.
+>
+ function My()
+ ...
+ return substitute(text, '%', '%%', 'g')
+ endfunction
+<
+Problem 17: *lightline-problem-17*
+ Found a bug of this plugin.
+ Got many errors while using this plugin.
+ Vim hangs while using this plugin.
+ Want this plugin to be more configurable.
+ This troubleshooting is not helpful.
+
+ Report/Request the issue/feature at
+ https://github.com/itchyny/lightline.vim/issues.
+
+==============================================================================
+CHANGELOG *lightline-changelog*
+
+0.0 2013-08-21, ...
+ - Initial commit and implementation
+
+==============================================================================
+vim:tw=78:sw=4:ts=8:ft=help:norl:noet:
diff --git a/vim/bundle/lightline.vim/plugin/lightline.vim b/vim/bundle/lightline.vim/plugin/lightline.vim
new file mode 100644
index 0000000..f396010
--- /dev/null
+++ b/vim/bundle/lightline.vim/plugin/lightline.vim
@@ -0,0 +1,24 @@
+" =============================================================================
+" Filename: plugin/lightline.vim
+" Author: itchyny
+" License: MIT License
+" Last Change: 2016/03/14 03:31:58.
+" =============================================================================
+
+if exists('g:loaded_lightline') || v:version < 700
+ finish
+endif
+let g:loaded_lightline = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+augroup lightline
+ autocmd!
+ autocmd WinEnter,BufWinEnter,FileType,ColorScheme,SessionLoadPost * call lightline#update()
+ autocmd ColorScheme,SessionLoadPost * call lightline#highlight()
+ autocmd CursorMoved,BufUnload * call lightline#update_once()
+augroup END
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/lightline.vim/test/.themisrc b/vim/bundle/lightline.vim/test/.themisrc
new file mode 100644
index 0000000..c226c08
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/.themisrc
@@ -0,0 +1,20 @@
+let s:sids = {}
+function! s:sid(path) abort
+ if has_key(s:sids, a:path)
+ return s:sids[a:path]
+ endif
+ redir => scriptnames
+ silent! scriptnames
+ redir END
+ for line in split(scriptnames, '\n')
+ if line =~# a:path
+ let sid = matchstr(line, '\v^\s*\zs\d+\ze')
+ let s:sids[a:path] = sid
+ return sid
+ endif
+ endfor
+endfunction
+
+function! SID(name) abort
+ return function(printf("\<SNR>%d_%s", s:sid('autoload/lightline.vim'), a:name))
+endfunction
diff --git a/vim/bundle/lightline.vim/test/concatenate.vim b/vim/bundle/lightline.vim/test/concatenate.vim
new file mode 100644
index 0000000..6fd2723
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/concatenate.vim
@@ -0,0 +1,90 @@
+let s:suite = themis#suite('concatenate')
+let s:assert = themis#helper('assert')
+
+function! s:suite.before_each()
+ let g:lightline = { 'subseparator': { 'left': '>', 'right': '<' } }
+ call lightline#init()
+endfunction
+
+function! s:suite.nil()
+ call s:assert.equals(lightline#concatenate([], 0), '')
+ call s:assert.equals(lightline#concatenate([], 1), '')
+endfunction
+
+function! s:suite.one()
+ call s:assert.equals(lightline#concatenate(['foo'], 0), 'foo')
+ call s:assert.equals(lightline#concatenate(['foo'], 1), 'foo')
+endfunction
+
+function! s:suite.two()
+ call s:assert.equals(lightline#concatenate(['foo', 'bar'], 0), 'foo > bar')
+ call s:assert.equals(lightline#concatenate(['foo', 'bar'], 1), 'foo < bar')
+endfunction
+
+function! s:suite.three()
+ call s:assert.equals(lightline#concatenate(['foo', 'bar', 'baz'], 0), 'foo > bar > baz')
+ call s:assert.equals(lightline#concatenate(['foo', 'bar', 'baz'], 1), 'foo < bar < baz')
+endfunction
+
+function! s:suite.one_empty()
+ call s:assert.equals(lightline#concatenate([''], 0), '')
+ call s:assert.equals(lightline#concatenate([''], 1), '')
+endfunction
+
+function! s:suite.two_empty_left()
+ call s:assert.equals(lightline#concatenate(['', 'bar'], 0), 'bar')
+ call s:assert.equals(lightline#concatenate(['', 'bar'], 1), 'bar')
+endfunction
+
+function! s:suite.two_empty_right()
+ call s:assert.equals(lightline#concatenate(['foo', ''], 0), 'foo')
+ call s:assert.equals(lightline#concatenate(['foo', ''], 1), 'foo')
+endfunction
+
+function! s:suite.two_empty_both()
+ call s:assert.equals(lightline#concatenate(['', ''], 0), '')
+ call s:assert.equals(lightline#concatenate(['', ''], 1), '')
+endfunction
+
+function! s:suite.three_empty_left()
+ call s:assert.equals(lightline#concatenate(['', 'bar', 'baz'], 0), 'bar > baz')
+ call s:assert.equals(lightline#concatenate(['', 'bar', 'baz'], 1), 'bar < baz')
+endfunction
+
+function! s:suite.three_empty_middle()
+ call s:assert.equals(lightline#concatenate(['foo', '', 'baz'], 0), 'foo > baz')
+ call s:assert.equals(lightline#concatenate(['foo', '', 'baz'], 1), 'foo < baz')
+endfunction
+
+function! s:suite.three_empty_right()
+ call s:assert.equals(lightline#concatenate(['foo', 'bar', ''], 0), 'foo > bar')
+ call s:assert.equals(lightline#concatenate(['foo', 'bar', ''], 1), 'foo < bar')
+endfunction
+
+function! s:suite.three_empty_middle_right()
+ call s:assert.equals(lightline#concatenate(['foo', '', ''], 0), 'foo')
+ call s:assert.equals(lightline#concatenate(['foo', '', ''], 1), 'foo')
+endfunction
+
+function! s:suite.three_empty_left_right()
+ call s:assert.equals(lightline#concatenate(['', 'bar', ''], 0), 'bar')
+ call s:assert.equals(lightline#concatenate(['', 'bar', ''], 1), 'bar')
+endfunction
+
+function! s:suite.three_empty_left_middle()
+ call s:assert.equals(lightline#concatenate(['', '', 'baz'], 0), 'baz')
+ call s:assert.equals(lightline#concatenate(['', '', 'baz'], 1), 'baz')
+endfunction
+
+function! s:suite.three_empty_all()
+ call s:assert.equals(lightline#concatenate(['', '', ''], 0), '')
+ call s:assert.equals(lightline#concatenate(['', '', ''], 1), '')
+endfunction
+
+function! s:suite.keep_original()
+ let xs = ['', 'bar', '']
+ call s:assert.equals(lightline#concatenate(xs, 0), 'bar')
+ call s:assert.equals(xs, ['', 'bar', ''])
+ call s:assert.equals(lightline#concatenate(xs, 1), 'bar')
+ call s:assert.equals(xs, ['', 'bar', ''])
+endfunction
diff --git a/vim/bundle/lightline.vim/test/error.vim b/vim/bundle/lightline.vim/test/error.vim
new file mode 100644
index 0000000..8fdabf4
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/error.vim
@@ -0,0 +1,15 @@
+let s:suite = themis#suite('error')
+let s:assert = themis#helper('assert')
+
+function! s:message() abort
+ redir => messages
+ silent! messages
+ redir END
+ return split(messages, '\n')[-1]
+endfunction
+
+function! s:suite.error()
+ let message = 'An error occurred.'
+ call lightline#error(message)
+ call s:assert.equals(s:message(), 'lightline.vim: ' . message)
+endfunction
diff --git a/vim/bundle/lightline.vim/test/expand.vim b/vim/bundle/lightline.vim/test/expand.vim
new file mode 100644
index 0000000..c2fc0ab
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/expand.vim
@@ -0,0 +1,612 @@
+let s:suite = themis#suite('expand')
+let s:assert = themis#helper('assert')
+
+function! s:expand(...)
+ return call(SID('expand'), a:000)
+endfunction
+
+function! s:suite.expand()
+ let g:lightline = {}
+ call lightline#init()
+ call s:assert.equals(s:expand([]),
+ \ [[], [], ['0']])
+endfunction
+
+function! s:suite.default()
+ let g:lightline = {}
+ call lightline#init()
+ call s:assert.equals(s:expand([['mode', 'paste'], ['readonly', 'filename', 'modified']]),
+ \ [[['mode', 'paste'], ['readonly', 'filename', 'modified']], [[0, 0], [0, 0, 0]], ['0', '1', '2']])
+endfunction
+
+function! s:suite.custom()
+ function! Custom()
+ return [ ['left'], ['middle'], ['right'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type()
+ function! Custom()
+ return [ ['left'], ['middle'], ['right'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['middle'], ['right'], ['modified']], [[0, 0], [1], [1], [1], [0]], ['0', '1', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left'], ['middle'], ['right', 'modified']], [[0, 0, 1], [1], [1, 0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.multiple()
+ function! Custom()
+ return [ ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['x0', 'x1', 'x2', 'y0', 'y1', 'y2', 'z0', 'z1', 'z2'], ['modified']], [[0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'x0', 'x1', 'x2', 'y0', 'y1', 'y2', 'z0', 'z1', 'z2', 'modified']], [[0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.multiple_type()
+ function! Custom()
+ return [ ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2'], ['modified']], [[0, 0], [1, 1, 1], [1, 1, 1], [1, 1, 1], [0]], ['0', '1', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'x0', 'x1', 'x2'], ['y0', 'y1', 'y2'], ['z0', 'z1', 'z2', 'modified']], [[0, 0, 1, 1, 1], [1, 1, 1], [1, 1, 1, 0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.flatten()
+ function! Custom()
+ return [ 'left', 'middle', 'right' ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left', 'middle', 'right'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', 'middle', 'right', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_flatten()
+ function! Custom()
+ return [ 'left', 'middle', 'right' ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['middle'], ['right'], ['modified']], [[0, 0], [1], [1], [1], [0]], ['0', '1', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left'], ['middle'], ['right', 'modified']], [[0, 0, 1], [1], [1, 0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_string()
+ function! Custom()
+ return 'custom'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_string()
+ function! Custom()
+ return 'custom'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_void_string()
+ function! Custom()
+ return ''
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_void_string()
+ function! Custom()
+ return ''
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_number()
+ function! Custom()
+ return 24
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', '24', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_number()
+ function! Custom()
+ return 24
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename'], ['24'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_void_string_array()
+ function! Custom()
+ return ['', '', '']
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_void_string_array()
+ function! Custom()
+ return ['', '', '']
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_void_string_array_2()
+ function! Custom()
+ return [[''], [''], ['']]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_void_string_array_2()
+ function! Custom()
+ return [[''], [''], ['']]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_void_string_array_3()
+ function! Custom()
+ return ['', 'custom', '']
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_void_string_array_3()
+ function! Custom()
+ return ['', 'custom', '']
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_void_string_array_4()
+ function! Custom()
+ return [[''], ['custom'], ['']]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'custom', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_void_string_array_4()
+ function! Custom()
+ return [[''], ['custom'], ['']]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename'], ['custom'], ['modified']], [[0, 0], [1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_left_nil()
+ function! Custom()
+ return [ [], ['y0', 'y1'], ['z0', 'z1'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
+ \ [[['filename'], ['y0', 'y1', 'z0', 'z1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
+ \ [[['filename', 'y0', 'y1', 'z0', 'z1', 'modified']], [[0, 1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_left_nil()
+ function! Custom()
+ return [ [], ['y0', 'y1'], ['z0', 'z1'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
+ \ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['modified']], [[0], [1, 1], [1, 1], [0]], ['0', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
+ \ [[['filename'], ['y0', 'y1'], ['z0', 'z1', 'modified']], [[0], [1, 1], [1, 1, 0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_right_nil()
+ function! Custom()
+ return [ ['x0', 'x1'], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
+ \ [[['filename'], ['x0', 'x1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
+ \ [[['filename', 'x0', 'x1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_right_nil()
+ function! Custom()
+ return [ ['x0', 'x1'], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom'], ['modified']]),
+ \ [[['filename'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0], [1, 1], [1, 1], [0]], ['0', '1', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'modified']]),
+ \ [[['filename', 'x0', 'x1'], ['y0', 'y1'], ['modified']], [[0, 1, 1], [1, 1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_one()
+ function! Custom()
+ return [ 'left' ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_one()
+ function! Custom()
+ return [ 'left' ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['modified']], [[0, 0], [1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', 'modified']], [[0, 0, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_two()
+ function! Custom()
+ return [ 'left', 'middle']
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left', 'middle'], ['modified']], [[0, 0], [1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', 'middle', 'modified']], [[0, 0, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_two()
+ function! Custom()
+ return [ 'left', 'middle' ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['middle'], ['modified']], [[0, 0], [1], [1], [0]], ['0', '1', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left'], ['middle'], ['modified']], [[0, 0, 1], [1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_mixed()
+ function! Custom()
+ return ['left', { 'custom': 24 }, [function('tr')]]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left', '{''custom'': 24}', 'function(''tr'')'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', '{''custom'': 24}', 'function(''tr'')', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_mixed()
+ function! Custom()
+ return ['left', { 'custom': 24 }, [function('tr')]]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['{''custom'': 24}'], ['function(''tr'')'], ['modified']], [[0, 0], [1], [1], [1], [0]], ['0', '1', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left'], ['{''custom'': 24}'], ['function(''tr'')', 'modified']], [[0, 0, 1], [1], [1, 0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_mixed_2()
+ function! Custom()
+ return [['left', ''], ['', { 'custom': 24 }, ''], [[function('tr')], '']]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left', '{''custom'': 24}', '[function(''tr'')]'], ['modified']], [[0, 0], [1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left', '{''custom'': 24}', '[function(''tr'')]', 'modified']], [[0, 0, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_mixed_2()
+ function! Custom()
+ return [['left', ''], ['', { 'custom': 24 }, ''], [[function('tr')], '']]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['left'], ['{''custom'': 24}'], ['[function(''tr'')]'], ['modified']], [[0, 0], [1], [1], [1], [0]], ['0', '1', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'left'], ['{''custom'': 24}'], ['[function(''tr'')]', 'modified']], [[0, 0, 1], [1], [1, 0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_error()
+ function! Custom()
+ throw 'error'
+ return 'custom'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.custom_type_error()
+ function! Custom()
+ throw 'error'
+ return 'custom'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.notfound()
+ let g:lightline = { 'component_expand': { 'custom': 'NotFound' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+endfunction
+
+function! s:suite.custom_type_notfound()
+ let g:lightline = { 'component_expand': { 'custom': 'NotFound' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['readonly', 'filename'], ['custom'], ['modified']]),
+ \ [[['readonly', 'filename'], ['modified']], [[0, 0], [0]], ['0', '2', '3']])
+ call s:assert.equals(s:expand([['readonly', 'filename', 'custom', 'modified']]),
+ \ [[['readonly', 'filename', 'modified']], [[0, 0, 0]], ['0', '1']])
+endfunction
+
+function! s:suite.duplicated_left_nil()
+ function! Custom()
+ return [ [], ['y0', 'y1'], ['z0', 'z1'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
+ \ [[['filename'], ['y0', 'y1', 'z0', 'z1', 'y0', 'y1', 'z0', 'z1'], ['modified']], [[0], [1, 1, 1, 1, 1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
+ \ [[['filename', 'y0', 'y1', 'z0', 'z1', 'y0', 'y1', 'z0', 'z1', 'modified']], [[0, 1, 1, 1, 1, 1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_type_left_nil()
+ function! Custom()
+ return [ [], ['y0', 'y1'], ['z0', 'z1'] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
+ \ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['y0', 'y1'], ['z0', 'z1'], ['modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1], [0]], ['0', 'custom', '1', 'custom', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
+ \ [[['filename'], ['y0', 'y1'], ['z0', 'z1'], ['y0', 'y1'], ['z0', 'z1', 'modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1, 0]], ['0', 'custom', '0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_right_nil()
+ function! Custom()
+ return [ ['x0', 'x1'], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
+ \ [[['filename'], ['x0', 'x1', 'y0', 'y1', 'x0', 'x1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1, 1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
+ \ [[['filename', 'x0', 'x1', 'y0', 'y1', 'x0', 'x1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_type_right_nil()
+ function! Custom()
+ return [ ['x0', 'x1'], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
+ \ [[['filename'], ['x0', 'x1'], ['y0', 'y1'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0], [1, 1], [1, 1], [1, 1], [1, 1], [0]], ['0', '1', 'custom', '1', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
+ \ [[['filename', 'x0', 'x1'], ['y0', 'y1'], ['x0', 'x1'], ['y0', 'y1'], ['modified']], [[0, 1, 1], [1, 1], [1, 1], [1, 1], [0]], ['0', 'custom', '0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_both_nil()
+ function! Custom()
+ return [ [], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
+ \ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', '1', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
+ \ [[['filename', 'y0', 'y1', 'y0', 'y1', 'modified']], [[0, 1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_type_both_nil()
+ function! Custom()
+ return [ [], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom'], ['modified']]),
+ \ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', 'custom', '2', '3']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom', 'modified']]),
+ \ [[['filename'], ['y0', 'y1', 'y0', 'y1'], ['modified']], [[0], [1, 1, 1, 1], [0]], ['0', 'custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_both_nil_left_most()
+ function! Custom()
+ return [ [], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['custom', 'custom'], ['modified']]),
+ \ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], ['0', '1', '2']])
+ call s:assert.equals(s:expand([['custom', 'custom', 'modified']]),
+ \ [[['y0', 'y1', 'y0', 'y1', 'modified']], [[1, 1, 1, 1, 0]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_type_both_nil_left_most()
+ function! Custom()
+ return [ [], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['custom', 'custom'], ['modified']]),
+ \ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], ['custom', '1', '2']])
+ call s:assert.equals(s:expand([['custom', 'custom', 'modified']]),
+ \ [[['y0', 'y1', 'y0', 'y1'], ['modified']], [[1, 1, 1, 1], [0]], ['custom', '0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_both_nil_right_most()
+ function! Custom()
+ return [ [], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom']]),
+ \ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], ['0', '1', '2']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom']]),
+ \ [[['filename', 'y0', 'y1', 'y0', 'y1']], [[0, 1, 1, 1, 1]], ['0', '1']])
+ delfunction Custom
+endfunction
+
+function! s:suite.duplicated_type_both_nil_right_most()
+ function! Custom()
+ return [ [], ['y0', 'y1'], [] ]
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom': 'Custom' }, 'component_type': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(s:expand([['filename'], ['custom', 'custom']]),
+ \ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], ['0', 'custom', '2']])
+ call s:assert.equals(s:expand([['filename', 'custom', 'custom']]),
+ \ [[['filename'], ['y0', 'y1', 'y0', 'y1']], [[0], [1, 1, 1, 1]], ['0', 'custom', '1']])
+ delfunction Custom
+endfunction
diff --git a/vim/bundle/lightline.vim/test/highlight.vim b/vim/bundle/lightline.vim/test/highlight.vim
new file mode 100644
index 0000000..fe5182a
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/highlight.vim
@@ -0,0 +1,171 @@
+let s:suite = themis#suite('highlight')
+let s:assert = themis#helper('assert')
+
+function! s:suite.before_each()
+ hi clear
+endfunction
+
+function! s:hi(name)
+ redir => hi
+ silent! exec 'hi' a:name
+ redir END
+ return substitute(join(split(hi, "\n"), ''), ' \+', ' ', 'g')
+endfunction
+
+function! s:pattern(xs, ...) abort
+ let ys = a:0 ? a:xs[1:] : a:xs
+ let zs = get(a:000, 0, a:xs)
+ return 'ctermfg=' . ys[2] . ' ctermbg=' . zs[3] . '.*guifg=' . ys[0] . ' guibg=' . zs[1]
+endfunction
+
+function! s:suite.highlight()
+ let g:lightline = {}
+ call lightline#init()
+ call lightline#colorscheme()
+ let palette = lightline#palette()
+ call s:assert.match(s:hi('LightLineLeft_normal_0'), s:pattern(palette.normal.left[0]))
+ call s:assert.match(s:hi('LightLineLeft_normal_1'), s:pattern(palette.normal.left[1]))
+ call s:assert.match(s:hi('LightLineLeft_normal_2'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineRight_normal_0'), s:pattern(palette.normal.right[0]))
+ call s:assert.match(s:hi('LightLineRight_normal_1'), s:pattern(palette.normal.right[1]))
+ call s:assert.match(s:hi('LightLineRight_normal_2'), s:pattern(palette.normal.right[2]))
+ call s:assert.match(s:hi('LightLineRight_normal_3'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineMiddle_normal'), s:pattern(palette.normal.middle[0]))
+endfunction
+
+function! s:suite.insert()
+ let g:lightline = {}
+ call lightline#init()
+ call lightline#colorscheme()
+ call lightline#highlight('insert')
+ let palette = lightline#palette()
+ call s:assert.match(s:hi('LightLineLeft_insert_0'), s:pattern(palette.insert.left[0]))
+ call s:assert.match(s:hi('LightLineLeft_insert_1'), s:pattern(palette.insert.left[1]))
+ call s:assert.match(s:hi('LightLineLeft_insert_2'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineRight_insert_0'), s:pattern(palette.insert.right[0]))
+ call s:assert.match(s:hi('LightLineRight_insert_1'), s:pattern(palette.insert.right[1]))
+ call s:assert.match(s:hi('LightLineRight_insert_2'), s:pattern(palette.insert.right[2]))
+ call s:assert.match(s:hi('LightLineRight_insert_3'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineMiddle_insert'), s:pattern(palette.insert.middle[0]))
+endfunction
+
+
+function! s:suite.visual()
+ let g:lightline = {}
+ call lightline#init()
+ call lightline#colorscheme()
+ call lightline#highlight('visual')
+ let palette = lightline#palette()
+ call s:assert.match(s:hi('LightLineLeft_visual_0'), s:pattern(palette.visual.left[0]))
+ call s:assert.match(s:hi('LightLineLeft_visual_1'), s:pattern(palette.visual.left[1]))
+ call s:assert.match(s:hi('LightLineLeft_visual_2'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineRight_visual_0'), s:pattern(palette.normal.right[0]))
+ call s:assert.match(s:hi('LightLineRight_visual_1'), s:pattern(palette.normal.right[1]))
+ call s:assert.match(s:hi('LightLineRight_visual_2'), s:pattern(palette.normal.right[2]))
+ call s:assert.match(s:hi('LightLineRight_visual_3'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineMiddle_normal'), s:pattern(palette.normal.middle[0]))
+endfunction
+
+function! s:suite.replace()
+ let g:lightline = {}
+ call lightline#init()
+ call lightline#colorscheme()
+ call lightline#highlight('replace')
+ let palette = lightline#palette()
+ call s:assert.match(s:hi('LightLineLeft_replace_0'), s:pattern(palette.replace.left[0]))
+ call s:assert.match(s:hi('LightLineLeft_replace_1'), s:pattern(palette.replace.left[1]))
+ call s:assert.match(s:hi('LightLineLeft_replace_2'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineRight_replace_0'), s:pattern(palette.replace.right[0]))
+ call s:assert.match(s:hi('LightLineRight_replace_1'), s:pattern(palette.replace.right[1]))
+ call s:assert.match(s:hi('LightLineRight_replace_2'), s:pattern(palette.replace.right[2]))
+ call s:assert.match(s:hi('LightLineRight_replace_3'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineMiddle_replace'), s:pattern(palette.replace.middle[0]))
+endfunction
+
+function! s:suite.left_right()
+ let g:lightline = {
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'readonly' ], [ 'filename' ], [ 'modified' ] ],
+ \ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat' ], [ 'fileencoding' ], [ 'filetype' ] ]
+ \ },
+ \ }
+ call lightline#init()
+ call lightline#colorscheme()
+ let palette = lightline#palette()
+ call s:assert.match(s:hi('LightLineLeft_normal_0'), s:pattern(palette.normal.left[0]))
+ call s:assert.match(s:hi('LightLineLeft_normal_1'), s:pattern(palette.normal.left[1]))
+ call s:assert.match(s:hi('LightLineLeft_normal_2'), s:pattern(palette.normal.middle[0]))
+ call s:assert.match(s:hi('LightLineLeft_normal_3'), s:pattern(palette.normal.middle[0]))
+ call s:assert.match(s:hi('LightLineLeft_normal_4'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineRight_normal_0'), s:pattern(palette.normal.right[0]))
+ call s:assert.match(s:hi('LightLineRight_normal_1'), s:pattern(palette.normal.right[1]))
+ call s:assert.match(s:hi('LightLineRight_normal_2'), s:pattern(palette.normal.right[2]))
+ call s:assert.match(s:hi('LightLineRight_normal_3'), s:pattern(palette.normal.middle[0]))
+ call s:assert.match(s:hi('LightLineRight_normal_4'), s:pattern(palette.normal.middle[0]))
+ call s:assert.match(s:hi('LightLineRight_normal_5'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineMiddle_normal'), s:pattern(palette.normal.middle[0]))
+endfunction
+
+function! s:suite.no_components()
+ let g:lightline = {
+ \ 'active': {
+ \ 'left': [],
+ \ 'right': []
+ \ },
+ \ 'inactive': {
+ \ 'left': [],
+ \ 'right': []
+ \ },
+ \ }
+ call lightline#init()
+ call lightline#colorscheme()
+ let palette = lightline#palette()
+ call s:assert.match(s:hi('LightLineLeft_normal_0'), s:pattern(palette.normal.left[0]))
+ call s:assert.match(s:hi('LightLineLeft_normal_1'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineRight_normal_0'), s:pattern(palette.normal.right[0]))
+ call s:assert.match(s:hi('LightLineRight_normal_1'), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi('LightLineMiddle_normal'), s:pattern(palette.normal.middle[0]))
+endfunction
+
+function! s:suite.subseparator()
+ let g:lightline = {
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'readonly' ], [ 'filename' ], [ 'modified' ] ],
+ \ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat' ], [ 'fileencoding' ], [ 'filetype' ] ]
+ \ },
+ \ }
+ call lightline#init()
+ call lightline#colorscheme()
+ let palette = lightline#palette()
+ for i in range(4)
+ for j in range(5)
+ if i + 1 == j
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_%s', i, j)), s:pattern(get(palette.normal.left, i, palette.normal.middle[0]), get(palette.normal.left, j, palette.normal.middle[0])))
+ else
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_%s', i, j)), 'E411: highlight group not found\|cleared')
+ endif
+ endfor
+ endfor
+endfunction
+
+function! s:suite.component_type()
+ let g:lightline = { 'component_type': { 'error': 'error', 'warning': 'warning' } }
+ call lightline#init()
+ call lightline#colorscheme()
+ let palette = lightline#palette()
+ for type in ['error', 'warning']
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s', type)), s:pattern(palette.normal[type][0]))
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_0_%s', type)), s:pattern(palette.normal.left[0], palette.normal[type][0]))
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_1_%s', type)), s:pattern(palette.normal.left[1], palette.normal[type][0]))
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_2_%s', type)), 'E411: highlight group not found\|cleared')
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_0', type)), s:pattern(palette.normal[type][0], palette.normal.left[0]))
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_1', type)), s:pattern(palette.normal[type][0], palette.normal.left[1]))
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_2', type)), s:pattern(palette.normal[type][0], palette.normal.middle[0]))
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_3', type)), 'E411: highlight group not found\|cleared')
+ endfor
+ for type1 in ['error', 'warning']
+ for type2 in ['error', 'warning']
+ call s:assert.match(s:hi(printf('LightLineLeft_normal_%s_%s', type1, type2)), s:pattern(palette.normal[type1][0], palette.normal[type2][0]))
+ endfor
+ endfor
+endfunction
diff --git a/vim/bundle/lightline.vim/test/link.vim b/vim/bundle/lightline.vim/test/link.vim
new file mode 100644
index 0000000..ca86753
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/link.vim
@@ -0,0 +1,131 @@
+let s:suite = themis#suite('link')
+let s:assert = themis#helper('assert')
+
+function! s:suite.before_each()
+ hi clear
+ let g:lightline = {}
+ call lightline#init()
+ call lightline#colorscheme()
+endfunction
+
+function! s:hi(name)
+ redir => hi
+ silent! exec 'hi' a:name
+ redir END
+ return substitute(join(split(hi, "\n"), ''), ' \+', ' ', 'g')
+endfunction
+
+function! s:suite.link()
+ call lightline#link()
+ call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_normal_0')
+ call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_normal_1')
+ call s:assert.match(s:hi('LightLineLeft_active_2'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_normal_0')
+ call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_normal_1')
+ call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_normal_2')
+ call s:assert.match(s:hi('LightLineRight_active_3'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_normal')
+endfunction
+
+function! s:suite.insert()
+ call lightline#link('i')
+ call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_insert_0')
+ call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_insert_1')
+ call s:assert.match(s:hi('LightLineLeft_active_2'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_insert_0')
+ call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_insert_1')
+ call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_insert_2')
+ call s:assert.match(s:hi('LightLineRight_active_3'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_insert')
+endfunction
+
+function! s:suite.visual()
+ call lightline#link('v')
+ call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_visual_0')
+ call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_visual_1')
+ call s:assert.match(s:hi('LightLineLeft_active_2'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_visual_0')
+ call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_visual_1')
+ call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_visual_2')
+ call s:assert.match(s:hi('LightLineRight_active_3'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_visual')
+endfunction
+
+function! s:suite.replace()
+ call lightline#link('R')
+ call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_replace_0')
+ call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_replace_1')
+ call s:assert.match(s:hi('LightLineLeft_active_2'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_replace_0')
+ call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_replace_1')
+ call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_replace_2')
+ call s:assert.match(s:hi('LightLineRight_active_3'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_replace')
+endfunction
+
+function! s:suite.left_right()
+ let g:lightline = {
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'readonly' ], [ 'filename' ], [ 'modified' ] ],
+ \ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat' ], [ 'fileencoding' ], [ 'filetype' ] ]
+ \ },
+ \ }
+ call lightline#init()
+ call lightline#colorscheme()
+ call lightline#link()
+ call s:assert.match(s:hi('LightLineLeft_active_0'), 'LightLineLeft_normal_0')
+ call s:assert.match(s:hi('LightLineLeft_active_1'), 'LightLineLeft_normal_1')
+ call s:assert.match(s:hi('LightLineLeft_active_2'), 'LightLineLeft_normal_2')
+ call s:assert.match(s:hi('LightLineLeft_active_3'), 'LightLineLeft_normal_3')
+ call s:assert.match(s:hi('LightLineLeft_active_4'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineRight_active_0'), 'LightLineRight_normal_0')
+ call s:assert.match(s:hi('LightLineRight_active_1'), 'LightLineRight_normal_1')
+ call s:assert.match(s:hi('LightLineRight_active_2'), 'LightLineRight_normal_2')
+ call s:assert.match(s:hi('LightLineRight_active_3'), 'LightLineRight_normal_3')
+ call s:assert.match(s:hi('LightLineRight_active_4'), 'LightLineRight_normal_4')
+ call s:assert.match(s:hi('LightLineRight_active_5'), 'E411: highlight group not found')
+ call s:assert.match(s:hi('LightLineMiddle_active'), 'LightLineMiddle_normal')
+endfunction
+
+function! s:suite.subseparator()
+ let g:lightline = {
+ \ 'active': {
+ \ 'left': [ [ 'mode', 'paste' ], [ 'readonly' ], [ 'filename' ], [ 'modified' ] ],
+ \ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat' ], [ 'fileencoding' ], [ 'filetype' ] ]
+ \ },
+ \ }
+ call lightline#init()
+ call lightline#colorscheme()
+ call lightline#link()
+ for i in range(4)
+ for j in range(5)
+ if i + 1 == j
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_%s', i, j)), printf('LightLineLeft_normal_%s_%s', i, j))
+ else
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_%s', i, j)), 'E411: highlight group not found')
+ endif
+ endfor
+ endfor
+endfunction
+
+function! s:suite.component_type()
+ let g:lightline = { 'component_type': { 'error': 'error', 'warning': 'warning' } }
+ call lightline#init()
+ call lightline#colorscheme()
+ call lightline#link()
+ for type in ['error', 'warning']
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s', type)), printf('LightLineLeft_normal_%s', type))
+ call s:assert.match(s:hi(printf('LightLineLeft_active_0_%s', type)), printf('LightLineLeft_normal_0_%s', type))
+ call s:assert.match(s:hi(printf('LightLineLeft_active_1_%s', type)), printf('LightLineLeft_normal_1_%s', type))
+ call s:assert.match(s:hi(printf('LightLineLeft_active_2_%s', type)), 'E411: highlight group not found')
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_0', type)), printf('LightLineLeft_normal_%s_0', type))
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_1', type)), printf('LightLineLeft_normal_%s_1', type))
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_2', type)), printf('LightLineLeft_normal_%s_2', type))
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_3', type)), 'E411: highlight group not found')
+ endfor
+ for type1 in ['error', 'warning']
+ for type2 in ['error', 'warning']
+ call s:assert.match(s:hi(printf('LightLineLeft_active_%s_%s', type1, type2)), printf('LightLineLeft_normal_%s_%s', type1, type2))
+ endfor
+ endfor
+endfunction
diff --git a/vim/bundle/lightline.vim/test/mode.vim b/vim/bundle/lightline.vim/test/mode.vim
new file mode 100644
index 0000000..53280f5
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/mode.vim
@@ -0,0 +1,14 @@
+let s:suite = themis#suite('mode')
+let s:assert = themis#helper('assert')
+
+function! s:suite.mode()
+ let g:lightline = {}
+ call lightline#init()
+ call s:assert.equals(lightline#mode(), 'NORMAL')
+endfunction
+
+function! s:suite.mode_map()
+ let g:lightline = { 'mode_map': { 'n': 'N' } }
+ call lightline#init()
+ call s:assert.equals(lightline#mode(), 'N')
+endfunction
diff --git a/vim/bundle/lightline.vim/test/onetab.vim b/vim/bundle/lightline.vim/test/onetab.vim
new file mode 100644
index 0000000..529d833
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/onetab.vim
@@ -0,0 +1,98 @@
+let s:suite = themis#suite('onetab')
+let s:assert = themis#helper('assert')
+
+function! s:suite.before_each()
+ let g:lightline = {}
+ call lightline#init()
+ tabnew
+ tabonly
+endfunction
+
+function! s:suite.onetab()
+ call s:assert.equals(lightline#onetab(1, 1), '1 [No Name]')
+endfunction
+
+function! s:suite.tabnew()
+ tabnew
+ call s:assert.equals(lightline#onetab(1, 0), '1 [No Name]')
+ call s:assert.equals(lightline#onetab(2, 1), '2 [No Name]')
+endfunction
+
+function! s:suite.tabnew_tabnew()
+ tabnew
+ tabnew
+ call s:assert.equals(lightline#onetab(1, 0), '1 [No Name]')
+ call s:assert.equals(lightline#onetab(2, 0), '2 [No Name]')
+ call s:assert.equals(lightline#onetab(3, 1), '3 [No Name]')
+endfunction
+
+function! s:suite.modified()
+ call append(0, '')
+ call s:assert.equals(lightline#onetab(1, 1), '1 [No Name] +')
+ undo
+endfunction
+
+function! s:suite.filename()
+ edit test
+ call s:assert.equals(lightline#onetab(1, 1), '1 test')
+ tabnew
+ bunload test
+endfunction
+
+function! s:suite.filename_modified()
+ edit test
+ call append(0, '')
+ call s:assert.equals(lightline#onetab(1, 1), '1 test +')
+ tabnew
+ bunload! test
+endfunction
+
+function! s:suite.active_inactive()
+ let g:lightline = { 'tab': { 'active': [ 'tabnum', 'filename' ], 'inactive': [ 'filename' ] } }
+ call lightline#init()
+ edit test
+ call append(0, '')
+ call s:assert.equals(lightline#onetab(1, 1), '1 test')
+ call s:assert.equals(lightline#onetab(1, 0), 'test')
+ tabnew
+ bunload! test
+endfunction
+
+function! s:suite.tab_component()
+ let g:lightline = { 'tab': { 'active': [ 'custom' ] }, 'tab_component': { 'custom': 'custom' } }
+ call lightline#init()
+ call s:assert.equals(lightline#onetab(1, 1), 'custom')
+ call s:assert.equals(lightline#onetab(2, 1), 'custom')
+endfunction
+
+function! s:suite.tab_component_function()
+ function! Custom(n)
+ return 'custom: ' . a:n
+ endfunction
+ let g:lightline = { 'tab': { 'active': [ 'custom' ] }, 'tab_component_function': { 'custom': 'Custom' } }
+ call lightline#init()
+ call s:assert.equals(lightline#onetab(1, 1), 'custom: 1')
+ call s:assert.equals(lightline#onetab(2, 1), 'custom: 2')
+ delfunction Custom
+endfunction
+
+function! s:suite.tab_component_empty_middle()
+ let g:lightline = { 'tab': { 'active': [ 'tabnum', 'custom', 'filename' ], 'inactive': [ 'tabnum', 'custom', 'custom', 'filename' ] }, 'tab_component': { 'custom': '' } }
+ call lightline#init()
+ call s:assert.equals(lightline#onetab(1, 1), '1 [No Name]')
+ call s:assert.equals(lightline#onetab(2, 1), '2 [No Name]')
+endfunction
+
+function! s:suite.tab_component_empty_left()
+ let g:lightline = { 'tab': { 'active': [ 'custom', 'filename' ], 'inactive': [ 'custom', 'custom', 'filename' ] }, 'tab_component': { 'custom': '' } }
+ call lightline#init()
+ call s:assert.equals(lightline#onetab(1, 1), '[No Name]')
+ call s:assert.equals(lightline#onetab(2, 1), '[No Name]')
+endfunction
+
+function! s:suite.tab_component_empty_middle()
+ let g:lightline = { 'tab': { 'active': [ 'tabnum', 'custom' ], 'inactive': [ 'tabnum', 'custom', 'custom' ] }, 'tab_component': { 'custom': '' } }
+ call lightline#init()
+ call s:assert.equals(lightline#onetab(1, 1), '1')
+ call s:assert.equals(lightline#onetab(2, 1), '2')
+endfunction
diff --git a/vim/bundle/lightline.vim/test/subseparator.vim b/vim/bundle/lightline.vim/test/subseparator.vim
new file mode 100644
index 0000000..02cac4c
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/subseparator.vim
@@ -0,0 +1,302 @@
+let s:suite = themis#suite('subseparator')
+let s:assert = themis#helper('assert')
+
+function! s:subseparator(...)
+ return eval(substitute(call(SID('subseparator'), a:000), '^%{\|}$', '', 'g'))
+endfunction
+
+function! s:suite.subseparator_component()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_1()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1', 'custom2': '1', 'custom3': '1' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_2()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '0', 'custom2': '1', 'custom3': '1' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_3()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '1' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_4()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1', 'custom2': '0', 'custom3': '0' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_5()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '0', 'custom2': '0', 'custom3': '0' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_6()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1||0', 'custom2': '0', 'custom3': '0' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+endfunction
+
+function! s:suite.subseparator_component_visible_condition_7()
+ let g:lightline = { 'component': { 'custom1': 'custom1', 'custom2': 'custom2', 'custom3': 'custom3' }, 'component_visible_condition': { 'custom1': '1||1', 'custom2': '0', 'custom3': '0' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+endfunction
+
+function! s:suite.subseparator_component_function()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_function_1()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom1
+endfunction
+
+function! s:suite.subseparator_component_function_2()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+ delfunction Custom1
+ delfunction Custom2
+endfunction
+
+function! s:suite.subseparator_component_function_3()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+ delfunction Custom1
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_function_4()
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_function_5()
+ function! Custom1()
+ return ''
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_function_6()
+ function! Custom1()
+ return ''
+ endfunction
+ function! Custom2()
+ return ''
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_function_7()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return ''
+ endfunction
+ function! Custom3()
+ return ''
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_expand()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [1, 1, 1]), '|')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_expand()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom1': 'Custom1', 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [1, 1, 1]), '|')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_expand_1()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom1': 'Custom1' }, 'component_function': { 'custom2': 'Custom2', 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [1, 0, 0]), '|')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_expand_2()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_expand': { 'custom1': 'Custom1', 'custom2': 'Custom2' }, 'component_function': { 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [1, 1, 0]), '|')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_expand_3()
+ function! Custom1()
+ return ''
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ function! Custom3()
+ return 'custom3'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2' }, 'component_expand': { 'custom3': 'Custom3' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 1]), '')
+ delfunction Custom1
+ delfunction Custom2
+ delfunction Custom3
+endfunction
+
+function! s:suite.subseparator_component_not_found()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom1
+endfunction
+
+function! s:suite.subseparator_component_not_found_1()
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom2': 'Custom2' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '')
+ delfunction Custom2
+endfunction
+
+function! s:suite.subseparator_component_not_found_2()
+ function! Custom1()
+ return 'custom1'
+ endfunction
+ function! Custom2()
+ return 'custom2'
+ endfunction
+ let g:lightline = { 'component_function': { 'custom1': 'Custom1', 'custom2': 'Custom2' } }
+ call lightline#init()
+ call s:assert.equals(s:subseparator(['custom1', 'custom2', 'custom3'], '|', [0, 0, 0]), '|')
+ delfunction Custom1
+ delfunction Custom2
+endfunction
diff --git a/vim/bundle/lightline.vim/test/tabline.vim b/vim/bundle/lightline.vim/test/tabline.vim
new file mode 100644
index 0000000..0a9879f
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/tabline.vim
@@ -0,0 +1,67 @@
+let s:suite = themis#suite('tabline')
+let s:assert = themis#helper('assert')
+
+function! s:suite.before_each()
+ let g:lightline = {}
+ call lightline#init()
+ tabnew
+ tabonly
+endfunction
+
+function! s:suite.tabline()
+ call s:assert.equals(&tabline, '%!lightline#tabline()')
+endfunction
+
+function! s:suite.enabled()
+ let g:lightline = { 'enable': { 'tabline': 1 } }
+ call lightline#init()
+ call s:assert.equals(&tabline, '%!lightline#tabline()')
+endfunction
+
+function! s:suite.disabled()
+ let g:lightline = { 'enable': { 'tabline': 0 } }
+ call lightline#init()
+ call s:assert.equals(&tabline, '')
+endfunction
+
+function! s:suite.tabnew()
+ let tabline = lightline#tabline()
+ tabnew
+ call s:assert.not_equals(lightline#tabline(), tabline)
+endfunction
+
+function! s:suite.tabnew_first()
+ let tabline = lightline#tabline()
+ 0tabnew
+ call s:assert.not_equals(lightline#tabline(), tabline)
+endfunction
+
+function! s:suite.tabnext()
+ tabnew
+ let tabline = lightline#tabline()
+ tabnext
+ call s:assert.not_equals(lightline#tabline(), tabline)
+endfunction
+
+function! s:suite.tabonly()
+ tabnew
+ tabfirst
+ let tabline = lightline#tabline()
+ tabonly
+ call s:assert.not_equals(lightline#tabline(), tabline)
+endfunction
+
+function! s:suite.tabclose()
+ tabnew
+ let tabline = lightline#tabline()
+ tabclose
+ call s:assert.not_equals(lightline#tabline(), tabline)
+endfunction
+
+function! s:suite.tabclose_last()
+ tabnew
+ tabfirst
+ let tabline = lightline#tabline()
+ $tabclose
+ call s:assert.not_equals(lightline#tabline(), tabline)
+endfunction
diff --git a/vim/bundle/lightline.vim/test/tabs.vim b/vim/bundle/lightline.vim/test/tabs.vim
new file mode 100644
index 0000000..92c2c08
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/tabs.vim
@@ -0,0 +1,99 @@
+let s:suite = themis#suite('tabs')
+let s:assert = themis#helper('assert')
+
+function! s:suite.before_each()
+ let g:lightline = { 'winwidth': 180 }
+ call lightline#init()
+ tabnew
+ tabonly
+endfunction
+
+function! s:tab(number, ...) abort
+ let active = get(a:000, 0, 0)
+ let last = get(a:000, 1, 0)
+ return '%' . a:number . 'T%{lightline#onetab(' . a:number . ',' . active . ')}' . (last ? '%T' : '')
+endfunction
+
+function! s:suite.tabs()
+ call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1, 1)], []])
+endfunction
+
+function! s:suite.tabnew()
+ tabnew
+ call s:assert.equals(lightline#tabs(), [[s:tab(1)], [s:tab(2, 1, 1)], []])
+endfunction
+
+function! s:suite.tabnew_tabnew()
+ tabnew
+ tabnew
+ call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2)], [s:tab(3, 1, 1)], []])
+endfunction
+
+function! s:suite.tabnew_tabfirst()
+ tabnew
+ tabfirst
+ call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1)], [s:tab(2, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_tabnew_tabfirst()
+ tabnew
+ tabnew
+ tabfirst
+ call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1)], [s:tab(2), s:tab(3, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_tabnew_tabprevious()
+ tabnew
+ tabnew
+ tabprevious
+ call s:assert.equals(lightline#tabs(), [[s:tab(1)], [s:tab(2, 1)], [s:tab(3, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_20()
+ for i in range(19)
+ tabnew
+ endfor
+ call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), s:tab(3), s:tab(4), '...', s:tab(16), s:tab(17), s:tab(18), s:tab(19)], [s:tab(20, 1, 1)], []])
+endfunction
+
+function! s:suite.tabnew_20_tabfirst()
+ for i in range(19)
+ tabnew
+ endfor
+ tabfirst
+ call s:assert.equals(lightline#tabs(), [[], [s:tab(1, 1)], [s:tab(2), s:tab(3), s:tab(4), s:tab(5), '...', s:tab(17), s:tab(18), s:tab(19), s:tab(20, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_20_tabfirst_tabnext()
+ for i in range(19)
+ tabnew
+ endfor
+ tabfirst
+ tabnext
+ call s:assert.equals(lightline#tabs(), [[s:tab(1)], [s:tab(2, 1)], [s:tab(3), s:tab(4), s:tab(5), s:tab(6), '...', s:tab(18), s:tab(19), s:tab(20, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_20_tabnext_10()
+ for i in range(19)
+ tabnew
+ endfor
+ tabnext 10
+ call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), '...', s:tab(8), s:tab(9)], [s:tab(10, 1)], [s:tab(11), s:tab(12), '...', s:tab(19), s:tab(20, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_20_tabprevious()
+ for i in range(19)
+ tabnew
+ endfor
+ tabprevious
+ call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), s:tab(3), '...', s:tab(15), s:tab(16), s:tab(17), s:tab(18)], [s:tab(19, 1)], [s:tab(20, 0, 1)]])
+endfunction
+
+function! s:suite.tabnew_20_tabprevious_tabprevious()
+ for i in range(19)
+ tabnew
+ endfor
+ tabprevious
+ tabprevious
+ call s:assert.equals(lightline#tabs(), [[s:tab(1), s:tab(2), s:tab(3), '...', s:tab(15), s:tab(16), s:tab(17)], [s:tab(18, 1)], [s:tab(19), s:tab(20, 0, 1)]])
+endfunction
diff --git a/vim/bundle/lightline.vim/test/toggle.vim b/vim/bundle/lightline.vim/test/toggle.vim
new file mode 100644
index 0000000..c6042a8
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/toggle.vim
@@ -0,0 +1,37 @@
+let s:suite = themis#suite('toggle')
+let s:assert = themis#helper('assert')
+
+function! s:suite.before_each()
+ let g:lightline = {}
+ call lightline#init()
+ tabnew
+ tabonly
+endfunction
+
+function! s:suite.default()
+ call s:assert.equals(exists('#lightline'), 1)
+ call s:assert.equals(exists('#lightline-disable'), 0)
+ call s:assert.not_equals(&tabline, '')
+endfunction
+
+function! s:suite.disable_enable()
+ call lightline#disable()
+ call s:assert.equals(exists('#lightline'), 0)
+ call s:assert.equals(exists('#lightline-disable'), 1)
+ call s:assert.equals(&tabline, '')
+ call lightline#enable()
+ call s:assert.equals(exists('#lightline'), 1)
+ call s:assert.equals(exists('#lightline-disable'), 0)
+ call s:assert.not_equals(&tabline, '')
+endfunction
+
+function! s:suite.toggle()
+ call lightline#toggle()
+ call s:assert.equals(exists('#lightline'), 0)
+ call s:assert.equals(exists('#lightline-disable'), 1)
+ call s:assert.equals(&tabline, '')
+ call lightline#toggle()
+ call s:assert.equals(exists('#lightline'), 1)
+ call s:assert.equals(exists('#lightline-disable'), 0)
+ call s:assert.not_equals(&tabline, '')
+endfunction
diff --git a/vim/bundle/lightline.vim/test/uniq.vim b/vim/bundle/lightline.vim/test/uniq.vim
new file mode 100644
index 0000000..cdfaec0
--- /dev/null
+++ b/vim/bundle/lightline.vim/test/uniq.vim
@@ -0,0 +1,46 @@
+let s:suite = themis#suite('uniq')
+let s:assert = themis#helper('assert')
+
+function! s:uniq(...)
+ try
+ return call(SID('uniq'), a:000)
+ catch
+ return call(function('uniq'), a:000)
+ endtry
+endfunction
+
+function! s:suite.nil()
+ call s:assert.equals(s:uniq([]), [])
+endfunction
+
+function! s:suite.one()
+ call s:assert.equals(s:uniq(['foo']), ['foo'])
+endfunction
+
+function! s:suite.two()
+ call s:assert.equals(s:uniq(['foo', 'bar']), ['foo', 'bar'])
+endfunction
+
+function! s:suite.three()
+ call s:assert.equals(s:uniq(['foo', 'bar', 'baz']), ['foo', 'bar', 'baz'])
+endfunction
+
+function! s:suite.two_duplicated()
+ call s:assert.equals(s:uniq(['foo', 'foo']), ['foo'])
+endfunction
+
+function! s:suite.three_duplicated()
+ call s:assert.equals(s:uniq(['foo', 'bar', 'foo']), ['foo', 'bar', 'foo'])
+endfunction
+
+function! s:suite.many1()
+ call s:assert.equals(s:uniq(['foo', 'foo', 'bar', 'baz', 'baz', 'qux', 'foo']), ['foo', 'bar', 'baz', 'qux', 'foo'])
+endfunction
+
+function! s:suite.many2()
+ call s:assert.equals(s:uniq(['foo', 'foo', 'foo', 'foo', 'bar', 'bar', 'bar']), ['foo', 'bar'])
+endfunction
+
+function! s:suite.many3()
+ call s:assert.equals(s:uniq(['foo', 'foo', 'bar', 'bar', 'bar', 'foo', 'foo', 'foo']), ['foo', 'bar', 'foo'])
+endfunction
diff --git a/vim/bundle/syntastic/.gitignore b/vim/bundle/syntastic/.gitignore
new file mode 100644
index 0000000..cc07c93
--- /dev/null
+++ b/vim/bundle/syntastic/.gitignore
@@ -0,0 +1,4 @@
+*~
+*.swp
+tags
+.DS_Store
diff --git a/vim/bundle/syntastic/CONTRIBUTING.md b/vim/bundle/syntastic/CONTRIBUTING.md
new file mode 100644
index 0000000..1949415
--- /dev/null
+++ b/vim/bundle/syntastic/CONTRIBUTING.md
@@ -0,0 +1,105 @@
+# CONTRIBUTING
+- - -
+1\. [Bug reports / GitHub issues](#bugreps)
+2\. [Submitting a patch](#patches)
+3\. [General style notes](#generalstyle)
+4\. [Syntax checker notes](#checkerstyle)
+- - -
+
+<a name="bugreps"></a>
+
+## 1. Bug reports / GitHub issues
+
+Please note that the preferred channel for posting bug reports is the
+[issue tracker at GitHub][bug_tracker]. Reports posted elsewhere are less likely
+to be seen by the core team.
+
+When reporting a bug make sure you search the existing GitHub issues
+for the same/similar issues. If you find one, feel free to add a `+1`
+comment with any additional information that may help us solve the
+issue.
+
+When creating a new issue be sure to state the following:
+
+* steps to reproduce the bug;
+* the version of Vim you are using (run `:ver` to find out);
+* the version of syntastic you are using (see `:SyntasticInfo`).
+
+For syntax checker bugs also state the version of the checker executable
+that you are using. Adding debugging information is typically useful
+too:
+
+* open a file handled by your checker;
+* set `g:syntastic_debug` to 1 or 3;
+* run the checker;
+* copy the output of `:mes`.
+
+<a name="patches"></a>
+
+## 2. Submitting a patch
+
+Before you consider adding features to syntastic, _please_ spend a few minutes
+(re-)reading the latest version of the [manual][manual]. Syntastic is changing
+rapidly at times, and it's possible that some features you want to add exist
+already.
+
+To submit a patch:
+
+* fork the [repo][github] on GitHub;
+* make a [topic branch][branches] and start hacking;
+* submit a pull request based off your topic branch.
+
+Small, focused patches are preferred.
+
+Large changes to the code should be discussed with the core team first.
+Create an issue and explain your plan and see what we say.
+
+Also, make sure to update the manual whenever applicable. Nobody can use
+features that aren't documented.
+
+<a name="generalstyle"></a>
+
+## 3. General style notes
+
+Follow the coding conventions/styles used in the syntastic core:
+
+* use 4 space indents;
+* don't use abbreviated keywords - e.g. use `endfunction`, not `endfun`
+(there's always room for more fun!);
+* don't use `l:` prefixes for variables unless actually required (i.e.
+almost never);
+* code for maintainability; we would rather a function be a couple of
+lines longer and have (for example) some [explaining variables][variables] to
+aid readability.
+
+<a name="checkerstyle"></a>
+
+## 4. Syntax checker notes
+
+Make sure to read the [guide][guide] if you plan to add new syntax checkers.
+
+Use the existing checkers as templates, rather than writing everything
+from scratch.
+
+The preferred style for error format strings is one "clause" per line.
+E.g. (from the `coffee` checker):
+
+```vim
+let errorformat =
+ \ '%E%f:%l:%c: %trror: %m,' .
+ \ 'Syntax%trror: In %f\, %m on line %l,' .
+ \ '%EError: In %f\, Parse error on line %l: %m,' .
+ \ '%EError: In %f\, %m on line %l,' .
+ \ '%W%f(%l): lint warning: %m,' .
+ \ '%W%f(%l): warning: %m,' .
+ \ '%E%f(%l): SyntaxError: %m,' .
+ \ '%-Z%p^,' .
+ \ '%-G%.%#'
+```
+
+[bug_tracker]: https://github.com/scrooloose/syntastic/issues
+[manual]: https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt
+[github]: https://github.com/scrooloose/syntastic
+[branches]: https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches
+[variables]: http://www.refactoring.com/catalog/extractVariable.html
+[guide]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
diff --git a/vim/bundle/syntastic/LICENCE b/vim/bundle/syntastic/LICENCE
new file mode 100644
index 0000000..8b1a9d8
--- /dev/null
+++ b/vim/bundle/syntastic/LICENCE
@@ -0,0 +1,13 @@
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ Version 2, December 2004
+
+Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
+
+Everyone is permitted to copy and distribute verbatim or modified
+copies of this license document, and changing it is allowed as long
+as the name is changed.
+
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
diff --git a/vim/bundle/syntastic/README.markdown b/vim/bundle/syntastic/README.markdown
new file mode 100644
index 0000000..685d840
--- /dev/null
+++ b/vim/bundle/syntastic/README.markdown
@@ -0,0 +1,480 @@
+ ,
+ / \,,_ .'|
+ ,{{| /}}}}/_.' _____________________________________________
+ }}}}` '{{' '. / \
+ {{{{{ _ ;, \ / Ladies and Gentlemen, \
+ ,}}}}}} /o`\ ` ;) | |
+ {{{{{{ / ( | this is ... |
+ }}}}}} | \ | |
+ {{{{{{{{ \ \ | |
+ }}}}}}}}} '.__ _ | | _____ __ __ _ |
+ {{{{{{{{ /`._ (_\ / | / ___/__ ______ / /_____ ______/ /_(_)____ |
+ }}}}}}' | //___/ --=: \__ \/ / / / __ \/ __/ __ `/ ___/ __/ / ___/ |
+ jgs `{{{{` | '--' | ___/ / /_/ / / / / /_/ /_/ (__ ) /_/ / /__ |
+ }}}` | /____/\__, /_/ /_/\__/\__,_/____/\__/_/\___/ |
+ | /____/ |
+ | /
+ \_____________________________________________/
+
+
+- - -
+1. [Introduction](#introduction)
+2. [Installation](#installation)
+2.1. [Requirements](#requirements)
+2.2. [Installing syntastic with Pathogen](#installpathogen)
+3. [Recommended settings](#settings)
+4. [FAQ](#faq)
+4.1. [I installed syntastic but it isn't reporting any errors...](#faqinfo)
+4.2. [The `python` checker complains about syntactically valid Python 3 constructs...](#faqpython3)
+4.3. [Are there any local checkers for HTML5 that I can use with syntastic?](#faqhtml5)
+4.4. [The `perl` checker has stopped working...](#faqperl)
+4.5. [What happened to the `rustc` checker?](#faqrust)
+4.6. [What happened to the `xcrun` checker?](#faqxcrun)
+4.7. [I run a checker and the location list is not updated...](#faqloclist)
+4.7. [I run`:lopen` or `:lwindow` and the error window is empty...](#faqloclist)
+4.8. [How can I pass additional arguments to a checker?](#faqargs)
+4.9. [Syntastic supports several checkers for my filetype - how do I tell which one(s) to use?](#faqcheckers)
+4.10. [What is the difference between syntax checkers and style checkers?](#faqstyle)
+4.11. [I have enabled multiple checkers for the current filetype. How can I display all errors from all checkers together?](#faqaggregate)
+4.12. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext)
+4.13. [The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?](#faqbdelete)
+5. [Resources](#otherresources)
+
+- - -
+
+<a name="introduction"></a>
+
+## 1\. Introduction
+
+Syntastic is a syntax checking plugin for [Vim][vim] that runs files through
+external syntax checkers and displays any resulting errors to the user. This
+can be done on demand, or automatically as files are saved. If syntax errors
+are detected, the user is notified and is happy because they didn't have to
+compile their code or execute their script to find them.
+
+At the time of this writing, syntastic has checking plugins for ActionScript,
+Ada, Ansible configurations, API Blueprint, AppleScript, AsciiDoc, Assembly
+languages, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, Chef, CoffeeScript,
+Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dockerfile, Dust, Elixir,
+Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe,
+Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP,
+LLVM intermediate language, Lua, Markdown, MATLAB, Mercury, NASM, Nix,
+Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable
+Object, OS X and iOS property lists, Pug (formerly Jade), Puppet, Python,
+QML, R, Racket, RDF TriG, RDF Turtle, Relax NG, reStructuredText, RPM spec,
+Ruby, SASS/SCSS, Scala, Slim, SML, Sphinx, SQL, Stylus, Tcl, TeX, Texinfo,
+Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, XQuery,
+YACC, YAML, YANG data models, z80, Zope page templates, and Zsh. See the
+[manual][checkers] for details about the corresponding supported checkers
+(`:help syntastic-checkers` in Vim).
+
+A number of third-party Vim plugins also provide checkers for syntastic,
+for example: [merlin][merlin], [omnisharp-vim][omnisharp], [rust.vim][rust],
+[syntastic-extras][myint], [syntastic-more][roktas], [vim-crystal][crystal],
+[vim-eastwood][eastwood], and [vim-swift][swift].
+
+Below is a screenshot showing the methods that Syntastic uses to display syntax
+errors. Note that, in practise, you will only have a subset of these methods
+enabled.
+
+![Screenshot 1][screenshot]
+
+1. Errors are loaded into the location list for the corresponding window.
+2. When the cursor is on a line containing an error, the error message is echoed in the command window.
+3. Signs are placed beside lines with errors - note that warnings are displayed in a different color.
+4. There is a configurable statusline flag you can include in your statusline config.
+5. Hover the mouse over a line containing an error and the error message is displayed as a balloon.
+6. (not shown) Highlighting errors with syntax highlighting. Erroneous parts of lines can be highlighted.
+
+<a name="installation"></a>
+
+## 2\. Installation
+
+<a name="requirements"></a>
+
+### 2.1\. Requirements
+
+Syntastic itself has rather relaxed requirements: it doesn't have any external
+dependencies, and it needs a version of [Vim][vim] compiled with a few common
+features: `autocmd`, `eval`, `file_in_path`, `modify_fname`, `quickfix`,
+`reltime`, and `user_commands`. Not all possible combinations of features that
+include the ones above make equal sense on all operating systems, but Vim
+version 7 or later with the "normal", "big", or "huge" feature sets should be
+fine.
+
+Syntastic should work with any modern plugin managers for Vim, such as
+[NeoBundle][neobundle], [Pathogen][pathogen], [Vim-Addon-Manager][vam], [Vim-Plug][plug], or
+[Vundle][vundle]. Instructions for installing syntastic with [Pathogen][pathogen] are
+included below for completeness.
+
+Starting with Vim version 7.4.1486 you can also load syntastic using the
+standard mechanism of packages, without the help of third-party plugin managers
+(see `:help packages` in Vim for details). Beware however that, while support
+for packages has been added in Vim 7.4.1384, the functionality needed by
+syntastic is present only in versions 7.4.1486 and later.
+
+Last but not least: syntastic doesn't know how to do any syntax checks by
+itself. In order to get meaningful results you need to install external
+checkers corresponding to the types of files you use. Please consult the
+[manual][checkers] (`:help syntastic-checkers` in Vim) for a list of supported
+checkers.
+
+<a name="installpathogen"></a>
+
+### 2.2\. Installing syntastic with Pathogen
+
+If you already have [Pathogen][pathogen] working then skip [Step 1](#step1) and go to
+[Step 2](#step2).
+
+<a name="step1"></a>
+
+#### 2.2.1\. Step 1: Install pathogen.vim
+
+First I'll show you how to install Tim Pope's [Pathogen][pathogen] so that it's easy to
+install syntastic. Do this in your terminal so that you get the `pathogen.vim`
+file and the directories it needs:
+```sh
+mkdir -p ~/.vim/autoload ~/.vim/bundle && \
+curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
+```
+Next you *need* to add this to your `~/.vimrc`:
+```vim
+execute pathogen#infect()
+```
+
+<a name="step2"></a>
+
+#### 2.2.2\. Step 2: Install syntastic as a Pathogen bundle
+
+You now have pathogen installed and can put syntastic into `~/.vim/bundle` like
+this:
+```sh
+cd ~/.vim/bundle && \
+git clone https://github.com/scrooloose/syntastic.git
+```
+Quit vim and start it back up to reload it, then type:
+```vim
+:Helptags
+```
+If you get an error when you do this, then you probably didn't install
+[Pathogen][pathogen] right. Go back to [Step 1](#step1) and make sure you did the
+following:
+
+1. Created both the `~/.vim/autoload` and `~/.vim/bundle` directories.
+2. Added the `execute pathogen#infect()` line to your `~/.vimrc` file
+3. Did the `git clone` of syntastic inside `~/.vim/bundle`
+4. Have permissions to access all of these directories.
+
+<a name="settings"></a>
+
+## 3\. Recommended settings
+
+Syntastic has numerous options that can be configured, and the defaults
+are not particularly well suitable for new users. It is recommended
+that you start by adding the following lines to your `vimrc` file, and
+return to them after reading the manual (see `:help syntastic` in Vim):
+```vim
+set statusline+=%#warningmsg#
+set statusline+=%{SyntasticStatuslineFlag()}
+set statusline+=%*
+
+let g:syntastic_always_populate_loc_list = 1
+let g:syntastic_auto_loc_list = 1
+let g:syntastic_check_on_open = 1
+let g:syntastic_check_on_wq = 0
+```
+
+<a name="faq"></a>
+
+## 4\. FAQ
+
+<a name="faqinfo"></a>
+
+__4.1. Q. I installed syntastic but it isn't reporting any errors...__
+
+A. The most likely reason is that none of the syntax checkers that it requires
+are installed. For example: by default, python requires either `flake8` or
+`pylint` to be installed and in your `$PATH`. Read the [manual][checkers]
+(`:help syntastic-checkers` in Vim) to find out what executables are
+supported. Note that aliases do not work; the actual executables must be
+available in your `$PATH`. Symbolic links are okay though. You can see
+syntastic's idea of available checkers by running `:SyntasticInfo`.
+
+A second probable reason is that none of the available checkers are
+enabled. Syntastic comes preconfigured with a default list of enabled checkers
+per filetype, but this list is kept short in order to prevent slowing down Vim
+or trying to run conflicting checks. The command `:SyntasticInfo` will show you
+which checkers are enabled. You can tell syntastic which checkers (among the
+available ones) you want to run by setting `g:syntastic_<filetype>_checkers` in
+your `vimrc` (see [below](#faqcheckers)).
+
+A third possible reason is that the `$PATH` seen by syntastic might not be same
+as the `$PATH` in your login shell. Syntastic runs checkers using the shell
+pointed to by Vim's `shell` (or by `g:syntastic_shell`, if set), and that's the
+shell you need to configure to set the proper `$PATH` and environment variables
+for your checkers. You can see syntastic's idea of `$PATH` by running
+```vim
+:echo syntastic#util#system('echo "$PATH"')
+```
+on UNIX and Mac OS-X systems, or
+```vim
+:echo syntastic#util#system('echo %PATH%')
+```
+on Windows.
+
+Finally, another reason it could fail is that either the command line options
+or the error output for a syntax checker may have changed. In this case, make
+sure you have the latest version of the syntax checker installed. If it still
+fails then post an [issue][bug_tracker] - or better yet, create a pull request.
+
+<a name="faqpython3"></a>
+
+__4.2. Q. The `python` checker complains about syntactically valid Python 3 constructs...__
+
+A. Configure the `python` checker to call a Python 3 interpreter rather than
+Python 2, e.g:
+```vim
+let g:syntastic_python_python_exec = '/path/to/python3'
+```
+
+<a name="faqhtml5"></a>
+
+__4.3. Q. Are there any local checkers for HTML5 that I can use with syntastic?__
+
+[HTML Tidy][tidy_old] has a fork named [HTML Tidy for HTML5][tidy]. It's a drop
+in replacement, and syntastic can use it without changes. Just install it
+somewhere and point `g:syntastic_html_tidy_exec` to its executable:
+```vim
+let g:syntastic_html_tidy_exec = 'tidy5'
+```
+Alternatively, you can install [vnu.jar][vnu_jar] from the [validator.nu][vnu]
+project and run it as a [HTTP server][vnu_server]:
+```sh
+$ java -Xss512k -cp /path/to/vnu.jar nu.validator.servlet.Main 8888
+```
+Then you can configure syntastic to use it:
+```vim
+let g:syntastic_html_validator_api = 'http://localhost:8888/'
+```
+
+<a name="faqperl"></a>
+
+__4.4. Q. The `perl` checker has stopped working...__
+
+A. The `perl` checker runs `perl -c` against your file, which in turn
+__executes__ any `BEGIN`, `UNITCHECK`, and `CHECK` blocks, and any `use`
+statements in your file (cf. [perlrun][perlrun]). This is probably fine if you
+wrote the file yourself, but it's a security problem if you're checking
+third-party files. Since there is currently no way to disable this behaviour
+while still producing useful results, the checker is now disabled by default.
+To (re-)enable it, make sure the `g:syntastic_perl_checkers` list includes
+`perl`, and set `g:syntastic_enable_perl_checker` to 1 in your `vimrc`:
+```vim
+let g:syntastic_enable_perl_checker = 1
+```
+
+<a name="faqrust"></a>
+
+__4.5. Q. What happened to the `rustc` checker?__
+
+A. It is now part of the [rust.vim][rust] plugin. If you install this plugin the
+checker should be picked up automatically by syntastic.
+
+<a name="faqxcrun"></a>
+
+__4.6. Q. What happened to the `xcrun` checker?__
+
+A. The `xcrun` checker used to have a security problem and it has been removed.
+A better checker for __Swift__ is part of the [vim-swift][swift] plugin. If you
+install this plugin the checker should be picked up automatically by syntastic.
+
+<a name="faqloclist"></a>
+
+__4.7. Q. I run a checker and the location list is not updated...__
+__4.7. Q. I run`:lopen` or `:lwindow` and the error window is empty...__
+
+A. By default the location list is changed only when you run the `:Errors`
+command, in order to minimise conflicts with other plugins. If you want the
+location list to always be updated when you run the checkers, add this line to
+your `vimrc`:
+```vim
+let g:syntastic_always_populate_loc_list = 1
+```
+
+<a name="faqargs"></a>
+
+__4.8. Q. How can I pass additional arguments to a checker?__
+
+A. Almost all syntax checkers use the `makeprgBuild()` function. Those checkers
+that do can be configured using global variables. The general form of the
+global `args` variables is `syntastic_<filetype>_<checker>_args`.
+
+So, If you wanted to pass `--my --args --here` to the ruby mri checker you
+would add this line to your `vimrc`:
+```vim
+let g:syntastic_ruby_mri_args = "--my --args --here"
+```
+
+See `:help syntastic-checker-options` for more information.
+
+<a name="faqcheckers"></a>
+
+__4.9. Q. Syntastic supports several checkers for my filetype - how do I tell it
+which one(s) to use?__
+
+A. Stick a line like this in your `vimrc`:
+```vim
+let g:syntastic_<filetype>_checkers = ['<checker-name>']
+```
+
+To see the list of supported checkers for your filetype read the
+[manual][checkers] (`:help syntastic-checkers` in Vim).
+
+e.g. Python has the following checkers, among others: `flake8`, `pyflakes`,
+`pylint` and a native `python` checker.
+
+To tell syntastic to use `pylint`, you would use this setting:
+```vim
+let g:syntastic_python_checkers = ['pylint']
+```
+
+Checkers can be chained together like this:
+```vim
+let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd']
+```
+
+This is telling syntastic to run the `php` checker first, and if no errors are
+found, run `phpcs`, and then `phpmd`.
+
+You can also run checkers explicitly by calling `:SyntasticCheck <checker>`.
+
+e.g. to run `phpcs` and `phpmd`:
+```vim
+:SyntasticCheck phpcs phpmd
+```
+
+This works for any checkers available for the current filetype, even if they
+aren't listed in `g:syntastic_<filetype>_checkers`. You can't run checkers for
+"foreign" filetypes though (e.g. you can't run, say, a Python checker if the
+filetype of the current file is `php`).
+
+<a name="faqstyle"></a>
+
+__4.10. Q. What is the difference between syntax checkers and style checkers?__
+
+A. The errors and warnings they produce are highlighted differently and can
+be filtered by different rules, but otherwise the distinction is pretty much
+arbitrary. There is an ongoing effort to keep things consistent, so you can
+_generally_ expect messages produced by syntax checkers to be _mostly_ related
+to syntax, and messages produced by style checkers to be _mostly_ about style.
+But there can be no formal guarantee that, say, a style checker that runs into
+a syntax error wouldn't die with a fatal message, nor that a syntax checker
+wouldn't give you warnings against using some constructs as being bad practice.
+There is also no guarantee that messages marked as "style" are less severe than
+the ones marked as "syntax" (whatever that might mean). And there are even a
+few Frankenstein checkers (for example `flake8` and `pylama`) that, by their
+nature, produce both kinds of messages. Syntastic is not smart enough to be
+able to sort out these things by itself.
+
+In fact it's more useful to look at this from the perspective of filtering
+unwanted messages, rather than as an indicator of severity levels. The
+distinction between syntax and style is orthogonal to the distinction between
+errors and warnings, and thus you can turn off messages based on level, on
+type, or both.
+
+e.g. To disable all style messages:
+```vim
+let g:syntastic_quiet_messages = { "type": "style" }
+```
+See `:help syntastic_quiet_messages` for details.
+
+<a name="faqaggregate"></a>
+
+__4.11. Q. I have enabled multiple checkers for the current filetype. How can I
+display all errors from all checkers together?__
+
+A. Set `g:syntastic_aggregate_errors` to 1 in your `vimrc`:
+```vim
+let g:syntastic_aggregate_errors = 1
+```
+
+See `:help syntastic-aggregating-errors` for more details.
+
+<a name="faqlnext"></a>
+
+__4.12. Q. How can I jump between the different errors without using the location
+list at the bottom of the window?__
+
+A. Vim provides several built-in commands for this. See `:help :lnext` and
+`:help :lprevious`.
+
+If you use these commands a lot then you may want to add shortcut mappings to
+your `vimrc`, or install something like [unimpaired][unimpaired], which provides such
+mappings (among other things).
+
+<a name="faqbdelete"></a>
+
+__4.13. Q. The error window is closed automatically when I :quit the current buffer
+but not when I :bdelete it?__
+
+A. There is no safe way to handle that situation automatically, but you can
+work around it:
+
+```vim
+nnoremap <silent> <C-d> :lclose<CR>:bdelete<CR>
+cabbrev <silent> bd <C-r>=(getcmdtype()==#':' && getcmdpos()==1 ? 'lclose\|bdelete' : 'bd')<CR>
+```
+
+<a name="otherresources"></a>
+
+## 5\. Resources
+
+The preferred place for posting suggestions, reporting bugs, and general
+discussions related to syntastic is the [issue tracker at GitHub][bug_tracker].
+A guide for writing syntax checkers can be found in the [wiki][guide].
+There are also a dedicated [google group][google_group], and a
+[syntastic tag at StackOverflow][stack_overflow].
+
+Syntastic aims to provide a common interface to syntax checkers for as many
+languages as possible. For particular languages, there are, of course, other
+plugins that provide more functionality than syntastic. You might want to take
+a look at [ghcmod-vim][ghcmod], [jedi-vim][jedi], [python-mode][python_mode], [vim-go][vimgo], or
+[YouCompleteMe][ycm].
+
+[screenshot]: https://github.com/scrooloose/syntastic/raw/master/_assets/screenshot_1.png
+
+[bug_tracker]: https://github.com/scrooloose/syntastic/issues
+[checkers]: https://github.com/scrooloose/syntastic/blob/master/doc/syntastic-checkers.txt
+[crystal]: https://github.com/rhysd/vim-crystal
+[eastwood]: https://github.com/venantius/vim-eastwood
+[ghcmod]: https://github.com/eagletmt/ghcmod-vim
+[google_group]: https://groups.google.com/group/vim-syntastic
+[guide]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
+[jedi]: https://github.com/davidhalter/jedi-vim
+[merlin]: https://github.com/the-lambda-church/merlin
+[myint]: https://github.com/myint/syntastic-extras
+[neobundle]: https://github.com/Shougo/neobundle.vim
+[omnisharp]: https://github.com/OmniSharp/omnisharp-vim
+[pathogen]: https://github.com/tpope/vim-pathogen
+[perlrun]: http://perldoc.perl.org/perlrun.html#*-c*
+[plug]: https://github.com/junegunn/vim-plug/
+[python_mode]: https://github.com/klen/python-mode
+[roktas]: https://github.com/roktas/syntastic-more
+[rust]: https://github.com/rust-lang/rust.vim
+[stack_overflow]: http://stackoverflow.com/questions/tagged/syntastic
+[swift]: https://github.com/kballard/vim-swift
+[tidy]: http://www.htacg.org/tidy-html5/
+[tidy_old]: http://tidy.sourceforge.net/
+[unimpaired]: https://github.com/tpope/vim-unimpaired
+[vam]: https://github.com/MarcWeber/vim-addon-manager
+[vim]: http://www.vim.org/
+[vimgo]: https://github.com/fatih/vim-go
+[vnu]: http://about.validator.nu/
+[vnu_jar]: https://github.com/validator/validator/releases/latest
+[vnu_server]: http://validator.github.io/validator/#standalone
+[vundle]: https://github.com/gmarik/Vundle.vim
+[ycm]: http://valloric.github.io/YouCompleteMe/
+
+<!--
+vim:tw=79:sw=4:
+-->
diff --git a/vim/bundle/syntastic/_assets/screenshot_1.png b/vim/bundle/syntastic/_assets/screenshot_1.png
new file mode 100644
index 0000000..c1b69f4
--- /dev/null
+++ b/vim/bundle/syntastic/_assets/screenshot_1.png
Binary files differ
diff --git a/vim/bundle/syntastic/autoload/syntastic/c.vim b/vim/bundle/syntastic/autoload/syntastic/c.vim
new file mode 100644
index 0000000..e49a29a
--- /dev/null
+++ b/vim/bundle/syntastic/autoload/syntastic/c.vim
@@ -0,0 +1,341 @@
+if exists('g:loaded_syntastic_c_autoload') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_c_autoload = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Public functions {{{1
+
+" convenience function to determine the 'null device' parameter
+" based on the current operating system
+function! syntastic#c#NullOutput() abort " {{{2
+ let known_os = has('unix') || has('mac') || syntastic#util#isRunningWindows()
+ return known_os ? '-o ' . syntastic#util#DevNull() : ''
+endfunction " }}}2
+
+" read additional compiler flags from the given configuration file
+" the file format and its parsing mechanism is inspired by clang_complete
+function! syntastic#c#ReadConfig(file) abort " {{{2
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, 'ReadConfig: looking for', a:file)
+
+ " search upwards from the current file's directory
+ let config = syntastic#util#findFileInParent(a:file, expand('%:p:h', 1))
+ if config ==# ''
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, 'ReadConfig: file not found')
+ return ''
+ endif
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, 'ReadConfig: config file:', config)
+ if !filereadable(config)
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, 'ReadConfig: file unreadable')
+ return ''
+ endif
+
+ " convert filename into absolute path
+ let filepath = fnamemodify(config, ':p:h')
+
+ " try to read config file
+ try
+ let lines = readfile(config)
+ catch /\m^Vim\%((\a\+)\)\=:E48[45]/
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, 'ReadConfig: error reading file')
+ return ''
+ endtry
+
+ " filter out empty lines and comments
+ call filter(lines, 'v:val !~# ''\v^(\s*#|$)''')
+
+ " remove leading and trailing spaces
+ call map(lines, 'substitute(v:val, ''\m^\s\+'', "", "")')
+ call map(lines, 'substitute(v:val, ''\m\s\+$'', "", "")')
+
+ let parameters = []
+ for line in lines
+ let matches = matchstr(line, '\m\C^\s*-I\s*\zs.\+')
+ if matches !=# ''
+ " this one looks like an absolute path
+ if match(matches, '\m^\%(/\|\a:\)') != -1
+ call add(parameters, '-I' . matches)
+ else
+ call add(parameters, '-I' . filepath . syntastic#util#Slash() . matches)
+ endif
+ else
+ call add(parameters, line)
+ endif
+ endfor
+
+ return join(map(parameters, 'syntastic#util#shescape(v:val)'))
+endfunction " }}}2
+
+" GetLocList() for C-like compilers
+function! syntastic#c#GetLocList(filetype, subchecker, options) abort " {{{2
+ try
+ let flags = s:_get_cflags(a:filetype, a:subchecker, a:options)
+ catch /\m\C^Syntastic: skip checks$/
+ return []
+ endtry
+
+ let makeprg = syntastic#util#shexpand(g:syntastic_{a:filetype}_compiler) .
+ \ ' ' . flags . ' ' . syntastic#util#shexpand('%')
+
+ let errorformat = s:_get_checker_var('g', a:filetype, a:subchecker, 'errorformat', a:options['errorformat'])
+
+ let postprocess = s:_get_checker_var('g', a:filetype, a:subchecker, 'remove_include_errors', 0) ?
+ \ ['filterForeignErrors'] : []
+
+ " process makeprg
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': postprocess })
+endfunction " }}}2
+
+" }}}1
+
+" Private functions {{{1
+
+" initialize c/cpp syntax checker handlers
+function! s:_init() abort " {{{2
+ let s:handlers = []
+ let s:cflags = {}
+
+ call s:_registerHandler('\m\<cairo', 's:_checkPackage', ['cairo', 'cairo'])
+ call s:_registerHandler('\m\<freetype', 's:_checkPackage', ['freetype', 'freetype2', 'freetype'])
+ call s:_registerHandler('\m\<glade', 's:_checkPackage', ['glade', 'libglade-2.0', 'libglade'])
+ call s:_registerHandler('\m\<glib', 's:_checkPackage', ['glib', 'glib-2.0', 'glib'])
+ call s:_registerHandler('\m\<gtk', 's:_checkPackage', ['gtk', 'gtk+-2.0', 'gtk+', 'glib-2.0', 'glib'])
+ call s:_registerHandler('\m\<libsoup', 's:_checkPackage', ['libsoup', 'libsoup-2.4', 'libsoup-2.2'])
+ call s:_registerHandler('\m\<libxml', 's:_checkPackage', ['libxml', 'libxml-2.0', 'libxml'])
+ call s:_registerHandler('\m\<pango', 's:_checkPackage', ['pango', 'pango'])
+ call s:_registerHandler('\m\<SDL', 's:_checkPackage', ['sdl', 'sdl'])
+ call s:_registerHandler('\m\<opengl', 's:_checkPackage', ['opengl', 'gl'])
+ call s:_registerHandler('\m\<webkit', 's:_checkPackage', ['webkit', 'webkit-1.0'])
+
+ call s:_registerHandler('\m\<php\.h\>', 's:_checkPhp', [])
+ call s:_registerHandler('\m\<Python\.h\>', 's:_checkPython', [])
+ call s:_registerHandler('\m\<ruby', 's:_checkRuby', [])
+endfunction " }}}2
+
+" register a handler dictionary object
+function! s:_registerHandler(regex, function, args) abort " {{{2
+ let handler = {}
+ let handler['regex'] = a:regex
+ let handler['func'] = function(a:function)
+ let handler['args'] = a:args
+ call add(s:handlers, handler)
+endfunction " }}}2
+
+" try to find library with 'pkg-config'
+" search possible libraries from first to last given
+" argument until one is found
+function! s:_checkPackage(name, ...) abort " {{{2
+ if executable('pkg-config')
+ if !has_key(s:cflags, a:name)
+ for pkg in a:000
+ let pkg_flags = syntastic#util#system('pkg-config --cflags ' . pkg)
+ " since we cannot necessarily trust the pkg-config exit code
+ " we have to check for an error output as well
+ if v:shell_error == 0 && pkg_flags !~? 'not found'
+ let pkg_flags = ' ' . substitute(pkg_flags, "\n", '', '')
+ let s:cflags[a:name] = pkg_flags
+ return pkg_flags
+ endif
+ endfor
+ else
+ return s:cflags[a:name]
+ endif
+ endif
+ return ''
+endfunction " }}}2
+
+" try to find PHP includes with 'php-config'
+function! s:_checkPhp() abort " {{{2
+ if executable('php-config')
+ if !has_key(s:cflags, 'php')
+ let s:cflags['php'] = syntastic#util#system('php-config --includes')
+ let s:cflags['php'] = ' ' . substitute(s:cflags['php'], "\n", '', '')
+ endif
+ return s:cflags['php']
+ endif
+ return ''
+endfunction " }}}2
+
+" try to find the python headers with distutils
+function! s:_checkPython() abort " {{{2
+ if executable('python')
+ if !has_key(s:cflags, 'python')
+ let s:cflags['python'] = syntastic#util#system('python -c ''from distutils import ' .
+ \ 'sysconfig; import sys; sys.stdout.write(sysconfig.get_python_inc())''')
+ let s:cflags['python'] = substitute(s:cflags['python'], "\n", '', '')
+ let s:cflags['python'] = ' -I' . s:cflags['python']
+ endif
+ return s:cflags['python']
+ endif
+ return ''
+endfunction " }}}2
+
+" try to find the ruby headers with 'rbconfig'
+function! s:_checkRuby() abort " {{{2
+ if executable('ruby')
+ if !has_key(s:cflags, 'ruby')
+ let s:cflags['ruby'] = syntastic#util#system('ruby -r rbconfig -e ' .
+ \ '''puts RbConfig::CONFIG["rubyhdrdir"] || RbConfig::CONFIG["archdir"]''')
+ let s:cflags['ruby'] = substitute(s:cflags['ruby'], "\n", '', '')
+ let s:cflags['ruby'] = ' -I' . s:cflags['ruby']
+ endif
+ return s:cflags['ruby']
+ endif
+ return ''
+endfunction " }}}2
+
+" }}}1
+
+" Utilities {{{1
+
+" resolve checker-related user variables
+function! s:_get_checker_var(scope, filetype, subchecker, name, default) abort " {{{2
+ let prefix = a:scope . ':' . 'syntastic_'
+ if exists(prefix . a:filetype . '_' . a:subchecker . '_' . a:name)
+ return {a:scope}:syntastic_{a:filetype}_{a:subchecker}_{a:name}
+ elseif exists(prefix . a:filetype . '_' . a:name)
+ return {a:scope}:syntastic_{a:filetype}_{a:name}
+ else
+ return a:default
+ endif
+endfunction " }}}2
+
+" resolve user CFLAGS
+function! s:_get_cflags(ft, ck, opts) abort " {{{2
+ " determine whether to parse header files as well
+ if has_key(a:opts, 'header_names') && expand('%', 1) =~? a:opts['header_names']
+ if s:_get_checker_var('g', a:ft, a:ck, 'check_header', 0)
+ let flags = get(a:opts, 'header_flags', '') . ' -c ' . syntastic#c#NullOutput()
+ else
+ " checking headers when check_header is unset: bail out
+ throw 'Syntastic: skip checks'
+ endif
+ else
+ let flags = get(a:opts, 'main_flags', '')
+ endif
+
+ let flags .= ' ' . s:_get_checker_var('g', a:ft, a:ck, 'compiler_options', '') . ' ' . s:_get_include_dirs(a:ft)
+
+ " check if the user manually set some cflags
+ let b_cflags = s:_get_checker_var('b', a:ft, a:ck, 'cflags', '')
+ if b_cflags !=# ''
+ let flags .= ' ' . b_cflags
+ endif
+
+ " add optional config file parameters
+ let config_file = s:_get_checker_var('g', a:ft, a:ck, 'config_file', '.syntastic_' . a:ft . '_config')
+ let flags .= ' ' . syntastic#c#ReadConfig(config_file)
+
+ if b_cflags ==# '' && (a:ft ==# 'c' || a:ft ==# 'cpp') && !s:_get_checker_var('g', a:ft, a:ck, 'no_include_search', 0)
+ " refresh the include file search if desired
+ if s:_get_checker_var('g', a:ft, a:ck, 'auto_refresh_includes', 0)
+ let flags .= ' ' . s:_search_headers()
+ else
+ " search for header includes if not cached already
+ if !exists('b:syntastic_' . a:ft . '_includes')
+ let b:syntastic_{a:ft}_includes = s:_search_headers()
+ endif
+ let flags .= ' ' . b:syntastic_{a:ft}_includes
+ endif
+ endif
+
+ return flags
+endfunction " }}}2
+
+" get the gcc include directory argument depending on the default
+" includes and the optional user-defined 'g:syntastic_c_include_dirs'
+function! s:_get_include_dirs(filetype) abort " {{{2
+ let include_dirs = []
+
+ if a:filetype =~# '\v^%(c|cpp|objc|objcpp)$' &&
+ \ (!exists('g:syntastic_'.a:filetype.'_no_default_include_dirs') ||
+ \ !g:syntastic_{a:filetype}_no_default_include_dirs)
+ let include_dirs = copy(s:default_includes)
+ endif
+
+ if exists('g:syntastic_'.a:filetype.'_include_dirs')
+ call extend(include_dirs, g:syntastic_{a:filetype}_include_dirs)
+ endif
+
+ return join(map(syntastic#util#unique(include_dirs), 'syntastic#util#shescape("-I" . v:val)'))
+endfunction " }}}2
+
+" search the first 100 lines for include statements that are
+" given in the handlers dictionary
+function! s:_search_headers() abort " {{{2
+ let includes = ''
+ let files = []
+ let found = []
+ let lines = filter(getline(1, 100), 'v:val =~# ''\m^\s*#\s*include''')
+
+ " search current buffer
+ for line in lines
+ let file = matchstr(line, '\m"\zs\S\+\ze"')
+ if file !=# ''
+ call add(files, file)
+ continue
+ endif
+
+ for handler in s:handlers
+ if line =~# handler['regex']
+ let includes .= call(handler['func'], handler['args'])
+ call add(found, handler['regex'])
+ break
+ endif
+ endfor
+ endfor
+
+ " search included headers
+ for hfile in files
+ if hfile !=# ''
+ let filename = expand('%:p:h', 1) . syntastic#util#Slash() . hfile
+
+ try
+ let lines = readfile(filename, '', 100)
+ catch /\m^Vim\%((\a\+)\)\=:E484/
+ continue
+ endtry
+
+ call filter(lines, 'v:val =~# ''\m^\s*#\s*include''')
+
+ for handler in s:handlers
+ if index(found, handler['regex']) != -1
+ continue
+ endif
+
+ for line in lines
+ if line =~# handler['regex']
+ let includes .= call(handler['func'], handler['args'])
+ call add(found, handler['regex'])
+ break
+ endif
+ endfor
+ endfor
+ endif
+ endfor
+
+ return includes
+endfunction " }}}2
+
+" }}}1
+
+" default include directories
+let s:default_includes = [
+ \ '.',
+ \ '..',
+ \ 'include',
+ \ 'includes',
+ \ '..' . syntastic#util#Slash() . 'include',
+ \ '..' . syntastic#util#Slash() . 'includes' ]
+
+call s:_init()
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/autoload/syntastic/log.vim b/vim/bundle/syntastic/autoload/syntastic/log.vim
new file mode 100644
index 0000000..5ad562d
--- /dev/null
+++ b/vim/bundle/syntastic/autoload/syntastic/log.vim
@@ -0,0 +1,222 @@
+if exists('g:loaded_syntastic_log_autoload') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_log_autoload = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+let s:one_time_notices_issued = []
+
+" Public functions {{{1
+
+function! syntastic#log#info(msg) abort " {{{2
+ echomsg 'syntastic: info: ' . a:msg
+endfunction " }}}2
+
+function! syntastic#log#warn(msg) abort " {{{2
+ echohl WarningMsg
+ echomsg 'syntastic: warning: ' . a:msg
+ echohl None
+endfunction " }}}2
+
+function! syntastic#log#error(msg) abort " {{{2
+ execute "normal \<Esc>"
+ echohl ErrorMsg
+ echomsg 'syntastic: error: ' . a:msg
+ echohl None
+endfunction " }}}2
+
+function! syntastic#log#oneTimeWarn(msg) abort " {{{2
+ if index(s:one_time_notices_issued, a:msg) >= 0
+ return
+ endif
+
+ call add(s:one_time_notices_issued, a:msg)
+ call syntastic#log#warn(a:msg)
+endfunction " }}}2
+
+" @vimlint(EVL102, 1, l:OLD_VAR)
+function! syntastic#log#deprecationWarn(old, new, ...) abort " {{{2
+ if exists('g:syntastic_' . a:old) && !exists('g:syntastic_' . a:new)
+ let msg = 'variable g:syntastic_' . a:old . ' is deprecated, please use '
+
+ if a:0
+ let OLD_VAR = g:syntastic_{a:old}
+ try
+ let NEW_VAR = eval(a:1)
+ let msg .= 'in its stead: let g:syntastic_' . a:new . ' = ' . string(NEW_VAR)
+ let g:syntastic_{a:new} = NEW_VAR
+ catch
+ let msg .= 'g:syntastic_' . a:new . ' instead'
+ endtry
+ else
+ let msg .= 'g:syntastic_' . a:new . ' instead'
+ let g:syntastic_{a:new} = g:syntastic_{a:old}
+ endif
+
+ call syntastic#log#oneTimeWarn(msg)
+ endif
+endfunction " }}}2
+" @vimlint(EVL102, 0, l:OLD_VAR)
+
+function! syntastic#log#debug(level, msg, ...) abort " {{{2
+ if !s:_isDebugEnabled(a:level)
+ return
+ endif
+
+ let leader = s:_log_timestamp()
+ call s:_logRedirect(1)
+
+ if a:0 > 0
+ " filter out dictionary functions
+ echomsg leader . a:msg . ' ' .
+ \ strtrans(string(type(a:1) == type({}) || type(a:1) == type([]) ?
+ \ filter(copy(a:1), 'type(v:val) != type(function("tr"))') : a:1))
+ else
+ echomsg leader . a:msg
+ endif
+
+ call s:_logRedirect(0)
+endfunction " }}}2
+
+function! syntastic#log#debugShowOptions(level, names) abort " {{{2
+ if !s:_isDebugEnabled(a:level)
+ return
+ endif
+
+ let leader = s:_log_timestamp()
+ call s:_logRedirect(1)
+
+ let vlist = copy(type(a:names) == type('') ? [a:names] : a:names)
+ let add_shell = index(vlist, 'shell') >= 0 && &shell !=# syntastic#util#var('shell')
+ if !empty(vlist)
+ call map(vlist, "'&' . v:val . ' = ' . strtrans(string(eval('&' . v:val))) . (s:_is_modified(v:val) ? ' (!)' : '')")
+ if add_shell
+ call add(vlist, 'u:shell = ' . strtrans(string(syntastic#util#var('shell'))) . ' (!)')
+ endif
+ echomsg leader . join(vlist, ', ')
+ endif
+ call s:_logRedirect(0)
+endfunction " }}}2
+
+function! syntastic#log#debugShowVariables(level, names) abort " {{{2
+ if !s:_isDebugEnabled(a:level)
+ return
+ endif
+
+ let leader = s:_log_timestamp()
+ call s:_logRedirect(1)
+
+ let vlist = type(a:names) == type('') ? [a:names] : a:names
+ for name in vlist
+ let msg = s:_format_variable(name)
+ if msg !=# ''
+ echomsg leader . msg
+ endif
+ endfor
+
+ call s:_logRedirect(0)
+endfunction " }}}2
+
+function! syntastic#log#debugDump(level) abort " {{{2
+ if !s:_isDebugEnabled(a:level)
+ return
+ endif
+
+ call syntastic#log#debugShowVariables( a:level, sort(keys(g:_SYNTASTIC_DEFAULTS)) )
+endfunction " }}}2
+
+function! syntastic#log#ndebug(level, title, messages) abort " {{{2
+ if s:_isDebugEnabled(a:level)
+ return
+ endif
+
+ call syntastic#log#error(a:title)
+ if type(a:messages) == type([])
+ for msg in a:messages
+ echomsg msg
+ endfor
+ else
+ echomsg a:messages
+ endif
+endfunction " }}}2
+
+" }}}1
+
+" Private functions {{{1
+
+function! s:_isDebugEnabled_smart(level) abort " {{{2
+ return and(g:syntastic_debug, a:level)
+endfunction " }}}2
+
+function! s:_isDebugEnabled_dumb(level) abort " {{{2
+ " poor man's bit test for bit N, assuming a:level == 2**N
+ return (g:syntastic_debug / a:level) % 2
+endfunction " }}}2
+
+let s:_isDebugEnabled = function(exists('*and') ? 's:_isDebugEnabled_smart' : 's:_isDebugEnabled_dumb')
+lockvar s:_isDebugEnabled
+
+function! s:_logRedirect(on) abort " {{{2
+ if exists('g:syntastic_debug_file')
+ if a:on
+ try
+ execute 'redir >> ' . fnameescape(expand(g:syntastic_debug_file, 1))
+ catch /\m^Vim\%((\a\+)\)\=:/
+ silent! redir END
+ unlet g:syntastic_debug_file
+ endtry
+ else
+ silent! redir END
+ endif
+ endif
+endfunction " }}}2
+
+" }}}1
+
+" Utilities {{{1
+
+function! s:_log_timestamp_smart() abort " {{{2
+ return printf('syntastic: %f: ', reltimefloat(reltime(g:_SYNTASTIC_START)))
+endfunction " }}}2
+
+function! s:_log_timestamp_dumb() abort " {{{2
+ return 'syntastic: ' . split(reltimestr(reltime(g:_SYNTASTIC_START)))[0] . ': '
+endfunction " }}}2
+
+let s:_log_timestamp = function(has('float') && exists('*reltimefloat') ? 's:_log_timestamp_smart' : 's:_log_timestamp_dumb')
+lockvar s:_log_timestamp
+
+function! s:_format_variable(name) abort " {{{2
+ let vals = []
+ if exists('g:syntastic_' . a:name)
+ call add(vals, 'g:syntastic_' . a:name . ' = ' . strtrans(string(g:syntastic_{a:name})))
+ endif
+ if exists('b:syntastic_' . a:name)
+ call add(vals, 'b:syntastic_' . a:name . ' = ' . strtrans(string(b:syntastic_{a:name})))
+ endif
+
+ return join(vals, ', ')
+endfunction " }}}2
+
+function! s:_is_modified(name) abort " {{{2
+ if !exists('s:option_defaults')
+ let s:option_defaults = {}
+ endif
+ if !has_key(s:option_defaults, a:name)
+ let opt_save = eval('&' . a:name)
+ execute 'set ' . a:name . '&'
+ let s:option_defaults[a:name] = eval('&' . a:name)
+ execute 'let &' . a:name . ' = ' . string(opt_save)
+ endif
+
+ return s:option_defaults[a:name] !=# eval('&' . a:name)
+endfunction " }}}2
+
+" }}}1
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/autoload/syntastic/postprocess.vim b/vim/bundle/syntastic/autoload/syntastic/postprocess.vim
new file mode 100644
index 0000000..136fa58
--- /dev/null
+++ b/vim/bundle/syntastic/autoload/syntastic/postprocess.vim
@@ -0,0 +1,73 @@
+if exists('g:loaded_syntastic_postprocess_autoload') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_postprocess_autoload = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Public functions {{{1
+
+" merge consecutive blanks
+function! syntastic#postprocess#compressWhitespace(errors) abort " {{{2
+ for e in a:errors
+ let e['text'] = substitute(e['text'], "\001", '', 'g')
+ let e['text'] = substitute(e['text'], '\n', ' ', 'g')
+ let e['text'] = substitute(e['text'], '\m\s\{2,}', ' ', 'g')
+ let e['text'] = substitute(e['text'], '\m^\s\+', '', '')
+ let e['text'] = substitute(e['text'], '\m\s\+$', '', '')
+ endfor
+
+ return a:errors
+endfunction " }}}2
+
+" remove spurious CR under Cygwin
+function! syntastic#postprocess#cygwinRemoveCR(errors) abort " {{{2
+ if has('win32unix')
+ for e in a:errors
+ let e['text'] = substitute(e['text'], '\r', '', 'g')
+ endfor
+ endif
+
+ return a:errors
+endfunction " }}}2
+
+" decode XML entities
+function! syntastic#postprocess#decodeXMLEntities(errors) abort " {{{2
+ for e in a:errors
+ let e['text'] = syntastic#util#decodeXMLEntities(e['text'])
+ endfor
+
+ return a:errors
+endfunction " }}}2
+
+" filter out errors referencing other files
+function! syntastic#postprocess#filterForeignErrors(errors) abort " {{{2
+ return filter(copy(a:errors), 'get(v:val, "bufnr") == ' . bufnr(''))
+endfunction " }}}2
+
+" make sure line numbers are not past end of buffers
+" XXX: this loads all referenced buffers in memory
+function! syntastic#postprocess#guards(errors) abort " {{{2
+ let buffers = syntastic#util#unique(map(filter(copy(a:errors), 'v:val["valid"]'), 'str2nr(v:val["bufnr"])'))
+
+ let guards = {}
+ for b in buffers
+ let guards[b] = len(getbufline(b, 1, '$'))
+ endfor
+
+ for e in a:errors
+ if e['valid'] && e['lnum'] > guards[e['bufnr']]
+ let e['lnum'] = guards[e['bufnr']]
+ endif
+ endfor
+
+ return a:errors
+endfunction " }}}2
+
+" }}}1
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/autoload/syntastic/preprocess.vim b/vim/bundle/syntastic/autoload/syntastic/preprocess.vim
new file mode 100644
index 0000000..cbab6fd
--- /dev/null
+++ b/vim/bundle/syntastic/autoload/syntastic/preprocess.vim
@@ -0,0 +1,614 @@
+if exists('g:loaded_syntastic_preprocess_autoload') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_preprocess_autoload = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Public functions {{{1
+
+function! syntastic#preprocess#cabal(errors) abort " {{{2
+ let out = []
+ let star = 0
+ for err in a:errors
+ if star
+ if err ==# ''
+ let star = 0
+ else
+ let out[-1] .= ' ' . err
+ endif
+ else
+ call add(out, err)
+ if err =~# '\m^*\s'
+ let star = 1
+ endif
+ endif
+ endfor
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#checkstyle(errors) abort " {{{2
+ let out = []
+ let fname = expand('%', 1)
+ for err in a:errors
+ if match(err, '\m<error\>') > -1
+ let line = str2nr(matchstr(err, '\m\<line="\zs\d\+\ze"'))
+ if line == 0
+ continue
+ endif
+
+ let col = str2nr(matchstr(err, '\m\<column="\zs\d\+\ze"'))
+
+ let type = matchstr(err, '\m\<severity="\zs.\ze')
+ if type !~? '^[EW]'
+ let type = 'E'
+ endif
+
+ let message = syntastic#util#decodeXMLEntities(matchstr(err, '\m\<message="\zs[^"]\+\ze"'))
+
+ call add(out, join([fname, type, line, col, message], ':'))
+ elseif match(err, '\m<file name="') > -1
+ let fname = syntastic#util#decodeXMLEntities(matchstr(err, '\v\<file name\="\zs[^"]+\ze"'))
+ endif
+ endfor
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#cppcheck(errors) abort " {{{2
+ return map(copy(a:errors), 'substitute(v:val, ''\v^\[[^]]+\]\zs( -\> \[[^]]+\])+\ze:'', "", "")')
+endfunction " }}}2
+
+function! syntastic#preprocess#dockerfile_lint(errors) abort " {{{2
+ let out = []
+ let json = s:_decode_JSON(join(a:errors, ''))
+
+ if type(json) == type({})
+ try
+ let data = json['error']['data'] + json['warn']['data'] + json['info']['data']
+ for e in data
+ let type = toupper(e['level'][0])
+ if type ==# 'I'
+ let type = 'W'
+ let style = 1
+ else
+ let style = 0
+ endif
+
+ let line = get(e, 'line', 1)
+ let message = e['message']
+ if has_key(e, 'description') && e['description'] !=# 'None'
+ let message = message . '. ' . e['description']
+ endif
+
+ let msg =
+ \ type . ':' .
+ \ style . ':' .
+ \ line . ':' .
+ \ message
+ call add(out, msg)
+ endfor
+ catch /\m^Vim\%((\a\+)\)\=:E716/
+ call syntastic#log#warn('checker dockerfile/dockerfile_lint: unrecognized error format')
+ let out = []
+ endtry
+ else
+ call syntastic#log#warn('checker dockerfile/dockerfile_lint: unrecognized error format')
+ endif
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#flow(errors) abort " {{{2
+ let idx = 0
+ while idx < len(a:errors) && a:errors[idx][0] !=# '{'
+ let idx += 1
+ endwhile
+ let errs = s:_decode_JSON(join(a:errors[idx :], ''))
+
+ let out = []
+ if type(errs) == type({}) && has_key(errs, 'errors') && type(errs['errors']) == type([])
+ for e in errs['errors']
+ if type(e) == type({}) && has_key(e, 'message') && type(e['message']) == type([]) && len(e['message'])
+ let m = e['message'][0]
+ let t = e['message'][1:]
+
+ try
+ let msg =
+ \ m['path'] . ':' .
+ \ m['line'] . ':' .
+ \ m['start'] . ':' .
+ \ (m['line'] ==# m['endline'] && str2nr(m['end']) > 0 ? m['end'] . ':' : '') .
+ \ ' ' . m['descr']
+
+ if len(t)
+ let msg .= ' ' . join(map(t,
+ \ 'v:val["descr"] . " (" . v:val["path"] . ":" . v:val["line"] . ":" . v:val["start"] . ' .
+ \ '"," . (v:val["line"] !=# v:val["endline"] ? v:val["endline"] . ":" : "") . ' .
+ \ 'v:val["end"] . ")"'))
+ endif
+
+ let msg = substitute(msg, '\r', '', 'g')
+ let msg = substitute(msg, '\n', ' ', 'g')
+
+ call add(out, msg)
+ catch /\m^Vim\%((\a\+)\)\=:E716/
+ call syntastic#log#warn('checker javascript/flow: unrecognized error format')
+ let out = []
+ break
+ endtry
+ else
+ call syntastic#log#warn('checker javascript/flow: unrecognized error format')
+ let out = []
+ break
+ endif
+ endfor
+ else
+ call syntastic#log#warn('checker javascript/flow: unrecognized error format')
+ endif
+
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#iconv(errors) abort " {{{2
+ return
+ \ has('iconv') && &encoding !=# '' && &encoding !=# 'utf-8' ?
+ \ map(a:errors, 'iconv(v:val, "utf-8", &encoding)') :
+ \ a:errors
+endfunction " }}}2
+
+function! syntastic#preprocess#jscs(errors) abort " {{{2
+ let errs = join(a:errors, '')
+ if errs ==# ''
+ return []
+ endif
+
+ let json = s:_decode_JSON(errs)
+
+ let out = []
+ if type(json) == type({})
+ for fname in keys(json)
+ if type(json[fname]) == type([])
+ for e in json[fname]
+ try
+ let e['message'] = substitute(e['message'], "\n", ' ', 'g')
+ cal add(out, fname . ':' . e['line'] . ':' . e['column'] . ':' . e['message'])
+ catch /\m^Vim\%((\a\+)\)\=:E716/
+ call syntastic#log#warn('checker javascript/jscs: unrecognized error item ' . string(e))
+ let out = []
+ endtry
+ endfor
+ else
+ call syntastic#log#warn('checker javascript/jscs: unrecognized error format')
+ endif
+ endfor
+ else
+ call syntastic#log#warn('checker javascript/jscs: unrecognized error format')
+ endif
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#killEmpty(errors) abort " {{{2
+ return filter(copy(a:errors), 'v:val !=# ""')
+endfunction " }}}2
+
+function! syntastic#preprocess#perl(errors) abort " {{{2
+ let out = []
+
+ for e in a:errors
+ let parts = matchlist(e, '\v^(.*)\sat\s(.{-})\sline\s(\d+)(.*)$')
+ if !empty(parts)
+ call add(out, parts[2] . ':' . parts[3] . ':' . parts[1] . parts[4])
+ endif
+ endfor
+
+ return syntastic#util#unique(out)
+endfunction " }}}2
+
+function! syntastic#preprocess#prospector(errors) abort " {{{2
+ let errs = s:_decode_JSON(join(a:errors, ''))
+
+ let out = []
+ if type(errs) == type({}) && has_key(errs, 'messages')
+ if type(errs['messages']) == type([])
+ for e in errs['messages']
+ if type(e) == type({})
+ try
+ if e['source'] ==# 'pylint'
+ let e['location']['character'] += 1
+ endif
+
+ let msg =
+ \ e['location']['path'] . ':' .
+ \ e['location']['line'] . ':' .
+ \ e['location']['character'] . ': ' .
+ \ e['code'] . ' ' .
+ \ e['message'] . ' ' .
+ \ '[' . e['source'] . ']'
+
+ call add(out, msg)
+ catch /\m^Vim\%((\a\+)\)\=:E716/
+ call syntastic#log#warn('checker python/prospector: unrecognized error item ' . string(e))
+ let out = []
+ break
+ endtry
+ else
+ call syntastic#log#warn('checker python/prospector: unrecognized error item ' . string(e))
+ let out = []
+ break
+ endif
+ endfor
+ else
+ call syntastic#log#warn('checker python/prospector: unrecognized error format')
+ endif
+ endif
+
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#rparse(errors) abort " {{{2
+ let errlist = copy(a:errors)
+
+ " remove uninteresting lines and handle continuations
+ let i = 0
+ while i < len(errlist)
+ if i > 0 && errlist[i][:1] ==# ' ' && errlist[i] !~# '\m\s\+\^$'
+ let errlist[i-1] .= errlist[i][1:]
+ call remove(errlist, i)
+ elseif errlist[i] !~# '\m^\(Lint:\|Lint checking:\|Error in\) '
+ call remove(errlist, i)
+ else
+ let i += 1
+ endif
+ endwhile
+
+ let out = []
+ let fname = ''
+ for e in errlist
+ if match(e, '\m^Lint: ') == 0
+ let parts = matchlist(e, '\m^Lint: \(.*\): found on lines \([0-9, ]\+\)\(+\(\d\+\) more\)\=')
+ if len(parts) >= 3
+ for line in split(parts[2], '\m,\s*')
+ call add(out, 'E:' . fname . ':' . line . ': ' . parts[1])
+ endfor
+ endif
+ if len(parts) >= 5 && parts[4] !=# ''
+ call add(out, 'E:' . fname . ':0: ' . parts[1] . ' - ' . parts[4] . ' messages not shown')
+ endif
+ elseif match(e, '\m^Lint checking: ') == 0
+ let fname = matchstr(e, '\m^Lint checking: \zs.*')
+ elseif match(e, '\m^Error in ') == 0
+ call add(out, substitute(e, '\m^Error in .\+ : .\+\ze:\d\+:\d\+: ', 'E:' . fname, ''))
+ endif
+ endfor
+
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#scss_lint(errors) abort " {{{2
+ let errs = join(a:errors, '')
+ if errs ==# ''
+ return []
+ endif
+
+ let json = s:_decode_JSON(errs)
+
+ let out = []
+ if type(json) == type({})
+ for fname in keys(json)
+ if type(json[fname]) == type([])
+ for e in json[fname]
+ try
+ cal add(out, fname . ':' .
+ \ e['severity'][0] . ':' .
+ \ e['line'] . ':' .
+ \ e['column'] . ':' .
+ \ e['length'] . ':' .
+ \ ( has_key(e, 'linter') ? e['linter'] . ': ' : '' ) .
+ \ e['reason'])
+ catch /\m^Vim\%((\a\+)\)\=:E716/
+ call syntastic#log#warn('checker scss/scss_lint: unrecognized error item ' . string(e))
+ let out = []
+ endtry
+ endfor
+ else
+ call syntastic#log#warn('checker scss/scss_lint: unrecognized error format')
+ endif
+ endfor
+ else
+ call syntastic#log#warn('checker scss/scss_lint: unrecognized error format')
+ endif
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#stylelint(errors) abort " {{{2
+ let out = []
+
+ " CssSyntaxError: /path/to/file.css:2:11: Missed semicolon
+ let parts = matchlist(a:errors[0], '\v^CssSyntaxError: (.{-1,}):(\d+):(\d+): (.+)')
+ if len(parts) > 4
+ call add(out, 'E:' . join(parts[1:4], ':'))
+ else
+ let errs = s:_decode_JSON(join(a:errors, ''))
+
+ let out = []
+ if type(errs) == type([]) && len(errs) == 1 && type(errs[0]) == type({}) &&
+ \ has_key(errs[0], 'source') && has_key(errs[0], 'warnings') && type(errs[0]['warnings']) == type([])
+
+ for e in errs[0]['warnings']
+ try
+ let severity = type(e['severity']) == type(0) ? ['W', 'E'][e['severity']-1] : e['severity'][0]
+ let msg =
+ \ severity . ':' .
+ \ errs[0]['source'] . ':' .
+ \ e['line'] . ':' .
+ \ e['column'] . ':' .
+ \ e['text']
+ call add(out, msg)
+ catch /\m^Vim\%((\a\+)\)\=:E716/
+ call syntastic#log#warn('checker css/stylelint: unrecognized error item ' . string(e))
+ let out = []
+ break
+ endtry
+ endfor
+ else
+ call syntastic#log#warn('checker css/stylelint: unrecognized error format')
+ endif
+ endif
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#tern_lint(errors) abort " {{{2
+ let errs = join(a:errors, '')
+ let json = s:_decode_JSON(errs)
+
+echomsg string(json)
+ let out = []
+ if type(json) == type({}) && has_key(json, 'messages') && type(json['messages']) == type([])
+ for e in json['messages']
+ try
+ let line_from = byte2line(e['from'] + 1)
+ if line_from > 0
+ let line = line_from
+ let column = e['from'] - line2byte(line_from) + 2
+ let line_to = byte2line(e['from'] + 1)
+ let hl = line_to == line ? e['to'] - line2byte(line_to) + 1 : 0
+ else
+ let line = 0
+ let column = 0
+ let hl = 0
+ endif
+
+ if column < 0
+ let column = 0
+ endif
+ if hl < 0
+ let hl = 0
+ endif
+
+ call add(out,
+ \ e['file'] . ':' .
+ \ e['severity'][0] . ':' .
+ \ line . ':' .
+ \ column . ':' .
+ \ hl . ':' .
+ \ e['message'])
+ catch /\m^Vim\%((\a\+)\)\=:E716/
+ call syntastic#log#warn('checker javascript/tern_lint: unrecognized error item ' . string(e))
+ let out = []
+ endtry
+ endfor
+ else
+ call syntastic#log#warn('checker javascript/tern_lint: unrecognized error format')
+ endif
+
+echomsg string(out)
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#tslint(errors) abort " {{{2
+ return map(copy(a:errors), 'substitute(v:val, ''\m^\(([^)]\+)\)\s\(.\+\)$'', ''\2 \1'', "")')
+endfunction " }}}2
+
+function! syntastic#preprocess#validator(errors) abort " {{{2
+ let out = []
+ for e in a:errors
+ let parts = matchlist(e, '\v^"([^"]+)"(.+)')
+ if len(parts) >= 3
+ " URL decode, except leave alone any "+"
+ let parts[1] = substitute(parts[1], '\m%\(\x\x\)', '\=nr2char("0x".submatch(1))', 'g')
+ let parts[1] = substitute(parts[1], '\m\\"', '"', 'g')
+ let parts[1] = substitute(parts[1], '\m\\\\', '\\', 'g')
+ call add(out, '"' . parts[1] . '"' . parts[2])
+ endif
+ endfor
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#vint(errors) abort " {{{2
+ let errs = s:_decode_JSON(join(a:errors, ''))
+
+ let out = []
+ if type(errs) == type([])
+ for e in errs
+ if type(e) == type({})
+ try
+ let msg =
+ \ e['file_path'] . ':' .
+ \ e['line_number'] . ':' .
+ \ e['column_number'] . ':' .
+ \ e['severity'][0] . ': ' .
+ \ e['description'] . ' (' .
+ \ e['policy_name'] . ')'
+
+ call add(out, msg)
+ catch /\m^Vim\%((\a\+)\)\=:E716/
+ call syntastic#log#warn('checker vim/vint: unrecognized error item ' . string(e))
+ let out = []
+ break
+ endtry
+ else
+ call syntastic#log#warn('checker vim/vint: unrecognized error item ' . string(e))
+ let out = []
+ break
+ endif
+ endfor
+ else
+ call syntastic#log#warn('checker vim/vint: unrecognized error format')
+ endif
+
+ return out
+endfunction " }}}2
+
+" }}}1
+
+" Workarounds {{{1
+
+" In errorformat, \ or % following %f make it depend on isfname. The default
+" setting of isfname is crafted to work with completion, rather than general
+" filename matching. The result for syntastic is that filenames containing
+" spaces (or a few other special characters) can't be matched.
+"
+" Fixing isfname to address this problem would depend on the set of legal
+" characters for filenames on the filesystem the project's files lives on.
+" Inferring the kind of filesystem a file lives on, in advance to parsing the
+" file's name, is an interesting problem (think f.i. a file loaded from a VFAT
+" partition, mounted on Linux). A problem syntastic is not prepared to solve.
+"
+" As a result, the functions below exist for the only reason to avoid using
+" things like %f\, in errorformat.
+"
+" References:
+" https://groups.google.com/forum/#!topic/vim_dev/pTKmZmouhio
+" https://vimhelp.appspot.com/quickfix.txt.html#error-file-format
+
+function! syntastic#preprocess#basex(errors) abort " {{{2
+ let out = []
+ let idx = 0
+ while idx < len(a:errors)
+ let parts = matchlist(a:errors[idx], '\v^\[\S+\] Stopped at (.+), (\d+)/(\d+):')
+ if len(parts) > 3
+ let err = parts[1] . ':' . parts[2] . ':' . parts[3] . ':'
+ let parts = matchlist(a:errors[idx+1], '\v^\[(.)\D+(\d+)\] (.+)')
+ if len(parts) > 3
+ let err .= (parts[1] ==? 'W' || parts[1] ==? 'E' ? parts[1] : 'E') . ':' . parts[2] . ':' . parts[3]
+ call add(out, err)
+ let idx +=1
+ endif
+ elseif a:errors[idx] =~# '\m^\['
+ " unparseable errors
+ call add(out, a:errors[idx])
+ endif
+ let idx +=1
+ endwhile
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#bro(errors) abort " {{{2
+ let out = []
+ for e in a:errors
+ let parts = matchlist(e, '\v^%(fatal )?(error|warning) in (.{-1,}), line (\d+): (.+)')
+ if len(parts) > 4
+ let parts[1] = parts[1][0]
+ call add(out, join(parts[1:4], ':'))
+ endif
+ endfor
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#coffeelint(errors) abort " {{{2
+ let out = []
+ for e in a:errors
+ let parts = matchlist(e, '\v^(.{-1,}),(\d+)%(,\d*)?,(error|warn),(.+)')
+ if len(parts) > 4
+ let parts[3] = parts[3][0]
+ call add(out, join(parts[1:4], ':'))
+ endif
+ endfor
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#mypy(errors) abort " {{{2
+ let out = []
+ for e in a:errors
+ " new format
+ let parts = matchlist(e, '\v^(.{-1,}):(\d+): error: (.+)')
+ if len(parts) > 3
+ call add(out, join(parts[1:3], ':'))
+ continue
+ endif
+
+ " old format
+ let parts = matchlist(e, '\v^(.{-1,}), line (\d+): (.+)')
+ if len(parts) > 3
+ call add(out, join(parts[1:3], ':'))
+ endif
+ endfor
+ return out
+endfunction " }}}2
+
+function! syntastic#preprocess#nix(errors) abort " {{{2
+ let out = []
+ for e in a:errors
+ let parts = matchlist(e, '\v^(.{-1,}), at (.{-1,}):(\d+):(\d+)$')
+ if len(parts) > 4
+ call add(out, join(parts[2:4], ':') . ':' . parts[1])
+ continue
+ endif
+
+ let parts = matchlist(e, '\v^(.{-1,}) at (.{-1,}), line (\d+):')
+ if len(parts) > 3
+ call add(out, parts[2] . ':' . parts[3] . ':' . parts[1])
+ continue
+ endif
+
+ let parts = matchlist(e, '\v^error: (.{-1,}), in (.{-1,})$')
+ if len(parts) > 2
+ call add(out, parts[2] . ':' . parts[1])
+ endif
+ endfor
+ return out
+endfunction " }}}2
+
+" }}}1
+
+" Private functions {{{1
+
+" @vimlint(EVL102, 1, l:true)
+" @vimlint(EVL102, 1, l:false)
+" @vimlint(EVL102, 1, l:null)
+function! s:_decode_JSON(json) abort " {{{2
+ if a:json ==# ''
+ return []
+ endif
+
+ " The following is inspired by https://github.com/MarcWeber/vim-addon-manager and
+ " http://stackoverflow.com/questions/17751186/iterating-over-a-string-in-vimscript-or-parse-a-json-file/19105763#19105763
+ " A hat tip to Marc Weber for this trick
+ if substitute(a:json, '\v\"%(\\.|[^"\\])*\"|true|false|null|[+-]?\d+%(\.\d+%([Ee][+-]?\d+)?)?', '', 'g') !~# "[^,:{}[\\] \t]"
+ " JSON artifacts
+ let true = 1
+ let false = 0
+ let null = ''
+
+ try
+ let object = eval(a:json)
+ catch
+ " malformed JSON
+ let object = ''
+ endtry
+ else
+ let object = ''
+ endif
+
+ return object
+endfunction " }}}2
+" @vimlint(EVL102, 0, l:true)
+" @vimlint(EVL102, 0, l:false)
+" @vimlint(EVL102, 0, l:null)
+
+" }}}1
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/autoload/syntastic/util.vim b/vim/bundle/syntastic/autoload/syntastic/util.vim
new file mode 100644
index 0000000..68eb06e
--- /dev/null
+++ b/vim/bundle/syntastic/autoload/syntastic/util.vim
@@ -0,0 +1,552 @@
+if exists('g:loaded_syntastic_util_autoload') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_util_autoload = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Public functions {{{1
+
+function! syntastic#util#isRunningWindows() abort " {{{2
+ return has('win16') || has('win32') || has('win64')
+endfunction " }}}2
+
+function! syntastic#util#DevNull() abort " {{{2
+ if syntastic#util#isRunningWindows()
+ return 'NUL'
+ endif
+ return '/dev/null'
+endfunction " }}}2
+
+" Get directory separator
+function! syntastic#util#Slash() abort " {{{2
+ return (!exists('+shellslash') || &shellslash) ? '/' : '\'
+endfunction " }}}2
+
+function! syntastic#util#CygwinPath(path) abort " {{{2
+ return substitute(syntastic#util#system('cygpath -m ' . syntastic#util#shescape(a:path)), "\n", '', 'g')
+endfunction " }}}2
+
+function! syntastic#util#system(command) abort " {{{2
+ let old_shell = &shell
+ let old_lc_messages = $LC_MESSAGES
+ let old_lc_all = $LC_ALL
+
+ let &shell = syntastic#util#var('shell')
+ let $LC_MESSAGES = 'C'
+ let $LC_ALL = ''
+
+ let cmd_start = reltime()
+ let out = system(a:command)
+ let cmd_time = split(reltimestr(reltime(cmd_start)))[0]
+
+ let $LC_ALL = old_lc_all
+ let $LC_MESSAGES = old_lc_messages
+
+ let &shell = old_shell
+
+ if exists('g:_SYNTASTIC_DEBUG_TRACE')
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'system: command run in ' . cmd_time . 's')
+ endif
+
+ return out
+endfunction " }}}2
+
+" Create a temporary directory
+function! syntastic#util#tmpdir() abort " {{{2
+ let tempdir = ''
+
+ if (has('unix') || has('mac')) && executable('mktemp') && !has('win32unix')
+ " TODO: option "-t" to mktemp(1) is not portable
+ let tmp = $TMPDIR !=# '' ? $TMPDIR : $TMP !=# '' ? $TMP : '/tmp'
+ let out = split(syntastic#util#system('mktemp -q -d ' . tmp . '/vim-syntastic-' . getpid() . '-XXXXXXXX'), "\n")
+ if v:shell_error == 0 && len(out) == 1
+ let tempdir = out[0]
+ endif
+ endif
+
+ if tempdir ==# ''
+ if has('win32') || has('win64')
+ let tempdir = $TEMP . syntastic#util#Slash() . 'vim-syntastic-' . getpid()
+ elseif has('win32unix')
+ let tempdir = syntastic#util#CygwinPath('/tmp/vim-syntastic-' . getpid())
+ elseif $TMPDIR !=# ''
+ let tempdir = $TMPDIR . '/vim-syntastic-' . getpid()
+ else
+ let tempdir = '/tmp/vim-syntastic-' . getpid()
+ endif
+
+ try
+ call mkdir(tempdir, 'p', 0700)
+ catch /\m^Vim\%((\a\+)\)\=:E739/
+ call syntastic#log#error(v:exception)
+ let tempdir = '.'
+ endtry
+ endif
+
+ return tempdir
+endfunction " }}}2
+
+" Recursively remove a directory
+function! syntastic#util#rmrf(what) abort " {{{2
+ " try to make sure we don't delete directories we didn't create
+ if a:what !~? 'vim-syntastic-'
+ return
+ endif
+
+ if getftype(a:what) ==# 'dir'
+ call s:_delete(a:what, 'rf')
+ else
+ silent! call delete(a:what)
+ endif
+endfunction " }}}2
+
+" Search the first 5 lines of the file for a magic number and return a map
+" containing the args and the executable
+"
+" e.g.
+"
+" #!/usr/bin/perl -f -bar
+"
+" returns
+"
+" {'exe': '/usr/bin/perl', 'args': ['-f', '-bar']}
+function! syntastic#util#parseShebang() abort " {{{2
+ for lnum in range(1, 5)
+ let line = getline(lnum)
+ if line =~# '^#!'
+ let line = substitute(line, '\v^#!\s*(\S+/env(\s+-\S+)*\s+)?', '', '')
+ let exe = matchstr(line, '\m^\S*\ze')
+ let args = split(matchstr(line, '\m^\S*\zs.*'))
+ return { 'exe': exe, 'args': args }
+ endif
+ endfor
+
+ return { 'exe': '', 'args': [] }
+endfunction " }}}2
+
+" Get the value of a Vim variable. Allow local variables to override global ones.
+function! syntastic#util#rawVar(name, ...) abort " {{{2
+ return get(b:, a:name, get(g:, a:name, a:0 > 0 ? a:1 : ''))
+endfunction " }}}2
+
+" Get the value of a syntastic variable. Allow local variables to override global ones.
+function! syntastic#util#var(name, ...) abort " {{{2
+ return call('syntastic#util#rawVar', ['syntastic_' . a:name] + a:000)
+endfunction " }}}2
+
+" Parse a version string. Return an array of version components.
+function! syntastic#util#parseVersion(version, ...) abort " {{{2
+ return map(split(matchstr( a:version, a:0 ? a:1 : '\v^\D*\zs\d+(\.\d+)+\ze' ), '\m\.'), 'str2nr(v:val)')
+endfunction " }}}2
+
+" Verify that the 'installed' version is at least the 'required' version.
+"
+" 'installed' and 'required' must be arrays. If they have different lengths,
+" the "missing" elements will be assumed to be 0 for the purposes of checking.
+"
+" See http://semver.org for info about version numbers.
+function! syntastic#util#versionIsAtLeast(installed, required) abort " {{{2
+ return syntastic#util#compareLexi(a:installed, a:required) >= 0
+endfunction " }}}2
+
+" Almost lexicographic comparison of two lists of integers. :) If lists
+" have different lengths, the "missing" elements are assumed to be 0.
+function! syntastic#util#compareLexi(a, b) abort " {{{2
+ for idx in range(max([len(a:a), len(a:b)]))
+ let a_element = str2nr(get(a:a, idx, 0))
+ let b_element = str2nr(get(a:b, idx, 0))
+ if a_element != b_element
+ return a_element > b_element ? 1 : -1
+ endif
+ endfor
+ " still here, thus everything matched
+ return 0
+endfunction " }}}2
+
+" strwidth() was added in Vim 7.3; if it doesn't exist, we use strlen()
+" and hope for the best :)
+let s:_width = function(exists('*strwidth') ? 'strwidth' : 'strlen')
+lockvar s:_width
+
+function! syntastic#util#screenWidth(str, tabstop) abort " {{{2
+ let chunks = split(a:str, "\t", 1)
+ let width = s:_width(chunks[-1])
+ for c in chunks[:-2]
+ let cwidth = s:_width(c)
+ let width += cwidth + a:tabstop - cwidth % a:tabstop
+ endfor
+ return width
+endfunction " }}}2
+
+" Print as much of a:msg as possible without "Press Enter" prompt appearing
+function! syntastic#util#wideMsg(msg) abort " {{{2
+ let old_ruler = &ruler
+ let old_showcmd = &showcmd
+
+ "This is here because it is possible for some error messages to
+ "begin with \n which will cause a "press enter" prompt.
+ let msg = substitute(a:msg, "\n", '', 'g')
+
+ "convert tabs to spaces so that the tabs count towards the window
+ "width as the proper amount of characters
+ let chunks = split(msg, "\t", 1)
+ let msg = join(map(chunks[:-2], 'v:val . repeat(" ", &tabstop - s:_width(v:val) % &tabstop)'), '') . chunks[-1]
+ let msg = strpart(msg, 0, &columns - 1)
+
+ set noruler noshowcmd
+ call syntastic#util#redraw(0)
+
+ echo msg
+
+ let &ruler = old_ruler
+ let &showcmd = old_showcmd
+endfunction " }}}2
+
+" Check whether a buffer is loaded, listed, and not hidden
+function! syntastic#util#bufIsActive(buffer) abort " {{{2
+ " convert to number, or hell breaks loose
+ let buf = str2nr(a:buffer)
+
+ if !bufloaded(buf) || !buflisted(buf)
+ return 0
+ endif
+
+ " get rid of hidden buffers
+ for tab in range(1, tabpagenr('$'))
+ if index(tabpagebuflist(tab), buf) >= 0
+ return 1
+ endif
+ endfor
+
+ return 0
+endfunction " }}}2
+
+" Start in directory a:where and walk up the parent folders until it finds a
+" file named a:what; return path to that file
+function! syntastic#util#findFileInParent(what, where) abort " {{{2
+ let old_suffixesadd = &suffixesadd
+ let &suffixesadd = ''
+ let file = findfile(a:what, escape(a:where, ' ') . ';')
+ let &suffixesadd = old_suffixesadd
+ return file
+endfunction " }}}2
+
+" Start in directory a:where and walk up the parent folders until it finds a
+" file matching a:what; return path to that file
+function! syntastic#util#findGlobInParent(what, where) abort " {{{2
+ let here = fnamemodify(a:where, ':p')
+
+ let root = syntastic#util#Slash()
+ if syntastic#util#isRunningWindows() && here[1] ==# ':'
+ " The drive letter is an ever-green source of fun. That's because
+ " we don't care about running syntastic on Amiga these days. ;)
+ let root = fnamemodify(root, ':p')
+ let root = here[0] . root[1:]
+ endif
+
+ let old = ''
+ while here !=# ''
+ try
+ " Vim 7.4.279 and later
+ let p = globpath(here, a:what, 1, 1)
+ catch /\m^Vim\%((\a\+)\)\=:E118/
+ let p = split(globpath(here, a:what, 1), "\n")
+ endtry
+
+ if !empty(p)
+ return fnamemodify(p[0], ':p')
+ elseif here ==? root || here ==? old
+ break
+ endif
+
+ let old = here
+
+ " we use ':h:h' rather than ':h' since ':p' adds a trailing '/'
+ " if 'here' is a directory
+ let here = fnamemodify(here, ':p:h:h')
+ endwhile
+
+ return ''
+endfunction " }}}2
+
+" Returns unique elements in a list
+function! syntastic#util#unique(list) abort " {{{2
+ let seen = {}
+ let uniques = []
+ for e in a:list
+ let k = string(e)
+ if !has_key(seen, k)
+ let seen[k] = 1
+ call add(uniques, e)
+ endif
+ endfor
+ return uniques
+endfunction " }}}2
+
+" A less noisy shellescape()
+function! syntastic#util#shescape(string) abort " {{{2
+ return a:string =~# '\m^[A-Za-z0-9_/.-]\+$' ? a:string : shellescape(a:string)
+endfunction " }}}2
+
+" A less noisy shellescape(expand())
+function! syntastic#util#shexpand(string, ...) abort " {{{2
+ return syntastic#util#shescape(a:0 ? expand(a:string, a:1) : expand(a:string, 1))
+endfunction " }}}2
+
+" Escape arguments
+function! syntastic#util#argsescape(opt) abort " {{{2
+ if type(a:opt) == type('') && a:opt !=# ''
+ return [a:opt]
+ elseif type(a:opt) == type([])
+ return map(copy(a:opt), 'syntastic#util#shescape(v:val)')
+ endif
+
+ return []
+endfunction " }}}2
+
+" Decode XML entities
+function! syntastic#util#decodeXMLEntities(string) abort " {{{2
+ let str = a:string
+ let str = substitute(str, '\m&lt;', '<', 'g')
+ let str = substitute(str, '\m&gt;', '>', 'g')
+ let str = substitute(str, '\m&quot;', '"', 'g')
+ let str = substitute(str, '\m&apos;', "'", 'g')
+ let str = substitute(str, '\m&amp;', '\&', 'g')
+ return str
+endfunction " }}}2
+
+function! syntastic#util#redraw(full) abort " {{{2
+ if a:full
+ redraw!
+ else
+ redraw
+ endif
+endfunction " }}}2
+
+function! syntastic#util#dictFilter(errors, filter) abort " {{{2
+ let rules = s:_translateFilter(a:filter)
+ " call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, "applying filter:", rules)
+ try
+ call filter(a:errors, rules)
+ catch /\m^Vim\%((\a\+)\)\=:E/
+ let msg = matchstr(v:exception, '\m^Vim\%((\a\+)\)\=:\zs.*')
+ call syntastic#log#error('quiet_messages: ' . msg)
+ endtry
+endfunction " }}}2
+
+" Return a [seconds, fractions] list of strings, representing the
+" (hopefully high resolution) time since program start
+function! syntastic#util#stamp() abort " {{{2
+ return split( split(reltimestr(reltime(g:_SYNTASTIC_START)))[0], '\.' )
+endfunction " }}}2
+
+function! syntastic#util#setChangedtick() abort " {{{2
+ unlockvar! b:syntastic_changedtick
+ let b:syntastic_changedtick = b:changedtick
+ lockvar! b:syntastic_changedtick
+endfunction " }}}2
+
+let s:_wid_base = 'syntastic_' . getpid() . '_' . reltimestr(g:_SYNTASTIC_START) . '_'
+let s:_wid_pool = 0
+
+" Add unique IDs to windows
+function! syntastic#util#setWids() abort " {{{2
+ for tab in range(1, tabpagenr('$'))
+ for win in range(1, tabpagewinnr(tab, '$'))
+ if gettabwinvar(tab, win, 'syntastic_wid') ==# ''
+ call settabwinvar(tab, win, 'syntastic_wid', s:_wid_base . s:_wid_pool)
+ let s:_wid_pool += 1
+ endif
+ endfor
+ endfor
+endfunction " }}}2
+
+let s:_str2float = function(exists('*str2float') ? 'str2float' : 'str2nr')
+lockvar s:_str2float
+
+function! syntastic#util#str2float(val) abort " {{{2
+ return s:_str2float(a:val)
+endfunction " }}}2
+
+function! syntastic#util#float2str(val) abort " {{{2
+ return s:_float2str(a:val)
+endfunction " }}}2
+
+" Crude printf()-like width formatter. Handles wide characters.
+function! syntastic#util#wformat(format, str) abort " {{{2
+ if a:format ==# ''
+ return a:str
+ endif
+
+ echomsg string(a:format) . ', ' . string(a:str)
+ let specs = matchlist(a:format, '\v^(-?)(0?)(%([1-9]\d*))?%(\.(\d+))?$')
+ if len(specs) < 5
+ return a:str
+ endif
+
+ let flushleft = specs[1] ==# '-'
+ let lpad = specs[2] ==# '0' ? '0' : ' '
+ let minlen = str2nr(specs[3])
+ let maxlen = str2nr(specs[4])
+ let out = substitute(a:str, "\t", ' ', 'g')
+
+ if maxlen && s:_width(out) > maxlen
+ let chars = filter(split(out, '\zs\ze', 1), 'v:val !=# ""')
+ let out = ''
+
+ if flushleft
+ for c in chars
+ if s:_width(out . c) < maxlen
+ let out .= c
+ else
+ let out .= &encoding ==# 'utf-8' && &termencoding ==# 'utf-8' ? "\u2026" : '>'
+ break
+ endif
+ endfor
+ else
+ call reverse(chars)
+ for c in chars
+ if s:_width(c . out) < maxlen
+ let out = c . out
+ else
+ let out = (&encoding ==# 'utf-8' && &termencoding ==# 'utf-8' ? "\u2026" : '<') . out
+ break
+ endif
+ endfor
+ endif
+ endif
+
+ if minlen && s:_width(out) < minlen
+ if flushleft
+ let out .= repeat(' ', minlen - s:_width(out))
+ else
+ let out = repeat(lpad, minlen - s:_width(out)) . out
+ endif
+ endif
+
+ return out
+endfunction " }}}2
+
+" }}}1
+
+" Private functions {{{1
+
+function! s:_translateFilter(filters) abort " {{{2
+ let conditions = []
+ for k in keys(a:filters)
+ if type(a:filters[k]) == type([])
+ call extend(conditions, map(copy(a:filters[k]), 's:_translateElement(k, v:val)'))
+ else
+ call add(conditions, s:_translateElement(k, a:filters[k]))
+ endif
+ endfor
+
+ if conditions == []
+ let conditions = ['1']
+ endif
+ return len(conditions) == 1 ? conditions[0] : join(map(conditions, '"(" . v:val . ")"'), ' && ')
+endfunction " }}}2
+
+function! s:_translateElement(key, term) abort " {{{2
+ let fkey = a:key
+ if fkey[0] ==# '!'
+ let fkey = fkey[1:]
+ let not = 1
+ else
+ let not = 0
+ endif
+
+ if fkey ==? 'level'
+ let op = not ? ' ==? ' : ' !=? '
+ let ret = 'v:val["type"]' . op . string(a:term[0])
+ elseif fkey ==? 'type'
+ if a:term ==? 'style'
+ let op = not ? ' ==? ' : ' !=? '
+ let ret = 'get(v:val, "subtype", "")' . op . '"style"'
+ else
+ let op = not ? '!' : ''
+ let ret = op . 'has_key(v:val, "subtype")'
+ endif
+ elseif fkey ==? 'regex'
+ let op = not ? ' =~? ' : ' !~? '
+ let ret = 'v:val["text"]' . op . string(a:term)
+ elseif fkey ==? 'file' || fkey[:4] ==? 'file:'
+ let op = not ? ' =~# ' : ' !~# '
+ let ret = 'bufname(str2nr(v:val["bufnr"]))'
+ let mod = fkey[4:]
+ if mod !=# ''
+ let ret = 'fnamemodify(' . ret . ', ' . string(mod) . ')'
+ endif
+ let ret .= op . string(a:term)
+ else
+ call syntastic#log#warn('quiet_messages: ignoring invalid key ' . strtrans(string(fkey)))
+ let ret = '1'
+ endif
+ return ret
+endfunction " }}}2
+
+" @vimlint(EVL103, 1, a:flags)
+function! s:_delete_dumb(what, flags) abort " {{{2
+ if !exists('s:rmrf')
+ let s:rmrf =
+ \ has('unix') || has('mac') ? 'rm -rf' :
+ \ has('win32') || has('win64') ? 'rmdir /S /Q' :
+ \ has('win16') || has('win95') || has('dos16') || has('dos32') ? 'deltree /Y' : ''
+ endif
+
+ if s:rmrf !=# ''
+ silent! call syntastic#util#system(s:rmrf . ' ' . syntastic#util#shescape(a:what))
+ else
+ call s:_rmrf(a:what)
+ endif
+endfunction " }}}2
+" @vimlint(EVL103, 0, a:flags)
+
+" delete(dir, 'rf') was added in Vim 7.4.1107, but it didn't become usable until 7.4.1128
+let s:_delete = function(v:version > 704 || (v:version == 704 && has('patch1128')) ? 'delete' : 's:_delete_dumb')
+lockvar s:_delete
+
+function! s:_rmrf(what) abort " {{{2
+ if !exists('s:rmdir')
+ let s:rmdir = syntastic#util#shescape(get(g:, 'netrw_localrmdir', 'rmdir'))
+ endif
+
+ if getftype(a:what) ==# 'dir'
+ if filewritable(a:what) != 2
+ return
+ endif
+
+ try
+ " Vim 7.4.279 and later
+ let entries = globpath(a:what, '*', 1, 1)
+ catch /\m^Vim\%((\a\+)\)\=:E118/
+ let entries = split(globpath(a:what, '*', 1), "\n")
+ endtry
+ for f in entries
+ call s:_rmrf(f)
+ endfor
+ silent! call syntastic#util#system(s:rmdir . ' ' . syntastic#util#shescape(a:what))
+ else
+ silent! call delete(a:what)
+ endif
+endfunction " }}}2
+
+function! s:_float2str_smart(val) abort " {{{2
+ return printf('%.1f', a:val)
+endfunction " }}}2
+
+function! s:_float2str_dumb(val) abort " {{{2
+ return a:val
+endfunction " }}}2
+
+let s:_float2str = function(has('float') ? 's:_float2str_smart' : 's:_float2str_dumb')
+lockvar s:_float2str
+
+" }}}1
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/doc/syntastic-checkers.txt b/vim/bundle/syntastic/doc/syntastic-checkers.txt
new file mode 100644
index 0000000..4794849
--- /dev/null
+++ b/vim/bundle/syntastic/doc/syntastic-checkers.txt
@@ -0,0 +1,6931 @@
+*syntastic-checkers.txt* Syntastic checkers
+*syntastic-checkers*
+
+==============================================================================
+SYNTAX CHECKERS BY LANGUAGE *syntastic-checkers-lang*
+
+|syntastic| comes with checkers for the following languages:
+
+ ActionScript.............................|syntastic-checkers-actionscript|
+ Ada......................................|syntastic-checkers-ada|
+ Ansible..................................|syntastic-checkers-ansible|
+ API Blueprint............................|syntastic-checkers-apiblueprint|
+ AppleScript..............................|syntastic-checkers-applescript|
+ AsciiDoc.................................|syntastic-checkers-asciidoc|
+ Assembly Languages.......................|syntastic-checkers-asm|
+
+ BEMHTML..................................|syntastic-checkers-bemhtml|
+ Bro......................................|syntastic-checkers-bro|
+
+ C........................................|syntastic-checkers-c|
+ C#.......................................|syntastic-checkers-cs|
+ C++......................................|syntastic-checkers-cpp|
+ Cabal....................................|syntastic-checkers-cabal|
+ Chef.....................................|syntastic-checkers-chef|
+ COBOL....................................|syntastic-checkers-cobol|
+ Coco.....................................|syntastic-checkers-co|
+ CoffeeScript.............................|syntastic-checkers-coffee|
+ Coq......................................|syntastic-checkers-coq|
+ CSS......................................|syntastic-checkers-css|
+ Cucumber.................................|syntastic-checkers-cucumber|
+ CUDA.....................................|syntastic-checkers-cuda|
+
+ D........................................|syntastic-checkers-d|
+ Dart.....................................|syntastic-checkers-dart|
+ DocBook..................................|syntastic-checkers-docbk|
+ Dockerfile...............................|syntastic-checkers-dockerfile|
+ Dust.....................................|syntastic-checkers-dustjs|
+
+ Elixir...................................|syntastic-checkers-elixir|
+ Erlang...................................|syntastic-checkers-erlang|
+ eRuby....................................|syntastic-checkers-eruby|
+
+ Fortran..................................|syntastic-checkers-fortran|
+
+ Gentoo Metadata..........................|syntastic-checkers-gentoo|
+ Gettext PO...............................|syntastic-checkers-po|
+ GLSL.....................................|syntastic-checkers-glsl|
+ Go.......................................|syntastic-checkers-go|
+
+ Haml.....................................|syntastic-checkers-haml|
+ Handlebars...............................|syntastic-checkers-handlebars|
+ Haskell..................................|syntastic-checkers-haskell|
+ Haxe.....................................|syntastic-checkers-haxe|
+ HSS......................................|syntastic-checkers-hss|
+ HTML.....................................|syntastic-checkers-html|
+
+ Java.....................................|syntastic-checkers-java|
+ JavaScript...............................|syntastic-checkers-javascript|
+ JSON.....................................|syntastic-checkers-json|
+
+ LESS.....................................|syntastic-checkers-less|
+ Lex......................................|syntastic-checkers-lex|
+ Limbo....................................|syntastic-checkers-limbo|
+ LISP.....................................|syntastic-checkers-lisp|
+ LLVM.....................................|syntastic-checkers-llvm|
+ Lua......................................|syntastic-checkers-lua|
+
+ Markdown.................................|syntastic-checkers-markdown|
+ MATLAB...................................|syntastic-checkers-matlab|
+ Mercury..................................|syntastic-checkers-mercury|
+
+ NASM.....................................|syntastic-checkers-nasm|
+ Nix......................................|syntastic-checkers-nix|
+ nroff....................................|syntastic-checkers-nroff|
+
+ Objective-C..............................|syntastic-checkers-objc|
+ Objective-C++............................|syntastic-checkers-objcpp|
+ OCaml....................................|syntastic-checkers-ocaml|
+
+ Perl.....................................|syntastic-checkers-perl|
+ PHP......................................|syntastic-checkers-php|
+ POD......................................|syntastic-checkers-pod|
+ Pug (formerly Jade)......................|syntastic-checkers-pug|
+ Puppet...................................|syntastic-checkers-puppet|
+ Python...................................|syntastic-checkers-python|
+
+ QML......................................|syntastic-checkers-qml|
+
+ R........................................|syntastic-checkers-r|
+ R Markdown...............................|syntastic-checkers-rmd|
+ Racket...................................|syntastic-checkers-racket|
+ Relax NG.................................|syntastic-checkers-rnc|
+ reStructuredText.........................|syntastic-checkers-rst|
+ RPM spec.................................|syntastic-checkers-spec|
+ Ruby.....................................|syntastic-checkers-ruby|
+
+ SASS.....................................|syntastic-checkers-sass|
+ Scala....................................|syntastic-checkers-scala|
+ SCSS.....................................|syntastic-checkers-scss|
+ Sh.......................................|syntastic-checkers-sh|
+ Slim.....................................|syntastic-checkers-slim|
+ SML......................................|syntastic-checkers-sml|
+ SQL......................................|syntastic-checkers-sql|
+ Stylus...................................|syntastic-checkers-stylus|
+
+ Tcl......................................|syntastic-checkers-tcl|
+ TeX......................................|syntastic-checkers-tex|
+ Texinfo..................................|syntastic-checkers-texinfo|
+ Text.....................................|syntastic-checkers-text|
+ Turtle...................................|syntastic-checkers-turtle|
+ TriG.....................................|syntastic-checkers-trig|
+ Twig.....................................|syntastic-checkers-twig|
+ TypeScript...............................|syntastic-checkers-typescript|
+
+ Vala.....................................|syntastic-checkers-vala|
+ Verilog..................................|syntastic-checkers-verilog|
+ VHDL.....................................|syntastic-checkers-vhdl|
+ VimL.....................................|syntastic-checkers-vim|
+
+ xHTML....................................|syntastic-checkers-xhtml|
+ XML......................................|syntastic-checkers-xml|
+ XQuery...................................|syntastic-checkers-xquery|
+ XSLT.....................................|syntastic-checkers-xslt|
+
+ YACC.....................................|syntastic-checkers-yacc|
+ YAML.....................................|syntastic-checkers-yaml|
+ YANG.....................................|syntastic-checkers-yang|
+
+ Z80......................................|syntastic-checkers-z80|
+ Zope Page Templates......................|syntastic-checkers-zpt|
+ Zsh......................................|syntastic-checkers-zsh|
+
+Third-party checkers are available for additional languages.
+
+==============================================================================
+SYNTAX CHECKERS FOR ACTIONSCRIPT *syntastic-checkers-actionscript*
+
+The following checkers are available for ActionScript (filetype
+"actionscript"):
+
+ 1. mxmlc....................|syntastic-actionscript-mxmlc|
+
+------------------------------------------------------------------------------
+1. mxmlc *syntastic-actionscript-mxmlc*
+
+Name: mxmlc
+Maintainer: Andy Earnshaw <andyearnshaw@gmail.com>
+
+"mxmlc" is a compiler for ActionScript. See Apache Flex for details:
+
+ http://flex.apache.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR ADA *syntastic-checkers-ada*
+
+The following checkers are available for Ada (filetype "ada"):
+
+ 1. GCC......................|syntastic-ada-gcc|
+
+------------------------------------------------------------------------------
+1. GCC *syntastic-ada-gcc*
+
+Name: gcc
+Maintainer: Alfredo Di Napoli <alfredo.dinapoli@gmail.com>
+
+Checker options~
+ *'g:syntastic_ada_compiler'*
+Type: string
+Default: "gcc"
+Compiler executable.
+
+ *'g:syntastic_ada_errorformat'*
+Type: string
+Default: unset
+Override for the default |'errorformat'|.
+
+ *'g:syntastic_ada_remove_include_errors'*
+Type: boolean
+Default: 0
+By default, errors in files included from the file being checked are shown.
+Set this variable to 1 to remove messages about errors in included files.
+Please note that this means syntastic will silently abort checks if there are
+fatal errors in one of the included files.
+
+ *'g:syntastic_ada_compiler_options'*
+Type: string
+Default: unset
+Compilation flags (such as defines or include directories) to be passed to the
+checker.
+
+ *'g:syntastic_ada_config_file'*
+Type: string
+Default: ".syntastic_ada_config"
+File containing additional compilation flags to be passed to the checker, one
+option per line (cf. |syntastic-config-files|).
+
+ *'g:syntastic_ada_include_dirs'*
+Type: array of strings
+Default: []
+Include directories to be passed to the checker, in addition to the above
+compilation flags. You can set it like this: >
+ let g:syntastic_ada_include_dirs = ["includes", "headers"]
+<
+and the corresponding "-Iincludes -Iheaders" will be added to the compilation
+flags.
+
+ *'b:syntastic_ada_cflags'*
+Type: string
+Default: unset
+Buffer-local variable. Additional compilation flags specific to the current
+buffer.
+
+ *'g:syntastic_ada_check_header'*
+Type: boolean
+Default: 0
+If the current file is a header (namely if its extension is "ads"), all checks
+are silently skipped. You can force syntastic to check header files by
+setting the above variable to 1.
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_ada_gcc_<option>' variables. The only exception is
+'g:syntastic_ada_gcc_exec', which can still be used to override the checker's
+executable.
+
+==============================================================================
+SYNTAX CHECKERS FOR ANSIBLE *syntastic-checkers-ansible*
+
+The following checkers are available for Ansible (filetype "ansible"):
+
+ 1. Ansible-lint.............|syntastic-ansible-ansible_lint|
+
+------------------------------------------------------------------------------
+1. Ansible-lint *syntastic-ansible-ansible_lint*
+
+Name: ansible_lint
+Maintainer: Erik Zaadi <erik.zaadi@gmail.com>
+
+"Ansible-lint" is a style checker for Ansible playbooks. See the project's
+page at GitHub for details:
+
+ https://github.com/willthames/ansible-lint
+
+Syntastic requires "Ansible-lint" version 2.0.4 or later.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You probably also need a plugin to set |filetype| for Ansible playbooks, such
+as "ansible-vim":
+
+ https://github.com/pearofducks/ansible-vim
+
+==============================================================================
+SYNTAX CHECKERS FOR API BLUEPRINT *syntastic-checkers-apiblueprint*
+
+The following checkers are available for API Blueprint (filetype "apiblueprint"):
+
+ 1. Drafter..................|syntastic-apiblueprint-drafter|
+
+------------------------------------------------------------------------------
+1. Drafter *syntastic-apiblueprint-drafter*
+
+Name: drafter
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Drafter" is a parser for Apiary's "API Blueprint" (http://apiblueprint.org/).
+See the project's page at GitHub for details:
+
+ https://github.com/apiaryio/drafter
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You probably also need a plugin to set |filetype| for API Blueprint files, such
+as "apiblueprint.vim":
+
+ https://github.com/kylef/apiblueprint.vim
+
+==============================================================================
+SYNTAX CHECKERS FOR APPLESCRIPT *syntastic-checkers-applescript*
+
+The following checkers are available for AppleScript (filetype "applescript"):
+
+ 1. osacompile...............|syntastic-applescript-osacompile|
+
+------------------------------------------------------------------------------
+1. osacompile *syntastic-applescript-osacompile*
+
+Name: osacompile
+Author: Zhao Cai <caizhaoff@gmail.com>
+
+"osacompile" is a compiler for "AppleScript". See the program's manual for
+details:
+
+ https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/osacompile.1.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR ASCIIDOC *syntastic-checkers-asciidoc*
+
+The following checkers are available for AsciiDoc (filetype "asciidoc"):
+
+ 1. Asciidoc.................|syntastic-asciidoc-asciidoc|
+
+------------------------------------------------------------------------------
+1. Asciidoc *syntastic-asciidoc-asciidoc*
+
+Name: asciidoc
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Asciidoc" is a translator for AsciiDoc documents (http://asciidoc.org/).
+
+Note~
+
+If you would prefer to use Asciidoctor (http://asciidoctor.org/) as an
+external checker instead of "Asciidoc", you can do that by pointing
+'g:syntastic_asciidoc_asciidoc_exec' to it: >
+ let g:syntastic_asciidoc_asciidoc_exec = "asciidoctor"
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR ASSEMBLY LANGUAGES *syntastic-checkers-asm*
+
+The following checkers are available for asembly languages (filetype "asm"):
+
+ 1. GCC......................|syntastic-asm-gcc|
+
+------------------------------------------------------------------------------
+1. GCC *syntastic-asm-gcc*
+
+Name: gcc
+Maintainer: Joshua Rahm <joshuarahm@gmail.com>
+
+This plugin supports both the AT&T and Intel dialects.
+
+Checker Options~
+ *'g:syntastic_asm_compiler'*
+Type: string
+Default: "gcc"
+Compiler executable. Set it to something like "mipsel-linux-gcc": >
+ let g:syntastic_asm_compiler = "mipsel-linux-gcc"
+<
+ *'g:syntastic_asm_errorformat'*
+Type: string
+Default: unset
+Override for the default |'errorformat'|.
+
+ *'g:syntastic_asm_dialect'*
+Type: string
+Default: unset
+Normally the assembler will select the dialect to use for checking based on
+the file extension (AT&T for ".s", Intel for ".asm"). If you want to override
+the automatic choice set this variable to either "att" or "intel".
+
+ *'g:syntastic_asm_remove_include_errors'*
+Type: boolean
+Default: 0
+By default, errors in files included from the file being checked are shown.
+Set this variable to 1 to remove messages about errors in included files.
+Please note that this means syntastic will silently abort checks if there are
+fatal errors in one of the included files.
+
+ *'g:syntastic_asm_compiler_options'*
+Type: string
+Default: unset
+Compilation flags (such as defines or include directories) to be passed to the
+assembler. Set it to something like "-mtune=native": >
+ let g:syntastic_asm_compiler_options = "-mtune=native"
+<
+ *'g:syntastic_asm_config_file'*
+Type: string
+Default: ".syntastic_asm_config"
+File containing additional compilation flags to be passed to the assembler,
+one option per line (see |syntastic-config-files|).
+
+ *'g:syntastic_asm_include_dirs'*
+Type: array of strings
+Default: []
+Include directories to be passed to the assembler, in addition to the
+above compilation flags. You can set it like this: >
+ let g:syntastic_asm_include_dirs = ["inc", "asm/src/include"]
+<
+and the corresponding "-Iinc -Iasm/src/include" will be added to the
+compilation flags.
+
+ *'b:syntastic_asm_cflags'*
+Type: string
+Default: unset
+Buffer-local variable. Additional compilation flags specific to the current
+buffer.
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_asm_gcc_<option>' variables. The only exception is
+'g:syntastic_asm_gcc_exec', which can still be used to override the checker's
+executable.
+
+==============================================================================
+SYNTAX CHECKERS FOR BEMHTML *syntastic-checkers-bemhtml*
+
+The following checkers are available for BEMHTML (filetype "bemhtml"):
+
+ 1. bemhtml-lint.............|syntastic-bemhtml-bemhtmllint|
+
+------------------------------------------------------------------------------
+1. bemhtml-lint *syntastic-bemhtml-bemhtmllint*
+
+Name: bemhtmllint
+Maintainer: Sergej Tatarincev
+
+BEMHTML is a template engine intended for using with BEM methodology
+(http://bem.info/method/). See the project's page at GitHub for details:
+
+ https://github.com/SevInf/bemhtml-lint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR BRO *syntastic-checkers-bro*
+
+The following checkers are available for Bro (filetype "bro"):
+
+ 1. Bro......................|syntastic-bro-bro|
+
+------------------------------------------------------------------------------
+1. Bro *syntastic-bro-bro*
+
+Name: bro
+Maintainer: Justin Azoff <justin.azoff@gmail.com>
+
+"Bro" is a network security monitor. See the project's page for details:
+
+ https://www.bro.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR C *syntastic-checkers-c*
+
+The following checkers are available for C (filetype "c"):
+
+ 1. AVR-GCC..................|syntastic-c-avrgcc|
+ 2. Checkpatch...............|syntastic-c-checkpatch|
+ 3. ClangCheck...............|syntastic-c-clang_check|
+ 4. Clang-Tidy...............|syntastic-c-clang_tidy|
+ 5. Cppcheck.................|syntastic-c-cppcheck|
+ 6. GCC......................|syntastic-c-gcc|
+ 7. make.....................|syntastic-c-make|
+ 8. OClint...................|syntastic-c-oclint|
+ 9. PC-Lint..................|syntastic-c-pc_lint|
+ 10. Sparse..................|syntastic-c-sparse|
+ 11. Splint..................|syntastic-c-splint|
+
+------------------------------------------------------------------------------
+1. AVR-GCC *syntastic-c-avrgcc*
+
+Name: avrgcc
+Maintainer: Karel <karelishere@gmail.com>
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Aditionally:
+
+ *g:syntastic_avrgcc_config_file*
+Type: string
+Default: ".syntastic_avrgcc_config"
+File containing compilation flags (such as defines or include directories),
+one option per line (cf. |syntastic-config-files|).
+
+------------------------------------------------------------------------------
+2. Checkpatch *syntastic-c-checkpatch*
+
+Name: checkpatch
+Maintainer: Daniel Walker <dwalker@fifo99.com>
+
+"Checkpatch" is a style checker for the Linux kernel sources. It's
+distributed along with the Linux kernel sources:
+
+ https://github.com/torvalds/linux/blob/master/scripts/checkpatch.pl
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+3. ClangCheck *syntastic-c-clang_check*
+
+Name: clang_check
+Maintainer: Benjamin Bannier <bbannier@gmail.com>
+
+"ClangCheck" is a wrapper around Clang's "LibTooling"
+(http://clang.llvm.org/docs/LibTooling.html). See the official page for
+details:
+
+ http://clang.llvm.org/docs/ClangCheck.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_clang_check_config_file'*
+Type: string
+Default: ".syntastic_clang_check_config"
+File containing compilation flags (such as defines or include directories),
+one option per line (cf. |syntastic-config-files|).
+
+Note~
+
+By default you can set "ClangCheck" parameters in
+'g:syntastic_c_clang_check_args', and compilation parameters
+(defines, optimisation flags, etc.) in the configuration file.
+
+However, if you want "ClangCheck" to use compilation databases
+(http://clang.llvm.org/docs/JSONCompilationDatabase.html) -- perhaps
+generated by "CMake" (https://github.com/rizsotto/Bear) or "Build EAR"
+(https://github.com/rizsotto/Bear) -- rather than pass compilation flags
+explicitly, set 'g:syntastic_c_clang_check_post_args' to an empty string: >
+ let g:syntastic_c_clang_check_post_args = ""
+<
+Configuration files pointed to by 'g:syntastic_clang_check_config_file' are
+then ignored.
+
+See also: |syntastic-cpp-clang_check|.
+
+------------------------------------------------------------------------------
+4. Clang-Tidy *syntastic-c-clang_tidy*
+
+Name: clang_tidy
+Maintainer: Benjamin Bannier <bbannier@gmail.com>
+
+"Clang-Tidy" is a lint tool based on "Clang" (http://clang.llvm.org/). See
+the project's page for details:
+
+ http://clang.llvm.org/extra/clang-tidy.html
+
+Installation~
+
+"Clang-Tidy" is part of the "Clang" (http://clang.llvm.org/) project, but it
+isn't built by default. You need to enable compilation of the "Extra Clang
+Tools" (http://clang.llvm.org/docs/ClangTools.html#extra-clang-tools) to get
+it. See the build tutorial for details:
+
+ http://clang.llvm.org/docs/LibASTMatchersTutorial.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_clang_tidy_config_file'*
+Type: string
+Default: ".syntastic_clang_tidy_config"
+File containing compilation flags (such as defines or include directories),
+one option per line (cf. |syntastic-config-files|).
+
+Note~
+
+By default you can set "ClangTidy" parameters in
+'g:syntastic_c_clang_tidy_args', and compilation parameters
+(defines, optimisation flags, etc.) in the configuration file.
+
+If you want "ClangTidy" to use compilation databases
+(http://clang.llvm.org/docs/JSONCompilationDatabase.html) --
+perhaps generated by "CMake" (http://cmake.org/) or "Build EAR"
+(https://github.com/rizsotto/Bear) -- rather than pass compilation flags
+explicitly, set 'g:syntastic_c_clang_tidy_post_args' to an empty string: >
+ let g:syntastic_c_clang_tidy_post_args = ""
+<
+Configuration files pointed to by 'g:syntastic_clang_tidy_config_file' are
+then ignored.
+
+See also: |syntastic-cpp-clang_tidy|.
+
+------------------------------------------------------------------------------
+5. Cppcheck *syntastic-c-cppcheck*
+
+Name: cppcheck
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Cppcheck" is a static analysis tool for C/C++ code. See the project's page
+for details:
+
+ http://cppcheck.sourceforge.net/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_cppcheck_config_file'*
+Type: string
+Default: ".syntastic_cppcheck_config"
+File containing compilation flags (such as defines or include directories),
+one option per line (cf. |syntastic-config-files|).
+
+See also: |syntastic-cpp-cppcheck|.
+
+------------------------------------------------------------------------------
+6. GCC *syntastic-c-gcc*
+
+Name: gcc
+Maintainer: Gregor Uhlenheuer <kongo2002@gmail.com>
+
+Checker options~
+ *'g:syntastic_c_compiler'*
+Type: string
+Default: "gcc", or "clang" if GCC is not found
+Compiler executable.
+
+ *'g:syntastic_c_errorformat'*
+Type: string
+Default: unset
+Override for the default |'errorformat'|.
+
+ *'g:syntastic_c_remove_include_errors'*
+Type: boolean
+Default: 0
+By default, errors in files included from the file being checked are shown.
+Set this variable to 1 to remove messages about errors in included files.
+Please note that this means syntastic will silently abort checks if there are
+fatal errors in one of the included files.
+
+ *'g:syntastic_c_compiler_options'*
+Type: string
+Default: "-std=gnu99"
+Compilation flags (such as defines or include directories) to be passed to the
+checker.
+
+ *'g:syntastic_c_config_file'*
+Type: string
+Default: ".syntastic_c_config"
+File containing additional compilation flags to be passed to the checker, one
+option per line (cf. |syntastic-config-files|).
+
+ *'g:syntastic_c_include_dirs'*
+Type: array of strings
+Default: []
+Include directories to be passed to the checker, in addition to the above
+compilation flags. You can set it to something like this: >
+ let g:syntastic_c_include_dirs = ["includes", "headers"]
+<
+and the corresponding "-Iincludes -Iheaders" will be added to the compilation
+flags.
+
+ *'g:syntastic_c_no_default_include_dirs'*
+Type: boolean
+Default: 0
+By default syntastic adds a number of common include directories to the
+compilation flags, namely: >
+ -I. -I.. -Iinclude -Iincludes -I../include -I../includes
+<
+You can disable this behaviour by setting the above variable to 1.
+
+ *'g:syntastic_c_no_include_search'*
+Type: boolean
+Default: 0
+By default syntastic looks at the first 100 lines of the file being checked,
+and tries to determine if it needs to include headers for some common
+libraries, such as "GLib" or "Gtk". It then tries to add the corresponding
+include directories to the compilation flags. You can disable this behaviour
+by setting the above variable to 1.
+
+ *'g:syntastic_c_auto_refresh_includes'*
+Type: boolean
+Default: 0
+Used only if "g:syntastic_c_no_include_search" is set to a false value. By
+default syntastic searches for common libraries only the first time the
+current file is checked. Setting the above variable to 1 instructs syntastic
+to refresh the list of common libraries every time the current file is
+checked. You can also force a refresh even when the above variable is 0, by
+`:unlet`-ing the buffer variable 'b:syntastic_c_includes'.
+
+ *'b:syntastic_c_cflags'*
+Type: string
+Default: unset
+Buffer-local variable. When set, no search for common libraries is performed,
+and the contents of the variable are added to the compilation flags.
+
+ *'g:syntastic_c_check_header'*
+Type: boolean
+Default: 0
+If the current file is a header (namely if its extension is "h"), all checks
+are silently skipped. You can force syntastic to check header files by
+setting the above variable to 1.
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_c_gcc_<option>' variables. The only exception is
+'g:syntastic_c_gcc_exec', which can still be used to override the checker's
+executable.
+
+See also: |syntastic-cpp-gcc|.
+
+------------------------------------------------------------------------------
+7. make *syntastic-c-make*
+
+Name: make
+Maintainer: Gregor Uhlenheuer <kongo2002@gmail.com>
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+8. OClint *syntastic-c-oclint*
+
+Name: oclint
+Maintainer: "UnCO" Lin <undercooled@lavabit.com>
+
+"OClint" is a static code analysis tool. See the project's page for details:
+
+ http://oclint.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ 'g:syntastic_oclint_config_file'
+Type: string
+Default: ".syntastic_oclint_config"
+File containing compilation flags (such as defines or include directories),
+one option per line (cf. |syntastic-config-files|).
+
+Notes~
+
+By default you can set "OClint" parameters in 'g:syntastic_c_oclint_args', and
+compilation parameters (defines, optimisation flags, etc.) in the config file.
+
+If you want "OClint" to use "Clang"-style compilation databases
+(http://clang.llvm.org/docs/JSONCompilationDatabase.html) --
+perhaps generated by "CMake" (http://cmake.org/) or "Build EAR"
+(https://github.com/rizsotto/Bear) -- rather than pass compilation flags
+explicitly, set 'g:syntastic_c_oclint_post_args' to an empty string: >
+ let g:syntastic_c_oclint_post_args = ""
+<
+Config files pointed to by 'g:syntastic_oclint_config_file' are then ignored.
+
+See also: |syntastic-cpp-oclint|.
+
+------------------------------------------------------------------------------
+9. PC-Lint *syntastic-c-pc_lint*
+
+Name: pc_lint
+Maintainer: Steve Bragg <steve@empresseffects.com>
+
+"PC-Lint" is a commercial static code analysis tool for Windows, produced
+by "Gimpel Software" (http://www.gimpel.com/). See the project's page for
+details:
+
+ http://www.gimpel.com/html/pcl.htm
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_pc_lint_config_file'*
+Type: string
+Default: "options.lnt"
+Name of an indirect (.lnt) file. A file with that name is looked up in the
+current directory and in parent directories; first such file found is used.
+
+See also: |syntastic-cpp-pc_lint|.
+
+------------------------------------------------------------------------------
+10. Sparse *syntastic-c-sparse*
+
+Name: sparse
+Maintainer: Daniel Walker <dwalker@fifo99.com>
+
+"Sparse" is a semantic parser for C, see the official wiki for details:
+
+ https://sparse.wiki.kernel.org/index.php/Main_Page
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_sparse_config_file'*
+Type: string
+Default: ".syntastic_sparse_config"
+File containing compilation flags (such as defines or include directories),
+one option per line (cf. |syntastic-config-files|).
+
+Notes~
+
+If you use "Sparse" with "GCC" you probably want to add something like this to
+your vimrc: >
+ let g:syntastic_c_sparse_post_args="-gcc-base-dir " .
+ \ system("gcc -v 2>&1 | sed -n '/^Reading specs/ { s#.* /#/#; s#/[^/]*$##; p; }'")
+<
+This allows "Sparse" to read "GCC"'s private include files.
+
+------------------------------------------------------------------------------
+11. Splint *syntastic-c-splint*
+
+Name: splint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Splint" is a tool for statically checking C programs for security
+vulnerabilities, see the project's page for details:
+
+ http://www.splint.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_splint_config_file'*
+Type: string
+Default: ".syntastic_splint_config"
+File containing project-specific options to be passed to "Splint"
+(such as defines or include directories), one option per line (cf.
+|syntastic-config-files|).
+
+==============================================================================
+SYNTAX CHECKERS FOR C# *syntastic-checkers-cs*
+
+The following checkers are available for C# (filetype "cs"):
+
+ 1. mcs......................|syntastic-cs-mcs|
+
+------------------------------------------------------------------------------
+1. mcs *syntastic-cs-mcs*
+
+Name: mcs
+Maintainer: Daniel Walker <dwalker@fifo99.com>
+
+"mcs" is a compiler for C# from the "Mono" project
+(http://www.mono-project.com/Main_Page). See the program's manual for details:
+
+ http://mono.wikia.com/wiki/Man_mcs
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR C++ *syntastic-checkers-cpp*
+
+The following checkers are available for C++ (filetype "cpp"):
+
+ 1. ClangCheck...............|syntastic-cpp-clang_check|
+ 2. Clang-Tidy...............|syntastic-cpp-clang_tidy|
+ 3. Cppcheck.................|syntastic-cpp-cppcheck|
+ 4. Cpplint..................|syntastic-cpp-cpplint|
+ 5. GCC......................|syntastic-cpp-gcc|
+ 6. OClint...................|syntastic-cpp-oclint|
+ 7. PC-Lint..................|syntastic-cpp-pc_lint|
+ 8. Vera++...................|syntastic-cpp-verapp|
+
+------------------------------------------------------------------------------
+1. ClangCheck *syntastic-cpp-clang_check*
+
+Name: clang_check
+Maintainer: Benjamin Bannier <bbannier@gmail.com>
+
+"ClangCheck" is a wrapper around Clang's "LibTooling"
+(http://clang.llvm.org/docs/LibTooling.html). See the official page for
+details:
+
+ http://clang.llvm.org/docs/ClangCheck.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ 'g:syntastic_clang_check_config_file'
+Type: string
+Default: ".syntastic_clang_check_config"
+file containing compilation flags (such as defines or include directories),
+one option per line (cf. |syntastic-config-files|).
+
+Note~
+
+By default you can set "ClangCheck" parameters in
+'g:syntastic_cpp_clang_check_args', and compilation parameters (defines,
+optimisation flags, etc.) in the configuration file.
+
+However, if you want "ClangCheck" to use compilation databases
+(http://clang.llvm.org/docs/JSONCompilationDatabase.html) -- perhaps
+generated by "CMake" (https://github.com/rizsotto/Bear) or "Build EAR"
+(https://github.com/rizsotto/Bear) -- rather than pass compilation flags
+explicitly, set 'g:syntastic_cpp_clang_check_post_args' to an empty string: >
+ let g:syntastic_cpp_clang_check_post_args = ""
+<
+Configuration files pointed to by 'g:syntastic_clang_check_config_file' are
+then ignored.
+
+See also: |syntastic-c-clang_check|.
+
+------------------------------------------------------------------------------
+2. Clang-Tidy *syntastic-cpp-clang_tidy*
+
+Name: clang_tidy
+Maintainer: Benjamin Bannier <bbannier@gmail.com>
+
+"Clang-Tidy" is a lint tool based on "Clang" (http://clang.llvm.org/). See
+the project's page for details:
+
+ http://clang.llvm.org/extra/clang-tidy.html
+
+Installation~
+
+"Clang-Tidy" is part of the "Clang" (http://clang.llvm.org/) project, but it
+isn't built by default. You need to enable compilation of the "Extra Clang
+Tools" (http://clang.llvm.org/docs/ClangTools.html#extra-clang-tools) to get
+it. See the build tutorial for details:
+
+ http://clang.llvm.org/docs/LibASTMatchersTutorial.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ 'g:syntastic_clang_tidy_config_file'
+Type: string
+Default: ".syntastic_clang_tidy_config"
+File containing compilation flags (such as defines or include directories),
+one option per line (cf. |syntastic-config-files|).
+
+Note~
+
+By default you can set "ClangTidy" parameters in
+'g:syntastic_ppc_clang_tidy_args', and compilation parameters (defines,
+optimisation flags, etc.) in the configuration file.
+
+If you want "ClangTidy" to use compilation databases
+(http://clang.llvm.org/docs/JSONCompilationDatabase.html) --
+perhaps generated by "CMake" (http://cmake.org/) or "Build EAR"
+(https://github.com/rizsotto/Bear) -- rather than pass compilation flags
+explicitly, set 'g:syntastic_cpp_clang_tidy_post_args' to an empty string: >
+ let g:syntastic_cpp_clang_tidy_post_args = ""
+<
+Configuration files pointed to by 'g:syntastic_clang_tidy_config_file' are
+then ignored.
+
+See also: |syntastic-c-clang_tidy|.
+
+------------------------------------------------------------------------------
+3. Cppcheck *syntastic-cpp-cppcheck*
+
+Name: cppcheck
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Cppcheck" is a static analysis tool for C/C++ code. See the project's page
+for details:
+
+ http://cppcheck.sourceforge.net/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ 'g:syntastic_cppcheck_config_file'
+Type: string
+Default: ".syntastic_cppcheck_config"
+File containing compilation flags (such as defines or include directories),
+one option per line (cf. |syntastic-config-files|).
+
+See also: |syntastic-c-cppcheck|.
+
+------------------------------------------------------------------------------
+4. Cpplint *syntastic-cpp-cpplint*
+
+Name: cpplint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+For details about "Cpplint" see the project's page:
+
+ https://code.google.com/p/google-styleguide/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_cpp_cpplint_thres'*
+Type: integer
+Default: 5
+Error threshold. Policy violations with a severity above this value are
+highlighted as errors, the others are considered warnings by syntastic.
+
+ *'g:syntastic_cpp_cpplint_args'*
+Type: string
+Default: "--verbose=3"
+Command line options to pass to "Cpplint"
+
+Note~
+
+By default syntastic expects the "cpplint" script to be named "cpplint.py".
+However, if your "cpplint" was installed with "pip", the script's name is
+"cpplint", and you need to set 'g:syntastic_cpp_cpplint_exec' accordingly:
+>
+ let g:syntastic_cpp_cpplint_exec = "cpplint"
+<
+------------------------------------------------------------------------------
+5. GCC *syntastic-cpp-gcc*
+
+Name: gcc
+Maintainer: Gregor Uhlenheuer <kongo2002@gmail.com>
+
+Checker options~
+ *'g:syntastic_cpp_compiler'*
+Type: string
+Default: "g++", or "clang++" if GCC is not found
+Compiler executable.
+
+ *'g:syntastic_cpp_errorformat'*
+Type: string
+Default: unset
+Override for the default |'errorformat'|.
+
+ *'g:syntastic_cpp_remove_include_errors'*
+Type: boolean
+Default: 0
+By default, errors in files included from the file being checked are shown.
+Set this variable to 1 to remove messages about errors in included files.
+Please note that this means syntastic will silently abort checks if there are
+fatal errors in one of the included files.
+
+ *'g:syntastic_cpp_compiler_options'*
+Type: string
+Default: unset
+Compilation flags (such as defines or include directories) to be passed to the
+checker.
+
+ *'g:syntastic_cpp_config_file'*
+Type: string
+Default: ".syntastic_cpp_config"
+File containing additional compilation flags to be passed to the checker, one
+option per line (cf. |syntastic-config-files|).
+
+ *'g:syntastic_cpp_include_dirs'*
+Type: array of strings
+Default: []
+Include directories to be passed to the checker, in addition to the above
+compilation flags. You can set it to something like this: >
+ let g:syntastic_cpp_include_dirs = ["includes", "headers"]
+>
+and the corresponding "-Iincludes -Iheaders" will be added to the compilation
+flags.
+
+ *'g:syntastic_cpp_no_default_include_dirs'*
+Type: boolean
+Default: 0
+By default syntastic adds a number of common include directories to the
+compilation flags, namely: >
+ -I. -I.. -Iinclude -Iincludes -I../include -I../includes
+<
+You can disable this behaviour by setting the above variable to 1.
+
+ *'g:syntastic_cpp_no_include_search'*
+Type: boolean
+Default: 0
+By default syntastic looks at the first 100 lines of the file being checked,
+and tries to determine if it needs to include headers for some common
+libraries, such as "GLib" or "Gtk". It then tries to add the corresponding
+include directories to the compilation flags. You can disable this behaviour
+by setting the above variable to 1.
+
+ *'g:syntastic_cpp_auto_refresh_includes'*
+Type: boolean
+Default: 0
+Used only if "g:syntastic_cpp_no_include_search" is set to a false value.
+By default syntastic searches for common libraries only the first time the
+current file is checked. Setting the above variable to 1 instructs syntastic
+to refresh the list of common libraries every time the current file is
+checked. You can also force a refresh even when the above variable is 0, by
+`:unlet`-ing the buffer variable 'b:syntastic_cpp_includes'.
+
+ *'b:syntastic_cpp_cflags'*
+Type: string
+Default: unset
+Buffer-local variable. When set, no search for common libraries is performed,
+and the contents of the variable are added to the compilation flags.
+
+ *'g:syntastic_cpp_check_header'*
+Type: boolean
+Default: 0
+If the current file is a header (namely if its extension is "h", "hpp", or
+"hh"), all checks are silently skipped. You can force syntastic to check
+header files by setting the above variable to 1.
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_cpp_gcc_<option>' variables. The only exception is
+'g:syntastic_cpp_gcc_exec', which can still be used to override the checker's
+executable.
+
+See also: |syntastic-c-gcc|.
+
+------------------------------------------------------------------------------
+6. OClint *syntastic-cpp-oclint*
+
+Name: oclint
+Maintainer: "UnCO" Lin <undercooled@lavabit.com>
+
+"OClint" is a static code analysis tool. See the project's page for details:
+
+ http://oclint.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ 'g:syntastic_oclint_config_file'
+Type: string
+Default: ".syntastic_oclint_config"
+File containing compilation flags (such as defines or include directories),
+one option per line (cf. |syntastic-config-files|).
+
+Notes~
+
+By default you can set "OClint" parameters in 'g:syntastic_cpp_oclint_args',
+and compilation parameters (defines, optimisation flags, etc.) in the config
+file.
+
+If you want "OClint" to use "Clang"-style compilation databases
+(http://clang.llvm.org/docs/JSONCompilationDatabase.html) --
+perhaps generated by "CMake" (http://cmake.org/) or "Build EAR"
+(https://github.com/rizsotto/Bear) -- rather than pass compilation flags
+explicitly, set 'g:syntastic_c_oclint_post_args' to an empty string: >
+ let g:syntastic_cpp_oclint_post_args = ""
+<
+Config files pointed to by 'g:syntastic_oclint_config_file' are then ignored.
+
+See also: |syntastic-c-oclint|.
+
+------------------------------------------------------------------------------
+7. PC-Lint *syntastic-cpp-pc_lint*
+
+Name: pc_lint
+Maintainer: Steve Bragg <steve@empresseffects.com>
+
+"PC-Lint" is a commercial static code analysis tool for Windows, produced
+by "Gimpel Software" (http://www.gimpel.com/). See the project's page for
+details:
+
+ http://www.gimpel.com/html/pcl.htm
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ 'g:syntastic_pc_lint_config_file'
+Type: string
+Default: "options.lnt"
+Name of an indirect (.lnt) file. A file with that name is looked up in the
+current directory and in parent directories; first such file found is used.
+
+See also: |syntastic-c-pc_lint|.
+
+------------------------------------------------------------------------------
+8. Vera++ *syntastic-cpp-verapp*
+
+Name: verapp
+Maintainer: Lucas Verney <phyks@phyks.me>
+
+"Vera++" is a programmable tool for verification, analysis and transformation
+of C++ source code. See the project's page for details:
+
+ https://bitbucket.org/verateam/vera/wiki/Home
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_verapp_config_file'*
+Type: string
+Default: ".syntastic_verapp_config"
+File containing additional compilation flags to be passed to the checker, one
+option per line (cf. |syntastic-config-files|).
+
+==============================================================================
+SYNTAX CHECKERS FOR CABAL *syntastic-checkers-cabal*
+
+The following checkers are available for Cabal (filetype "cabal"):
+
+ 1. Cabal....................|syntastic-cabal-cabal|
+
+------------------------------------------------------------------------------
+1. Cabal *syntastic-cabal-cabal*
+
+Name: cabal
+Maintainer: Ian D. Bollinger <ian.bollinger@gmail.com>
+
+This checker runs "cabal check" against Haskell Cabal package descriptions.
+See the project's page for more information:
+
+ http://www.haskell.org/cabal/
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_cabal_cabal_<option>' variables. The only exception
+is 'g:syntastic_cabal_cabal_exec', which can still be used to override the
+checker's executable.
+
+==============================================================================
+SYNTAX CHECKERS FOR CHEF *syntastic-checkers-chef*
+
+The following checkers are available for Chef (filetype "chef"):
+
+ 1. Foodcritic...............|syntastic-chef-foodcritic|
+
+------------------------------------------------------------------------------
+1. Foodcritic *syntastic-chef-foodcritic*
+
+Name: foodcritic
+Maintainer: Doug Ireton
+
+"Foodcritic" is a linter for "Chef" cookbooks (http://www.opscode.com/chef/).
+See the project's page for more information:
+
+ http://acrmp.github.io/foodcritic/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You probably also need a plugin to set |filetype| for Chef files, such as
+"vim-chef":
+
+ https://github.com/dougireton/vim-chef
+
+==============================================================================
+SYNTAX CHECKERS FOR COBOL *syntastic-checkers-cobol*
+
+The following checkers are available for COBOL (filetype "cobol"):
+
+ 1. OpenCOBOL................|syntastic-cobol-cobc|
+
+------------------------------------------------------------------------------
+1. OpenCOBOL *syntastic-cobol-cobc*
+
+Name: cobc
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"OpenCOBOL" is a compiler for COBOL. See the project's page for more
+information:
+
+ http://www.opencobol.org/
+
+Checker options~
+ *'g:syntastic_cobol_compiler'*
+Type: string
+Default: "cobc"
+Compiler executable.
+
+ *'g:syntastic_cobol_errorformat'*
+Type: string
+Default: unset
+Override for the default |'errorformat'|.
+
+ *'g:syntastic_cobol_remove_include_errors'*
+Type: boolean
+Default: 0
+By default, errors in files included from the file being checked are shown.
+Set this variable to 1 to remove messages about errors in included files.
+Please note that this means syntastic will silently abort checks if there are
+fatal errors in one of the included files.
+
+ *'g:syntastic_cobol_compiler_options'*
+Type: string
+Default: unset
+Compilation flags (such as "-std=cobol2002") to be passed to the checker.
+
+ *'g:syntastic_cobol_config_file'*
+Type: string
+Default: ".syntastic_cobol_config"
+File containing additional compilation flags to be passed to the checker, one
+option per line (cf. |syntastic-config-files|).
+
+ *'g:syntastic_cobol_include_dirs'*
+Type: array of strings
+Default: []
+Include directories to be passed to the checker, in addition to the above
+compilation flags. You can set it to something like this: >
+ let g:syntastic_cobol_include_dirs = ["includes", "headers"]
+<
+and the corresponding "-Iincludes -Iheaders" will be added to the compilation
+flags.
+
+ *'b:syntastic_cobol_cflags'*
+Type: string
+Default: unset
+Buffer-local variable. Additional compilation flags specific to the current
+buffer.
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_cobol_cobc_<option>' variables. The only exception
+is 'g:syntastic_cobol_cobc_exec', which can still be used to override the
+checker's executable.
+
+==============================================================================
+SYNTAX CHECKERS FOR COCO *syntastic-checkers-co*
+
+The following checkers are available for Coco (filetype "co"):
+
+ 1. Coco.....................|syntastic-co-coco|
+
+------------------------------------------------------------------------------
+1. Coco *syntastic-co-coco*
+
+Name: coco
+Maintainer: Andrew Kelley <superjoe30@gmail.com>
+
+For details about "Coco" see the project's page:
+
+ https://github.com/satyr/coco/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR COFFEESCRIPT *syntastic-checkers-coffee*
+
+The following checkers are available for CoffeeScript (filetype "coffee"):
+
+ 1. Coffee...................|syntastic-coffee-coffee|
+ 2. CoffeeLint...............|syntastic-coffee-coffeelint|
+
+------------------------------------------------------------------------------
+1. Coffee *syntastic-coffee-coffee*
+
+Name: coffee
+Maintainer: Lincoln Stoll <l@lds.li>
+
+"Coffee" is a compiler for CoffeeScript. See the project's page for details:
+
+ http://coffeescript.org/
+
+Syntastic requires "Coffee" version 1.6.2 or later.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. CoffeeLint *syntastic-coffee-coffeelint*
+
+Name: coffeelint
+Maintainer: Lincoln Stoll <l@lds.li>
+
+"CoffeeLint" is a style checker for CoffeeScript. See the project's page for
+details:
+
+ http://www.coffeelint.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR COQ *syntastic-checkers-coq*
+
+The following checkers are available for Coq (filetype "coq"):
+
+ 1. Coqtop...................|syntastic-coq-coqtop|
+
+------------------------------------------------------------------------------
+1. Coqtop *syntastic-coq-coqtop*
+
+Name: coqtop
+Maintainer: Matvey Aksenov <matvey.aksenov@gmail.com>
+
+"Coqtop" is the top level intrface for Coq. See the project's page for
+details:
+
+ http://coq.inria.fr/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR CSS *syntastic-checkers-css*
+
+The following checkers are available for CSS (filetype "css"):
+
+ 1. CSSLint..................|syntastic-css-csslint|
+ 2. mixedindentlint..........|syntastic-css-mixedindentlint|
+ 3. PHP_CodeSniffer..........|syntastic-css-phpcs|
+ 4. PrettyCSS................|syntastic-css-prettycss|
+ 5. RECESS...................|syntastic-css-recess|
+ 6. stylelint................|syntastic-css-stylelint|
+
+------------------------------------------------------------------------------
+1. CSSLint *syntastic-css-csslint*
+
+Name: csslint
+Maintainer: Ory Band <oryband@gmail.com>
+
+"CSSLint" is a lint tool for Cascading Stylesheets. See the project's page
+for details:
+
+ http://csslint.net/
+
+Installation~
+
+Install it with "npm": >
+ npm install -g csslint
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. mixedindentlint *syntastic-css-mixedindentlint*
+
+Name: mixedindentlint
+Maintainer: Payton Swick <payton@foolord.com>
+
+"mixedindentlint" is a general-purpose indentation checker. See the project's
+page at GitHub for more information:
+
+ https://github.com/sirbrillig/mixedindentlint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-javascript-mixedindentlint|, |syntastic-scss-mixedindentlint|.
+
+------------------------------------------------------------------------------
+3. PHP_CodeSniffer *syntastic-css-phpcs*
+
+Name: phpcs
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"PHP_CodeSniffer" is a style checker for PHP and CSS. See the project's page
+at GitHub for details:
+
+ https://github.com/squizlabs/PHP_CodeSniffer/
+
+Installation~
+
+Install it with: >
+ pear install PHP_CodeSniffer
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+If you're checking files containing tab characters then "PHP_CodeSniffer"'s
+idea of tabstop must match Vim's 'tabstop', otherwise syntastic will highlight
+the errors at shifted positions. By default syntastic does that by adding
+an option "--tab-width=&tabstop" to "PHP_CodeSniffer", but that option
+also instructs "PHP_CodeSniffer" to expand tabs, and some code sniffers
+(f.i. "CakePHP", see https://github.com/cakephp/cakephp-codesniffer) insist on
+indenting lines with tabs. To work around the resulting mess if you're using
+one of these sniffers, set "--tab-width=0" and 'tabstop' to 8: >
+ let g:syntastic_php_phpcs_args = "--tab-width=0"
+ set tabstop=8
+<
+See also: |syntastic-php-phpcs|.
+
+------------------------------------------------------------------------------
+4. PrettyCSS *syntastic-css-prettycss*
+
+Name: prettycss
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"PrettyCSS" is a beautifier, lint checker, and validator for Cascading
+Stylesheets. For more details see:
+
+PrettyCSS Demo:
+
+ http://fidian.github.io/PrettyCSS/
+
+The project's page at GitHub:
+
+ https://github.com/fidian/PrettyCSS/
+
+Installation~
+
+Install it with: >
+ npm install -g PrettyCSS
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+5. RECESS *syntastic-css-recess*
+
+Name: recess
+Maintainer: Tim Carry <tim@pixelastic.com>
+
+"RECESS" is a code quality tool for CSS built on top of LESS. See the
+project's page for details:
+
+ http://twitter.github.io/recess/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-less-recess|.
+
+------------------------------------------------------------------------------
+6. stylelint *syntastic-css-stylelint*
+
+Name: stylelint
+Maintainer: Tim Carry <tim@pixelastic.com>
+
+"stylelint" is a style checker for Cascading Stylesheets. See the project's
+page for more information:
+
+ http://stylelint.io/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-scss-stylelint|.
+
+==============================================================================
+SYNTAX CHECKERS FOR CUCUMBER *syntastic-checkers-cucumber*
+
+The following checkers are available for Cucumber (filetype "cucumber"):
+
+ 1. Cucumber.................|syntastic-cucumber-cucumber|
+
+------------------------------------------------------------------------------
+1. Cucumber *syntastic-cucumber-cucumber*
+
+Name: cucumber
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"Cucumber" is a tool that executes plain-text functional descriptions as
+automated tests. See the project's page for more information:
+
+ http://cukes.info/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR CUDA *syntastic-checkers-cuda*
+
+The following checkers are available for CUDA (filetype "cuda"):
+
+ 1. NVCC.....................|syntastic-cuda-nvcc|
+
+------------------------------------------------------------------------------
+1. NVCC *syntastic-cuda-nvcc*
+
+Name: nvcc
+Author: Hannes Schulz <schulz@ais.uni-bonn.de>
+
+"NVCC" is a CUDA Compiler from nVidia. See the project's page for details:
+
+ https://developer.nvidia.com/cuda-llvm-compiler
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_cuda_check_header'*
+Type: boolean
+Default: 0
+Turn this on to check header files. The checker then creates an empty file
+".syntastic_dummy.cu" in the base directory of the file being checked.
+Example: >
+ let g:syntastic_cuda_check_header = 1
+<
+ *'g:syntastic_cuda_config_file'*
+Type: string
+Default: ".syntastic_cuda_config"
+File containing additional compilation flags to be passed to the checker, one
+option per line (cf. |syntastic-config-files|).
+
+==============================================================================
+SYNTAX CHECKERS FOR D *syntastic-checkers-d*
+
+The following checkers are available for D (filetype "d"):
+
+ 1. DMD......................|syntastic-d-dmd|
+
+------------------------------------------------------------------------------
+1. DMD *syntastic-d-dmd*
+
+Name: dmd
+Maintainer: Alfredo Di Napoli <alfredo.dinapoli@gmail.com>
+
+Checker options~
+ *'g:syntastic_d_compiler'*
+Type: string
+Default: "dmd"
+Compiler executable.
+
+ *'g:syntastic_d_errorformat'*
+Type: string
+Default: unset
+Override for the default |'errorformat'|.
+
+ *'g:syntastic_d_remove_include_errors'*
+Type: boolean
+Default: 0
+By default, errors in files included from the file being checked are shown.
+Set this variable to 1 to remove messages about errors in included files.
+Please note that this means syntastic will silently abort checks if there are
+fatal errors in one of the included files.
+
+ *'g:syntastic_d_compiler_options'*
+Type: string
+Default: unset
+Compilation flags (such as defines or include directories) to be passed to the
+checker.
+
+ *'g:syntastic_d_config_file'*
+Type: string
+Default: ".syntastic_d_config"
+File containing additional compilation flags to be passed to the checker, one
+option per line (cf. |syntastic-config-files|).
+
+ *'g:syntastic_d_include_dirs'*
+Type: array of strings
+Default: inferred from ".dub/packages"
+Include directories to be passed to the checker, in addition to the above
+compilation flags. You can set it like this: >
+ let g:syntastic_d_include_dirs = ["includes", "headers"]
+<
+and the corresponding "-Iincludes -Iheaders" will be added to the compilation
+flags.
+
+ *'g:syntastic_d_use_dub'*
+Type: boolean
+Default: 1
+Whether to use "dub" to find include directories. This requires "dub" version
+0.9.24 or later.
+
+ *'g:syntastic_d_dub_exec'*
+Type: string
+Default: "dub"
+Path to the "dub" executable. Ignored if |'g:syntastic_d_use_dub'| is unset.
+
+ *'b:syntastic_d_cflags'*
+Type: string
+Default: unset
+Buffer-local variable. Additional compilation flags specific to the current
+buffer.
+
+ *'g:syntastic_d_check_header'*
+Type: boolean
+Default: 0
+If the current file is a header (namely if its extension is "di"), all checks
+are silently skipped. You can force syntastic to check header files by setting
+the above variable to 1.
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_d_dmd_<option>' variables. The only exception is
+'g:syntastic_d_dmd_exec', which can still be used to override the checker's
+executable.
+
+==============================================================================
+SYNTAX CHECKERS FOR DART *syntastic-checkers-dart*
+
+The following checkers are available for Dart (filetype "dart"):
+
+ 1. Analyzer.................|syntastic-dart-dartanalyzer|
+
+------------------------------------------------------------------------------
+1. Analyzer *syntastic-dart-dartanalyzer*
+
+Name: dartanalyzer
+Maintainer: Maksim Ryzhikov <rv.maksim@gmail.com>
+
+"Analyzer" is a static analysis tool for Dart (https://www.dartlang.org/).
+See the manual for more information:
+
+ https://www.dartlang.org/tools/analyzer/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR DOCBOOK *syntastic-checkers-docbk*
+
+The following checkers are available for DocBook (filetype "docbk"):
+
+ 1. Igor.....................|syntastic-docbk-igor|
+ 2. xmllint..................|syntastic-docbk-xmllint|
+
+------------------------------------------------------------------------------
+1. Igor *syntastic-docbk-igor*
+
+Name: igor
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Igor" is a proofreader for DocBook SGML, man pages, and text files used by
+the FreeBSD project (https://www.freebsd.org/). See the author's presentation
+for details:
+
+ http://www.youtube.com/watch?v=sczHqUPygZY
+
+The latest version can be obtained from Glen Barber's repository:
+
+ http://docscripts.glenbarber.us/tags/igor/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-nroff-igor|, |syntastic-text-igor|.
+
+------------------------------------------------------------------------------
+2. xmllint *syntastic-docbk-xmllint*
+
+Name: xmllint
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"xmllint" is a checker and transformer tool for XML files, distributed with
+the "libxml" package (http://www.xmlsoft.org/). See the tool's manual for more
+information:
+
+ http://xmlsoft.org/xmllint.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You can use a local installation of DTDs to significantly speed up validation
+and allow you to validate XML data without network access. See the
+"xmlcatalog" manual, and the catalog documentation for more information:
+
+ http://www.xmlsoft.org/xmlcatalog_man.html
+ http://www.xmlsoft.org/catalog.html
+
+For an example of a DTD catalog see f.i. "XMLCatalog":
+
+ https://github.com/darcyparker/XMLCatalog
+
+In order to use it with syntastic you'll have to clone it to a local
+directory, and point the environment variable "XML_CATALOG_FILES" to the file
+"catalog.xml" in the said directory: >
+ XML_CATALOG_FILES=/some/path/XMLCatalog/catalog.xml
+ export XML_CATALOG_FILES
+<
+Otherwise "xmllint" will try to load XML catalogs from "/etc/xml/catalog".
+
+See also: |syntastic-xml-xmllint|, |syntastic-xslt-xmllint|.
+
+==============================================================================
+SYNTAX CHECKERS FOR DOCKERFILE *syntastic-checkers-dockerfile*
+
+The following checkers are available for Dockerfile (filetype "dockerfile"):
+
+ 1. dockerfile-lint..........|syntastic-dockerfile-dockerfile_lint|
+
+------------------------------------------------------------------------------
+1. dockerfile-lint *syntastic-dockerfile-dockerfile_lint*
+
+Name: dockerfile_lint
+Maintainer: Tim Carry <tim@pixelastic.com>
+
+"dockerfile-lint" is a linter for Dockerfiles
+(http://docs.docker.com/engine/reference/builder). See the project's page at
+GitHub for details:
+
+ https://github.com/projectatomic/dockerfile_lint
+
+Installation~
+
+Install it with: >
+ npm install -g dockerfile_lint
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR DUST *syntastic-checkers-dustjs*
+
+The following checkers are available for Dust (filetype "dustjs"):
+
+ 1. Swiffer..................|syntastic-dustjs-swiffer|
+
+------------------------------------------------------------------------------
+1. Swiffer *syntastic-dustjs-swiffer*
+
+Name: swiffer
+Maintainer: Steven Foote <smfoote@gmail.com>
+
+"Swiffer" is a command line lint tool for Dust. See the project's page for
+details:
+
+ https://github.com/smfoote/Swiffer.js
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+To enable Dust syntax checking, you must set the filetype of your Dust
+template files to "dustjs". An easy way to do this is by installing the dustjs
+syntax highlighter:
+
+ https://github.com/jimmyhchan/dustjs.vim
+
+==============================================================================
+SYNTAX CHECKERS FOR ELIXIR *syntastic-checkers-elixir*
+
+The following checkers are available for Elixir (filetype "elixir"):
+
+ 1. elixir...................|syntastic-elixir-elixir|
+
+------------------------------------------------------------------------------
+1. elixir *syntastic-elixir-elixir*
+
+Name: elixir
+Maintainer: Richard Ramsden <rramsden@gmail.com>
+
+See the project's page for details:
+
+ http://elixir-lang.org/
+
+Security~
+
+This checker executes the code in the files it checks:
+
+ https://github.com/scrooloose/syntastic/issues/1141
+
+This is probably fine if you wrote the files yourself, but it can be a problem
+if you're trying to check third party files. If you are 100% willing to let
+Vim run the code in your files, set 'g:syntastic_enable_elixir_checker' to 1
+in your vimrc to enable this checker: >
+ let g:syntastic_enable_elixir_checker = 1
+<
+There is also a buffer-local version of this variable, that takes precedence
+over a global one in the buffers where it is defined.
+
+Please note that setting this variable doesn't automatically enable the
+checker, you still need to add "elixir" to 'g:syntastic_elixir_checkers' if
+you plan to use it.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR ERLANG *syntastic-checkers-erlang*
+
+The following checkers are available for Erlang (filetype "erlang"):
+
+ 1. escript..................|syntastic-erlang-escript|
+ 2. SyntaxErl................|syntastic-erlang-syntaxerl|
+
+------------------------------------------------------------------------------
+1. escript *syntastic-erlang-escript*
+
+Name: escript
+Maintainer: Pawel Salata <rockplayer.pl@gmail.com>
+
+"escript" is an interpreter for Erlang programs. See the tool's manual for
+more information:
+
+ http://www.erlang.org/doc/man/escript.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+If you get warning: "behaviour X undefined" with your customize behaviour, add
+the following line in your vimrc: >
+ let g:syntastic_erlc_include_path = "ebin"
+<
+
+------------------------------------------------------------------------------
+2. SyntaxErl *syntastic-erlang-syntaxerl*
+
+Name: syntaxerl
+Maintainer: locojay
+
+"SyntaxErl" is a syntax checker for Erlang. It uses "rebar"
+(https://github.com/basho/rebar) to determine correct deps and libs paths.
+See the project's page for more information:
+
+ https://github.com/ten0s/syntaxerl
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR ERUBY *syntastic-checkers-eruby*
+
+The following checkers are available for eRuby (filetype "eruby"):
+
+ 1. Ruby.....................|syntastic-eruby-ruby|
+
+------------------------------------------------------------------------------
+1. Ruby *syntastic-eruby-ruby*
+
+Name: ruby
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+Checker options~
+ 'g:syntastic_ruby_exec'
+Type: string
+Default: "ruby"
+The Ruby executable to use.
+
+Note~
+
+The variable 'g:syntastic_ruby_exec' is also used by the Ruby
+"MRI" checker (cf. |syntastic-ruby-mri|), and it can be overriden
+by 'g:syntastic_eruby_ruby_exec'. However, this checker doesn't
+call the "makeprgBuild()" function, and thus it ignores all other
+'g:syntastic_eruby_ruby_<option>' variables.
+
+==============================================================================
+SYNTAX CHECKERS FOR FORTRAN *syntastic-checkers-fortran*
+
+The following checkers are available for Fortran (filetype "fortran"):
+
+ 1. GNU Fortran..............|syntastic-fortran-gfortran|
+
+------------------------------------------------------------------------------
+1. GNU Fortran *syntastic-fortran-gfortran*
+
+Name: gfortran
+Maintainer: Karl Yngve Lervåg <karl.yngve@lervag.net>
+
+"GNU Fortran" is a checker for Fortran files using either GNU
+Fortran (https://gcc.gnu.org/fortran/) or Intel Fortran Compilers
+(https://software.intel.com/en-us/fortran-compilers).
+
+Checker options~
+ *'g:syntastic_fortran_compiler'*
+Type: string
+Default: "gfortran"
+Compiler executable. Set this to either "gfortran" (to use GNU Fortran), or to
+"ifort" (for Intel Fortran).
+
+ *'g:syntastic_fortran_errorformat'*
+Type: string
+Default: unset
+Override for the default |'errorformat'|.
+
+ *'g:syntastic_fortran_remove_include_errors'*
+Type: boolean
+Default: 0
+By default, errors in files included from the file being checked are shown.
+Set this variable to 1 to remove messages about errors in included files.
+Please note that this means syntastic will silently abort checks if there are
+fatal errors in one of the included files.
+
+ *'g:syntastic_fortran_compiler_options'*
+Type: string
+Default: unset
+Compilation flags (such as "-std=f95") to be passed to the checker.
+
+ *'g:syntastic_fortran_config_file'*
+Type: string
+Default: ".syntastic_fortran_config"
+File containing additional compilation flags to be passed to the checker, one
+option per line (cf. |syntastic-config-files|).
+
+ *'g:syntastic_fortran_include_dirs'*
+Type: array of strings
+Default: []
+Include directories to be passed to the checker, in addition to the above
+compilation flags. You can set it like this: >
+ let g:syntastic_fortran_include_dirs = ["includes", "headers"]"
+<
+and the corresponding "-Iincludes -Iheaders" will be added to the compilation
+flags.
+
+ *'b:syntastic_fortran_cflags'*
+Type: string
+Default: unset
+Buffer-local variable. Additional compilation flags specific to the current
+buffer.
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_fortran_gfortran_<option>' variables. The only
+exception is 'g:syntastic_fortran_gfortran_exec', which can still be used to
+override the checker's executable.
+
+==============================================================================
+SYNTAX CHECKERS FOR GENTOO METADATA *syntastic-checkers-gentoo*
+
+The following checkers are available for Gentoo Metadata (filetype "gentoo"):
+
+ 1. xmllint..................|syntastic-gentoo-xmllint|
+
+------------------------------------------------------------------------------
+1. xmllint *syntastic-gentoo-xmllint*
+
+Name: xmllint
+Maintainer: James Rowe <jnrowe@gmail.com>
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+The DTDs required to validate "metadata.xml" files are available in
+"$PORTDIR/metadata/dtd", and these local files can be used to significantly
+speed up validation. You can create a catalog file with: >
+ xmlcatalog --create --add rewriteURI http://www.gentoo.org/dtd/ \
+ ${PORTDIR:-/usr/portage}/metadata/dtd/ /etc/xml/gentoo
+<
+See "xmlcatalog" for more information:
+
+ http://www.xmlsoft.org/catalog.html
+
+==============================================================================
+SYNTAX CHECKERS FOR GETTEXT PO *syntastic-checkers-po*
+
+The following checkers are available for gettext .po files (filetype "po"):
+
+ 1. msgfmt...................|syntastic-po-msgfmt|
+
+------------------------------------------------------------------------------
+1. msgfmt *syntastic-po-msgfmt*
+
+Name: msgfmt
+Maintainer: Ryo Okubo <syucream1031@gmail.com>
+
+"msgfmt" is a compiler for gettext Portable Object
+(http://www.gnu.org/software/gettext/manual/html_node/PO-Files.html)
+translation files. See the program's manual for details:
+
+ http://www.gnu.org/software/gettext/manual/html_node/msgfmt-Invocation.html#msgfmt-Invocation
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR GLSL *syntastic-checkers-glsl*
+
+The following checkers are available for GLSL (filetype "glsl"):
+
+ 1. cgc......................|syntastic-glsl-cgc|
+
+------------------------------------------------------------------------------
+1. cgc *syntastic-glsl-cgc*
+
+Name: cgc
+Maintainer: Joshua Rahm <joshuarahm@gmail.com>
+
+"cgc" is a compiler that translates Cg or GLSL programs into OpenGL or DirectX
+code. See the manual for more details:
+
+ http://http.developer.nvidia.com/Cg/cgc.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_glsl_extensions'*
+Type: dictionary
+Default: unset
+
+You can control the profiles used by "cgc" with magic comments: put the magic
+comment "// profile:" followed by the profile for "cgc" to use. For example
+use >
+ // profile: glslf
+<
+to force the fragment shader profile.
+
+If the magic comment does not exist, then the dictionary
+'g:syntastic_glsl_extensions' is used to infer the appropriate profile from
+the current file's extension. If this dictionary does not exist either, a
+default dictionary is used instead. Finally, if the current file's extension
+cannott be found in these dictionaries, the checker assumes a vertex shader
+profile.
+
+ *'g:syntastic_glsl_options'*
+Type: string
+Default: unset
+Additional arguments to pass to "cgc".
+
+==============================================================================
+SYNTAX CHECKERS FOR GO *syntastic-checkers-go*
+
+The following checkers are available for Go (filetype "go"):
+
+ 1. go.......................|syntastic-go-go|
+ 2. gofmt....................|syntastic-go-gofmt|
+ 3. Golint...................|syntastic-go-golint|
+ 4. Go Meta Linter...........|syntastic-go-gometalinter|
+ 5. gotype...................|syntastic-go-gotype|
+ 6. vet......................|syntastic-go-govet|
+
+------------------------------------------------------------------------------
+1. go *syntastic-go-go*
+
+Name: go
+Maintainer: Kamil Kisiel <kamil@kamilkisiel.net>
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_go_go_build_args'*
+Type: string
+Default: "-buildmode=archive"
+arguments passed to "go build"
+
+ *'g:syntastic_go_go_test_args'*
+Type: string
+Default: "-buildmode=archive"
+arguments passed to "go test".
+
+Note~
+
+This syntax checker does not reformat your source code. Use a |BufWritePre|
+autocommand towards that end: >
+ autocmd FileType go autocmd BufWritePre <buffer> Fmt
+<
+------------------------------------------------------------------------------
+2. gofmt *syntastic-go-gofmt*
+
+Name: gofmt
+Maintainer: Brandon Thomson <bt@brandonthomson.com>
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+This syntax checker does not reformat your source code. Use a |BufWritePre|
+autocommand towards that end: >
+ autocmd FileType go autocmd BufWritePre <buffer> Fmt
+<
+------------------------------------------------------------------------------
+3. Golint *syntastic-go-golint*
+
+Name: golint
+Maintainer: Hiroshi Ioka <hirochachacha@gmail.com>
+
+"Golint" is a linter for Go. See the project's page for details:
+
+ https://github.com/golang/lint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+4. Go Meta Linter *syntastic-go-gometalinter*
+
+Name: gometalinter
+Maintainer: Joshua Rubin <joshua@rubixconsulting.com>
+
+"Go Meta Linter" is a linter for Go. It runs a number of other linters
+against your files, and normalises their output to a standard format.
+See the project's page at GitHub for details:
+
+ https://github.com/alecthomas/gometalinter
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+5. gotype *syntastic-go-gotype*
+
+Name: gotype
+Maintainer: luz <ne.tetewi@gmail.com>
+
+See the tool's documentation for details:
+
+ https://godoc.org/golang.org/x/tools/cmd/gotype
+
+------------------------------------------------------------------------------
+6. vet *syntastic-go-govet*
+
+Name: govet
+Maintainer: Kamil Kisiel <kamil@kamilkisiel.net>
+
+See the tool's documentation for details:
+
+ https://godoc.org/golang.org/x/tools/cmd/vet
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_go_govet_<option>' variables.
+
+==============================================================================
+SYNTAX CHECKERS FOR HAML *syntastic-checkers-haml*
+
+The following checkers are available for Haml (filetype "haml"):
+
+ 1. Haml.....................|syntastic-haml-haml|
+ 2. HAML-Lint................|syntastic-haml-haml_lint|
+
+------------------------------------------------------------------------------
+1. Haml *syntastic-haml-haml*
+
+Name: haml
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+See the project's page for details:
+
+ http://haml.info/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. HAML-Lint *syntastic-haml-haml_lint*
+
+Name: haml_lint
+Maintainer: Shane da Silva <shane@dasilva.io>
+
+"HAML-Lint" is a checker for HAML files. See the project's page for details:
+
+ https://github.com/causes/haml-lint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR HANDLEBARS *syntastic-checkers-handlebars*
+
+The following checkers are available for Handlebars (filetype "handlebars"):
+
+ 1. Handlebars...............|syntastic-handlebars-handlebars|
+
+------------------------------------------------------------------------------
+1. Handlebars *syntastic-handlebars-handlebars*
+
+Name: handlebars
+Maintainer: Jeremy Mack
+
+"Handlebars" is a JavaScript library for building semantic templates. See the
+project's page for details:
+
+ http://handlebarsjs.com/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You probably also need a plugin to set |filetype| for Handlebars files, such as
+"vim-mustache-handlebars":
+
+ https://github.com/mustache/vim-mustache-handlebars
+
+==============================================================================
+SYNTAX CHECKERS FOR HASKELL *syntastic-checkers-haskell*
+
+The following checkers are available for Haskell (filetype "haskell"):
+
+ 1. hdevtools................|syntastic-haskell-hdevtools|
+ 2. HLint....................|syntastic-haskell-hlint|
+ 3. Style scanner............|syntastic-haskell-scan|
+
+------------------------------------------------------------------------------
+1. hdevtools *syntastic-haskell-hdevtools*
+
+Name: hdevtools
+Maintainer: Anthony Carapetis <anthony.carapetis@gmail.com>
+
+"hdevtools" is a backend for text editor plugins. See the project's page at
+GitHub for details:
+
+ https://github.com/bitc/hdevtools/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+If you're checking files containing tab characters, then Vim's 'tabstop'
+must match "hdevtools"'s idea of tabstop, otherwise column numbers will be
+shifted. At the time of this writing, "hdevtools"'s tabstop is hardcoded to 8,
+so you should probably add something like this to your vimrc: >
+ set tabstop=8
+<
+------------------------------------------------------------------------------
+2. HLint *syntastic-haskell-hlint*
+
+Name: hlint
+Maintainer: Nicolas Wu <nicolas.wu@gmail.com>
+
+"HLint" is a linter and style checker for Haskell. See the project's page for
+details:
+
+ http://community.haskell.org/~ndm/hlint/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+If you're checking files containing tab characters, Vim's 'tabstop' must
+match "HLint"'s idea of tabstop, otherwise column numbers will be shifted. At
+the time of this writing "HLint"'s tabstop is hardcoded to 8, so you should
+probably add something like this to your vimrc: >
+ set tabstop=8
+<
+------------------------------------------------------------------------------
+3. Style scanner *syntastic-haskell-scan*
+
+Name: scan
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Style scanner" is a style checker for Haskell. See the project's page for
+details:
+
+ http://projects.haskell.org/style-scanner/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+If you're checking files containing tab characters, Vim's 'tabstop' must
+match "Style scanner"'s idea of tabstop, otherwise column numbers will be
+shifted. At the time of this writing "Style scanner"'s tabstop is hardcoded to
+8, so you should probably add something like this to your vimrc: >
+ set tabstop=8
+<
+==============================================================================
+SYNTAX CHECKERS FOR HAXE *syntastic-checkers-haxe*
+
+The following checkers are available for Haxe (filetype "haxe"):
+
+ 1. Haxe.....................|syntastic-haxe-haxe|
+
+------------------------------------------------------------------------------
+1. Haxe *syntastic-haxe-haxe*
+
+Name: haxe
+Maintainer: David Bernard <david.bernard.31@gmail.com>
+
+"Haxe" is a programming language and compiler that can produce applications
+and source code for multiple different platforms from a single code-base. See
+the project's page for details:
+
+ http://haxe.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:vaxe_hxml'*
+ *'b:vaxe_hxml'*
+Type: string
+Default: unset
+By default the checker will search parent folders for "hxml" files, and
+use the first one it finds. You can override that behaviour by pointing
+'g:vaxe_hxml' or 'b:vaxe_hxml' to a specific build file. Those variables can
+also be set by Vaxe:
+
+ https://github.com/jdonaldson/vaxe
+
+==============================================================================
+SYNTAX CHECKERS FOR HSS *syntastic-checkers-hss*
+
+The following checkers are available for HSS (filetype "hss"):
+
+ 1. HSS......................|syntastic-hss-hss|
+
+------------------------------------------------------------------------------
+1. HSS *syntastic-hss-hss*
+
+Name: hss
+Maintainer: Justin Donaldson <jdonaldson@gmail.com>
+
+"HSS" is a tool that extends the CSS syntax with features such as variables
+and nested blocks. See the project's page for details:
+
+ http://ncannasse.fr/projects/hss
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR HTML *syntastic-checkers-html*
+
+The following checkers are available for HTML (filetype "html"):
+
+ 1. ESLint...................|syntastic-html-eslint|
+ 2. gjslint..................|syntastic-html-gjslint|
+ 3. HTML tidy................|syntastic-html-tidy|
+ 4. JSHint...................|syntastic-html-jshint|
+ 5. textlint.................|syntastic-html-textlint|
+ 6. Validator................|syntastic-html-validator|
+ 7. W3.......................|syntastic-html-w3|
+
+------------------------------------------------------------------------------
+1. ESLint *syntastic-html-eslint*
+
+Name: eslint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"ESLint" is a tool for identifying and reporting on patterns found in
+ECMAScript/JavaScript code. It can also detect problems in JavaScript code
+embedded in HTML files. See the project's page for details:
+
+ https://github.com/nzakas/eslint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You can also use "eslint_d" (https://github.com/mantoni/eslint_d.js), version
+2.1.0 or later, instead of "ESLint". Just point 'g:syntastic_html_eslint_exec'
+to it:
+
+ https://github.com/mantoni/eslint_d.js#editor-integration
+
+See also: |syntastic-javascript-eslint|, |syntastic-typescript-eslint|.
+
+------------------------------------------------------------------------------
+2. gjslint *syntastic-html-gjslint*
+
+Name: gjslint
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"Closure Linter", or "gjslint", is a style checker for JavaScript. It can also
+detect problems in HTML files. See the project's page for more information:
+
+ https://developers.google.com/closure/utilities/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-javascript-gjslint|.
+
+------------------------------------------------------------------------------
+3. HTML tidy *syntastic-html-tidy*
+
+Name: tidy
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"HTML Tidy" is a syntax checker and formatter for HTML. See the project's page
+for more information:
+
+ http://www.html-tidy.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_html_tidy_ignore_errors'*
+Type: array of strings
+Default: []
+List of errors to ignore. Case-sensitive patterns matched as substrings
+(not regular expressions) against the error messages. See also
+|'syntastic_quiet_messages'|.
+
+ *'g:syntastic_html_tidy_blocklevel_tags'*
+Type: array of strings
+Default: []
+List of additional blocklevel tags to be added to "--new-blocklevel-tags".
+
+ *'g:syntastic_html_tidy_inline_tags'*
+Type: array of strings
+Default: []
+List of additional inline tags to be added to "--new-inline-tags".
+
+ *'g:syntastic_html_tidy_empty_tags'*
+Type: array of strings
+Default: []
+List of additional empty tags, to be added to "--new-empty-tags".
+
+See also: |syntastic-xhtml-tidy|.
+
+------------------------------------------------------------------------------
+4. jshint *syntastic-html-jshint*
+
+Name: JSHint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"JSHint" can detect JavaScript errors and potential problems in HTML
+files. See the project's page for details:
+
+ http://jshint.com/
+
+Syntastic requires "JSHint" version 2.4.0 or later.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+If you're checking files containing tab characters then "JSHint"'s idea of
+tabstop must match Vim's 'tabstop', otherwise syntastic will highlight the
+errors at shifted positions. By default "JSHint"'s tabstop is 4, while Vim's
+default 'tabstop' is 8.
+
+In order to change "JSHint"'s tabstop you have to change its "indent" config
+option (cf. http://jshint.com/docs/options/#indent). One way to do that is
+to put it in a file named ".jshintrc" in the current directory, the parent
+directories, or your home directory. The file is supposed to be in JSON
+format. For example: >
+ {
+ "indent": 8
+ }
+<
+See JSHint documentation for more details:
+
+ http://jshint.com/docs/
+
+Please note however that setting "indent" also triggers the indentation checks
+in "JSHint". If that is undesirable, your only other option is to leave
+"JSHint"'s tabstop alone, and change Vim's 'tabstop' to 4. To change Vim's
+'tabstop', you can add this to your vimrc: >
+ set tabstop=4
+<
+See also: |syntastic-javascript-jshint|, |syntastic-xhtml-jshint|.
+
+------------------------------------------------------------------------------
+5. textlint *syntastic-html-textlint*
+
+Name: textlint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"textlint" is a natural language linter for text, Markdown, and HTML files.
+See the project's page for details:
+
+ https://textlint.github.io/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You need to install both "textlint" and the "textlint HTML" plugin for this to
+work:
+
+ https://github.com/textlint/textlint-plugin-html
+
+See also: |syntastic-markdown-textlint|, |syntastic-text-textlint|.
+
+------------------------------------------------------------------------------
+6. Validator *syntastic-html-validator*
+
+Name: validator
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Validator" is a non-DTD-based HTML checker. See the project's page for
+details:
+
+ http://validator.github.io/validator/
+
+As a syntastic checker, you can validate your files against the online service
+(see https://validator.nu/), or you can install "vnu.jar":
+
+ https://github.com/validator/validator/releases/latest
+
+then run it as a HTTP server: >
+ $ java -Xss512k -cp /path/to/vnu.jar nu.validator.servlet.Main 8888
+<
+Requirement~
+
+This checker uses cURL:
+
+ http://curl.haxx.se/
+
+Checker options~
+
+ *'g:syntastic_html_validator_api'*
+Type: string
+Default: "http://validator.nu/"
+URL of the service to use for checking. Leave it to the default to run the
+checks against "https://validator.nu/", or set it to "http://localhost:8888/"
+if you have "vnu.jar" installed, and you're running it as a standalone HTTP
+server. See:
+
+ http://validator.github.io/validator/#standalone
+
+ *'g:syntastic_html_validator_parser'*
+Type: string
+Default: empty
+Parser to use. Legal values are: "xml", "xmldtd", "html", "html5", "html4",
+and "html4tr". Set it to "html5" to check HTML5 files. References:
+
+ https://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters#parser
+
+ *'g:syntastic_html_validator_nsfilter'*
+Type: string
+Default: empty
+Sets the "nsfilter" for the parser. See:
+
+ https://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters#nsfilter
+
+ *'g:syntastic_html_validator_exec'*
+Type: string
+Default: "curl"
+Path to the "cURL" executable. Override it with a full path if your "cURL" is
+not installed in a standard location.
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_html_validator_<option>' variables. The only exception
+is 'g:syntastic_html_validator_exec', which can be used to override the path
+to the "cURL" executable.
+
+Note~
+
+Non-zero exit codes from "cURL" are typically network errors, and are signaled
+by syntastic with messages such as: >
+ syntastic: error: checker html/validator returned abnormal status 26
+<
+You can lookup the meaning of these codes in cURL's manual:
+
+ http://curl.haxx.se/docs/manpage.html#EXIT
+
+------------------------------------------------------------------------------
+7. W3 *syntastic-html-w3*
+
+Name: w3
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"W3" is the W3C Markup Validator for HTML. See the project's page for
+details:
+
+ https://validator.w3.org/source/
+
+As a syntastic checker, you can validate your files against the online service
+(see http://validator.w3.org/), or you can install it from sources and run it
+as a local service:
+
+ https://github.com/w3c/markup-validator/
+
+Requirement~
+
+This checker uses cURL:
+
+ http://curl.haxx.se/
+
+Checker options~
+
+ *'g:syntastic_html_w3_api'*
+Type: string
+Default: "http://validator.w3.org/check"
+URL of the service to use for checking. Leave it to the default to
+run the checks against "http://validator.w3.org/", or set it to
+"http://localhost/w3c-validator/check" if you're running a local service.
+
+ *'g:syntastic_html_w3_exec'*
+Type: string
+Default: "curl"
+Path to the "cURL" executable. Override it with a full path if your "cURL" is
+not installed in a standard location.
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_html_w3_<option>' variables. The only exception is
+'g:syntastic_html_w3_exec', which can be used to override the path to the
+"cURL" executable.
+
+Note~
+
+Non-zero exit codes from "cURL" are typically network errors, and are signaled
+by syntastic with messages such as: >
+ syntastic: error: checker html/validator returned abnormal status 26
+<
+You can lookup the meaning of these codes in cURL's manual:
+
+ http://curl.haxx.se/docs/manpage.html#EXIT
+
+==============================================================================
+SYNTAX CHECKERS FOR JAVA *syntastic-checkers-java*
+
+The following checkers are available for Java (filetype "java"):
+
+ 1. checkstyle...............|syntastic-java-checkstyle|
+ 2. javac....................|syntastic-java-javac|
+
+------------------------------------------------------------------------------
+1. checkstyle *syntastic-java-checkstyle*
+
+Name: checkstyle
+Maintainer: Dmitry Geurkov <d.geurkov@gmail.com>
+
+"Checkstyle" is a style checker for Java. See the project's page for details:
+
+ http://checkstyle.sourceforge.net/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_java_checkstyle_classpath'*
+Type: string
+Default: "checkstyle-6.10.1-all.jar"
+Classpath to use. Multiple files are allowed.
+
+ *'g:syntastic_java_checkstyle_conf_file'*
+Type: string
+Default: "sun_checks.xml"
+Path to the configuration file for the "-c" option (cf.
+http://checkstyle.sourceforge.net/cmdline.html#Command_line_usage).
+
+
+Notes~
+
+1. The checker was tested with "checkstyle" version 5.5. If you're using
+it with version 5.6 or later you should remove DoubleCheckedLocking from
+your configuration file:
+
+ http://stackoverflow.com/a/12798807/1658042
+
+2. At the time of this writing, the "checkstyle" checker doesn't distinguish
+between error severity levels. All messages are treated as errors, regardless
+of their severity defined in the "checkstyle" config file.
+
+3. You can specify a property file: >
+ let g:syntastic_java_checkstyle_post_args =
+ \ ["-p", "/path/to/checkstyle.properties"]
+<
+4. You probably want to download the "fat jar" "checkstyle-*-all.jar" and
+point |'g:syntastic_java_checkstyle_classpath'| to it:
+
+ http://iweb.dl.sourceforge.net/project/checkstyle/checkstyle/
+ http://checkstyle.sourceforge.net/cmdline.html#Usage_by_Classpath_update
+
+Current builds at Maven Central do not package "checkstyles" with its
+dependencies:
+
+ http://search.maven.org/#search|gav|1|g%3A%22com.puppycrawl.tools%22%20AND%20a%3A%22checkstyle%22
+
+However, |'g:syntastic_java_checkstyle_classpath'| accepts multiple files if
+you want to include the "checkstyle" jar and all of its dependencies.
+
+------------------------------------------------------------------------------
+2. javac *syntastic-java-javac*
+
+Name: javac
+Maintainers: Jochen Keil <jochen.keil@gmail.com>
+ Dmitry Geurkov <d.geurkov@gmail.com>
+
+Commands~
+
+The following commands are available:
+
+ *:SyntasticJavacEditClasspath*
+This opens a new window where you can specify a classpath. Individual paths
+may be specified one per line, or separated by colons ":" on UNIX, or by
+semicolons ";" on Windows.
+
+ *:SyntasticJavacEditConfig*
+This command relevant only if |'g:syntastic_java_javac_config_file_enabled'|
+is set. It opens a buffer where you can specify project-specific options from
+the list below. These options will be saved in a file pointed to by
+|'g:syntastic_java_javac_config_file'| (".syntastic_javac_config" by default).
+Set |'g:syntastic_java_javac_config_file'| to a full path to use a
+project-wide configuration file, rather than a file in the current directory.
+The settings have to be specified as Vim commands.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_java_javac_executable'*
+Type: string
+Default: "javac"
+Compiler executable used for checking files.
+
+ *'g:syntastic_java_maven_executable'*
+Type: string
+Default: "mvn"
+Maven executable used for loading classpath for "maven" projects.
+
+ *'g:syntastic_java_javac_options'*
+Type: string
+Default: "-Xlint"
+Options for "javac".
+
+ *'g:syntastic_java_javac_classpath'*
+Type: string
+Default: ""
+Classpath. It can be changed by running the `:SyntasticJavacEditClasspath`
+command.
+
+ *'g:syntastic_java_javac_delete_output'*
+Type: boolean
+Default: 1
+When set the checker will delete the ".class" files created by "javac".
+
+ *'g:syntastic_java_javac_autoload_maven_classpath'*
+Type: boolean
+Default: 1
+If enabled and a file "pom.xml" is found in the current working directory,
+"maven" is used to load classpath.
+
+ *'g:syntastic_java_javac_config_file'*
+Type: string
+Default: ".syntastic_javac_config"
+Path to the configuration file used by "javac". As usual, if a filename is
+specified rather than a full path, the file is created and looked for in the
+current directory.
+
+ *'g:syntastic_java_javac_config_file_enabled'*
+Type: boolean
+Default: 0
+When enabled, the classpath is written to the file pointed to by
+|'g:syntastic_java_javac_config_file'|. The file is created as needed.
+You can edit this file with the `:SyntasticJavacEditClasspath` command.
+The change will take effect next time you run the checker.
+
+ *'g:syntastic_java_javac_custom_classpath_command'*
+Type: string
+Default: ""
+Custom command to run in order to get the classpath. The command classpath
+output can be in traditional Java form, or specified on separate lines.
+"%file_path%", "%FILE_NAME%", and "%FILE_DIR%" are expanded to the current
+file's full path, filename, and base directory respectively, all of them
+escaped for use in a shell command.
+
+Using Ant~
+
+When using "ant" (http://ant.apache.org/) you can have a custom build target
+(named for example "path") that will output your project's classpath. You can
+then use `:SyntasticJavacEditConfig` and add the following line to use it with
+"javac" checker: >
+ let g:syntastic_java_javac_custom_classpath_command =
+ \ "ant -q path | grep echo | cut -f2- -d] | tr -d ' ' | tr ':' '\n'"
+<
+Using Gradle~
+
+For "Gradle" projects (http://gradle.org/) you might consider using
+"gradle-syntastic-plugin":
+
+ https://github.com/Scuilion/gradle-syntastic-plugin
+
+This will write the relevant classpath to a file ".syntastic_javac_config".
+
+==============================================================================
+SYNTAX CHECKERS FOR JAVASCRIPT *syntastic-checkers-javascript*
+
+The following checkers are available for JavaScript (filetype "javascript"):
+
+ 1. Closure Compiler.........|syntastic-javascript-closurecompiler|
+ 2. ESLint...................|syntastic-javascript-eslint|
+ 3. Flow.....................|syntastic-javascript-flow|
+ 4. gjslint..................|syntastic-javascript-gjslint|
+ 5. JavaScript Lint..........|syntastic-javascript-jsl|
+ 6. JSCS.....................|syntastic-javascript-jscs|
+ 7. JSHint...................|syntastic-javascript-jshint|
+ 8. JSLint...................|syntastic-javascript-jslint|
+ 9. JSXHint..................|syntastic-javascript-jsxhint|
+ 10. mixedindentlint.........|syntastic-javascript-mixedindentlint|
+ 11. standard................|syntastic-javascript-standard|
+ 12. tern-lint...............|syntastic-javascript-tern_lint|
+
+------------------------------------------------------------------------------
+1. Closure Compiler *syntastic-javascript-closurecompiler*
+
+Name: closurecompiler
+Maintainer: Motohiro Takayama <mootoh@gmail.com>
+
+"Closure Compiler" is a compiler for JavaScript maintained by Google. See the
+project's page for details:
+
+ https://developers.google.com/closure/compiler/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_javascript_closurecompiler_path'*
+Type: string
+Default: unset
+Path to "google-closure-compiler.jar"
+
+ *'g:syntastic_javascript_closurecompiler_script'*
+Type: string
+Default: unset
+Path to a "closurecompiler" executable script.
+
+Note~
+
+In order to enable the checker you have to set exactly one of the options
+above. If you have a package manager (such as "Homebrew") that installs a
+shell script that runs "Closure Compiler", point
+|'g:syntastic_javascript_closurecompiler_script'| to that script. Otherwise
+set |'g:syntastic_javascript_closurecompiler_path'| to point to the "Closure
+Compiler" jar file.
+
+------------------------------------------------------------------------------
+2. ESLint *syntastic-javascript-eslint*
+
+Name: eslint
+Maintainer: Maksim Ryzhikov <rv.maksim@gmail.com>
+
+"ESLint" is a tool for identifying and reporting on patterns found in
+ECMAScript/JavaScript code. See the project's page for details:
+
+ https://github.com/nzakas/eslint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You can also use "eslint_d" (https://github.com/mantoni/eslint_d.js),
+version 2.1.0 or later, instead of "ESLint". Just point
+'g:syntastic_javascript_eslint_exec' to it:
+
+ https://github.com/mantoni/eslint_d.js#editor-integration
+
+See also: |syntastic-html-eslint|, |syntastic-typescript-eslint|.
+
+------------------------------------------------------------------------------
+3. Flow *syntastic-javascript-flow*
+
+Name: flow
+Maintainer: Michael Robinson <mike@pagesofinterest.net>
+
+"Flow" is a static type checker for JavaScript, written by Facebook. See the
+project's page for details:
+
+ http://flowtype.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Notes~
+
+Syntastic requires "Flow" version 0.6 or later.
+
+To use "Flow" with your projects, you must:
+
+a. Install it:
+
+ https://github.com/sindresorhus/flow-bin
+
+b. Configure your project:
+>
+ cd /path/to/your/project
+ flow init
+<
+c. Read the docs to find out more. It won't work out of the box.
+
+ http://flowtype.org/docs/existing.html
+
+------------------------------------------------------------------------------
+4. gjslint *syntastic-javascript-gjslint*
+
+Name: gjslint
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"Closure Linter", or "gjslint", is a style checker for JavaScript. See the
+project's page for more information:
+
+ https://developers.google.com/closure/utilities/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-html-gjslint|.
+
+------------------------------------------------------------------------------
+5. JavaScript Lint *syntastic-javascript-jsl*
+
+Name: jsl
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+For details about "JavaScript Lint" see the project's page:
+
+ http://www.javascriptlint.com/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+6. JSCS *syntastic-javascript-jscs*
+
+Name: jscs
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"JSCS" is a code style checker for JavaScript. See the project's page for
+more information:
+
+ https://github.com/mdevils/node-jscs
+
+Syntastic requires "JSCS" version 0.2.0 or later.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+7. JSHint *syntastic-javascript-jshint*
+
+Name: jshint
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"JSHint" is a tool to detect errors and potential problems in JavaScript
+files. See the project's page for details:
+
+ http://jshint.com/
+
+Syntastic requires "JSHint" version 1.0.0 or later.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Notes~
+
+If you're checking files containing tab characters then "JSHint"'s idea of
+tabstop must match Vim's 'tabstop', otherwise syntastic will highlight the
+errors at shifted positions. By default "JSHint"'s tabstop is 4, while Vim's
+default 'tabstop' is 8.
+
+In order to change "JSHint"'s tabstop you have to change its "indent" config
+option (cf. http://jshint.com/docs/options/#indent). One way to do that is
+to put it in a file named ".jshintrc" in the current directory, the parent
+directories, or your home directory. The file is supposed to be in JSON
+format. For example: >
+ {
+ "indent": 8
+ }
+<
+See JSHint documentation for more details:
+
+ http://jshint.com/docs/
+
+Please note however that setting "indent" also triggers the indentation checks
+in "JSHint". If that is undesirable, your only other option is to leave
+"JSHint"'s tabstop alone, and change Vim's 'tabstop' to 4. To change Vim's
+'tabstop', you can add this to your vimrc: >
+ set tabstop=4
+<
+See also: |syntastic-html-jshint|, |syntastic-xhtml-jshint|.
+
+------------------------------------------------------------------------------
+8. JSLint *syntastic-javascript-jslint*
+
+Name: jslint
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"JSLint" is a code quality checker for JavaScript. See the program's page for
+details:
+
+ http://www.jslint.com/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+By default the checker calls "JSLint" with these options: >
+ --white --nomen --regexp --plusplus --bitwise --newcap --sloppy --vars
+<
+This can be changed by setting 'g:syntastic_javascript_jslint_args' in your
+vimrc to your own list of options, for example: >
+ let g:syntastic_javascript_jslint_args =
+ \ "--nomen --regexp --browser --devel --windows --sloppy --vars"
+<
+Setting this variable to the empty string "" is allowed, and instructs
+syntastic to call "JSLint" with no options.
+
+------------------------------------------------------------------------------
+9. JSXHint *syntastic-javascript-jsxhint*
+
+Name: JSXHint
+Maintainer: Thomas Boyt <me@thomasboyt.com>
+
+"JSXHint" is a wrapper around JSHint (http://jshint.com/) for
+linting JSX syntax, which is inline markup-in-JS used by React
+(http://facebook.github.io/react/docs/getting-started.html).
+
+See the project's page for details:
+
+ https://github.com/strml/jsxhint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Installation~
+
+Install it with "npm": >
+ npm install -g jsxhint
+<
+Syntastic requires "JSXHint" version v0.4.1 or later. You also need "JSHint"
+v1.1.0 or later.
+
+Note~
+
+Since "JSXHint" is a wrapper around JSHint, the following note relevant to
+the latter still applies:
+
+If you're checking files containing tab characters then JSHint's idea of
+tabstop must match Vim's 'tabstop', otherwise syntastic will highlight the
+errors at shifted positions. By default JSHint's tabstop is 4, while Vim's
+default 'tabstop' is 8.
+
+In order to change "JSHint"'s tabstop you have to change its "indent" config
+option (http://jshint.com/docs/options/#indent). One way to do that is to
+put it in a file named ".jshintrc" in the current directory, the parent
+directories, or your home directory. The file is supposed to be in JSON
+format. For example: >
+ {
+ "indent": 8
+ }
+<
+See JSHint documentation for more details:
+
+ http://jshint.com/docs/
+
+Please note however that setting "indent" also triggers the indentation checks
+in JSHint. If that is undesirable, your only other option is to leave JSHint's
+tabstop alone, and change Vim's 'tabstop' to 4. To change Vim's 'tabstop', you
+can add this to your 'vimrc': >
+ set tabstop=4
+<
+Alternative~
+
+"JSXHint" will not show JSX-related errors in syntastic, because failed JSX
+compiles will result in the uncompiled data being passed to JSHint:
+
+ https://github.com/STRML/JSXHint/issues/45
+
+To get around this, "Syntastic-React" can be used as a replacement for
+"JSXHint":
+
+ https://github.com/jaxbot/syntastic-react
+
+------------------------------------------------------------------------------
+10. mixedindentlint *syntastic-javascript-mixedindentlint*
+
+Name: mixedindentlint
+Maintainer: Payton Swick <payton@foolord.com>
+
+"mixedindentlint" is a general-purpose indentation checker. See the project's
+page at GitHub for more information:
+
+ https://github.com/sirbrillig/mixedindentlint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-css-mixedindentlint|, |syntastic-scss-mixedindentlint|.
+
+------------------------------------------------------------------------------
+11. standard *syntastic-javascript-standard*
+
+Name: standard
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Standard" is a code style checker for JavaScript. See the project's page for
+more information:
+
+ https://github.com/feross/standard
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_javascript_standard_generic'*
+Type: boolean
+Default: 0
+Flag that can be used to disable version checks for "standard".
+
+Note~
+
+Most forks of "standard" can also be used with syntastic. Just
+set 'g:syntastic_javascript_standard_generic' to 1, and point
+'g:syntastic_javascript_standard_exec' to the fork's executable. For
+example to use happiness (https://github.com/JedWatson/happiness) instead of
+"standard": >
+ let g:syntastic_javascript_checkers = ["standard"]
+ let g:syntastic_javascript_standard_exec = "happiness"
+ let g:syntastic_javascript_standard_generic = 1
+<
+------------------------------------------------------------------------------
+12. tern-lint *syntastic-javascript-tern_lint*
+
+Name: tern_lint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"tern-lint" is a static type checker for JavaScript. See the project's page
+for more information:
+
+ https://github.com/angelozerr/tern-lint
+
+Syntastic requires a version of Vim compiled with the |+byte_offset| feature
+to use this checker.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+"tern-lint" recursively scans files starting from (Vim's idea of) the current
+directory, regardless of the current file.
+
+==============================================================================
+SYNTAX CHECKERS FOR JSON *syntastic-checkers-json*
+
+The following checkers are available for JSON (filetype "json"):
+
+ 1. JSONLint.................|syntastic-json-jsonlint|
+ 2. jsonval..................|syntastic-json-jsonval|
+
+------------------------------------------------------------------------------
+1. JSONLint *syntastic-json-jsonlint*
+
+Name: jsonlint
+Maintainer: Miller Medeiros <contact@millermedeiros.com>
+
+"JSONLint" is a validator for JSON. See the project's page for details:
+
+ http://jsonlint.com/
+
+Installation~
+
+Install it with: >
+ npm install -g jsonlint
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. jsonval *syntastic-json-jsonval*
+
+Name: jsonval
+Maintainer: Miller Medeiros <contact@millermedeiros.com>
+
+"jsonval" is a validator for JSON. See the project's page at GitHub for
+details:
+
+ https://github.com/dangerousben/jsonval
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR LESS *syntastic-checkers-less*
+
+The following checkers are available for LESS (filetype "less"):
+
+ 1. lessc....................|syntastic-less-lessc|
+ 2. RECESS...................|syntastic-less-recess|
+
+------------------------------------------------------------------------------
+1. lessc *syntastic-less-lessc*
+
+Name: lessc
+Maintainer: Julien Blanchard <julien@sideburns.eu>
+
+"lessc" is a compiler for LESS. See the project's page for details:
+
+ http://lesscss.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+ *'g:syntastic_less_use_less_lint'*
+Type: boolean
+Default: 0
+Flag that can be set to instruct syntastic to run "less-lint" instead of
+"less".
+
+------------------------------------------------------------------------------
+2. RECESS *syntastic-less-recess*
+
+Name: recess
+Maintainer: Tim Carry <tim@pixelastic.com>
+
+"RECESS" is a code quality tool for CSS built on top of LESS. See the
+project's page for details:
+
+ http://twitter.github.io/recess/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-css-recess|.
+
+==============================================================================
+SYNTAX CHECKERS FOR LEX *syntastic-checkers-lex*
+
+The following checkers are available for Lex (filetype "lex"):
+
+ 1. flex.....................|syntastic-lex-flex|
+
+------------------------------------------------------------------------------
+1. flex *syntastic-lex-flex*
+
+Name: flex
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Flex" is the GNU implementation of the standard UNIX lexical analyzer "lex"
+(http://en.wikipedia.org/wiki/Lex_programming_tool). See the project's page
+for more information:
+
+ http://flex.sourceforge.net/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR LIMBO *syntastic-checkers-limbo*
+
+The following checkers are available for Limbo (filetype "limbo"):
+
+ 1. Limbo....................|syntastic-limbo-limbo|
+
+------------------------------------------------------------------------------
+1. Limbo *syntastic-limbo-limbo*
+
+Name: limbo
+Maintainer: Alex Efros <powerman-asdf@ya.ru>
+
+"Limbo" is a compiler for the Limbo language
+(http://doc.cat-v.org/inferno/4th_edition/limbo_language/), the
+language used to write applications for the "Inferno" operating system
+(http://doc.cat-v.org/inferno/). See the "Inferno" project's page for
+a reference implementation:
+
+ http://code.google.com/p/inferno-os/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR LISP *syntastic-checkers-lisp*
+
+The following checkers are available for LISP (filetype "lisp"):
+
+ 1. CLISP....................|syntastic-lisp-clisp|
+
+------------------------------------------------------------------------------
+1. CLISP *syntastic-lisp-clisp*
+
+Name: clisp
+Maintainer: Karl Yngve Lervåg <karl.yngve@lervag.net>
+
+"CLISP" is an interpreter for LISP programs. See the project's page for
+details:
+
+ http://www.clisp.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR LLVM *syntastic-checkers-llvm*
+
+The following checkers are available for LLVM (filetype "llvm"):
+
+ 1. LLVM.....................|syntastic-llvm-llvm|
+
+------------------------------------------------------------------------------
+1. LLVM *syntastic-llvm-llvm*
+
+Name: llvm
+Maintainer: Andrew Kelley <superjoe30@gmail.com>
+
+"LLVM" is the intermediate language for the LLVM compilers (http://llvm.org/).
+See the reference manual for details:
+
+ http://llvm.org/docs/LangRef.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR LUA *syntastic-checkers-lua*
+
+The following checkers are available for Lua (filetype "lua"):
+
+ 1. luac.....................|syntastic-lua-luac|
+ 2. luacheck.................|syntastic-lua-luacheck|
+
+------------------------------------------------------------------------------
+1. luac *syntastic-lua-luac*
+
+Name: luac
+Maintainer: Gregor Uhlenheuer <kongo2002@gmail.com>
+
+"luac" is a compiler for Lua. See the tool's manual for details:
+
+ http://www.lua.org/manual/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+"luac" truncates filenames when the full path of the files involved is longer
+than a certain fixed amount. Syntastic can't detect this situation, and will
+silently ignore error messages with truncated filenames.
+
+------------------------------------------------------------------------------
+2. luacheck *syntastic-lua-luacheck*
+
+Name: luacheck
+Maintainer: Thiago Bastos <tbastos@tbastos.com>
+
+"Luacheck" is a tool for static analysis of Lua code. See the project's page
+for details:
+
+ https://github.com/mpeterv/luacheck
+
+In contrast to "luac" (see |syntastic-lua-luac|) which only flags syntax
+errors, this checker detects code smells, so you probably want to enable both
+when available.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+A sensible set of options for LUA projects might be something like this: >
+ let g:syntastic_check_on_open = 1
+ let g:syntastic_lua_checkers = ["luac", "luacheck"]
+ let g:syntastic_lua_luacheck_args = "--no-unused-args"
+<
+==============================================================================
+SYNTAX CHECKERS FOR MARKDOWN *syntastic-checkers-markdown*
+
+The following checkers are available for Markdown (filetype "markdown"):
+
+ 1. Markdown lint tool.......|syntastic-markdown-mdl|
+ 2. textlint.................|syntastic-markdown-textlint|
+
+------------------------------------------------------------------------------
+1. Markdown lint tool *syntastic-markdown-mdl*
+
+Name: mdl
+Maintainer: Charles Beynon <etothepiipower@gmail.com>
+
+"Markdown lint tool" is a style checker for Markdown files. See the project's
+page at GitHub for details:
+
+ https://github.com/mivok/markdownlint
+
+Installation~
+
+Install it with: >
+ gem install mdl
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You can also use the "Node.js"-based "markdownlint-cli" as a checker instead
+of "mdl":
+
+ https://github.com/igorshubovych/markdownlint-cli
+
+To do that, you have to point 'g:syntastic_markdown_mdl_exec' to
+"markdownlint", and set 'g:syntastic_markdown_mdl_args' to an empty string (or
+to a set of valid "markdownlint-cli" options): >
+ let g:syntastic_markdown_mdl_exec = "markdownlint"
+ let g:syntastic_markdown_mdl_args = ""
+<
+------------------------------------------------------------------------------
+2. textlint *syntastic-markdown-textlint*
+
+Name: textlint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"textlint" is a natural language linter for text, Markdown, and HTML files.
+See the project's page for details:
+
+ https://textlint.github.io/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-html-textlint|, |syntastic-text-textlint|.
+
+==============================================================================
+SYNTAX CHECKERS FOR MATLAB *syntastic-checkers-matlab*
+
+The following checkers are available for MATLAB (filetype "matlab"):
+
+ 1. mlint....................|syntastic-matlab-mlint|
+
+------------------------------------------------------------------------------
+1. mlint *syntastic-matlab-mlint*
+
+Name: mlint
+Maintainer: Jason Graham <jason@the-graham.com>
+
+"mlint" is a code checker for MATLAB. The "mlint" binary is distributed with
+the "MATLAB" package:
+
+ http://www.mathworks.com/help/matlab/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR MERCURY *syntastic-checkers-mercury*
+
+The following checkers are available for Mercury (filetype "mercury"):
+
+ 1. mmc......................|syntastic-mercury-mmc|
+
+------------------------------------------------------------------------------
+1. mmc *syntastic-mercury-mmc*
+
+Name: mmc
+Maintainer: Joshua Rahm <joshuarahm@gmail.com>
+
+"mmc" is a compiler for Mercury. See Mercury's page for more details:
+
+ http://www.mercurylang.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR NASM *syntastic-checkers-nasm*
+
+The following checkers are available for NASM (filetype "nasm"):
+
+ 1. nasm.....................|syntastic-nasm-nasm|
+
+------------------------------------------------------------------------------
+1. nasm *syntastic-nasm-nasm*
+
+Name: nasm
+Maintainer: HĂĽvard Pettersson <haavard.pettersson@gmail.com>
+
+"NASM" is an assembler and disassembler for the Intel x86 architecture. See
+the project's page for details:
+
+ http://www.nasm.us/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR NIX *syntastic-checkers-nix*
+
+The following checkers are available for Nix (filetype "nix"):
+
+ 1. Nix......................|syntastic-nix-nix|
+
+------------------------------------------------------------------------------
+1. Nix *syntastic-nix-nix*
+
+Name: nix
+Maintainer: Tim Cuthbertson <tim@gfxmonk.net>
+
+"Nix" is a checker for language "Nix" using "nix-instantiate". See the
+project's page for details:
+
+ http://nixos.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR NROFF *syntastic-checkers-nroff*
+
+The following checkers are available for nroff (filetype "nroff"):
+
+ 1. Igor.....................|syntastic-nroff-igor|
+ 2. mandoc...................|syntastic-nroff-mandoc|
+
+------------------------------------------------------------------------------
+1. Igor *syntastic-nroff-igor*
+
+Name: igor
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Igor" is a proofreader for DocBook SGML, man pages, and text files used by
+the FreeBSD project (https://www.freebsd.org/). See the author's presentation
+for details:
+
+ http://www.youtube.com/watch?v=sczHqUPygZY
+
+The latest version can be obtained from Glen Barber's repository:
+
+ http://docscripts.glenbarber.us/tags/igor/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-docbk-igor|, |syntastic-text-igor|.
+
+------------------------------------------------------------------------------
+2. mandoc *syntastic-nroff-mandoc*
+
+Name: mandoc
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+See the project's page for details:
+
+ http://mdocml.bsd.lv/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR OBJECTIVE-C *syntastic-checkers-objc*
+
+The following checkers are available for Objective-C (filetype "objc"):
+
+ 1. GCC......................|syntastic-objc-gcc|
+ 2. OClint...................|syntastic-objc-oclint|
+
+------------------------------------------------------------------------------
+1. GCC *syntastic-objc-gcc*
+
+Name: gcc
+Maintainer: Gregor Uhlenheuer <kongo2002@gmail.com>
+
+Checker options~
+ *'g:syntastic_objc_compiler'*
+Type: string
+Default: "gcc", or "clang" if GCC is not found
+Compiler executable.
+
+ *'g:syntastic_objc_errorformat'*
+Type: string
+Default: unset
+Override for the default |'errorformat'|.
+
+ *'g:syntastic_objc_remove_include_errors'*
+Type: boolean
+Default: 0
+By default, errors in files included from the file being checked are shown.
+Set this variable to 1 to remove messages about errors in included files.
+Please note that this means syntastic will silently abort checks if there are
+fatal errors in one of the included files.
+
+ *'g:syntastic_objc_compiler_options'*
+Type: string
+Default: unset
+Compilation flags (such as defines or include directories) to be passed to the
+checker.
+
+ *'g:syntastic_objc_config_file'*
+Type: string
+Default: ".syntastic_objc_config"
+File containing additional compilation flags to be passed to the checker, one
+option per line (cf. |syntastic-config-files|).
+
+ *'g:syntastic_objc_include_dirs'*
+Type: array of strings
+Default: []
+Include directories to be passed to the checker, in addition to the above
+compilation flags. You can set it like this: >
+ let g:syntastic_objc_include_dirs = ["includes", "headers"]
+<
+and the corresponding "-Iincludes -Iheaders" will be added to the compilation
+flags.
+
+ *'g:syntastic_objc_no_default_include_dirs'*
+Type: boolean
+Default: 0
+By default syntastic adds a number of common include directories to the
+compilation flags, namely: >
+ -I. -I.. -Iinclude -Iincludes -I../include -I../includes
+<
+You can disable this behaviour by setting the above variable to 1.
+
+ *'b:syntastic_objc_cflags'*
+Type: string
+Default: unset
+Buffer-local variable. Additional compilation flags specific to the current
+buffer.
+
+ *'g:syntastic_objc_check_header'*
+Type: boolean
+Default: 0
+If the current file is a header (namely if its extension is "h"), all checks
+are silently skipped. You can force syntastic to check header files by
+setting the above variable to 1.
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_objc_gcc_<option>' variables. The only exception is
+'g:syntastic_objc_gcc_exec', which can still be used to override the checker's
+executable.
+
+See also: |syntastic-objcpp-gcc|.
+
+------------------------------------------------------------------------------
+2. OClint *syntastic-objc-oclint*
+
+Name: oclint
+Maintainer: "UnCO" Lin <undercooled@lavabit.com>
+
+"OClint" is a static code analysis tool. See the project's page for details:
+
+ http://oclint.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ 'g:syntastic_oclint_config_file'
+Type: string
+Default: ".syntastic_oclint_config"
+File containing compilation flags (such as defines or include directories),
+one option per line (cf. |syntastic-config-files|).
+
+See also: |syntastic-objcpp-oclint|.
+
+==============================================================================
+SYNTAX CHECKERS FOR OBJECTIVE-C++ *syntastic-checkers-objcpp*
+
+The following checkers are available for Objective-C++ (filetype "objcpp"):
+
+ 1. GCC......................|syntastic-objcpp-gcc|
+ 2. OClint...................|syntastic-objcpp-oclint|
+
+------------------------------------------------------------------------------
+1. GCC *syntastic-objcpp-gcc*
+
+Name: gcc
+Maintainer: Gregor Uhlenheuer <kongo2002@gmail.com>
+
+Checker options~
+ *'g:syntastic_objcpp_compiler'*
+Type: string
+Default: "gcc", or "clang" if GCC is not found
+Compiler executable.
+
+ *'g:syntastic_objcpp_errorformat'*
+Type: string
+Default: unset
+Override for the default |'errorformat'|.
+
+ *'g:syntastic_objcpp_remove_include_errors'*
+Type: boolean
+Default: 0
+By default, errors in files included from the file being checked are shown.
+Set this variable to 1 to remove messages about errors in included files.
+Please note that this means syntastic will silently abort checks if there are
+fatal errors in one of the included files.
+
+ *'g:syntastic_objcpp_compiler_options'*
+Type: string
+Default: unset
+Compilation flags (such as defines or include directories) to be passed to the
+checker.
+
+ *'g:syntastic_objcpp_config_file'*
+Type: string
+Default: ".syntastic_objcpp_config"
+File containing additional compilation flags to be passed to the checker, one
+option per line (cf. |syntastic-config-files|).
+
+ *'g:syntastic_objcpp_include_dirs'*
+Type: array of strings
+Default: []
+Include directories to be passed to the checker, in addition to the above
+compilation flags. You can set it like this: >
+ let g:syntastic_objcpp_include_dirs = ["includes", "headers"]
+<
+and the corresponding "-Iincludes -Iheaders" will be added to the compilation
+flags.
+
+ *'g:syntastic_objcpp_no_default_include_dirs'*
+Type: boolean
+Default: 0
+By default syntastic adds a number of common include directories to the
+compilation flags, namely: >
+ -I. -I.. -Iinclude -Iincludes -I../include -I../includes
+<
+You can disable this behaviour by setting the above variable to 1.
+
+ *'b:syntastic_objcpp_cflags'*
+Type: string
+Default: unset
+Buffer-local variable. Additional compilation flags specific to the current
+buffer.
+
+ *'g:syntastic_objcpp_check_header'*
+Type: boolean
+Default: 0
+If the current file is a header (namely if its extension is "h"), all checks
+are silently skipped. You can force syntastic to check header files by
+setting the above variable to 1.
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_objcpp_gcc_<option>' variables. The only exception
+is 'g:syntastic_objcpp_gcc_exec', which can still be used to override the
+checker's executable.
+
+See also: |syntastic-objc-gcc|.
+
+------------------------------------------------------------------------------
+2. OClint *syntastic-objcpp-oclint*
+
+Name: oclint
+Maintainer: "UnCO" Lin <undercooled@lavabit.com>
+
+"OClint" is a static code analysis tool. See the project's page for details:
+
+ http://oclint.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ 'g:syntastic_oclint_config_file'
+Type: string
+Default: ".syntastic_oclint_config"
+File containing compilation flags (such as defines or include directories),
+one option per line (cf. |syntastic-config-files|).
+
+See also: |syntastic-objc-oclint|.
+
+==============================================================================
+SYNTAX CHECKERS FOR OCAML *syntastic-checkers-ocaml*
+
+The following checkers are available for OCaml (filetype "ocaml"):
+
+ 1. camlp4o..................|syntastic-ocaml-camlp4o|
+
+------------------------------------------------------------------------------
+1. camlp4o *syntastic-ocaml-camlp4o*
+
+Name: camlp4o
+Maintainer: Tőrők Edwin <edwintorok@gmail.com>
+
+"ocamlc" is a compiler for Caml. See the project's page for details:
+
+ http://caml.inria.fr/
+
+Checker options~
+ *'g:syntastic_ocaml_use_ocamlc'*
+Type: boolean
+Default: 0
+Enable this variable to use "ocamlc".
+
+ *'g:syntastic_ocaml_use_janestreet_core'*
+Type: boolean
+Default: 0
+It's possible to use "ocamlc" in conjunction with Jane Street's "core". In
+order to do that you have to set the above variable.
+
+ *'g:syntastic_ocaml_janestreet_core_dir'*
+Type: string
+Default: "."
+Path to Jane Street's "core".
+
+ *'g:syntastic_ocaml_camlp4r'*
+Type: boolean
+Default: 0
+By default, .ml and .mli files are checked with the "camlp4o" preprocessor,
+.mll with "ocamllex", and .mly with "menhir". If your source code requires
+"camlp4r" you can set this variable.
+
+ *'g:syntastic_ocaml_use_ocamlbuild'*
+Type: boolean
+Default: 0
+Whether to enable typechecking and syntax extensions. This tells syntastic to
+run "ocamlbuild <name>.inferred.mli". It writes object files to the "_build"
+directory, and possibly rebuilds your "myocamlbuild.ml" plugin. If you are
+using syntax extensions / external libraries and have a properly set up
+"_tags" (and "myocamlbuild.ml" file), setting this flag should just work. For
+best results your current directory should be the project root (same situation
+if you want useful output from `:make`).
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_ocaml_camlp4o_<option>' variables.
+
+Note~
+
+You might consider using the checkers packaged with Merlin instead of this
+one. They provide type errors and let you use packages outside core:
+
+ https://github.com/the-lambda-church/merlin
+
+==============================================================================
+SYNTAX CHECKERS FOR PERL *syntastic-checkers-perl*
+
+The following checkers are available for Perl (filetype "perl"):
+
+ 1. perl.....................|syntastic-perl-perl|
+ 2. Perl::Critic.............|syntastic-perl-perlcritic|
+ 3. Pod::Checker.............|syntastic-perl-podchecker|
+
+------------------------------------------------------------------------------
+1. perl *syntastic-perl-perl*
+
+Name: perl
+Maintainers: Anthony Carapetis <anthony.carapetis@gmail.com>
+ Eric Harmon
+
+Security~
+
+This checker runs "perl -c" against your files, which in turn executes any
+"BEGIN", "UNITCHECK", and "CHECK" blocks, and any "use" statements in your
+file (cf. http://perldoc.perl.org/perlrun.html#*-c*). This is probably fine if
+you wrote the file yourself, but it can be a problem if you're trying to check
+third party files. If you are 100% willing to let Vim run the code in your
+file, set 'g:syntastic_enable_perl_checker' to 1 in your vimrc to enable this
+checker: >
+ let g:syntastic_enable_perl_checker = 1
+<
+There is also a buffer-local version of this variable, that takes precedence
+over it in the buffers where it is defined.
+
+Please note that setting this variable doesn't automatically enable the
+checker, you still need to add it to 'g:syntastic_perl_checkers' if you plan
+to use it.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_perl_interpreter'*
+Type: string
+Default: "perl"
+The perl interpreter to use.
+
+ *'g:syntastic_perl_lib_path'*
+Type: list os strings
+Default: []
+List of include directories to be added to the perl command line. Example: >
+ let g:syntastic_perl_lib_path = [ "./lib", "./lib/auto" ]
+<
+Note~
+
+The variable |'g:syntastic_perl_interpreter'| is shared with the YAML::XS
+checker (cf. |syntastic-yaml-yamlxs|). If for some reasons you don't want to
+use the same interpreter for both checkers, you can override it locally by
+setting 'g:syntastic_perl_perl_exec'.
+
+------------------------------------------------------------------------------
+2. Perl::Critic *syntastic-perl-perlcritic*
+
+Name: perlcritic
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Perl::Critic" is a static analyzer for Perl. See the project's page for
+details:
+
+ http://perlcritic.com/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_perl_perlcritic_thres'*
+Type: integer
+Default: 5
+Error threshold: policy violations with a severity above this value are
+highlighted as errors, the others are warnings.
+
+Note~
+
+You can override the format of "perlcritic" messages, for example: >
+ let g:syntastic_perl_perlcritic_post_args =
+ \ '--verbose "\%s:\%f:\%l:\%c: \%p: \%m\n"'
+<
+Just make sure to leave alone the leading "\%s:\%f:\%l:\%c:".
+
+------------------------------------------------------------------------------
+3. Pod::Checker *syntastic-perl-podchecker*
+
+Name: podchecker
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Pod::Checker" is a checker for pod documents. See the module's manual for
+details:
+
+ http://perldoc.perl.org/Pod/Checker.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-pod-podchecker|.
+
+==============================================================================
+SYNTAX CHECKERS FOR PHP *syntastic-checkers-php*
+
+The following checkers are available for PHP (filetype "php"):
+
+ 1. PHP......................|syntastic-php-php|
+ 2. PHP_CodeSniffer..........|syntastic-php-phpcs|
+ 3. PHPLint..................|syntastic-php-phplint|
+ 4. PHP Mess Detector........|syntastic-php-phpmd|
+
+------------------------------------------------------------------------------
+1. PHP *syntastic-php-php*
+
+Name: php
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. PHP_CodeSniffer *syntastic-php-phpcs*
+
+Name: phpcs
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"PHP_CodeSniffer" is a style checker for PHP and CSS. See the project's page
+at GitHub for details:
+
+ https://github.com/squizlabs/PHP_CodeSniffer/
+
+Installation~
+
+Install it with: >
+ pear install PHP_CodeSniffer
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+If you're checking files containing tab characters then "PHP_CodeSniffer"'s
+idea of tabstop must match Vim's 'tabstop', otherwise syntastic will highlight
+the errors at shifted positions. By default syntastic does that by adding
+an option "--tab-width=&tabstop" to "PHP_CodeSniffer", but that option
+also instructs "PHP_CodeSniffer" to expand tabs, and some code sniffers
+(f.i. "CakePHP", see https://github.com/cakephp/cakephp-codesniffer) insist on
+indenting lines with tabs. To work around the resulting mess if you're using
+one of these sniffers, set "--tab-width=0" and 'tabstop' to 8: >
+ let g:syntastic_php_phpcs_args = "--tab-width=0"
+ set tabstop=8
+<
+See also: |syntastic-css-phpcs|.
+
+------------------------------------------------------------------------------
+3. PHPLint *syntastic-php-phplint*
+
+Name: phplint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"PHPLint" is a style checker for PHP. See the project's page for details:
+
+ http://www.icosaedro.it/phplint/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+4. PHP Mess Detector *syntastic-php-phpmd*
+
+Name: phpmd
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"PHP Mess Detector" is a code analyzer for PHP. See the project's page for
+details:
+
+ http://phpmd.org
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR POD *syntastic-checkers-pod*
+
+The following checkers are available for POD (filetype "pod"):
+
+ 1. Pod::Checker.............|syntastic-pod-podchecker|
+
+------------------------------------------------------------------------------
+1. Pod::Checker *syntastic-pod-podchecker*
+
+Name: podchecker
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Pod::Checker" is a checker for pod documents. See the module's manual for
+details:
+
+ http://perldoc.perl.org/Pod/Checker.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-perl-podchecker|.
+
+==============================================================================
+SYNTAX CHECKERS FOR PUG (FORMERLY JADE) *syntastic-checkers-pug*
+
+The following checkers are available for Pug (formerly Jade; filetype "pug"):
+
+ 1. pug_lint.................|syntastic-pug-pug_lint|
+
+------------------------------------------------------------------------------
+1. pug_lint *syntastic-pug-pug_lint*
+
+Name: pug_lint
+Maintainer: Ben Parnell <benjaminparnell.94@gmail.com>
+
+"pug-lint" is a linter and style checker for Pug (formerly known as "Jade";
+http://jade-lang.com/). See the project's page at GitHub for details:
+
+ https://github.com/pugjs/pug-lint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR PUPPET *syntastic-checkers-puppet*
+
+The following checkers are available for Puppet (filetype "puppet"):
+
+ 1. puppet...................|syntastic-puppet-puppet|
+ 2. puppet-lint..............|syntastic-puppet-puppetlint|
+
+------------------------------------------------------------------------------
+1. puppet *syntastic-puppet-puppet*
+
+Name: puppet
+Maintainer: Eivind Uggedal <eivind@uggedal.com>
+
+"Puppet" is an automated administrative engine for UNIX systems. See the
+project's page for details:
+
+ http://projects.puppetlabs.com/projects/puppet
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. puppet-lint *syntastic-puppet-puppetlint*
+
+Name: puppetlint
+Maintainer: Eivind Uggedal <eivind@uggedal.com>
+
+"puppet-lint" is a style checker for puppet manifests
+(http://projects.puppetlabs.com/projects/puppet). See the project's page for
+details:
+
+ http://puppet-lint.com/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR PYTHON *syntastic-checkers-python*
+
+The following checkers are available for Python (filetype "python"):
+
+ 1. flake8...................|syntastic-python-flake8|
+ 2. Frosted..................|syntastic-python-frosted|
+ 3. mypy.....................|syntastic-python-mypy|
+ 4. Prospector...............|syntastic-python-prospector|
+ 5. py3kwarn.................|syntastic-python-py3kwarn|
+ 6. pycodestyle..............|syntastic-python-pycodestyle|
+ 7. pydocstyle...............|syntastic-python-pydocstyle|
+ 8. Pyflakes.................|syntastic-python-pyflakes|
+ 9. Pylama...................|syntastic-python-pylama|
+ 10. Pylint..................|syntastic-python-pylint|
+ 11. python..................|syntastic-python-python|
+
+------------------------------------------------------------------------------
+1. flake8 *syntastic-python-flake8*
+
+Name: flake8
+Maintainers: Sylvain Soliman <Sylvain.Soliman+git@gmail.com>
+ kstep <me@kstep.me>
+
+"Flake8" is a wrapper around PyFlakes (https://launchpad.net/pyflakes), pep8
+(https://github.com/jcrocholl/pep8), and Ned Batchelder's McCabe script
+(http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html).
+See the project's page and the official docs for details:
+
+ https://gitlab.com/pycqa/flake8
+ http://flake8.readthedocs.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. Frosted *syntastic-python-frosted*
+
+Name: frosted
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Frosted" is a fork of pyflakes (https://launchpad.net/pyflakes). See the
+project's page for details:
+
+ https://github.com/timothycrosley/frosted
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+3. mypy *syntastic-python-mypy*
+
+Name: mypy
+Maintainer: Russ Hewgill <Russ.Hewgill@gmail.com>
+
+"mypy" is a static type checker for Python. See the project's page for
+details:
+
+ http://www.mypy-lang.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+4. Prospector *syntastic-python-prospector*
+
+Name: prospector
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Prospector" is a static analysis tool for Python. It brings
+together the functionality of other tools such as pylint
+(http://www.pylint.org/), pyflakes (https://launchpad.net/pyflakes),
+pep8 (https://github.com/jcrocholl/pep8), pydocstyle (formerly
+"pep257"; https://github.com/PyCQA/pydocstyle), and McCabe complexity
+(http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html).
+See the project's official documentation for details:
+
+ http://prospector.readthedocs.org/en/latest/
+
+Syntastic supports "Prospector" versions 0.7 and later.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+5. py3kwarn *syntastic-python-py3kwarn*
+
+Name: py3kwarn
+Author: Liam Curry <liam@curry.name>
+
+"Py3kwarn" is a code checker for Python that detects incompatibilities with
+Python 3. See the project's page for details:
+
+ https://github.com/liamcurry/py3kwarn
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+6. pycodestyle *syntastic-python-pycodestyle*
+
+Name: pycodestyle
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"pycodestyle" (formerly "pep8") is a style checker for Python, derived from
+the conventions in PEP 8 (http://www.python.org/dev/peps/pep-0008/). See the
+project's page for details:
+
+ https://github.com/PyCQA/pycodestyle
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+7. pydocstyle *syntastic-python-pydocstyle*
+
+Name: pydocstyle
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"pydocstyle" (formerly "pep257") is a docstring style checker
+for Python, derived from the conventions established in PEP 257
+(http://www.python.org/dev/peps/pep-0257/). See the project's page for
+details:
+
+ https://github.com/PyCQA/pydocstyle
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+8. Pyflakes *syntastic-python-pyflakes*
+
+Name: pyflakes
+Authors: Martin Grenfell <martin.grenfell@gmail.com>
+ kstep <me@kstep.me>
+ Parantapa Bhattacharya <parantapa@gmail.com>
+
+"Pyflakes" is a simple code checker for Python. See the project's page for
+more information:
+
+ https://launchpad.net/pyflakes
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+9. Pylama *syntastic-python-pylama*
+
+Name: pylama
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Pylama" is a wrapper around pep8 (https://github.com/jcrocholl/pep8),
+pydocstyle (formerly "pep257"; https://github.com/PyCQA/pydocstyle),
+Pyflakes (https://launchpad.net/pyflakes),
+Pylint (http://www.pylint.org/), and Ned Batchelder's McCabe script
+(http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html).
+See the project's page for details:
+
+ https://github.com/klen/pylama
+
+Note~
+
+The Pylint backend requires you to install "pylama_pylint":
+
+ https://github.com/klen/pylama_pylint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+10. Pylint *syntastic-python-pylint*
+
+Name: pylint
+Author: Parantapa Bhattacharya <parantapa@gmail.com>
+
+"Pylint" is a code checker for Python. See the project's page for details:
+
+ http://www.pylint.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Notes~
+
+On OS X you need to set the environment variable "LC_CTYPE" to "UTF-8"
+before running Vim: >
+ LC_CTYPE=en_US.UTF-8
+ export LC_CTYPE
+<
+Several people have expressed interest in showing the old message IDs
+along with the error messages. You can override the message format in
+'g:syntastic_python_pylint_post_args'. Please note that the new format must
+start with "{path}:{line}:{column}:{C}: ", otherwise syntastic will not
+recognise any messages. Example: >
+ let g:syntastic_python_pylint_post_args =
+ \ '--msg-template="{path}:{line}:{column}:{C}: [{symbol} {msg_id}] {msg}"'
+<
+------------------------------------------------------------------------------
+11. python *syntastic-python-python*
+
+Name: python
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+This checker uses Python's builtin "compile()" function for detecting syntax
+errors.
+
+Syntastic requires Python version 2.6 or later.
+
+Codecs~
+
+In Python you have the ability to specify a particular codec at the top of
+the file with a special comment that looks something like this: >
+ # coding: spec
+<
+Further references:
+
+ https://docs.python.org/reference/lexical_analysis.html#encoding-declarations
+
+Python will see this comment at import time and use the corresponding codec to
+transform the file before using it. The "python" checker has an option
+|'g:syntastic_python_python_use_codec'| that will make syntastic aware of such
+comments before running compiler checks on the file.
+
+Please note that transforming a file like this affects line numbers and
+column numbers, and syntastic has no way to make the necessary adjustments.
+Consequently, errors might appear on surprising lines if you enable this
+feature and the transformed file has code on different lines than the raw
+file. For this reason the use of these transformations should be limitted
+to codecs that preserve line numbers, such as the "spec" codec provided by
+"NoseOfYeti":
+
+ https://noseofyeti.readthedocs.org/en/latest/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_python_python_use_codec'*
+Type: boolean
+Default: 0
+Enables handling of "# coding: spec" comments.
+
+==============================================================================
+SYNTAX CHECKERS FOR QML *syntastic-checkers-qml*
+
+The following checkers are available for QML (filetype "qml"):
+
+ 1. qmllint..................|syntastic-qml-qmllint|
+
+------------------------------------------------------------------------------
+1. qmllint *syntastic-qml-qmllint*
+
+Name: qmllint
+Maintainer: Peter Wu <peter@lekensteyn.nl>
+
+"qmllint" is a QML syntax verifier. It was introduced with Qt 5.4 (cf.
+https://www.kdab.com/kdab-contributions-qt-5-4-qmllint/) as part of Qt
+Declarative:
+
+ https://code.qt.io/cgit/qt/qtdeclarative.git/tree/tools/qmllint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR R *syntastic-checkers-r*
+
+The following checkers are available for R (filetype "r"):
+
+ 1. lint.....................|syntastic-r-lint|
+ 2. lintr....................|syntastic-r-lintr|
+ 3. svtools..................|syntastic-r-svtools|
+
+------------------------------------------------------------------------------
+1. lint *syntastic-r-lint*
+
+Name: lint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+This is a style checker for R files, using the R package "lint":
+
+ http://cran.r-project.org/web/packages/lint/
+
+Checker option~
+
+ *'g:syntastic_r_lint_styles'*
+Type: string
+Default: "lint.style"
+R list of style tests to apply.
+
+Set 'g:syntastic_r_lint_styles' to something like this: >
+ let g:syntastic_r_lint_styles =
+ \ 'list(spacing.indentation.notabs, spacing.indentation.evenindent)'
+<
+See "lint"'s manual for possible values:
+
+ http://cran.r-project.org/web/packages/lint/lint.pdf
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_r_lint_<option>' variables. The only exception is
+'g:syntastic_r_lint_exec', which can still be used to override the "R"
+executable.
+
+Limitations~
+
+The checker uses column numbers only when running into syntax errors. If
+you're checking files containing tab characters, then Vim's 'tabstop' must
+match R's idea of tabstop, otherwise column numbers will be shifted. At the
+time of this writing R's tabstop is hardcoded to 8, so you should probably
+add something like this to your vimrc: >
+ set tabstop=8
+<
+The "lint" package will only show at most 5 messages of a kind. At the time of
+this writing this is not configurable.
+
+Beware also that the checker is pretty slow when using the default style
+setting of "lint.style".
+
+------------------------------------------------------------------------------
+2. lintr *syntastic-r-lintr*
+
+Name: lintr
+Maintainer: Jim Hester <james.f.hester@gmail.com>
+
+"lintr" is a static code analysys tool for R files. See the project's page at
+GitHub for details:
+
+ https://github.com/jimhester/lintr
+
+Security~
+
+This checker executes parts of the files it checks. This is probably fine if
+you wrote the file yourself, but it can be a problem if you're trying to check
+third party files. If you are 100% willing to let Vim run the code in your
+file, set 'g:syntastic_enable_r_lintr_checker' to 1 in your vimrc to enable
+this checker: >
+ let g:syntastic_enable_r_lintr_checker = 1
+<
+There is also a buffer-local version of this variable, that takes precedence
+over it in the buffers where it is defined.
+
+Please note that setting this variable doesn't automatically enable the
+checker, you still need to add "lintr" to 'g:syntastic_r_checkers' if you plan
+to use it.
+
+Checker Options~
+ *'g:syntastic_r_lintr_linters'*
+Type: string
+Default: "default_linters"
+Which "lintr" linters to apply to your code.
+
+ *'g:syntastic_r_lintr_cache'*
+Type: string
+Default: "FALSE"
+Whether to use the lintr cache. This speeds up linting time, but can introduce
+false positives in some cases.
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_r_lintr_<option>' variables. The only exception is
+'g:syntastic_r_lintr_exec', which can still be used to override the "R"
+executable.
+
+See also: |syntastic-rmd-lintr|.
+
+------------------------------------------------------------------------------
+3. svtools *syntastic-r-svtools*
+
+Name: svtools
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+This is a checker for R files, using the R package "svTools":
+
+ http://cran.r-project.org/web/packages/svTools/
+
+In turn, this package delegates most of the work to the "checkUsage()"
+function in the codetools package:
+
+ http://cran.r-project.org/web/packages/codetools/
+
+Security~
+
+This checker executes parts of the files it checks. This is probably fine if
+you wrote the file yourself, but it can be a problem if you're trying to check
+third party files. If you are 100% willing to let Vim run the code in your
+file, set 'g:syntastic_enable_r_svtools_checker' to 1 in your vimrc to enable
+this checker: >
+ let g:syntastic_enable_r_svtools_checker = 1
+<
+There is also a buffer-local version of this variable, that takes precedence
+over it in the buffers where it is defined.
+
+Please note that setting this variable doesn't automatically enable the
+checker, you still need to add "svtools" to 'g:syntastic_r_checkers' if you
+plan to use it.
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_r_svtools_<option>' variables. The only exception is
+'g:syntastic_r_svtools_exec', which can still be used to override the "R"
+executable.
+
+Limitations~
+
+"svTools" version 0.9-4 (current at the time of this writing) has a number
+of problems that prevents it from checking most sources. You might consider
+applying this patch as a workaround:
+
+ https://gist.github.com/lcd047/9988687#file-svtools-patch
+
+At the time of this writing "svTools" doesn't produce meaningful column
+numbers (the column numbers are always set to 1). The patch mentioned above
+enables "svTools" to produce more useful column numbers, but only for syntax
+errors. If you apply the said patch and you're checking files containing
+tab characters Vim's 'tabstop' must match "R"'s idea of tabstop, otherwise
+column numbers will be shifted. At the time of this writing "R"'s tabstop is
+hardcoded to 8, so you should probably add something like this to your vimrc: >
+ set tabstop=8
+<
+==============================================================================
+SYNTAX CHECKERS FOR R MARKDOWN *syntastic-checkers-rmd*
+
+The following checkers are available for R Markdown (filetype "rmd"):
+
+ 1. lintr....................|syntastic-rmd-lintr|
+
+------------------------------------------------------------------------------
+1. lintr *syntastic-rmd-lintr*
+
+Name: lintr
+Maintainer: Jim Hester <james.f.hester@gmail.com>
+
+"lintr" is a static code analysys tool for R files. See the project's page at
+GitHub for details:
+
+ https://github.com/jimhester/lintr
+
+Security~
+
+This checker executes parts of the files it checks. This is probably fine if
+you wrote the file yourself, but it can be a problem if you're trying to check
+third party files. If you are 100% willing to let Vim run the code in your
+file, set 'g:syntastic_enable_r_lintr_checker' to 1 in your vimrc to enable
+this checker: >
+ let g:syntastic_enable_r_lintr_checker = 1
+<
+There is also a buffer-local version of this variable, that takes precedence
+over it in the buffers where it is defined.
+
+Please note that setting this variable doesn't automatically enable the
+checker, you still need to add "lintr" to 'g:syntastic_rmd_checkers' if you
+plan to use it.
+
+Checker Options~
+ 'g:syntastic_r_lintr_linters'
+Type: string
+Default: "default_linters"
+Which "lintr" linters to apply to your code.
+
+ 'g:syntastic_r_lintr_cache'
+Type: string
+Default: "FALSE"
+Whether to use the lintr cache. This speeds up linting time, but can introduce
+false positives in some cases.
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_rmd_lintr_<option>' variables. The only exception is
+'g:syntastic_rmd_lintr_exec', which can still be used to override the "R"
+executable.
+
+See also: |syntastic-r-lintr|.
+
+==============================================================================
+SYNTAX CHECKERS FOR RACKET *syntastic-checkers-racket*
+
+The following checkers are available for Racket (filetype "racket"):
+
+ 1. code-ayatollah...........|syntastic-racket-code-ayatollah|
+ 2. racket...................|syntastic-racket-racket|
+
+------------------------------------------------------------------------------
+1. code-ayatollah *syntastic-racket-code-ayatollah*
+
+Name: code_ayatollah
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+Installation~
+
+Download "code-ayatollah.rkt" (http://tmp.barzilay.org/code-ayatollah.rkt)
+and point 'g:syntastic_racket_code_ayatollah_script' to it: >
+ let g:syntastic_racket_code_ayatollah_script = "/path/to/code-ayatollah.rkt"
+<
+Of course, you also need "racket" (http://racket-lang.org/).
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. racket *syntastic-racket-racket*
+
+Name: racket
+Maintainer: Steve Bragg <steve@empresseffects.com>
+
+Security~
+
+This checker executes the code in the files it checks:
+
+ https://github.com/scrooloose/syntastic/issues/1773
+
+This is probably fine if you wrote the files yourself, but it can be a problem
+if you're trying to check third party files. If you are 100% willing to let
+Vim run the code in your files, set 'g:syntastic_enable_racket_racket_checker'
+to 1 in your vimrc to enable this checker: >
+ let g:syntastic_enable_racket_racket_checker = 1
+<
+There is also a buffer-local version of this variable, that takes precedence
+over a global one in the buffers where it is defined.
+
+Please note that setting this variable doesn't automatically enable the
+checker, you still need to add "racket" to 'g:syntastic_racket_checkers' if
+you plan to use it.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR RELAX NG *syntastic-checkers-rnc*
+
+The following checkers are available for Relax NG (filetype "rnc"):
+
+ 1. rnv......................|syntastic-rnc-rnv|
+
+------------------------------------------------------------------------------
+1. rnv *syntastic-rnc-rnv*
+
+Name: rnv
+Maintainer: Remko Tronçon <remko@el-tramo.be>
+
+"RNV" is an implementation of Relax NG Compact Syntax validator (cf.
+http://relaxng.org/compact-20021121.html). See the project's page for
+details:
+
+ http://www.davidashen.net/rnv.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR RESTRUCTUREDTEXT *syntastic-checkers-rst*
+
+The following checkers are available for reStructuredText (filetype "rst"):
+
+ 1. rst2pseudoxml............|syntastic-rst-rst2pseudoxml|
+ 2. rstcheck.................|syntastic-rst-rstcheck|
+ 3. Sphinx...................|syntastic-rst-sphinx|
+
+------------------------------------------------------------------------------
+1. rst2pseudoxml *syntastic-rst-rst2pseudoxml*
+
+Name: rst2pseudoxml
+Maintainer: James Rowe <jnrowe@gmail.com>
+
+"rst2pseudoxml" is part of the Python package Docutils:
+
+ http://docutils.sourceforge.net/
+
+We use "rst2pseudoxml", as it is ever so marginally faster than the other
+"rst2${x}" tools in docutils.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. rstcheck *syntastic-rst-rstcheck*
+
+Name: rstcheck
+Maintainer: Steven Myint <git@stevenmyint.com>
+
+"rstcheck" is a checker for reStructuredText files. See the project's page at
+GitHub for details:
+
+ https://github.com/myint/rstcheck
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+3. Sphinx *syntastic-rst-sphinx*
+
+Name: sphinx
+Maintainer: Buck Evan <buck@yelp.com>
+
+"Sphinx" is a checker for documentation files written in the Sphinx dialect
+of reStructuredText, using the "pseudoxml" builder of "sphinx-build". See the
+project's page for details:
+
+ http://sphinx-doc.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_rst_sphinx_source_dir'*
+Type: string
+Default: unset
+Base directory of the project being checked.
+
+ *'g:syntastic_rst_sphinx_config_dir'*
+Type: string
+Default: unset
+Directory containing the "conf.py" file.
+
+Notes~
+
+The checker needs to know two paths to run: the source directory where the
+project's files are located, and the directory where the configuration file
+"conf.py" is located. By default it looks for "conf.py" in the base directory
+of the current file, then upwards in parent directories. If a configuration
+file is found and the file is readable, its base directory is assumed to be
+both the source directory and the configuration directory of the project.
+
+If syntastic can't determine the source directory or the configuration
+directory, or if you want to override the autodetected paths, options
+|'g:syntastic_rst_sphinx_source_dir'| and |'g:syntastic_rst_sphinx_config_dir'|
+take precedence over the detected values.
+
+Please not also that the checker creates output files in a temporary directory
+that is created upon the first run in the current session, and is removed when
+Vim exits. If you need to change the location of this directory you can do
+so by exporting the environment variables "TMPDIR" or "TMP" (on UNIX and Mac
+OS-X), or "TEMP" (on Windows) before running Vim. Various index files are also
+cached in this directory, so it might be advantageous to avoid quitting Vim
+between checker runs.
+
+==============================================================================
+SYNTAX CHECKERS FOR RPM SPEC *syntastic-checkers-spec*
+
+The following checkers are available for Linux RPM packages (filetype "spec"):
+
+ 1. rpmlint..................|syntastic-spec-rpmlint|
+
+------------------------------------------------------------------------------
+1. rpmlint *syntastic-spec-rpmlint*
+
+Name: rpmlint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"rpmlint" is a trool for checking Linux RPM packages. See the project's page
+for details:
+
+ http://sourceforge.net/projects/rpmlint/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR RUBY *syntastic-checkers-ruby*
+
+The following checkers are available for Ruby (filetype "ruby"):
+
+ 1. Flog.....................|syntastic-ruby-flog|
+ 2. JRuby....................|syntastic-ruby-jruby|
+ 3. MacRuby..................|syntastic-ruby-macruby|
+ 4. MRI......................|syntastic-ruby-mri|
+ 5. reek.....................|syntastic-ruby-reek|
+ 6. RuboCop..................|syntastic-ruby-rubocop|
+ 7. Ruby-lint................|syntastic-ruby-rubylint|
+
+------------------------------------------------------------------------------
+1. Flog *syntastic-ruby-flog*
+
+Name: flog
+Maintainer: Tim Carry <tim@pixelastic.com>
+
+"Flog" is a complexity checker for Ruby files. See the project's page for
+details:
+
+ http://ruby.sadi.st/Flog.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_ruby_flog_threshold_warning'*
+Type: number
+Default: 45
+Threshold for warnings. Functions with complexity below this number are not
+flagged as either errors or warnings.
+
+ *'g:syntastic_ruby_flog_threshold_error'*
+Type: number
+Default: 90
+Threshold for errors. Functions with complexity above this number are flagged
+as errors.
+
+
+Note~
+
+"Flog" reports complexity values as floating point numbers. If your Vim is
+not compiled with the "+float" feature, both the numbers reported by flog and
+the two options above are rounded by syntastic towards zero (that is, "39.9"
+is taken as "39").
+
+------------------------------------------------------------------------------
+2. JRuby *syntastic-ruby-jruby*
+
+Name: jruby
+Maintainer: Leonid Shevtsov <leonid@shevtsov.me>
+
+"JRuby" is a Java implementation of the Ruby programming language. See the
+project's page for details:
+
+ http://jruby.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+3. MacRuby *syntastic-ruby-macruby*
+
+Name: macruby
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"MacRuby" is an implementation of Ruby for Mac OS X. See the project's
+pagefor details:
+
+ http://www.macruby.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+4. MRI *syntastic-ruby-mri*
+
+Name: mri
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_ruby_exec'*
+Type: string
+Default: unset
+Ruby executable. This is a convenience variable shared with the eRuby checker
+"Ruby" (cf. |syntastic-eruby-ruby|). Used only if 'g:syntastic_ruby_mri_exec'
+is unset.
+
+------------------------------------------------------------------------------
+5. Reek *syntastic-ruby-reek*
+
+Name: reek
+Maintainer: Mindaugas Mozūras
+
+"Reek" is a code smell detection tool for Ruby. See the project's page at
+GitHub for details:
+
+ https://github.com/troessner/reek
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+6. RuboCop *syntastic-ruby-rubocop*
+
+Name: rubocop
+Maintainer: Recai Oktaş <roktas@bil.omu.edu.tr>
+
+"RuboCop" is a style checker for Ruby. See the project's page for details:
+
+ https://github.com/bbatsov/rubocop
+
+Syntastic requires "RuboCop" version 0.12.0 or later.
+
+Running "RuboCop" under development versions of "Ruby" is explicitly NOT
+supported.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Notes~
+
+Most issues returned by "rubocop" are warnings, so for best results your
+|'syntastic_quiet_messages'| should not filter out warnings.
+
+If the "RuboCop" checker is not enabled automatically by syntastic try
+running "rubocop --version" from the shell. If it complains about "Parser"
+(see https://github.com/whitequark/parser) expecting a different version of
+"Ruby" than you are running, your configuration is not directly supported by
+syntastic.
+
+While passing around the blame for this does have a certain entertaining value
+(cf. https://github.com/bbatsov/rubocop/issues/1819), the problem is real,
+since "Ruby" syntax did change between versions. The solution is to run a
+system such as "rbenv" (http://rbenv.org/) or "rvm" (https://rvm.io/), that
+allows you to run multiple versions of "Ruby" without conflicts: >
+ $ rbenv version
+ 2.1.3 (set by /usr/local/var/rbenv/version)
+
+ $ rubocop --version
+ warning: parser/current is loading parser/ruby21, which recognizes
+ warning: 2.1.2-compliant syntax, but you are running 2.1.3.
+ 0.26.1
+
+ $ rbenv shell 2.1.2
+
+ $ rubocop --version
+ 0.26.1
+<
+Alternatively, if you absolutely must do it the wrong way, you can
+also install a wrapper script that kills the version warning and point
+'g:syntastic_ruby_rubocop_exec' to it:
+
+ https://gist.github.com/lcd047/96138909015f2f8d2d36
+
+------------------------------------------------------------------------------
+7. Ruby-lint *syntastic-ruby-rubylint*
+
+Name: rubylint
+Maintainer: Yorick Peterse <yorickpeterse@gmail.com>
+
+"Ruby-lint" is a linter and static code analysis tool for Ruby. See the
+project's page for details:
+
+ https://github.com/YorickPeterse/ruby-lint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+If the "rubylint" checker is not enabled automatically by syntastic, try
+running "ruby-lint --version" from the shell. If it complains about "Parser"
+(see https://github.com/whitequark/parser) expecting a different version of
+"Ruby" than you are running, your configuration is not directly supported by
+syntastic.
+
+While passing around the blame for this does have a certain entertaining value
+(cf. https://github.com/bbatsov/rubocop/issues/1819), the problem is real,
+since "Ruby" syntax did change between versions. The solution is to run a
+system such as "rbenv" (http://rbenv.org/) or "rvm" (https://rvm.io/), that
+allows you to run multiple versions of "Ruby" without conflicts: >
+ $ rbenv version
+ 2.1.3 (set by /usr/local/var/rbenv/version)
+
+ $ ruby-lint --version
+ warning: parser/current is loading parser/ruby21, which recognizes
+ warning: 2.1.2-compliant syntax, but you are running 2.1.3.
+ ruby-lint v2.0.4 on ruby 2.1.3 [i486-linux]
+
+ $ rbenv shell 2.1.2
+
+ $ ruby-lint --version
+ ruby-lint v2.0.4 on ruby 2.1.2 [i486-linux]
+<
+Alternatively, if you absolutely must do it the wrong way, you can
+also install a wrapper script that kills the version warning and point
+'g:syntastic_ruby_rubylint_exec' to it:
+
+ https://gist.github.com/lcd047/492245d9923af45fb964
+
+==============================================================================
+SYNTAX CHECKERS FOR SASS *syntastic-checkers-sass*
+
+The following checkers are available for SASS (filetype "sass"):
+
+ 1. Sass.....................|syntastic-sass-sass|
+ 2. Sass Lint................|syntastic-sass-sass_lint|
+ 3. SassC....................|syntastic-sass-sassc|
+
+------------------------------------------------------------------------------
+1. Sass *syntastic-sass-sass*
+
+Name: sass
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"Sass" is a translator for SASS. See the project's page for details:
+
+ http://sass-lang.com/
+
+Installation~
+
+Install it with "gem": >
+ gem install sass
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-scss-sass|.
+
+------------------------------------------------------------------------------
+2. Sass Lint *syntastic-sass-sass_lint*
+
+Name: sass_lint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Sass Lint" is a checker for SASS and SCSS files. See the project's page for
+details:
+
+ https://github.com/sasstools/sass-lint
+
+Syntastic requires "Sass Lint" version 1.5.0 or later.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-scss-sass_lint|.
+
+------------------------------------------------------------------------------
+3. SassC *syntastic-sass-sassc*
+
+Name: sassc
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"SassC" is a checker for SASS and SCSS files, based on the "libsass" library
+(https://github.com/hcatlin/libsass). See the project's page for details:
+
+ https://github.com/hcatlin/sassc
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-scss-sassc|.
+
+==============================================================================
+SYNTAX CHECKERS FOR SCALA *syntastic-checkers-scala*
+
+The following checkers are available for Scala (filetype "scala"):
+
+ 1. fsc......................|syntastic-scala-fsc|
+ 2. scalac...................|syntastic-scala-scalac|
+ 3. Scalastyle...............|syntastic-scala-scalastyle|
+
+------------------------------------------------------------------------------
+1. fsc *syntastic-scala-fsc*
+
+Name: fsc
+Maintainer: Gregor Uhlenheuer <kongo2002@gmail.com>
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. scalac *syntastic-scala-scalac*
+
+Name: scalac
+Maintainer: Rickey Visinski <rickeyvisinski@gmail.com>
+
+"scalac" is a compiler for Scala. See the project's page for more information:
+
+ http://docs.scala-lang.org
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+3. Scalastyle *syntastic-scala-scalastyle*
+
+Name: scalastyle
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Scalastyle" is a style checker for Scala. See the project's page for
+details:
+
+ http://www.scalastyle.org/
+
+Syntastic uses the command line version of "Scalastyle":
+
+ http://www.scalastyle.org/command-line.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_scala_scalastyle_jar'*
+Type: string
+Default: "scalastyle-batch_2.10.jar"
+Path to the "scalastyle-batch" jar file. You might want to set this to a full
+path.
+
+ *'g:syntastic_scala_scalastyle_config_file'*
+Type: string
+Default: "scalastyle_config.xml"
+Path to the configuration file to use. You might want to also set this to a
+full path.
+
+==============================================================================
+SYNTAX CHECKERS FOR SCSS *syntastic-checkers-scss*
+
+The following checkers are available for SCSS (filetype "scss"):
+
+ 1. mixedindentlint..........|syntastic-scss-mixedindentlint|
+ 2. Sass.....................|syntastic-scss-sass|
+ 3. Sass Lint................|syntastic-scss-sass_lint|
+ 4. SassC....................|syntastic-scss-sassc|
+ 5. SCSS-lint................|syntastic-scss-scss_lint|
+ 6. stylelint................|syntastic-scss-stylelint|
+
+------------------------------------------------------------------------------
+1. mixedindentlint *syntastic-scss-mixedindentlint*
+
+Name: mixedindentlint
+Maintainer: Payton Swick <payton@foolord.com>
+
+"mixedindentlint" is a general-purpose indentation checker. See the project's
+page at GitHub for more information:
+
+ https://github.com/sirbrillig/mixedindentlint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-css-mixedindentlint|, |syntastic-javascript-mixedindentlint|.
+
+------------------------------------------------------------------------------
+2. Sass *syntastic-scss-sass*
+
+Name: sass
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"Sass" is a translator for SASS. See the project's page for details:
+
+ http://sass-lang.com/
+
+Installation~
+
+Install it with "gem": >
+ gem install sass
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-sass-sass|.
+
+------------------------------------------------------------------------------
+3. Sass Lint *syntastic-scss-sass_lint*
+
+Name: sass_lint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Sass Lint" is a checker for SASS and SCSS files. See the project's page for
+details:
+
+ https://github.com/sasstools/sass-lint
+
+Syntastic requires "Sass Lint" version 1.5.0 or later.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-sass-sass_lint|.
+
+------------------------------------------------------------------------------
+4. SassC *syntastic-scss-sassc*
+
+Name: sassc
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+
+"SassC" is a checker for SASS and SCSS files, based on the "libsass" library
+(https://github.com/hcatlin/libsass). See the project's page for details:
+
+ https://github.com/hcatlin/sassc
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-sass-sassc|.
+
+------------------------------------------------------------------------------
+5. SCSS-lint *syntastic-scss-scss_lint*
+
+Name: scss_lint
+Maintainer: Shane da Silva <shane@dasilva.io>
+
+"SCSS-Lint" is a lint tool for SCSS. See the project's page for details:
+
+ https://github.com/brigade/scss-lint
+
+Syntastic requires "SCSS-Lint" version 0.29.0 or later.
+
+Installation~
+
+Install it with "gem": >
+ gem install scss_lint
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+6. stylelint *syntastic-scss-stylelint*
+
+Name: stylelint
+Maintainer: Tim Carry <tim@pixelastic.com>
+
+"stylelint" is a style checker for Cascading Stylesheets. See the project's
+page for more information:
+
+ http://stylelint.io/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-css-stylelint|.
+
+==============================================================================
+SYNTAX CHECKERS FOR SH *syntastic-checkers-sh*
+
+The following checkers are available for Sh (filetype "sh"):
+
+ 1. Bashate..................|syntastic-sh-bashate|
+ 2. checkbashisms............|syntastic-sh-checkbashisms|
+ 3. sh.......................|syntastic-sh-sh|
+ 4. ShellCheck...............|syntastic-sh-shellcheck|
+
+------------------------------------------------------------------------------
+1. Bashate *syntastic-sh-bashate*
+
+Name: bashate
+Maintainer: aswna
+
+"Bashate" is a style checker for bash scripts used by the OpenStack
+(http://www.openstack.org/). See the project's page at GitHub for details:
+
+ https://github.com/openstack-dev/bashate
+
+Installation~
+
+Install it with "pip": >
+ pip install bashate
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. checkbashisms *syntastic-sh-checkbashisms*
+
+Name: checkbashisms
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"checkbashisms" is part of the Linux "devscripts" package. It can be obtained
+from the Debian source archive:
+
+ http://packages.qa.debian.org/d/devscripts.html
+
+For FreeBSD and OpenBSD you can also install the "devel/checkbashisms" port.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+3. sh *syntastic-sh-sh*
+
+Name: sh
+Maintainer: Gregor Uhlenheuer <kongo2002@gmail.com>
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+4. ShellCheck *syntastic-sh-shellcheck*
+
+Name: shellcheck
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"ShellCheck" is a static analysis tool for Bourne shell scripts. See the
+project's page for details:
+
+ http://www.shellcheck.net/about.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR SLIM *syntastic-checkers-slim*
+
+The following checkers are available for Slim (filetype "slim"):
+
+ 1. Slim-Lint................|syntastic-slim-slim_lint|
+ 2. Slimrb...................|syntastic-slim-slimrb|
+
+------------------------------------------------------------------------------
+1. Slim-Lint *syntastic-slim-slim_lint*
+
+Name: slim_lint
+Maintainer: Vasily Kolesnikov <re.vkolesnikov@gmail.com>
+
+"Slim-Lint" is a style checker for Slim files (http://slim-lang.com/). See
+the project's page at GitHub for details:
+
+ https://github.com/sds/slim-lint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Installation~
+
+You can install "Slim-Lint" with "gem": >
+ gem install slim_lint
+<
+------------------------------------------------------------------------------
+2. Slimrb *syntastic-slim-slimrb*
+
+Name: slimrb
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"Slimrb" is a processor for the template language Slim
+(http://slim-lang.com/). See the project's page for details:
+
+ https://github.com/slim-template/slim
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR SML *syntastic-checkers-sml*
+
+The following checkers are available for SML (filetype "sml"):
+
+ 1. smlnj....................|syntastic-sml-smlnj|
+
+------------------------------------------------------------------------------
+1. smlnj *syntastic-sml-smlnj*
+
+Name: smlnj
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"smlnj" is a compiler for Standard ML '97. See the project's page for details:
+
+ http://www.smlnj.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR SQL *syntastic-checkers-sql*
+
+The following checkers are available for SQL (filetype "sql"):
+
+ 1. sqlint...................|syntastic-sql-sqlint|
+
+------------------------------------------------------------------------------
+1. sqlint *syntastic-sql-sqlint*
+
+Name: sqlint
+Maintainer: Steve Purcell <steve@sanityinc.com>
+
+"sqlint" is a lint checker for ANSI SQL. See the project's page at GitHub for
+details:
+
+ https://github.com/purcell/sqlint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR STYLUS *syntastic-checkers-stylus*
+
+The following checkers are available for Stylus (filetype "stylus"):
+
+ 1. Stylint..................|syntastic-stylus-stylint|
+
+------------------------------------------------------------------------------
+1. Stylint *syntastic-stylus-stylint*
+
+Name: stylint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Stylint" is a linter for Stylus (http://learnboost.github.io/stylus). See
+the project's page at GitHub for details:
+
+ https://github.com/rossPatton/stylint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You might also find useful the "vim-stylus" plugin:
+
+ https://github.com/wavded/vim-stylus
+
+==============================================================================
+SYNTAX CHECKERS FOR TCL *syntastic-checkers-tcl*
+
+The following checkers are available for Tcl (filetype "tcl"):
+
+ 1. nagelfar.................|syntastic-tcl-nagelfar|
+
+------------------------------------------------------------------------------
+1. nagelfar *syntastic-tcl-nagelfar*
+
+Name: nagelfar
+Maintainer: James Pickard <james.pickard@gmail.com>
+
+"Nagelfar" is a syntax checker for Tcl. See the project's page for details:
+
+ http://nagelfar.sourceforge.net/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR TEX *syntastic-checkers-tex*
+
+The following checkers are available for TeX (filetype "tex"):
+
+ 1. ChkTeX...................|syntastic-tex-chktex|
+ 2. lacheck..................|syntastic-tex-lacheck|
+
+------------------------------------------------------------------------------
+1. ChkTeX *syntastic-tex-chktex*
+
+Name: chktex
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"ChkTeX" is a checker for TeX and LaTeX. See the project's page for details:
+
+ http://baruch.ev-en.org/proj/chktex/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_tex_chktex_showmsgs'*
+Type: boolean
+Default: 1
+Whether to show informational messages ("chktex" option "-m"). By default
+informational messages are shown as warnings.
+
+------------------------------------------------------------------------------
+2. lacheck *syntastic-tex-lacheck*
+
+Name: lacheck
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"lacheck" is a style checker for LaTeX documents. See the project's page for
+details:
+
+ http://www.ctan.org/tex-archive/support/lacheck
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Limitations~
+
+At the time of this writing "lacheck" can't expand "\def" commands. As a
+result, most "\input" commands using macros are signaled as errors.
+
+==============================================================================
+SYNTAX CHECKERS FOR TEXINFO *syntastic-checkers-texinfo*
+
+The following checkers are available for Texinfo (filetype "texinfo"):
+
+ 1. Makeinfo.................|syntastic-texinfo-makeinfo|
+
+------------------------------------------------------------------------------
+1. Makeinfo *syntastic-texinfo-makeinfo*
+
+Name: makeinfo
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Makeinfo" is a convertor for Texinfo files. It is distributed together with
+the GNU package "texinfo":
+
+ http://www.gnu.org/software/texinfo/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR TEXT *syntastic-checkers-text*
+
+The following checkers are available for plain text (filetype "text"):
+
+ 1. atdtool..................|syntastic-text-atdtool|
+ 2. Igor.....................|syntastic-text-igor|
+ 3. language-check...........|syntastic-text-language_check|
+ 4. textlint.................|syntastic-text-textlint|
+
+------------------------------------------------------------------------------
+1. atdtool *syntastic-text-atdtool*
+
+Name: atdtool
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"atdtool" is a script that runs a text file through the "After the Deadline"
+language service (http://www.afterthedeadline.com/) and returns a list of
+spelling, style, and grammar errors. See the project's page for details:
+
+ https://github.com/lpenz/atdtool
+
+See also the list of features of "After the Deadline":
+
+ http://www.afterthedeadline.com/features.slp
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. Igor *syntastic-text-igor*
+
+Name: igor
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Igor" is a proofreader for DocBook SGML, man pages, and text files used by
+the FreeBSD (https://www.freebsd.org/). See the author's presentation for
+details:
+
+ http://www.youtube.com/watch?v=sczHqUPygZY
+
+The latest version can be obtained from Glen Barber's repository:
+
+ http://docscripts.glenbarber.us/tags/igor/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-docbk-igor|, |syntastic-nroff-igor|.
+
+------------------------------------------------------------------------------
+3. language-check *syntastic-text-language_check*
+
+Name: language_check
+Maintainer: Steven Myint <git@stevenmyint.com>
+
+"language-check" is a wrapper for the LanguageTool grammar checker
+(https://www.languagetool.org/). See the project's page for details:
+
+ https://github.com/myint/language-check
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+4. textlint *syntastic-text-textlint*
+
+Name: textlint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"textlint" is a natural language linter for text, Markdown, and HTML files.
+See the project's page for details:
+
+ https://textlint.github.io/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-html-textlint|, |syntastic-markdown-textlint|.
+
+==============================================================================
+SYNTAX CHECKERS FOR TRIG *syntastic-checkers-trig*
+
+The following checkers are available for TriG (filetype "trig"):
+
+ 1. rapper...................|syntastic-trig-rapper|
+
+------------------------------------------------------------------------------
+1. rapper *syntastic-trig-rapper*
+
+Name: rapper
+Maintainer: Sebastian Tramp <mail@sebastian.tramp.name>
+
+"rapper" is an RDF parsing and serializing utility. See the project's page for
+details:
+
+ http://librdf.org/raptor/rapper.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You probably also need a plugin to set |filetype| for TriG files, such as
+"Vim-RDF":
+
+ https://github.com/niklasl/vim-rdf
+
+See also: |syntastic-turtle-rapper|.
+
+==============================================================================
+SYNTAX CHECKERS FOR TURTLE *syntastic-checkers-turtle*
+
+The following checkers are available for Turtle (filetype "turtle"):
+
+ 1. rapper...................|syntastic-turtle-rapper|
+ 2. ttl......................|syntastic-turtle-ttl|
+
+------------------------------------------------------------------------------
+1. rapper *syntastic-turtle-rapper*
+
+Name: rapper
+Maintainer: Sebastian Tramp <mail@sebastian.tramp.name>
+
+"rapper" is an RDF parsing and serializing utility. See the project's page
+for details:
+
+ http://librdf.org/raptor/rapper.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You probably also need a plugin to set |filetype| for Turtle files, such as
+"Vim-RDF":
+
+ https://github.com/niklasl/vim-rdf
+
+See also: |syntastic-trig-rapper|.
+
+------------------------------------------------------------------------------
+2. ttl *syntastic-turtle-ttl*
+
+Name: ttl
+Maintainer: Antoine Reilles <tonio@NetBSD.org>
+
+"ttl" is an RDF validator. See the project's page at GitHub for details:
+
+ https://github.com/mmlab/TurtleValidator
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You probably also need a plugin to set |filetype| for Turtle files, such as
+"Vim-RDF":
+
+ https://github.com/niklasl/vim-rdf
+
+==============================================================================
+SYNTAX CHECKERS FOR TWIG *syntastic-checkers-twig*
+
+The following checkers are available for Twig (filetype "twig"):
+
+ 1. twig-lint................|syntastic-twig-twiglint|
+
+------------------------------------------------------------------------------
+1. twig-lint *syntastic-twig-twiglint*
+
+Name: twiglint
+Maintainer: Alexander <iam.asm89@gmail.com>
+
+"twig-lint" is a lint tool for Twig templates. See the project's page at
+GitHub for details:
+
+ https://github.com/asm89/twig-lint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Notes~
+
+For the standalone executable, add the following to your vimrc file: >
+ let g:syntastic_twig_twiglint_exec = "php"
+ let g:syntastic_twig_twiglint_exe = "php /path/to/twig-lint.phar"
+<
+For the "Composer" (https://getcomposer.org/) dependency "twig-lint" must be
+in your "$PATH". No further configuration is needed.
+
+==============================================================================
+SYNTAX CHECKERS FOR TYPESCRIPT *syntastic-checkers-typescript*
+
+The following checkers are available for TypeScript (filetype "typescript"):
+
+ 1. ESLint...................|syntastic-typescript-eslint|
+ 2. tsc......................|syntastic-typescript-tsc|
+ 3. TSLint...................|syntastic-typescript-tslint|
+
+------------------------------------------------------------------------------
+1. ESLint *syntastic-typescript-eslint*
+
+Name: eslint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"ESLint" is a tool for identifying and reporting on patterns found
+in ECMAScript/JavaScript code. With the "babel-eslint" plugin
+(https://github.com/babel/babel-eslint) "ESLint" can also can also be
+used to check TypeScript files. See the project's page for details:
+
+ https://github.com/nzakas/eslint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You probably also need a plugin to set |filetype| for TypeScript files, such
+as "typescript-vim":
+
+ https://github.com/leafgarland/typescript-vim
+
+See also: |syntastic-html-eslint|, |syntastic-javascript-eslint|.
+
+------------------------------------------------------------------------------
+2. tsc *syntastic-typescript-tsc*
+
+Name: tsc
+Maintainer: Bill Casarin <bill@casarin.ca>
+
+"tsc" is a compiler for TypeScript. See the project's page for details:
+
+ http://www.typescriptlang.org/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You probably also need a plugin to set |filetype| for TypeScript files, such
+as "typescript-vim":
+
+ https://github.com/leafgarland/typescript-vim
+
+------------------------------------------------------------------------------
+3. TSLint *syntastic-typescript-tslint*
+
+Name: tslint
+Maintainer: Seon-Wook Park <seon.wook@swook.net>
+
+"TSLint" is a lint checker for TypeScript. See the project's page for
+details:
+
+ https://github.com/palantir/tslint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You probably also need a plugin to set |filetype| for TypeScript files, such
+as "typescript-vim":
+
+ https://github.com/leafgarland/typescript-vim
+
+==============================================================================
+SYNTAX CHECKERS FOR VALA *syntastic-checkers-vala*
+
+The following checkers are available for Vala (filetype "vala"):
+
+ 1. Valac....................|syntastic-vala-valac|
+
+------------------------------------------------------------------------------
+1. Valac *syntastic-vala-valac*
+
+Name: valac
+Maintainer: Konstantin Stepanov (me@kstep.me)
+
+"valac" is a compiler for Vala. See the project's page for details:
+
+ https://wiki.gnome.org/Projects/Vala
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_vala_modules'*
+Type: string or array of strings
+Default: unset
+Space-separated list of Vala modules to be passed as "--pkg" arguments.
+
+ *'g:syntastic_vala_vapi_dirs'*
+Type: string or array of strings
+Default: unset
+Space-separated list of "vapi" directories to be passed as "--vapidirs"
+arguments.
+
+Notes~
+
+If |'g:syntastic_vala_modules'| is unset, you can also specify a list of
+module to load for the current file by adding a special comment starting with
+"// modules: " and containing a space-delimited list of names.
+
+If |'g:syntastic_vala_vapi_dirs'| is unset, you can also specify a list of
+"vapi" directories for the current file by adding a special comment starting
+with "// vapidirs:" and containing a space-delimited list of names.
+
+==============================================================================
+SYNTAX CHECKERS FOR VERILOG *syntastic-checkers-verilog*
+
+The following checkers are available for Verilog (filetype "verilog"):
+
+ 1. Icarus Verilog...........|syntastic-verilog-iverilog|
+ 2. Verilator................|syntastic-verilog-verilator|
+
+------------------------------------------------------------------------------
+1. Icarus Verilog *syntastic-verilog-iverilog*
+
+Name: iverilog
+Maintainer: Psidium <psiidium@gmail.com>
+
+"Icarus Verilog" is a Verilog simulation and synthesis tool. See the
+project's page for details:
+
+ http://iverilog.icarus.com/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. Verilator *syntastic-verilog-verilator*
+
+Name: verilator
+Maintainer: Kocha <kocha.lsifrontend@gmail.com>
+
+Checker options~
+
+ *'g:syntastic_verilog_compiler'*
+Type: string
+Default: "verilator"
+Compiler executable.
+
+ *'g:syntastic_verilog_errorformat'*
+Type: string
+Default: unset
+Override for the default |'errorformat'|.
+
+ *'g:syntastic_verilog_remove_include_errors'*
+Type: boolean
+Default: 0
+By default, errors in files included from the file being checked are shown.
+Set this variable to 1 to remove messages about errors in included files.
+Please note that this means syntastic will silently abort checks if there are
+fatal errors in one of the included files.
+
+ *'g:syntastic_verilog_compiler_options'*
+Type: string
+Default: unset
+Compilation flags (such as defines or include directories) to be passed to the
+checker.
+
+ *'g:syntastic_verilog_config_file'*
+Type: string
+Default: ".syntastic_verilog_config"
+File containing additional compilation flags to be passed to the checker, one
+option per line (cf. |syntastic-config-files|).
+
+ *'g:syntastic_verilog_include_dirs'*
+Type: array of strings
+Default: []
+Include directories to be passed to the checker, in addition to the
+above compilation flags. You can set it like this: >
+ let g:syntastic_verilog_include_dirs = ["includes", "headers"]
+<
+and the corresponding "-Iincludes -Iheaders" will be added to the compilation
+flags.
+
+ *'b:syntastic_verilog_cflags'*
+Type: string
+Default: unset
+Buffer-local variable. Additional compilation flags specific to the current
+buffer.
+
+Note~
+
+This checker doesn't call the "makeprgBuild()" function, and thus it ignores
+the usual 'g:syntastic_verilog_verilator_<option>' variables. The only
+exception is 'g:syntastic_verilog_verilator_exec', which can still be used to
+override the checker's executable.
+
+==============================================================================
+SYNTAX CHECKERS FOR VHDL *syntastic-checkers-vhdl*
+
+The following checkers are available for VHDL (filetype "vhdl"):
+
+ 1. GHDL.....................|syntastic-vhdl-ghdl|
+ 2. vcom.....................|syntastic-vhdl-vcom|
+
+------------------------------------------------------------------------------
+1. GHDL *syntastic-vhdl-ghdl*
+
+Name: ghdl
+Maintainer: Jan Wagner <jaydyou@janidom.de>
+
+"GHDL" is a VHDL simulator. See the project's page for details:
+
+ http://gna.org/projects/ghdl/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. vcom *syntastic-vhdl-vcom*
+
+Name: vcom
+Maintainer: Jim Vogel <jim.e.vogel@gmail.com>
+
+"vcom" is compiler for VHDL files distributed with the "ModelSim" HDL
+simulation environment:
+
+ https://www.mentor.com/products/fpga/model/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR VIML *syntastic-checkers-vim*
+
+The following checkers are available for VimL (filetype "vim"):
+
+ 1. Vimlint..................|syntastic-vim-vimlint|
+ 2. Vint.....................|syntastic-vim-vint|
+
+------------------------------------------------------------------------------
+1. Vimlint *syntastic-vim-vimlint*
+
+Name: vimlint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Vimlint" is a lint checker for VimL written in pure VimL, based on Yukihiro
+Nakadaira's "vimlparser" (https://github.com/ynkdir/vim-vimlparser/). See the
+project's page for details:
+
+ https://github.com/syngan/vim-vimlint/
+
+Installation~
+
+You need to install the Vim plugins "vim-vimlint" and "vim-vimlparser"
+mentioned above.
+
+Checker Options~
+
+ *'g:syntastic_vimlint_options'*
+Type: dictionary
+Default: |EVL102|, |EVL103|, |EVL104|, |EVL105|, |EVL106|, |EVL201|, |EVL204|, and |EVL205|
+ are warnings.
+Dictionary of "Vimlint" options, with the same syntax as |g:vimlint#config|.
+See |g:vimlint#config| and |vimlint-errorcode| for more details.
+
+"Vimlint" does not call the "makeprgBuild()" function, and thus ignores the
+usual 'g:syntastic_vim_vimlint_<option>' variables.
+
+Note~
+
+The values of |'g:syntastic_vimlint_options'| useful for syntastic are those
+that ignore or change the severity of some "EVLxxx" messages. For example
+to ignore warnings about unused arguments: >
+ let g:syntastic_vimlint_options = { "EVL103": 1 }
+<
+Limitation~
+
+Certain error messages can't be turned off by |'g:syntastic_vimlint_options'|.
+This is a misfeature of "Vimlint" rather than a limitation of syntastic. You
+can still ignore these messages using the standard mechanism of
+|'syntastic_quiet_messages'|: >
+ let g:syntastic_vim_vimlint_quiet_messages = { "regex": '\v\[EVL%(105|205)\]' }
+<
+At the time of this writing the messages that can't be turned off by setting
+|'g:syntastic_vimlint_options'| are:
+
+ |EVL105| - global variable defined without 'g:'
+ |EVL202| - missing call
+ |EVL203| - parse error in command
+ |EVL205| - missing 'scriptencoding'
+ |EVL901| - unknown type
+ |EVL902| - assert error.
+
+------------------------------------------------------------------------------
+2. Vint *syntastic-vim-vint*
+
+Name: vint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Vint" is a lint checker for VimL. See the project's page at GitHub for
+details:
+
+ https://github.com/Kuniwak/vint
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR XHTML *syntastic-checkers-xhtml*
+
+The following checkers are available for xHTML (filetype "xhtml"):
+
+ 1. HTML Tidy................|syntastic-xhtml-tidy|
+ 2. jshint...................|syntastic-xhtml-jshint|
+
+------------------------------------------------------------------------------
+1. HTML tidy *syntastic-xhtml-tidy*
+
+Name: tidy
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"HTML Tidy" is a syntax checker and formatter for HTML. See the HTML Tidy
+Library Project for more information:
+
+ http://tidy.sourceforge.net/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ *'g:syntastic_xhtml_tidy_ignore_errors'*
+Type: array of strings
+Default: []
+List of errors to ignore. Case-sensitive patterns matched as substrings
+(not regular expressions) against the error messages. See also
+|'syntastic_quiet_messages'|.
+
+See also: |syntastic-html-tidy|.
+
+------------------------------------------------------------------------------
+2. jshint *syntastic-xhtml-jshint*
+
+Name: JSHint
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"JSHint" can detect JavaScript errors and potential problems in HTML
+files. See the project's page for details:
+
+ http://jshint.com/
+
+Syntastic requires "JSHint" version 2.4.0 or later.
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+If you're checking files containing tab characters then "JSHint"'s idea of
+tabstop must match Vim's 'tabstop', otherwise syntastic will highlight the
+errors at shifted positions. By default "JSHint"'s tabstop is 4, while Vim's
+default 'tabstop' is 8.
+
+In order to change "JSHint"'s tabstop you have to change its "indent" config
+option (cf. http://jshint.com/docs/options/#indent). One way to do that is
+to put it in a file named ".jshintrc" in the current directory, the parent
+directories, or your home directory. The file is supposed to be in JSON
+format. For example: >
+ {
+ "indent": 8
+ }
+<
+See JSHint documentation for more details:
+
+ http://jshint.com/docs/
+
+Please note however that setting "indent" also triggers the indentation checks
+in "JSHint". If that is undesirable, your only other option is to leave
+"JSHint"'s tabstop alone, and change Vim's 'tabstop' to 4. To change Vim's
+'tabstop', you can add this to your vimrc: >
+ set tabstop=4
+<
+See also: |syntastic-html-jshint|, |syntastic-javascript-jshint|.
+
+==============================================================================
+SYNTAX CHECKERS FOR XML *syntastic-checkers-xml*
+
+The following checkers are available for XML (filetype "xml"):
+
+ 1. plutil...................|syntastic-xml-plutil|
+ 2. xmllint..................|syntastic-xml-xmllint|
+
+------------------------------------------------------------------------------
+1. plutil *syntastic-xml-plutil*
+
+Name: plutil
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"plutil" is a checker for OS X and iOS property list files. See the "plist(5)"
+and "plutil(1)" manual pages for details:
+
+ https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/plist.5.html
+ https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/plutil.1.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. xmllint *syntastic-xml-xmllint*
+
+Name: xmllint
+Maintainer: Sebastian Kusnier <sebastian@kusnier.net>
+
+"xmllint" is a checker and transformer tool for XML files, distributed with
+the "libxml" package (http://www.xmlsoft.org/). See the tool's manual for more
+information:
+
+ http://xmlsoft.org/xmllint.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You can use a local installation of DTDs to significantly speed up validation
+and allow you to validate XML data without network access. See the
+"xmlcatalog" manual, and the catalog documentation for more information:
+
+ http://www.xmlsoft.org/xmlcatalog_man.html
+ http://www.xmlsoft.org/catalog.html
+
+For an example of a DTD catalog see f.i. "XMLCatalog":
+
+ https://github.com/darcyparker/XMLCatalog
+
+In order to use it with syntastic you'll have to clone it to a local
+directory, and point the environment variable "XML_CATALOG_FILES" to the file
+"catalog.xml" in the said directory: >
+ XML_CATALOG_FILES=/some/path/XMLCatalog/catalog.xml
+ export XML_CATALOG_FILES
+<
+Otherwise "xmllint" will try to load XML catalogs from "/etc/xml/catalog".
+
+See also: |syntastic-docbk-xmllint|, |syntastic-xslt-xmllint|.
+
+==============================================================================
+SYNTAX CHECKERS FOR XQUERY *syntastic-checkers-xquery*
+
+The following checkers are available for XQuery (filetype "xquery"):
+
+ 1. BaseX....................|syntastic-xquery-basex|
+
+------------------------------------------------------------------------------
+1. BaseX *syntastic-xquery-basex*
+
+Name: basex
+Maintainer: James Wright <james.jw@hotmail.com>
+
+"BaseX" is an XML database engine and XPath`/`XQuery processor. See the
+project's page for details:
+
+ http://basex.org/
+
+Installation~
+
+1. Install "BaseX"
+2. Add the "basex/bin" folder to your "$PATH".
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR XSLT *syntastic-checkers-xslt*
+
+The following checkers are available for XSLT (filetype "xslt"):
+
+ 1. xmllint..................|syntastic-xslt-xmllint|
+
+------------------------------------------------------------------------------
+1. xmllint *syntastic-xslt-xmllint*
+
+Name: xmllint
+Maintainer: Sebastian Kusnier <sebastian@kusnier.net>
+
+"xmllint" is a checker and transformer tool for XML files, distributed with
+the "libxml" package (http://www.xmlsoft.org/). See the tool's manual for more
+information:
+
+ http://xmlsoft.org/xmllint.html
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+See also: |syntastic-docbk-xmllint|, |syntastic-xml-xmllint|.
+
+==============================================================================
+SYNTAX CHECKERS FOR YACC *syntastic-checkers-yacc*
+
+The following checkers are available for YACC (filetype "yacc"):
+
+ 1. Bison....................|syntastic-yacc-bison|
+
+------------------------------------------------------------------------------
+1. Bison *syntastic-yacc-bison*
+
+Name: bison
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+"Bison" is the GNU implementation of the standard UNIX parser generator
+"yacc" (http://en.wikipedia.org/wiki/Yacc). See the project's page for more
+information:
+
+ http://www.gnu.org/software/bison/
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR YAML *syntastic-checkers-yaml*
+
+The following checkers are available for YAML (filetype "yaml"):
+
+ 1. JavaScript YAML..........|syntastic-yaml-jsyaml|
+ 2. yamllint.................|syntastic-yaml-yamllint|
+ 3. YAML::XS.................|syntastic-yaml-yamlxs|
+
+------------------------------------------------------------------------------
+1. JavaScript YAML *syntastic-yaml-jsyaml*
+
+Name: jsyaml
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+"JavaScript YAML" is a parser for YAML. See the project's page at GitHub for
+details:
+
+ https://github.com/nodeca/js-yaml
+
+Installation~
+
+Install it with "npm": >
+ npm install -g js-yaml
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+------------------------------------------------------------------------------
+2. yamllint *syntastic-yaml-yamllint*
+
+Name: yamllint
+Maintainer: Adrien VergĂŠ
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+"yamllint" is a linter and style checker for YAML.
+See the project's page at GitHub for details:
+
+ https://github.com/adrienverge/yamllint
+
+Installation~
+
+Install it with "pip": >
+ pip install yamllint
+<
+------------------------------------------------------------------------------
+3. YAML::XS *syntastic-yaml-yamlxs*
+
+Name: yamlxs
+Maintainer: LCD 47 <lcd047@gmail.com>
+
+This is a syntax checker for YAML 1.1 using the Perl module "YAML::XS":
+
+ https://metacpan.org/pod/YAML::XS
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Additionally:
+
+ 'g:syntastic_perl_interpreter'
+Type: string
+Default: "perl"
+The perl interpreter to use.
+
+ 'g:syntastic_perl_lib_path'
+Type: list
+Default: []
+List of include directories to be added to the perl command line. Example: >
+ let g:syntastic_perl_lib_path = [ "/usr/local/lib/perl5/auto" ]
+<
+Note~
+
+The variable |'g:syntastic_perl_interpreter'| is shared with the "perl" checker
+(cf. |syntastic-perl-perl|). If for some reasons you don't want to use the same
+interpreter for both checkers, you can override it locally by setting
+'g:syntastic_yaml_yamlxs_exec'.
+
+==============================================================================
+SYNTAX CHECKERS FOR YANG *syntastic-checkers-yang*
+
+The following checkers are available for YANG data models (filetype "yang"):
+
+ 1. pyang....................|syntastic-yang-pyang|
+
+------------------------------------------------------------------------------
+1. pyang *syntastic-yang-pyang*
+
+Name: pyang
+Maintainer: Joshua Downer <joshua.downer@gmail.com>
+
+"pyang" is a validator for YANG data models (http://www.yang-central.org/).
+See the project's page at GitHub for more information:
+
+ https://github.com/mbj4668/pyang
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You probably also need a plugin to set |filetype| for YANG files, such as
+"yang.vim":
+
+ https://github.com/nathanalderson/yang.vim
+
+==============================================================================
+SYNTAX CHECKERS FOR Z80 *syntastic-checkers-z80*
+
+The following checkers are available for Z80 (filetype "z80"):
+
+ 1. Z80syntaxchecker.........|syntastic-z80-z80syntaxchecker|
+
+------------------------------------------------------------------------------
+1. Z80syntaxchecker *syntastic-z80-z80syntaxchecker*
+
+Name: z80syntaxchecker
+Maintainer: Romain Giot <giot.romain@gmail.com>
+
+"Z80syntaxchecker" is a syntax checker for Z80 assembly files.
+
+Installation~
+
+To install "Z80syntaxchecker" either install "pycpcdemotools"
+(https://github.com/cpcsdk/pycpcdemotools), or copy the following script to a
+directory in your "$PATH":
+
+ https://raw.githubusercontent.com/rgiot/pycpcdemotools/master/cpcdemotools/source_checker/z80_syntax_checker.py
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+SYNTAX CHECKERS FOR ZOPE PAGE TEMPLATES *syntastic-checkers-zpt*
+
+The following checkers are available for Zope Page Templates (filetype "zpt"):
+
+ 1. zptlint..................|syntastic-zpt-zptlint|
+
+------------------------------------------------------------------------------
+1. zptlint *syntastic-zpt-zptlint*
+
+Name: zptlint
+Maintainer: claytron <robots@claytron.com>
+
+"zptlint" is a checker for Zope Page Templates. See the project's README for
+more information:
+
+ https://trac.bubblenet.be/browser/bubblenet/pythoncode/zptlint/trunk/README.txt?format=txt
+
+Installation~
+
+Install it with "pip": >
+ pip install zptlint
+<
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+Note~
+
+You probably also need to set |filetype| for Zope Page Templates to "zpt".
+You can do that with an `:autocmd`: >
+ autocmd BufNewFile,BufRead *.pt,*.cpt,*.zpt set filetype=zpt syntax=xml
+<
+==============================================================================
+SYNTAX CHECKERS FOR ZSH *syntastic-checkers-zsh*
+
+The following checkers are available for Zsh (filetype "zsh"):
+
+ 1. zsh......................|syntastic-zsh-zsh|
+
+------------------------------------------------------------------------------
+1. zsh *syntastic-zsh-zsh*
+
+Name: zsh
+Maintainer: Martin Grenfell <martin.grenfell@gmail.com>
+
+Checker options~
+
+This checker is initialised using the "makeprgBuild()" function and thus it
+accepts the standard options described at |syntastic-config-makeprg|.
+
+==============================================================================
+CONFIGURATION FILES *syntastic-config-files*
+
+ Supported checkers..........|syntastic-config-checkers|
+ Naming......................|syntastic-config-naming|
+ Location....................|syntastic-config-location|
+ Format......................|syntastic-config-format|
+
+ *syntastic-config-checkers*
+Currently, the following checkers can read some of their options from
+syntastic-specific configuration files:
+
+ ADA~
+ GCC (|syntastic-ada-gcc|)
+
+ Assembly Languages~
+ GCC (|syntastic-asm-gcc|)
+
+ C~
+ AVR-GCC (|syntastic-c-avrgcc|)
+ ClangCheck (|syntastic-c-clang_check|)
+ Clang-Tidy (|syntastic-c-clang_tidy|)
+ Cppcheck (|syntastic-c-cppcheck|)
+ GCC (|syntastic-c-gcc|)
+ OCLint (|syntastic-c-oclint|)
+ Sparse (|syntastic-c-sparse|)
+ Splint (|syntastic-c-splint|)
+
+ COBOL~
+ OpenCOBOL (|syntastic-cobol-cobc|)
+
+ C++~
+ ClangCheck (|syntastic-cpp-clang_check|)
+ Clang-Tidy (|syntastic-cpp-clang_tidy|)
+ Cppcheck (|syntastic-cpp-cppcheck|)
+ GCC (|syntastic-cpp-gcc|)
+ OCLint (|syntastic-cpp-oclint|)
+ Vera++ (|syntastic-cpp-verapp|)
+
+ D~
+ DMD (|syntastic-d-dmd|)
+
+ Fortran~
+ GNU Fortran (|syntastic-fortran-gfortran|)
+
+ Objective-C~
+ GCC (|syntastic-objc-gcc|)
+ OCLint (|syntastic-objc-oclint|)
+
+ Objective-C++~
+ GCC (|syntastic-objcpp-gcc|)
+ OCLint (|syntastic-objcpp-oclint|)
+
+ Verilog~
+ Verilator (|syntastic-verilog-verilator|)
+
+ *syntastic-config-naming*
+Naming~
+
+Depending on checker, the filename of the corresponding configuration file
+can be specified by setting either 'g:syntastic_<filetype>_config_file' or
+'g:syntastic_<checker>_config_file'. Refer to the docs for the particular
+checkers above for the exact names.
+ *syntastic-config-location*
+Location~
+
+A configuration file is looked up in the directory of the file being checked,
+then upwards in parent directories. The search stops either when a file with
+the right name is found, or when the root of the filesystem is reached.
+
+Consequently, you would normally put a configuration file in the top directory
+of your project, and you would override it when needed with other configuration
+files placed in subdirectories.
+ *syntastic-config-format*
+Format~
+
+The file is expected to contain one option per line. Empty lines and lines
+starting with `#` are removed. On each line, leading and trailing spaces are
+also removed. Each option is then escaped, so you don't have to worry about
+special characters.
+
+Lines starting with `-I` are assumed to be include paths, and are handled
+specially. If the path following an `-I` is relative, it's treated as
+being relative to the current configuration file, and is replaced by the
+corresponding absolute path. If the path is absolute to begin with, it is
+left unchanged.
+
+Please note that, aside from `-I`, syntastic doesn't try to keep track of
+options with arguments. If you need to pass f.i. `-aux-info filename` to your
+compiler you have to write `-aux-info` and `filename` on separate lines in the
+configuration file, otherwise syntastic will quote the space and merge them in
+a single string, which is probably not what you mean: >
+ -aux-info
+ filename
+<
+In the same vein, `=` in options not special in any way. As stated
+above, everything on a line (except lines starting with `-I`, as noted)
+is considered an "option" and escaped.
+
+ vim:tw=78:sw=4:ft=help:norl:
diff --git a/vim/bundle/syntastic/doc/syntastic.txt b/vim/bundle/syntastic/doc/syntastic.txt
new file mode 100644
index 0000000..9b9674e
--- /dev/null
+++ b/vim/bundle/syntastic/doc/syntastic.txt
@@ -0,0 +1,1128 @@
+*syntastic.txt* Syntax checking on the fly has never been so pimp.
+*syntastic*
+
+
+ It's a bird! It's a plane! ZOMG It's ... ~
+
+ _____ __ __ _ ~
+ / ___/__ ______ / /_____ ______/ /_(_)____ ~
+ \__ \/ / / / __ \/ __/ __ `/ ___/ __/ / ___/ ~
+ ___/ / /_/ / / / / /_/ /_/ (__ ) /_/ / /__ ~
+ /____/\__, /_/ /_/\__/\__,_/____/\__/_/\___/ ~
+ /____/ ~
+
+
+
+ Reference Manual~
+
+
+==============================================================================
+CONTENTS *syntastic-contents*
+
+ 1.Intro........................................|syntastic-intro|
+ 1.1.Quick start............................|syntastic-quickstart|
+ 1.2.Recommended settings...................|syntastic-recommended|
+ 2.Functionality provided.......................|syntastic-functionality|
+ 2.1.The statusline flag....................|syntastic-statusline-flag|
+ 2.2.Error signs............................|syntastic-error-signs|
+ 2.3.Error window...........................|syntastic-error-window|
+ 2.4.Error highlighting.....................|syntastic-highlighting|
+ 2.5.Aggregating errors.....................|syntastic-aggregating-errors|
+ 2.6.Filtering errors.......................|syntastic-filtering-errors|
+ 3.Commands.....................................|syntastic-commands|
+ 4.Global Options...............................|syntastic-global-options|
+ 5.Checker Options..............................|syntastic-checker-options|
+ 5.1.Choosing which checkers to use.........|syntastic-filetype-checkers|
+ 5.2.Choosing the executable................|syntastic-config-exec|
+ 5.3.Configuring specific checkers..........|syntastic-config-makeprg|
+ 5.4.Sorting errors.........................|syntastic-config-sort|
+ 5.5.Filtering errors.......................|syntastic-config-filtering|
+ 5.6.Debugging..............................|syntastic-config-debug|
+ 5.7.Profiling..............................|syntastic-profiling|
+ 6.Notes........................................|syntastic-notes|
+ 6.1.Handling of composite filetypes........|syntastic-composite|
+ 6.2.Editing files over network.............|syntastic-netrw|
+ 6.3.The 'shellslash' option................|syntastic-shellslash|
+ 6.4.Saving Vim sessions....................|syntastic-sessions|
+ 7.Compatibility with other software............|syntastic-compatibility|
+ 7.1.The csh and tcsh shells................|syntastic-csh|
+ 7.2.Eclim..................................|syntastic-eclim|
+ 7.3.The fish shell.........................|syntastic-fish|
+ 7.4.The fizsh shell........................|syntastic-fizsh|
+ 7.5.flagship...............................|syntastic-flagship|
+ 7.6.powerline..............................|syntastic-powerline|
+ 7.7.The PowerShell shell...................|syntastic-powershell|
+ 7.8.python-mode............................|syntastic-pymode|
+ 7.9.vim-auto-save..........................|syntastic-vim-auto-save|
+ 7.10.vim-go................................|syntastic-vim-go|
+ 7.11.vim-virtualenv........................|syntastic-vim-virtualenv|
+ 7.12.YouCompleteMe.........................|syntastic-ycm|
+ 7.13.The zsh shell and MacVim..............|syntastic-zsh|
+ 8.About........................................|syntastic-about|
+ 9.License......................................|syntastic-license|
+
+
+==============================================================================
+1. Intro *syntastic-intro*
+
+Syntastic is a syntax checking plugin that runs files through external syntax
+checkers. This can be done on demand, or automatically as files are saved
+and opened. If syntax errors are detected, the user is notified and is happy
+because they didn't have to compile their code or execute their script to find
+them.
+
+Syntastic comes in two parts: the syntax checker plugins, and the core. The
+syntax checker plugins are defined on a per-filetype basis where each one wraps
+up an external syntax checking program. The core script delegates off to these
+plugins and uses their output to provide the syntastic functionality.
+
+Take a look at the list of supported filetypes and checkers: |syntastic-checkers|.
+
+Note: This doc only deals with using syntastic. To learn how to write syntax
+checker integrations, see the guide on the GitHub wiki:
+
+ https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
+
+------------------------------------------------------------------------------
+1.1. Quick start *syntastic-quickstart*
+
+Syntastic comes preconfigured with a default list of enabled checkers per
+|filetype|. This list is kept reasonably short to prevent slowing down Vim or
+trying to use conflicting checkers.
+
+You can see the list of checkers available for the current filetype with the
+`:SyntasticInfo` command.
+
+You probably want to override the configured list of checkers for the
+filetypes you use, and also change the arguments passed to specific checkers
+to suit your needs. See |syntastic-checker-options| below for details.
+
+Use `:SyntasticCheck` to manually check right now. Use `:Errors` to open the
+|location-list| window, and `:lclose` to close it. You can clear the error
+list with `:SyntasticReset`, and you can use `:SyntasticToggleMode` to switch
+between active (checking on writing the buffer) and passive (manual) checking.
+
+You don't have to switch focus to the |location-list| window to jump to the
+different errors. Vim provides several built-in commands for this, for
+example `:lnext` and `:lprevious`. You may want to add shortcut mappings for
+these commands, or perhaps install a plugin such as Tim Pope's "unimpaired"
+(see https://github.com/tpope/vim-unimpaired) that provides such mappings.
+
+------------------------------------------------------------------------------
+1.2. Recommended settings *syntastic-recommended*
+
+Syntastic has numerous options that can be configured, and the defaults are
+not particularly well suitable for new users. It is recommended that you start
+by adding the following lines to your vimrc, and return to them later as
+needed: >
+ set statusline+=%#warningmsg#
+ set statusline+=%{SyntasticStatuslineFlag()}
+ set statusline+=%*
+
+ let g:syntastic_always_populate_loc_list = 1
+ let g:syntastic_auto_loc_list = 1
+ let g:syntastic_check_on_open = 1
+ let g:syntastic_check_on_wq = 0
+<
+==============================================================================
+2. Functionality provided *syntastic-functionality*
+
+Syntax checking can be done automatically or on demand (see
+|'syntastic_mode_map'| and `:SyntasticToggleMode` for configuring this).
+
+When syntax checking is done, the features below can be used to notify the
+user of errors. See |syntastic-global-options| for how to configure and
+activate/deactivate these features.
+
+ * A statusline flag
+ * Signs beside lines with errors
+ * The |location-list| can be populated with the errors for the associated
+ buffer
+ * Erroneous parts of lines can be highlighted (this functionality is only
+ provided by some syntax checkers)
+ * Balloons (if the |+balloon_eval| feature is compiled in) can be used to
+ display error messages for erroneous lines when hovering the mouse over
+ them
+ * Error messages from multiple checkers can be aggregated in a single list
+
+------------------------------------------------------------------------------
+2.1. The statusline flag *syntastic-statusline-flag*
+
+To use the statusline flag, this must appear in your |'statusline'| setting >
+ %{SyntasticStatuslineFlag()}
+<
+Something like this could be more useful: >
+ set statusline+=%#warningmsg#
+ set statusline+=%{SyntasticStatuslineFlag()}
+ set statusline+=%*
+<
+When syntax errors are detected a flag will be shown. The content of the flag
+is derived from the |syntastic_stl_format| option.
+
+Please note that these settings might conflict with other Vim plugins that
+change the way statusline works. Refer to these plugins' documentation for
+possible solutions. See also |syntastic-powerline| below if you're using the
+"powerline" Vim plugin (https://github.com/powerline/powerline).
+
+------------------------------------------------------------------------------
+2.2. Error signs *syntastic-error-signs*
+
+Syntastic uses the `:sign` commands (provided that the |+signs| feature is
+compiled in) to mark lines with errors and warnings in the sign column. To
+enable this feature, use the |'syntastic_enable_signs'| option.
+
+Signs are colored using the Error and Todo syntax highlight groups by default
+(see |group-name|). If you wish to customize the colors for the signs, you
+can use the following groups:
+ SyntasticErrorSign - For syntax errors, links to "error" by default
+ SyntasticWarningSign - For syntax warnings, links to "todo" by default
+ SyntasticStyleErrorSign - For style errors, links to "SyntasticErrorSign"
+ by default
+ SyntasticStyleWarningSign - For style warnings, links to
+ "SyntasticWarningSign" by default
+
+Example: >
+ highlight SyntasticErrorSign guifg=white guibg=red
+<
+To set up highlighting for the line where a sign resides, you can use the
+following highlight groups:
+ SyntasticErrorLine
+ SyntasticWarningLine
+ SyntasticStyleErrorLine - Links to "SyntasticErrorLine" by default
+ SyntasticStyleWarningLine - Links to "SyntasticWarningLine" by default
+
+Example: >
+ highlight SyntasticErrorLine guibg=#2f0000
+<
+------------------------------------------------------------------------------
+2.3. The error window *syntastic-error-window*
+
+You can use the `:Errors` command to display the errors for the current buffer
+in the |location-list|.
+
+By default syntastic doesn't fill the |location-list| with the errors found by
+the checkers, in order to reduce clashes with other plugins. Consequently, if
+you run `:lopen` or `:lwindow` rather than `:Errors` to open the error window
+you wouldn't see syntastic's list of errors. If you insist on using `:lopen`
+or `:lwindow` you should either run `:SyntasticSetLoclist` after running the
+checks, or set |'syntastic_always_populate_loc_list'| which tells syntastic to
+update the |location-list| automatically.
+
+------------------------------------------------------------------------------
+2.4. Error highlighting *syntastic-highlighting*
+
+Some checkers provide enough information for syntastic to be able to highlight
+errors. By default the SpellBad syntax highlight group is used to color errors,
+and the SpellCap group is used for warnings. If you wish to customize the
+colors for highlighting you can use the following groups:
+ SyntasticError - Links to "SpellBad" by default (see |hl-SpellBad|)
+ SyntasticWarning - Links to "SpellCap" by default (see |hl-SpellCap|)
+ SyntasticStyleError - Links to "SyntasticError" by default
+ SyntasticStyleWarning - Links to "SyntasticWarning" by default
+
+Example: >
+ highlight SyntasticError guibg=#2f0000
+<
+------------------------------------------------------------------------------
+2.5. Aggregating errors *syntastic-aggregating-errors*
+
+By default, namely if |'syntastic_aggregate_errors'| is unset, syntastic runs
+in turn the checkers corresponding to the filetype of the current file (see
+|syntastic-filetype-checkers|), and stops as soon as a checker reports any
+errors. It then notifies you of the errors using the notification mechanisms
+above. In this mode error lists are always produced by a single checker, and,
+if you open the error window, the name of the checker that generated the errors
+is shown on the statusline of the error window.
+
+If |'syntastic_aggregate_errors'| is set, syntastic runs all checkers that
+apply (still cf. |syntastic-filetype-checkers|), then aggregates errors found
+by all checkers in a single list, and notifies you. In this mode each error
+message is labeled with the name of the checker that generated it, but you can
+disable generation of these labels by turning off |'syntastic_id_checkers'|.
+
+If |'syntastic_sort_aggregated_errors'| is set (which is the default), messages
+in the aggregated list are grouped by file, then sorted by line number, then
+type, then column number. Otherwise messages produced by the same checker are
+grouped together, and sorting within each group is decided by the variables
+|'syntastic_<filetype>_<checker>_sort'|.
+
+------------------------------------------------------------------------------
+2.6 Filtering errors *syntastic-filtering-errors*
+
+You can selectively disable some of the errors found by checkers either
+using |'syntastic_quiet_messages'|, or by specifying a list of patterns in
+|'syntastic_ignore_files'|.
+
+See also: |'syntastic_<filetype>_<checker>_quiet_messages'| and
+|'b:syntastic_skip_checks'|.
+
+==============================================================================
+3. Commands *syntastic-commands*
+
+:Errors *:Errors*
+
+When errors have been detected, use this command to pop up the |location-list|
+and display the error messages.
+
+Please note that the `:Errors` command overwrites the current location list with
+syntastic's own location list.
+
+:SyntasticToggleMode *:SyntasticToggleMode*
+
+Toggles syntastic between active and passive mode. See |'syntastic_mode_map'|
+for more info.
+
+:SyntasticCheck *:SyntasticCheck*
+
+Manually cause a syntax check to be done. By default the checkers in the
+|'g:syntastic_<filetype>_checkers'| or |'b:syntastic_checkers'| lists are run,
+cf. |syntastic-filetype-checkers|. If |'syntastic_aggregate_errors'| is unset
+(which is the default), checking stops the first time a checker reports any
+errors; if |'syntastic_aggregate_errors'| is set, all checkers that apply are
+run in turn, and all errors found are aggregated in a single list.
+
+The command may be followed by a (space separated) list of checkers. In this
+case |'g:syntastic_<filetype>_checkers'| and |'b:syntastic_checkers'| are
+ignored, and the checkers named by the command's arguments are run instead, in
+the order specified. The set by |'syntastic_aggregate_errors'| still apply.
+
+Example: >
+ :SyntasticCheck flake8 pylint
+<
+:SyntasticInfo *:SyntasticInfo*
+
+The command takes an optional argument, and outputs information about the
+checkers available for the filetype named by said argument, or for the current
+filetype if no argument was provided.
+
+:SyntasticReset *:SyntasticReset*
+
+Resets the list of errors and turns off all error notifiers.
+
+:SyntasticSetLoclist *:SyntasticSetLoclist*
+
+If |'syntastic_always_populate_loc_list'| is not set, the |location-list| is
+not filled in automatically with the list of errors detected by the checkers.
+This is useful if you run syntastic along with other plugins that use location
+lists. The `:SyntasticSetLoclist` command allows you to stick the errors into
+the location list explicitly.
+
+==============================================================================
+4. Global Options *syntastic-global-options*
+
+ *'syntastic_check_on_open'*
+Type: boolean
+Default: 0
+If this variable is enabled, syntastic in active mode will run syntax checks
+when buffers are first loaded, as well as on saving: >
+ let g:syntastic_check_on_open = 1
+<
+ *'syntastic_check_on_wq'*
+Type: boolean
+Default: 1
+In active mode syntax checks are normally run whenever buffers are written to
+disk, even when the writes happen just before quitting Vim. If you want to
+skip checks when you issue `:wq`, `:x`, and `:ZZ`, set this variable to 0: >
+ let g:syntastic_check_on_wq = 0
+<
+ *'syntastic_aggregate_errors'*
+Type: boolean
+Default: 0
+When enabled, syntastic runs all checkers that apply to the current filetype,
+then aggregates errors found by all checkers and displays them. When disabled,
+syntastic runs each checker in turn, and stops to display the results the first
+time a checker finds any errors. >
+ let g:syntastic_aggregate_errors = 1
+<
+ *'syntastic_id_checkers'*
+Type: boolean
+Default: 1
+When results from multiple checkers are aggregated in a single error list
+(that is either when |'syntastic_aggregate_errors'| is enabled, or when
+checking a file with a composite filetype, cf. |syntastic-composite|), it
+might not be immediately obvious which checker has produced a given error
+message. This variable instructs syntastic to label error messages with the
+names of the checkers that created them. >
+ let g:syntastic_id_checkers = 0
+<
+ *'syntastic_sort_aggregated_errors'*
+Type: boolean
+Default: 1
+By default, when results from multiple checkers are aggregated in a single
+error list (that is either when |'syntastic_aggregate_errors'| is enabled, or
+when checking a file with a composite filetype, cf. |syntastic-composite|),
+errors are grouped by file, then sorted by line number, then grouped by type
+(namely errors take precedence over warnings), then they are sorted by column
+number. If you want to leave messages grouped by checker output, set this
+variable to 0: >
+ let g:syntastic_sort_aggregated_errors = 0
+<
+ *'syntastic_echo_current_error'*
+Type: boolean
+Default: 1
+If enabled, syntastic will echo current error to the command window. If
+multiple errors are found on the same line, |'syntastic_cursor_columns'| is
+used to decide which one is shown. >
+ let g:syntastic_echo_current_error = 1
+<
+ *'syntastic_cursor_columns'*
+Type: boolean
+Default: 1
+This option controls which errors are echoed to the command window if
+|'syntastic_echo_current_error'| is set and multiple errors are found on the
+same line. When the option is enabled, the first error corresponding to the
+current column is shown. Otherwise, the first error on the current line is
+echoed, regardless of the cursor position on the current line.
+
+When dealing with very large lists of errors, disabling this option can speed
+up navigation significantly: >
+ let g:syntastic_cursor_column = 0
+<
+ *'syntastic_enable_signs'*
+Type: boolean
+Default: 1
+Use this option to tell syntastic whether to use the `:sign` interface to mark
+syntax errors: >
+ let g:syntastic_enable_signs = 1
+<
+ *'syntastic_error_symbol'* *'syntastic_style_error_symbol'*
+ *'syntastic_warning_symbol'* *'syntastic_style_warning_symbol'*
+Type: string
+Use these options to control what the syntastic `:sign` text contains. Several
+error symbols can be customized:
+ syntastic_error_symbol - For syntax errors, defaults to ">>"
+ syntastic_style_error_symbol - For style errors, defaults to "S>"
+ syntastic_warning_symbol - For syntax warnings, defaults to ">>"
+ syntastic_style_warning_symbol - For style warnings, defaults to "S>"
+
+Example: >
+ let g:syntastic_error_symbol = "\u2717"
+ let g:syntastic_warning_symbol = "\u26A0"
+<
+ *'syntastic_enable_balloons'*
+Type: boolean
+Default: 1
+Use this option to tell syntastic whether to display error messages in balloons
+when the mouse is hovered over erroneous lines: >
+ let g:syntastic_enable_balloons = 1
+<
+Note that Vim must be compiled with |+balloon_eval|.
+
+ *'syntastic_enable_highlighting'*
+Type: boolean
+Default: 1
+Use this option to tell syntastic whether to use syntax highlighting to mark
+errors (where possible). Highlighting can be turned off with the following >
+ let g:syntastic_enable_highlighting = 0
+<
+ *'syntastic_always_populate_loc_list'*
+Type: boolean
+Default: 0
+By default syntastic doesn't fill the |location-list| with the errors found
+by the checkers, in order to reduce clashes with other plugins. Enable this
+option to tell syntastic to always stick any detected errors into the
+|location-list|: >
+ let g:syntastic_always_populate_loc_list = 1
+<
+Please note that if |'syntastic_auto_jump'| is set to a non-zero value the
+location list is overwritten with Syntastic's own list when taking a jump,
+regardless of the value of |'syntastic_always_populate_loc_list'|. The
+location list is also overwritten when running the `:Errors` command.
+
+ *'syntastic_auto_jump'*
+Type: integer
+Default: 0
+Enable this option if you want the cursor to jump to the first detected issue
+when saving or opening a file.
+
+When set to 0 the cursor won't jump automatically. >
+ let g:syntastic_auto_jump = 0
+<
+When set to 1 the cursor will always jump to the first issue detected,
+regardless of type. >
+ let g:syntastic_auto_jump = 1
+<
+When set to 2 the cursor will jump to the first issue detected, but only if
+this issue is an error. >
+ let g:syntastic_auto_jump = 2
+<
+When set to 3 the cursor will jump to the first error detected, if any. If
+all issues detected are warnings, the cursor won't jump. >
+ let g:syntastic_auto_jump = 3
+<
+Please note that in either situation taking the jump also has the side effect
+of the location list being overwritten with Syntastic's own location list,
+regardless of the value of |'syntastic_always_populate_loc_list'|.
+
+ *'syntastic_auto_loc_list'*
+Type: integer
+Default: 2
+Use this option to tell syntastic to automatically open and/or close the
+|location-list| (see |syntastic-error-window|).
+
+When set to 0 the error window will be neither opened nor closed
+automatically. >
+ let g:syntastic_auto_loc_list = 0
+<
+When set to 1 the error window will be automatically opened when errors are
+detected, and closed when none are detected. >
+ let g:syntastic_auto_loc_list = 1
+<
+When set to 2 the error window will be automatically closed when no errors are
+detected, but not opened automatically. >
+ let g:syntastic_auto_loc_list = 2
+<
+When set to 3 the error window will be automatically opened when errors are
+detected, but not closed automatically. >
+ let g:syntastic_auto_loc_list = 3
+<
+ *'syntastic_loc_list_height'*
+Type: integer
+Default: 10
+Use this option to specify the height of the location lists that syntastic
+opens. >
+ let g:syntastic_loc_list_height = 5
+<
+ *'syntastic_ignore_files'*
+Type: list of strings
+Default: []
+Use this option to specify files that syntastic should never check. It's a
+list of |regular-expression| patterns. The full paths of files (see |::p|) are
+matched against these patterns, and the matches are case-sensitive. Use |\c|
+to specify case-insensitive patterns. Example: >
+ let g:syntastic_ignore_files = ['\m^/usr/include/', '\m\c\.h$']
+<
+ *'syntastic_filetype_map'*
+Type: dictionary
+Default: {}
+Use this option to map non-standard filetypes to standard ones. Corresponding
+checkers are mapped accordingly, which allows syntastic to check files with
+non-standard filetypes: >
+ let g:syntastic_filetype_map = {
+ \ "plaintex": "tex",
+ \ "gentoo-metadata": "xml" }
+<
+Composite filetypes (cf. |syntastic-composite|) can also be mapped to simple
+types, which disables the default behaviour of running both checkers against
+the input file: >
+ let g:syntastic_filetype_map = { "handlebars.html": "handlebars" }
+<
+ *'syntastic_mode_map'*
+Type: dictionary
+Default: { "mode": "active",
+ "active_filetypes": [],
+ "passive_filetypes": [] }
+Use this option to fine tune when automatic syntax checking is done (or not
+done).
+
+The option should be set to something like: >
+ let g:syntastic_mode_map = {
+ \ "mode": "active",
+ \ "active_filetypes": ["ruby", "php"],
+ \ "passive_filetypes": ["puppet"] }
+<
+"mode" can be mapped to one of two values - "active" or "passive". When set
+to "active", syntastic does automatic checking whenever a buffer is saved or
+initially opened. When set to "passive" syntastic only checks when the user
+calls `:SyntasticCheck`.
+
+The exceptions to these rules are defined with "active_filetypes" and
+"passive_filetypes". In passive mode, automatic checks are still done for
+filetypes in the "active_filetypes" array (and "passive_filetypes" is
+ignored). In active mode, automatic checks are not done for any filetypes in
+the "passive_filetypes" array ("active_filetypes" is ignored).
+
+If any of "mode", "active_filetypes", or "passive_filetypes" are left
+unspecified, they default to values above.
+
+If local variable |'b:syntastic_mode'| is defined its value takes precedence
+over all calculations involving |'syntastic_mode_map'| for the corresponding
+buffer.
+
+At runtime, the `:SyntasticToggleMode` command can be used to switch between
+active and passive modes.
+
+ *'b:syntastic_mode'*
+Type: string
+Default: unset
+Only the local form |'b:syntastic_mode'| is used. When set to either "active"
+or "passive", it takes precedence over |'syntastic_mode_map'| when deciding
+whether the corresponding buffer should be checked automatically.
+
+ *'syntastic_quiet_messages'*
+Type: dictionary
+Default: {}
+Use this option to filter out some of the messages produced by checkers. The
+option should be set to something like: >
+ let g:syntastic_quiet_messages = {
+ \ "!level": "errors",
+ \ "type": "style",
+ \ "regex": '\m\[C03\d\d\]',
+ \ "file:p": ['\m^/usr/include/', '\m\c\.h$'] }
+<
+Each element turns off messages matching the patterns specified by the
+corresponding value. Values are lists, but if a list consists of a single
+element you may omit the brackets (e.g. you may write "style" instead of
+["style"]). Elements with values [] or "" are ignored (this is useful for
+overriding filters, cf. |filter-overrides|).
+
+ "level" - takes one of two values, "warnings" or "errors"
+ "type" - can be either "syntax" or "style"
+ "regex" - each item in list is matched against the messages' text as a
+ case-insensitive |regular-expression|
+ "file" - each item in list is matched against the filenames the messages
+ refer to, as a case-sensitive |regular-expression|.
+
+If a key is prefixed by an exclamation mark "!", the corresponding filter is
+negated (i.e. the above example silences all messages that are NOT errors).
+
+The "file" key may be followed by one or more filename modifiers (see
+|filename-modifiers|). The modifiers are applied to the filenames the messages
+refer to before matching against the value (i.e. in the above example the full
+path of the issues are matched against '\m^/usr/include/' and '\m\c\.h$').
+
+If |'syntastic_id_checkers'| is set, filters are applied before error messages
+are labeled with the names of the checkers that created them.
+
+There are also checker-specific variants of this option, providing finer
+control. They are named |'syntastic_<filetype>_<checker>_quiet_messages'|.
+
+For a particular checker, if both a |'syntastic_quiet_messages'| filter and
+a checker-specific filter are present, they are both applied (to the list of
+errors produced by the said checker). In case of conflicting values for the
+same keys, the values of the checker-specific filters take precedence.
+
+ *filter-overrides*
+Since filter elements with values [] or "" are ignored, you can disable global
+filters for particular checkers, by setting the values of the corresponding
+elements in |'syntastic_<filetype>_<checker>_quiet_messages'| to [] or "". For
+example, the following setting will silence all warnings, except for the
+ones produced by "pylint": >
+ let g:syntastic_quiet_messages = { "level": "warnings" }
+ let g:syntastic_python_pylint_quiet_messages = { "level" : [] }
+<
+ *'syntastic_stl_format'*
+Type: string
+Default: "[Syntax: line:%F (%t)]"
+Use this option to control what the syntastic statusline text contains. Several
+magic flags are available to insert information:
+ %e - number of errors
+ %w - number of warnings
+ %t - total number of warnings and errors
+ %ne - filename of file containing first error
+ %nw - filename of file containing first warning
+ %N - filename of file containing first warning or error
+ %pe - filename with path of file containing first error
+ %pw - filename with path of file containing first warning
+ %P - filename with path of file containing first warning or error
+ %fe - line number of first error
+ %fw - line number of first warning
+ %F - line number of first warning or error
+
+These flags accept width and alignment controls similar to the ones used by
+|'statusline'| flags:
+ %-0{minwid}.{maxwid}{flag}
+
+All fields except {flag} are optional. A single percent sign can be given as
+"%%".
+
+Several additional flags are available to hide text under certain conditions:
+ %E{...} - hide the text in the brackets unless there are errors
+ %W{...} - hide the text in the brackets unless there are warnings
+ %B{...} - hide the text in the brackets unless there are both warnings AND
+ errors
+These flags can't be nested.
+
+Example: >
+ let g:syntastic_stl_format = "[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]"
+<
+If this format is used and the current buffer has 5 errors and 1 warning
+starting on lines 20 and 10 respectively then this would appear on the
+statusline: >
+ [Err: 20 #5, Warn: 10 #1]
+<
+If the buffer had 2 warnings, starting on line 5 then this would appear: >
+ [Warn: 5 #2]
+<
+ *'b:syntastic_skip_checks'*
+Type: boolean
+Default: unset
+Only the local form |'b:syntastic_skip_checks'| is used. When set to a true
+value, no checks are run against the corresponding buffer. Example: >
+ let b:syntastic_skip_checks = 1
+<
+ *'syntastic_full_redraws'*
+Type: boolean
+Default: 0 in GUI Vim and MacVim, 1 otherwise
+Controls whether syntastic calls `:redraw` or `:redraw!` for screen redraws.
+Changing it can in principle make screen redraws smoother, but it can also
+cause screen to flicker, or cause ghost characters. Leaving it to the default
+should be safe.
+
+ *'syntastic_exit_checks'*
+Type: boolean
+Default: 0 when running under "cmd.exe" on Windows, 1 otherwise
+Syntastic attempts to catch abnormal termination conditions from checkers by
+looking at their exit codes. The "cmd.exe" shell on Windows make these checks
+meaningless, by returning 1 to Vim when the checkers exit with non-zero codes.
+The above variable can be used to disable exit code checks in syntastic.
+
+ *'syntastic_shell'*
+Type: string
+Default: Vim's 'shell'
+This is the (full path to) the shell syntastic will use to run the checkers.
+On UNIX and Mac OS-X this shell must accept Bourne-compatible syntax for
+file "stdout" and "stderr" redirections ">file" and "2>file". Examples of
+compatible shells are "zsh", "bash", "ksh", and of course the original Bourne
+"sh".
+
+This shell is independent of Vim's 'shell', and it isn't used for interactive
+operations. It must take care to initialize all environment variables needed
+by the checkers you're using. Example: >
+ let g:syntastic_shell = "/bin/sh"
+<
+ *'syntastic_nested_autocommands'*
+Type: boolean
+Default: 0
+Controls whether syntastic's autocommands |BufReadPost| and |BufWritePost|
+are called from other |BufReadPost| and |BufWritePost| autocommands (see
+|autocmd-nested|). This is known to trigger interoperability problems with
+other plugins, so only enable it if you actually need that functionality.
+
+ *'syntastic_debug'*
+Type: integer
+Default: 0
+Set this to the sum of one or more of the following flags to enable
+debugging:
+
+ 1 - trace general workflow
+ 2 - dump location lists
+ 4 - trace notifiers
+ 8 - trace autocommands
+ 16 - dump options
+ 32 - trace running of specific checkers
+
+Example: >
+ let g:syntastic_debug = 1
+<
+Syntastic will then add debugging messages to Vim's |message-history|. You can
+examine these messages with `:mes`.
+
+ *'syntastic_debug_file'*
+Type: string
+Default: unset
+When set, debugging messages are written to the file named by its value, in
+addition to being added to Vim's |message-history|: >
+ let g:syntastic_debug_file = "~/syntastic.log"
+<
+ *'syntastic_extra_filetypes'*
+Type: list of strings
+Default: []
+List of filetypes handled by checkers external to syntastic. If you have a Vim
+plugin that adds a checker for syntastic, and if the said checker deals with a
+filetype that is unknown to syntastic, you might consider adding that filetype
+to this list: >
+ let g:syntastic_extra_filetypes = [ "make", "gitcommit" ]
+<
+This will allow `:SyntasticInfo` to do proper tab completion for the new
+filetypes.
+
+==============================================================================
+5. Checker Options *syntastic-checker-options*
+
+------------------------------------------------------------------------------
+5.1 Choosing which checkers to use *syntastic-filetype-checkers*
+
+ *'g:syntastic_<filetype>_checkers'*
+You can tell syntastic which checkers to run for a given filetype by setting a
+variable 'g:syntastic_<filetype>_checkers' to a list of checkers, e.g. >
+ let g:syntastic_php_checkers = ["php", "phpcs", "phpmd"]
+<
+ *'b:syntastic_checkers'*
+There is also a per-buffer version of this setting, |'b:syntastic_checkers'|.
+When set, it takes precedence over |'g:syntastic_<filetype>_checkers'|. You can
+use this in an autocmd to configure specific checkers for particular paths: >
+ autocmd FileType python if stridx(expand("%:p"), "/some/path/") == 0 |
+ \ let b:syntastic_checkers = ["pylint"] | endif
+<
+If neither |'g:syntastic_<filetype>_checkers'| nor |'b:syntastic_checkers'|
+is set, a default list of checker is used. Beware however that this list
+deliberately kept minimal, for performance reasons.
+
+Take a look elsewhere in this manual to find out what checkers and filetypes
+are supported by syntastic: |syntastic-checkers|.
+
+Use `:SyntasticInfo` to see which checkers are available for a given filetype.
+
+------------------------------------------------------------------------------
+5.2 Choosing the executable *syntastic-config-exec*
+
+ *'syntastic_<filetype>_<checker>_exec'*
+The executable run by a checker is normally defined automatically, when the
+checker is registered. You can however override it, by setting the variable
+'g:syntastic_<filetype>_<checker>_exec': >
+ let g:syntastic_ruby_mri_exec = "~/bin/ruby2"
+<
+This variable has a local version, 'b:syntastic_<filetype>_<checker>_exec',
+which takes precedence over the global one in the corresponding buffer.
+
+ *'b:syntastic_<checker>_exec'*
+There is also a local variable named 'b:syntastic_<checker>_exec', which
+takes precedence over both 'b:syntastic_<filetype>_<checker>_exec' and
+'g:syntastic_<filetype>_<checker>_exec' in the buffers where it is defined.
+
+------------------------------------------------------------------------------
+5.3 Configuring specific checkers *syntastic-config-makeprg*
+
+Checkers are run by constructing a command line and by passing it to a shell
+(see |'shell'| and |'syntastic_shell'|). In most cases this command line is
+built using an internal function named "makeprgBuild()", which provides a
+number of options that allow you to customise every part of the command that
+gets called.
+
+ *'syntastic_<filetype>_<checker>_<option>'*
+Checkers that use "makeprgBuild()" construct the corresponding command line
+like this: >
+ let makeprg = self.makeprgBuild({
+ \ "exe": self.getExec(),
+ \ "args": "-a -b -c",
+ \ "fname": shellescape(expand("%", 1)),
+ \ "post_args": "--more --args",
+ \ "tail": "2>/dev/null" })
+<
+The result is a command line of the form: >
+ <exe> <args> <fname> <post_args> <tail>
+<
+All fields above are optional, and can be overridden by setting global
+variables 'g:syntastic_<filetype>_<checker-name>_<option-name>' - even
+parameters not specified in the call to "makeprgBuild()". For example to
+override the argguments and the tail: >
+ let g:syntastic_c_pc_lint_args = "-w5 -Iz:/usr/include/linux"
+ let g:syntastic_c_pc_lint_tail = "2>/dev/null"
+<
+These variables also have buffer-local versions named
+'b:syntastic_<filetype>_<checker-name>_<option-name>', which takes precedence
+over the global ones in the corresponding buffers.
+
+You can see the final outcome of setting these variables in the debug logs
+(cf. |syntastic-config-debug|).
+
+Special characters need to be escaped, so that they can survive shell
+expansions. Vim function |shellescape()| can help you with escaping: >
+ let g:syntastic_c_cppcheck_args =
+ \ "-DBUILD_BASENAME=my-module " . shellescape("-DBUILD_STR(s)=#s")
+<
+Alternatively, you can tell syntastic to escape special characters by turning
+the value into a list: >
+ let g:syntastic_c_cppcheck_args =
+ \ ["-DBUILD_BASENAME=my-module", "-DBUILD_STR(s)=#s"]
+<
+Each element of this list is then escaped as needed, and turned into a
+separate argument for the shell.
+
+ *syntastic-config-empty*
+If one of the above variables has a non-empty default and you want it to be
+empty, you can set it to an empty string, e.g.: >
+ let g:syntastic_javascript_jslint_args = ""
+<
+ *'syntastic_<filetype>_<checker>_exe'*
+The 'exe' option is special. Normally it is the same as the 'exec' attribute
+described above, but you can use it to add environment variables to the
+command line, or to change the way the checker is run. For example this setup
+allows you to run PC-Lint on Linux, under Wine emulation: >
+ let g:syntastic_c_pc_lint_exec = "wine"
+ let g:syntastic_c_pc_lint_exe = "wine c:/path/to/lint-nt.exe"
+<
+ *'syntastic_<filetype>_<checker>_fname'*
+
+The 'fname' option is also special. Normally it is automatically set by
+syntastic to the name of the current file, but you can change that as needed.
+For example you can tell the SML/NJ compiler to use Compilation Manager by
+omitting the filename from the command line: >
+ let g:syntastic_sml_smlnj_fname = ""
+<
+ *syntastic-config-no-makeprgbuild*
+For checkers that do not use the "makeprgBuild()" function you will have to
+look at the source code of the checker in question. If there are specific
+options that can be set they are normally documented in this manual (see
+|syntastic-checkers|).
+
+------------------------------------------------------------------------------
+5.4 Sorting errors *syntastic-config-sort*
+
+ *'syntastic_<filetype>_<checker>_sort'*
+Syntastic may decide to group the errors produced by some checkers by file,
+then sort them by line number, then by type, then by column number. If you'd
+prefer to see the errors in the order in which they are output by the external
+checker you can set the variable |'g:syntastic_<filetype>_<checker>_sort'| to 0.
+
+Alternatively, if syntastic doesn't reorder the errors produced by a checker
+but you'd like it to sort them, you can set the same variable to 1.
+
+There is also a local version |'b:syntastic_<filetype>_<checker>_sort'| of
+this variable, that takes precedence over it in the buffers where it is
+defined.
+
+For aggregated lists (see |syntastic-aggregating-errors|) these variables are
+ignored if |'syntastic_sort_aggregated_errors'| is set (which is the default).
+
+------------------------------------------------------------------------------
+5.5 Filtering errors *syntastic-config-filtering*
+
+ *'syntastic_<filetype>_<checker>_quiet_messages'*
+Finally, variables 'g:syntastic_<filetype>_<checker-name>_quiet_messages' can
+be used to filter out some of the messages produced by specific checkers. The
+effect is identical to that of |syntastic_quiet_messages|, except only messages
+from the corresponding checkers are filtered. Example: >
+ let g:syntastic_python_pylama_quiet_messages = {
+ \ "type": "style",
+ \ "regex": '\m\[C03\d\d\]' }
+<
+The syntax is of course identical to that of |syntastic_quiet_messages|.
+
+------------------------------------------------------------------------------
+5.6 Debugging *syntastic-config-debug*
+
+Syntastic can log a trace of its working to Vim's |message-history|. To verify
+the command line constructed by syntastic to run a checker, set the variable
+|'syntastic_debug'| to a non-zero value, run the checker, then run `:mes` to
+display the messages, and look for "makeprg" in the output.
+
+From a user's perspective, the useful values for |'syntastic_debug'| are 1, 3,
+and 33:
+
+ 1 - logs syntastic's workflow
+ 3 - logs workflow, checker's output, and |location-list| manipulations
+ 33 - logs workflow and checker-specific details (such as version checks).
+
+Debug logs can be saved to a file; see |'syntastic_debug_file'| for details.
+
+Setting |'syntastic_debug'| to 0 turns off logging.
+
+------------------------------------------------------------------------------
+5.7 Profiling *syntastic-profiling*
+
+A very useful tool for debugging performance problems is Vim's built-in
+|profiler|. In order to enable profiling for syntastic you need to add two lines
+to your vimrc (not to gvimrc): >
+ profile start syntastic.log
+ profile! file */syntastic/*
+<
+(assuming your copy of syntastic lives in a directory creatively named
+"syntastic"). These lines must be executed before syntastic is loaded, so you
+need to put them before package managers such as "pathogen" or "Vundle", and
+(in newer Vim versions) before any commands related to |packages|.
+
+A log file is created in the current directory, and is updated when you quit
+Vim.
+
+==============================================================================
+6. Notes *syntastic-notes*
+
+------------------------------------------------------------------------------
+6.1. Handling of composite filetypes *syntastic-composite*
+
+Some Vim plugins use composite filetypes, such as "django.python" or
+"handlebars.html". Normally syntastic deals with this situation by splitting
+the filetype in its simple components, and calling all checkers that apply.
+If this behaviour is not desirable, you can disable it by mapping the
+composite filetypes to simple ones using |'syntastic_filetype_map'|, e.g.: >
+ let g:syntastic_filetype_map = { "handlebars.html": "handlebars" }
+<
+------------------------------------------------------------------------------
+6.2 Editing files over network *syntastic-netrw*
+
+The standard plugin |netrw| allows Vim to transparently edit files over
+network and inside archives. Currently syntastic doesn't support this mode
+of operation. It can only check files that can be accessed directly by local
+checkers, without any translation or conversion.
+
+------------------------------------------------------------------------------
+6.3 The 'shellslash' option *syntastic-shellslash*
+
+The 'shellslash' option is relevant only on Windows systems. This option
+determines (among other things) the rules for quoting command lines, and there
+is no easy way for syntastic to make sure its state is appropriate for your
+shell. It should be turned off if your 'shell' (or |'syntastic_shell'|) is
+"cmd.exe", and on for shells that expect an UNIX-like syntax, such as Cygwin's
+"sh". Most checkers will stop working if 'shellslash' is set to the wrong
+value.
+
+------------------------------------------------------------------------------
+6.4 Saving Vim sessions *syntastic-sessions*
+
+If you use `:mksession` to save Vim sessions you should probably make sure to
+remove option "blank" from 'sessionoptions': >
+ set sessionoptions-=blank
+<
+This will prevent `:mksession` from saving |syntastic-error-window| as empty
+quickfix windows.
+
+==============================================================================
+7. Compatibility with other software *syntastic-compatibility*
+
+------------------------------------------------------------------------------
+7.1 The csh and tcsh shells *syntastic-csh*
+
+The "csh" and "tcsh" shells are mostly compatible with syntastic. However,
+some checkers assume Bourne shell syntax for redirecting "stderr". For this
+reason, you should point |'syntastic_shell'| to a Bourne-compatible shell,
+such as "zsh", "bash", "ksh", or even the original Bourne "sh": >
+ let g:syntastic_shell = "/bin/sh"
+<
+------------------------------------------------------------------------------
+7.2. Eclim *syntastic-eclim*
+
+Syntastic can be used together with "Eclim" (see http://eclim.org/). However,
+by default Eclim disables syntastic's checks for the filetypes it supports, in
+order to run its own validation. If you'd prefer to use Eclim but still run
+syntastic's checks, set |g:EclimFileTypeValidate| to 0: >
+ let g:EclimFileTypeValidate = 0
+<
+It is also possible to re-enable syntastic checks only for some filetypes, and
+run Eclim's validation for others. Please consult Eclim's documentation for
+details.
+
+------------------------------------------------------------------------------
+7.3 The fish shell *syntastic-fish*
+
+At the time of this writing the "fish" shell (see http://fishshell.com/)
+doesn't support the standard UNIX syntax for file redirections, and thus it
+can't be used together with syntastic. You can however set |'syntastic_shell'|
+to a more traditional shell, such as "zsh", "bash", "ksh", or even the
+original Bourne "sh": >
+ let g:syntastic_shell = "/bin/sh"
+<
+------------------------------------------------------------------------------
+7.4. The fizsh shell *syntastic-fizsh*
+
+Using syntastic with the "fizsh" shell (see https://github.com/zsh-users/fizsh)
+is possible, but potentially problematic. In order to do it you'll need to set
+'shellredir' like this: >
+ set shellredir=>%s\ 2>&1
+<
+Please keep in mind however that Vim can't take advantage of any of the
+interactive features of "fizsh". Using a more traditional shell such as "zsh",
+"bash", "ksh", or the original Bourne "sh" might be a better choice: >
+ let g:syntastic_shell = "/bin/sh"
+<
+------------------------------------------------------------------------------
+7.5 flagship *syntastic-flagship*
+
+The "flagship" Vim plugin (https://github.com/tpope/vim-flagship) has its
+own mechanism of showing flags on the |'statusline'|. To allow "flagship"
+to manage syntastic's statusline flag add the following |autocommand| to
+your vimrc, rather than explicitly adding the flag to your |'statusline'| as
+described in the |syntastic-statusline-flag| section above: >
+ autocmd User Flags call Hoist("window", "SyntasticStatuslineFlag")
+<
+------------------------------------------------------------------------------
+7.6. powerline *syntastic-powerline*
+
+The "powerline" Vim plugin (https://github.com/powerline/powerline) comes
+packaged with a syntastic segment. To customize this segment create a file
+"~/.config/powerline/themes/vim/default.json", with a content like this: >
+ {
+ "segment_data" : {
+ "powerline.segments.vim.plugin.syntastic.syntastic" : {
+ "args" : {
+ "err_format" : "Err: {first_line} #{num} ",
+ "warn_format" : "Warn: {first_line} #{num} "
+ }
+ }
+ }
+ }
+<
+------------------------------------------------------------------------------
+7.7. The PowerShell shell *syntastic-powershell*
+
+At the time of this writing, syntastic is not compatible with using "Windows
+PowerShell" (http://technet.microsoft.com/en-us/library/bb978526.aspx) as Vim's
+'shell'. You may still run Vim from 'PowerShell', but you do have to point
+Vim's 'shell' to a more traditional program, such as "cmd.exe": >
+ set shell=cmd.exe
+<
+------------------------------------------------------------------------------
+7.8 python-mode *syntastic-pymode*
+
+Syntastic can be used along with the "python-mode" Vim plugin (see
+https://github.com/klen/python-mode). However, they both run syntax checks by
+default when you save buffers to disk, and this is probably not what you want.
+To avoid both plugins opening error windows, you can either set passive mode
+for python in syntastic (see |'syntastic_mode_map'|), or disable lint checks in
+"python-mode", by setting |pymode_lint_on_write| to 0. E.g.: >
+ let g:pymode_lint_on_write = 0
+<
+------------------------------------------------------------------------------
+7.9. vim-auto-save *syntastic-vim-auto-save*
+
+Syntastic can be used together with the "vim-auto-save" Vim plugin (see
+https://github.com/907th/vim-auto-save). However, syntastic checks in active
+mode only work with "vim-auto-save" version 0.1.7 or later.
+
+------------------------------------------------------------------------------
+7.10. vim-go *syntastic-vim-go*
+
+Syntastic can be used along with the "vim-go" Vim plugin (see
+https://github.com/fatih/vim-go). However, both "vim-go" and syntastic run
+syntax checks by default when you save buffers to disk. To avoid conflicts,
+you have to either set passive mode in syntastic for the "go" filetype (see
+|syntastic_mode_map|), or prevent "vim-go" from showing a quickfix window when
+|g:go_fmt_command| fails, by setting |g:go_fmt_fail_silently| to 1. E.g.: >
+ let g:go_fmt_fail_silently = 1
+<
+"vim-go" version 1.4 and earlier always uses |quickfix| lists. Starting with
+version 1.5, "vim-go" can also use location lists (see |location-list|). To
+avoid conflicts with syntastic, you probably want to configure "vim-go" to
+stick with |quickfix| lists: >
+ let g:go_list_type = "quickfix"
+<
+------------------------------------------------------------------------------
+7.11. vim-virtualenv *syntastic-vim-virtualenv*
+
+At the time of this writing, syntastic can't run checkers installed
+in Python virtual environments activated by "vim-virtualenv" (see
+https://github.com/jmcantrell/vim-virtualenv). This is a limitation of
+"vim-virtualenv".
+
+------------------------------------------------------------------------------
+7.12 YouCompleteMe *syntastic-ycm*
+
+Syntastic can be used together with the "YouCompleteMe" Vim plugin (see
+http://valloric.github.io/YouCompleteMe/). However, by default "YouCompleteMe"
+disables syntastic's checkers for the "c", "cpp", "objc", and "objcpp"
+filetypes, in order to allow its own checkers to run. If you want to use YCM's
+identifier completer but still run syntastic's checkers for those filetypes you
+have to set |g:ycm_show_diagnostics_ui| to 0. E.g.: >
+ let g:ycm_show_diagnostics_ui = 0
+<
+------------------------------------------------------------------------------
+7.13 The zsh shell and MacVim *syntastic-zsh*
+
+If you're running MacVim together with the "zsh" shell (http://www.zsh.org/)
+you need to be aware that MacVim does not source your .zshrc file, but will
+source a .zshenv file. Consequently you have to move any setup steps relevant
+to the checkers you're using from .zshrc to .zshenv, otherwise your checkers
+will misbehave when run by syntastic. This is particularly important for
+programs such as "rvm" (https://rvm.io/) or "rbenv" (http://rbenv.org/), that
+rely on setting environment variables.
+
+==============================================================================
+8. About *syntastic-about*
+
+The core maintainers of syntastic are:
+ Martin Grenfell (GitHub: scrooloose)
+ Gregor Uhlenheuer (GitHub: kongo2002)
+ LCD 047 (GitHub: lcd047)
+
+Find the latest version of syntastic at:
+
+ http://github.com/scrooloose/syntastic
+
+==============================================================================
+9. License *syntastic-license*
+
+Syntastic is released under the WTFPL.
+See http://sam.zoy.org/wtfpl/COPYING.
+
+ vim:tw=78:sw=4:ft=help:norl:
diff --git a/vim/bundle/syntastic/plugin/syntastic.vim b/vim/bundle/syntastic/plugin/syntastic.vim
new file mode 100644
index 0000000..49b586c
--- /dev/null
+++ b/vim/bundle/syntastic/plugin/syntastic.vim
@@ -0,0 +1,729 @@
+"============================================================================
+"File: syntastic.vim
+"Description: Vim plugin for on the fly syntax checking.
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_plugin') || &compatible
+ finish
+endif
+let g:loaded_syntastic_plugin = 1
+
+if has('reltime')
+ let g:_SYNTASTIC_START = reltime()
+ lockvar! g:_SYNTASTIC_START
+endif
+
+let g:_SYNTASTIC_VERSION = '3.7.0-157'
+lockvar g:_SYNTASTIC_VERSION
+
+" Sanity checks {{{1
+
+if v:version < 700 || (v:version == 700 && !has('patch175'))
+ call syntastic#log#error('need Vim version 7.0.175 or later')
+ finish
+endif
+
+for s:feature in [
+ \ 'autocmd',
+ \ 'eval',
+ \ 'file_in_path',
+ \ 'modify_fname',
+ \ 'quickfix',
+ \ 'reltime',
+ \ 'user_commands'
+ \ ]
+ if !has(s:feature)
+ call syntastic#log#error('need Vim compiled with feature ' . s:feature)
+ finish
+ endif
+endfor
+
+let s:_running_windows = syntastic#util#isRunningWindows()
+lockvar s:_running_windows
+
+if !exists('g:syntastic_shell')
+ let g:syntastic_shell = &shell
+endif
+
+if s:_running_windows
+ let g:_SYNTASTIC_UNAME = 'Windows'
+elseif executable('uname')
+ try
+ let g:_SYNTASTIC_UNAME = split(syntastic#util#system('uname'), "\n")[0]
+ catch /\m^Vim\%((\a\+)\)\=:E484/
+ call syntastic#log#error("your shell " . syntastic#util#var('shell') . " can't handle traditional UNIX syntax for redirections")
+ finish
+ catch /\m^Vim\%((\a\+)\)\=:E684/
+ let g:_SYNTASTIC_UNAME = 'Unknown'
+ endtry
+else
+ let g:_SYNTASTIC_UNAME = 'Unknown'
+endif
+lockvar g:_SYNTASTIC_UNAME
+
+" }}}1
+
+" Defaults {{{1
+
+let g:_SYNTASTIC_DEFAULTS = {
+ \ 'aggregate_errors': 0,
+ \ 'always_populate_loc_list': 0,
+ \ 'auto_jump': 0,
+ \ 'auto_loc_list': 2,
+ \ 'check_on_open': 0,
+ \ 'check_on_wq': 1,
+ \ 'cursor_columns': 1,
+ \ 'debug': 0,
+ \ 'echo_current_error': 1,
+ \ 'enable_balloons': 1,
+ \ 'enable_highlighting': 1,
+ \ 'enable_signs': 1,
+ \ 'error_symbol': '>>',
+ \ 'exit_checks': !(s:_running_windows && syntastic#util#var('shell', &shell) =~? '\m\<cmd\.exe$'),
+ \ 'filetype_map': {},
+ \ 'full_redraws': !(has('gui_running') || has('gui_macvim')),
+ \ 'id_checkers': 1,
+ \ 'ignore_extensions': '\c\v^([gx]?z|lzma|bz2)$',
+ \ 'ignore_files': [],
+ \ 'loc_list_height': 10,
+ \ 'nested_autocommands': 0,
+ \ 'quiet_messages': {},
+ \ 'reuse_loc_lists': 1,
+ \ 'shell': &shell,
+ \ 'sort_aggregated_errors': 1,
+ \ 'stl_format': '[Syntax: line:%F (%t)]',
+ \ 'style_error_symbol': 'S>',
+ \ 'style_warning_symbol': 'S>',
+ \ 'warning_symbol': '>>'
+ \ }
+lockvar! g:_SYNTASTIC_DEFAULTS
+
+for s:key in keys(g:_SYNTASTIC_DEFAULTS)
+ if !exists('g:syntastic_' . s:key)
+ let g:syntastic_{s:key} = copy(g:_SYNTASTIC_DEFAULTS[s:key])
+ endif
+endfor
+
+if exists('g:syntastic_quiet_warnings')
+ call syntastic#log#oneTimeWarn("variable g:syntastic_quiet_warnings is deprecated, please use let g:syntastic_quiet_messages = {'level': 'warnings'} instead")
+ if g:syntastic_quiet_warnings
+ let s:quiet_warnings = get(g:syntastic_quiet_messages, 'type', [])
+ if type(s:quiet_warnings) != type([])
+ let s:quiet_warnings = [s:quiet_warnings]
+ endif
+ call add(s:quiet_warnings, 'warnings')
+ let g:syntastic_quiet_messages['type'] = s:quiet_warnings
+ endif
+endif
+
+" }}}1
+
+" Debug {{{1
+
+let s:_DEBUG_DUMP_OPTIONS = [
+ \ 'shell',
+ \ 'shellcmdflag',
+ \ 'shellpipe',
+ \ 'shellquote',
+ \ 'shellredir',
+ \ 'shellslash',
+ \ 'shelltemp',
+ \ 'shellxquote'
+ \ ]
+if exists('+shellxescape')
+ call add(s:_DEBUG_DUMP_OPTIONS, 'shellxescape')
+endif
+lockvar! s:_DEBUG_DUMP_OPTIONS
+
+" debug constants
+let g:_SYNTASTIC_DEBUG_TRACE = 1
+lockvar g:_SYNTASTIC_DEBUG_TRACE
+let g:_SYNTASTIC_DEBUG_LOCLIST = 2
+lockvar g:_SYNTASTIC_DEBUG_LOCLIST
+let g:_SYNTASTIC_DEBUG_NOTIFICATIONS = 4
+lockvar g:_SYNTASTIC_DEBUG_NOTIFICATIONS
+let g:_SYNTASTIC_DEBUG_AUTOCOMMANDS = 8
+lockvar g:_SYNTASTIC_DEBUG_AUTOCOMMANDS
+let g:_SYNTASTIC_DEBUG_VARIABLES = 16
+lockvar g:_SYNTASTIC_DEBUG_VARIABLES
+let g:_SYNTASTIC_DEBUG_CHECKERS = 32
+lockvar g:_SYNTASTIC_DEBUG_CHECKERS
+
+" }}}1
+
+runtime! plugin/syntastic/*.vim
+
+let s:registry = g:SyntasticRegistry.Instance()
+let s:notifiers = g:SyntasticNotifiers.Instance()
+let s:modemap = g:SyntasticModeMap.Instance()
+
+let s:_quit_pre = []
+
+" Commands {{{1
+
+" @vimlint(EVL103, 1, a:cursorPos)
+" @vimlint(EVL103, 1, a:cmdLine)
+" @vimlint(EVL103, 1, a:argLead)
+function! s:CompleteCheckerName(argLead, cmdLine, cursorPos) abort " {{{2
+ let checker_names = []
+ for ft in s:_resolve_filetypes([])
+ call extend(checker_names, s:registry.getNamesOfAvailableCheckers(ft))
+ endfor
+ return join(checker_names, "\n")
+endfunction " }}}2
+" @vimlint(EVL103, 0, a:cursorPos)
+" @vimlint(EVL103, 0, a:cmdLine)
+" @vimlint(EVL103, 0, a:argLead)
+
+
+" @vimlint(EVL103, 1, a:cursorPos)
+" @vimlint(EVL103, 1, a:cmdLine)
+" @vimlint(EVL103, 1, a:argLead)
+function! s:CompleteFiletypes(argLead, cmdLine, cursorPos) abort " {{{2
+ return join(s:registry.getKnownFiletypes(), "\n")
+endfunction " }}}2
+" @vimlint(EVL103, 0, a:cursorPos)
+" @vimlint(EVL103, 0, a:cmdLine)
+" @vimlint(EVL103, 0, a:argLead)
+
+command! -bar -nargs=* -complete=custom,s:CompleteCheckerName SyntasticCheck call SyntasticCheck(<f-args>)
+command! -bar -nargs=? -complete=custom,s:CompleteFiletypes SyntasticInfo call SyntasticInfo(<f-args>)
+command! -bar Errors call SyntasticErrors()
+command! -bar SyntasticReset call SyntasticReset()
+command! -bar SyntasticToggleMode call SyntasticToggleMode()
+command! -bar SyntasticSetLoclist call SyntasticSetLoclist()
+
+command! SyntasticJavacEditClasspath runtime! syntax_checkers/java/*.vim | SyntasticJavacEditClasspath
+command! SyntasticJavacEditConfig runtime! syntax_checkers/java/*.vim | SyntasticJavacEditConfig
+
+" }}}1
+
+" Public API {{{1
+
+function! SyntasticCheck(...) abort " {{{2
+ call s:UpdateErrors(0, a:000)
+ call syntastic#util#redraw(g:syntastic_full_redraws)
+endfunction " }}}2
+
+function! SyntasticInfo(...) abort " {{{2
+ call s:modemap.modeInfo(a:000)
+ call s:registry.echoInfoFor(s:_resolve_filetypes(a:000))
+ call s:_explain_skip(a:000)
+endfunction " }}}2
+
+function! SyntasticErrors() abort " {{{2
+ call g:SyntasticLoclist.current().show()
+endfunction " }}}2
+
+function! SyntasticReset() abort " {{{2
+ call s:ClearCache()
+ call s:notifiers.refresh(g:SyntasticLoclist.New([]))
+endfunction " }}}2
+
+function! SyntasticToggleMode() abort " {{{2
+ call s:modemap.toggleMode()
+ call s:ClearCache()
+ call s:notifiers.refresh(g:SyntasticLoclist.New([]))
+ call s:modemap.echoMode()
+endfunction " }}}2
+
+function! SyntasticSetLoclist() abort " {{{2
+ call g:SyntasticLoclist.current().setloclist()
+endfunction " }}}2
+
+" }}}1
+
+" Autocommands {{{1
+
+augroup syntastic
+ autocmd!
+ autocmd BufEnter * call s:BufEnterHook()
+augroup END
+
+if g:syntastic_nested_autocommands
+ augroup syntastic
+ autocmd BufReadPost * nested call s:BufReadPostHook()
+ autocmd BufWritePost * nested call s:BufWritePostHook()
+ augroup END
+else
+ augroup syntastic
+ autocmd BufReadPost * call s:BufReadPostHook()
+ autocmd BufWritePost * call s:BufWritePostHook()
+ augroup END
+endif
+
+if exists('##QuitPre')
+ " QuitPre was added in Vim 7.3.544
+ augroup syntastic
+ autocmd QuitPre * call s:QuitPreHook(expand('<amatch>', 1))
+ augroup END
+endif
+
+function! s:BufReadPostHook() abort " {{{2
+ if g:syntastic_check_on_open
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS,
+ \ 'autocmd: BufReadPost, buffer ' . bufnr('') . ' = ' . string(bufname(str2nr(bufnr('')))))
+ call s:UpdateErrors(1, [])
+ endif
+endfunction " }}}2
+
+function! s:BufWritePostHook() abort " {{{2
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS,
+ \ 'autocmd: BufWritePost, buffer ' . bufnr('') . ' = ' . string(bufname(str2nr(bufnr('')))))
+ call s:UpdateErrors(1, [])
+endfunction " }}}2
+
+function! s:BufEnterHook() abort " {{{2
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS,
+ \ 'autocmd: BufEnter, buffer ' . bufnr('') . ' = ' . string(bufname(str2nr(bufnr('')))) .
+ \ ', &buftype = ' . string(&buftype))
+ if &buftype ==# ''
+ call s:notifiers.refresh(g:SyntasticLoclist.current())
+ elseif &buftype ==# 'quickfix'
+ " TODO: this is needed because in recent versions of Vim lclose
+ " can no longer be called from BufWinLeave
+ " TODO: at this point there is no b:syntastic_loclist
+ let loclist = filter(copy(getloclist(0)), 'v:val["valid"] == 1')
+ let owner = str2nr(getbufvar(bufnr(''), 'syntastic_owner_buffer'))
+ let buffers = syntastic#util#unique(map(loclist, 'v:val["bufnr"]') + (owner ? [owner] : []))
+ if !empty(get(w:, 'syntastic_loclist_set', [])) && !empty(loclist) && empty(filter( buffers, 'syntastic#util#bufIsActive(v:val)' ))
+ call SyntasticLoclistHide()
+ endif
+ endif
+endfunction " }}}2
+
+function! s:QuitPreHook(fname) abort " {{{2
+ let buf = bufnr(fnameescape(a:fname))
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS, 'autocmd: QuitPre, buffer ' . buf . ' = ' . string(a:fname))
+
+ if !syntastic#util#var('check_on_wq')
+ call syntastic#util#setWids()
+ call add(s:_quit_pre, buf . '_' . getbufvar(buf, 'changetick') . '_' . w:syntastic_wid)
+ endif
+
+ if !empty(get(w:, 'syntastic_loclist_set', []))
+ call SyntasticLoclistHide()
+ endif
+endfunction " }}}2
+
+" }}}1
+
+" Main {{{1
+
+"refresh and redraw all the error info for this buf when saving or reading
+function! s:UpdateErrors(auto_invoked, checker_names) abort " {{{2
+ call syntastic#log#debugShowVariables(g:_SYNTASTIC_DEBUG_TRACE, 'version')
+ call syntastic#log#debugShowOptions(g:_SYNTASTIC_DEBUG_TRACE, s:_DEBUG_DUMP_OPTIONS)
+ call syntastic#log#debugDump(g:_SYNTASTIC_DEBUG_VARIABLES)
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'UpdateErrors' . (a:auto_invoked ? ' (auto)' : '') .
+ \ ': ' . (len(a:checker_names) ? join(a:checker_names) : 'default checkers'))
+
+ call s:modemap.synch()
+
+ if s:_skip_file()
+ return
+ endif
+
+ let run_checks = !a:auto_invoked || s:modemap.doAutoChecking()
+ if run_checks
+ call s:CacheErrors(a:checker_names)
+ call syntastic#util#setChangedtick()
+ else
+ if a:auto_invoked
+ return
+ endif
+ endif
+
+ let loclist = g:SyntasticLoclist.current()
+
+ if exists('*SyntasticCheckHook')
+ call SyntasticCheckHook(loclist.getRaw())
+ endif
+
+ " populate loclist and jump {{{3
+ let do_jump = syntastic#util#var('auto_jump') + 0
+ if do_jump == 2
+ let do_jump = loclist.getFirstError(1)
+ elseif do_jump == 3
+ let do_jump = loclist.getFirstError()
+ elseif 0 > do_jump || do_jump > 3
+ let do_jump = 0
+ endif
+
+ let w:syntastic_loclist_set = []
+ if syntastic#util#var('always_populate_loc_list') || do_jump
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: setloclist (new)')
+ call setloclist(0, loclist.getRaw())
+ if !exists('b:syntastic_changedtick')
+ call syntastic#util#setChangedtick()
+ endif
+ let w:syntastic_loclist_set = [bufnr(''), b:syntastic_changedtick]
+ if run_checks && do_jump && !loclist.isEmpty()
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: jump')
+ execute 'silent! lrewind ' . do_jump
+
+ " XXX: Vim doesn't call autocmd commands in a predictible
+ " order, which can lead to missing filetype when jumping
+ " to a new file; the following is a workaround for the
+ " resulting brain damage
+ if &filetype ==# ''
+ silent! filetype detect
+ endif
+ endif
+ endif
+ " }}}3
+
+ call s:notifiers.refresh(loclist)
+endfunction " }}}2
+
+"clear the loc list for the buffer
+function! s:ClearCache() abort " {{{2
+ call s:notifiers.reset(g:SyntasticLoclist.current())
+ call b:syntastic_loclist.destroy()
+endfunction " }}}2
+
+"detect and cache all syntax errors in this buffer
+function! s:CacheErrors(checker_names) abort " {{{2
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'CacheErrors: ' .
+ \ (len(a:checker_names) ? join(a:checker_names) : 'default checkers'))
+ call s:ClearCache()
+ let newLoclist = g:SyntasticLoclist.New([])
+
+ if !s:_skip_file()
+ " debug logging {{{3
+ call syntastic#log#debugShowVariables(g:_SYNTASTIC_DEBUG_TRACE, 'aggregate_errors')
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, '$PATH = ' . string($PATH))
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'getcwd() = ' . string(getcwd()))
+ " }}}3
+
+ let filetypes = s:_resolve_filetypes([])
+ let aggregate_errors = syntastic#util#var('aggregate_errors') || len(filetypes) > 1
+ let decorate_errors = aggregate_errors && syntastic#util#var('id_checkers')
+ let sort_aggregated_errors = aggregate_errors && syntastic#util#var('sort_aggregated_errors')
+
+ let clist = []
+ for type in filetypes
+ call extend(clist, s:registry.getCheckers(type, a:checker_names))
+ endfor
+
+ let names = []
+ let unavailable_checkers = 0
+ for checker in clist
+ let cname = checker.getFiletype() . '/' . checker.getName()
+ if !checker.isAvailable()
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'CacheErrors: Checker ' . cname . ' is not available')
+ let unavailable_checkers += 1
+ continue
+ endif
+
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'CacheErrors: Invoking checker: ' . cname)
+
+ let loclist = checker.getLocList()
+
+ if !loclist.isEmpty()
+ if decorate_errors
+ call loclist.decorate(cname)
+ endif
+ call add(names, cname)
+ if checker.wantSort() && !sort_aggregated_errors
+ call loclist.sort()
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'sorted:', loclist)
+ endif
+
+ let newLoclist = newLoclist.extend(loclist)
+
+ if !aggregate_errors
+ break
+ endif
+ endif
+ endfor
+
+ " set names {{{3
+ if !empty(names)
+ if len(syntastic#util#unique(map( copy(names), 'substitute(v:val, "\\m/.*", "", "")' ))) == 1
+ let type = substitute(names[0], '\m/.*', '', '')
+ let name = join(map( names, 'substitute(v:val, "\\m.\\{-}/", "", "")' ), ', ')
+ call newLoclist.setName( name . ' ('. type . ')' )
+ else
+ " checkers from mixed types
+ call newLoclist.setName(join(names, ', '))
+ endif
+ endif
+ " }}}3
+
+ " issue warning about no active checkers {{{3
+ if len(clist) == unavailable_checkers
+ if !empty(a:checker_names)
+ if len(a:checker_names) == 1
+ call syntastic#log#warn('checker ' . a:checker_names[0] . ' is not available')
+ else
+ call syntastic#log#warn('checkers ' . join(a:checker_names, ', ') . ' are not available')
+ endif
+ else
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'CacheErrors: no checkers available for ' . &filetype)
+ endif
+ endif
+ " }}}3
+
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'aggregated:', newLoclist)
+ if sort_aggregated_errors
+ call newLoclist.sort()
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'sorted:', newLoclist)
+ endif
+ endif
+
+ call newLoclist.deploy()
+endfunction " }}}2
+
+"Emulates the :lmake command. Sets up the make environment according to the
+"options given, runs make, resets the environment, returns the location list
+"
+"a:options can contain the following keys:
+" 'makeprg'
+" 'errorformat'
+"
+"The corresponding options are set for the duration of the function call. They
+"are set with :let, so dont escape spaces.
+"
+"a:options may also contain:
+" 'defaults' - a dict containing default values for the returned errors
+" 'subtype' - all errors will be assigned the given subtype
+" 'preprocess' - a function to be applied to the error file before parsing errors
+" 'postprocess' - a list of functions to be applied to the error list
+" 'cwd' - change directory to the given path before running the checker
+" 'env' - environment variables to set before running the checker
+" 'returns' - a list of valid exit codes for the checker
+" @vimlint(EVL102, 1, l:env_save)
+function! SyntasticMake(options) abort " {{{2
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'SyntasticMake: called with options:', a:options)
+
+ " save options and locale env variables {{{3
+ let old_local_errorformat = &l:errorformat
+ let old_errorformat = &errorformat
+ let old_cwd = getcwd()
+ " }}}3
+
+ if has_key(a:options, 'errorformat')
+ let &errorformat = a:options['errorformat']
+ set errorformat<
+ endif
+
+ if has_key(a:options, 'cwd')
+ execute 'lcd ' . fnameescape(a:options['cwd'])
+ endif
+
+ " set environment variables {{{3
+ let env_save = {}
+ if has_key(a:options, 'env') && len(a:options['env'])
+ for key in keys(a:options['env'])
+ if key =~? '\m^[a-z_][a-z0-9_]*$'
+ execute 'let env_save[' . string(key) . '] = $' . key
+ execute 'let $' . key . ' = ' . string(a:options['env'][key])
+ endif
+ endfor
+ endif
+ " }}}3
+
+ let err_lines = split(syntastic#util#system(a:options['makeprg']), "\n", 1)
+
+ " restore environment variables {{{3
+ if len(env_save)
+ for key in keys(env_save)
+ execute 'let $' . key . ' = ' . string(env_save[key])
+ endfor
+ endif
+ " }}}3
+
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', err_lines)
+
+ " Does it still make sense to go on?
+ let bailout =
+ \ syntastic#util#var('exit_checks') &&
+ \ has_key(a:options, 'returns') &&
+ \ index(a:options['returns'], v:shell_error) == -1
+
+ if !bailout
+ if has_key(a:options, 'Preprocess')
+ let err_lines = call(a:options['Preprocess'], [err_lines])
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'preprocess (external):', err_lines)
+ elseif has_key(a:options, 'preprocess')
+ let err_lines = call('syntastic#preprocess#' . a:options['preprocess'], [err_lines])
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'preprocess:', err_lines)
+ endif
+ lgetexpr err_lines
+
+ let errors = deepcopy(getloclist(0))
+
+ if has_key(a:options, 'cwd')
+ execute 'lcd ' . fnameescape(old_cwd)
+ endif
+
+ try
+ silent lolder
+ catch /\m^Vim\%((\a\+)\)\=:E380/
+ " E380: At bottom of quickfix stack
+ call setloclist(0, [], 'r')
+ catch /\m^Vim\%((\a\+)\)\=:E776/
+ " E776: No location list
+ " do nothing
+ endtry
+ else
+ let errors = []
+ endif
+
+ " restore options {{{3
+ let &errorformat = old_errorformat
+ let &l:errorformat = old_local_errorformat
+ " }}}3
+
+ if !s:_running_windows && (s:_os_name() =~? 'FreeBSD' || s:_os_name() =~? 'OpenBSD')
+ call syntastic#util#redraw(g:syntastic_full_redraws)
+ endif
+
+ if bailout
+ call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', err_lines)
+ throw 'Syntastic: checker error'
+ endif
+
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'raw loclist:', errors)
+
+ if has_key(a:options, 'defaults')
+ call s:_add_to_errors(errors, a:options['defaults'])
+ endif
+
+ " Add subtype info if present.
+ if has_key(a:options, 'subtype')
+ call s:_add_to_errors(errors, { 'subtype': a:options['subtype'] })
+ endif
+
+ if has_key(a:options, 'Postprocess') && !empty(a:options['Postprocess'])
+ for rule in a:options['Postprocess']
+ let errors = call(rule, [errors])
+ endfor
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'postprocess (external):', errors)
+ elseif has_key(a:options, 'postprocess') && !empty(a:options['postprocess'])
+ for rule in a:options['postprocess']
+ let errors = call('syntastic#postprocess#' . rule, [errors])
+ endfor
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'postprocess:', errors)
+ endif
+
+ return errors
+endfunction " }}}2
+" @vimlint(EVL102, 0, l:env_save)
+
+"return a string representing the state of buffer according to
+"g:syntastic_stl_format
+"
+"return '' if no errors are cached for the buffer
+function! SyntasticStatuslineFlag() abort " {{{2
+ return g:SyntasticLoclist.current().getStatuslineFlag()
+endfunction " }}}2
+
+" }}}1
+
+" Utilities {{{1
+
+function! s:_resolve_filetypes(filetypes) abort " {{{2
+ let type = len(a:filetypes) ? a:filetypes[0] : &filetype
+ return split( get(g:syntastic_filetype_map, type, type), '\m\.' )
+endfunction " }}}2
+
+function! s:_ignore_file(filename) abort " {{{2
+ let fname = fnamemodify(a:filename, ':p')
+ for pattern in g:syntastic_ignore_files
+ if fname =~# pattern
+ return 1
+ endif
+ endfor
+ return 0
+endfunction " }}}2
+
+function! s:_is_quitting(buf) abort " {{{2
+ let quitting = 0
+ if exists('w:syntastic_wid')
+ let key = a:buf . '_' . getbufvar(a:buf, 'changetick') . '_' . w:syntastic_wid
+ let idx = index(s:_quit_pre, key)
+ if idx >= 0
+ call remove(s:_quit_pre, idx)
+ let quitting = 1
+ endif
+ endif
+
+ return quitting
+endfunction " }}}2
+
+" Skip running in special buffers
+function! s:_skip_file() abort " {{{2
+ let fname = expand('%', 1)
+ let skip = s:_is_quitting(bufnr('%')) || get(b:, 'syntastic_skip_checks', 0) ||
+ \ (&buftype !=# '') || !filereadable(fname) || getwinvar(0, '&diff') ||
+ \ getwinvar(0, '&previewwindow') || s:_ignore_file(fname) ||
+ \ fnamemodify(fname, ':e') =~? g:syntastic_ignore_extensions
+ if skip
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, '_skip_file: skipping checks')
+ endif
+ return skip
+endfunction " }}}2
+
+" Explain why checks will be skipped for the current file
+function! s:_explain_skip(filetypes) abort " {{{2
+ if empty(a:filetypes) && s:_skip_file()
+ let why = []
+ let fname = expand('%', 1)
+
+ if s:_is_quitting(bufnr('%'))
+ call add(why, 'quitting buffer')
+ endif
+ if get(b:, 'syntastic_skip_checks', 0)
+ call add(why, 'b:syntastic_skip_checks set')
+ endif
+ if &buftype !=# ''
+ call add(why, 'buftype = ' . string(&buftype))
+ endif
+ if !filereadable(fname)
+ call add(why, 'file not readable / not local')
+ endif
+ if getwinvar(0, '&diff')
+ call add(why, 'diff mode')
+ endif
+ if getwinvar(0, '&previewwindow')
+ call add(why, 'preview window')
+ endif
+ if s:_ignore_file(fname)
+ call add(why, 'filename matching g:syntastic_ignore_files')
+ endif
+ if fnamemodify(fname, ':e') =~? g:syntastic_ignore_extensions
+ call add(why, 'extension matching g:syntastic_ignore_extensions')
+ endif
+
+ echomsg 'The current file will not be checked (' . join(why, ', ') . ')'
+ endif
+endfunction " }}}2
+
+" Take a list of errors and add default values to them from a:options
+function! s:_add_to_errors(errors, options) abort " {{{2
+ for err in a:errors
+ for key in keys(a:options)
+ if !has_key(err, key) || empty(err[key])
+ let err[key] = a:options[key]
+ endif
+ endfor
+ endfor
+
+ return a:errors
+endfunction " }}}2
+
+function! s:_os_name() abort " {{{2
+ return g:_SYNTASTIC_UNAME
+endfunction " }}}2
+
+" }}}1
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/plugin/syntastic/autoloclist.vim b/vim/bundle/syntastic/plugin/syntastic/autoloclist.vim
new file mode 100644
index 0000000..153b0bc
--- /dev/null
+++ b/vim/bundle/syntastic/plugin/syntastic/autoloclist.vim
@@ -0,0 +1,38 @@
+if exists('g:loaded_syntastic_notifier_autoloclist') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_notifier_autoloclist = 1
+
+let g:SyntasticAutoloclistNotifier = {}
+
+" Public methods {{{1
+"
+function! g:SyntasticAutoloclistNotifier.New() abort " {{{2
+ let newObj = copy(self)
+ return newObj
+endfunction " }}}2
+
+function! g:SyntasticAutoloclistNotifier.refresh(loclist) abort " {{{2
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'autoloclist: refresh')
+ call g:SyntasticAutoloclistNotifier.AutoToggle(a:loclist)
+endfunction " }}}2
+
+function! g:SyntasticAutoloclistNotifier.AutoToggle(loclist) abort " {{{2
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'autoloclist: toggle')
+ let auto_loc_list = syntastic#util#var('auto_loc_list')
+ if !a:loclist.isEmpty()
+ if auto_loc_list == 1 || auto_loc_list == 3
+ call a:loclist.show()
+ endif
+ else
+ if auto_loc_list == 1 || auto_loc_list == 2
+ "TODO: this will close the loc list window if one was opened by
+ "something other than syntastic
+ lclose
+ endif
+ endif
+endfunction " }}}2
+
+" }}}1
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/plugin/syntastic/balloons.vim b/vim/bundle/syntastic/plugin/syntastic/balloons.vim
new file mode 100644
index 0000000..fdd70bf
--- /dev/null
+++ b/vim/bundle/syntastic/plugin/syntastic/balloons.vim
@@ -0,0 +1,59 @@
+if exists('g:loaded_syntastic_notifier_balloons') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_notifier_balloons = 1
+
+if !has('balloon_eval')
+ let g:syntastic_enable_balloons = 0
+endif
+
+let g:SyntasticBalloonsNotifier = {}
+
+" Public methods {{{1
+
+function! g:SyntasticBalloonsNotifier.New() abort " {{{2
+ let newObj = copy(self)
+ return newObj
+endfunction " }}}2
+
+function! g:SyntasticBalloonsNotifier.enabled() abort " {{{2
+ return has('balloon_eval') && syntastic#util#var('enable_balloons')
+endfunction " }}}2
+
+" Update the error balloons
+function! g:SyntasticBalloonsNotifier.refresh(loclist) abort " {{{2
+ unlet! b:syntastic_private_balloons
+ if self.enabled() && !a:loclist.isEmpty()
+ let b:syntastic_private_balloons = a:loclist.balloons()
+ if !empty(b:syntastic_private_balloons)
+ set ballooneval balloonexpr=SyntasticBalloonsExprNotifier()
+ endif
+ endif
+endfunction " }}}2
+
+" Reset the error balloons
+" @vimlint(EVL103, 1, a:loclist)
+function! g:SyntasticBalloonsNotifier.reset(loclist) abort " {{{2
+ let b:syntastic_private_balloons = {}
+ if has('balloon_eval')
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'balloons: reset')
+ unlet! b:syntastic_private_balloons
+ set noballooneval
+ endif
+endfunction " }}}2
+" @vimlint(EVL103, 0, a:loclist)
+
+" }}}1
+
+" Private functions {{{1
+
+function! SyntasticBalloonsExprNotifier() abort " {{{2
+ if !exists('b:syntastic_private_balloons')
+ return ''
+ endif
+ return get(b:syntastic_private_balloons, v:beval_lnum, '')
+endfunction " }}}2
+
+" }}}1
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/plugin/syntastic/checker.vim b/vim/bundle/syntastic/plugin/syntastic/checker.vim
new file mode 100644
index 0000000..22ad820
--- /dev/null
+++ b/vim/bundle/syntastic/plugin/syntastic/checker.vim
@@ -0,0 +1,273 @@
+if exists('g:loaded_syntastic_checker') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_checker = 1
+
+let g:SyntasticChecker = {}
+
+" Public methods {{{1
+
+function! g:SyntasticChecker.New(args, ...) abort " {{{2
+ let newObj = copy(self)
+
+ let newObj._filetype = a:args['filetype']
+ let newObj._name = a:args['name']
+
+ if a:0
+ " redirected checker
+ let newObj._exec = get(a:args, 'exec', a:1['_exec'])
+
+ let filetype = a:1['_filetype']
+ let name = a:1['_name']
+ let prefix = 'SyntaxCheckers_' . filetype . '_' . name . '_'
+
+ if exists('g:syntastic_' . filetype . '_' . name . '_sort') && !exists('g:syntastic_' . newObj._filetype . '_' . newObj._name . '_sort')
+ let g:syntastic_{newObj._filetype}_{newObj._name}_sort = g:syntastic_{filetype}_{name}_sort
+ endif
+
+ if has_key(a:args, 'enable')
+ let newObj._enable = a:args['enable']
+ elseif has_key(a:1, '_enable')
+ let newObj._enable = a:1['_enable']
+ endif
+ else
+ let newObj._exec = get(a:args, 'exec', newObj._name)
+ let prefix = 'SyntaxCheckers_' . newObj._filetype . '_' . newObj._name . '_'
+
+ if has_key(a:args, 'enable')
+ let newObj._enable = a:args['enable']
+ endif
+ endif
+
+ let newObj._locListFunc = function(prefix . 'GetLocList')
+
+ if exists('*' . prefix . 'IsAvailable')
+ let newObj._isAvailableFunc = function(prefix . 'IsAvailable')
+ else
+ let newObj._isAvailableFunc = function('s:_isAvailableDefault')
+ endif
+
+ if exists('*' . prefix . 'GetHighlightRegex')
+ let newObj._highlightRegexFunc = function(prefix . 'GetHighlightRegex')
+ endif
+
+ return newObj
+endfunction " }}}2
+
+function! g:SyntasticChecker.getFiletype() abort " {{{2
+ return self._filetype
+endfunction " }}}2
+
+function! g:SyntasticChecker.getName() abort " {{{2
+ return self._name
+endfunction " }}}2
+
+" Synchronise _exec with user's setting. Force re-validation if needed.
+"
+" XXX: This function must be called at least once before calling either
+" getExec() or getExecEscaped(). Normally isAvailable() does that for you
+" automatically, but you should keep still this in mind if you change the
+" current checker workflow.
+function! g:SyntasticChecker.syncExec() abort " {{{2
+ let user_exec =
+ \ expand( exists('b:syntastic_' . self._name . '_exec') ? b:syntastic_{self._name}_exec :
+ \ syntastic#util#var(self._filetype . '_' . self._name . '_exec'), 1 )
+
+ if user_exec !=# '' && user_exec !=# self._exec
+ let self._exec = user_exec
+ if has_key(self, '_available')
+ " we have a new _exec on the block, it has to be validated
+ call remove(self, '_available')
+ endif
+ endif
+endfunction " }}}2
+
+function! g:SyntasticChecker.getExec() abort " {{{2
+ return self._exec
+endfunction " }}}2
+
+function! g:SyntasticChecker.getExecEscaped() abort " {{{2
+ return syntastic#util#shescape(self._exec)
+endfunction " }}}2
+
+function! g:SyntasticChecker.getLocListRaw() abort " {{{2
+ let checker_start = reltime()
+ let name = self._filetype . '/' . self._name
+
+ if has_key(self, '_enable')
+ let status = syntastic#util#var(self._enable, -1)
+ if type(status) != type(0)
+ call syntastic#log#error('checker ' . name . ': invalid value ' . strtrans(string(status)) .
+ \ ' for g:syntastic_' . self._enable . '; try 0 or 1 instead')
+ return []
+ endif
+ if status < 0
+ call syntastic#log#error('checker ' . name . ': checks disabled for security reasons; ' .
+ \ 'set g:syntastic_' . self._enable . ' to 1 to override')
+ endif
+ if status <= 0
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'getLocList: checker ' . name . ' enabled but not forced')
+ return []
+ else
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'getLocList: checker ' . name . ' forced')
+ endif
+ endif
+
+ try
+ let list = self._locListFunc()
+ if self._exec !=# ''
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE, 'getLocList: checker ' . name . ' returned ' . v:shell_error)
+ endif
+ catch /\m\C^Syntastic: checker error$/
+ let list = []
+ if self._exec !=# ''
+ call syntastic#log#error('checker ' . name . ' returned abnormal status ' . v:shell_error)
+ else
+ call syntastic#log#error('checker ' . name . ' aborted')
+ endif
+ endtry
+ call self._populateHighlightRegexes(list)
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, name . ' raw:', list)
+ call self._quietMessages(list)
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_TRACE,
+ \ 'getLocList: checker ' . name . ' run in ' . split(reltimestr(reltime(checker_start)))[0] . 's')
+ return list
+endfunction " }}}2
+
+function! g:SyntasticChecker.getLocList() abort " {{{2
+ return g:SyntasticLoclist.New(self.getLocListRaw())
+endfunction " }}}2
+
+function! g:SyntasticChecker.getVersion(...) abort " {{{2
+ if !exists('self._version')
+ let command = a:0 ? a:1 : self.getExecEscaped() . ' --version'
+ let version_output = syntastic#util#system(command)
+ call self.log('getVersion: ' . string(command) . ': ' .
+ \ string(split(version_output, "\n", 1)) .
+ \ (v:shell_error ? ' (exit code ' . v:shell_error . ')' : '') )
+ let parsed_ver = syntastic#util#parseVersion(version_output)
+ if len(parsed_ver)
+ call self.setVersion(parsed_ver)
+ else
+ call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', split(version_output, "\n", 1))
+ call syntastic#log#error("checker " . self._filetype . "/" . self._name . ": can't parse version string (abnormal termination?)")
+ endif
+ endif
+ return get(self, '_version', [])
+endfunction " }}}2
+
+function! g:SyntasticChecker.setVersion(version) abort " {{{2
+ if len(a:version)
+ let self._version = copy(a:version)
+ call self.log(self.getExec() . ' version =', a:version)
+ endif
+endfunction " }}}2
+
+function! g:SyntasticChecker.log(msg, ...) abort " {{{2
+ let leader = self._filetype . '/' . self._name . ': '
+ if a:0 > 0
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, leader . a:msg, a:1)
+ else
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_CHECKERS, leader . a:msg)
+ endif
+endfunction " }}}2
+
+function! g:SyntasticChecker.makeprgBuild(opts) abort " {{{2
+ let basename = self._filetype . '_' . self._name . '_'
+
+ let parts = []
+ call extend(parts, self._getOpt(a:opts, basename, 'exe', self.getExecEscaped()))
+ call extend(parts, self._getOpt(a:opts, basename, 'args', ''))
+ call extend(parts, self._getOpt(a:opts, basename, 'fname', syntastic#util#shexpand('%')))
+ call extend(parts, self._getOpt(a:opts, basename, 'post_args', ''))
+ call extend(parts, self._getOpt(a:opts, basename, 'tail', ''))
+
+ return join(parts)
+endfunction " }}}2
+
+function! g:SyntasticChecker.isAvailable() abort " {{{2
+ call self.syncExec()
+ if !has_key(self, '_available')
+ let self._available = self._isAvailableFunc()
+ endif
+ return self._available
+endfunction " }}}2
+
+function! g:SyntasticChecker.isDisabled() abort " {{{2
+ return has_key(self, '_enable') && syntastic#util#var(self._enable, -1) <= 0
+endfunction " }}}2
+
+function! g:SyntasticChecker.wantSort() abort " {{{2
+ return syntastic#util#var(self._filetype . '_' . self._name . '_sort', 0)
+endfunction " }}}2
+
+" This method is no longer used by syntastic. It's here only to maintain
+" backwards compatibility with external checkers which might depend on it.
+function! g:SyntasticChecker.setWantSort(val) abort " {{{2
+ if !exists('g:syntastic_' . self._filetype . '_' . self._name . '_sort')
+ let g:syntastic_{self._filetype}_{self._name}_sort = a:val
+ endif
+endfunction " }}}2
+
+" }}}1
+
+" Private methods {{{1
+
+function! g:SyntasticChecker._quietMessages(errors) abort " {{{2
+ " wildcard quiet_messages
+ let quiet_filters = copy(syntastic#util#var('quiet_messages', {}))
+ if type(quiet_filters) != type({})
+ call syntastic#log#warn('ignoring invalid syntastic_quiet_messages')
+ unlet quiet_filters
+ let quiet_filters = {}
+ endif
+
+ " per checker quiet_messages
+ let name = self._filetype . '_' . self._name
+ try
+ call extend( quiet_filters, copy(syntastic#util#var(name . '_quiet_messages', {})), 'force' )
+ catch /\m^Vim\%((\a\+)\)\=:E712/
+ call syntastic#log#warn('ignoring invalid syntastic_' . name . '_quiet_messages')
+ endtry
+
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'quiet_messages filter:', quiet_filters)
+
+ if !empty(quiet_filters)
+ call syntastic#util#dictFilter(a:errors, quiet_filters)
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_LOCLIST, 'filtered by quiet_messages:', a:errors)
+ endif
+endfunction " }}}2
+
+function! g:SyntasticChecker._populateHighlightRegexes(errors) abort " {{{2
+ if has_key(self, '_highlightRegexFunc')
+ for e in a:errors
+ if e['valid']
+ let term = self._highlightRegexFunc(e)
+ if term !=# ''
+ let e['hl'] = term
+ endif
+ endif
+ endfor
+ endif
+endfunction " }}}2
+
+function! g:SyntasticChecker._getOpt(opts, basename, name, default) abort " {{{2
+ let ret = []
+ call extend( ret, syntastic#util#argsescape(get(a:opts, a:name . '_before', '')) )
+ call extend( ret, syntastic#util#argsescape(syntastic#util#var( a:basename . a:name, get(a:opts, a:name, a:default) )) )
+ call extend( ret, syntastic#util#argsescape(get(a:opts, a:name . '_after', '')) )
+
+ return ret
+endfunction " }}}2
+
+" }}}1
+
+" Private functions {{{1
+
+function! s:_isAvailableDefault() dict " {{{2
+ return executable(self.getExec())
+endfunction " }}}2
+
+" }}}1
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/plugin/syntastic/cursor.vim b/vim/bundle/syntastic/plugin/syntastic/cursor.vim
new file mode 100644
index 0000000..f59d87b
--- /dev/null
+++ b/vim/bundle/syntastic/plugin/syntastic/cursor.vim
@@ -0,0 +1,138 @@
+if exists('g:loaded_syntastic_notifier_cursor') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_notifier_cursor = 1
+
+let g:SyntasticCursorNotifier = {}
+
+" Public methods {{{1
+
+function! g:SyntasticCursorNotifier.New() abort " {{{2
+ let newObj = copy(self)
+ return newObj
+endfunction " }}}2
+
+function! g:SyntasticCursorNotifier.enabled() abort " {{{2
+ return syntastic#util#var('echo_current_error')
+endfunction " }}}2
+
+function! g:SyntasticCursorNotifier.refresh(loclist) abort " {{{2
+ if self.enabled() && !a:loclist.isEmpty()
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'cursor: refresh')
+ let b:syntastic_private_messages = copy(a:loclist.messages(bufnr('')))
+ let b:syntastic_private_line = -1
+ let b:syntastic_cursor_columns = a:loclist.getCursorColumns()
+ autocmd! syntastic CursorMoved
+ autocmd syntastic CursorMoved * call SyntasticRefreshCursor()
+ endif
+endfunction " }}}2
+
+" @vimlint(EVL103, 1, a:loclist)
+function! g:SyntasticCursorNotifier.reset(loclist) abort " {{{2
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'cursor: reset')
+ autocmd! syntastic CursorMoved
+ unlet! b:syntastic_private_messages
+ let b:syntastic_private_line = -1
+endfunction " }}}2
+" @vimlint(EVL103, 0, a:loclist)
+
+" }}}1
+
+" Private functions {{{1
+
+function! SyntasticRefreshCursor() abort " {{{2
+ if !exists('b:syntastic_private_messages') || empty(b:syntastic_private_messages)
+ " file not checked
+ return
+ endif
+
+ if !exists('b:syntastic_private_line')
+ let b:syntastic_private_line = -1
+ endif
+ let l = line('.')
+ let current_messages = get(b:syntastic_private_messages, l, {})
+
+ if !exists('b:syntastic_cursor_columns')
+ let b:syntastic_cursor_columns = g:syntastic_cursor_columns
+ endif
+
+ if b:syntastic_cursor_columns
+ let c = virtcol('.')
+ if !exists('b:syntastic_private_idx')
+ let b:syntastic_private_idx = -1
+ endif
+
+ if s:_is_same_index(l, b:syntastic_private_line, c, b:syntastic_private_idx, current_messages)
+ return
+ else
+ let b:syntastic_private_line = l
+ endif
+
+ if !empty(current_messages)
+ let b:syntastic_private_idx = s:_find_index(c, current_messages)
+ call syntastic#util#wideMsg(current_messages[b:syntastic_private_idx].text)
+ else
+ let b:syntastic_private_idx = -1
+ echo
+ endif
+ else
+ if l == b:syntastic_private_line
+ return
+ endif
+ let b:syntastic_private_line = l
+
+ if !empty(current_messages)
+ call syntastic#util#wideMsg(current_messages[0].text)
+ else
+ echo
+ endif
+ endif
+endfunction " }}}2
+
+" }}}1
+
+" Utilities {{{1
+
+function! s:_is_same_index(line, old_line, column, idx, messages) abort " {{{2
+ if a:old_line >= 0 && a:line == a:old_line && a:idx >= 0
+ if len(a:messages) <= 1
+ return 1
+ endif
+
+ if a:messages[a:idx].scol <= a:column || a:idx == 0
+ if a:idx == len(a:messages) - 1 || a:column < a:messages[a:idx + 1].scol
+ return 1
+ else
+ return 0
+ endif
+ else
+ return 0
+ endif
+ else
+ return 0
+ endif
+endfunction " }}}2
+
+function! s:_find_index(column, messages) abort " {{{2
+ let max = len(a:messages) - 1
+ if max == 0
+ return 0
+ endif
+ let min = 0
+
+ " modified binary search: assign index 0 to columns to the left of the first error
+ while min < max - 1
+ let mid = (min + max) / 2
+ if a:column < a:messages[mid].scol
+ let max = mid
+ else
+ let min = mid
+ endif
+ endwhile
+
+ return a:column < a:messages[max].scol ? min : max
+endfunction " }}}2
+
+" }}}1
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/plugin/syntastic/highlighting.vim b/vim/bundle/syntastic/plugin/syntastic/highlighting.vim
new file mode 100644
index 0000000..a9e1a08
--- /dev/null
+++ b/vim/bundle/syntastic/plugin/syntastic/highlighting.vim
@@ -0,0 +1,104 @@
+if exists('g:loaded_syntastic_notifier_highlighting') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_notifier_highlighting = 1
+
+" Highlighting requires getmatches introduced in 7.1.040
+let s:has_highlighting = v:version > 701 || (v:version == 701 && has('patch040'))
+lockvar s:has_highlighting
+
+let g:SyntasticHighlightingNotifier = {}
+
+let s:setup_done = 0
+
+" Public methods {{{1
+
+function! g:SyntasticHighlightingNotifier.New() abort " {{{2
+ let newObj = copy(self)
+
+ if !s:setup_done
+ call self._setup()
+ let s:setup_done = 1
+ lockvar s:setup_done
+ endif
+
+ return newObj
+endfunction " }}}2
+
+function! g:SyntasticHighlightingNotifier.enabled() abort " {{{2
+ return s:has_highlighting && syntastic#util#var('enable_highlighting')
+endfunction " }}}2
+
+" Sets error highlights in the current window
+function! g:SyntasticHighlightingNotifier.refresh(loclist) abort " {{{2
+ if self.enabled()
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'highlighting: refresh')
+ call self._reset()
+ let buf = bufnr('')
+ let issues = filter(a:loclist.copyRaw(), 'v:val["bufnr"] == buf')
+ for item in issues
+ let group = 'Syntastic' . get(item, 'subtype', '') . ( item['type'] ==? 'E' ? 'Error' : 'Warning' )
+
+ " The function `Syntastic_{filetype}_{checker}_GetHighlightRegex` is
+ " used to override default highlighting.
+ if has_key(item, 'hl')
+ call matchadd(group, '\%' . item['lnum'] . 'l' . item['hl'])
+ elseif get(item, 'col', 0)
+ if get(item, 'vcol', 0)
+ let lastcol = virtcol([item['lnum'], '$'])
+ let coltype = 'v'
+ else
+ let lastcol = col([item['lnum'], '$'])
+ let coltype = 'c'
+ endif
+ let lcol = min([lastcol, item['col']])
+
+ call matchadd(group, '\%' . item['lnum'] . 'l\%' . lcol . coltype)
+ endif
+ endfor
+ endif
+endfunction " }}}2
+
+" Remove all error highlights from the window
+" @vimlint(EVL103, 1, a:loclist)
+function! g:SyntasticHighlightingNotifier.reset(loclist) abort " {{{2
+ if s:has_highlighting
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'highlighting: reset')
+ call self._reset()
+ endif
+endfunction " }}}2
+" @vimlint(EVL103, 0, a:loclist)
+
+" }}}1
+
+" Private methods {{{1
+
+" One time setup: define our own highlighting
+function! g:SyntasticHighlightingNotifier._setup() abort " {{{2
+ if s:has_highlighting
+ if !hlexists('SyntasticError')
+ highlight link SyntasticError SpellBad
+ endif
+ if !hlexists('SyntasticWarning')
+ highlight link SyntasticWarning SpellCap
+ endif
+ if !hlexists('SyntasticStyleError')
+ highlight link SyntasticStyleError SyntasticError
+ endif
+ if !hlexists('SyntasticStyleWarning')
+ highlight link SyntasticStyleWarning SyntasticWarning
+ endif
+ endif
+endfunction " }}}2
+
+function! g:SyntasticHighlightingNotifier._reset() abort " {{{2
+ for match in getmatches()
+ if stridx(match['group'], 'Syntastic') == 0
+ call matchdelete(match['id'])
+ endif
+ endfor
+endfunction " }}}2
+
+" }}}1
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/plugin/syntastic/loclist.vim b/vim/bundle/syntastic/plugin/syntastic/loclist.vim
new file mode 100644
index 0000000..3e9528b
--- /dev/null
+++ b/vim/bundle/syntastic/plugin/syntastic/loclist.vim
@@ -0,0 +1,439 @@
+if exists('g:loaded_syntastic_loclist') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_loclist = 1
+
+let g:SyntasticLoclist = {}
+
+" Public methods {{{1
+
+function! g:SyntasticLoclist.New(rawLoclist) abort " {{{2
+ let newObj = copy(self)
+
+ let llist = filter(copy(a:rawLoclist), 'v:val["valid"] == 1')
+
+ for e in llist
+ if get(e, 'type', '') ==# ''
+ let e['type'] = 'E'
+ endif
+ endfor
+
+ let newObj._rawLoclist = llist
+ let newObj._name = ''
+ let newObj._owner = bufnr('')
+ let newObj._sorted = 0
+ let newObj._columns = g:syntastic_cursor_columns
+
+ return newObj
+endfunction " }}}2
+
+function! g:SyntasticLoclist.current() abort " {{{2
+ if !exists('b:syntastic_loclist') || empty(b:syntastic_loclist)
+ let b:syntastic_loclist = g:SyntasticLoclist.New([])
+ endif
+ return b:syntastic_loclist
+endfunction " }}}2
+
+function! g:SyntasticLoclist.extend(other) abort " {{{2
+ let list = self.copyRaw()
+ call extend(list, a:other.copyRaw())
+ return g:SyntasticLoclist.New(list)
+endfunction " }}}2
+
+function! g:SyntasticLoclist.sort() abort " {{{2
+ if !self._sorted
+ for e in self._rawLoclist
+ call s:_set_screen_column(e)
+ endfor
+
+ call sort(self._rawLoclist, self._columns ? 's:_compare_error_items_by_columns' : 's:_compare_error_items_by_lines')
+
+ let self._sorted = 1
+ endif
+endfunction " }}}2
+
+function! g:SyntasticLoclist.isEmpty() abort " {{{2
+ return empty(self._rawLoclist)
+endfunction " }}}2
+
+function! g:SyntasticLoclist.isNewerThan(stamp) abort " {{{2
+ if !exists('self._stamp')
+ let self._stamp = []
+ return 0
+ endif
+ return syntastic#util#compareLexi(self._stamp, a:stamp) > 0
+endfunction " }}}2
+
+function! g:SyntasticLoclist.copyRaw() abort " {{{2
+ return copy(self._rawLoclist)
+endfunction " }}}2
+
+function! g:SyntasticLoclist.getRaw() abort " {{{2
+ return self._rawLoclist
+endfunction " }}}2
+
+function! g:SyntasticLoclist.getBuffers() abort " {{{2
+ return syntastic#util#unique(map(copy(self._rawLoclist), 'str2nr(v:val["bufnr"])') + [self._owner])
+endfunction " }}}2
+
+function! g:SyntasticLoclist.getCursorColumns() abort " {{{2
+ return self._columns
+endfunction " }}}2
+
+function! g:SyntasticLoclist.getStatuslineFlag() abort " {{{2
+ if !exists('self._stl_format')
+ let self._stl_format = ''
+ endif
+ if !exists('self._stl_flag')
+ let self._stl_flag = ''
+ endif
+
+ if g:syntastic_stl_format !=# self._stl_format
+ let self._stl_format = g:syntastic_stl_format
+
+ if !empty(self._rawLoclist)
+ let errors = self.errors()
+ let warnings = self.warnings()
+
+ let num_errors = len(errors)
+ let num_warnings = len(warnings)
+ let num_issues = len(self._rawLoclist)
+
+ let output = self._stl_format
+
+ "hide stuff wrapped in %E(...) unless there are errors
+ let output = substitute(output, '\m\C%E{\([^}]*\)}', num_errors ? '\1' : '' , 'g')
+
+ "hide stuff wrapped in %W(...) unless there are warnings
+ let output = substitute(output, '\m\C%W{\([^}]*\)}', num_warnings ? '\1' : '' , 'g')
+
+ "hide stuff wrapped in %B(...) unless there are both errors and warnings
+ let output = substitute(output, '\m\C%B{\([^}]*\)}', (num_warnings && num_errors) ? '\1' : '' , 'g')
+
+ let flags = {
+ \ '%': '%',
+ \ 't': num_issues,
+ \ 'e': num_errors,
+ \ 'w': num_warnings,
+ \ 'N': (num_issues ? fnamemodify( bufname(self._rawLoclist[0]['bufnr']), ':t') : ''),
+ \ 'P': (num_issues ? fnamemodify( bufname(self._rawLoclist[0]['bufnr']), ':p:~:.') : ''),
+ \ 'F': (num_issues ? self._rawLoclist[0]['lnum'] : ''),
+ \ 'ne': (num_errors ? fnamemodify( bufname(errors[0]['bufnr']), ':t') : ''),
+ \ 'pe': (num_errors ? fnamemodify( bufname(errors[0]['bufnr']), ':p:~:.') : ''),
+ \ 'fe': (num_errors ? errors[0]['lnum'] : ''),
+ \ 'nw': (num_warnings ? fnamemodify( bufname(warnings[0]['bufnr']), ':t') : ''),
+ \ 'pw': (num_warnings ? fnamemodify( bufname(warnings[0]['bufnr']), ':p:~:.') : ''),
+ \ 'fw': (num_warnings ? warnings[0]['lnum'] : '') }
+ let output = substitute(output, '\v\C\%(-?\d*%(\.\d+)?)([npf][ew]|[NPFtew%])', '\=syntastic#util#wformat(submatch(1), flags[submatch(2)])', 'g')
+
+ let self._stl_flag = output
+ else
+ let self._stl_flag = ''
+ endif
+ endif
+
+ return self._stl_flag
+endfunction " }}}2
+
+function! g:SyntasticLoclist.getFirstError(...) abort " {{{2
+ let max_issues = len(self._rawLoclist)
+ if a:0 && a:1 < max_issues
+ let max_issues = a:1
+ endif
+
+ for idx in range(max_issues)
+ if get(self._rawLoclist[idx], 'type', '') ==? 'E'
+ return idx + 1
+ endif
+ endfor
+
+ return 0
+endfunction " }}}2
+
+function! g:SyntasticLoclist.getName() abort " {{{2
+ return len(self._name)
+endfunction " }}}2
+
+function! g:SyntasticLoclist.setName(name) abort " {{{2
+ let self._name = a:name
+endfunction " }}}2
+
+function! g:SyntasticLoclist.getOwner() abort " {{{2
+ return self._owner
+endfunction " }}}2
+
+function! g:SyntasticLoclist.setOwner(buffer) abort " {{{2
+ let self._owner = type(a:buffer) == type(0) ? a:buffer : str2nr(a:buffer)
+endfunction " }}}2
+
+function! g:SyntasticLoclist.deploy() abort " {{{2
+ call self.setOwner(bufnr(''))
+ let self._stamp = syntastic#util#stamp()
+ for buf in self.getBuffers()
+ call setbufvar(buf, 'syntastic_loclist', self)
+ endfor
+endfunction " }}}2
+
+function! g:SyntasticLoclist.destroy() abort " {{{2
+ for buf in self.getBuffers()
+ call setbufvar(buf, 'syntastic_loclist', {})
+ endfor
+endfunction " }}}2
+
+function! g:SyntasticLoclist.decorate(tag) abort " {{{2
+ for e in self._rawLoclist
+ let e['text'] .= ' [' . a:tag . ']'
+ endfor
+endfunction " }}}2
+
+function! g:SyntasticLoclist.balloons() abort " {{{2
+ if !exists('self._cachedBalloons')
+ let sep = has('balloon_multiline') ? "\n" : ' | '
+
+ let self._cachedBalloons = {}
+ for e in self._rawLoclist
+ let buf = e['bufnr']
+
+ if !has_key(self._cachedBalloons, buf)
+ let self._cachedBalloons[buf] = {}
+ endif
+
+ if has_key(self._cachedBalloons[buf], e['lnum'])
+ let self._cachedBalloons[buf][e['lnum']] .= sep . e['text']
+ else
+ let self._cachedBalloons[buf][e['lnum']] = e['text']
+ endif
+ endfor
+ endif
+
+ return get(self._cachedBalloons, bufnr(''), {})
+endfunction " }}}2
+
+function! g:SyntasticLoclist.errors() abort " {{{2
+ if !exists('self._cachedErrors')
+ let self._cachedErrors = self.filter({'type': 'E'})
+ endif
+ return self._cachedErrors
+endfunction " }}}2
+
+function! g:SyntasticLoclist.warnings() abort " {{{2
+ if !exists('self._cachedWarnings')
+ let self._cachedWarnings = self.filter({'type': 'W'})
+ endif
+ return self._cachedWarnings
+endfunction " }}}2
+
+" Legacy function. Syntastic no longer calls it, but we keep it
+" around because other plugins (f.i. powerline) depend on it.
+function! g:SyntasticLoclist.hasErrorsOrWarningsToDisplay() abort " {{{2
+ return !self.isEmpty()
+endfunction " }}}2
+
+" cache used by EchoCurrentError()
+function! g:SyntasticLoclist.messages(buf) abort " {{{2
+ if !exists('self._cachedMessages')
+ let self._cachedMessages = {}
+
+ let errors = self.errors() + self.warnings()
+ for e in errors
+ let b = e['bufnr']
+ let l = e['lnum']
+
+ if !has_key(self._cachedMessages, b)
+ let self._cachedMessages[b] = {}
+ endif
+
+ if !has_key(self._cachedMessages[b], l)
+ let self._cachedMessages[b][l] = [e]
+ elseif self._columns
+ call add(self._cachedMessages[b][l], e)
+ endif
+ endfor
+
+ if self._columns
+ if !self._sorted
+ for b in keys(self._cachedMessages)
+ for l in keys(self._cachedMessages[b])
+ if len(self._cachedMessages[b][l]) > 1
+ for e in self._cachedMessages[b][l]
+ call s:_set_screen_column(e)
+ endfor
+ call sort(self._cachedMessages[b][l], 's:_compare_error_items_by_columns')
+ endif
+ endfor
+ endfor
+ endif
+
+ for b in keys(self._cachedMessages)
+ for l in keys(self._cachedMessages[b])
+ call s:_remove_shadowed_items(self._cachedMessages[b][l])
+ endfor
+ endfor
+ endif
+ endif
+
+ return get(self._cachedMessages, a:buf, {})
+endfunction " }}}2
+
+"Filter the list and return new native loclist
+"e.g.
+" .filter({'bufnr': 10, 'type': 'e'})
+"
+"would return all errors for buffer 10.
+"
+"Note that all comparisons are done with ==?
+function! g:SyntasticLoclist.filter(filters) abort " {{{2
+ let conditions = values(map(copy(a:filters), 's:_translate(v:key, v:val)'))
+ let filter = len(conditions) == 1 ?
+ \ conditions[0] : join(map(conditions, '"(" . v:val . ")"'), ' && ')
+ return filter(copy(self._rawLoclist), filter)
+endfunction " }}}2
+
+function! g:SyntasticLoclist.setloclist() abort " {{{2
+ if !exists('w:syntastic_loclist_set')
+ let w:syntastic_loclist_set = []
+ endif
+ if empty(w:syntastic_loclist_set) || w:syntastic_loclist_set != [bufnr(''), b:changedtick]
+ let replace = g:syntastic_reuse_loc_lists && !empty(w:syntastic_loclist_set)
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: setloclist ' . (replace ? '(replace)' : '(new)'))
+ call setloclist(0, self.getRaw(), replace ? 'r' : ' ')
+ call syntastic#util#setChangedtick()
+ let w:syntastic_loclist_set = [bufnr(''), b:syntastic_changedtick]
+ endif
+endfunction " }}}2
+
+"display the cached errors for this buf in the location list
+function! g:SyntasticLoclist.show() abort " {{{2
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: show')
+ call self.setloclist()
+
+ if !self.isEmpty()
+ let num = winnr()
+ execute 'lopen ' . syntastic#util#var('loc_list_height')
+ if num != winnr()
+ execute num . 'wincmd w'
+ endif
+
+ " try to find the loclist window and set w:quickfix_title
+ let errors = getloclist(0)
+ for buf in tabpagebuflist()
+ if buflisted(buf) && bufloaded(buf) && getbufvar(buf, '&buftype') ==# 'quickfix'
+ let win = bufwinnr(buf)
+ let title = getwinvar(win, 'quickfix_title')
+
+ " TODO: try to make sure we actually own this window; sadly,
+ " errors == getloclist(0) is the only somewhat safe way to
+ " achieve that
+ if strpart(title, 0, 16) ==# ':SyntasticCheck ' ||
+ \ ( (title ==# '' || title ==# ':setloclist()') && errors == getloclist(0) )
+ call setwinvar(win, 'quickfix_title', ':SyntasticCheck ' . self._name)
+ call setbufvar(buf, 'syntastic_owner_buffer', self._owner)
+ endif
+ endif
+ endfor
+ endif
+endfunction " }}}2
+
+" }}}1
+
+" Public functions {{{1
+
+function! SyntasticLoclistHide() abort " {{{2
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'loclist: hide')
+ silent! lclose
+endfunction " }}}2
+
+" }}}1
+
+" Utilities {{{1
+
+function! s:_translate(key, val) abort " {{{2
+ return 'get(v:val, ' . string(a:key) . ', "") ==? ' . string(a:val)
+endfunction " }}}2
+
+function! s:_set_screen_column(item) abort " {{{2
+ if !has_key(a:item, 'scol')
+ let col = get(a:item, 'col', 0)
+ if col != 0 && get(a:item, 'vcol', 0) == 0
+ let buf = str2nr(a:item['bufnr'])
+ try
+ let line = getbufline(buf, a:item['lnum'])[0]
+ catch /\m^Vim\%((\a\+)\)\=:E684/
+ let line = ''
+ endtry
+ let a:item['scol'] = syntastic#util#screenWidth(strpart(line, 0, col), getbufvar(buf, '&tabstop'))
+ else
+ let a:item['scol'] = col
+ endif
+ endif
+endfunction " }}}2
+
+function! s:_remove_shadowed_items(errors) abort " {{{2
+ " keep only the first message at a given column
+ let i = 0
+ while i < len(a:errors) - 1
+ let j = i + 1
+ let dupes = 0
+ while j < len(a:errors) && a:errors[j].scol == a:errors[i].scol
+ let dupes = 1
+ let j += 1
+ endwhile
+ if dupes
+ call remove(a:errors, i + 1, j - 1)
+ endif
+ let i += 1
+ endwhile
+
+ " merge messages with the same text
+ let i = 0
+ while i < len(a:errors) - 1
+ let j = i + 1
+ let dupes = 0
+ while j < len(a:errors) && a:errors[j].text == a:errors[i].text
+ let dupes = 1
+ let j += 1
+ endwhile
+ if dupes
+ call remove(a:errors, i + 1, j - 1)
+ endif
+ let i += 1
+ endwhile
+endfunction " }}}2
+
+function! s:_compare_error_items_by_columns(a, b) abort " {{{2
+ if a:a['bufnr'] != a:b['bufnr']
+ " group by file
+ return a:a['bufnr'] - a:b['bufnr']
+ elseif a:a['lnum'] != a:b['lnum']
+ " sort by line
+ return a:a['lnum'] - a:b['lnum']
+ elseif a:a['scol'] != a:b['scol']
+ " sort by screen column
+ return a:a['scol'] - a:b['scol']
+ elseif a:a['type'] !=? a:b['type']
+ " errors take precedence over warnings
+ return a:a['type'] ==? 'E' ? -1 : 1
+ else
+ return 0
+ endif
+endfunction " }}}2
+
+function! s:_compare_error_items_by_lines(a, b) abort " {{{2
+ if a:a['bufnr'] != a:b['bufnr']
+ " group by file
+ return a:a['bufnr'] - a:b['bufnr']
+ elseif a:a['lnum'] != a:b['lnum']
+ " sort by line
+ return a:a['lnum'] - a:b['lnum']
+ elseif a:a['type'] !=? a:b['type']
+ " errors take precedence over warnings
+ return a:a['type'] ==? 'E' ? -1 : 1
+ else
+ " sort by screen column
+ return a:a['scol'] - a:b['scol']
+ endif
+endfunction " }}}2
+
+" }}}1
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/plugin/syntastic/modemap.vim b/vim/bundle/syntastic/plugin/syntastic/modemap.vim
new file mode 100644
index 0000000..501c82b
--- /dev/null
+++ b/vim/bundle/syntastic/plugin/syntastic/modemap.vim
@@ -0,0 +1,117 @@
+if exists('g:loaded_syntastic_modemap') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_modemap = 1
+
+let g:SyntasticModeMap = {}
+
+" Public methods {{{1
+
+function! g:SyntasticModeMap.Instance() abort " {{{2
+ if !exists('s:SyntasticModeMapInstance')
+ let s:SyntasticModeMapInstance = copy(self)
+ call s:SyntasticModeMapInstance.synch()
+ endif
+
+ return s:SyntasticModeMapInstance
+endfunction " }}}2
+
+function! g:SyntasticModeMap.synch() abort " {{{2
+ if exists('g:syntastic_mode_map')
+ let self._mode = get(g:syntastic_mode_map, 'mode', 'active')
+ let self._activeFiletypes = copy(get(g:syntastic_mode_map, 'active_filetypes', []))
+ let self._passiveFiletypes = copy(get(g:syntastic_mode_map, 'passive_filetypes', []))
+ else
+ let self._mode = 'active'
+ let self._activeFiletypes = []
+ let self._passiveFiletypes = []
+ endif
+endfunction " }}}2
+
+function! g:SyntasticModeMap.allowsAutoChecking(filetype) abort " {{{2
+ let fts = split(a:filetype, '\m\.')
+
+ if self.isPassive()
+ return self._isOneFiletypeActive(fts)
+ else
+ return self._noFiletypesArePassive(fts)
+ endif
+endfunction " }}}2
+
+function! g:SyntasticModeMap.doAutoChecking() abort " {{{2
+ let local_mode = get(b:, 'syntastic_mode', '')
+ if local_mode ==# 'active' || local_mode ==# 'passive'
+ return local_mode ==# 'active'
+ endif
+
+ return self.allowsAutoChecking(&filetype)
+endfunction " }}}2
+
+function! g:SyntasticModeMap.isPassive() abort " {{{2
+ return self._mode ==# 'passive'
+endfunction " }}}2
+
+function! g:SyntasticModeMap.toggleMode() abort " {{{2
+ call self.synch()
+
+ if self._mode ==# 'active'
+ let self._mode = 'passive'
+ else
+ let self._mode = 'active'
+ endif
+
+ "XXX Changing a global variable. Tsk, tsk...
+ if !exists('g:syntastic_mode_map')
+ let g:syntastic_mode_map = {}
+ endif
+ let g:syntastic_mode_map['mode'] = self._mode
+endfunction " }}}2
+
+function! g:SyntasticModeMap.echoMode() abort " {{{2
+ echo 'Syntastic: ' . self._mode . ' mode enabled'
+endfunction " }}}2
+
+function! g:SyntasticModeMap.modeInfo(filetypes) abort " {{{2
+ echomsg 'Syntastic version: ' . g:_SYNTASTIC_VERSION . ' (Vim ' . v:version . ', ' . g:_SYNTASTIC_UNAME . ')'
+ let type = len(a:filetypes) ? a:filetypes[0] : &filetype
+ echomsg 'Info for filetype: ' . type
+
+ call self.synch()
+ echomsg 'Global mode: ' . self._mode
+ if self._mode ==# 'active'
+ if len(self._passiveFiletypes)
+ let plural = len(self._passiveFiletypes) != 1 ? 's' : ''
+ echomsg 'Passive filetype' . plural . ': ' . join(sort(copy(self._passiveFiletypes)))
+ endif
+ else
+ if len(self._activeFiletypes)
+ let plural = len(self._activeFiletypes) != 1 ? 's' : ''
+ echomsg 'Active filetype' . plural . ': ' . join(sort(copy(self._activeFiletypes)))
+ endif
+ endif
+ echomsg 'Filetype ' . type . ' is ' . (self.allowsAutoChecking(type) ? 'active' : 'passive')
+
+ if !len(a:filetypes)
+ if exists('b:syntastic_mode') && (b:syntastic_mode ==# 'active' || b:syntastic_mode ==# 'passive')
+ echomsg 'Local mode: ' . b:syntastic_mode
+ endif
+
+ echomsg 'The current file will ' . (self.doAutoChecking() ? '' : 'not ') . 'be checked automatically'
+ endif
+endfunction " }}}2
+
+" }}}1
+
+" Private methods {{{1
+
+function! g:SyntasticModeMap._isOneFiletypeActive(filetypes) abort " {{{2
+ return !empty(filter(copy(a:filetypes), 'index(self._activeFiletypes, v:val) != -1'))
+endfunction " }}}2
+
+function! g:SyntasticModeMap._noFiletypesArePassive(filetypes) abort " {{{2
+ return empty(filter(copy(a:filetypes), 'index(self._passiveFiletypes, v:val) != -1'))
+endfunction " }}}2
+
+" }}}1
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/plugin/syntastic/notifiers.vim b/vim/bundle/syntastic/plugin/syntastic/notifiers.vim
new file mode 100644
index 0000000..fe158ca
--- /dev/null
+++ b/vim/bundle/syntastic/plugin/syntastic/notifiers.vim
@@ -0,0 +1,86 @@
+if exists('g:loaded_syntastic_notifiers') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_notifiers = 1
+
+let g:SyntasticNotifiers = {}
+
+let s:_NOTIFIER_TYPES = ['signs', 'balloons', 'highlighting', 'cursor', 'autoloclist']
+lockvar! s:_NOTIFIER_TYPES
+
+let s:_PERSISTENT_NOTIFIERS = ['signs', 'balloons']
+lockvar! s:_PERSISTENT_NOTIFIERS
+
+" Public methods {{{1
+
+function! g:SyntasticNotifiers.Instance() abort " {{{2
+ if !exists('s:SyntasticNotifiersInstance')
+ let s:SyntasticNotifiersInstance = copy(self)
+ call s:SyntasticNotifiersInstance._initNotifiers()
+ endif
+
+ return s:SyntasticNotifiersInstance
+endfunction " }}}2
+
+function! g:SyntasticNotifiers.refresh(loclist) abort " {{{2
+ if !a:loclist.isEmpty() && !a:loclist.isNewerThan([])
+ " loclist not fully constructed yet
+ return
+ endif
+
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'notifiers: refresh')
+ for type in self._enabled_types
+ let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
+ if !has_key(g:{class}, 'enabled') || self._notifier[type].enabled()
+ if index(s:_PERSISTENT_NOTIFIERS, type) > -1
+ " refresh only if loclist has changed since last call
+ if !exists('b:syntastic_private_' . type . '_stamp')
+ let b:syntastic_private_{type}_stamp = []
+ endif
+ if a:loclist.isNewerThan(b:syntastic_private_{type}_stamp) || a:loclist.isEmpty()
+ call self._notifier[type].refresh(a:loclist)
+ let b:syntastic_private_{type}_stamp = syntastic#util#stamp()
+ endif
+ else
+ call self._notifier[type].refresh(a:loclist)
+ endif
+ endif
+ endfor
+endfunction " }}}2
+
+function! g:SyntasticNotifiers.reset(loclist) abort " {{{2
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'notifiers: reset')
+ for type in self._enabled_types
+ let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
+
+ " reset notifiers regardless if they are enabled or not, since
+ " the user might have disabled them since the last refresh();
+ " notifiers MUST be prepared to deal with reset() when disabled
+ if has_key(g:{class}, 'reset')
+ call self._notifier[type].reset(a:loclist)
+ endif
+
+ " also reset stamps
+ if index(s:_PERSISTENT_NOTIFIERS, type) > -1
+ let b:syntastic_private_{type}_stamp = []
+ endif
+ endfor
+endfunction " }}}2
+
+" }}}1
+
+" Private methods {{{1
+
+function! g:SyntasticNotifiers._initNotifiers() abort " {{{2
+ let self._notifier = {}
+ for type in s:_NOTIFIER_TYPES
+ let class = substitute(type, '\m.*', 'Syntastic\u&Notifier', '')
+ let self._notifier[type] = g:{class}.New()
+ endfor
+
+ let self._enabled_types = copy(s:_NOTIFIER_TYPES)
+endfunction " }}}2
+
+" }}}1
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/plugin/syntastic/registry.vim b/vim/bundle/syntastic/plugin/syntastic/registry.vim
new file mode 100644
index 0000000..0c2d261
--- /dev/null
+++ b/vim/bundle/syntastic/plugin/syntastic/registry.vim
@@ -0,0 +1,375 @@
+if exists('g:loaded_syntastic_registry') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_registry = 1
+
+" Initialisation {{{1
+
+let s:_DEFAULT_CHECKERS = {
+ \ 'actionscript': ['mxmlc'],
+ \ 'ada': ['gcc'],
+ \ 'ansible': ['ansible_lint'],
+ \ 'apiblueprint': ['drafter'],
+ \ 'applescript': ['osacompile'],
+ \ 'asciidoc': ['asciidoc'],
+ \ 'asm': ['gcc'],
+ \ 'bro': ['bro'],
+ \ 'bemhtml': ['bemhtmllint'],
+ \ 'c': ['gcc'],
+ \ 'cabal': ['cabal'],
+ \ 'chef': ['foodcritic'],
+ \ 'co': ['coco'],
+ \ 'cobol': ['cobc'],
+ \ 'coffee': ['coffee', 'coffeelint'],
+ \ 'coq': ['coqtop'],
+ \ 'cpp': ['gcc'],
+ \ 'cs': ['mcs'],
+ \ 'css': ['csslint'],
+ \ 'cucumber': ['cucumber'],
+ \ 'cuda': ['nvcc'],
+ \ 'd': ['dmd'],
+ \ 'dart': ['dartanalyzer'],
+ \ 'docbk': ['xmllint'],
+ \ 'dockerfile': ['dockerfile_lint'],
+ \ 'dustjs': ['swiffer'],
+ \ 'elixir': [],
+ \ 'erlang': ['escript'],
+ \ 'eruby': ['ruby'],
+ \ 'fortran': ['gfortran'],
+ \ 'glsl': ['cgc'],
+ \ 'go': [],
+ \ 'haml': ['haml'],
+ \ 'handlebars': ['handlebars'],
+ \ 'haskell': ['hdevtools', 'hlint'],
+ \ 'haxe': ['haxe'],
+ \ 'hss': ['hss'],
+ \ 'html': ['tidy'],
+ \ 'jade': ['jade_lint'],
+ \ 'java': ['javac'],
+ \ 'javascript': ['jshint', 'jslint'],
+ \ 'json': ['jsonlint', 'jsonval'],
+ \ 'less': ['lessc'],
+ \ 'lex': ['flex'],
+ \ 'limbo': ['limbo'],
+ \ 'lisp': ['clisp'],
+ \ 'llvm': ['llvm'],
+ \ 'lua': ['luac'],
+ \ 'markdown': ['mdl'],
+ \ 'matlab': ['mlint'],
+ \ 'mercury': ['mmc'],
+ \ 'nasm': ['nasm'],
+ \ 'nix': ['nix'],
+ \ 'nroff': ['mandoc'],
+ \ 'objc': ['gcc'],
+ \ 'objcpp': ['gcc'],
+ \ 'ocaml': ['camlp4o'],
+ \ 'perl': ['perlcritic'],
+ \ 'php': ['php', 'phpcs', 'phpmd'],
+ \ 'po': ['msgfmt'],
+ \ 'pod': ['podchecker'],
+ \ 'puppet': ['puppet', 'puppetlint'],
+ \ 'pug': ['pug_lint'],
+ \ 'python': ['python', 'flake8', 'pylint'],
+ \ 'qml': ['qmllint'],
+ \ 'r': [],
+ \ 'rmd': [],
+ \ 'racket': ['racket'],
+ \ 'rnc': ['rnv'],
+ \ 'rst': ['rst2pseudoxml'],
+ \ 'ruby': ['mri'],
+ \ 'sass': ['sass'],
+ \ 'scala': ['fsc', 'scalac'],
+ \ 'scss': ['sass', 'scss_lint'],
+ \ 'sh': ['sh', 'shellcheck'],
+ \ 'slim': ['slimrb'],
+ \ 'sml': ['smlnj'],
+ \ 'spec': ['rpmlint'],
+ \ 'sql': ['sqlint'],
+ \ 'stylus': ['stylint'],
+ \ 'tcl': ['nagelfar'],
+ \ 'tex': ['lacheck', 'chktex'],
+ \ 'texinfo': ['makeinfo'],
+ \ 'text': [],
+ \ 'trig': ['rapper'],
+ \ 'turtle': ['rapper'],
+ \ 'twig': ['twiglint'],
+ \ 'typescript': ['tsc'],
+ \ 'vala': ['valac'],
+ \ 'verilog': ['verilator'],
+ \ 'vhdl': ['ghdl'],
+ \ 'vim': ['vimlint'],
+ \ 'xhtml': ['tidy'],
+ \ 'xml': ['xmllint'],
+ \ 'xslt': ['xmllint'],
+ \ 'xquery': ['basex'],
+ \ 'yacc': ['bison'],
+ \ 'yaml': ['jsyaml'],
+ \ 'yang': ['pyang'],
+ \ 'z80': ['z80syntaxchecker'],
+ \ 'zpt': ['zptlint'],
+ \ 'zsh': ['zsh'],
+ \ }
+lockvar! s:_DEFAULT_CHECKERS
+
+let s:_DEFAULT_FILETYPE_MAP = {
+ \ 'gentoo-metadata': 'xml',
+ \ 'groff': 'nroff',
+ \ 'lhaskell': 'haskell',
+ \ 'litcoffee': 'coffee',
+ \ 'mail': 'text',
+ \ 'mkd': 'markdown',
+ \ 'pe-puppet': 'puppet',
+ \ 'sgml': 'docbk',
+ \ 'sgmllnx': 'docbk',
+ \ }
+lockvar! s:_DEFAULT_FILETYPE_MAP
+
+let s:_ECLIM_TYPES = [
+ \ 'c',
+ \ 'cpp',
+ \ 'html',
+ \ 'java',
+ \ 'php',
+ \ 'python',
+ \ 'ruby',
+ \ ]
+lockvar! s:_ECLIM_TYPES
+
+let s:_YCM_TYPES = [
+ \ 'c',
+ \ 'cpp',
+ \ 'objc',
+ \ 'objcpp',
+ \ ]
+lockvar! s:_YCM_TYPES
+
+let g:SyntasticRegistry = {}
+
+" }}}1
+
+" Public methods {{{1
+
+" Note: Handling of filetype aliases: all public methods take aliases as
+" parameters, all private methods take normalized filetypes. Public methods
+" are thus supposed to normalize filetypes before calling private methods.
+
+function! g:SyntasticRegistry.Instance() abort " {{{2
+ if !exists('s:SyntasticRegistryInstance')
+ let s:SyntasticRegistryInstance = copy(self)
+ let s:SyntasticRegistryInstance._checkerMap = {}
+ endif
+
+ return s:SyntasticRegistryInstance
+endfunction " }}}2
+
+function! g:SyntasticRegistry.CreateAndRegisterChecker(args) abort " {{{2
+ let registry = g:SyntasticRegistry.Instance()
+
+ if has_key(a:args, 'redirect')
+ let [ft, name] = split(a:args['redirect'], '/')
+ call registry._loadCheckersFor(ft, 1)
+
+ let clone = get(registry._checkerMap[ft], name, {})
+ if empty(clone)
+ throw 'Syntastic: Checker ' . a:args['redirect'] . ' redirects to unregistered checker ' . ft . '/' . name
+ endif
+
+ let checker = g:SyntasticChecker.New(a:args, clone)
+ else
+ let checker = g:SyntasticChecker.New(a:args)
+ endif
+ call registry._registerChecker(checker)
+endfunction " }}}2
+
+" Given a list of checker names hints_list, return a map name --> checker.
+" If hints_list is empty, user settings are are used instead. Checkers are
+" not checked for availability (that is, the corresponding IsAvailable() are
+" not run).
+function! g:SyntasticRegistry.getCheckers(ftalias, hints_list) abort " {{{2
+ let ft = s:_normalise_filetype(a:ftalias)
+ call self._loadCheckersFor(ft, 0)
+
+ let checkers_map = self._checkerMap[ft]
+ if empty(checkers_map)
+ return []
+ endif
+
+ call self._checkDeprecation(ft)
+
+ let names =
+ \ !empty(a:hints_list) ? syntastic#util#unique(a:hints_list) :
+ \ exists('b:syntastic_checkers') ? b:syntastic_checkers :
+ \ exists('g:syntastic_' . ft . '_checkers') ? g:syntastic_{ft}_checkers :
+ \ get(s:_DEFAULT_CHECKERS, ft, 0)
+
+ return type(names) == type([]) ?
+ \ self._filterCheckersByName(checkers_map, names) : [checkers_map[keys(checkers_map)[0]]]
+endfunction " }}}2
+
+" Same as getCheckers(), but keep only the available checkers. This runs the
+" corresponding IsAvailable() functions for all checkers.
+function! g:SyntasticRegistry.getCheckersAvailable(ftalias, hints_list) abort " {{{2
+ return filter(self.getCheckers(a:ftalias, a:hints_list), 'v:val.isAvailable()')
+endfunction " }}}2
+
+" Same as getCheckers(), but keep only the checkers that are available and
+" disabled. This runs the corresponding IsAvailable() functions for all checkers.
+function! g:SyntasticRegistry.getCheckersDisabled(ftalias, hints_list) abort " {{{2
+ return filter(self.getCheckers(a:ftalias, a:hints_list), 'v:val.isDisabled() && v:val.isAvailable()')
+endfunction " }}}2
+
+function! g:SyntasticRegistry.getKnownFiletypes() abort " {{{2
+ let types = keys(s:_DEFAULT_CHECKERS)
+
+ call extend(types, keys(s:_DEFAULT_FILETYPE_MAP))
+
+ if exists('g:syntastic_filetype_map')
+ call extend(types, keys(g:syntastic_filetype_map))
+ endif
+
+ if exists('g:syntastic_extra_filetypes') && type(g:syntastic_extra_filetypes) == type([])
+ call extend(types, g:syntastic_extra_filetypes)
+ endif
+
+ return syntastic#util#unique(types)
+endfunction " }}}2
+
+function! g:SyntasticRegistry.getNamesOfAvailableCheckers(ftalias) abort " {{{2
+ let ft = s:_normalise_filetype(a:ftalias)
+ call self._loadCheckersFor(ft, 0)
+ return keys(filter( copy(self._checkerMap[ft]), 'v:val.isAvailable()' ))
+endfunction " }}}2
+
+function! g:SyntasticRegistry.echoInfoFor(ftalias_list) abort " {{{2
+ let ft_list = syntastic#util#unique(map( copy(a:ftalias_list), 's:_normalise_filetype(v:val)' ))
+ if len(ft_list) != 1
+ let available = []
+ let active = []
+ let disabled = []
+
+ for ft in ft_list
+ call extend(available, map( self.getNamesOfAvailableCheckers(ft), 'ft . "/" . v:val' ))
+ call extend(active, map( self.getCheckersAvailable(ft, []), 'ft . "/" . v:val.getName()' ))
+ call extend(disabled, map( self.getCheckersDisabled(ft, []), 'ft . "/" . v:val.getName()' ))
+ endfor
+ else
+ let ft = ft_list[0]
+ let available = self.getNamesOfAvailableCheckers(ft)
+ let active = map(self.getCheckersAvailable(ft, []), 'v:val.getName()')
+ let disabled = map(self.getCheckersDisabled(ft, []), 'v:val.getName()')
+ endif
+
+ let cnt = len(available)
+ let plural = cnt != 1 ? 's' : ''
+ let cklist = cnt ? join(sort(available)) : '-'
+ echomsg 'Available checker' . plural . ': ' . cklist
+
+ let cnt = len(active)
+ let plural = cnt != 1 ? 's' : ''
+ let cklist = cnt ? join(active) : '-'
+ echomsg 'Currently enabled checker' . plural . ': ' . cklist
+
+ let cnt = len(disabled)
+ let plural = cnt != 1 ? 's' : ''
+ if len(disabled)
+ let cklist = join(sort(disabled))
+ echomsg 'Checker' . plural . ' disabled for security reasons: ' . cklist
+ endif
+
+ " Eclim feels entitled to mess with syntastic's variables {{{3
+ if exists(':EclimValidate') && get(g:, 'EclimFileTypeValidate', 1)
+ let disabled = filter(copy(ft_list), 's:_disabled_by_eclim(v:val)')
+ let cnt = len(disabled)
+ if cnt
+ let plural = cnt != 1 ? 's' : ''
+ let cklist = join(disabled, ', ')
+ echomsg 'Checkers for filetype' . plural . ' ' . cklist . ' possibly disabled by Eclim'
+ endif
+ endif
+ " }}}3
+
+ " So does YouCompleteMe {{{3
+ if exists('g:loaded_youcompleteme') && get(g:, 'ycm_show_diagnostics_ui', get(g:, 'ycm_register_as_syntastic_checker', 1))
+ let disabled = filter(copy(ft_list), 's:_disabled_by_ycm(v:val)')
+ let cnt = len(disabled)
+ if cnt
+ let plural = cnt != 1 ? 's' : ''
+ let cklist = join(disabled, ', ')
+ echomsg 'Checkers for filetype' . plural . ' ' . cklist . ' possibly disabled by YouCompleteMe'
+ endif
+ endif
+ " }}}3
+endfunction " }}}2
+
+" }}}1
+
+" Private methods {{{1
+
+function! g:SyntasticRegistry._registerChecker(checker) abort " {{{2
+ let ft = a:checker.getFiletype()
+ if !has_key(self._checkerMap, ft)
+ let self._checkerMap[ft] = {}
+ endif
+
+ let name = a:checker.getName()
+ if has_key(self._checkerMap[ft], name)
+ throw 'Syntastic: Duplicate syntax checker name: ' . ft . '/' . name
+ endif
+
+ let self._checkerMap[ft][name] = a:checker
+endfunction " }}}2
+
+function! g:SyntasticRegistry._filterCheckersByName(checkers_map, list) abort " {{{2
+ return filter( map(copy(a:list), 'get(a:checkers_map, v:val, {})'), '!empty(v:val)' )
+endfunction " }}}2
+
+function! g:SyntasticRegistry._loadCheckersFor(filetype, force) abort " {{{2
+ if !a:force && has_key(self._checkerMap, a:filetype)
+ return
+ endif
+
+ execute 'runtime! syntax_checkers/' . a:filetype . '/*.vim'
+
+ if !has_key(self._checkerMap, a:filetype)
+ let self._checkerMap[a:filetype] = {}
+ endif
+endfunction " }}}2
+
+" Check for obsolete variable g:syntastic_<filetype>_checker
+function! g:SyntasticRegistry._checkDeprecation(filetype) abort " {{{2
+ if exists('g:syntastic_' . a:filetype . '_checker') && !exists('g:syntastic_' . a:filetype . '_checkers')
+ let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker]
+ call syntastic#log#oneTimeWarn('variable g:syntastic_' . a:filetype . '_checker is deprecated')
+ endif
+endfunction " }}}2
+
+" }}}1
+
+" Utilities {{{1
+
+"resolve filetype aliases, and replace - with _ otherwise we cant name
+"syntax checker functions legally for filetypes like "gentoo-metadata"
+function! s:_normalise_filetype(ftalias) abort " {{{2
+ let ft = get(s:_DEFAULT_FILETYPE_MAP, a:ftalias, a:ftalias)
+ let ft = get(g:syntastic_filetype_map, ft, ft)
+ let ft = substitute(ft, '\m-', '_', 'g')
+ return ft
+endfunction " }}}2
+
+function! s:_disabled_by_eclim(filetype) abort " {{{2
+ if index(s:_ECLIM_TYPES, a:filetype) >= 0
+ let lang = toupper(a:filetype[0]) . a:filetype[1:]
+ let ft = a:filetype !=# 'cpp' ? lang : 'C'
+ return get(g:, 'Eclim' . lang . 'Validate', 1) && !get(g:, 'Eclim' . ft . 'SyntasticEnabled', 0)
+ endif
+
+ return 0
+endfunction " }}}2
+
+function! s:_disabled_by_ycm(filetype) abort " {{{2
+ return index(s:_YCM_TYPES, a:filetype) >= 0
+endfunction " }}}2
+
+" }}}1
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/plugin/syntastic/signs.vim b/vim/bundle/syntastic/plugin/syntastic/signs.vim
new file mode 100644
index 0000000..e3bafa0
--- /dev/null
+++ b/vim/bundle/syntastic/plugin/syntastic/signs.vim
@@ -0,0 +1,138 @@
+if exists('g:loaded_syntastic_notifier_signs') || !exists('g:loaded_syntastic_plugin')
+ finish
+endif
+let g:loaded_syntastic_notifier_signs = 1
+
+" Initialisation {{{1
+
+" start counting sign ids at 5000, start here to hopefully avoid conflicting
+" with any other code that places signs (not sure if this precaution is
+" actually needed)
+let s:first_sign_id = 5000
+let s:next_sign_id = s:first_sign_id
+
+let g:SyntasticSignsNotifier = {}
+
+let s:setup_done = 0
+
+" }}}1
+
+" Public methods {{{1
+
+function! g:SyntasticSignsNotifier.New() abort " {{{2
+ let newObj = copy(self)
+ return newObj
+endfunction " }}}2
+
+function! g:SyntasticSignsNotifier.enabled() abort " {{{2
+ return has('signs') && syntastic#util#var('enable_signs')
+endfunction " }}}2
+
+function! g:SyntasticSignsNotifier.refresh(loclist) abort " {{{2
+ call syntastic#log#debug(g:_SYNTASTIC_DEBUG_NOTIFICATIONS, 'signs: refresh')
+
+ let old_signs = copy(self._bufSignIds())
+ if self.enabled()
+ if !s:setup_done
+ call self._setup()
+ let s:setup_done = 1
+ lockvar s:setup_done
+ endif
+
+ call self._signErrors(a:loclist)
+ endif
+ call self._removeSigns(old_signs)
+endfunction " }}}2
+
+" }}}1
+
+" Private methods {{{1
+
+" One time setup: define our own sign types and highlighting
+function! g:SyntasticSignsNotifier._setup() abort " {{{2
+ if has('signs')
+ if !hlexists('SyntasticErrorSign')
+ highlight link SyntasticErrorSign error
+ endif
+ if !hlexists('SyntasticWarningSign')
+ highlight link SyntasticWarningSign todo
+ endif
+ if !hlexists('SyntasticStyleErrorSign')
+ highlight link SyntasticStyleErrorSign SyntasticErrorSign
+ endif
+ if !hlexists('SyntasticStyleWarningSign')
+ highlight link SyntasticStyleWarningSign SyntasticWarningSign
+ endif
+ if !hlexists('SyntasticStyleErrorLine')
+ highlight link SyntasticStyleErrorLine SyntasticErrorLine
+ endif
+ if !hlexists('SyntasticStyleWarningLine')
+ highlight link SyntasticStyleWarningLine SyntasticWarningLine
+ endif
+
+ " define the signs used to display syntax and style errors/warns
+ execute 'sign define SyntasticError text=' . g:syntastic_error_symbol .
+ \ ' texthl=SyntasticErrorSign linehl=SyntasticErrorLine'
+ execute 'sign define SyntasticWarning text=' . g:syntastic_warning_symbol .
+ \ ' texthl=SyntasticWarningSign linehl=SyntasticWarningLine'
+ execute 'sign define SyntasticStyleError text=' . g:syntastic_style_error_symbol .
+ \ ' texthl=SyntasticStyleErrorSign linehl=SyntasticStyleErrorLine'
+ execute 'sign define SyntasticStyleWarning text=' . g:syntastic_style_warning_symbol .
+ \ ' texthl=SyntasticStyleWarningSign linehl=SyntasticStyleWarningLine'
+ endif
+endfunction " }}}2
+
+" Place signs by all syntax errors in the buffer
+function! g:SyntasticSignsNotifier._signErrors(loclist) abort " {{{2
+ let loclist = a:loclist
+ if !loclist.isEmpty()
+
+ let buf = bufnr('')
+ if !bufloaded(buf)
+ " signs can be placed only in loaded buffers
+ return
+ endif
+
+ " errors come first, so that they are not masked by warnings
+ let issues = copy(loclist.errors())
+ call extend(issues, loclist.warnings())
+ call filter(issues, 'v:val["bufnr"] == buf')
+ let seen = {}
+
+ for i in issues
+ if i['lnum'] > 0 && !has_key(seen, i['lnum'])
+ let seen[i['lnum']] = 1
+
+ let sign_severity = i['type'] ==? 'W' ? 'Warning' : 'Error'
+ let sign_subtype = get(i, 'subtype', '')
+ let sign_type = 'Syntastic' . sign_subtype . sign_severity
+
+ execute 'sign place ' . s:next_sign_id . ' line=' . i['lnum'] . ' name=' . sign_type . ' buffer=' . i['bufnr']
+ call add(self._bufSignIds(), s:next_sign_id)
+ let s:next_sign_id += 1
+ endif
+ endfor
+ endif
+endfunction " }}}2
+
+" Remove the signs with the given ids from this buffer
+function! g:SyntasticSignsNotifier._removeSigns(ids) abort " {{{2
+ if has('signs')
+ for s in reverse(copy(a:ids))
+ execute 'sign unplace ' . s
+ call remove(self._bufSignIds(), index(self._bufSignIds(), s))
+ endfor
+ endif
+endfunction " }}}2
+
+" Get all the ids of the SyntaxError signs in the buffer
+function! g:SyntasticSignsNotifier._bufSignIds() abort " {{{2
+ if !exists('b:syntastic_private_sign_ids')
+ let b:syntastic_private_sign_ids = []
+ endif
+ return b:syntastic_private_sign_ids
+endfunction " }}}2
+
+" }}}1
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/actionscript/mxmlc.vim b/vim/bundle/syntastic/syntax_checkers/actionscript/mxmlc.vim
new file mode 100644
index 0000000..1066769
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/actionscript/mxmlc.vim
@@ -0,0 +1,67 @@
+"============================================================================
+"File: mxmlc.vim
+"Description: ActionScript syntax checker - using mxmlc
+"Maintainer: Andy Earnshaw <andyearnshaw@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_actionscript_mxmlc_checker')
+ finish
+endif
+let g:loaded_syntastic_actionscript_mxmlc_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_actionscript_mxmlc_GetHighlightRegex(item)
+ let term = ''
+
+ if match(a:item['text'], '\mvariable ''') > -1
+ let term = matchstr(a:item['text'], '\m''\zs[^'']\+\ze''')
+
+ elseif match(a:item['text'], 'expected a definition keyword') > -1
+ let term = matchstr(a:item['text'], '\mnot \zs[^.]\+\ze\.')
+
+ elseif match(a:item['text'], '\mundefined \%(property\|method\)') > -1
+ let term = matchstr(a:item['text'], '\mundefined \%(property\|method\) \zs[^. ]\+\ze')
+
+ elseif match(a:item['text'], 'could not be found') > -1
+ let term = matchstr(a:item['text'], '\m \zs\S\+\ze could not be found')
+
+ elseif match(a:item['text'], 'Type was not found') > -1
+ let term = matchstr(a:item['text'], '\m: \zs[^.]\+\zs\.')
+
+ endif
+
+ return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : ''
+endfunction
+
+function! SyntaxCheckers_actionscript_mxmlc_GetLocList() dict
+ call syntastic#log#deprecationWarn('actionscript_mxmlc_conf', 'actionscript_mxmlc_args',
+ \ "'-load-config+=' . syntastic#util#shexpand(OLD_VAR)")
+
+ let makeprg = self.makeprgBuild({ 'args_after': '-output=' . syntastic#util#DevNull() })
+
+ let errorformat =
+ \ '%f(%l): col: %c %trror: %m,' .
+ \ '%f(%l): col: %c %tarning: %m,' .
+ \ '%f: %trror: %m,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'actionscript',
+ \ 'name': 'mxmlc'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/ada/gcc.vim b/vim/bundle/syntastic/syntax_checkers/ada/gcc.vim
new file mode 100644
index 0000000..6072ae4
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/ada/gcc.vim
@@ -0,0 +1,47 @@
+"============================================================================
+"File: ada.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Alfredo Di Napoli <alfredo.dinapoli@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_ada_gcc_checker')
+ finish
+endif
+let g:loaded_syntastic_ada_gcc_checker = 1
+
+if !exists('g:syntastic_ada_compiler_options')
+ let g:syntastic_ada_compiler_options = ''
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_ada_gcc_IsAvailable() dict
+ if !exists('g:syntastic_ada_compiler')
+ let g:syntastic_ada_compiler = self.getExec()
+ endif
+ return executable(expand(g:syntastic_ada_compiler, 1))
+endfunction
+
+function! SyntaxCheckers_ada_gcc_GetLocList() dict
+ return syntastic#c#GetLocList('ada', 'gcc', {
+ \ 'errorformat':
+ \ '%-G%f:%s:,' .
+ \ '%f:%l:%c: %m,' .
+ \ '%f:%l: %m',
+ \ 'main_flags': '-c -x ada -gnats -gnatef',
+ \ 'header_flags': '-x ada -gnats -gnatef',
+ \ 'header_names': '\.ads$' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'ada',
+ \ 'name': 'gcc' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/ansible/ansible_lint.vim b/vim/bundle/syntastic/syntax_checkers/ansible/ansible_lint.vim
new file mode 100644
index 0000000..fe62581
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/ansible/ansible_lint.vim
@@ -0,0 +1,54 @@
+"============================================================================
+"File: ansible_lint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Erik Zaadi <erik.zaadi at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_ansible_ansible_lint_checker')
+ finish
+endif
+let g:loaded_syntastic_ansible_ansible_lint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_ansible_ansible_lint_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 0, 4])
+endfunction
+
+function! SyntaxCheckers_ansible_ansible_lint_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-p' })
+
+ let errorformat =
+ \ '%f:%l: [EANSIBLE%n] %m,' .
+ \ '%f:%l: [ANSIBLE%n] %m'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env,
+ \ 'defaults': {'type': 'E'},
+ \ 'subtype': 'Style',
+ \ 'returns': [0, 2] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'ansible',
+ \ 'name': 'ansible_lint',
+ \ 'exec': 'ansible-lint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/apiblueprint/drafter.vim b/vim/bundle/syntastic/syntax_checkers/apiblueprint/drafter.vim
new file mode 100644
index 0000000..e404a4f
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/apiblueprint/drafter.vim
@@ -0,0 +1,66 @@
+"============================================================================
+"File: drafter.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_apiblueprint_drafter_checker')
+ finish
+endif
+let g:loaded_syntastic_apiblueprint_drafter_checker = 1
+
+if !exists('g:syntastic_apiblueprint_drafter_sort')
+ let g:syntastic_apiblueprint_drafter_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_apiblueprint_drafter_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'post_args': '-u -l' })
+
+ let errorformat =
+ \ '%trror: (%n) %m,' .
+ \ '%tarning: (%n) %m,' .
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')},
+ \ 'returns': [0, 2, 3, 4] })
+
+ for e in loclist
+ let matches = matchlist(e['text'], '\v^(.+); line (\d+), column (\d+) - line (\d+), column (\d+)$')
+ if len(matches) > 5
+ let e['lnum'] = str2nr(matches[2])
+ let e['col'] = str2nr(matches[3])
+ let e['vcol'] = 0
+
+ if matches[2] == matches[4]
+ let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . matches[5] . 'c'
+ endif
+
+ let e['text'] = matches[1]
+ else
+ let e['valid'] = 0
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'apiblueprint',
+ \ 'name': 'drafter'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/applescript/osacompile.vim b/vim/bundle/syntastic/syntax_checkers/applescript/osacompile.vim
new file mode 100644
index 0000000..406e029
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/applescript/osacompile.vim
@@ -0,0 +1,49 @@
+"==============================================================================
+" FileName: applescript.vim
+" Desc: Syntax checking plugin for syntastic.vim
+" Author: Zhao Cai
+" Email: caizhaoff@gmail.com
+" Version: 0.2.1
+" Date Created: Thu 09 Sep 2011 10:30:09 AM EST
+" Last Modified: Fri 09 Dec 2011 01:10:24 PM EST
+"
+" History: 0.1.0 - working, but it will run the script everytime to check
+" syntax. Should use osacompile but strangely it does not give
+" errors.
+"
+" 0.2.0 - switch to osacompile, it gives less errors compared
+" with osascript.
+"
+" 0.2.1 - remove g:syntastic_applescript_tempfile. use
+" tempname() instead.
+"
+" License: This program is free software. It comes without any
+" warranty, to the extent permitted by applicable law. You can
+" redistribute it and/or modify it under the terms of the Do What The
+" Fuck You Want To Public License, Version 2, as published by Sam
+" Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_applescript_osacompile_checker')
+ finish
+endif
+let g:loaded_syntastic_applescript_osacompile_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_applescript_osacompile_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-o ' . tempname() . '.scpt' })
+ let errorformat = '%f:%l:%m'
+ return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'applescript',
+ \ 'name': 'osacompile' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/asciidoc/asciidoc.vim b/vim/bundle/syntastic/syntax_checkers/asciidoc/asciidoc.vim
new file mode 100644
index 0000000..bc64e6a
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/asciidoc/asciidoc.vim
@@ -0,0 +1,47 @@
+"============================================================================
+"File: asciidoc.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_asciidoc_asciidoc_checker')
+ finish
+endif
+let g:loaded_syntastic_asciidoc_asciidoc_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_asciidoc_asciidoc_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': syntastic#c#NullOutput() })
+
+ let errorformat =
+ \ '%E%\w%\+: %tRROR: %f: line %l: %m,' .
+ \ '%E%\w%\+: %tRROR: %f: %m,' .
+ \ '%E%\w%\+: FAILED: %f: line %l: %m,' .
+ \ '%E%\w%\+: FAILED: %f: %m,' .
+ \ '%W%\w%\+: %tARNING: %f: line %l: %m,' .
+ \ '%W%\w%\+: %tARNING: %f: %m,' .
+ \ '%W%\w%\+: DEPRECATED: %f: line %l: %m,' .
+ \ '%W%\w%\+: DEPRECATED: %f: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 1] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'asciidoc',
+ \ 'name': 'asciidoc'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/asm/gcc.vim b/vim/bundle/syntastic/syntax_checkers/asm/gcc.vim
new file mode 100644
index 0000000..d352eee
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/asm/gcc.vim
@@ -0,0 +1,61 @@
+"============================================================================
+"File: gcc.vim
+"Description: Syntax checking for at&t and intel assembly files with gcc
+"Maintainer: Josh Rahm <joshuarahm@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_asm_gcc_checker')
+ finish
+endif
+let g:loaded_syntastic_asm_gcc_checker = 1
+
+if !exists('g:syntastic_asm_compiler_options')
+ let g:syntastic_asm_compiler_options = ''
+endif
+
+if !exists('g:syntastic_asm_generic')
+ let g:syntastic_asm_generic = 0
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_asm_gcc_IsAvailable() dict " {{{1
+ if !exists('g:syntastic_asm_compiler')
+ let g:syntastic_asm_compiler = self.getExec()
+ endif
+ return executable(expand(g:syntastic_asm_compiler, 1))
+endfunction " }}}1
+
+function! SyntaxCheckers_asm_gcc_GetLocList() dict " {{{1
+ return syntastic#c#GetLocList('asm', 'gcc', {
+ \ 'errorformat':
+ \ '%-G%f:%s:,' .
+ \ '%f:%l:%c: %trror: %m,' .
+ \ '%f:%l:%c: %tarning: %m,' .
+ \ '%f:%l: %m',
+ \ 'main_flags': '-x assembler -fsyntax-only' . (g:syntastic_asm_generic ? '' : ' -masm=' . s:GetDialect()) })
+endfunction " }}}1
+
+" Utilities {{{1
+
+function! s:GetDialect() " {{{2
+ return syntastic#util#var('asm_dialect', expand('%:e', 1) ==? 'asm' ? 'intel' : 'att')
+endfunction " }}}2
+
+" }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'asm',
+ \ 'name': 'gcc' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/bemhtml/bemhtmllint.vim b/vim/bundle/syntastic/syntax_checkers/bemhtml/bemhtmllint.vim
new file mode 100644
index 0000000..1837067
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/bemhtml/bemhtmllint.vim
@@ -0,0 +1,35 @@
+"============================================================================
+"File: bemhtmllint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Sergej Tatarincev <s.tatarincev at yandex.ua>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_bemhtml_bemhtmllint_checker')
+ finish
+endif
+
+let g:loaded_syntastic_bemhtml_bemhtmllint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function SyntaxCheckers_bemhtml_bemhtmllint_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+ let errorformat = '%f:%l:%c: %m'
+ return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'bemhtml',
+ \ 'name': 'bemhtmllint',
+ \ 'exec': 'bemhtml-lint' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/bro/bro.vim b/vim/bundle/syntastic/syntax_checkers/bro/bro.vim
new file mode 100644
index 0000000..cea441b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/bro/bro.vim
@@ -0,0 +1,58 @@
+"============================================================================
+"File: bro.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Justin Azoff <justin.azoff@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_bro_bro_checker')
+ finish
+endif
+let g:loaded_syntastic_bro_bro_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_bro_bro_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], '\m at or near "\zs[^"]\+\ze"')
+ return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : ''
+endfunction
+
+function! SyntaxCheckers_bro_bro_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+
+ if syntastic#util#system(self.getExecEscaped() . ' --help') !~# '--parse-only'
+ call self.log('unknown option "--parse-only"')
+ return 0
+ endif
+
+ return 1
+endfunction
+
+function! SyntaxCheckers_bro_bro_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_before': '--parse-only' })
+
+ "example: error in ./foo.bro, line 3: unknown identifier banana, at or near "banana"
+ let errorformat = '%t:%f:%l:%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'bro' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'bro',
+ \ 'name': 'bro'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/c/avrgcc.vim b/vim/bundle/syntastic/syntax_checkers/c/avrgcc.vim
new file mode 100644
index 0000000..0fbb984
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/c/avrgcc.vim
@@ -0,0 +1,57 @@
+"============================================================================
+"File: avrgcc.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Karel <karelishere at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_c_avrgcc_checker')
+ finish
+endif
+let g:loaded_syntastic_c_avrgcc_checker = 1
+
+if !exists('g:syntastic_avrgcc_config_file')
+ let g:syntastic_avrgcc_config_file = '.syntastic_avrgcc_config'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_c_avrgcc_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_before': syntastic#c#ReadConfig(g:syntastic_avrgcc_config_file),
+ \ 'args_after': '-x c -fsyntax-only' })
+
+ let errorformat =
+ \ '%-G%f:%s:,' .
+ \ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' .
+ \ '%-G%f:%l: %#error: %#for each function it appears%.%#,' .
+ \ '%-GIn file included%.%#,' .
+ \ '%-G %#from %f:%l\,,' .
+ \ '%f:%l:%c: %trror: %m,' .
+ \ '%f:%l:%c: %tarning: %m,' .
+ \ '%f:%l:%c: %m,' .
+ \ '%f:%l: %trror: %m,' .
+ \ '%f:%l: %tarning: %m,'.
+ \ '%f:%l: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['compressWhitespace'] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'c',
+ \ 'name': 'avrgcc',
+ \ 'exec': 'avr-gcc'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/c/checkpatch.vim b/vim/bundle/syntastic/syntax_checkers/c/checkpatch.vim
new file mode 100644
index 0000000..43b047c
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/c/checkpatch.vim
@@ -0,0 +1,60 @@
+"============================================================================
+"File: checkpatch.vim
+"Description: Syntax checking plugin for syntastic.vim using checkpatch.pl
+"Maintainer: Daniel Walker <dwalker at fifo99 dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_c_checkpatch_checker')
+ finish
+endif
+let g:loaded_syntastic_c_checkpatch_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_c_checkpatch_IsAvailable() dict
+ call syntastic#log#deprecationWarn('c_checker_checkpatch_location', 'c_checkpatch_exec')
+
+ if !exists('g:syntastic_c_checkpatch_exec') && !executable(self.getExec())
+ if executable('checkpatch')
+ let g:syntastic_c_checkpatch_exec = 'checkpatch'
+ elseif executable('./scripts/checkpatch.pl')
+ let g:syntastic_c_checkpatch_exec = fnamemodify('./scripts/checkpatch.pl', ':p')
+ elseif executable('./scripts/checkpatch')
+ let g:syntastic_c_checkpatch_exec = fnamemodify('./scripts/checkpatch', ':p')
+ endif
+ endif
+
+ call self.log('exec =', self.getExec())
+
+ return executable(self.getExec())
+endfunction
+
+function! SyntaxCheckers_c_checkpatch_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '--no-summary --no-tree --terse --file' })
+
+ let errorformat =
+ \ '%f:%l: %tARNING: %m,' .
+ \ '%f:%l: %tRROR: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 1],
+ \ 'subtype': 'Style' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'c',
+ \ 'name': 'checkpatch',
+ \ 'exec': 'checkpatch.pl'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/c/clang_check.vim b/vim/bundle/syntastic/syntax_checkers/c/clang_check.vim
new file mode 100644
index 0000000..4c3677a
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/c/clang_check.vim
@@ -0,0 +1,64 @@
+"============================================================================
+"File: clang_check.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Benjamin Bannier <bbannier at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_c_clang_check_checker')
+ finish
+endif
+let g:loaded_syntastic_c_clang_check_checker = 1
+
+if !exists('g:syntastic_clang_check_config_file')
+ let g:syntastic_clang_check_config_file = '.syntastic_clang_check_config'
+endif
+
+if !exists('g:syntastic_c_clang_check_sort')
+ let g:syntastic_c_clang_check_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_c_clang_check_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'post_args':
+ \ '-- ' .
+ \ syntastic#c#ReadConfig(g:syntastic_clang_check_config_file) . ' ' .
+ \ '-fshow-column ' .
+ \ '-fshow-source-location ' .
+ \ '-fno-caret-diagnostics ' .
+ \ '-fno-color-diagnostics ' .
+ \ '-fdiagnostics-format=clang' })
+
+ let errorformat =
+ \ '%E%f:%l:%c: fatal error: %m,' .
+ \ '%E%f:%l:%c: error: %m,' .
+ \ '%W%f:%l:%c: warning: %m,' .
+ \ '%-G%\m%\%%(LLVM ERROR:%\|No compilation database found%\)%\@!%.%#,' .
+ \ '%E%m'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env,
+ \ 'defaults': {'bufnr': bufnr('')},
+ \ 'returns': [0, 1] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'c',
+ \ 'name': 'clang_check',
+ \ 'exec': 'clang-check'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/c/clang_tidy.vim b/vim/bundle/syntastic/syntax_checkers/c/clang_tidy.vim
new file mode 100644
index 0000000..6d8cbfe
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/c/clang_tidy.vim
@@ -0,0 +1,64 @@
+"============================================================================
+"File: clang_tidy.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Benjamin Bannier <bbannier at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_c_clang_tidy_checker')
+ finish
+endif
+let g:loaded_syntastic_c_clang_tidy_checker = 1
+
+if !exists('g:syntastic_clang_tidy_config_file')
+ let g:syntastic_clang_tidy_config_file = '.syntastic_clang_tidy_config'
+endif
+
+if !exists('g:syntastic_c_clang_tidy_sort')
+ let g:syntastic_c_clang_tidy_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_c_clang_tidy_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'post_args':
+ \ '-- ' .
+ \ syntastic#c#ReadConfig(g:syntastic_clang_tidy_config_file) . ' ' .
+ \ '-fshow-column ' .
+ \ '-fshow-source-location ' .
+ \ '-fno-caret-diagnostics ' .
+ \ '-fno-color-diagnostics ' .
+ \ '-fdiagnostics-format=clang' })
+
+ let errorformat =
+ \ '%E%f:%l:%c: fatal error: %m,' .
+ \ '%E%f:%l:%c: error: %m,' .
+ \ '%W%f:%l:%c: warning: %m,' .
+ \ '%-G%\m%\%%(LLVM ERROR:%\|No compilation database found%\)%\@!%.%#,' .
+ \ '%E%m'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env,
+ \ 'defaults': {'bufnr': bufnr('')},
+ \ 'returns': [0, 1] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'c',
+ \ 'name': 'clang_tidy',
+ \ 'exec': 'clang-tidy'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/c/cppcheck.vim b/vim/bundle/syntastic/syntax_checkers/c/cppcheck.vim
new file mode 100644
index 0000000..cd802a8
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/c/cppcheck.vim
@@ -0,0 +1,62 @@
+"============================================================================
+"File: cppcheck.vim
+"Description: Syntax checking plugin for syntastic.vim using cppcheck.pl
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_c_cppcheck_checker')
+ finish
+endif
+let g:loaded_syntastic_c_cppcheck_checker = 1
+
+if !exists('g:syntastic_cppcheck_config_file')
+ let g:syntastic_cppcheck_config_file = '.syntastic_cppcheck_config'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_c_cppcheck_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args': syntastic#c#ReadConfig(g:syntastic_cppcheck_config_file),
+ \ 'args_after': '-q --enable=style' })
+
+ let errorformat =
+ \ '[%f:%l]: (%trror) %m,' .
+ \ '[%f:%l]: (%tarning) %m,' .
+ \ '[%f:%l]: (%ttyle) %m,' .
+ \ '[%f:%l]: (%terformance) %m,' .
+ \ '[%f:%l]: (%tortability) %m,' .
+ \ '[%f:%l]: (%tnformation) %m,' .
+ \ '[%f:%l]: (%tnconclusive) %m,' .
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'cppcheck',
+ \ 'returns': [0] })
+
+ for e in loclist
+ if e['type'] =~? '\m^[SPI]'
+ let e['type'] = 'w'
+ let e['subtype'] = 'Style'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'c',
+ \ 'name': 'cppcheck'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/c/gcc.vim b/vim/bundle/syntastic/syntax_checkers/c/gcc.vim
new file mode 100644
index 0000000..4fa9216
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/c/gcc.vim
@@ -0,0 +1,59 @@
+"============================================================================
+"File: c.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_c_gcc_checker')
+ finish
+endif
+let g:loaded_syntastic_c_gcc_checker = 1
+
+if !exists('g:syntastic_c_compiler_options')
+ let g:syntastic_c_compiler_options = '-std=gnu99'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_c_gcc_IsAvailable() dict
+ if !exists('g:syntastic_c_compiler')
+ let g:syntastic_c_compiler = executable(self.getExec()) ? self.getExec() : 'clang'
+ endif
+ call self.log('g:syntastic_c_compiler =', g:syntastic_c_compiler)
+ return executable(expand(g:syntastic_c_compiler, 1))
+endfunction
+
+function! SyntaxCheckers_c_gcc_GetLocList() dict
+ return syntastic#c#GetLocList('c', 'gcc', {
+ \ 'errorformat':
+ \ '%-G%f:%s:,' .
+ \ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' .
+ \ '%-G%f:%l: %#error: %#for each function it appears%.%#,' .
+ \ '%-GIn file included%.%#,' .
+ \ '%-G %#from %f:%l\,,' .
+ \ '%f:%l:%c: %trror: %m,' .
+ \ '%f:%l:%c: %tarning: %m,' .
+ \ '%f:%l:%c: %m,' .
+ \ '%f:%l: %trror: %m,' .
+ \ '%f:%l: %tarning: %m,'.
+ \ '%f:%l: %m',
+ \ 'main_flags': '-x c -fsyntax-only',
+ \ 'header_flags': '-x c',
+ \ 'header_names': '\m\.h$' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'c',
+ \ 'name': 'gcc' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/c/make.vim b/vim/bundle/syntastic/syntax_checkers/c/make.vim
new file mode 100644
index 0000000..e477994
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/c/make.vim
@@ -0,0 +1,61 @@
+"============================================================================
+"File: make.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_c_make_checker')
+ finish
+endif
+let g:loaded_syntastic_c_make_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_c_make_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args': '-sk', 'fname': '' })
+
+ let errorformat =
+ \ '%-G%f:%s:,' .
+ \ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' .
+ \ '%-G%f:%l: %#error: %#for each function it appears%.%#,' .
+ \ '%-GIn file included%.%#,' .
+ \ '%-G %#from %f:%l\,,' .
+ \ '%f:%l:%c: %trror: %m,' .
+ \ '%f:%l:%c: %tarning: %m,' .
+ \ '%f:%l:%c: %m,' .
+ \ '%f:%l: %trror: %m,' .
+ \ '%f:%l: %tarning: %m,'.
+ \ '%f:%l: %m'
+
+ if exists('g:syntastic_c_errorformat')
+ let errorformat = g:syntastic_c_errorformat
+ endif
+
+ " process makeprg
+ let errors = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+
+ " filter the processed errors if desired
+ if exists('g:syntastic_c_remove_include_errors') && g:syntastic_c_remove_include_errors != 0
+ return filter(errors, 'has_key(v:val, "bufnr") && v:val["bufnr"] == ' . bufnr(''))
+ else
+ return errors
+ endif
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'c',
+ \ 'name': 'make'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/c/oclint.vim b/vim/bundle/syntastic/syntax_checkers/c/oclint.vim
new file mode 100644
index 0000000..f172a11
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/c/oclint.vim
@@ -0,0 +1,65 @@
+"============================================================================
+"File: oclint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: "UnCO" Lin <undercooled aT lavabit com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_c_oclint_checker')
+ finish
+endif
+let g:loaded_syntastic_c_oclint_checker = 1
+
+if !exists('g:syntastic_oclint_config_file')
+ let g:syntastic_oclint_config_file = '.syntastic_oclint_config'
+endif
+
+if !exists('g:syntastic_c_oclint_sort')
+ let g:syntastic_c_oclint_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_c_oclint_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'post_args': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file) })
+
+ let errorformat =
+ \ '%E%f:%l:%c: fatal error: %m,' .
+ \ '%E%f:%l:%c: error: %m,' .
+ \ '%W%f:%l:%c: warning: %m,' .
+ \ '%E%f:%l:%c: %m,' .
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'postprocess': ['compressWhitespace'],
+ \ 'returns': [0, 3, 5] })
+
+ for e in loclist
+ if e['text'] =~# '\v P3( |$)'
+ let e['type'] = 'W'
+ endif
+
+ let e['text'] = substitute(e['text'], '\m\C P[1-3]$', '', '')
+ let e['text'] = substitute(e['text'], '\m\C P[1-3] ', ': ', '')
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'c',
+ \ 'name': 'oclint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/c/pc_lint.vim b/vim/bundle/syntastic/syntax_checkers/c/pc_lint.vim
new file mode 100644
index 0000000..6efd17a
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/c/pc_lint.vim
@@ -0,0 +1,66 @@
+"============================================================================
+"File: pc_lint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Steve Bragg <steve at empresseffects dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_c_pc_lint_checker')
+ finish
+endif
+let g:loaded_syntastic_c_pc_lint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+if !exists('g:syntastic_pc_lint_config_file')
+ let g:syntastic_pc_lint_config_file = 'options.lnt'
+endif
+
+function! SyntaxCheckers_c_pc_lint_GetLocList() dict
+ let config = syntastic#util#findFileInParent(g:syntastic_pc_lint_config_file, expand('%:p:h', 1))
+ call self.log('config =', config)
+
+ " -hFs1 - show filename, add space after messages, try to make message 1 line
+ " -width(0,0) - make sure there are no line breaks
+ " -t - set tab size
+ " -v - turn off verbosity
+ let makeprg = self.makeprgBuild({
+ \ 'args': (filereadable(config) ? syntastic#util#shescape(fnamemodify(config, ':p')) : ''),
+ \ 'args_after': ['-hFs1', '-width(0,0)', '-t' . &tabstop, '-format=%f:%l:%C:%t:%n:%m'] })
+
+ let errorformat =
+ \ '%E%f:%l:%v:Error:%n:%m,' .
+ \ '%W%f:%l:%v:Warning:%n:%m,' .
+ \ '%I%f:%l:%v:Info:%n:%m,' .
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['cygwinRemoveCR'] })
+
+ for e in loclist
+ if e['type'] ==? 'I'
+ let e['type'] = 'W'
+ let e['subtype'] = 'Style'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'c',
+ \ 'name': 'pc_lint',
+ \ 'exec': 'lint-nt'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/c/sparse.vim b/vim/bundle/syntastic/syntax_checkers/c/sparse.vim
new file mode 100644
index 0000000..ca831c0
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/c/sparse.vim
@@ -0,0 +1,48 @@
+"============================================================================
+"File: sparse.vim
+"Description: Syntax checking plugin for syntastic.vim using sparse.pl
+"Maintainer: Daniel Walker <dwalker at fifo99 dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_c_sparse_checker')
+ finish
+endif
+let g:loaded_syntastic_c_sparse_checker = 1
+
+if !exists('g:syntastic_sparse_config_file')
+ let g:syntastic_sparse_config_file = '.syntastic_sparse_config'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_c_sparse_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args': syntastic#c#ReadConfig(g:syntastic_sparse_config_file),
+ \ 'args_after': '-ftabstop=' . &ts })
+
+ let errorformat =
+ \ '%f:%l:%v: %trror: %m,' .
+ \ '%f:%l:%v: %tarning: %m,'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')},
+ \ 'returns': [0, 1] })
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'c',
+ \ 'name': 'sparse'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/c/splint.vim b/vim/bundle/syntastic/syntax_checkers/c/splint.vim
new file mode 100644
index 0000000..a4e19f0
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/c/splint.vim
@@ -0,0 +1,55 @@
+"============================================================================
+"File: splint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_c_splint_checker')
+ finish
+endif
+let g:loaded_syntastic_c_splint_checker = 1
+
+if !exists('g:syntastic_splint_config_file')
+ let g:syntastic_splint_config_file = '.syntastic_splint_config'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_c_splint_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args': syntastic#c#ReadConfig(g:syntastic_splint_config_file),
+ \ 'args_after': '-showfunc -hints +quiet' })
+
+ let errorformat =
+ \ '%-G%f:%l:%v: %[%#]%[%#]%[%#] Internal Bug %.%#,' .
+ \ '%-G%f(%l\,%v): %[%#]%[%#]%[%#] Internal Bug %.%#,' .
+ \ '%W%f:%l:%v: %m,' .
+ \ '%W%f(%l\,%v): %m,' .
+ \ '%W%f:%l: %m,' .
+ \ '%W%f(%l): %m,' .
+ \ '%-C %\+In file included from %.%#,' .
+ \ '%-C %\+from %.%#,' .
+ \ '%+C %.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'postprocess': ['compressWhitespace'],
+ \ 'defaults': {'type': 'W'} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'c',
+ \ 'name': 'splint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/cabal/cabal.vim b/vim/bundle/syntastic/syntax_checkers/cabal/cabal.vim
new file mode 100644
index 0000000..e43aefa
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/cabal/cabal.vim
@@ -0,0 +1,55 @@
+"============================================================================
+"File: cabal.vim
+"Description: Haskell package description (.cabal file) linting and syntax
+" validation via 'cabal check'
+"Maintainer: Ian D. Bollinger <ian.bollinger@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_cabal_cabal_checker')
+ finish
+endif
+let g:loaded_syntastic_cabal_cabal_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_cabal_cabal_GetHighlightRegex(item)
+ let field = matchstr(a:item['text'], "\\vParse of field '\\zs[^']+")
+ if field !=# ''
+ return '\v\c^\s*' . field . '\s*:\s*\zs.*$'
+ endif
+ let field = matchstr(a:item['text'], "\\v(^|\\s)'\\zs[^']+\\ze'")
+ if field !=# ''
+ return '\V\c\<' . escape(field, '\') . '\>'
+ endif
+ return ''
+endfunction
+
+function! SyntaxCheckers_cabal_cabal_GetLocList() dict
+ let makeprg = self.getExecEscaped() . ' check'
+
+ let errorformat =
+ \ '%Ecabal: %f:%l: %m,' .
+ \ '%W* %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'cwd': expand('%:p:h', 1),
+ \ 'preprocess': 'cabal',
+ \ 'defaults': {'bufnr': bufnr('')} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'cabal',
+ \ 'name': 'cabal'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/chef/foodcritic.vim b/vim/bundle/syntastic/syntax_checkers/chef/foodcritic.vim
new file mode 100644
index 0000000..84d9af1
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/chef/foodcritic.vim
@@ -0,0 +1,39 @@
+"============================================================================
+"File: foodcritic.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Doug Ireton <dougireton@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_chef_foodcritic_checker')
+ finish
+endif
+let g:loaded_syntastic_chef_foodcritic_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_chef_foodcritic_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ " FC023: Prefer conditional attributes: ./recipes/config.rb:49
+ let errorformat = 'FC%n: %m: %f:%l'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'chef',
+ \ 'name': 'foodcritic'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/co/coco.vim b/vim/bundle/syntastic/syntax_checkers/co/coco.vim
new file mode 100644
index 0000000..9be5d7d
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/co/coco.vim
@@ -0,0 +1,47 @@
+"============================================================================
+"File: co.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Andrew Kelley <superjoe30@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_co_coco_checker')
+ finish
+endif
+let g:loaded_syntastic_co_coco_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_co_coco_GetLocList() dict
+ let tmpdir = syntastic#util#tmpdir()
+ let makeprg = self.makeprgBuild({ 'args_after': '-c -o ' . tmpdir })
+
+ let errorformat =
+ \ '%EFailed at: %f,' .
+ \ '%ZSyntax%trror: %m on line %l,'.
+ \ '%EFailed at: %f,'.
+ \ '%Z%trror: Parse error on line %l: %m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+
+ call syntastic#util#rmrf(tmpdir)
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'co',
+ \ 'name': 'coco'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/cobol/cobc.vim b/vim/bundle/syntastic/syntax_checkers/cobol/cobc.vim
new file mode 100644
index 0000000..0cff0cc
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/cobol/cobc.vim
@@ -0,0 +1,47 @@
+"============================================================================
+"File: cobc.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+
+if exists('g:loaded_syntastic_cobol_cobc_checker')
+ finish
+endif
+let g:loaded_syntastic_cobol_cobc_checker = 1
+
+if !exists('g:syntastic_cobol_compiler_options')
+ let g:syntastic_cobol_compiler_options = ''
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_cobol_cobc_IsAvailable() dict
+ if !exists('g:syntastic_cobol_compiler')
+ let g:syntastic_cobol_compiler = self.getExec()
+ endif
+ call self.log('g:syntastic_cobol_compiler =', g:syntastic_cobol_compiler)
+ return executable(expand(g:syntastic_cobol_compiler, 1))
+endfunction
+
+function! SyntaxCheckers_cobol_cobc_GetLocList() dict
+ return syntastic#c#GetLocList('cobol', 'cobc', {
+ \ 'errorformat': '%f:%l: %trror: %m',
+ \ 'main_flags': '-fsyntax-only' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'cobol',
+ \ 'name': 'cobc' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/coffee/coffee.vim b/vim/bundle/syntastic/syntax_checkers/coffee/coffee.vim
new file mode 100644
index 0000000..3b521fc
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/coffee/coffee.vim
@@ -0,0 +1,58 @@
+"============================================================================
+"File: coffee.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Lincoln Stoll <l@lds.li>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+"
+" Note: this script requires CoffeeScript version 1.6.2 or newer.
+"
+
+if exists('g:loaded_syntastic_coffee_coffee_checker')
+ finish
+endif
+let g:loaded_syntastic_coffee_coffee_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_coffee_coffee_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ let ver = self.getVersion(self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull())
+ return syntastic#util#versionIsAtLeast(ver, [1, 6, 2])
+endfunction
+
+function! SyntaxCheckers_coffee_coffee_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-cp' })
+
+ let errorformat =
+ \ '%E%f:%l:%c: %trror: %m,' .
+ \ 'Syntax%trror: In %f\, %m on line %l,' .
+ \ '%EError: In %f\, Parse error on line %l: %m,' .
+ \ '%EError: In %f\, %m on line %l,' .
+ \ '%W%f(%l): lint warning: %m,' .
+ \ '%W%f(%l): warning: %m,' .
+ \ '%E%f(%l): SyntaxError: %m,' .
+ \ '%-Z%p^,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'coffee',
+ \ 'name': 'coffee'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/coffee/coffeelint.vim b/vim/bundle/syntastic/syntax_checkers/coffee/coffeelint.vim
new file mode 100644
index 0000000..befdbc8
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/coffee/coffeelint.vim
@@ -0,0 +1,44 @@
+"============================================================================
+"File: coffeelint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Lincoln Stoll <l@lds.li>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_coffee_coffeelint_checker')
+ finish
+endif
+let g:loaded_syntastic_coffee_coffeelint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_coffee_coffeelint_GetLocList() dict
+ if !exists('s:coffeelint_new')
+ let s:coffeelint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1, 4])
+ endif
+ let makeprg = self.makeprgBuild({ 'args_after': (s:coffeelint_new ? '--reporter csv' : '--csv') })
+
+ let errorformat = '%f:%l:%t:%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'returns': [0, 1],
+ \ 'preprocess': 'coffeelint' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'coffee',
+ \ 'name': 'coffeelint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/coq/coqtop.vim b/vim/bundle/syntastic/syntax_checkers/coq/coqtop.vim
new file mode 100644
index 0000000..6385554
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/coq/coqtop.vim
@@ -0,0 +1,40 @@
+"============================================================================
+"File: coqtop.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Matvey Aksenov <matvey.aksenov at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_coq_coqtop_checker')
+ finish
+endif
+let g:loaded_syntastic_coq_coqtop_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_coq_coqtop_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-noglob -batch -load-vernac-source' })
+
+ let errorformat =
+ \ '%AFile "%f"\, line %l\, characters %c-%.%#\:,'.
+ \ '%C%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'coq',
+ \ 'name': 'coqtop'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/clang_check.vim b/vim/bundle/syntastic/syntax_checkers/cpp/clang_check.vim
new file mode 100644
index 0000000..cf9ec0c
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/cpp/clang_check.vim
@@ -0,0 +1,22 @@
+"============================================================================
+"File: clang_check.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Benjamin Bannier <bbannier at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_cpp_clang_check_checker')
+ finish
+endif
+let g:loaded_syntastic_cpp_clang_check_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'cpp',
+ \ 'name': 'clang_check',
+ \ 'redirect': 'c/clang_check'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/clang_tidy.vim b/vim/bundle/syntastic/syntax_checkers/cpp/clang_tidy.vim
new file mode 100644
index 0000000..770d1f6
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/cpp/clang_tidy.vim
@@ -0,0 +1,22 @@
+"============================================================================
+"File: clang_tidy.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Benjamin Bannier <bbannier at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_cpp_clang_tidy_checker')
+ finish
+endif
+let g:loaded_syntastic_cpp_clang_tidy_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'cpp',
+ \ 'name': 'clang_tidy',
+ \ 'redirect': 'c/clang_tidy'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/cppcheck.vim b/vim/bundle/syntastic/syntax_checkers/cpp/cppcheck.vim
new file mode 100644
index 0000000..4e0eb86
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/cpp/cppcheck.vim
@@ -0,0 +1,22 @@
+"============================================================================
+"File: cppcheck.vim
+"Description: Syntax checking plugin for syntastic.vim using cppcheck.pl
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_cpp_cppcheck_checker')
+ finish
+endif
+let g:loaded_syntastic_cpp_cppcheck_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'cpp',
+ \ 'name': 'cppcheck',
+ \ 'redirect': 'c/cppcheck'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/cpplint.vim b/vim/bundle/syntastic/syntax_checkers/cpp/cpplint.vim
new file mode 100644
index 0000000..54984bb
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/cpp/cpplint.vim
@@ -0,0 +1,52 @@
+"============================================================================
+"File: cpplint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_cpp_cpplint_checker')
+ finish
+endif
+let g:loaded_syntastic_cpp_cpplint_checker = 1
+
+if !exists('g:syntastic_cpp_cpplint_thres')
+ let g:syntastic_cpp_cpplint_thres = 5
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_cpp_cpplint_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args': '--verbose=3' })
+
+ let errorformat = '%A%f:%l: %m [%t],%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'returns': [0, 1] })
+
+ " change error types according to the prescribed threshold
+ for e in loclist
+ let e['type'] = e['type'] < g:syntastic_cpp_cpplint_thres ? 'W' : 'E'
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'cpp',
+ \ 'name': 'cpplint',
+ \ 'exec': 'cpplint.py'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/gcc.vim b/vim/bundle/syntastic/syntax_checkers/cpp/gcc.vim
new file mode 100644
index 0000000..1243980
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/cpp/gcc.vim
@@ -0,0 +1,56 @@
+"============================================================================
+"File: cpp.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_cpp_gcc_checker')
+ finish
+endif
+let g:loaded_syntastic_cpp_gcc_checker = 1
+
+if !exists('g:syntastic_cpp_compiler_options')
+ let g:syntastic_cpp_compiler_options = ''
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_cpp_gcc_IsAvailable() dict
+ if !exists('g:syntastic_cpp_compiler')
+ let g:syntastic_cpp_compiler = executable(self.getExec()) ? self.getExec() : 'clang++'
+ endif
+ call self.log('g:syntastic_cpp_compiler =', g:syntastic_cpp_compiler)
+ return executable(expand(g:syntastic_cpp_compiler, 1))
+endfunction
+
+function! SyntaxCheckers_cpp_gcc_GetLocList() dict
+ return syntastic#c#GetLocList('cpp', 'gcc', {
+ \ 'errorformat':
+ \ '%-G%f:%s:,' .
+ \ '%f:%l:%c: %trror: %m,' .
+ \ '%f:%l:%c: %tarning: %m,' .
+ \ '%f:%l:%c: %m,'.
+ \ '%f:%l: %trror: %m,'.
+ \ '%f:%l: %tarning: %m,'.
+ \ '%f:%l: %m',
+ \ 'main_flags': '-x c++ -fsyntax-only',
+ \ 'header_flags': '-x c++',
+ \ 'header_names': '\m\.\(h\|hpp\|hh\)$' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'cpp',
+ \ 'name': 'gcc',
+ \ 'exec': 'g++' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/oclint.vim b/vim/bundle/syntastic/syntax_checkers/cpp/oclint.vim
new file mode 100644
index 0000000..8217769
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/cpp/oclint.vim
@@ -0,0 +1,22 @@
+"============================================================================
+"File: oclint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: "UnCO" Lin <undercooled aT lavabit com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_cpp_oclint_checker')
+ finish
+endif
+let g:loaded_syntastic_cpp_oclint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'cpp',
+ \ 'name': 'oclint',
+ \ 'redirect': 'c/oclint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/pc_lint.vim b/vim/bundle/syntastic/syntax_checkers/cpp/pc_lint.vim
new file mode 100644
index 0000000..a7c95e8
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/cpp/pc_lint.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: pc_lint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Steve Bragg <steve at empresseffects dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_cpp_pc_lint_checker')
+ finish
+endif
+let g:loaded_syntastic_cpp_pc_lint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'cpp',
+ \ 'name': 'pc_lint',
+ \ 'redirect': 'c/pc_lint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/cpp/verapp.vim b/vim/bundle/syntastic/syntax_checkers/cpp/verapp.vim
new file mode 100644
index 0000000..af1fd8c
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/cpp/verapp.vim
@@ -0,0 +1,48 @@
+"============================================================================
+"File: verapp.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Lucas Verney <phyks@phyks.me>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+" Tested with Vera++ 1.3.0
+"============================================================================
+
+if exists('g:loaded_syntastic_cpp_verapp_checker')
+ finish
+endif
+let g:loaded_syntastic_cpp_verapp_checker = 1
+
+if !exists('g:syntastic_verapp_config_file')
+ let g:syntastic_verapp_config_file = '.syntastic_verapp_config'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_cpp_verapp_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args': syntastic#c#ReadConfig(g:syntastic_verapp_config_file),
+ \ 'args_after': '--show-rule --no-duplicate -S -c -' })
+
+ let errorformat = '%f:%t:%l:%c:%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'checkstyle',
+ \ 'subtype': 'Style' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'cpp',
+ \ 'name': 'verapp',
+ \ 'exec': 'vera++'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/cs/mcs.vim b/vim/bundle/syntastic/syntax_checkers/cs/mcs.vim
new file mode 100644
index 0000000..4544a93
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/cs/mcs.vim
@@ -0,0 +1,39 @@
+"============================================================================
+"File: cs.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Daniel Walker <dwalker@fifo99.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_cs_mcs_checker')
+ finish
+endif
+let g:loaded_syntastic_cs_mcs_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_cs_mcs_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '--parse' })
+
+ let errorformat = '%f(%l\,%c): %trror %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'cs',
+ \ 'name': 'mcs'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/css/csslint.vim b/vim/bundle/syntastic/syntax_checkers/css/csslint.vim
new file mode 100644
index 0000000..2d3702b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/css/csslint.vim
@@ -0,0 +1,47 @@
+"============================================================================
+"File: css.vim
+"Description: Syntax checking plugin for syntastic.vim using `csslint` CLI tool (http://csslint.net).
+"Maintainer: Ory Band <oryband at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_css_csslint_checker')
+ finish
+endif
+let g:loaded_syntastic_css_csslint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_css_csslint_GetLocList() dict
+ call syntastic#log#deprecationWarn('csslint_options', 'css_csslint_args')
+
+ let makeprg = self.makeprgBuild({ 'args_after': '--format=compact' })
+
+ " Print CSS Lint's error/warning messages from compact format. Ignores blank lines.
+ let errorformat =
+ \ '%-G,' .
+ \ '%-G%f: lint free!,' .
+ \ '%f: line %l\, col %c\, %trror - %m,' .
+ \ '%f: line %l\, col %c\, %tarning - %m,'.
+ \ '%f: line %l\, col %c\, %m,'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')} })
+
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'css',
+ \ 'name': 'csslint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/css/mixedindentlint.vim b/vim/bundle/syntastic/syntax_checkers/css/mixedindentlint.vim
new file mode 100644
index 0000000..a0ce3ba
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/css/mixedindentlint.vim
@@ -0,0 +1,22 @@
+"============================================================================
+"File: mixedindentlint.vim
+"Description: Mixed indentation linter for vim
+"Maintainer: Payton Swick <payton@foolord.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_css_mixedindentlint_checker')
+ finish
+endif
+let g:loaded_syntastic_css_mixedindentlint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'css',
+ \ 'name': 'mixedindentlint',
+ \ 'redirect': 'javascript/mixedindentlint'})
+
+" vim: set et sts=4 sw=4:
diff --git a/vim/bundle/syntastic/syntax_checkers/css/phpcs.vim b/vim/bundle/syntastic/syntax_checkers/css/phpcs.vim
new file mode 100644
index 0000000..a065f0e
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/css/phpcs.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: phpcs.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_css_phpcs_checker')
+ finish
+endif
+let g:loaded_syntastic_css_phpcs_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'css',
+ \ 'name': 'phpcs',
+ \ 'redirect': 'php/phpcs'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/css/prettycss.vim b/vim/bundle/syntastic/syntax_checkers/css/prettycss.vim
new file mode 100644
index 0000000..b531f49
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/css/prettycss.vim
@@ -0,0 +1,61 @@
+"============================================================================
+"File: prettycss.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_css_prettycss_checker')
+ finish
+endif
+let g:loaded_syntastic_css_prettycss_checker = 1
+
+if !exists('g:syntastic_css_prettycss_sort')
+ let g:syntastic_css_prettycss_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_css_prettycss_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], '\m (\zs[^)]\+\ze)$')
+ if term !=# ''
+ let term = '\V' . escape(term, '\')
+ endif
+ return term
+endfunction
+
+function! SyntaxCheckers_css_prettycss_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ " Print CSS Lint's error/warning messages from compact format. Ignores blank lines.
+ let errorformat =
+ \ '%EError: %m\, line %l\, char %c),' .
+ \ '%WWarning: %m\, line %l\, char %c),' .
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')} })
+
+ for e in loclist
+ let e['text'] .= ')'
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'css',
+ \ 'name': 'prettycss'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/css/recess.vim b/vim/bundle/syntastic/syntax_checkers/css/recess.vim
new file mode 100644
index 0000000..ce6d5ae
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/css/recess.vim
@@ -0,0 +1,24 @@
+"============================================================================
+"File: recess.vim
+"Description: Syntax checking plugin for syntastic.vim using `recess`
+" (http://twitter.github.io/recess/).
+"Maintainer: Tim Carry <tim at pixelastic dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_css_recess_checker')
+ finish
+endif
+let g:loaded_syntastic_css_recess_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'css',
+ \ 'name': 'recess',
+ \ 'redirect': 'less/recess'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/css/stylelint.vim b/vim/bundle/syntastic/syntax_checkers/css/stylelint.vim
new file mode 100644
index 0000000..58c7dec
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/css/stylelint.vim
@@ -0,0 +1,47 @@
+"============================================================================
+"File: stylelint.vim
+"Description: Syntax checking plugin for syntastic.vim using `stylelint`
+" (https://github.com/stylelint/stylelint).
+"Maintainer: Tim Carry <tim at pixelastic dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_css_stylelint_checker')
+ finish
+endif
+let g:loaded_syntastic_css_stylelint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+let s:args_after = {
+ \ 'css': '-f json',
+ \ 'scss': '-f json -s scss' }
+
+function! SyntaxCheckers_css_stylelint_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': get(s:args_after, self.getFiletype(), '') })
+
+ let errorformat = '%t:%f:%l:%c:%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'preprocess': 'stylelint',
+ \ 'returns': [0, 1, 2] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'css',
+ \ 'name': 'stylelint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
+
diff --git a/vim/bundle/syntastic/syntax_checkers/cucumber/cucumber.vim b/vim/bundle/syntastic/syntax_checkers/cucumber/cucumber.vim
new file mode 100644
index 0000000..8a48690
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/cucumber/cucumber.vim
@@ -0,0 +1,42 @@
+"============================================================================
+"File: cucumber.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_cucumber_cucumber_checker')
+ finish
+endif
+let g:loaded_syntastic_cucumber_cucumber_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_cucumber_cucumber_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '--dry-run --quiet --strict --format pretty' })
+
+ let errorformat =
+ \ '%f:%l:%c:%m,' .
+ \ '%W %.%# (%m),' .
+ \ '%-Z%f:%l:%.%#,'.
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'cucumber',
+ \ 'name': 'cucumber'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/cuda/nvcc.vim b/vim/bundle/syntastic/syntax_checkers/cuda/nvcc.vim
new file mode 100644
index 0000000..3476039
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/cuda/nvcc.vim
@@ -0,0 +1,81 @@
+"============================================================================
+"File: cuda.vim
+"Description: Syntax checking plugin for syntastic
+"Author: Hannes Schulz <schulz at ais dot uni-bonn dot de>
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_cuda_nvcc_checker')
+ finish
+endif
+let g:loaded_syntastic_cuda_nvcc_checker = 1
+
+if !exists('g:syntastic_cuda_config_file')
+ let g:syntastic_cuda_config_file = '.syntastic_cuda_config'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_cuda_nvcc_GetLocList() dict
+ let arch_flag = syntastic#util#var('cuda_arch')
+ if arch_flag !=# ''
+ let arch_flag = '-arch=' . arch_flag
+ call syntastic#log#oneTimeWarn('variable g:syntastic_cuda_arch is deprecated, ' .
+ \ 'please add ' . string(arch_flag) . ' to g:syntastic_cuda_nvcc_args instead')
+ endif
+
+ let build_opts = {}
+ let dummy = ''
+ if index(['h', 'hpp', 'cuh'], expand('%:e', 1), 0, 1) >= 0
+ if syntastic#util#var('cuda_check_header', 0)
+ let dummy = expand('%:p:h', 1) . syntastic#util#Slash() . '.syntastic_dummy.cu'
+ let build_opts = {
+ \ 'exe_before': 'echo > ' . syntastic#util#shescape(dummy) . ' ;',
+ \ 'fname_before': '.syntastic_dummy.cu -include' }
+ else
+ return []
+ endif
+ endif
+
+ call extend(build_opts, {
+ \ 'args_before': arch_flag . ' --cuda -O0 -I .',
+ \ 'args': syntastic#c#ReadConfig(g:syntastic_cuda_config_file),
+ \ 'args_after': '-Xcompiler -fsyntax-only',
+ \ 'tail_after': syntastic#c#NullOutput() })
+
+ let makeprg = self.makeprgBuild(build_opts)
+
+ let errorformat =
+ \ '%*[^"]"%f"%*\D%l: %m,'.
+ \ '"%f"%*\D%l: %m,'.
+ \ '%-G%f:%l: (Each undeclared identifier is reported only once,'.
+ \ '%-G%f:%l: for each function it appears in.),'.
+ \ '%f:%l:%c:%m,'.
+ \ '%f(%l):%m,'.
+ \ '%f:%l:%m,'.
+ \ '"%f"\, line %l%*\D%c%*[^ ] %m,'.
+ \ '%D%*\a[%*\d]: Entering directory `%f'','.
+ \ '%X%*\a[%*\d]: Leaving directory `%f'','.
+ \ '%D%*\a: Entering directory `%f'','.
+ \ '%X%*\a: Leaving directory `%f'','.
+ \ '%DMaking %*\a in %f,'.
+ \ '%f|%l| %m'
+
+ let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
+
+ if dummy !=# ''
+ call delete(dummy)
+ endif
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'cuda',
+ \ 'name': 'nvcc'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/d/dmd.vim b/vim/bundle/syntastic/syntax_checkers/d/dmd.vim
new file mode 100644
index 0000000..8897995
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/d/dmd.vim
@@ -0,0 +1,132 @@
+"============================================================================
+"File: d.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Alfredo Di Napoli <alfredo dot dinapoli at gmail dot com>
+"License: Based on the original work of Gregor Uhlenheuer and his
+" cpp.vim checker so credits are dued.
+" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+" HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+" OTHER DEALINGS IN THE SOFTWARE.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_d_dmd_checker')
+ finish
+endif
+let g:loaded_syntastic_d_dmd_checker = 1
+
+if !exists('g:syntastic_d_compiler_options')
+ let g:syntastic_d_compiler_options = ''
+endif
+
+if !exists('g:syntastic_d_use_dub')
+ let g:syntastic_d_use_dub = 1
+endif
+
+if !exists('g:syntastic_d_dub_exec')
+ let g:syntastic_d_dub_exec = 'dub'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_d_dmd_IsAvailable() dict " {{{1
+ if !exists('g:syntastic_d_compiler')
+ let g:syntastic_d_compiler = self.getExec()
+ endif
+ call self.log('g:syntastic_d_compiler =', g:syntastic_d_compiler)
+ return executable(expand(g:syntastic_d_compiler, 1))
+endfunction " }}}1
+
+function! SyntaxCheckers_d_dmd_GetLocList() dict " {{{1
+ if !exists('g:syntastic_d_include_dirs')
+ let g:syntastic_d_include_dirs = s:GetIncludes(self, expand('%:p:h'))
+ endif
+
+ return syntastic#c#GetLocList('d', 'dmd', {
+ \ 'errorformat':
+ \ '%-G%f:%s:,%f(%l): %m,' .
+ \ '%f:%l: %m',
+ \ 'main_flags': '-c -of' . syntastic#util#DevNull(),
+ \ 'header_names': '\m\.di$' })
+endfunction " }}}1
+
+" Utilities {{{1
+
+function! s:GetIncludes(checker, base) " {{{2
+ let includes = []
+
+ if g:syntastic_d_use_dub && !exists('s:dub_ok')
+ let s:dub_ok = s:ValidateDub(a:checker)
+ endif
+
+ if g:syntastic_d_use_dub && s:dub_ok
+ let where = escape(a:base, ' ') . ';'
+
+ let old_suffixesadd = &suffixesadd
+ let dirs = syntastic#util#unique(map(filter(
+ \ findfile('dub.json', where, -1) +
+ \ findfile('dub.sdl', where, -1) +
+ \ findfile('package.json', where, -1),
+ \ 'filereadable(v:val)'), 'fnamemodify(v:val, ":h")'))
+ let &suffixesadd = old_suffixesadd
+ call a:checker.log('using dub: looking for includes in', dirs)
+
+ for dir in dirs
+ try
+ execute 'silent lcd ' . fnameescape(dir)
+ let paths = split(syntastic#util#system(syntastic#util#shescape(g:syntastic_d_dub_exec) . ' describe --import-paths'), "\n")
+ silent lcd -
+ if v:shell_error == 0
+ call extend(includes, paths)
+ call a:checker.log('using dub: found includes', paths)
+ endif
+ catch /\m^Vim\%((\a\+)\)\=:E472/
+ " evil directory is evil
+ endtry
+ endfor
+ endif
+
+ if empty(includes)
+ let includes = filter(glob($HOME . '/.dub/packages/*', 1, 1), 'isdirectory(v:val)')
+ call map(includes, 'isdirectory(v:val . "/source") ? v:val . "/source" : v:val')
+ call add(includes, './source')
+ endif
+
+ return syntastic#util#unique(includes)
+endfunction " }}}2
+
+function! s:ValidateDub(checker) " {{{2
+ let ok = 0
+
+ if executable(g:syntastic_d_dub_exec)
+ let command = syntastic#util#shescape(g:syntastic_d_dub_exec) . ' --version'
+ let version_output = syntastic#util#system(command)
+ call a:checker.log('getVersion: ' . string(command) . ': ' .
+ \ string(split(version_output, "\n", 1)) .
+ \ (v:shell_error ? ' (exit code ' . v:shell_error . ')' : '') )
+ let parsed_ver = syntastic#util#parseVersion(version_output)
+ call a:checker.log(g:syntastic_d_dub_exec . ' version =', parsed_ver)
+ if len(parsed_ver)
+ let ok = syntastic#util#versionIsAtLeast(parsed_ver, [0, 9, 24])
+ endif
+ endif
+
+ return ok
+endfunction " }}}2
+
+" }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'd',
+ \ 'name': 'dmd' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/dart/dartanalyzer.vim b/vim/bundle/syntastic/syntax_checkers/dart/dartanalyzer.vim
new file mode 100644
index 0000000..63b8267
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/dart/dartanalyzer.vim
@@ -0,0 +1,76 @@
+"============================================================================
+"File: dartanalyzer.vim
+"Description: Dart syntax checker - using dartanalyzer
+"Maintainer: Maksim Ryzhikov <rv.maksim at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_dart_dartanalyzer_checker')
+ finish
+endif
+let g:loaded_syntastic_dart_dartanalyzer_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_dart_dartanalyzer_GetHighlightRegex(error)
+ if a:error['len']
+ let lcol = a:error['col'] - 1
+ let rcol = a:error['col'] + a:error['len']
+ let ret = '\%>' . lcol . 'c\%<' . rcol . 'c'
+ else
+ let ret = ''
+ endif
+
+ return ret
+endfunction
+
+function! SyntaxCheckers_dart_dartanalyzer_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '--machine' })
+
+ " Machine readable format looks like:
+ " SEVERITY|TYPE|ERROR_CODE|FILENAME|LINE_NUMBER|COLUMN|LENGTH|MESSAGE
+ " SEVERITY: (WARNING|ERROR)
+ " TYPE: (RESOLVER|STATIC_TYPE|...)
+ " ERROR_CODE: (NO_SUCH_TYPE|...)
+ " FILENAME: String
+ " LINE_NUMBER: int
+ " COLUMN: int
+ " LENGTH: int
+ " MESSAGE: String
+
+ " We use %n to grab the error length, for the syntax highlighter
+ let commonformat = '|%.%#|%.%#|%f|%l|%c|%n|%m'
+
+ let errorformat =
+ \ '%EERROR' . commonformat . ',' .
+ \ '%WWARNING' . commonformat
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 1, 2, 3] })
+
+ for e in loclist
+ let e['text'] = substitute(e['text'], '\m\\\([\\|]\)', '\1', 'g')
+
+ " Undo the %n hack
+ let e['len'] = e['nr']
+ call remove(e, 'nr')
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'dart',
+ \ 'name': 'dartanalyzer' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/docbk/igor.vim b/vim/bundle/syntastic/syntax_checkers/docbk/igor.vim
new file mode 100644
index 0000000..5448861
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/docbk/igor.vim
@@ -0,0 +1,55 @@
+"============================================================================
+"File: igor.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_docbk_igor_checker')
+ finish
+endif
+let g:loaded_syntastic_docbk_igor_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_docbk_igor_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat = '%f:%l:%m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': { 'type': 'W' },
+ \ 'subtype': 'Style',
+ \ 'returns': [0] })
+
+ let buf = bufnr('')
+ for e in loclist
+ " XXX: igor strips directories from filenames
+ let e['bufnr'] = buf
+
+ let e['hl'] = '\V' . escape( substitute(e['text'], '\m[^:]*:', '', ''), '\' )
+ let e['hl'] = substitute(e['hl'], '\V[', '\\zs', 'g')
+ let e['hl'] = substitute(e['hl'], '\V]', '\\ze', 'g')
+
+ " let e['text'] = substitute(e['text'], '\m:.*$', '', '')
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'docbk',
+ \ 'name': 'igor'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/docbk/xmllint.vim b/vim/bundle/syntastic/syntax_checkers/docbk/xmllint.vim
new file mode 100644
index 0000000..30d66d2
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/docbk/xmllint.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: docbk.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_docbk_xmllint_checker')
+ finish
+endif
+let g:loaded_syntastic_docbk_xmllint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'docbk',
+ \ 'name': 'xmllint',
+ \ 'redirect': 'xml/xmllint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/dockerfile/dockerfile_lint.vim b/vim/bundle/syntastic/syntax_checkers/dockerfile/dockerfile_lint.vim
new file mode 100644
index 0000000..3a5b769
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/dockerfile/dockerfile_lint.vim
@@ -0,0 +1,53 @@
+"============================================================================
+"File: dockerfile_lint.vim
+"Description: Syntax checking plugin for syntastic.vim using dockerfile-lint
+" (https://github.com/projectatomic/dockerfile-lint).
+"Maintainer: Tim Carry <tim at pixelastic dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_dockerfile_dockerfile_lint_checker')
+ finish
+endif
+let g:loaded_syntastic_dockerfile_dockerfile_lint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_dockerfile_dockerfile_lint_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '-j',
+ \ 'fname_before': '-f' })
+
+ let errorformat = '%t:%n:%l:%m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'dockerfile_lint',
+ \ 'defaults': {'bufnr': bufnr('')},
+ \ 'returns': [0, 1] })
+
+ for e in loclist
+ if e['nr']
+ let e['subtype'] = 'Style'
+ endif
+ call remove(e, 'nr')
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'dockerfile',
+ \ 'name': 'dockerfile_lint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/dustjs/swiffer.vim b/vim/bundle/syntastic/syntax_checkers/dustjs/swiffer.vim
new file mode 100644
index 0000000..8edf1d5
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/dustjs/swiffer.vim
@@ -0,0 +1,38 @@
+"============================================================================
+"File: swiffer.vim
+"Description: Dust.js syntax checker - using swiffer
+"Maintainer: Steven Foote <smfoote at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_dustjs_swiffer_checker')
+ finish
+endif
+
+let g:loaded_syntastic_dustjs_swiffer_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_dustjs_swiffer_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat = '%E%f - Line %l\, Column %c: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+ endfunction
+
+call SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'dustjs',
+ \ 'name': 'swiffer'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/elixir/elixir.vim b/vim/bundle/syntastic/syntax_checkers/elixir/elixir.vim
new file mode 100644
index 0000000..f2ffe67
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/elixir/elixir.vim
@@ -0,0 +1,56 @@
+"============================================================================
+"File: elixir.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Richard Ramsden <rramsden at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_elixir_elixir_checker')
+ finish
+endif
+let g:loaded_syntastic_elixir_elixir_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" TODO: we should probably split this into separate checkers
+function! SyntaxCheckers_elixir_elixir_IsAvailable() dict
+ call self.log(
+ \ 'executable("elixir") = ' . executable('elixir') . ', ' .
+ \ 'executable("mix") = ' . executable('mix'))
+ return executable('elixir') && executable('mix')
+endfunction
+
+function! SyntaxCheckers_elixir_elixir_GetLocList() dict
+ let make_options = {}
+ let compile_command = 'elixir'
+ let mix_file = syntastic#util#findFileInParent('mix.exs', expand('%:p:h', 1))
+
+ if filereadable(mix_file)
+ let compile_command = 'mix compile'
+ let make_options['cwd'] = fnamemodify(mix_file, ':p:h')
+ endif
+
+ let make_options['makeprg'] = self.makeprgBuild({ 'exe': compile_command })
+
+ let make_options['errorformat'] =
+ \ '%E** %*[^\ ] %f:%l: %m,' .
+ \ '%W%f:%l: warning: %m'
+
+ return SyntasticMake(make_options)
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'elixir',
+ \ 'name': 'elixir',
+ \ 'enable': 'enable_elixir_checker'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/erlang/erlang_check_file.erl b/vim/bundle/syntastic/syntax_checkers/erlang/erlang_check_file.erl
new file mode 100755
index 0000000..730e600
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/erlang/erlang_check_file.erl
@@ -0,0 +1,95 @@
+#!/usr/bin/env escript
+
+main([File]) ->
+ Dir = get_root(filename:dirname(File)),
+ Defs = [strong_validation,
+ warn_export_all,
+ warn_export_vars,
+ warn_shadow_vars,
+ warn_obsolete_guard,
+ warn_unused_import,
+ report,
+ {i, Dir ++ "/include"}],
+ %% `rebar.config` is looked for,
+ %% but it is not necessarily the one in the project root.
+ %% I.e. it may be one deeper in the project file hierarchy.
+ RebarFile = rebar_file(Dir),
+ %% `rebar.config` might contain relative paths.
+ %% They are relative to the file! Not to the project root.
+ RebarOpts = rebar_opts(Dir ++ "/" ++ RebarFile),
+ code:add_patha(filename:absname("ebin")),
+ %% `compile:file/2` requires the `{i, Path}` to be relative
+ %% to CWD - no surprise here.
+ compile:file(File, Defs ++ translate_paths(Dir, RebarOpts));
+
+main(_) ->
+ io:format("Usage: ~s <file>~n", [escript:script_name()]),
+ halt(1).
+
+rebar_file(Dir) ->
+ DirList = filename:split(Dir),
+ case lists:last(DirList) of
+ "test" ->
+ "rebar.test.config";
+ _ ->
+ "rebar.config"
+ end.
+
+rebar_opts(RebarFile) ->
+ Dir = get_root(filename:dirname(RebarFile)),
+ case file:consult(RebarFile) of
+ {ok, Terms} ->
+ RebarLibDirs = proplists:get_value(lib_dirs, Terms, []),
+ lists:foreach(
+ fun(LibDir) ->
+ code:add_pathsa(filelib:wildcard(LibDir ++ "/*/ebin"))
+ end, RebarLibDirs),
+ RebarDepsDir = proplists:get_value(deps_dir, Terms, "deps"),
+ code:add_pathsa(filelib:wildcard(RebarDepsDir ++ "/*/ebin")),
+ IncludeDeps = {i, filename:join(Dir, RebarDepsDir)},
+ proplists:get_value(erl_opts, Terms, []) ++ [IncludeDeps];
+ {error, _} when RebarFile == "rebar.config" ->
+ fallback_opts();
+ {error, _} ->
+ rebar_opts("rebar.config")
+ end.
+
+fallback_opts() ->
+ code:add_pathsa(filelib:wildcard("deps/*/ebin")),
+ code:add_pathsa(nested_app_ebins()),
+ [
+ { i, filename:absname("apps") }, { i, filename:absname("deps") } | [ { i, filename:absname(Path) } || Path <- filelib:wildcard("deps/*/apps")]
+ ].
+
+nested_app_ebins() ->
+ DetectedAppSrcFiles = filelib:wildcard("deps/*/apps/**/*.app.src"),
+ [apps_dir_from_src(AppSrcFile)||AppSrcFile<-DetectedAppSrcFiles].
+
+apps_dir_from_src(SrcFile) ->
+ SrcDir = filename:dirname(SrcFile),
+ filename:join(SrcDir, "../../ebin").
+
+get_root(Dir) ->
+ Path = filename:split(filename:absname(Dir)),
+ filename:join(get_root(lists:reverse(Path), Path)).
+
+get_root([], Path) ->
+ Path;
+get_root(["src" | Tail], _Path) ->
+ lists:reverse(Tail);
+get_root(["test" | Tail], _Path) ->
+ lists:reverse(Tail);
+get_root([_ | Tail], Path) ->
+ get_root(Tail, Path).
+
+translate_paths(Dir, RebarOpts) ->
+ [ translate_path(Dir, Opt) || Opt <- RebarOpts ].
+
+translate_path(Dir, {i, Path}) ->
+ case Path of
+ %% absolute
+ "/" ++ _ -> {i, Path};
+ %% relative -> make absolute taking rebar.config location into account
+ _ -> {i, filename:join([Dir, Path])}
+ end;
+translate_path(_, Other) -> Other.
diff --git a/vim/bundle/syntastic/syntax_checkers/erlang/escript.vim b/vim/bundle/syntastic/syntax_checkers/erlang/escript.vim
new file mode 100644
index 0000000..9fd869f
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/erlang/escript.vim
@@ -0,0 +1,61 @@
+"============================================================================
+"File: erlang.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Pawel Salata <rockplayer.pl at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_erlang_erlang_checker')
+ finish
+endif
+let g:loaded_syntastic_erlang_erlang_checker = 1
+
+if !exists('g:syntastic_erlc_include_path')
+ let g:syntastic_erlc_include_path = ''
+endif
+
+let s:check_file = syntastic#util#shescape(expand('<sfile>:p:h', 1) . syntastic#util#Slash() . 'erlang_check_file.erl')
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_erlang_escript_GetLocList() dict
+ if expand('%:e', 1) ==# 'hrl'
+ return []
+ endif
+
+ let shebang = syntastic#util#parseShebang()
+ if shebang['exe'] ==# 'escript'
+ let args = '-s'
+ let post_args = ''
+ else
+ let args = s:check_file
+ let post_args = g:syntastic_erlc_include_path
+ endif
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': args,
+ \ 'fname': syntastic#util#shexpand('%:p'),
+ \ 'post_args_after': post_args })
+
+ let errorformat =
+ \ '%W%f:%l: warning: %m,'.
+ \ '%E%f:%l: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'erlang',
+ \ 'name': 'escript'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/erlang/syntaxerl.vim b/vim/bundle/syntastic/syntax_checkers/erlang/syntaxerl.vim
new file mode 100644
index 0000000..45f4735
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/erlang/syntaxerl.vim
@@ -0,0 +1,42 @@
+"============================================================================
+"File: syntaxerl.vim
+"Description: Syntax checking plugin for syntastic.
+"Maintainer: locojay
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_erlang_syntaxerl_checker')
+ finish
+endif
+
+let g:loaded_syntastic_erlang_syntaxerl_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+function! SyntaxCheckers_erlang_syntaxerl_GetLocList() dict
+
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%W%f:%l: warning: %m,'.
+ \ '%E%f:%l: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'erlang',
+ \ 'name': 'syntaxerl'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/eruby/ruby.vim b/vim/bundle/syntastic/syntax_checkers/eruby/ruby.vim
new file mode 100644
index 0000000..16eed62
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/eruby/ruby.vim
@@ -0,0 +1,82 @@
+"============================================================================
+"File: ruby.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_eruby_ruby_checker')
+ finish
+endif
+let g:loaded_syntastic_eruby_ruby_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_eruby_ruby_IsAvailable() dict
+ if !exists('g:syntastic_eruby_ruby_exec') && exists('g:syntastic_ruby_exec')
+ let g:syntastic_eruby_ruby_exec = g:syntastic_ruby_exec
+ call self.log('g:syntastic_eruby_ruby_exec =', g:syntastic_eruby_ruby_exec)
+ endif
+ return executable(self.getExec())
+endfunction
+
+function! SyntaxCheckers_eruby_ruby_GetLocList() dict
+ if !exists('s:ruby_new')
+ let s:ruby_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1, 9])
+ endif
+
+ let fname = "'" . escape(expand('%', 1), "\\'") . "'"
+
+ " TODO: encodings became useful in ruby 1.9 :)
+ if s:ruby_new
+ let enc = &fileencoding !=# '' ? &fileencoding : &encoding
+ let encoding_spec = ', :encoding => "' . (enc ==? 'utf-8' ? 'UTF-8' : 'BINARY') . '"'
+ else
+ let encoding_spec = ''
+ endif
+
+ "gsub fixes issue #7, rails has it's own eruby syntax
+ let makeprg =
+ \ self.getExecEscaped() . ' -rerb -e ' .
+ \ syntastic#util#shescape('puts ERB.new(File.read(' .
+ \ fname . encoding_spec .
+ \ ').gsub(''<%='',''<%''), nil, ''-'').src') .
+ \ ' | ' . self.getExecEscaped() . ' -w -c'
+
+ let errorformat = '%-G%\m%.%#warning: %\%%(possibly %\)%\?useless use of a literal in void context,'
+
+ " filter out lines starting with ...
+ " long lines are truncated and wrapped in ... %p then returns the wrong
+ " column offset
+ let errorformat .= '%-G%\%.%\%.%\%.%.%#,'
+
+ let errorformat .=
+ \ '%-GSyntax OK,'.
+ \ '%E-:%l: syntax error\, %m,%Z%p^,'.
+ \ '%W-:%l: warning: %m,'.
+ \ '%Z%p^,'.
+ \ '%-C%.%#'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'RUBYOPT': '' }
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env,
+ \ 'defaults': { 'bufnr': bufnr(''), 'vcol': 1 } })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'eruby',
+ \ 'name': 'ruby'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/fortran/gfortran.vim b/vim/bundle/syntastic/syntax_checkers/fortran/gfortran.vim
new file mode 100644
index 0000000..fffaf30
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/fortran/gfortran.vim
@@ -0,0 +1,99 @@
+"============================================================================
+"File: fortran.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Karl Yngve Lervåg <karl.yngve@lervag.net>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_fortran_gfortran_checker')
+ finish
+endif
+let g:loaded_syntastic_fortran_gfortran_checker = 1
+
+if !exists('g:syntastic_fortran_compiler_options')
+ let g:syntastic_fortran_compiler_options = ''
+endif
+
+let s:type_map = {}
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_fortran_gfortran_IsAvailable() dict " {{{1
+ if !exists('g:syntastic_fortran_compiler')
+ let g:syntastic_fortran_compiler = self.getExec()
+ endif
+ call self.log('g:syntastic_fortran_compiler = ', g:syntastic_fortran_compiler)
+ return executable(expand(g:syntastic_fortran_compiler, 1))
+endfunction " }}}1
+
+" @vimlint(EVL104, 1, l:errorformat)
+function! SyntaxCheckers_fortran_gfortran_GetLocList() dict " {{{1
+ call s:SetCompilerType(g:syntastic_fortran_compiler)
+ if !has_key(s:type_map, g:syntastic_fortran_compiler)
+ call syntastic#log#error("checker fortran/gfortran: can't parse version string (abnormal termination?)")
+ return []
+ endif
+
+ if s:type_map[g:syntastic_fortran_compiler] ==# 'gfortran'
+ let errorformat =
+ \ '%-C %#,'.
+ \ '%-C %#%.%#,'.
+ \ '%A%f:%l%[.:]%c:,'.
+ \ '%Z%\m%\%%(Fatal %\)%\?%trror: %m,'.
+ \ '%Z%tarning: %m,'.
+ \ '%-G%.%#'
+ if !exists('g:syntastic_fortran_gfortran_sort')
+ let g:syntastic_fortran_gfortran_sort = 0
+ endif
+ elseif s:type_map[g:syntastic_fortran_compiler] ==# 'ifort'
+ let errorformat =
+ \ '%E%f(%l): error #%n: %m,'.
+ \ '%W%f(%l): warning #%n: %m,'.
+ \ '%W%f(%l): remark #%n: %m,'.
+ \ '%-Z%p^,'.
+ \ '%-G%.%#'
+ if !exists('g:syntastic_fortran_gfortran_sort')
+ let g:syntastic_fortran_gfortran_sort = 1
+ endif
+ endif
+
+ return syntastic#c#GetLocList('fortran', 'gfortran', {
+ \ 'errorformat': errorformat,
+ \ 'main_flags': '-fsyntax-only' })
+endfunction " }}}1
+" @vimlint(EVL104, 0, l:errorformat)
+
+" Utilities {{{1
+
+function! s:SetCompilerType(exe) " {{{2
+ if !has_key(s:type_map, a:exe)
+ try
+ let ver = filter( split(syntastic#util#system(syntastic#util#shescape(a:exe) . ' --version'), '\n'),
+ \ 'v:val =~# "\\v^%(GNU Fortran|ifort) "' )[0]
+ if ver =~# '\m^GNU Fortran '
+ let s:type_map[a:exe] = 'gfortran'
+ elseif ver =~# '\m^ifort '
+ let s:type_map[a:exe] = 'ifort'
+ endif
+ catch /\m^Vim\%((\a\+)\)\=:E684/
+ " do nothing
+ endtry
+ endif
+endfunction " }}}2
+
+" }}}
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'fortran',
+ \ 'name': 'gfortran' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/glsl/cgc.vim b/vim/bundle/syntastic/syntax_checkers/glsl/cgc.vim
new file mode 100644
index 0000000..602399d
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/glsl/cgc.vim
@@ -0,0 +1,81 @@
+"============================================================================
+"File: glsl.vim
+"Description: Syntax checker for OpenGL Shading Language
+"Maintainer: Joshua Rahm <joshuarahm@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_glsl_cgc_checker')
+ finish
+endif
+let g:loaded_syntastic_glsl_cgc_checker = 1
+
+let s:glsl_extensions = {
+ \ 'glslf': 'gpu_fp',
+ \ 'glslv': 'gpu_vp',
+ \ 'frag': 'gpu_fp',
+ \ 'vert': 'gpu_vp',
+ \ 'fp': 'gpu_fp',
+ \ 'vp': 'gpu_vp'
+ \ }
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_glsl_cgc_GetLocList() dict " {{{1
+ let makeprg = self.makeprgBuild({
+ \ 'args_before': '-oglsl -profile ' . s:GetProfile(),
+ \ 'args': (exists('g:syntastic_glsl_options') ? ' ' . g:syntastic_glsl_options : '') })
+
+ let errorformat =
+ \ '%E%f(%l) : error %m,' .
+ \ '%W%f(%l) : warning %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction " }}}1
+
+" Utilities {{{1
+
+function! s:GetProfile() " {{{2
+ let save_view = winsaveview()
+ let old_foldenable = &foldenable
+ let old_lazyredraw = &lazyredraw
+
+ let &lazyredraw = 1
+ let &foldenable = 0
+ call cursor(1, 1)
+
+ let magic = '\m\C^// profile:\s*'
+ let line = search(magic, 'c')
+
+ call winrestview(save_view)
+ let &foldenable = old_foldenable
+ let &lazyredraw = old_lazyredraw
+
+ if line
+ let profile = matchstr(getline(line), magic . '\zs.*')
+ else
+ let extensions = exists('g:syntastic_glsl_extensions') ? g:syntastic_glsl_extensions : s:glsl_extensions
+ let profile = get(extensions, tolower(expand('%:e', 1)), 'gpu_vert')
+ endif
+
+ return profile
+endfunction " }}}2
+
+" }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \'filetype': 'glsl',
+ \'name': 'cgc'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/go/go.vim b/vim/bundle/syntastic/syntax_checkers/go/go.vim
new file mode 100644
index 0000000..f32f505
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/go/go.vim
@@ -0,0 +1,103 @@
+"============================================================================
+"File: go.vim
+"Description: Check go syntax using 'gofmt -l' followed by 'go [build|test]'
+"Maintainer: Kamil Kisiel <kamil@kamilkisiel.net>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+"
+" This syntax checker does not reformat your source code.
+" Use a BufWritePre autocommand to that end:
+" autocmd FileType go autocmd BufWritePre <buffer> Fmt
+
+if exists('g:loaded_syntastic_go_go_checker')
+ finish
+endif
+let g:loaded_syntastic_go_go_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_go_go_IsAvailable() dict
+ return executable(self.getExec()) && executable('gofmt')
+endfunction
+
+function! SyntaxCheckers_go_go_GetLocList() dict
+ if !exists('s:go_new')
+ let s:go_new = syntastic#util#versionIsAtLeast(self.getVersion(self.getExecEscaped() . ' version'), [1, 5])
+ endif
+
+ " Check with gofmt first, since `go build` and `go test` might not report
+ " syntax errors in the current file if another file with syntax error is
+ " compiled first.
+ let makeprg = self.makeprgBuild({
+ \ 'exe': 'gofmt',
+ \ 'args': '-l',
+ \ 'tail': '> ' . syntastic#util#DevNull() })
+
+ let errorformat =
+ \ '%f:%l:%c: %m,' .
+ \ '%-G%.%#'
+
+ let errors = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'type': 'e'} })
+ if !empty(errors)
+ return errors
+ endif
+
+ " Test files, i.e. files with a name ending in `_test.go`, are not
+ " compiled by `go build`, therefore `go test` must be called for those.
+ if match(expand('%', 1), '\m_test\.go$') == -1
+ let cmd = 'build'
+ let opts = syntastic#util#var('go_go_build_args', s:go_new ? '-buildmode=archive' : '')
+ let cleanup = 0
+ else
+ let cmd = 'test -c'
+ let opts = syntastic#util#var('go_go_test_args', s:go_new ? '-buildmode=archive' : '')
+ let cleanup = 1
+ endif
+ let opt_str = (type(opts) != type('') || opts !=# '') ? join(syntastic#util#argsescape(opts)) : opts
+ let makeprg = self.getExecEscaped() . ' ' . cmd . ' ' . opt_str
+
+ " The first pattern is for warnings from C compilers.
+ let errorformat =
+ \ '%W%f:%l: warning: %m,' .
+ \ '%E%f:%l:%c:%m,' .
+ \ '%E%f:%l:%m,' .
+ \ '%C%\s%\+%m,' .
+ \ '%+Ecan''t load package: %m,' .
+ \ '%+Einternal error: %m,' .
+ \ '%-G#%.%#'
+
+ " The go compiler needs to either be run with an import path as an
+ " argument or directly from the package directory. Since figuring out
+ " the proper import path is fickle, just cwd to the package.
+
+ let errors = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'cwd': expand('%:p:h', 1),
+ \ 'env': {'GOGC': 'off'},
+ \ 'defaults': {'type': 'e'} })
+
+ if cleanup
+ call delete(expand('%:p:h', 1) . syntastic#util#Slash() . expand('%:p:h:t', 1) . '.test')
+ endif
+
+ return errors
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'go',
+ \ 'name': 'go'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/go/gofmt.vim b/vim/bundle/syntastic/syntax_checkers/go/gofmt.vim
new file mode 100644
index 0000000..bdb6218
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/go/gofmt.vim
@@ -0,0 +1,45 @@
+"============================================================================
+"File: gofmt.vim
+"Description: Check go syntax using 'gofmt -l'
+"Maintainer: Brandon Thomson <bt@brandonthomson.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+"
+" This syntax checker does not reformat your source code.
+" Use a BufWritePre autocommand to that end:
+" autocmd FileType go autocmd BufWritePre <buffer> Fmt
+
+if exists('g:loaded_syntastic_go_gofmt_checker')
+ finish
+endif
+let g:loaded_syntastic_go_gofmt_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_go_gofmt_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '-l',
+ \ 'tail_after': '> ' . syntastic#util#DevNull() })
+
+ let errorformat = '%f:%l:%c: %m,%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'type': 'e'} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'go',
+ \ 'name': 'gofmt'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/go/golint.vim b/vim/bundle/syntastic/syntax_checkers/go/golint.vim
new file mode 100644
index 0000000..29eee0c
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/go/golint.vim
@@ -0,0 +1,42 @@
+"============================================================================
+"File: golint.vim
+"Description: Check go syntax using 'golint'
+"Maintainer: Hiroshi Ioka <hirochachacha@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_go_golint_checker')
+ finish
+endif
+let g:loaded_syntastic_go_golint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_go_golint_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%f:%l:%c: %m,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'type': 'w'},
+ \ 'subtype': 'Style' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'go',
+ \ 'name': 'golint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/go/gometalinter.vim b/vim/bundle/syntastic/syntax_checkers/go/gometalinter.vim
new file mode 100644
index 0000000..780f49b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/go/gometalinter.vim
@@ -0,0 +1,53 @@
+"============================================================================
+"File: gometalinter.vim
+"Description: Check go syntax using 'gometalint'
+"Maintainer: Joshua Rubin <joshua@rubixconsulting.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_go_gometalinter_checker')
+ finish
+endif
+let g:loaded_syntastic_go_gometalinter_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_go_gometalinter_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args': '-t',
+ \ 'fname': syntastic#util#shexpand('%:p:h') })
+
+ let errorformat =
+ \ '%f:%l:%c:%trror: %m,' .
+ \ '%f:%l:%c:%tarning: %m,' .
+ \ '%f:%l::%trror: %m,' .
+ \ '%f:%l::%tarning: %m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 1] })
+
+ for e in loclist
+ if e['text'] =~# '\v\(%(deadcode|gocyclo|golint|defercheck|varcheck|structcheck|errcheck|dupl)\)$'
+ let e['subtype'] = 'Style'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'go',
+ \ 'name': 'gometalinter'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/go/gotype.vim b/vim/bundle/syntastic/syntax_checkers/go/gotype.vim
new file mode 100644
index 0000000..37472ee
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/go/gotype.vim
@@ -0,0 +1,48 @@
+"============================================================================
+"File: gotype.vim
+"Description: Perform syntactic and semantic checking of Go code using 'gotype'
+"Maintainer: luz <ne.tetewi@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_go_gotype_checker')
+ finish
+endif
+let g:loaded_syntastic_go_gotype_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_go_gotype_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args': (expand('%', 1) =~# '\m_test\.go$' ? '-a' : ''),
+ \ 'fname': '.' })
+
+ let errorformat =
+ \ '%f:%l:%c: %m,' .
+ \ '%-G%.%#'
+
+ " gotype needs the full go package to test types properly. Just cwd to
+ " the package for the same reasons specified in go.vim ("figuring out
+ " the import path is fickle").
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'cwd': expand('%:p:h', 1),
+ \ 'defaults': {'type': 'e'} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'go',
+ \ 'name': 'gotype'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/go/govet.vim b/vim/bundle/syntastic/syntax_checkers/go/govet.vim
new file mode 100644
index 0000000..6c30631
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/go/govet.vim
@@ -0,0 +1,48 @@
+"============================================================================
+"File: govet.vim
+"Description: Perform static analysis of Go code with the vet tool
+"Maintainer: Kamil Kisiel <kamil@kamilkisiel.net>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_go_govet_checker')
+ finish
+endif
+let g:loaded_syntastic_go_govet_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_go_govet_GetLocList() dict
+ let makeprg = self.getExecEscaped() . ' vet'
+
+ let errorformat =
+ \ '%Evet: %.%\+: %f:%l:%c: %m,' .
+ \ '%W%f:%l: %m,' .
+ \ '%-G%.%#'
+
+ " The go compiler needs to either be run with an import path as an
+ " argument or directly from the package directory. Since figuring out
+ " the proper import path is fickle, just cwd to the package.
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'cwd': expand('%:p:h', 1),
+ \ 'defaults': {'type': 'w'} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'go',
+ \ 'name': 'govet',
+ \ 'exec': 'go' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/haml/haml.vim b/vim/bundle/syntastic/syntax_checkers/haml/haml.vim
new file mode 100644
index 0000000..c0c7318
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/haml/haml.vim
@@ -0,0 +1,46 @@
+"============================================================================
+"File: haml.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_haml_haml_checker')
+ finish
+endif
+let g:loaded_syntastic_haml_haml_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_haml_haml_IsAvailable() dict
+ call syntastic#log#deprecationWarn('haml_interpreter', 'haml_haml_exec')
+ return executable(self.getExec())
+endfunction
+
+function! SyntaxCheckers_haml_haml_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-c' })
+
+ let errorformat =
+ \ 'Haml error on line %l: %m,' .
+ \ 'Syntax error on line %l: %m,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'haml',
+ \ 'name': 'haml'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/haml/haml_lint.vim b/vim/bundle/syntastic/syntax_checkers/haml/haml_lint.vim
new file mode 100644
index 0000000..60b3db3
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/haml/haml_lint.vim
@@ -0,0 +1,37 @@
+"============================================================================
+"File: haml_lint.vim
+"Description: HAML style and syntax checker plugin for Syntastic
+"Maintainer: Shane da Silva <shane@dasilva.io>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_haml_haml_lint_checker')
+ finish
+endif
+let g:loaded_syntastic_haml_haml_lint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_haml_haml_lint_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+ let errorformat = '%f:%l [%t] %m'
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style'})
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'haml',
+ \ 'name': 'haml_lint',
+ \ 'exec': 'haml-lint' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/handlebars/handlebars.vim b/vim/bundle/syntastic/syntax_checkers/handlebars/handlebars.vim
new file mode 100644
index 0000000..f5ae742
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/handlebars/handlebars.vim
@@ -0,0 +1,43 @@
+"============================================================================
+"File: handlebars.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_handlebars_handlebars_checker')
+ finish
+endif
+let g:loaded_syntastic_handlebars_handlebars_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_handlebars_handlebars_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-f ' . syntastic#util#DevNull() })
+
+ let errorformat =
+ \ '%EError: %m on line %l:,' .
+ \ '%EError: %m,' .
+ \ '%Z%p^,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['guards'],
+ \ 'defaults': {'bufnr': bufnr('')} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'handlebars',
+ \ 'name': 'handlebars'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/haskell/ghc-mod.vim b/vim/bundle/syntastic/syntax_checkers/haskell/ghc-mod.vim
new file mode 100644
index 0000000..928e5b3
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/haskell/ghc-mod.vim
@@ -0,0 +1,94 @@
+"============================================================================
+"File: ghc-mod.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_haskell_ghc_mod_checker')
+ finish
+endif
+let g:loaded_syntastic_haskell_ghc_mod_checker = 1
+
+let s:ghc_mod_new = -1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() dict " {{{1
+ if !executable(self.getExec())
+ return 0
+ endif
+
+ " ghc-mod 5.0.0 and later needs the "version" command to print the
+ " version. But the "version" command appeared in 4.1.0. Thus, we need to
+ " know the version in order to know how to find out the version. :)
+
+ " Try "ghc-mod version".
+ let version_output = split(syntastic#util#system(self.getExecEscaped() . ' version'), '\n', 1)
+ let ver = filter(copy(version_output), 'v:val =~# ''\m\sversion''')
+ if !len(ver)
+ " That didn't work. Try "ghc-mod" alone.
+ let version_output = split(syntastic#util#system(self.getExecEscaped()), '\n', 1)
+ let ver = filter(copy(version_output), 'v:val =~# ''\m\sversion''')
+ endif
+ let parsed_ver = len(ver) ? syntastic#util#parseVersion(ver[0]) : []
+
+ if len(parsed_ver)
+ " Encouraged by the great success in finding out the version, now we
+ " need either a Vim that can handle NULs in system() output, or a
+ " ghc-mod that has the "--boundary" option.
+ call self.setVersion(parsed_ver)
+ let s:ghc_mod_new = syntastic#util#versionIsAtLeast(parsed_ver, [2, 1, 2])
+ else
+ call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', version_output)
+ call syntastic#log#error("checker haskell/ghc_mod: can't parse version string (abnormal termination?)")
+ let s:ghc_mod_new = -1
+ endif
+
+ " ghc-mod 5.4.0 wants to run in the root directory of the project;
+ " syntastic can't cope with the resulting complications
+ "
+ " References:
+ " https://hackage.haskell.org/package/ghc-mod-5.4.0.0/changelog
+ let s:ghc_mod_bailout = syntastic#util#versionIsAtLeast(parsed_ver, [5, 4])
+
+ return (s:ghc_mod_new >= 0) && (v:version >= 704 || s:ghc_mod_new) && !s:ghc_mod_bailout
+endfunction " }}}1
+
+function! SyntaxCheckers_haskell_ghc_mod_GetLocList() dict " {{{1
+ let makeprg = self.makeprgBuild({
+ \ 'exe': self.getExecEscaped() . ' check' . (s:ghc_mod_new ? ' --boundary=""' : '') })
+
+ let errorformat =
+ \ '%-G%\s%#,' .
+ \ '%f:%l:%c:%trror: %m,' .
+ \ '%f:%l:%c:%tarning: %m,'.
+ \ '%f:%l:%c: %trror: %m,' .
+ \ '%f:%l:%c: %tarning: %m,' .
+ \ '%f:%l:%c:%m,' .
+ \ '%E%f:%l:%c:,' .
+ \ '%Z%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'iconv',
+ \ 'postprocess': ['compressWhitespace'],
+ \ 'returns': [0] })
+endfunction " }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'haskell',
+ \ 'name': 'ghc_mod',
+ \ 'exec': 'ghc-mod' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/haskell/hdevtools.vim b/vim/bundle/syntastic/syntax_checkers/haskell/hdevtools.vim
new file mode 100644
index 0000000..4b0a80f
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/haskell/hdevtools.vim
@@ -0,0 +1,56 @@
+"============================================================================
+"File: hdevtools.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_haskell_hdevtools_checker')
+ finish
+endif
+let g:loaded_syntastic_haskell_hdevtools_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict
+ if !exists('g:syntastic_haskell_hdevtools_args') && exists('g:hdevtools_options')
+ call syntastic#log#oneTimeWarn('variable g:hdevtools_options is deprecated, ' .
+ \ 'please use g:syntastic_haskell_hdevtools_args instead')
+ let g:syntastic_haskell_hdevtools_args = g:hdevtools_options
+ endif
+
+ let makeprg = self.makeprgBuild({
+ \ 'exe_after': 'check',
+ \ 'fname': syntastic#util#shexpand('%:p') })
+
+ let errorformat =
+ \ '%-Z %#,'.
+ \ '%W%f:%l:%v: Warning: %m,'.
+ \ '%W%f:%l:%v: Warning:,'.
+ \ '%E%f:%l:%v: %m,'.
+ \ '%E%>%f:%l:%v:,'.
+ \ '%+C %#%m,'.
+ \ '%W%>%f:%l:%v:,'.
+ \ '%+C %#%tarning: %m,'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'vcol': 1},
+ \ 'postprocess': ['compressWhitespace'] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'haskell',
+ \ 'name': 'hdevtools'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/haskell/hlint.vim b/vim/bundle/syntastic/syntax_checkers/haskell/hlint.vim
new file mode 100644
index 0000000..c75ea8b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/haskell/hlint.vim
@@ -0,0 +1,41 @@
+"============================================================================
+"File: hlint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Nicolas Wu <nicolas.wu at gmail dot com>
+"License: BSD
+"============================================================================
+
+if exists('g:loaded_syntastic_haskell_hlint_checker')
+ finish
+endif
+let g:loaded_syntastic_haskell_hlint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_haskell_hlint_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'fname': syntastic#util#shexpand('%:p')})
+
+ let errorformat =
+ \ '%E%f:%l:%v: Error while reading hint file\, %m,' .
+ \ '%E%f:%l:%v: Error: %m,' .
+ \ '%W%f:%l:%v: Warning: %m,' .
+ \ '%W%f:%l:%v: Suggestion: %m,' .
+ \ '%C%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'vcol': 1},
+ \ 'postprocess': ['compressWhitespace'] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'haskell',
+ \ 'name': 'hlint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/haskell/scan.vim b/vim/bundle/syntastic/syntax_checkers/haskell/scan.vim
new file mode 100644
index 0000000..7cf7e7b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/haskell/scan.vim
@@ -0,0 +1,43 @@
+"============================================================================
+"File: scan.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_haskell_scan_checker')
+ finish
+endif
+let g:loaded_syntastic_haskell_scan_checker = 1
+
+if !exists('g:syntastic_haskell_scan_sort')
+ let g:syntastic_haskell_scan_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_haskell_scan_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat = '%f:%l:%v: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'haskell',
+ \ 'name': 'scan'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/haxe/haxe.vim b/vim/bundle/syntastic/syntax_checkers/haxe/haxe.vim
new file mode 100644
index 0000000..789e9f3
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/haxe/haxe.vim
@@ -0,0 +1,63 @@
+"============================================================================
+"File: haxe.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: David Bernard <david.bernard.31 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_haxe_haxe_checker')
+ finish
+endif
+let g:loaded_syntastic_haxe_haxe_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_haxe_haxe_GetLocList() dict
+ if exists('b:vaxe_hxml')
+ let hxml = b:vaxe_hxml
+ elseif exists('g:vaxe_hxml')
+ let hxml = g:vaxe_hxml
+ else
+ let hxml = syntastic#util#findGlobInParent('*.hxml', expand('%:p:h', 1))
+ endif
+ let hxml = fnamemodify(hxml, ':p')
+
+ call self.log('hxml =', hxml)
+
+ if hxml !=# ''
+ let makeprg = self.makeprgBuild({
+ \ 'fname': syntastic#util#shescape(fnamemodify(hxml, ':t')) })
+
+ let errorformat = '%E%f:%l: characters %c-%n : %m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'cwd': fnamemodify(hxml, ':h') })
+
+ for e in loclist
+ let e['hl'] = '\%>' . e['col'] . 'c\%<' . (e['nr'] + 1) . 'c'
+ let e['col'] += 1
+ let e['nr'] = 0
+ endfor
+
+ return loclist
+ endif
+
+ return []
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'haxe',
+ \ 'name': 'haxe'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/hss/hss.vim b/vim/bundle/syntastic/syntax_checkers/hss/hss.vim
new file mode 100644
index 0000000..d988615
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/hss/hss.vim
@@ -0,0 +1,38 @@
+"============================================================================
+"File: hss.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Justin Donaldson (jdonaldson@gmail.com)
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_hss_hss_checker')
+ finish
+endif
+let g:loaded_syntastic_hss_hss_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_hss_hss_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after' : '-output ' . syntastic#util#DevNull() })
+
+ let errorformat = '%E%f:%l: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'hss',
+ \ 'name': 'hss'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/html/eslint.vim b/vim/bundle/syntastic/syntax_checkers/html/eslint.vim
new file mode 100644
index 0000000..3e91931
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/html/eslint.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: eslint.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_html_eslint_checker')
+ finish
+endif
+let g:loaded_syntastic_html_eslint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'html',
+ \ 'name': 'eslint',
+ \ 'redirect': 'javascript/eslint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/html/gjslint.vim b/vim/bundle/syntastic/syntax_checkers/html/gjslint.vim
new file mode 100644
index 0000000..a26e2f3
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/html/gjslint.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: gjslint.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_html_gjslint_checker')
+ finish
+endif
+let g:loaded_syntastic_html_gjslint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'html',
+ \ 'name': 'gjslint',
+ \ 'redirect': 'javascript/gjslint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/html/jshint.vim b/vim/bundle/syntastic/syntax_checkers/html/jshint.vim
new file mode 100644
index 0000000..a7af758
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/html/jshint.vim
@@ -0,0 +1,50 @@
+"============================================================================
+"File: jshint.vim
+"Description: Javascript syntax checker for HTML - using jshint
+"Maintainer: LCD 47 <lcd047@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_html_jshint_checker')
+ finish
+endif
+let g:loaded_syntastic_html_jshint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_html_jshint_IsAvailable() dict
+ call syntastic#log#deprecationWarn('jshint_exec', 'html_jshint_exec')
+ if !executable(self.getExec())
+ return 0
+ endif
+ return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 4])
+endfunction
+
+function! SyntaxCheckers_html_jshint_GetLocList() dict
+ call syntastic#log#deprecationWarn('html_jshint_conf', 'html_jshint_args',
+ \ "'--config ' . syntastic#util#shexpand(OLD_VAR)")
+
+ let makeprg = self.makeprgBuild({ 'args_after': '--verbose --extract always' })
+
+ let errorformat = '%A%f: line %l\, col %v\, %m \(%t%*\d\)'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')},
+ \ 'returns': [0, 2] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'html',
+ \ 'name': 'jshint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/html/textlint.vim b/vim/bundle/syntastic/syntax_checkers/html/textlint.vim
new file mode 100644
index 0000000..b95d8be
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/html/textlint.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: textlint.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_html_textlint_checker')
+ finish
+endif
+let g:loaded_syntastic_html_textlint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'html',
+ \ 'name': 'textlint',
+ \ 'redirect': 'text/textlint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/html/tidy.vim b/vim/bundle/syntastic/syntax_checkers/html/tidy.vim
new file mode 100644
index 0000000..3075a7d
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/html/tidy.vim
@@ -0,0 +1,212 @@
+"============================================================================
+"File: tidy.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_html_tidy_checker')
+ finish
+endif
+let g:loaded_syntastic_html_tidy_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Checker options {{{1
+
+if !exists('g:syntastic_html_tidy_ignore_errors')
+ let g:syntastic_html_tidy_ignore_errors = []
+endif
+
+if !exists('g:syntastic_html_tidy_blocklevel_tags')
+ let g:syntastic_html_tidy_blocklevel_tags = []
+endif
+
+if !exists('g:syntastic_html_tidy_inline_tags')
+ let g:syntastic_html_tidy_inline_tags = []
+endif
+
+if !exists('g:syntastic_html_tidy_empty_tags')
+ let g:syntastic_html_tidy_empty_tags = []
+endif
+
+" }}}1
+
+" Constants {{{1
+
+let s:IGNORE_ERRORS = [
+ \ "<table> lacks \"summary\" attribute",
+ \ "not approved by W3C",
+ \ "<input> proprietary attribute \"placeholder\"",
+ \ "<meta> proprietary attribute \"charset\"",
+ \ "<meta> lacks \"content\" attribute",
+ \ "inserting \"type\" attribute",
+ \ "proprietary attribute \"data-",
+ \ "missing <!DOCTYPE> declaration",
+ \ "inserting implicit <body>",
+ \ "inserting missing 'title' element",
+ \ "unescaped & or unknown entity",
+ \ "<input> attribute \"type\" has invalid value",
+ \ "proprietary attribute \"role\"",
+ \ "proprietary attribute \"aria-activedescendant\"",
+ \ "proprietary attribute \"aria-atomic\"",
+ \ "proprietary attribute \"aria-autocomplete\"",
+ \ "proprietary attribute \"aria-busy\"",
+ \ "proprietary attribute \"aria-checked\"",
+ \ "proprietary attribute \"aria-controls\"",
+ \ "proprietary attribute \"aria-describedby\"",
+ \ "proprietary attribute \"aria-disabled\"",
+ \ "proprietary attribute \"aria-dropeffect\"",
+ \ "proprietary attribute \"aria-expanded\"",
+ \ "proprietary attribute \"aria-flowto\"",
+ \ "proprietary attribute \"aria-grabbed\"",
+ \ "proprietary attribute \"aria-haspopup\"",
+ \ "proprietary attribute \"aria-hidden\"",
+ \ "proprietary attribute \"aria-invalid\"",
+ \ "proprietary attribute \"aria-label\"",
+ \ "proprietary attribute \"aria-labelledby\"",
+ \ "proprietary attribute \"aria-level\"",
+ \ "proprietary attribute \"aria-live\"",
+ \ "proprietary attribute \"aria-multiline\"",
+ \ "proprietary attribute \"aria-multiselectable\"",
+ \ "proprietary attribute \"aria-orientation\"",
+ \ "proprietary attribute \"aria-owns\"",
+ \ "proprietary attribute \"aria-posinset\"",
+ \ "proprietary attribute \"aria-pressed\"",
+ \ "proprietary attribute \"aria-readonly\"",
+ \ "proprietary attribute \"aria-relevant\"",
+ \ "proprietary attribute \"aria-relevant\"",
+ \ "proprietary attribute \"aria-required\"",
+ \ "proprietary attribute \"aria-selected\"",
+ \ "proprietary attribute \"aria-setsize\"",
+ \ "proprietary attribute \"aria-sort\"",
+ \ "proprietary attribute \"aria-valuemax\"",
+ \ "proprietary attribute \"aria-valuemin\"",
+ \ "proprietary attribute \"aria-valuenow\"",
+ \ "proprietary attribute \"aria-valuetext\""
+ \ ]
+lockvar! s:IGNORE_ERRORS
+
+let s:BLOCKLEVEL_TAGS = [
+ \ 'main',
+ \ 'section',
+ \ 'article',
+ \ 'aside',
+ \ 'header',
+ \ 'footer',
+ \ 'nav',
+ \ 'figure',
+ \ 'figcaption'
+ \ ]
+lockvar! s:BLOCKLEVEL_TAGS
+
+let s:INLINE_TAGS = [
+ \ 'video',
+ \ 'audio',
+ \ 'source',
+ \ 'embed',
+ \ 'mark',
+ \ 'progress',
+ \ 'meter',
+ \ 'time',
+ \ 'ruby',
+ \ 'rt',
+ \ 'rp',
+ \ 'canvas',
+ \ 'command',
+ \ 'details',
+ \ 'datalist'
+ \ ]
+lockvar! s:INLINE_TAGS
+
+let s:EMPTY_TAGS = [
+ \ 'wbr',
+ \ 'keygen'
+ \ ]
+lockvar! s:EMPTY_TAGS
+
+" }}}1
+
+function! SyntaxCheckers_html_tidy_GetLocList() dict " {{{1
+ let makeprg = self.makeprgBuild({ 'args_after': s:Args() })
+
+ let errorformat =
+ \ '%Wline %l column %v - Warning: %m,' .
+ \ '%Eline %l column %v - Error: %m,' .
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')},
+ \ 'returns': [0, 1, 2] })
+
+ " filter out valid HTML5 from the errors
+ for e in loclist
+ if e['valid'] && s:IgnoreError(e['text']) == 1
+ let e['valid'] = 0
+ endif
+ endfor
+
+ return loclist
+endfunction " }}}1
+
+" Utilities {{{1
+
+" TODO: join this with xhtml.vim for DRY's sake?
+function! s:TidyEncOptByFenc() " {{{2
+ let TIDY_OPTS = {
+ \ 'utf-8': '-utf8',
+ \ 'ascii': '-ascii',
+ \ 'latin1': '-latin1',
+ \ 'iso-2022-jp': '-iso-2022',
+ \ 'cp1252': '-win1252',
+ \ 'macroman': '-mac',
+ \ 'utf-16le': '-utf16le',
+ \ 'utf-16': '-utf16',
+ \ 'big5': '-big5',
+ \ 'cp932': '-shiftjis',
+ \ 'sjis': '-shiftjis',
+ \ 'cp850': '-ibm858',
+ \ }
+ return get(TIDY_OPTS, &fileencoding, '-utf8')
+endfunction " }}}2
+
+function! s:IgnoreError(text) " {{{2
+ for item in s:IGNORE_ERRORS + g:syntastic_html_tidy_ignore_errors
+ if stridx(a:text, item) != -1
+ return 1
+ endif
+ endfor
+ return 0
+endfunction " }}}2
+
+function! s:NewTags(name) " {{{2
+ return syntastic#util#shescape(join( s:{toupper(a:name)} + g:syntastic_html_tidy_{a:name}, ',' ))
+endfunction " }}}2
+
+function! s:Args() " {{{2
+ let args = s:TidyEncOptByFenc() .
+ \ ' --new-blocklevel-tags ' . s:NewTags('blocklevel_tags') .
+ \ ' --new-inline-tags ' . s:NewTags('inline_tags') .
+ \ ' --new-empty-tags ' . s:NewTags('empty_tags') .
+ \ ' -e'
+ return args
+endfunction " }}}2
+
+" }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'html',
+ \ 'name': 'tidy'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/html/validator.vim b/vim/bundle/syntastic/syntax_checkers/html/validator.vim
new file mode 100644
index 0000000..14a4c64
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/html/validator.vim
@@ -0,0 +1,69 @@
+"============================================================================
+"File: validator.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_html_validator_checker')
+ finish
+endif
+let g:loaded_syntastic_html_validator_checker=1
+
+if !exists('g:syntastic_html_validator_api')
+ let g:syntastic_html_validator_api = 'https://validator.nu/'
+endif
+
+if !exists('g:syntastic_html_validator_parser')
+ let g:syntastic_html_validator_parser = ''
+endif
+
+if !exists('g:syntastic_html_validator_nsfilter')
+ let g:syntastic_html_validator_nsfilter = ''
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_html_validator_GetLocList() dict
+ let fname = syntastic#util#shexpand('%')
+ let makeprg = self.getExecEscaped() . ' -q -L -s --compressed -F out=gnu -F asciiquotes=yes' .
+ \ (g:syntastic_html_validator_parser !=# '' ? ' -F parser=' . g:syntastic_html_validator_parser : '') .
+ \ (g:syntastic_html_validator_nsfilter !=# '' ? ' -F nsfilter=' . g:syntastic_html_validator_nsfilter : '') .
+ \ ' -F doc=@' . fname . '\;type=text/html\;filename=' . fname . ' ' . g:syntastic_html_validator_api
+
+ let errorformat =
+ \ '%E"%f":%l: %trror: %m,' .
+ \ '%E"%f":%l-%\d%\+: %trror: %m,' .
+ \ '%E"%f":%l%\%.%c: %trror: %m,' .
+ \ '%E"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: %trror: %m,' .
+ \ '%E"%f":%l: %trror fatal: %m,' .
+ \ '%E"%f":%l-%\d%\+: %trror fatal: %m,' .
+ \ '%E"%f":%l%\%.%c: %trror fatal: %m,' .
+ \ '%E"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: %trror fatal: %m,' .
+ \ '%W"%f":%l: info %tarning: %m,' .
+ \ '%W"%f":%l-%\d%\+: info %tarning: %m,' .
+ \ '%W"%f":%l%\%.%c: info %tarning: %m,' .
+ \ '%W"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: info %tarning: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'validator',
+ \ 'returns': [0] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'html',
+ \ 'name': 'validator',
+ \ 'exec': 'curl' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/html/w3.vim b/vim/bundle/syntastic/syntax_checkers/html/w3.vim
new file mode 100644
index 0000000..37ff11a
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/html/w3.vim
@@ -0,0 +1,62 @@
+"============================================================================
+"File: w3.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_html_w3_checker')
+ finish
+endif
+let g:loaded_syntastic_html_w3_checker = 1
+
+if !exists('g:syntastic_html_w3_api')
+ let g:syntastic_html_w3_api = 'http://validator.w3.org/check'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_html_w3_GetLocList() dict
+ let makeprg = self.getExecEscaped() . ' -q -L -s -F output=json ' .
+ \ '-F uploaded_file=@' . syntastic#util#shexpand('%:p') . '\;type=text/html ' .
+ \ g:syntastic_html_w3_api
+
+ let errorformat =
+ \ '%A %\+{,' .
+ \ '%C %\+"lastLine": %l\,%\?,' .
+ \ '%C %\+"lastColumn": %c\,%\?,' .
+ \ '%C %\+"message": "%m"\,%\?,' .
+ \ '%C %\+"type": "%trror"\,%\?,' .
+ \ '%-G %\+"type": "%tnfo"\,%\?,' .
+ \ '%C %\+"subtype": "%tarning"\,%\?,' .
+ \ '%Z %\+}\,,' .
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')},
+ \ 'returns': [0] })
+
+ for e in loclist
+ let e['text'] = substitute(e['text'], '\m\\\([\"]\)', '\1', 'g')
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'html',
+ \ 'name': 'w3',
+ \ 'exec': 'curl' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/jade/jade_lint.vim b/vim/bundle/syntastic/syntax_checkers/jade/jade_lint.vim
new file mode 100644
index 0000000..32cc808
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/jade/jade_lint.vim
@@ -0,0 +1,24 @@
+"============================================================================
+"File: jade_lint.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_jade_jade_lint_checker')
+ finish
+endif
+let g:loaded_syntastic_jade_jade_lint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'jade',
+ \ 'name': 'jade_lint',
+ \ 'exec': 'jade-lint',
+ \ 'redirect': 'pug/pug_lint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/java/checkstyle.vim b/vim/bundle/syntastic/syntax_checkers/java/checkstyle.vim
new file mode 100644
index 0000000..f4eee5e
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/java/checkstyle.vim
@@ -0,0 +1,85 @@
+"============================================================================
+"File: checkstyle.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Dmitry Geurkov <d.geurkov at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+" Tested with checkstyle 5.5
+"============================================================================
+
+if exists('g:loaded_syntastic_java_checkstyle_checker')
+ finish
+endif
+let g:loaded_syntastic_java_checkstyle_checker = 1
+
+if !exists('g:syntastic_java_checkstyle_classpath')
+ let g:syntastic_java_checkstyle_classpath = 'checkstyle-6.10.1-all.jar'
+endif
+
+if !exists('g:syntastic_java_checkstyle_conf_file')
+ let g:syntastic_java_checkstyle_conf_file = 'sun_checks.xml'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_java_checkstyle_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+
+ let conf_file = expand(g:syntastic_java_checkstyle_conf_file, 1)
+ call self.log('filereadable(' . string(conf_file) . ') = ' . filereadable(conf_file))
+
+ return filereadable(conf_file)
+endfunction
+
+function! SyntaxCheckers_java_checkstyle_GetLocList() dict
+
+ " classpath
+ if !exists('s:sep')
+ let s:sep = syntastic#util#isRunningWindows() || has('win32unix') ? ';' : ':'
+ endif
+ let classpath = join(map( split(g:syntastic_java_checkstyle_classpath, s:sep, 1), 'expand(v:val, 1)' ), s:sep)
+ call self.log('classpath =', classpath)
+
+ " forced options
+ let opts = []
+ if classpath !=# ''
+ call extend(opts, ['-cp', classpath])
+ endif
+ call extend(opts, [
+ \ 'com.puppycrawl.tools.checkstyle.Main',
+ \ '-c', expand(g:syntastic_java_checkstyle_conf_file, 1),
+ \ '-f', 'xml' ])
+
+ " filename
+ let fname = syntastic#util#shescape( expand('%:p:h', 1) . syntastic#util#Slash() . expand('%:t', 1) )
+ if has('win32unix')
+ let fname = substitute(syntastic#util#system('cygpath -m ' . fname), '\m\%x00', '', 'g')
+ endif
+
+ let makeprg = self.makeprgBuild({ 'args_after': opts, 'fname': fname })
+
+ let errorformat = '%f:%t:%l:%c:%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'checkstyle',
+ \ 'subtype': 'Style' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'java',
+ \ 'name': 'checkstyle',
+ \ 'exec': 'java'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/java/javac.vim b/vim/bundle/syntastic/syntax_checkers/java/javac.vim
new file mode 100644
index 0000000..948c244
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/java/javac.vim
@@ -0,0 +1,427 @@
+"============================================================================
+"File: javac.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Jochen Keil <jochen.keil at gmail dot com>
+" Dmitry Geurkov <d.geurkov at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_java_javac_checker')
+ finish
+endif
+let g:loaded_syntastic_java_javac_checker = 1
+let g:syntastic_java_javac_maven_pom_tags = ['build', 'properties']
+let g:syntastic_java_javac_maven_pom_properties = {}
+let s:has_maven = 0
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Checker options {{{1
+
+if !exists('g:syntastic_java_javac_executable')
+ let g:syntastic_java_javac_executable = 'javac'
+endif
+
+if !exists('g:syntastic_java_maven_executable')
+ let g:syntastic_java_maven_executable = 'mvn'
+endif
+
+if !exists('g:syntastic_java_javac_options')
+ let g:syntastic_java_javac_options = '-Xlint'
+endif
+
+if !exists('g:syntastic_java_maven_options')
+ let g:syntastic_java_maven_options = ''
+endif
+
+if !exists('g:syntastic_java_javac_classpath')
+ let g:syntastic_java_javac_classpath = ''
+endif
+
+if !exists('g:syntastic_java_javac_delete_output')
+ let g:syntastic_java_javac_delete_output = 1
+endif
+
+if !exists('g:syntastic_java_javac_autoload_maven_classpath')
+ let g:syntastic_java_javac_autoload_maven_classpath = 1
+endif
+
+if !exists('g:syntastic_java_javac_config_file_enabled')
+ let g:syntastic_java_javac_config_file_enabled = 0
+endif
+
+if !exists('g:syntastic_java_javac_config_file')
+ let g:syntastic_java_javac_config_file = '.syntastic_javac_config'
+endif
+
+if !exists('g:syntastic_java_javac_custom_classpath_command')
+ let g:syntastic_java_javac_custom_classpath_command = ''
+endif
+
+if !exists('g:syntastic_java_javac_maven_pom_ftime')
+ let g:syntastic_java_javac_maven_pom_ftime = {}
+endif
+
+if !exists('g:syntastic_java_javac_maven_pom_classpath')
+ let g:syntastic_java_javac_maven_pom_classpath = {}
+endif
+
+" }}}1
+
+" Constants {{{1
+
+let s:_FILE_SHORTCUTS = {
+ \ '%FILE_PATH%': '%:p',
+ \ '%FILE_NAME%': '%:t',
+ \ '%FILE_DIR%': '%:p:h',
+ \ }
+lockvar! s:_FILE_SHORTCUTS
+
+" }}}1
+
+" Commands {{{1
+
+command! SyntasticJavacEditClasspath call s:EditClasspath()
+command! SyntasticJavacEditConfig call s:EditConfig()
+
+" }}}1
+
+function! SyntaxCheckers_java_javac_IsAvailable() dict " {{{1
+ let s:has_maven = executable(expand(g:syntastic_java_maven_executable, 1))
+ return executable(expand(g:syntastic_java_javac_executable, 1))
+endfunction " }}}1
+
+function! SyntaxCheckers_java_javac_GetLocList() dict " {{{1
+ let javac_opts = g:syntastic_java_javac_options
+
+ let output_dir = ''
+ if g:syntastic_java_javac_delete_output
+ let output_dir = syntastic#util#tmpdir()
+ let javac_opts .= ' -d ' . syntastic#util#shescape(output_dir)
+ endif
+
+ " load classpath from config file
+ if g:syntastic_java_javac_config_file_enabled
+ call s:LoadConfigFile()
+ endif
+
+
+ " add classpathes to javac_classpath {{{2
+ let javac_classpath = ''
+
+ for path in split(g:syntastic_java_javac_classpath, s:ClassSep())
+ if path !=# ''
+ try
+ let ps = glob(path, 1, 1)
+ catch
+ let ps = split(glob(path, 1), "\n")
+ endtry
+ if type(ps) == type([])
+ for p in ps
+ let javac_classpath = s:AddToClasspath(javac_classpath, p)
+ endfor
+ else
+ let javac_classpath = s:AddToClasspath(javac_classpath, ps)
+ endif
+ endif
+ endfor
+
+ if s:has_maven && g:syntastic_java_javac_autoload_maven_classpath
+ if !g:syntastic_java_javac_delete_output
+ let javac_opts .= ' -d ' . syntastic#util#shescape(s:MavenOutputDirectory())
+ endif
+ let javac_classpath = s:AddToClasspath(javac_classpath, s:GetMavenClasspath())
+ endif
+ " }}}2
+
+ " load custom classpath {{{2
+ if g:syntastic_java_javac_custom_classpath_command !=# ''
+ " Pre-process the classpath command string a little.
+ let classpath_command = g:syntastic_java_javac_custom_classpath_command
+ for [key, val] in items(s:_FILE_SHORTCUTS)
+ let classpath_command = substitute(classpath_command, '\V' . key, syntastic#util#shexpand(val), 'g')
+ endfor
+ let lines = syntastic#util#system(classpath_command)
+ if syntastic#util#isRunningWindows() || has('win32unix')
+ let lines = substitute(lines, "\r\n", "\n", 'g')
+ endif
+ for l in split(lines, "\n")
+ let javac_classpath = s:AddToClasspath(javac_classpath, l)
+ endfor
+ endif
+
+ if javac_classpath !=# ''
+ let javac_opts .= ' -cp ' . syntastic#util#shexpand(javac_classpath)
+ endif
+ " }}}2
+
+ let fname = expand('%:p:h', 1) . syntastic#util#Slash() . expand ('%:t', 1)
+
+ if has('win32unix')
+ let fname = syntastic#util#CygwinPath(fname)
+ endif
+
+ let makeprg = self.makeprgBuild({
+ \ 'args': javac_opts,
+ \ 'fname': syntastic#util#shescape(fname) })
+
+ " unashamedly stolen from *errorformat-javac* (quickfix.txt) and modified to include error types
+ let errorformat =
+ \ '%E%f:%l: error: %m,'.
+ \ '%W%f:%l: warning: %m,'.
+ \ '%E%f:%l: %m,'.
+ \ '%Z%p^,'.
+ \ '%-G%.%#'
+
+ if output_dir !=# ''
+ silent! call mkdir(output_dir, 'p')
+ endif
+ let errors = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['cygwinRemoveCR'] })
+
+ if output_dir !=# ''
+ call syntastic#util#rmrf(output_dir)
+ endif
+ return errors
+
+endfunction " }}}1
+
+" Utilities {{{1
+
+function! s:RemoveCarriageReturn(line) " {{{2
+ return substitute(a:line, "\r", '', 'g')
+endfunction " }}}2
+
+function! s:ClassSep() " {{{2
+ return (syntastic#util#isRunningWindows() || has('win32unix')) ? ';' : ':'
+endfunction " }}}2
+
+function! s:AddToClasspath(classpath, path) " {{{2
+ if a:path ==# ''
+ return a:classpath
+ endif
+ return (a:classpath !=# '') ? a:classpath . s:ClassSep() . a:path : a:path
+endfunction " }}}2
+
+function! s:SplitClasspath(classpath) " {{{2
+ return split(a:classpath, s:ClassSep())
+endfunction " }}}2
+
+function! s:LoadConfigFile() " {{{2
+ if filereadable(expand(g:syntastic_java_javac_config_file, 1))
+ execute 'source ' . fnameescape(expand(g:syntastic_java_javac_config_file, 1))
+ endif
+endfunction " }}}2
+
+function! s:SaveClasspath() " {{{2
+ " build classpath from lines
+ let path = ''
+ let lines = getline(1, line('$'))
+ for l in lines
+ let path = s:AddToClasspath(path, l)
+ endfor
+ " save classpath to config file
+ if g:syntastic_java_javac_config_file_enabled
+ if filereadable(expand(g:syntastic_java_javac_config_file, 1))
+ " load lines from config file
+ let lines = readfile(expand(g:syntastic_java_javac_config_file, 1))
+ " strip g:syntastic_java_javac_classpath options from config file lines
+ let i = 0
+ while i < len(lines)
+ if match(lines[i], 'g:syntastic_java_javac_classpath') != -1
+ call remove(lines, i)
+ else
+ let i += 1
+ endif
+ endwhile
+ else
+ let lines = []
+ endif
+ " add new g:syntastic_java_javac_classpath option to config
+ call add(lines, 'let g:syntastic_java_javac_classpath = ' . string(path))
+ " save config file lines
+ call writefile(lines, expand(g:syntastic_java_javac_config_file, 1))
+ endif
+ " set new classpath
+ let g:syntastic_java_javac_classpath = path
+ let &modified = 0
+endfunction " }}}2
+
+function! s:EditClasspath() " {{{2
+ let command = 'syntastic javac classpath'
+ let winnr = bufwinnr('^' . command . '$')
+ if winnr < 0
+ let path = []
+ let pathlines = split(g:syntastic_java_javac_classpath, "\n")
+ for p in pathlines
+ call extend(path, s:SplitClasspath(p))
+ endfor
+ execute (len(path) + 5) . 'sp ' . fnameescape(command)
+
+ augroup syntastic
+ autocmd BufWriteCmd <buffer> call s:SaveClasspath() | bwipeout
+ augroup END
+
+ setlocal buftype=acwrite bufhidden=wipe nobuflisted noswapfile nowrap number
+ for p in path
+ call append(line('$') - 1, p)
+ endfor
+ let &modified = 0
+ else
+ execute winnr . 'wincmd w'
+ endif
+endfunction " }}}2
+
+function! s:SaveConfig() " {{{2
+ " get lines
+ let lines = getline(1, line('$'))
+ if g:syntastic_java_javac_config_file_enabled
+ " save config file lines
+ call writefile(lines, expand(g:syntastic_java_javac_config_file, 1))
+ endif
+ let &modified = 0
+endfunction " }}}2
+
+function! s:EditConfig() " {{{2
+ if !g:syntastic_java_javac_config_file_enabled
+ return
+ endif
+
+ let command = 'syntastic javac config'
+ let winnr = bufwinnr('^' . command . '$')
+ if winnr < 0
+ let lines = []
+ if filereadable(expand(g:syntastic_java_javac_config_file, 1))
+ let lines = readfile(expand(g:syntastic_java_javac_config_file, 1))
+ endif
+ execute (len(lines) + 5) . 'sp ' . fnameescape(command)
+
+ augroup syntastic
+ autocmd BufWriteCmd <buffer> call s:SaveConfig() | bwipeout
+ augroup END
+
+ setlocal ft=vim buftype=acwrite bufhidden=wipe nobuflisted noswapfile nowrap number
+ for l in lines
+ call append(line('$') - 1, l)
+ endfor
+ let &modified = 0
+ else
+ execute winnr . 'wincmd w'
+ endif
+endfunction " }}}2
+
+function! s:GetMavenProperties() " {{{2
+ let mvn_properties = {}
+ let pom = syntastic#util#findFileInParent('pom.xml', expand('%:p:h', 1))
+ if s:has_maven && filereadable(pom)
+ if !has_key(g:syntastic_java_javac_maven_pom_properties, pom)
+ let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) .
+ \ ' -f ' . syntastic#util#shescape(pom) .
+ \ ' ' . g:syntastic_java_maven_options
+ let mvn_is_managed_tag = 1
+ let mvn_settings_output = split(syntastic#util#system(mvn_cmd . ' help:effective-pom'), "\n")
+ let current_path = 'project'
+ for line in mvn_settings_output
+ let matches = matchlist(line, '\m^\s*<\([a-zA-Z0-9\-\.]\+\)>\s*$')
+ if mvn_is_managed_tag && !empty(matches)
+ let mvn_is_managed_tag = index(g:syntastic_java_javac_maven_pom_tags, matches[1]) >= 0
+ let current_path .= '.' . matches[1]
+ else
+ let matches = matchlist(line, '\m^\s*</\([a-zA-Z0-9\-\.]\+\)>\s*$')
+ if !empty(matches)
+ let mvn_is_managed_tag = index(g:syntastic_java_javac_maven_pom_tags, matches[1]) < 0
+ let current_path = substitute(current_path, '\m\.' . matches[1] . '$', '', '')
+ else
+ let matches = matchlist(line, '\m^\s*<\([a-zA-Z0-9\-\.]\+\)>\(.\+\)</[a-zA-Z0-9\-\.]\+>\s*$')
+ if mvn_is_managed_tag && !empty(matches)
+ let mvn_properties[current_path . '.' . matches[1]] = matches[2]
+ endif
+ endif
+ endif
+ endfor
+ let g:syntastic_java_javac_maven_pom_properties[pom] = mvn_properties
+ endif
+ return g:syntastic_java_javac_maven_pom_properties[pom]
+ endif
+ return mvn_properties
+endfunction " }}}2
+
+function! s:GetMavenClasspath() " {{{2
+ let pom = syntastic#util#findFileInParent('pom.xml', expand('%:p:h', 1))
+ if s:has_maven && filereadable(pom)
+ if !has_key(g:syntastic_java_javac_maven_pom_ftime, pom) || g:syntastic_java_javac_maven_pom_ftime[pom] != getftime(pom)
+ let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) .
+ \ ' -f ' . syntastic#util#shescape(pom) .
+ \ ' ' . g:syntastic_java_maven_options
+ let mvn_classpath_output = split(syntastic#util#system(mvn_cmd . ' dependency:build-classpath -DincludeScope=test'), "\n")
+ let mvn_classpath = ''
+ let class_path_next = 0
+
+ for line in mvn_classpath_output
+ if class_path_next == 1
+ let mvn_classpath = s:RemoveCarriageReturn(line)
+ break
+ endif
+ if stridx(line, 'Dependencies classpath:') >= 0
+ let class_path_next = 1
+ endif
+ endfor
+
+ let mvn_properties = s:GetMavenProperties()
+
+ let sep = syntastic#util#Slash()
+ let output_dir = get(mvn_properties, 'project.build.outputDirectory', join(['target', 'classes'], sep))
+ let mvn_classpath = s:AddToClasspath(mvn_classpath, output_dir)
+
+ let test_output_dir = get(mvn_properties, 'project.build.testOutputDirectory', join(['target', 'test-classes'], sep))
+ let mvn_classpath = s:AddToClasspath(mvn_classpath, test_output_dir)
+
+ let g:syntastic_java_javac_maven_pom_ftime[pom] = getftime(pom)
+ let g:syntastic_java_javac_maven_pom_classpath[pom] = mvn_classpath
+ endif
+ return g:syntastic_java_javac_maven_pom_classpath[pom]
+ endif
+ return ''
+endfunction " }}}2
+
+function! s:MavenOutputDirectory() " {{{2
+ let pom = syntastic#util#findFileInParent('pom.xml', expand('%:p:h', 1))
+ if s:has_maven && filereadable(pom)
+ let mvn_properties = s:GetMavenProperties()
+ let output_dir = get(mvn_properties, 'project.properties.build.dir', getcwd())
+
+ let sep = syntastic#util#Slash()
+ let src_main_dir = get(mvn_properties, 'project.build.sourceDirectory', join(['src', 'main', 'java'], sep))
+ let src_test_dir = get(mvn_properties, 'project.build.testsourceDirectory', join(['src', 'test', 'java'], sep))
+ if stridx(expand('%:p:h', 1), src_main_dir) >= 0
+ let output_dir = get(mvn_properties, 'project.build.outputDirectory', join ([output_dir, 'target', 'classes'], sep))
+ endif
+ if stridx(expand('%:p:h', 1), src_test_dir) >= 0
+ let output_dir = get(mvn_properties, 'project.build.testOutputDirectory', join([output_dir, 'target', 'test-classes'], sep))
+ endif
+
+ if has('win32unix')
+ let output_dir = syntastic#util#CygwinPath(output_dir)
+ endif
+ return output_dir
+ endif
+ return '.'
+endfunction " }}}2
+
+" }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'java',
+ \ 'name': 'javac'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/closurecompiler.vim b/vim/bundle/syntastic/syntax_checkers/javascript/closurecompiler.vim
new file mode 100644
index 0000000..8c4190a
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/javascript/closurecompiler.vim
@@ -0,0 +1,76 @@
+"============================================================================
+"File: closurecompiler.vim
+"Description: Javascript syntax checker - using Google Closure Compiler
+"Maintainer: Motohiro Takayama <mootoh at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_javascript_closurecompiler_checker')
+ finish
+endif
+let g:loaded_syntastic_javascript_closurecompiler_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_javascript_closurecompiler_IsAvailable() dict
+ call syntastic#log#deprecationWarn('javascript_closure_compiler_path', 'javascript_closurecompiler_path')
+
+ if !executable(self.getExec())
+ return 0
+ endif
+
+ let s:has_script = exists('g:syntastic_javascript_closurecompiler_script')
+ if s:has_script
+ return 1
+ endif
+
+ let cp = get(g:, 'syntastic_javascript_closurecompiler_path', '')
+ call self.log('g:syntastic_javascript_closurecompiler_path =', cp)
+
+ let jar = expand(cp, 1)
+ call self.log('filereadable(' . string(jar) . ') = ' . filereadable(jar))
+
+ return filereadable(jar)
+endfunction
+
+function! SyntaxCheckers_javascript_closurecompiler_GetLocList() dict
+ call syntastic#log#deprecationWarn('javascript_closure_compiler_options', 'javascript_closurecompiler_args')
+ call syntastic#log#deprecationWarn('javascript_closure_compiler_file_list', 'javascript_closurecompiler_file_list')
+
+ let flist = expand(get(g:, 'syntastic_javascript_closurecompiler_file_list', ''), 1)
+ if filereadable(flist)
+ let file_list = map( readfile(flist), 'expand(v:var, 1)' )
+ else
+ let file_list = [expand('%', 1)]
+ endif
+
+ let makeprg = self.makeprgBuild({
+ \ 'exe_after': (s:has_script ? [] : ['-jar', expand(g:syntastic_javascript_closurecompiler_path, 1)]),
+ \ 'args_after': '--js',
+ \ 'fname': file_list })
+
+ let errorformat =
+ \ '%-GOK,'.
+ \ '%E%f:%l: ERROR - %m,'.
+ \ '%W%f:%l: WARNING - %m,'.
+ \ '%Z%p^'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'javascript',
+ \ 'name': 'closurecompiler',
+ \ 'exec': get(g:, 'syntastic_javascript_closurecompiler_script', 'java')})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/eslint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/eslint.vim
new file mode 100644
index 0000000..437bc55
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/javascript/eslint.vim
@@ -0,0 +1,78 @@
+"============================================================================
+"File: eslint.vim
+"Description: Javascript syntax checker - using eslint
+"Maintainer: Maksim Ryzhikov <rv.maksim at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_javascript_eslint_checker')
+ finish
+endif
+let g:loaded_syntastic_javascript_eslint_checker = 1
+
+if !exists('g:syntastic_javascript_eslint_sort')
+ let g:syntastic_javascript_eslint_sort = 1
+endif
+
+if !exists('g:syntastic_javascript_eslint_generic')
+ let g:syntastic_javascript_eslint_generic = 0
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_javascript_eslint_IsAvailable() dict
+ if g:syntastic_javascript_eslint_generic
+ call self.log('generic eslint, exec =', self.getExec())
+ endif
+
+ if !executable(self.getExec())
+ return 0
+ endif
+ return g:syntastic_javascript_eslint_generic || syntastic#util#versionIsAtLeast(self.getVersion(), [0, 1])
+endfunction
+
+function! SyntaxCheckers_javascript_eslint_GetLocList() dict
+ if !g:syntastic_javascript_eslint_generic
+ call syntastic#log#deprecationWarn('javascript_eslint_conf', 'javascript_eslint_args',
+ \ "'--config ' . syntastic#util#shexpand(OLD_VAR)")
+ endif
+
+ let makeprg = self.makeprgBuild({ 'args_before': (g:syntastic_javascript_eslint_generic ? '' : '-f compact') })
+
+ let errorformat =
+ \ '%E%f: line %l\, col %c\, Error - %m,' .
+ \ '%W%f: line %l\, col %c\, Warning - %m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['guards'] })
+
+ if !g:syntastic_javascript_eslint_generic
+ if !exists('s:eslint_new')
+ let s:eslint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1])
+ endif
+
+ if !s:eslint_new
+ for e in loclist
+ let e['col'] += 1
+ endfor
+ endif
+ endif
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'javascript',
+ \ 'name': 'eslint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/flow.vim b/vim/bundle/syntastic/syntax_checkers/javascript/flow.vim
new file mode 100644
index 0000000..13ee47a
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/javascript/flow.vim
@@ -0,0 +1,67 @@
+"============================================================================
+"File: flow.vim
+"Description: Javascript syntax checker - using flow
+"Maintainer: Michael Robinson <mike@pagesofinterest.net>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_javascript_flow_checker')
+ finish
+endif
+let g:loaded_syntastic_javascript_flow_checker = 1
+
+if !exists('g:syntastic_javascript_flow_sort')
+ let g:syntastic_javascript_flow_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_javascript_flow_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 6])
+endfunction
+
+function! SyntaxCheckers_javascript_flow_GetLocList() dict
+ if syntastic#util#findFileInParent('.flowconfig', expand('%:p:h', 1)) ==# ''
+ return []
+ endif
+
+ let makeprg = self.makeprgBuild({
+ \ 'exe': self.getExecEscaped() . ' check',
+ \ 'args_after': '--show-all-errors --json' })
+
+ let errorformat =
+ \ '%f:%l:%c:%n: %m,' .
+ \ '%f:%l:%c: %m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'flow',
+ \ 'defaults': {'type': 'E'} })
+
+ for e in loclist
+ if get(e, 'col', 0) && get(e, 'nr', 0)
+ let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['nr'] + 1) . 'c'
+ let e['nr'] = 0
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'javascript',
+ \ 'name': 'flow'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/gjslint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/gjslint.vim
new file mode 100644
index 0000000..3368905
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/javascript/gjslint.vim
@@ -0,0 +1,46 @@
+"============================================================================
+"File: gjslint.vim
+"Description: Javascript syntax checker - using gjslint
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_javascript_gjslint_checker')
+ finish
+endif
+let g:loaded_syntastic_javascript_gjslint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_javascript_gjslint_GetLocList() dict
+ call syntastic#log#deprecationWarn('javascript_gjslint_conf', 'javascript_gjslint_args')
+
+ let makeprg = self.makeprgBuild({
+ \ 'args': '--nodebug_indentation',
+ \ 'args_after': '--check_html --nosummary --unix_mode --nobeep' })
+
+ let errorformat =
+ \ "%f:%l:(New Error -%\\?\%n) %m," .
+ \ "%f:%l:(-%\\?%n) %m," .
+ \ "%-G1 files checked," .
+ \ " no errors found.," .
+ \ "%-G%.%#"
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'javascript',
+ \ 'name': 'gjslint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/jscs.vim b/vim/bundle/syntastic/syntax_checkers/javascript/jscs.vim
new file mode 100644
index 0000000..d259086
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/javascript/jscs.vim
@@ -0,0 +1,53 @@
+"============================================================================
+"File: jscs.vim
+"Description: Javascript syntax checker - using jscs
+"Maintainer: LCD 47 <lcd047@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_javascript_jscs_checker')
+ finish
+endif
+let g:loaded_syntastic_javascript_jscs_checker = 1
+
+if !exists('g:syntastic_javascript_jscs_sort')
+ let g:syntastic_javascript_jscs_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_javascript_jscs_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 1])
+endfunction
+
+function! SyntaxCheckers_javascript_jscs_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '--no-colors --max-errors -1 --reporter json' })
+
+ let errorformat = '%f:%l:%c:%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'preprocess': 'jscs',
+ \ 'defaults': {'type': 'E'},
+ \ 'returns': [0, 2] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'javascript',
+ \ 'name': 'jscs'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/jshint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/jshint.vim
new file mode 100644
index 0000000..492aa69
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/javascript/jshint.vim
@@ -0,0 +1,60 @@
+"============================================================================
+"File: jshint.vim
+"Description: Javascript syntax checker - using jshint
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_javascript_jshint_checker')
+ finish
+endif
+let g:loaded_syntastic_javascript_jshint_checker = 1
+
+if !exists('g:syntastic_javascript_jshint_sort')
+ let g:syntastic_javascript_jshint_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_javascript_jshint_IsAvailable() dict
+ call syntastic#log#deprecationWarn('jshint_exec', 'javascript_jshint_exec')
+ if !executable(self.getExec())
+ return 0
+ endif
+
+ let ver = self.getVersion()
+ let s:jshint_new = syntastic#util#versionIsAtLeast(ver, [1, 1])
+
+ return syntastic#util#versionIsAtLeast(ver, [1])
+endfunction
+
+function! SyntaxCheckers_javascript_jshint_GetLocList() dict
+ call syntastic#log#deprecationWarn('javascript_jshint_conf', 'javascript_jshint_args',
+ \ "'--config ' . syntastic#util#shexpand(OLD_VAR)")
+
+ let makeprg = self.makeprgBuild({ 'args_after': (s:jshint_new ? '--verbose ' : '') })
+
+ let errorformat = s:jshint_new ?
+ \ '%A%f: line %l\, col %v\, %m \(%t%*\d\)' :
+ \ '%E%f: line %l\, col %v\, %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')},
+ \ 'returns': [0, 2] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'javascript',
+ \ 'name': 'jshint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/jsl.vim b/vim/bundle/syntastic/syntax_checkers/javascript/jsl.vim
new file mode 100644
index 0000000..aa9862b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/javascript/jsl.vim
@@ -0,0 +1,48 @@
+"============================================================================
+"File: jsl.vim
+"Description: Javascript syntax checker - using jsl
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_javascript_jsl_checker')
+ finish
+endif
+let g:loaded_syntastic_javascript_jsl_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_javascript_jsl_GetLocList() dict
+ call syntastic#log#deprecationWarn('javascript_jsl_conf', 'javascript_jsl_args',
+ \ "'-conf ' . syntastic#util#shexpand(OLD_VAR)")
+
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '-nologo -nofilelisting -nosummary -nocontext -process' })
+
+ let errorformat =
+ \ '%W%f(%l): lint warning: %m,'.
+ \ '%-Z%p^,'.
+ \ '%W%f(%l): warning: %m,'.
+ \ '%-Z%p^,'.
+ \ '%E%f(%l): SyntaxError: %m,'.
+ \ '%-Z%p^,'.
+ \ '%-G'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'javascript',
+ \ 'name': 'jsl'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/jslint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/jslint.vim
new file mode 100644
index 0000000..e2ce76c
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/javascript/jslint.vim
@@ -0,0 +1,51 @@
+"============================================================================
+"File: jslint.vim
+"Description: Javascript syntax checker - using jslint
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_javascript_jslint_checker')
+ finish
+endif
+
+let g:loaded_syntastic_javascript_jslint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_javascript_jslint_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], '\mExpected .* and instead saw ''\zs.*\ze''')
+ if term !=# ''
+ let term = '\V\<' . escape(term, '\') . '\>'
+ endif
+ return term
+endfunction
+
+function! SyntaxCheckers_javascript_jslint_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args': '--white --nomen --regexp --plusplus --bitwise --newcap --sloppy --vars' })
+
+ let errorformat =
+ \ '%E %##%\d%\+ %m,'.
+ \ '%-Z%.%#Line %l\, Pos %c,'.
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'javascript',
+ \ 'name': 'jslint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/jsxhint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/jsxhint.vim
new file mode 100644
index 0000000..e29ce06
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/javascript/jsxhint.vim
@@ -0,0 +1,56 @@
+"============================================================================
+"File: jsxhint.vim
+"Description: Javascript syntax checker - using jsxhint
+"Maintainer: Thomas Boyt <me@thomasboyt.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_javascript_jsxhint_checker')
+ finish
+endif
+let g:loaded_syntastic_javascript_jsxhint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict " {{{1
+ if !executable(self.getExec())
+ return 0
+ endif
+
+ let version_output = syntastic#util#system(self.getExecEscaped() . ' --version')
+ let parsed_ver = !v:shell_error && (version_output =~# '\m^JSXHint\>') ? syntastic#util#parseVersion(version_output) : []
+ if len(parsed_ver)
+ call self.setVersion(parsed_ver)
+ else
+ call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', split(version_output, "\n", 1))
+ call syntastic#log#error("checker javascript/jsxhint: can't parse version string (abnormal termination?)")
+ endif
+
+ return syntastic#util#versionIsAtLeast(parsed_ver, [0, 4, 1])
+endfunction " }}}1
+
+function! SyntaxCheckers_javascript_jsxhint_GetLocList() dict " {{{1
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '--verbose' })
+
+ let errorformat = '%A%f: line %l\, col %v\, %m \(%t%*\d\)'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')} })
+endfunction " }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'javascript',
+ \ 'name': 'jsxhint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/mixedindentlint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/mixedindentlint.vim
new file mode 100644
index 0000000..2995409
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/javascript/mixedindentlint.vim
@@ -0,0 +1,40 @@
+"============================================================================
+"File: mixedindentlint.vim
+"Description: Mixed indentation linter for vim
+"Maintainer: Payton Swick <payton@foolord.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_javascript_mixedindentlint_checker')
+ finish
+endif
+let g:loaded_syntastic_javascript_mixedindentlint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_javascript_mixedindentlint_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat = 'Line %l in "%f" %.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'defaults': { 'text': 'Indentation differs from rest of file' },
+ \ 'returns': [0, 1] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'javascript',
+ \ 'name': 'mixedindentlint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/standard.vim b/vim/bundle/syntastic/syntax_checkers/javascript/standard.vim
new file mode 100644
index 0000000..e652bd0
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/javascript/standard.vim
@@ -0,0 +1,55 @@
+"============================================================================
+"File: standard.vim
+"Description: JavaScript syntax checker - using standard
+"Maintainer: LCD 47 <lcd047@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_javascript_standard_checker')
+ finish
+endif
+let g:loaded_syntastic_javascript_standard_checker = 1
+
+if !exists('g:syntastic_javascript_standard_generic')
+ let g:syntastic_javascript_standard_generic = 0
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_javascript_standard_IsAvailable() dict
+ if g:syntastic_javascript_standard_generic
+ call self.log('generic standard, exec =', self.getExec())
+ endif
+
+ if !executable(self.getExec())
+ return 0
+ endif
+ return g:syntastic_javascript_standard_generic || syntastic#util#versionIsAtLeast(self.getVersion(), [2, 6, 1])
+endfunction
+
+function! SyntaxCheckers_javascript_standard_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args': '-v' })
+
+ let errorformat = ' %f:%l:%c: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'defaults': {'type': 'W'},
+ \ 'returns': [0, 1] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'javascript',
+ \ 'name': 'standard'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/javascript/tern_lint.vim b/vim/bundle/syntastic/syntax_checkers/javascript/tern_lint.vim
new file mode 100644
index 0000000..547942b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/javascript/tern_lint.vim
@@ -0,0 +1,53 @@
+"============================================================================
+"File: tern_lint.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_javascript_tern_lint_checker')
+ finish
+endif
+let g:loaded_syntastic_javascript_tern_lint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_javascript_tern_lint_IsAvailable() dict
+ return has('byte_offset') && executable(self.getExec())
+endfunction
+
+function! SyntaxCheckers_javascript_tern_lint_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat = '%f:%t:%l:%c:%n:%m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'tern_lint',
+ \ 'returns': [0] })
+
+ for e in loclist
+ if get(e, 'col', 0) && get(e, 'nr', 0)
+ let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['nr'] + 1) . 'c'
+ endif
+ let e['nr'] = 0
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'javascript',
+ \ 'name': 'tern_lint',
+ \ 'exec': 'tern-lint' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/json/jsonlint.vim b/vim/bundle/syntastic/syntax_checkers/json/jsonlint.vim
new file mode 100644
index 0000000..9a89c78
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/json/jsonlint.vim
@@ -0,0 +1,43 @@
+"============================================================================
+"File: jsonlint.vim
+"Description: JSON syntax checker - using jsonlint
+"Maintainer: Miller Medeiros <contact at millermedeiros dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_json_jsonlint_checker')
+ finish
+endif
+let g:loaded_syntastic_json_jsonlint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_json_jsonlint_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'post_args_after': '--compact' })
+
+ let errorformat =
+ \ '%ELine %l:%c,'.
+ \ '%Z\\s%#Reason: %m,'.
+ \ '%C%.%#,'.
+ \ '%f: line %l\, col %c\, %m,'.
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'json',
+ \ 'name': 'jsonlint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/json/jsonval.vim b/vim/bundle/syntastic/syntax_checkers/json/jsonval.vim
new file mode 100644
index 0000000..2a756b6
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/json/jsonval.vim
@@ -0,0 +1,41 @@
+"============================================================================
+"File: jsonval.vim
+"Description: JSON syntax checker - using jsonval
+"Maintainer: Miller Medeiros <contact at millermedeiros dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_json_jsonval_checker')
+ finish
+endif
+let g:loaded_syntastic_json_jsonval_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_json_jsonval_GetLocList() dict
+ " based on https://gist.github.com/1196345
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%E%f: %m at line %l,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'json',
+ \ 'name': 'jsonval'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/less/less-lint.coffee b/vim/bundle/syntastic/syntax_checkers/less/less-lint.coffee
new file mode 100644
index 0000000..0b05e4a
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/less/less-lint.coffee
@@ -0,0 +1,41 @@
+#!/usr/bin/env node
+
+fs = require 'fs'
+less = require 'less'
+args = process.argv.slice(1)
+options = {}
+
+args = args.filter (arg) ->
+ match = arg.match(/^-I(.+)$/)
+ if match
+ options.paths.push(match[1]);
+ return false
+
+ match = arg.match(/^--?([a-z][\-0-9a-z]*)(?:=([^\s]+))?$/i)
+ if match
+ arg = match[1]
+ else
+ return arg
+
+ switch arg
+ when 'strict-imports' then options.strictImports = true
+ when 'include-path'
+ options.paths = match[2].split(if os.type().match(/Windows/) then ';' else ':')
+ .map (p) ->
+ if p
+ return path.resolve(process.cwd(), p)
+ when 'O0' then options.optimization = 0
+ when 'O1' then options.optimization = 1
+ when 'O2' then options.optimization = 2
+
+options.filename = args[1]
+
+parser = new(less.Parser) options
+
+fs.readFile(options.filename, 'utf-8', (err,data) ->
+ parser.parse(data, (err, tree) ->
+ if err
+ less.writeError err
+ process.exit(1)
+ )
+)
diff --git a/vim/bundle/syntastic/syntax_checkers/less/less-lint.js b/vim/bundle/syntastic/syntax_checkers/less/less-lint.js
new file mode 100644
index 0000000..5abc653
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/less/less-lint.js
@@ -0,0 +1,57 @@
+// Generated by CoffeeScript 1.3.3
+(function() {
+ var args, fs, less, options, parser;
+
+ fs = require('fs');
+
+ less = require('less');
+
+ args = process.argv.slice(1);
+
+ options = {};
+
+ args = args.filter(function(arg) {
+ var match;
+ match = arg.match(/^-I(.+)$/);
+ if (match) {
+ options.paths.push(match[1]);
+ return false;
+ }
+ match = arg.match(/^--?([a-z][\-0-9a-z]*)(?:=([^\s]+))?$/i);
+ if (match) {
+ arg = match[1];
+ } else {
+ return arg;
+ }
+ switch (arg) {
+ case 'strict-imports':
+ return options.strictImports = true;
+ case 'include-path':
+ return options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':').map(function(p) {
+ if (p) {
+ return path.resolve(process.cwd(), p);
+ }
+ });
+ case 'O0':
+ return options.optimization = 0;
+ case 'O1':
+ return options.optimization = 1;
+ case 'O2':
+ return options.optimization = 2;
+ }
+ });
+
+ options.filename = args[1];
+
+ parser = new less.Parser(options);
+
+ fs.readFile(options.filename, 'utf-8', function(err, data) {
+ return parser.parse(data, function(err, tree) {
+ if (err) {
+ less.writeError(err);
+ return process.exit(1);
+ }
+ });
+ });
+
+}).call(this);
diff --git a/vim/bundle/syntastic/syntax_checkers/less/lessc.vim b/vim/bundle/syntastic/syntax_checkers/less/lessc.vim
new file mode 100644
index 0000000..ad4035e
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/less/lessc.vim
@@ -0,0 +1,59 @@
+"============================================================================
+"File: less.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Julien Blanchard <julien at sideburns dot eu>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_less_lessc_checker')
+ finish
+endif
+let g:loaded_syntastic_less_lessc_checker = 1
+
+if !exists('g:syntastic_less_use_less_lint')
+ let g:syntastic_less_use_less_lint = 0
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+let s:node_file = 'node ' . syntastic#util#shescape(expand('<sfile>:p:h', 1) . syntastic#util#Slash() . 'less-lint.js')
+
+function! SyntaxCheckers_less_lessc_IsAvailable() dict
+ call self.log('g:syntastic_less_use_less_lint =', g:syntastic_less_use_less_lint)
+ return g:syntastic_less_use_less_lint ? executable('node') : executable(self.getExec())
+endfunction
+
+function! SyntaxCheckers_less_lessc_GetLocList() dict
+ call syntastic#log#deprecationWarn('less_options', 'less_lessc_args')
+
+ let makeprg = self.makeprgBuild({
+ \ 'exe': (g:syntastic_less_use_less_lint ? s:node_file : self.getExecEscaped()),
+ \ 'args_after': '--no-color',
+ \ 'tail': '> ' . syntastic#util#DevNull() })
+
+ let errorformat =
+ \ '%m in %f on line %l\, column %c:,' .
+ \ '%m in %f:%l:%c,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['guards'],
+ \ 'defaults': {'bufnr': bufnr(''), 'text': 'Syntax error'} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'less',
+ \ 'name': 'lessc'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/less/recess.vim b/vim/bundle/syntastic/syntax_checkers/less/recess.vim
new file mode 100644
index 0000000..1a8d876
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/less/recess.vim
@@ -0,0 +1,44 @@
+"============================================================================
+"File: recess.vim
+"Description: Syntax checking plugin for syntastic.vim using `recess`
+" (http://twitter.github.io/recess/).
+"Maintainer: Tim Carry <tim at pixelastic dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_less_recess_checker')
+ finish
+endif
+let g:loaded_syntastic_less_recess_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_less_recess_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'post_args_after': '--format=compact --stripColors' })
+
+ let errorformat =
+ \ '%E%m in %f,' .
+ \ '%Z %#%l.%.%#,' .
+ \ '%f:%l:%m,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'less',
+ \ 'name': 'recess'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/lex/flex.vim b/vim/bundle/syntastic/syntax_checkers/lex/flex.vim
new file mode 100644
index 0000000..82cbf10
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/lex/flex.vim
@@ -0,0 +1,50 @@
+"============================================================================
+"File: lex.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_lex_flex_checker')
+ finish
+endif
+let g:loaded_syntastic_lex_flex_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_lex_flex_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'],
+ \ '\m^\(unrecognized %option\|bad <start condition>\|bad character\( class expression\)\=\): \zs.*')
+ if term ==# ''
+ let term = matchstr(a:item['text'],
+ \ '\m^\(Definition value for\|undefined definition\) \zs{[^}]\+}\ze')
+ endif
+
+ return term !=# '' ? '\V' . escape(term, '\') : ''
+endfunction
+
+function! SyntaxCheckers_lex_flex_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': syntastic#c#NullOutput() })
+
+ let errorformat = '%f:%l: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'lex',
+ \ 'name': 'flex'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/limbo/limbo.vim b/vim/bundle/syntastic/syntax_checkers/limbo/limbo.vim
new file mode 100644
index 0000000..0dfe03c
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/limbo/limbo.vim
@@ -0,0 +1,46 @@
+"============================================================================
+"File: limbo.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Alex Efros <powerman-asdf@ya.ru>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_limbo_limbo_checker')
+ finish
+endif
+let g:loaded_syntastic_limbo_limbo_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_limbo_limbo_GetLocList() dict
+ let include = $INFERNO_HOME !=# '' ? '-I$INFERNO_HOME ' : ''
+ " don't generate .dis in current dir while checking syntax,
+ " .dis should be generated by `mk`
+ let output = filereadable('mkfile') ? (' ' . syntastic#c#NullOutput()) : ''
+
+ let makeprg = self.makeprgBuild({ 'args_before': include . '-w' . output })
+
+ let errorformat = '%E%f:%l:%m'
+ if expand('%', 1) =~# '\m\.m$'
+ let errorformat = '%-G%f:%l: near ` EOF ` : no implementation module,' . errorformat
+ endif
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'limbo',
+ \ 'name': 'limbo' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/lisp/clisp.vim b/vim/bundle/syntastic/syntax_checkers/lisp/clisp.vim
new file mode 100644
index 0000000..26de435
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/lisp/clisp.vim
@@ -0,0 +1,57 @@
+"============================================================================
+"File: lisp.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Karl Yngve Lervåg <karl.yngve@lervag.net>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_lisp_clisp_checker')
+ finish
+endif
+let g:loaded_syntastic_lisp_clisp_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_lisp_clisp_GetLocList() dict
+ let tmpdir = syntastic#util#tmpdir()
+ let out = tmpdir !=# '.' ? ('-o ' . syntastic#util#shescape(tmpdir . syntastic#util#Slash() . 'syntastic_' . getpid())) : ''
+
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '-q',
+ \ 'fname_before': '-c',
+ \ 'post_args_after': out })
+
+ let errorformat =
+ \ '%-G;%.%#,' .
+ \ '%W%>WARNING:%.%# line %l : %m,' .
+ \ '%Z %#%m,' .
+ \ '%W%>WARNING:%.%# lines %l%\%.%\%.%\d%\+ : %m,' .
+ \ '%Z %#%m,' .
+ \ '%E%>The following functions were %m,' .
+ \ '%Z %m,' .
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')} })
+
+ call syntastic#util#rmrf(tmpdir)
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'lisp',
+ \ 'name': 'clisp'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/llvm/llvm.vim b/vim/bundle/syntastic/syntax_checkers/llvm/llvm.vim
new file mode 100644
index 0000000..7e90314
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/llvm/llvm.vim
@@ -0,0 +1,39 @@
+"============================================================================
+"File: llvm.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Andrew Kelley <superjoe30@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_llvm_llvm_checker')
+ finish
+endif
+let g:loaded_syntastic_llvm_llvm_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_llvm_llvm_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': syntastic#c#NullOutput() })
+
+ let errorformat = 'llc: %f:%l:%c: %trror: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'llvm',
+ \ 'name': 'llvm',
+ \ 'exec': 'llc'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/lua/luac.vim b/vim/bundle/syntastic/syntax_checkers/lua/luac.vim
new file mode 100644
index 0000000..178f76a
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/lua/luac.vim
@@ -0,0 +1,65 @@
+"============================================================================
+"File: lua.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_lua_luac_checker')
+ finish
+endif
+let g:loaded_syntastic_lua_luac_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos)
+ let result = ''
+ let near = matchstr(a:pos['text'], '\mnear ''\zs[^'']\+\ze''')
+ if near !=# ''
+ if near ==# '<eof>'
+ let p = getpos('$')
+ let a:pos['lnum'] = p[1]
+ let a:pos['col'] = p[2]
+ let result = '\%' . p[2] . 'c'
+ else
+ let result = '\V' . escape(near, '\')
+ endif
+
+ " XXX the following piece of code is evil, and is likely to break
+ " in future versions of syntastic; enable it at your own risk :)
+
+ "let open = matchstr(a:pos['text'], '\m(to close ''\zs[^'']\+\ze'' at line [0-9]\+)')
+ "if open != ''
+ " let line = str2nr(matchstr(a:pos['text'], '\m(to close ''[^'']\+'' at line \zs[0-9]\+\ze)'))
+ " let group = a:pos['type'] ==? 'E' ? 'SyntasticError' : 'SyntasticWarning'
+ " call matchadd(group, '\%' . line . 'l\V' . escape(open, '\'))
+ "endif
+ endif
+ return result
+endfunction
+
+function! SyntaxCheckers_lua_luac_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-p' })
+
+ let errorformat = 'luac: %#%f:%l: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': { 'bufnr': bufnr(''), 'type': 'E' } })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'lua',
+ \ 'name': 'luac'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/lua/luacheck.vim b/vim/bundle/syntastic/syntax_checkers/lua/luacheck.vim
new file mode 100644
index 0000000..5c8521d
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/lua/luacheck.vim
@@ -0,0 +1,67 @@
+"============================================================================
+"File: luacheck.vim
+"Description: Lua static analysis using luacheck
+"Maintainer: Thiago Bastos <tbastos@tbastos.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_lua_luacheck_checker')
+ finish
+endif
+let g:loaded_syntastic_lua_luacheck_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_lua_luacheck_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], '\m''\zs\S\+\ze''')
+ if term !=# ''
+ return '\V\<' . escape(term, '\') . '\>'
+ endif
+
+ let term = matchstr(a:item['text'], '\m\(accessing undefined\|setting non-standard global\|' .
+ \ 'setting non-module global\|unused global\) variable \zs\S\+')
+ if term ==# ''
+ let term = matchstr(a:item['text'], '\mvariable \zs\S\+\ze was previously defined')
+ endif
+ if term ==# ''
+ let term = matchstr(a:item['text'], '\munused \(variable\|argument\|loop variable\) \zs\S\+')
+ endif
+ if term ==# ''
+ let term = matchstr(a:item['text'], '\m\(value assigned to variable\|value of argument\|' .
+ \ 'value of loop variable\) \zs\S\+')
+ endif
+ if term ==# ''
+ let term = matchstr(a:item['text'], '\mvariable \zs\S\+\ze is never set')
+ endif
+
+ return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : ''
+endfunction
+
+function! SyntaxCheckers_lua_luacheck_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '--no-color' })
+
+ let errorformat =
+ \ '%f:%l:%c: %m,'.
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'defaults': { 'type': 'W' },
+ \ 'returns': [0, 1, 2] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'lua',
+ \ 'name': 'luacheck' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/markdown/mdl.vim b/vim/bundle/syntastic/syntax_checkers/markdown/mdl.vim
new file mode 100644
index 0000000..17dc86d
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/markdown/mdl.vim
@@ -0,0 +1,45 @@
+"============================================================================
+"File: mdl.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Charles Beynon <etothepiipower at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_markdown_mdl_checker')
+ finish
+endif
+let g:loaded_syntastic_markdown_mdl_checker = 1
+
+if !exists('g:syntastic_markdown_mdl_sort')
+ let g:syntastic_markdown_mdl_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_markdown_mdl_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args': '--warnings' })
+
+ let errorformat =
+ \ '%E%f:%\s%\=%l: %m,'.
+ \ '%W%f: Kramdown Warning: %m found on line %l'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'markdown',
+ \ 'name': 'mdl'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/markdown/textlint.vim b/vim/bundle/syntastic/syntax_checkers/markdown/textlint.vim
new file mode 100644
index 0000000..3419d4d
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/markdown/textlint.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: textlint.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_markdown_textlint_checker')
+ finish
+endif
+let g:loaded_syntastic_markdown_textlint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'markdown',
+ \ 'name': 'textlint',
+ \ 'redirect': 'text/textlint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/matlab/mlint.vim b/vim/bundle/syntastic/syntax_checkers/matlab/mlint.vim
new file mode 100644
index 0000000..6e0b8d1
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/matlab/mlint.vim
@@ -0,0 +1,41 @@
+"============================================================================
+"File: matlab.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Jason Graham <jason at the-graham dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_matlab_mlint_checker')
+ finish
+endif
+let g:loaded_syntastic_matlab_mlint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_matlab_mlint_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-id $*' })
+
+ let errorformat =
+ \ 'L %l (C %c): %*[a-zA-Z0-9]: %m,'.
+ \ 'L %l (C %c-%*[0-9]): %*[a-zA-Z0-9]: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'matlab',
+ \ 'name': 'mlint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/mercury/mmc.vim b/vim/bundle/syntastic/syntax_checkers/mercury/mmc.vim
new file mode 100644
index 0000000..75ee654
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/mercury/mmc.vim
@@ -0,0 +1,49 @@
+"============================================================================
+"File: mercury.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Joshua Rahm (joshuarahm@gmail.com)
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_mercury_mmc_checker')
+ finish
+endif
+let g:loaded_syntastic_mercury_mmc_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_mercury_mmc_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_before': '-e' })
+
+ let errorformat =
+ \ '%C%f:%l: %m,' .
+ \ '%E%f:%l: %m,' .
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+
+ for e in loclist
+ if stridx(e['text'], ' warning:') >= 0
+ let e['type'] = 'W'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'mercury',
+ \ 'name': 'mmc'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/nasm/nasm.vim b/vim/bundle/syntastic/syntax_checkers/nasm/nasm.vim
new file mode 100644
index 0000000..e309c1f
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/nasm/nasm.vim
@@ -0,0 +1,41 @@
+"============================================================================
+"File: nasm.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Håvard Pettersson <haavard.pettersson at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_nasm_nasm_checker')
+ finish
+endif
+let g:loaded_syntastic_nasm_nasm_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_nasm_nasm_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '-X gnu -f elf' .
+ \ ' -I ' . syntastic#util#shescape(expand('%:p:h', 1) . syntastic#util#Slash()) .
+ \ ' ' . syntastic#c#NullOutput() })
+
+ let errorformat = '%f:%l: %t%*[^:]: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'nasm',
+ \ 'name': 'nasm'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/nix/nix.vim b/vim/bundle/syntastic/syntax_checkers/nix/nix.vim
new file mode 100644
index 0000000..f3c449d
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/nix/nix.vim
@@ -0,0 +1,45 @@
+"============================================================================
+"File: nix.vim
+"Description: Check nix syntax using 'nix-instantiate --eval-only'
+"Maintainer: Tim Cuthbertson <tim@gfxmonk.net>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+"
+"
+if exists('g:loaded_syntastic_nix_nix_checker')
+ finish
+endif
+let g:loaded_syntastic_nix_nix_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_nix_nix_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '--parse-only' })
+
+ let errorformat =
+ \ '%f:%l:%c:%m,' .
+ \ '%f:%l:%m,' .
+ \ '%f:%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'type': 'e'},
+ \ 'preprocess': 'nix' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'nix',
+ \ 'name': 'nix',
+ \ 'exec': 'nix-instantiate' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/nroff/igor.vim b/vim/bundle/syntastic/syntax_checkers/nroff/igor.vim
new file mode 100644
index 0000000..dcad8c5
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/nroff/igor.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: igor.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_nroff_igor_checker')
+ finish
+endif
+let g:loaded_syntastic_nroff_igor_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'nroff',
+ \ 'name': 'igor',
+ \ 'redirect': 'docbk/igor'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/nroff/mandoc.vim b/vim/bundle/syntastic/syntax_checkers/nroff/mandoc.vim
new file mode 100644
index 0000000..8efc4ce
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/nroff/mandoc.vim
@@ -0,0 +1,41 @@
+"============================================================================
+"File: mandoc.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_nroff_mandoc_checker')
+ finish
+endif
+let g:loaded_syntastic_nroff_mandoc_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_nroff_mandoc_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-Tlint' })
+
+ let errorformat =
+ \ '%E%f:%l:%c: %tRROR: %m,' .
+ \ '%W%f:%l:%c: %tARNING: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 2, 3, 4] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'nroff',
+ \ 'name': 'mandoc'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/objc/gcc.vim b/vim/bundle/syntastic/syntax_checkers/objc/gcc.vim
new file mode 100644
index 0000000..73da7f8
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/objc/gcc.vim
@@ -0,0 +1,59 @@
+"============================================================================
+"File: objc.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_objc_gcc_checker')
+ finish
+endif
+let g:loaded_syntastic_objc_gcc_checker = 1
+
+if !exists('g:syntastic_objc_compiler_options')
+ let g:syntastic_objc_compiler_options = '-std=gnu99'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_objc_gcc_IsAvailable() dict
+ if !exists('g:syntastic_objc_compiler')
+ let g:syntastic_objc_compiler = executable(self.getExec()) ? self.getExec() : 'clang'
+ endif
+ call self.log('g:syntastic_objc_compiler =', g:syntastic_objc_compiler)
+ return executable(expand(g:syntastic_objc_compiler, 1))
+endfunction
+
+function! SyntaxCheckers_objc_gcc_GetLocList() dict
+ return syntastic#c#GetLocList('objc', 'gcc', {
+ \ 'errorformat':
+ \ '%-G%f:%s:,' .
+ \ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' .
+ \ '%-G%f:%l: %#error: %#for each function it appears%.%#,' .
+ \ '%-GIn file included%.%#,'.
+ \ '%-G %#from %f:%l\,,' .
+ \ '%f:%l:%c: %trror: %m,' .
+ \ '%f:%l:%c: %tarning: %m,' .
+ \ '%f:%l:%c: %m,' .
+ \ '%f:%l: %trror: %m,' .
+ \ '%f:%l: %tarning: %m,' .
+ \ '%f:%l: %m',
+ \ 'main_flags': '-x objective-c -fsyntax-only',
+ \ 'header_flags': '-x objective-c-header -lobjc',
+ \ 'header_names': '\m\.h$' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'objc',
+ \ 'name': 'gcc' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/objc/oclint.vim b/vim/bundle/syntastic/syntax_checkers/objc/oclint.vim
new file mode 100644
index 0000000..534d82b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/objc/oclint.vim
@@ -0,0 +1,22 @@
+"============================================================================
+"File: oclint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: "UnCO" Lin <undercooled aT lavabit com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_objc_oclint_checker')
+ finish
+endif
+let g:loaded_syntastic_objc_oclint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'objc',
+ \ 'name': 'oclint',
+ \ 'redirect': 'c/oclint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/objcpp/gcc.vim b/vim/bundle/syntastic/syntax_checkers/objcpp/gcc.vim
new file mode 100644
index 0000000..6ae7ba5
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/objcpp/gcc.vim
@@ -0,0 +1,59 @@
+"============================================================================
+"File: objcpp.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_objcpp_gcc_checker')
+ finish
+endif
+let g:loaded_syntastic_objcpp_gcc_checker = 1
+
+if !exists('g:syntastic_objcpp_compiler_options')
+ let g:syntastic_objcpp_compiler_options = '-std=gnu99'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_objcpp_gcc_IsAvailable() dict
+ if !exists('g:syntastic_c_compiler')
+ let g:syntastic_objcpp_compiler = executable(self.getExec()) ? self.getExec() : 'clang'
+ endif
+ call self.log('g:syntastic_objcpp_compiler =', g:syntastic_objcpp_compiler)
+ return executable(expand(g:syntastic_objcpp_compiler, 1))
+endfunction
+
+function! SyntaxCheckers_objcpp_gcc_GetLocList() dict
+ return syntastic#c#GetLocList('objcpp', 'gcc', {
+ \ 'errorformat':
+ \ '%-G%f:%s:,' .
+ \ '%-G%f:%l: %#error: %#(Each undeclared identifier is reported only%.%#,' .
+ \ '%-G%f:%l: %#error: %#for each function it appears%.%#,' .
+ \ '%-GIn file included%.%#,'.
+ \ '%-G %#from %f:%l\,,' .
+ \ '%f:%l:%c: %trror: %m,' .
+ \ '%f:%l:%c: %tarning: %m,' .
+ \ '%f:%l:%c: %m,' .
+ \ '%f:%l: %trror: %m,' .
+ \ '%f:%l: %tarning: %m,' .
+ \ '%f:%l: %m',
+ \ 'main_flags': '-x objective-c++ -fsyntax-only',
+ \ 'header_flags': '-x objective-c++-header -lobjc',
+ \ 'header_names': '\m\.h$' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'objcpp',
+ \ 'name': 'gcc' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/objcpp/oclint.vim b/vim/bundle/syntastic/syntax_checkers/objcpp/oclint.vim
new file mode 100644
index 0000000..5528258
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/objcpp/oclint.vim
@@ -0,0 +1,22 @@
+"============================================================================
+"File: oclint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: "UnCO" Lin <undercooled aT lavabit com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_objcpp_oclint_checker')
+ finish
+endif
+let g:loaded_syntastic_objcpp_oclint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'objcpp',
+ \ 'name': 'oclint',
+ \ 'redirect': 'c/oclint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/ocaml/camlp4o.vim b/vim/bundle/syntastic/syntax_checkers/ocaml/camlp4o.vim
new file mode 100644
index 0000000..f7f34e7
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/ocaml/camlp4o.vim
@@ -0,0 +1,130 @@
+"============================================================================
+"File: ocaml.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Török Edwin <edwintorok at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_ocaml_camlp4o_checker')
+ finish
+endif
+let g:loaded_syntastic_ocaml_camlp4o_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" Checker options {{{1
+
+if !exists('g:syntastic_ocaml_use_ocamlc') || !executable('ocamlc')
+ let g:syntastic_ocaml_use_ocamlc = 0
+endif
+
+if !exists('g:syntastic_ocaml_use_janestreet_core')
+ let g:syntastic_ocaml_use_janestreet_core = 0
+endif
+
+if !exists('g:syntastic_ocaml_janestreet_core_dir')
+ let g:syntastic_ocaml_janestreet_core_dir = '.'
+endif
+
+if !exists('g:syntastic_ocaml_use_ocamlbuild') || !executable('ocamlbuild')
+ let g:syntastic_ocaml_use_ocamlbuild = 0
+endif
+
+" }}}1
+
+function! SyntaxCheckers_ocaml_camlp4o_IsAvailable() dict " {{{1
+ let s:ocamlpp = get(g:, 'syntastic_ocaml_camlp4r', 0) ? 'camlp4r' : 'camlp4o'
+ return executable(s:ocamlpp)
+endfunction " }}}1
+
+function! SyntaxCheckers_ocaml_camlp4o_GetLocList() dict " {{{1
+ let makeprg = s:GetMakeprg()
+ if makeprg ==# ''
+ return []
+ endif
+
+ let errorformat =
+ \ '%WWarning: File "%f"\, line %l\, chars %c-%n:,'.
+ \ '%WWarning: line %l\, chars %c-%n:,'.
+ \ '%AFile "%f"\, line %l\, characters %c-%n:,'.
+ \ '%AFile "%f"\, line %l\, characters %c-%*\d (end at line %*\d\, character %*\d):,'.
+ \ '%AFile "%f"\, line %l\, character %c:,'.
+ \ '%AFile "%f"\, line %l\, character %c:%m,'.
+ \ '%-GPreprocessing error %.%#,'.
+ \ '%-GCommand exited %.%#,'.
+ \ '%C%tarning %*\d: %m,'.
+ \ '%C%m,'.
+ \ '%-G+%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')} })
+
+ for e in loclist
+ if get(e, 'col', 0) && get(e, 'nr', 0)
+ let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['nr'] + 1) . 'c'
+ let e['nr'] = 0
+ endif
+ endfor
+
+ return loclist
+endfunction " }}}1
+
+" Utilities {{{1
+
+function! s:GetMakeprg() " {{{2
+ return
+ \ g:syntastic_ocaml_use_ocamlc ? g:syntastic_ocaml_use_ocamlc :
+ \ (g:syntastic_ocaml_use_ocamlbuild && isdirectory('_build')) ? s:GetOcamlcMakeprg() :
+ \ s:GetOtherMakeprg()
+endfunction " }}}2
+
+function! s:GetOcamlcMakeprg() " {{{2
+ let build_cmd = g:syntastic_ocaml_use_janestreet_core ?
+ \ 'ocamlc -I ' . syntastic#util#shexpand(g:syntastic_ocaml_janestreet_core_dir) : 'ocamlc'
+ let build_cmd .= ' -c ' . syntastic#util#shexpand('%')
+ return build_cmd
+endfunction " }}}2
+
+function! s:GetOcamlBuildMakeprg() " {{{2
+ return 'ocamlbuild -quiet -no-log -tag annot,' . s:ocamlpp . ' -no-links -no-hygiene -no-sanitize ' .
+ \ syntastic#util#shexpand('%:r') . '.cmi'
+endfunction " }}}2
+
+function! s:GetOtherMakeprg() " {{{2
+ "TODO: give this function a better name?
+ "
+ "TODO: should use throw/catch instead of returning an empty makeprg
+
+ let extension = expand('%:e', 1)
+ let makeprg = ''
+
+ if stridx(extension, 'mly') >= 0 && executable('menhir')
+ " ocamlyacc output can't be redirected, so use menhir
+ let makeprg = 'menhir --only-preprocess ' . syntastic#util#shexpand('%') . ' >' . syntastic#util#DevNull()
+ elseif stridx(extension,'mll') >= 0 && executable('ocamllex')
+ let makeprg = 'ocamllex -q ' . syntastic#c#NullOutput() . ' ' . syntastic#util#shexpand('%')
+ else
+ let makeprg = 'camlp4o ' . syntastic#c#NullOutput() . ' ' . syntastic#util#shexpand('%')
+ endif
+
+ return makeprg
+endfunction " }}}2
+
+" }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'ocaml',
+ \ 'name': 'camlp4o'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/perl/perl.vim b/vim/bundle/syntastic/syntax_checkers/perl/perl.vim
new file mode 100644
index 0000000..e039518
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/perl/perl.vim
@@ -0,0 +1,94 @@
+"============================================================================
+"File: perl.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com>,
+" Eric Harmon <http://eharmon.net>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+"
+" Security:
+"
+" This checker runs 'perl -c' against your file, which in turn executes
+" any BEGIN, UNITCHECK, and CHECK blocks, and any use statements in
+" your file. This is probably fine if you wrote the file yourself,
+" but it can be a problem if you're trying to check third party files.
+" If you are 100% willing to let Vim run the code in your file, set
+" g:syntastic_enable_perl_checker to 1 in your vimrc to enable this
+" checker:
+"
+" let g:syntastic_enable_perl_checker = 1
+"
+" References:
+"
+" - http://perldoc.perl.org/perlrun.html#*-c*
+
+if exists('g:loaded_syntastic_perl_perl_checker')
+ finish
+endif
+let g:loaded_syntastic_perl_perl_checker = 1
+
+if !exists('g:syntastic_perl_lib_path')
+ let g:syntastic_perl_lib_path = []
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_perl_perl_IsAvailable() dict " {{{1
+ if !exists('g:syntastic_perl_perl_exec') && exists('g:syntastic_perl_interpreter')
+ let g:syntastic_perl_perl_exec = g:syntastic_perl_interpreter
+ endif
+
+ " don't call executable() here, to allow things like
+ " let g:syntastic_perl_interpreter='/usr/bin/env perl'
+ silent! call syntastic#util#system(self.getExecEscaped() . ' -e ' . syntastic#util#shescape('exit(0)'))
+ return v:shell_error == 0
+endfunction " }}}1
+
+function! SyntaxCheckers_perl_perl_GetLocList() dict " {{{1
+ if type(g:syntastic_perl_lib_path) == type('')
+ call syntastic#log#oneTimeWarn('variable g:syntastic_perl_lib_path should be a list')
+ let includes = split(g:syntastic_perl_lib_path, ',')
+ else
+ let includes = copy(syntastic#util#var('perl_lib_path'))
+ endif
+ let shebang = syntastic#util#parseShebang()
+ let extra = join(map(includes, '"-I" . v:val')) .
+ \ (index(shebang['args'], '-T') >= 0 ? ' -T' : '') .
+ \ (index(shebang['args'], '-t') >= 0 ? ' -t' : '')
+ let errorformat = '%f:%l:%m'
+
+ let makeprg = self.makeprgBuild({ 'args_before': '-c -X ' . extra })
+
+ let errors = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'perl',
+ \ 'defaults': {'type': 'E'} })
+ if !empty(errors)
+ return errors
+ endif
+
+ let makeprg = self.makeprgBuild({ 'args_before': '-c -Mwarnings ' . extra })
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'perl',
+ \ 'defaults': {'type': 'W'} })
+endfunction " }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'perl',
+ \ 'name': 'perl',
+ \ 'enable': 'enable_perl_checker'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/perl/perlcritic.vim b/vim/bundle/syntastic/syntax_checkers/perl/perlcritic.vim
new file mode 100644
index 0000000..abe9f43
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/perl/perlcritic.vim
@@ -0,0 +1,52 @@
+"============================================================================
+"File: perlcritic.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_perl_perlcritic_checker')
+ finish
+endif
+let g:loaded_syntastic_perl_perlcritic_checker = 1
+
+if !exists('g:syntastic_perl_perlcritic_thres')
+ let g:syntastic_perl_perlcritic_thres = 5
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_perl_perlcritic_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '--quiet --nocolor --verbose "\%s:\%f:\%l:\%c:(\%s) \%m (\%e)\n"' })
+
+ let errorformat = '%t:%f:%l:%c:%m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 2],
+ \ 'subtype': 'Style' })
+
+ " change error types according to the prescribed threshold
+ for e in loclist
+ let e['type'] = e['type'] < g:syntastic_perl_perlcritic_thres ? 'W' : 'E'
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'perl',
+ \ 'name': 'perlcritic'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/perl/podchecker.vim b/vim/bundle/syntastic/syntax_checkers/perl/podchecker.vim
new file mode 100644
index 0000000..cad39bd
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/perl/podchecker.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: podchecker.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_perl_podchecker_checker')
+ finish
+endif
+let g:loaded_syntastic_perl_podchecker_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'perl',
+ \ 'name': 'podchecker',
+ \ 'redirect': 'pod/podchecker'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/php/php.vim b/vim/bundle/syntastic/syntax_checkers/php/php.vim
new file mode 100644
index 0000000..5b118f6
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/php/php.vim
@@ -0,0 +1,52 @@
+"============================================================================
+"File: php.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_php_php_checker')
+ finish
+endif
+let g:loaded_syntastic_php_php_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_php_php_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], "\\munexpected '\\zs[^']\\+\\ze'")
+ return term !=# '' ? '\V' . escape(term, '\') : ''
+endfunction
+
+function! SyntaxCheckers_php_php_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args': '-d error_reporting=E_ALL',
+ \ 'args_after': '-l -d display_errors=1 -d log_errors=0 -d xdebug.cli_color=0' })
+
+ let errorformat =
+ \ '%-GNo syntax errors detected in%.%#,'.
+ \ 'Parse error: %#syntax %trror\, %m in %f on line %l,'.
+ \ 'Parse %trror: %m in %f on line %l,'.
+ \ 'Fatal %trror: %m in %f on line %l,'.
+ \ '%-G\s%#,'.
+ \ '%-GErrors parsing %.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['guards'] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'php',
+ \ 'name': 'php'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/php/phpcs.vim b/vim/bundle/syntastic/syntax_checkers/php/phpcs.vim
new file mode 100644
index 0000000..1bd8f98
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/php/phpcs.vim
@@ -0,0 +1,41 @@
+"============================================================================
+"File: phpcs.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_php_phpcs_checker')
+ finish
+endif
+let g:loaded_syntastic_php_phpcs_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_php_phpcs_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '--report=csv' })
+
+ let errorformat =
+ \ '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity%.%#,'.
+ \ '"%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'php',
+ \ 'name': 'phpcs' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/php/phplint.vim b/vim/bundle/syntastic/syntax_checkers/php/phplint.vim
new file mode 100644
index 0000000..d04f3ba
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/php/phplint.vim
@@ -0,0 +1,91 @@
+"============================================================================
+"File: phplint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_php_phplint_checker')
+ finish
+endif
+let g:loaded_syntastic_php_phplint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_php_phplint_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
+ if term !=# ''
+ return '\V' . escape(term, '\')
+ endif
+ let term = matchstr(a:item['text'], '\m\(class\|function\|method\) \zs\S\+\ze was declared as')
+ if term !=# ''
+ return '\V' . escape(term, '\')
+ endif
+ let term = matchstr(a:item['text'], '\maccess forbidden to \(private\|protected\) \(class\|constant\|method\|variable\|\(private\|protected\) property\) \zs\S\+\ze')
+ if term !=# ''
+ return '\V' . escape(term, '\')
+ endif
+ let term = matchstr(a:item['text'], '\musing deprecated \(class\|constant\|method\|property\|variable\) \zs\S\+\ze')
+ if term !=# ''
+ return '\V' . escape(term, '\')
+ endif
+ let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
+ if term !=# ''
+ return '\V' . escape(term, '\')
+ endif
+ let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
+ if term !=# ''
+ return '\V' . escape(term, '\')
+ endif
+ let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
+ return term !=# '' ? '\V' . escape(term, '\') : ''
+endfunction
+
+function! SyntaxCheckers_php_phplint_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_after':
+ \ '--print-file-name ' .
+ \ '--print-line-numbers ' .
+ \ '--print-column-number ' .
+ \ '--print-errors ' .
+ \ '--print-warnings ' .
+ \ '--no-print-notices ' .
+ \ '--no-print-context ' .
+ \ '--no-print-source ' .
+ \ '--tab-size ' . &tabstop })
+
+ let errorformat =
+ \ '%E%f:%l:%v: %tRROR: %m,' .
+ \ '%W%f:%l:%v: %tarning: %m,' .
+ \ '%+C%\t%.%#,' .
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['compressWhitespace'],
+ \ 'subtype': 'Style',
+ \ 'returns': [0, 1] })
+
+ for e in loclist
+ let e['text'] = substitute(e['text'], '\m \(Hint\|Examples\):.*', '', '')
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'php',
+ \ 'name': 'phplint',
+ \ 'exec': 'phpl' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/php/phpmd.vim b/vim/bundle/syntastic/syntax_checkers/php/phpmd.vim
new file mode 100644
index 0000000..5207d3d
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/php/phpmd.vim
@@ -0,0 +1,77 @@
+"============================================================================
+"File: phpmd.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_php_phpmd_checker')
+ finish
+endif
+let g:loaded_syntastic_php_phpmd_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_php_phpmd_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], '\m\C^The \S\+ \w\+\(()\)\= \(has\|is not\|utilizes\)')
+ if term !=# ''
+ return '\V'.substitute(term, '\m\C^The \S\+ \(\w\+\)\(()\)\= .*', '\1', '')
+ endif
+ let term = matchstr(a:item['text'], '\m\C^Avoid \(variables with short\|excessively long variable\) names like \S\+\.')
+ if term !=# ''
+ return '\V'.substitute(term, '\m\C^Avoid \(variables with short\|excessively long variable\) names like \(\S\+\)\..*', '\2', '')
+ endif
+ let term = matchstr(a:item['text'], '\m\C^Avoid using short method names like \S\+::\S\+()\.')
+ if term !=# ''
+ return '\V'.substitute(term, '\m\C^Avoid using short method names like \S\+::\(\S\+\)()\..*', '\1', '')
+ endif
+ let term = matchstr(a:item['text'], '\m\C^\S\+ accesses the super-global variable ')
+ if term !=# ''
+ return '\V'.substitute(term, '\m\C accesses the super-global variable .*$', '', '')
+ endif
+ let term = matchstr(a:item['text'], '\m\C^Constant \S\+ should be defined in uppercase')
+ if term !=# ''
+ return '\V'.substitute(term, '\m\C^Constant \(\S\+\) should be defined in uppercase', '\1', '')
+ endif
+ let term = matchstr(a:item['text'], "\\m\\C^The '\\S\\+()' method which returns ")
+ if term !=# ''
+ return '\V'.substitute(term, "\\m\\C^The '\\(\\S\\+\\)()' method which returns.*", '\1', '')
+ endif
+ let term = matchstr(a:item['text'], '\m\C variable \S\+ should begin with ')
+ if term !=# ''
+ return '\V'.substitute(term, '\m\C.* variable \(\S\+\) should begin with .*', '\1', '')
+ endif
+ let term = matchstr(a:item['text'], "\\m\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\S\\+'")
+ if term !=# ''
+ return '\V'.substitute(term, "\\m\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\(\\S\\+\\)'.*", '\2', '')
+ endif
+ return ''
+endfunction
+
+function! SyntaxCheckers_php_phpmd_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'post_args_before': 'text',
+ \ 'post_args': 'codesize,design,unusedcode,naming' })
+
+ let errorformat = '%E%f:%l%\s%#%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype' : 'Style' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'php',
+ \ 'name': 'phpmd'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/po/msgfmt.vim b/vim/bundle/syntastic/syntax_checkers/po/msgfmt.vim
new file mode 100644
index 0000000..1d09733
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/po/msgfmt.vim
@@ -0,0 +1,50 @@
+"============================================================================
+"File: msgfmt.vim
+"Description: Syntax checking plugin for po files of gettext
+"Maintainer: Ryo Okubo <syucream1031@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_po_msgfmt_checker')
+ finish
+endif
+let g:loaded_syntastic_po_msgfmt_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_po_msgfmt_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], '\mkeyword "\zs[^"]\+\ze" unknown')
+ return term !=# '' ? '\V' . escape(term, '\') : ''
+endfunction
+
+function! SyntaxCheckers_po_msgfmt_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-c ' . syntastic#c#NullOutput() })
+
+ let errorformat =
+ \ '%W%f:%l: warning: %m,' .
+ \ '%E%f:%l:%v: %m,' .
+ \ '%E%f:%l: %m,' .
+ \ '%+C %.%#,' .
+ \ '%Z%p^,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['compressWhitespace'] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'po',
+ \ 'name': 'msgfmt'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/pod/podchecker.vim b/vim/bundle/syntastic/syntax_checkers/pod/podchecker.vim
new file mode 100644
index 0000000..9ef5dca
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/pod/podchecker.vim
@@ -0,0 +1,51 @@
+"============================================================================
+"File: podchecker.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_pod_podchecker_checker')
+ finish
+endif
+let g:loaded_syntastic_pod_podchecker_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_pod_podchecker_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%W%[%#]%[%#]%[%#] WARNING: %m at line %l in file %f,' .
+ \ '%W%[%#]%[%#]%[%#] WARNING: %m at line EOF in file %f,' .
+ \ '%E%[%#]%[%#]%[%#] ERROR: %m at line %l in file %f,' .
+ \ '%E%[%#]%[%#]%[%#] ERROR: %m at line EOF in file %f'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 1, 2] })
+
+ for e in loclist
+ if e['valid'] && e['lnum'] == 0
+ let e['lnum'] = str2nr(matchstr(e['text'], '\m\<line \zs\d\+\ze'))
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'pod',
+ \ 'name': 'podchecker'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/pug/pug_lint.vim b/vim/bundle/syntastic/syntax_checkers/pug/pug_lint.vim
new file mode 100644
index 0000000..880838e
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/pug/pug_lint.vim
@@ -0,0 +1,40 @@
+"============================================================================
+"File: pug_lint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Ben Parnell <benjaminparnell.94@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_pug_pug_lint_checker')
+ finish
+endif
+let g:loaded_syntastic_pug_pug_lint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_pug_pug_lint_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-r inline' })
+
+ let errorformat = '%f:%l:%c %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 2] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'pug',
+ \ 'name': 'pug_lint',
+ \ 'exec': 'pug-lint' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/puppet/puppet.vim b/vim/bundle/syntastic/syntax_checkers/puppet/puppet.vim
new file mode 100644
index 0000000..83077c7
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/puppet/puppet.vim
@@ -0,0 +1,47 @@
+"============================================================================
+"File: puppet.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Eivind Uggedal <eivind at uggedal dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_puppet_puppet_checker')
+ finish
+endif
+let g:loaded_syntastic_puppet_puppet_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_puppet_puppet_GetLocList() dict
+ if !exists('s:puppet_new')
+ let s:puppet_new = syntastic#util#versionIsAtLeast(self.getVersion(), [2, 7, 0])
+ endif
+
+ let makeprg = self.makeprgBuild({
+ \ 'args_before': (s:puppet_new ? 'parser validate --color=false' : '--color=false --parseonly') })
+
+ let errorformat =
+ \ '%-Gerr: Try ''puppet help parser validate'' for usage,' .
+ \ '%-GError: Try ''puppet help parser validate'' for usage,' .
+ \ '%A%t%*[a-zA-Z]: %m at %f:%l:%c,' .
+ \ '%A%t%*[a-zA-Z]: %m at %f:%l'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'puppet',
+ \ 'name': 'puppet'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/puppet/puppetlint.vim b/vim/bundle/syntastic/syntax_checkers/puppet/puppetlint.vim
new file mode 100644
index 0000000..a492db6
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/puppet/puppetlint.vim
@@ -0,0 +1,52 @@
+"============================================================================
+"File: puppetlint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Eivind Uggedal <eivind at uggedal dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_puppet_puppetlint_checker')
+ finish
+endif
+let g:loaded_syntastic_puppet_puppetlint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_puppet_puppetlint_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ let s:puppetlint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1])
+ return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 2])
+endfunction
+
+function! SyntaxCheckers_puppet_puppetlint_GetLocList() dict
+ call syntastic#log#deprecationWarn('puppet_lint_arguments', 'puppet_puppetlint_args')
+
+ let makeprg = self.makeprgBuild({
+ \ 'args_after':
+ \ '--log-format "%{KIND} [%{check}] %{message} at %{fullpath}:' .
+ \ (s:puppetlint_new ? '%{line}' : '%{linenumber}') . '"' })
+
+ let errorformat = '%t%*[a-zA-Z] %m at %f:%l'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'puppet',
+ \ 'name': 'puppetlint',
+ \ 'exec': 'puppet-lint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/python/codec.py b/vim/bundle/syntastic/syntax_checkers/python/codec.py
new file mode 100755
index 0000000..6e980c7
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/codec.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+
+from __future__ import print_function
+from sys import argv, exit
+
+import codecs
+import re
+import os
+
+
+if len(argv) != 2:
+ exit(1)
+
+try:
+ with open(argv[1]) as fle:
+ text = fle.readlines()
+
+ if text:
+ match = re.match(r"#\s*coding\s*:\s*(?P<coding>\w+)", text[0])
+ if match:
+ text = codecs.lookup(match.groupdict()["coding"]).incrementaldecoder().decode(
+ ''.join(text).encode('utf-8')).encode('utf-8')
+
+ if isinstance(text, list):
+ text = ''.join(text).encode('utf-8')
+
+ compile(text, argv[1], 'exec', 0, 1)
+except SyntaxError as err:
+ print('%s:%s:%s: %s' % (err.filename, err.lineno, err.offset, err.msg))
+except Exception as err:
+ print('%s:%s:%s: %s' % (os.path.abspath(argv[1]), 1, 0, err))
diff --git a/vim/bundle/syntastic/syntax_checkers/python/compile.py b/vim/bundle/syntastic/syntax_checkers/python/compile.py
new file mode 100755
index 0000000..32f1413
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/compile.py
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+
+from __future__ import print_function
+from sys import argv, exit
+
+
+if len(argv) != 2:
+ exit(1)
+
+try:
+ compile(open(argv[1]).read(), argv[1], 'exec', 0, 1)
+except SyntaxError as err:
+ print('%s:%s:%s: %s' % (err.filename, err.lineno, err.offset, err.msg))
diff --git a/vim/bundle/syntastic/syntax_checkers/python/flake8.vim b/vim/bundle/syntastic/syntax_checkers/python/flake8.vim
new file mode 100644
index 0000000..257b69d
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/flake8.vim
@@ -0,0 +1,72 @@
+"============================================================================
+"File: flake8.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Authors: Sylvain Soliman <Sylvain dot Soliman+git at gmail dot com>
+" kstep <me@kstep.me>
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_python_flake8_checker')
+ finish
+endif
+let g:loaded_syntastic_python_flake8_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_python_flake8_GetHighlightRegex(item)
+ return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:item)
+endfunction
+
+function! SyntaxCheckers_python_flake8_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%E%f:%l: could not compile,%-Z%p^,' .
+ \ '%A%f:%l:%c: %t%n %m,' .
+ \ '%A%f:%l: %t%n %m,' .
+ \ '%-G%.%#'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env })
+
+ for e in loclist
+ " E*** and W*** are pep8 errors
+ " F*** are PyFlakes codes
+ " C*** are McCabe complexity messages
+ " N*** are naming conventions from pep8-naming
+
+ if has_key(e, 'nr')
+ let e['text'] .= printf(' [%s%03d]', e['type'], e['nr'])
+ " E901 are syntax errors
+ " E902 are I/O errors
+ if e['type'] ==? 'E' && e['nr'] !~# '\m^9'
+ let e['subtype'] = 'Style'
+ endif
+ call remove(e, 'nr')
+ endif
+
+ if e['type'] =~? '\m^[CNW]'
+ let e['subtype'] = 'Style'
+ endif
+
+ let e['type'] = e['type'] =~? '\m^[EFC]' ? 'E' : 'W'
+ endfor
+
+ return loclist
+endfunction
+
+runtime! syntax_checkers/python/pyflakes.vim
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'python',
+ \ 'name': 'flake8'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/python/frosted.vim b/vim/bundle/syntastic/syntax_checkers/python/frosted.vim
new file mode 100644
index 0000000..d642795
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/frosted.vim
@@ -0,0 +1,63 @@
+"============================================================================
+"File: frosted.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_python_frosted_checker')
+ finish
+endif
+let g:loaded_syntastic_python_frosted_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_python_frosted_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-vb' })
+
+ let errorformat =
+ \ '%f:%l:%c:%m,' .
+ \ '%E%f:%l: %m,' .
+ \ '%-Z%p^,' .
+ \ '%-G%.%#'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env,
+ \ 'returns': [0, 1] })
+
+ for e in loclist
+ let e['col'] += 1
+
+ let parts = matchlist(e.text, '\v^([EW]\d+):([^:]*):(.+)')
+ if len(parts) >= 4
+ let e['type'] = parts[1][0]
+ let e['text'] = parts[3] . ' [' . parts[1] . ']'
+ let e['hl'] = '\V\<' . escape(parts[2], '\') . '\>'
+ elseif e['text'] =~? '\v^I\d+:'
+ let e['valid'] = 0
+ else
+ let e['vcol'] = 0
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'python',
+ \ 'name': 'frosted' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/python/mypy.vim b/vim/bundle/syntastic/syntax_checkers/python/mypy.vim
new file mode 100644
index 0000000..19ca1fd
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/mypy.vim
@@ -0,0 +1,36 @@
+"============================================================================
+"File: mypy.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Author: Russ Hewgill <Russ dot Hewgill at gmail dot com>
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_python_mypy_checker')
+ finish
+endif
+let g:loaded_syntastic_python_mypy_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_python_mypy_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat = '%f:%l:%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': { 'type': 'E' },
+ \ 'returns': [0, 1],
+ \ 'preprocess': 'mypy' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'python',
+ \ 'name': 'mypy'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/python/pep257.vim b/vim/bundle/syntastic/syntax_checkers/python/pep257.vim
new file mode 100644
index 0000000..e59166b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/pep257.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: pep257.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_python_pep257_checker')
+ finish
+endif
+let g:loaded_syntastic_python_pep257_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'python',
+ \ 'name': 'pep257',
+ \ 'redirect': 'python/pydocstyle'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/python/pep8.vim b/vim/bundle/syntastic/syntax_checkers/python/pep8.vim
new file mode 100644
index 0000000..80ab980
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/pep8.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: pep8.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_python_pep8_checker')
+ finish
+endif
+let g:loaded_syntastic_python_pep8_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'python',
+ \ 'name': 'pep8',
+ \ 'redirect': 'python/pycodestyle'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/python/prospector.vim b/vim/bundle/syntastic/syntax_checkers/python/prospector.vim
new file mode 100644
index 0000000..c5e4735
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/prospector.vim
@@ -0,0 +1,73 @@
+"============================================================================
+"File: prospector.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_python_prospector_checker')
+ finish
+endif
+let g:loaded_syntastic_python_prospector_checker = 1
+
+if !exists('g:syntastic_python_prospector_sort')
+ let g:syntastic_python_prospector_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_python_prospector_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 7])
+endfunction
+
+function! SyntaxCheckers_python_prospector_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '--messages-only --absolute-paths --die-on-tool-error --zero-exit --output-format json' })
+
+ let errorformat = '%f:%l:%c: %m'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env,
+ \ 'preprocess': 'prospector',
+ \ 'returns': [0] })
+
+ for e in loclist
+ if e['text'] =~# '\v\[%(dodgy|mccabe|pep8|pep257|pyroma)\]$'
+ let e['subtype'] = 'Style'
+ endif
+
+ if e['text'] =~# '\v\[pylint\]$'
+ let e['type'] = e['text'] =~? '\m^[CRW]' ? 'W' : 'E'
+ elseif e['text'] =~# '\v\[%(frosted|pep8)\]$'
+ let e['type'] = e['text'] =~? '\m^W' ? 'W' : 'E'
+ elseif e['text'] =~# '\v\[%(dodgy|pyroma|vulture)\]$'
+ let e['type'] = 'W'
+ else
+ let e['type'] = 'E'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'python',
+ \ 'name': 'prospector'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/python/py3kwarn.vim b/vim/bundle/syntastic/syntax_checkers/python/py3kwarn.vim
new file mode 100644
index 0000000..b0e7771
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/py3kwarn.vim
@@ -0,0 +1,36 @@
+"============================================================================
+"File: py3kwarn.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Authors: Liam Curry <liam@curry.name>
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_python_py3kwarn_checker')
+ finish
+endif
+let g:loaded_syntastic_python_py3kwarn_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_python_py3kwarn_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat = '%W%f:%l:%c: %m'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'python',
+ \ 'name': 'py3kwarn'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/python/pycodestyle.vim b/vim/bundle/syntastic/syntax_checkers/python/pycodestyle.vim
new file mode 100644
index 0000000..3b1e705
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/pycodestyle.vim
@@ -0,0 +1,48 @@
+"============================================================================
+"File: pycodestyle.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_python_pycodestyle_checker')
+ finish
+endif
+let g:loaded_syntastic_python_pycodestyle_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_python_pycodestyle_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat = '%f:%l:%c: %m'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env,
+ \ 'subtype': 'Style' })
+
+ for e in loclist
+ let e['type'] = e['text'] =~? '^W' ? 'W' : 'E'
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'python',
+ \ 'name': 'pycodestyle'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/python/pydocstyle.vim b/vim/bundle/syntastic/syntax_checkers/python/pydocstyle.vim
new file mode 100644
index 0000000..05ea6b3
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/pydocstyle.vim
@@ -0,0 +1,66 @@
+"============================================================================
+"File: pydocstyle.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_python_pydocstyle_checker')
+ finish
+endif
+let g:loaded_syntastic_python_pydocstyle_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_python_pydocstyle_GetLocList() dict
+ if !exists('s:pydocstyle_new')
+ let s:pydocstyle_new = syntastic#util#versionIsAtLeast(self.getVersion(), [0, 3])
+ endif
+
+ let makeprg = self.makeprgBuild({})
+
+ if s:pydocstyle_new
+ let errorformat =
+ \ '%E%f:%l %.%#:,' .
+ \ '%+C %m'
+ else
+ let errorformat =
+ \ '%E%f:%l:%c%\%.%\%.%\d%\+:%\d%\+: %m,' .
+ \ '%E%f:%l:%c: %m,' .
+ \ '%+C %m'
+ endif
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env,
+ \ 'subtype': 'Style',
+ \ 'preprocess': 'killEmpty',
+ \ 'postprocess': ['compressWhitespace'] })
+
+ if s:pydocstyle_new == 0
+ " byte offsets rather than column numbers
+ for e in loclist
+ let e['col'] = get(e, 'col', 0) + 1
+ endfor
+ endif
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'python',
+ \ 'name': 'pydocstyle'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/python/pyflakes.vim b/vim/bundle/syntastic/syntax_checkers/python/pyflakes.vim
new file mode 100644
index 0000000..d403135
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/pyflakes.vim
@@ -0,0 +1,74 @@
+"============================================================================
+"File: pyflakes.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Authors: Martin Grenfell <martin.grenfell@gmail.com>
+" kstep <me@kstep.me>
+" Parantapa Bhattacharya <parantapa@gmail.com>
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_python_pyflakes_checker')
+ finish
+endif
+let g:loaded_syntastic_python_pyflakes_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_python_pyflakes_GetHighlightRegex(i)
+ if stridx(a:i['text'], 'is assigned to but never used') >= 0
+ \ || stridx(a:i['text'], 'imported but unused') >= 0
+ \ || stridx(a:i['text'], 'undefined name') >= 0
+ \ || stridx(a:i['text'], 'redefinition of') >= 0
+ \ || stridx(a:i['text'], 'referenced before assignment') >= 0
+ \ || stridx(a:i['text'], 'duplicate argument') >= 0
+ \ || stridx(a:i['text'], 'after other statements') >= 0
+ \ || stridx(a:i['text'], 'shadowed by loop variable') >= 0
+
+ " fun with Python's %r: try "..." first, then '...'
+ let term = matchstr(a:i['text'], '\m^.\{-}"\zs.\{-1,}\ze"')
+ if term !=# ''
+ return '\V\<' . escape(term, '\') . '\>'
+ endif
+
+ let term = matchstr(a:i['text'], '\m^.\{-}''\zs.\{-1,}\ze''')
+ if term !=# ''
+ return '\V\<' . escape(term, '\') . '\>'
+ endif
+ endif
+ return ''
+endfunction
+
+function! SyntaxCheckers_python_pyflakes_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%E%f:%l: could not compile,'.
+ \ '%-Z%p^,'.
+ \ '%E%f:%l:%c: %m,'.
+ \ '%E%f:%l: %m,'.
+ \ '%-G%.%#'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env,
+ \ 'defaults': {'text': 'Syntax error'} })
+
+ for e in loclist
+ let e['vcol'] = 0
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'python',
+ \ 'name': 'pyflakes'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/python/pylama.vim b/vim/bundle/syntastic/syntax_checkers/python/pylama.vim
new file mode 100644
index 0000000..d4aab0a
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/pylama.vim
@@ -0,0 +1,79 @@
+"============================================================================
+"File: pylama.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_python_pylama_checker')
+ finish
+endif
+let g:loaded_syntastic_python_pylama_checker = 1
+
+if !exists('g:syntastic_python_pylama_sort')
+ let g:syntastic_python_pylama_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_python_pylama_GetHighlightRegex(item)
+ return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:item)
+endfunction
+
+function! SyntaxCheckers_python_pylama_GetLocList() dict
+ if !exists('s:pylama_new')
+ let s:pylama_new = syntastic#util#versionIsAtLeast(self.getVersion(), [4])
+ endif
+
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '-f pep8' . (s:pylama_new ? ' --force' : '') })
+
+ " TODO: "WARNING:pylama:..." messages are probably a logging bug
+ let errorformat =
+ \ '%-GWARNING:pylama:%.%#,' .
+ \ '%A%f:%l:%c: %m'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env })
+
+ " adjust for weirdness in each checker
+ for e in loclist
+ let e['type'] = e['text'] =~? '\m^[RCW]' ? 'W' : 'E'
+ if e['text'] =~# '\v\[%(isort|mccabe|pep257|pylint)\]$'
+ if has_key(e, 'col')
+ let e['col'] += 1
+ endif
+ endif
+ if e['text'] =~# '\v\[pylint\]$'
+ if has_key(e, 'vcol')
+ let e['vcol'] = 0
+ endif
+ endif
+ if e['text'] =~# '\v\[%(isort|mccabe|pep257|pep8)\]$'
+ let e['subtype'] = 'Style'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+runtime! syntax_checkers/python/pyflakes.vim
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'python',
+ \ 'name': 'pylama' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/python/pylint.vim b/vim/bundle/syntastic/syntax_checkers/python/pylint.vim
new file mode 100644
index 0000000..884d07a
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/pylint.vim
@@ -0,0 +1,98 @@
+"============================================================================
+"File: pylint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Parantapa Bhattacharya <parantapa at gmail dot com>
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_python_pylint_checker')
+ finish
+endif
+let g:loaded_syntastic_python_pylint_checker = 1
+
+if !exists('g:syntastic_python_pylint_sort')
+ let g:syntastic_python_pylint_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+let s:pylint_new = -1
+
+function! SyntaxCheckers_python_pylint_IsAvailable() dict " {{{1
+ if !executable(self.getExec())
+ return 0
+ endif
+
+ try
+ " On Windows the version is shown as "pylint-script.py 1.0.0".
+ " On Gentoo Linux it's "pylint-python2.7 0.28.0".
+ " On NixOS, that would be ".pylint-wrapped 0.26.0".
+ " On Arch Linux it's "pylint2 1.1.0".
+ " On new-ish Fedora it's "python3-pylint 1.2.0".
+ " Have you guys considered switching to creative writing yet? ;)
+
+ let version_output = syntastic#util#system(self.getExecEscaped() . ' --version')
+ let pylint_version = filter( split(version_output, '\m, \=\|\n'), 'v:val =~# ''\m^\(python[-0-9]*-\|\.\)\=pylint[-0-9]*\>''' )[0]
+ let parsed_ver = syntastic#util#parseVersion(substitute(pylint_version, '\v^\S+\s+', '', ''))
+ call self.setVersion(parsed_ver)
+
+ let s:pylint_new = syntastic#util#versionIsAtLeast(parsed_ver, [1])
+ catch /\m^Vim\%((\a\+)\)\=:E684/
+ call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', split(version_output, "\n", 1))
+ call syntastic#log#error("checker python/pylint: can't parse version string (abnormal termination?)")
+ let s:pylint_new = -1
+ endtry
+
+ return s:pylint_new >= 0
+endfunction " }}}1
+
+function! SyntaxCheckers_python_pylint_GetLocList() dict " {{{1
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': (s:pylint_new ?
+ \ '-f text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" -r n' :
+ \ '-f parseable -r n -i y') })
+
+ let errorformat =
+ \ '%A%f:%l:%c:%t: %m,' .
+ \ '%A%f:%l: %m,' .
+ \ '%A%f:(%l): %m,' .
+ \ '%-Z%p^%.%#,' .
+ \ '%-G%.%#'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env,
+ \ 'returns': range(32) })
+
+ for e in loclist
+ if !s:pylint_new
+ let e['type'] = e['text'][1]
+ endif
+
+ if e['type'] =~? '\m^[EF]'
+ let e['type'] = 'E'
+ elseif e['type'] =~? '\m^[CRW]'
+ let e['type'] = 'W'
+ else
+ let e['valid'] = 0
+ endif
+
+ let e['col'] += 1
+ let e['vcol'] = 0
+ endfor
+
+ return loclist
+endfunction " }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'python',
+ \ 'name': 'pylint' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/python/python.vim b/vim/bundle/syntastic/syntax_checkers/python/python.vim
new file mode 100644
index 0000000..17ad2c9
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/python/python.vim
@@ -0,0 +1,57 @@
+"============================================================================
+"File: python.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_python_python_checker')
+ finish
+endif
+let g:loaded_syntastic_python_python_checker = 1
+
+if !exists('g:syntastic_python_python_use_codec')
+ let g:syntastic_python_python_use_codec = 0
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+let s:base_path = expand('<sfile>:p:h', 1) . syntastic#util#Slash()
+
+function! SyntaxCheckers_python_python_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 6])
+endfunction
+
+function! SyntaxCheckers_python_python_GetLocList() dict
+ let compiler = s:base_path . (g:syntastic_python_python_use_codec ? 'codec.py' : 'compile.py')
+ call self.log('using compiler script', compiler)
+ let makeprg = self.makeprgBuild({ 'exe': [self.getExec(), compiler] })
+
+ let errorformat = '%E%f:%l:%c: %m'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env,
+ \ 'returns': [0] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'python',
+ \ 'name': 'python'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/qml/qmllint.vim b/vim/bundle/syntastic/syntax_checkers/qml/qmllint.vim
new file mode 100644
index 0000000..0aef61c
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/qml/qmllint.vim
@@ -0,0 +1,39 @@
+"============================================================================
+"File: qmllint.vim
+"Description: Syntax checking plugin for syntastic.vim using qmllint
+"Maintainer: Peter Wu <peter@lekensteyn.nl>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_qml_qmllint_checker')
+ finish
+endif
+let g:loaded_syntastic_qml_qmllint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_qml_qmllint_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat = '%f:%l : %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['guards'],
+ \ 'returns': [0, 255] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'qml',
+ \ 'name': 'qmllint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/r/lint.vim b/vim/bundle/syntastic/syntax_checkers/r/lint.vim
new file mode 100644
index 0000000..854c170
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/r/lint.vim
@@ -0,0 +1,82 @@
+"============================================================================
+"File: lint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_r_lint_checker')
+ finish
+endif
+let g:loaded_syntastic_r_lint_checker = 1
+
+if !exists('g:syntastic_r_lint_styles')
+ let g:syntastic_r_lint_styles = 'lint.style'
+endif
+
+if !exists('g:syntastic_r_lint_sort')
+ let g:syntastic_r_lint_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_r_lint_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], '\m`\zs[^`]\+\ze`')
+ if term ==# ''
+ let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'")
+ endif
+ return term !=# '' ? '\V' . escape(term, '\') : ''
+endfunction
+
+function! SyntaxCheckers_r_lint_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ call syntastic#util#system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(lint)'))
+ return v:shell_error == 0
+endfunction
+
+function! SyntaxCheckers_r_lint_GetLocList() dict
+ let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : ''
+ let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
+ \ ' -e ' . syntastic#util#shescape(setwd . 'library(lint); ' .
+ \ 'try(lint(commandArgs(TRUE), ' . g:syntastic_r_lint_styles . '))') .
+ \ ' --args ' . syntastic#util#shexpand('%')
+
+ let errorformat =
+ \ '%t:%f:%l:%v: %m,' .
+ \ '%t:%f:%l: %m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'preprocess': 'rparse',
+ \ 'returns': [0] })
+
+ for e in loclist
+ if e['type'] ==? 'F'
+ " parse error
+ let e['type'] = 'E'
+ call remove(e, 'subtype')
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'r',
+ \ 'name': 'lint',
+ \ 'exec': 'R' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/r/lintr.vim b/vim/bundle/syntastic/syntax_checkers/r/lintr.vim
new file mode 100644
index 0000000..7c71ec0
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/r/lintr.vim
@@ -0,0 +1,81 @@
+"============================================================================
+"File: lintr.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Jim Hester <james.f.hester at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+"
+" Security:
+"
+" This checker runs the code in your file. This is probably fine if you
+" wrote the file yourself, but it can be a problem if you're trying to
+" check third party files. If you are 100% willing to let Vim run the
+" code in your file, set g:syntastic_enable_r_lintr_checker to 1 in
+" your vimrc to enable this checker:
+"
+" let g:syntastic_enable_r_lintr_checker = 1
+
+if exists("g:loaded_syntastic_r_lintr_checker")
+ finish
+endif
+let g:loaded_syntastic_r_lintr_checker = 1
+
+if !exists('g:syntastic_r_lintr_linters')
+ let g:syntastic_r_lintr_linters = 'default_linters'
+endif
+
+if !exists('g:syntastic_r_lintr_cache')
+ let g:syntastic_r_lintr_cache = 'FALSE'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_r_lintr_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'")
+ return term != '' ? '\V' . escape(term, '\') : ''
+endfunction
+
+function! SyntaxCheckers_r_lintr_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ call system(self.getExecEscaped() . ' --slave --no-restore --no-save -e ' . syntastic#util#shescape('library(lintr)'))
+ return v:shell_error == 0
+endfunction
+
+function! SyntaxCheckers_r_lintr_GetLocList() dict
+ let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : ''
+ let makeprg = self.getExecEscaped() . ' --slave --no-restore --no-save' .
+ \ ' -e ' . syntastic#util#shescape(setwd . 'suppressPackageStartupMessages(library(lintr)); ' .
+ \ 'lint(cache = ' . g:syntastic_r_lintr_cache . ', commandArgs(TRUE), ' . g:syntastic_r_lintr_linters . ')') .
+ \ ' --args ' . syntastic#util#shexpand('%')
+
+ let errorformat =
+ \ '%W%f:%l:%c: style: %m,' .
+ \ '%W%f:%l:%c: warning: %m,' .
+ \ '%E%f:%l:%c: error: %m,'
+
+ call self.setWantSort(1)
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'r',
+ \ 'name': 'lintr',
+ \ 'exec': 'R',
+ \ 'enable': 'enable_r_lintr_checker'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/r/svtools.vim b/vim/bundle/syntastic/syntax_checkers/r/svtools.vim
new file mode 100644
index 0000000..d2a6a74
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/r/svtools.vim
@@ -0,0 +1,74 @@
+"============================================================================
+"File: svtools.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+"
+" Security:
+"
+" This checker runs the code in your file. This is probably fine if you
+" wrote the file yourself, but it can be a problem if you're trying to
+" check third party files. If you are 100% willing to let Vim run the
+" code in your file, set g:syntastic_enable_r_svtools_checker to 1 in
+" your vimrc to enable this checker:
+"
+" let g:syntastic_enable_r_svtools_checker = 1
+
+if exists('g:loaded_syntastic_r_svtools_checker')
+ finish
+endif
+let g:loaded_syntastic_r_svtools_checker = 1
+
+if !exists('g:syntastic_r_svtools_styles')
+ let g:syntastic_r_svtools_styles = 'lint.style'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_r_svtools_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'")
+ return term !=# '' ? '\V' . escape(term, '\') : ''
+endfunction
+
+function! SyntaxCheckers_r_svtools_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ call syntastic#util#system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(svTools)'))
+ return v:shell_error == 0
+endfunction
+
+function! SyntaxCheckers_r_svtools_GetLocList() dict
+ let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : ''
+ let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
+ \ ' -e ' . syntastic#util#shescape(setwd . 'library(svTools); ' .
+ \ 'try(lint(commandArgs(TRUE), filename = commandArgs(TRUE), type = "flat", sep = ":"))') .
+ \ ' --args ' . syntastic#util#shexpand('%')
+
+ let errorformat =
+ \ '%trror:%f:%\s%#%l:%\s%#%v:%m,' .
+ \ '%tarning:%f:%\s%#%l:%\s%#%v:%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'r',
+ \ 'name': 'svtools',
+ \ 'exec': 'R',
+ \ 'enable': 'enable_r_svtools_checker'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/racket/code-ayatollah.vim b/vim/bundle/syntastic/syntax_checkers/racket/code-ayatollah.vim
new file mode 100644
index 0000000..14463c4
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/racket/code-ayatollah.vim
@@ -0,0 +1,62 @@
+"============================================================================
+"File: code-ayatollah.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_racket_code_ayatollah_checker')
+ finish
+endif
+let g:loaded_syntastic_racket_code_ayatollah_checker = 1
+
+if !exists('g:syntastic_racket_code_ayatollah_script')
+ let g:syntastic_racket_code_ayatollah_script = 'code-ayatollah.rkt'
+endif
+
+if !exists('g:syntastic_racket_code_ayatollah_sort')
+ let g:syntastic_racket_code_ayatollah_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_racket_code_ayatollah_IsAvailable() dict
+ let s:script = expand(g:syntastic_racket_code_ayatollah_script, 1)
+ return executable(self.getExec()) && filereadable(s:script)
+endfunction
+
+function! SyntaxCheckers_racket_code_ayatollah_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'exe': [self.getExec(), s:script] })
+
+ let errorformat =
+ \ ' %l:%v: %m,' .
+ \ '%PErrors in %f:,' .
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style' })
+
+ for e in loclist
+ let e['col'] += 1
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'racket',
+ \ 'name': 'code_ayatollah',
+ \ 'exec': 'racket' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/racket/racket.vim b/vim/bundle/syntastic/syntax_checkers/racket/racket.vim
new file mode 100644
index 0000000..b563a5b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/racket/racket.vim
@@ -0,0 +1,51 @@
+"============================================================================
+"File: racket.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Author: Steve Bragg <steve at empresseffects dot com>
+"
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_racket_racket_checker')
+ finish
+endif
+let g:loaded_syntastic_racket_racket_checker=1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_racket_racket_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ " example of error message
+ "eval-apply.rkt:460:30: the-empty-environment: unbound identifier in module
+ " in: the-empty-environment
+ let errorformat = '%f:%l:%v: %m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+
+ for e in loclist
+ if has_key(e, 'col')
+ let e['col'] += 1
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'racket',
+ \ 'name': 'racket',
+ \ 'enable': 'enable_racket_racket_checker' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/rmd/lintr.vim b/vim/bundle/syntastic/syntax_checkers/rmd/lintr.vim
new file mode 100644
index 0000000..dcc235f
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/rmd/lintr.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: lintr.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Jim Hester <james.f.hester at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_rmd_lintr_checker')
+ finish
+endif
+let g:loaded_syntastic_rmd_lintr_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'rmd',
+ \ 'name': 'lintr',
+ \ 'redirect': 'r/lintr'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/rnc/rnv.vim b/vim/bundle/syntastic/syntax_checkers/rnc/rnv.vim
new file mode 100644
index 0000000..848d60c
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/rnc/rnv.vim
@@ -0,0 +1,38 @@
+"============================================================================
+"File: rnv.vim
+"Description: RelaxNG RNV syntax checking plugin for syntastic.vim
+"Maintainer: Remko Tronçon <remko at el-tramo dot be>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_rnc_rnv_checker')
+ finish
+endif
+let g:loaded_syntastic_rnc_rnv_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_rnc_rnv_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args': '-c' })
+
+ let errorformat =
+ \ '%f:%l:%c: %trror: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'rnc',
+ \ 'name': 'rnv'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/rst/rst2pseudoxml.vim b/vim/bundle/syntastic/syntax_checkers/rst/rst2pseudoxml.vim
new file mode 100644
index 0000000..532c75c
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/rst/rst2pseudoxml.vim
@@ -0,0 +1,65 @@
+"============================================================================
+"File: rst.vim
+"Description: Syntax checking plugin for docutils' reStructuredText files
+"Maintainer: James Rowe <jnrowe at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+" We use rst2pseudoxml.py, as it is ever so marginally faster than the other
+" rst2${x} tools in docutils.
+
+if exists('g:loaded_syntastic_rst_rst2pseudoxml_checker')
+ finish
+endif
+let g:loaded_syntastic_rst_rst2pseudoxml_checker = 1
+
+let s:rst2pseudoxml = (executable('rst2pseudoxml.py') && !syntastic#util#isRunningWindows()) ? 'rst2pseudoxml.py' : 'rst2pseudoxml'
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_rst_rst2pseudoxml_IsAvailable() dict
+ call self.log('exec =', self.getExec())
+ return executable(self.getExec())
+endfunction
+
+function! SyntaxCheckers_rst_rst2pseudoxml_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '--report=2 --exit-status=1',
+ \ 'tail': syntastic#util#DevNull() })
+
+ let errorformat =
+ \ '%f:%l: (%t%\w%\+/%\d%\+) %m,'.
+ \ '%f:: (%t%\w%\+/%\d%\+) %m,'.
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+
+ for e in loclist
+ if e['type'] ==? 'I'
+ let e['type'] = 'W'
+ let e['subtype'] = 'Style'
+ else
+ let e['type'] = 'E'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'rst',
+ \ 'name': 'rst2pseudoxml',
+ \ 'exec': s:rst2pseudoxml })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/rst/rstcheck.vim b/vim/bundle/syntastic/syntax_checkers/rst/rstcheck.vim
new file mode 100644
index 0000000..3c3b8c4
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/rst/rstcheck.vim
@@ -0,0 +1,50 @@
+"============================================================================
+"File: rstcheck.vim
+"Description: Syntax checking for reStructuredText and embedded code blocks
+"Authors: Steven Myint <git@stevenmyint.com>
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_rst_rstcheck_checker')
+ finish
+endif
+let g:loaded_syntastic_rst_rstcheck_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_rst_rstcheck_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%f:%l: (%tNFO/1) %m,'.
+ \ '%f:%l: (%tARNING/2) %m,'.
+ \ '%f:%l: (%tRROR/3) %m,'.
+ \ '%f:%l: (%tEVERE/4) %m,'.
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 1] })
+
+ for e in loclist
+ if e['type'] ==? 'S'
+ let e['type'] = 'E'
+ elseif e['type'] ==? 'I'
+ let e['type'] = 'W'
+ let e['subtype'] = 'Style'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'rst',
+ \ 'name': 'rstcheck'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/rst/sphinx.vim b/vim/bundle/syntastic/syntax_checkers/rst/sphinx.vim
new file mode 100644
index 0000000..3c211f4
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/rst/sphinx.vim
@@ -0,0 +1,80 @@
+"============================================================================
+"File: sphinx.vim
+"Description: Syntax checking plugin for Sphinx reStructuredText files
+"Maintainer: Buck Evan <buck dot 2019 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists("g:loaded_syntastic_rst_sphinx_checker")
+ finish
+endif
+let g:loaded_syntastic_rst_sphinx_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+let s:sphinx_cache_location = syntastic#util#tmpdir()
+lockvar s:sphinx_cache_location
+
+augroup syntastic
+ autocmd VimLeave * call syntastic#util#rmrf(s:sphinx_cache_location)
+augroup END
+
+function! SyntaxCheckers_rst_sphinx_GetLocList() dict
+
+ let srcdir = syntastic#util#var('rst_sphinx_source_dir')
+ call self.log('g:syntastic_rst_sphinx_source_dir =', srcdir)
+ if srcdir ==# ''
+ let config = syntastic#util#findFileInParent('conf.py', expand('%:p:h', 1))
+ if config ==# '' || !filereadable(config)
+ call self.log('conf.py file not found')
+ return []
+ endif
+ let srcdir = fnamemodify(config, ':p:h')
+ endif
+
+ let confdir = syntastic#util#var('rst_sphinx_config_dir')
+ call self.log('g:syntastic_rst_sphinx_config_dir =', confdir)
+ if confdir ==# ''
+ let config = syntastic#util#findFileInParent('conf.py', expand('%:p:h', 1))
+ let confdir = (config !=# '' && filereadable(config)) ? fnamemodify(config, ':p:h') : srcdir
+ endif
+
+ let makeprg = self.makeprgBuild({
+ \ 'args': '-n -E',
+ \ 'args_after': '-q -N -b pseudoxml -c ' . syntastic#util#shescape(confdir),
+ \ 'fname': syntastic#util#shescape(srcdir),
+ \ 'fname_after': syntastic#util#shescape(s:sphinx_cache_location) })
+
+ let errorformat =
+ \ '%E%f:%l: SEVER%t: %m,' .
+ \ '%f:%l: %tRROR: %m,' .
+ \ '%f:%l: %tARNING: %m,' .
+ \ '%E%f:: SEVER%t: %m,' .
+ \ '%f:: %tRROR: %m,' .
+ \ '%f:: %tARNING: %m,' .
+ \ '%trror: %m,' .
+ \ '%+C%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0] })
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'rst',
+ \ 'name': 'sphinx',
+ \ 'exec': 'sphinx-build' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/flog.vim b/vim/bundle/syntastic/syntax_checkers/ruby/flog.vim
new file mode 100644
index 0000000..127cdbd
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/ruby/flog.vim
@@ -0,0 +1,72 @@
+"============================================================================
+"File: flog.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Tim Carry <tim at pixelastic dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_ruby_flog_checker')
+ finish
+endif
+let g:loaded_syntastic_ruby_flog_checker = 1
+
+if !exists('g:syntastic_ruby_flog_threshold_warning')
+ let g:syntastic_ruby_flog_threshold_warning = 45
+endif
+
+if !exists('g:syntastic_ruby_flog_threshold_error')
+ let g:syntastic_ruby_flog_threshold_error = 90
+endif
+
+if !exists('g:syntastic_ruby_flog_sort')
+ let g:syntastic_ruby_flog_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_ruby_flog_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args': '-a' })
+
+ " Example output:
+ " 93.25: MyClass::my_method my_file:42
+ let errorformat = '%\m%\s%#%m: %.%# %f:%l'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style' })
+
+ let trail_w = syntastic#util#float2str(g:syntastic_ruby_flog_threshold_warning) . ')'
+ let trail_e = syntastic#util#float2str(g:syntastic_ruby_flog_threshold_error) . ')'
+ for e in loclist
+ let score = syntastic#util#str2float(e['text'])
+
+ let e['text'] = 'Complexity is too high (' . syntastic#util#float2str(score) . '/'
+ if score < g:syntastic_ruby_flog_threshold_warning
+ let e['valid'] = 0
+ elseif score < g:syntastic_ruby_flog_threshold_error
+ let e['type'] = 'W'
+ let e['text'] .= trail_w
+ else
+ let e['type'] = 'E'
+ let e['text'] .= trail_e
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'ruby',
+ \ 'name': 'flog'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/jruby.vim b/vim/bundle/syntastic/syntax_checkers/ruby/jruby.vim
new file mode 100644
index 0000000..d9d2aee
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/ruby/jruby.vim
@@ -0,0 +1,50 @@
+"============================================================================
+"File: jruby.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Leonid Shevtsov <leonid at shevtsov dot me>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_ruby_jruby_checker')
+ finish
+endif
+let g:loaded_syntastic_ruby_jruby_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_ruby_jruby_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args': (syntastic#util#isRunningWindows() ? '-T1 -W1' : '-W1'),
+ \ 'args_after': '-c' })
+
+ let errorformat =
+ \ '%-GSyntax OK for %f,'.
+ \ '%ESyntaxError in %f:%l: syntax error\, %m,'.
+ \ '%Z%p^,'.
+ \ '%W%f:%l: warning: %m,'.
+ \ '%Z%p^,'.
+ \ '%W%f:%l: %m,'.
+ \ '%-C%.%#'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'RUBYOPT': '' }
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'ruby',
+ \ 'name': 'jruby'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/macruby.vim b/vim/bundle/syntastic/syntax_checkers/ruby/macruby.vim
new file mode 100644
index 0000000..c51188f
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/ruby/macruby.vim
@@ -0,0 +1,49 @@
+"============================================================================
+"File: macruby.vim
+"Description: Syntax checking plugin for syntastic.vim
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_ruby_macruby_checker')
+ finish
+endif
+let g:loaded_syntastic_ruby_macruby_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_ruby_macruby_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args': '-W1',
+ \ 'args_after': '-c' })
+
+ let errorformat =
+ \ '%-GSyntax OK,'.
+ \ '%E%f:%l: syntax error\, %m,'.
+ \ '%Z%p^,'.
+ \ '%W%f:%l: warning: %m,'.
+ \ '%Z%p^,'.
+ \ '%W%f:%l: %m,'.
+ \ '%-C%.%#'
+
+ let env = { 'RUBYOPT': '' }
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'ruby',
+ \ 'name': 'macruby'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/mri.vim b/vim/bundle/syntastic/syntax_checkers/ruby/mri.vim
new file mode 100644
index 0000000..563ed4f
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/ruby/mri.vim
@@ -0,0 +1,82 @@
+"============================================================================
+"File: mri.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_ruby_mri_checker')
+ finish
+endif
+let g:loaded_syntastic_ruby_mri_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_ruby_mri_IsAvailable() dict
+ if !exists('g:syntastic_ruby_mri_exec') && exists('g:syntastic_ruby_exec')
+ let g:syntastic_ruby_mri_exec = g:syntastic_ruby_exec
+ call self.log('g:syntastic_ruby_exec =', g:syntastic_ruby_exec)
+ endif
+ return executable(self.getExec())
+endfunction
+
+function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i)
+ if stridx(a:i['text'], 'assigned but unused variable') >= 0
+ let term = split(a:i['text'], ' - ')[1]
+ return '\V\<' . escape(term, '\') . '\>'
+ endif
+
+ return ''
+endfunction
+
+function! SyntaxCheckers_ruby_mri_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args': '-w -T1',
+ \ 'args_after': '-c' })
+
+ "this is a hack to filter out a repeated useless warning in rspec files
+ "containing lines like
+ "
+ " foo.should == 'bar'
+ "
+ "Which always generate the warning below. Note that ruby >= 1.9.3 includes
+ "the word "possibly" in the warning
+ let errorformat = '%-G%\m%.%#warning: %\%%(possibly %\)%\?useless use of == in void context,'
+
+ " filter out lines starting with ...
+ " long lines are truncated and wrapped in ... %p then returns the wrong
+ " column offset
+ let errorformat .= '%-G%\%.%\%.%\%.%.%#,'
+
+ let errorformat .=
+ \ '%-GSyntax OK,'.
+ \ '%E%f:%l: syntax error\, %m,'.
+ \ '%Z%p^,'.
+ \ '%W%f:%l: warning: %m,'.
+ \ '%Z%p^,'.
+ \ '%W%f:%l: %m,'.
+ \ '%-C%.%#'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'RUBYOPT': '' }
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'ruby',
+ \ 'name': 'mri',
+ \ 'exec': 'ruby'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/reek.vim b/vim/bundle/syntastic/syntax_checkers/ruby/reek.vim
new file mode 100644
index 0000000..d9a564a
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/ruby/reek.vim
@@ -0,0 +1,56 @@
+"============================================================================
+"File: reek.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Mindaugas Mozūras
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_ruby_reek_checker')
+ finish
+endif
+let g:loaded_syntastic_ruby_reek_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_ruby_reek_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ return syntastic#util#versionIsAtLeast(self.getVersion(), [1, 3, 0])
+endfunction
+
+function! SyntaxCheckers_ruby_reek_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_before': '--no-color --line-number --single-line' })
+
+ let errorformat =
+ \ '%E%.%#: Racc::ParseError: %f:%l :: %m,' .
+ \ '%W%f:%l: %m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 2] })
+
+ for e in loclist
+ if e['type'] ==? 'W'
+ let e['subtype'] = 'Style'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'ruby',
+ \ 'name': 'reek'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/rubocop.vim b/vim/bundle/syntastic/syntax_checkers/ruby/rubocop.vim
new file mode 100644
index 0000000..56f54bf
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/ruby/rubocop.vim
@@ -0,0 +1,57 @@
+"============================================================================
+"File: rubocop.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Recai Oktaş <roktas@bil.omu.edu.tr>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_ruby_rubocop_checker')
+ finish
+endif
+let g:loaded_syntastic_ruby_rubocop_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_ruby_rubocop_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 12, 0])
+endfunction
+
+function! SyntaxCheckers_ruby_rubocop_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '--format emacs' })
+
+ let errorformat = '%f:%l:%c: %t: %m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style'})
+
+ " convert rubocop severities to error types recognized by syntastic
+ for e in loclist
+ if e['type'] ==# 'F'
+ let e['type'] = 'E'
+ elseif e['type'] !=# 'W' && e['type'] !=# 'E'
+ let e['type'] = 'W'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'ruby',
+ \ 'name': 'rubocop'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/ruby/rubylint.vim b/vim/bundle/syntastic/syntax_checkers/ruby/rubylint.vim
new file mode 100644
index 0000000..2e74f87
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/ruby/rubylint.vim
@@ -0,0 +1,45 @@
+"============================================================================
+"File: rubylint.vim
+"Description: Checks Ruby source code using ruby-lint
+"Maintainer: Yorick Peterse <yorickpeterse@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_ruby_rubylint_checker')
+ finish
+endif
+
+let g:loaded_syntastic_ruby_rubylint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_ruby_rubylint_GetLocList() dict
+ if !exists('s:rubylint_new')
+ let s:rubylint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [2])
+ endif
+ let makeprg = self.makeprgBuild({
+ \ 'args': (s:rubylint_new ? '' : 'analyze '),
+ \ 'args_after': '--presenter=syntastic' })
+
+ let errorformat = '%f:%t:%l:%c: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'ruby',
+ \ 'name': 'rubylint',
+ \ 'exec': 'ruby-lint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/sass/sass.vim b/vim/bundle/syntastic/syntax_checkers/sass/sass.vim
new file mode 100644
index 0000000..5f6194f
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/sass/sass.vim
@@ -0,0 +1,84 @@
+"============================================================================
+"File: sass.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_sass_sass_checker')
+ finish
+endif
+let g:loaded_syntastic_sass_sass_checker = 1
+
+"sass caching for large files drastically speeds up the checking, but store it
+"in a temp location otherwise sass puts .sass_cache dirs in the users project
+let s:sass_cache_location = syntastic#util#tmpdir()
+lockvar s:sass_cache_location
+
+augroup syntastic
+ autocmd VimLeave * call syntastic#util#rmrf(s:sass_cache_location)
+augroup END
+
+"By default do not check partials as unknown variables are a syntax error
+if !exists('g:syntastic_sass_check_partials')
+ let g:syntastic_sass_check_partials = 0
+endif
+
+"use compass imports if available
+let s:imports = ''
+if executable('compass')
+ let s:imports = '--compass'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_sass_sass_GetLocList() dict
+ if !g:syntastic_sass_check_partials && expand('%:t', 1)[0] ==# '_'
+ return []
+ endif
+
+ let makeprg = self.makeprgBuild({
+ \ 'args_before': '--cache-location ' . s:sass_cache_location . ' ' . s:imports . ' --check' })
+
+ let errorformat =
+ \ '%E%\m%\%%(Syntax %\)%\?%trror: %m,' .
+ \ '%+C %.%#,' .
+ \ '%C on line %l of %f\, %.%#,' .
+ \ '%C on line %l of %f,' .
+ \ '%-G %\+from line %.%#,' .
+ \ '%-G %\+Use --trace for backtrace.,' .
+ \ '%W%>DEPRECATION WARNING on line %l of %f:,' .
+ \ '%+C%> %.%#,' .
+ \ '%W%>WARNING: on line %l of %f:,' .
+ \ '%+C%> %.%#,' .
+ \ '%W%>WARNING on line %l of %f: %m,' .
+ \ '%+C%> %.%#,' .
+ \ '%W%>WARNING on line %l of %f:,' .
+ \ '%Z%m,' .
+ \ '%W%>WARNING: %m,' .
+ \ '%C on line %l of %f\, %.%#,' .
+ \ '%C on line %l of %f,' .
+ \ '%-G %\+from line %.%#,' .
+ \ 'Syntax %trror on line %l: %m,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['compressWhitespace'] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'sass',
+ \ 'name': 'sass'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/sass/sass_lint.vim b/vim/bundle/syntastic/syntax_checkers/sass/sass_lint.vim
new file mode 100644
index 0000000..e87da29
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/sass/sass_lint.vim
@@ -0,0 +1,51 @@
+"============================================================================
+"File: sass_lint.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_sass_sass_lint_checker')
+ finish
+endif
+let g:loaded_syntastic_sass_sass_lint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_sass_sass_lint_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ return syntastic#util#versionIsAtLeast(self.getVersion(), [1, 5])
+endfunction
+
+function! SyntaxCheckers_sass_sass_lint_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args': '-v',
+ \ 'args_after': '-q -f compact' })
+
+ let errorformat =
+ \ '%f: line %l\, col %c\, %trror - %m,' .
+ \ '%f: line %l\, col %c\, %tarning - %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 1] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'sass',
+ \ 'name': 'sass_lint',
+ \ 'exec': 'sass-lint' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/sass/sassc.vim b/vim/bundle/syntastic/syntax_checkers/sass/sassc.vim
new file mode 100644
index 0000000..699e04e
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/sass/sassc.vim
@@ -0,0 +1,38 @@
+"============================================================================
+"File: sassc.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_sass_sassc_checker')
+ finish
+endif
+let g:loaded_syntastic_sass_sassc_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_sass_sassc_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'fname_after': syntastic#util#DevNull() })
+
+ let errorformat = '%f:%l: %trror: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'sass',
+ \ 'name': 'sassc'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/scala/fsc.vim b/vim/bundle/syntastic/syntax_checkers/scala/fsc.vim
new file mode 100644
index 0000000..25d6a4d
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/scala/fsc.vim
@@ -0,0 +1,48 @@
+"============================================================================
+"File: fsc.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_scala_fsc_checker')
+ finish
+endif
+let g:loaded_syntastic_scala_fsc_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_scala_fsc_GetLocList() dict
+ call syntastic#log#deprecationWarn('scala_options', 'scala_fsc_args')
+
+ " fsc has some serious problems with the
+ " working directory changing after being started
+ " that's why we better pass an absolute path
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '-Ystop-after:parser',
+ \ 'fname': syntastic#util#shexpand('%:p') })
+
+ let errorformat =
+ \ '%E%f:%l: %trror: %m,' .
+ \ '%Z%p^,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'scala',
+ \ 'name': 'fsc'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/scala/scalac.vim b/vim/bundle/syntastic/syntax_checkers/scala/scalac.vim
new file mode 100644
index 0000000..854876b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/scala/scalac.vim
@@ -0,0 +1,43 @@
+"============================================================================
+"File: scala.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Rickey Visinski <rickeyvisinski at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_scala_scalac_checker')
+ finish
+endif
+let g:loaded_syntastic_scala_scalac_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_scala_scalac_GetLocList() dict
+ call syntastic#log#deprecationWarn('scala_options', 'scala_scalac_args')
+
+ let makeprg = self.makeprgBuild({ 'args_after': '-Ystop-after:parser' })
+
+ let errorformat =
+ \ '%E%f:%l: %trror: %m,' .
+ \ '%Z%p^,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'scala',
+ \ 'name': 'scalac'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/scala/scalastyle.vim b/vim/bundle/syntastic/syntax_checkers/scala/scalastyle.vim
new file mode 100644
index 0000000..60d2163
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/scala/scalastyle.vim
@@ -0,0 +1,77 @@
+"============================================================================
+"File: scalastyle.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_scala_scalastyle_checker')
+ finish
+endif
+let g:loaded_syntastic_scala_scalastyle_checker = 1
+
+if !exists('g:syntastic_scala_scalastyle_jar')
+ let g:syntastic_scala_scalastyle_jar = 'scalastyle-batch_2.10.jar'
+endif
+
+if !exists('g:syntastic_scala_scalastyle_config_file')
+ let g:syntastic_scala_scalastyle_config_file = 'scalastyle_config.xml'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_scala_scalastyle_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+
+ let jar = expand(g:syntastic_scala_scalastyle_jar, 1)
+ let conf_file = expand(g:syntastic_scala_scalastyle_config_file, 1)
+ call self.log('filereadable(' . string(jar) . ') = ' . filereadable(jar) . ', ' .
+ \ 'filereadable(' . string(conf_file) . ') = ' . filereadable(conf_file))
+
+ return filereadable(jar) && filereadable(conf_file)
+endfunction
+
+function! SyntaxCheckers_scala_scalastyle_GetLocList() dict
+
+ let makeprg = self.makeprgBuild({
+ \ 'exe_after': ['-jar', expand(g:syntastic_scala_scalastyle_jar, 1)],
+ \ 'args_before': ['-c', expand(g:syntastic_scala_scalastyle_config_file, 1)] })
+
+ let errorformat =
+ \ '%trror file=%f message=%m line=%l column=%c,' .
+ \ '%trror file=%f message=%m line=%l,' .
+ \ '%tarning file=%f message=%m line=%l column=%c,' .
+ \ '%tarning file=%f message=%m line=%l'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'returns': [0, 1] })
+
+ for e in loclist
+ if has_key(e, 'col')
+ let e['col'] += 1
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'scala',
+ \ 'name': 'scalastyle',
+ \ 'exec': 'java'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/scss/mixedindentlint.vim b/vim/bundle/syntastic/syntax_checkers/scss/mixedindentlint.vim
new file mode 100644
index 0000000..04a1fec
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/scss/mixedindentlint.vim
@@ -0,0 +1,22 @@
+"============================================================================
+"File: mixedindentlint.vim
+"Description: Mixed indentation linter for vim
+"Maintainer: Payton Swick <payton@foolord.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_scss_mixedindentlint_checker')
+ finish
+endif
+let g:loaded_syntastic_scss_mixedindentlint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'scss',
+ \ 'name': 'mixedindentlint',
+ \ 'redirect': 'javascript/mixedindentlint'})
+
+" vim: set et sts=4 sw=4:
diff --git a/vim/bundle/syntastic/syntax_checkers/scss/sass.vim b/vim/bundle/syntastic/syntax_checkers/scss/sass.vim
new file mode 100644
index 0000000..3df8c80
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/scss/sass.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: scss.vim
+"Description: scss syntax checking plugin for syntastic
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_scss_sass_checker')
+ finish
+endif
+let g:loaded_syntastic_scss_sass_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'scss',
+ \ 'name': 'sass',
+ \ 'redirect': 'sass/sass'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/scss/sass_lint.vim b/vim/bundle/syntastic/syntax_checkers/scss/sass_lint.vim
new file mode 100644
index 0000000..c50dac4
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/scss/sass_lint.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: sass_lint.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_scss_sass_lint_checker')
+ finish
+endif
+let g:loaded_syntastic_scss_sass_lint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'scss',
+ \ 'name': 'sass_lint',
+ \ 'redirect': 'sass/sass_lint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/scss/sassc.vim b/vim/bundle/syntastic/syntax_checkers/scss/sassc.vim
new file mode 100644
index 0000000..f1b2372
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/scss/sassc.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: sassc.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_scss_sassc_checker')
+ finish
+endif
+let g:loaded_syntastic_scss_sassc_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'scss',
+ \ 'name': 'sassc',
+ \ 'redirect': 'sass/sassc'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/scss/scss_lint.vim b/vim/bundle/syntastic/syntax_checkers/scss/scss_lint.vim
new file mode 100644
index 0000000..c0f921a
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/scss/scss_lint.vim
@@ -0,0 +1,64 @@
+"============================================================================
+"File: scss_lint.vim
+"Description: SCSS style and syntax checker plugin for Syntastic
+"Maintainer: Shane da Silva <shane@dasilva.io>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_scss_scss_lint_checker')
+ finish
+endif
+let g:loaded_syntastic_scss_scss_lint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_scss_scss_lint_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 29])
+endfunction
+
+function! SyntaxCheckers_scss_scss_lint_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-f JSON' })
+
+ let errorformat = '%f:%t:%l:%c:%n:%m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'scss_lint',
+ \ 'postprocess': ['guards'],
+ \ 'returns': [0, 1, 2, 65, 66] })
+
+ let cutoff = strlen('Syntax Error: ')
+ for e in loclist
+ if e['nr'] > 1
+ let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['col'] + e['nr']) . 'c'
+ endif
+ let e['nr'] = 0
+
+ if e['text'][: cutoff-1] ==# 'Syntax Error: '
+ let e['text'] = e['text'][cutoff :]
+ else
+ let e['subtype'] = 'Style'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'scss',
+ \ 'name': 'scss_lint',
+ \ 'exec': 'scss-lint' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/scss/stylelint.vim b/vim/bundle/syntastic/syntax_checkers/scss/stylelint.vim
new file mode 100644
index 0000000..1962916
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/scss/stylelint.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: stylelint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_scss_stylelint_checker')
+ finish
+endif
+let g:loaded_syntastic_scss_stylelint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'scss',
+ \ 'name': 'stylelint',
+ \ 'redirect': 'css/stylelint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/sh/bashate.vim b/vim/bundle/syntastic/syntax_checkers/sh/bashate.vim
new file mode 100644
index 0000000..c7888ad
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/sh/bashate.vim
@@ -0,0 +1,48 @@
+"============================================================================
+"File: bashate.vim
+"Description: Bash script style checking plugin for syntastic.vim
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_sh_bashate_checker')
+ finish
+endif
+let g:loaded_syntastic_sh_bashate_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_sh_bashate_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%EE%n: %m,' .
+ \ '%Z - %f%\s%\+: L%l,' .
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'returns': [0, 1] })
+
+ for e in loclist
+ let e['text'] = substitute(e['text'], "\\m: '.*", '', '')
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'sh',
+ \ 'name': 'bashate' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/sh/checkbashisms.vim b/vim/bundle/syntastic/syntax_checkers/sh/checkbashisms.vim
new file mode 100644
index 0000000..2ed0717
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/sh/checkbashisms.vim
@@ -0,0 +1,42 @@
+"============================================================================
+"File: checkbashisms.vim
+"Description: Shell script syntax/style checking plugin for syntastic.vim
+"Notes: checkbashisms.pl can be downloaded from
+" http://debian.inode.at/debian/pool/main/d/devscripts/
+" as part of the devscripts package.
+"============================================================================
+
+if exists('g:loaded_syntastic_sh_checkbashisms_checker')
+ finish
+endif
+let g:loaded_syntastic_sh_checkbashisms_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_sh_checkbashisms_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args': '-fx' })
+
+ let errorformat =
+ \ '%-Gscript %f is already a bash script; skipping,' .
+ \ '%Eerror: %f: %m\, opened in line %l,' .
+ \ '%Eerror: %f: %m,' .
+ \ '%Ecannot open script %f for reading: %m,' .
+ \ '%Wscript %f %m,%C%.# lines,' .
+ \ '%Wpossible bashism in %f line %l (%m):,%C%.%#,%Z.%#,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'sh',
+ \ 'name': 'checkbashisms' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/sh/sh.vim b/vim/bundle/syntastic/syntax_checkers/sh/sh.vim
new file mode 100644
index 0000000..395b81b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/sh/sh.vim
@@ -0,0 +1,93 @@
+"============================================================================
+"File: sh.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_sh_sh_checker')
+ finish
+endif
+let g:loaded_syntastic_sh_sh_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_sh_sh_IsAvailable() dict " {{{1
+ call self.log('shell =', s:GetShell())
+ return s:IsShellValid()
+endfunction " }}}1
+
+function! SyntaxCheckers_sh_sh_GetLocList() dict " {{{1
+ if s:GetShell() ==# 'zsh'
+ return s:ForwardToZshChecker()
+ endif
+
+ if !s:IsShellValid()
+ return []
+ endif
+
+ let makeprg = self.makeprgBuild({
+ \ 'exe': s:GetShell(),
+ \ 'args_after': '-n' })
+
+ let errorformat = '%f: line %l: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction " }}}1
+
+" Utilities {{{1
+
+function! s:GetShell() " {{{2
+ if !exists('b:shell') || b:shell ==# ''
+ let b:shell = ''
+ let shebang = syntastic#util#parseShebang()['exe']
+ if shebang !=# ''
+ if shebang[-strlen('bash'):-1] ==# 'bash'
+ let b:shell = 'bash'
+ elseif shebang[-strlen('zsh'):-1] ==# 'zsh'
+ let b:shell = 'zsh'
+ elseif shebang[-strlen('sh'):-1] ==# 'sh'
+ let b:shell = 'sh'
+ endif
+ endif
+ " try to use env variable in case no shebang could be found
+ if b:shell ==# ''
+ let b:shell = fnamemodify($SHELL, ':t')
+ endif
+ endif
+ return b:shell
+endfunction " }}}2
+
+function! s:IsShellValid() " {{{2
+ let shell = s:GetShell()
+ return shell !=# '' && executable(shell)
+endfunction " }}}2
+
+function! s:ForwardToZshChecker() " {{{2
+ let registry = g:SyntasticRegistry.Instance()
+ let zsh_checkers = registry.getCheckersAvailable('zsh', ['zsh'])
+ if !empty(zsh_checkers)
+ return zsh_checkers[0].getLocListRaw()
+ else
+ return []
+ endif
+endfunction " }}}2
+
+" }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'sh',
+ \ 'name': 'sh' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/sh/shellcheck.vim b/vim/bundle/syntastic/syntax_checkers/sh/shellcheck.vim
new file mode 100644
index 0000000..5189e19
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/sh/shellcheck.vim
@@ -0,0 +1,66 @@
+"============================================================================
+"File: shellcheck.vim
+"Description: Shell script syntax/style checking plugin for syntastic.vim
+"============================================================================
+
+if exists('g:loaded_syntastic_sh_shellcheck_checker')
+ finish
+endif
+let g:loaded_syntastic_sh_shellcheck_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_sh_shellcheck_GetLocList() dict " {{{1
+ let makeprg = self.makeprgBuild({
+ \ 'args': s:GetShell(),
+ \ 'args_after': '-f gcc' })
+
+ let errorformat =
+ \ '%f:%l:%c: %trror: %m,' .
+ \ '%f:%l:%c: %tarning: %m,' .
+ \ '%f:%l:%c: %tote: %m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 1] })
+
+ for e in loclist
+ if e['type'] ==? 'n'
+ let e['type'] = 'w'
+ let e['subtype'] = 'Style'
+ endif
+ endfor
+
+ return loclist
+endfunction " }}}1
+
+" Utilities {{{1
+
+function! s:GetShell() " {{{2
+ let sh = ''
+
+ if syntastic#util#parseShebang()['exe'] ==# ''
+ if syntastic#util#rawVar('is_kornshell', 0) || syntastic#util#rawVar('is_posix', 0)
+ let sh = 'ksh'
+ elseif syntastic#util#rawVar('is_bash', 0)
+ let sh = 'bash'
+ elseif syntastic#util#rawVar('is_sh', 0)
+ let sh = 'sh'
+ endif
+ endif
+
+ return sh !=# '' ? '-s ' . sh : ''
+endfunction " }}}2
+
+" }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'sh',
+ \ 'name': 'shellcheck' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/slim/slim_lint.vim b/vim/bundle/syntastic/syntax_checkers/slim/slim_lint.vim
new file mode 100644
index 0000000..f387971
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/slim/slim_lint.vim
@@ -0,0 +1,39 @@
+"============================================================================
+"File: slim_lint.vim
+"Description: Slim style and syntax checker plugin for Syntastic
+"Maintainer: Vasily Kolesnikov <re.vkolesnikov@gmail.com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_slim_slim_lint_checker')
+ finish
+endif
+let g:loaded_syntastic_slim_slim_lint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_slim_slim_lint_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat = '%f:%l [%t] %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style'})
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'slim',
+ \ 'name': 'slim_lint',
+ \ 'exec': 'slim-lint' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/slim/slimrb.vim b/vim/bundle/syntastic/syntax_checkers/slim/slimrb.vim
new file mode 100644
index 0000000..80bac05
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/slim/slimrb.vim
@@ -0,0 +1,55 @@
+"============================================================================
+"File: slim.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_slim_slimrb_checker')
+ finish
+endif
+let g:loaded_syntastic_slim_slimrb_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_slim_slimrb_GetLocList() dict
+ if !exists('s:slimrb_new')
+ let ver = self.getVersion(self.getExecEscaped() . ' --version 2>'. syntastic#util#DevNull())
+ let s:slimrb_new = syntastic#util#versionIsAtLeast(ver, [1, 3, 1])
+ endif
+
+ let makeprg = self.makeprgBuild({ 'args_after': '-c' })
+
+ if s:slimrb_new
+ let errorformat =
+ \ '%C %#%f\, Line %l\, Column %c,'.
+ \ '%-G %.%#,'.
+ \ '%ESlim::Parser::SyntaxError: %m,'.
+ \ '%+C%.%#'
+ else
+ let errorformat =
+ \ '%C %#%f\, Line %l,'.
+ \ '%-G %.%#,'.
+ \ '%ESlim::Parser::SyntaxError: %m,'.
+ \ '%+C%.%#'
+ endif
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'slim',
+ \ 'name': 'slimrb'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/sml/smlnj.vim b/vim/bundle/syntastic/syntax_checkers/sml/smlnj.vim
new file mode 100644
index 0000000..8b29db4
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/sml/smlnj.vim
@@ -0,0 +1,47 @@
+"============================================================================
+"File: smlnj.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_sml_smlnj_checker')
+ finish
+endif
+let g:loaded_syntastic_sml_smlnj_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_sml_smlnj_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%E%f:%l%\%.%c %trror: %m,' .
+ \ '%E%f:%l%\%.%c-%\d%\+%\%.%\d%\+ %trror: %m,' .
+ \ '%W%f:%l%\%.%c %tarning: %m,' .
+ \ '%W%f:%l%\%.%c-%\d%\+%\%.%\d%\+ %tarning: %m,' .
+ \ '%C%\s%\+%m,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['compressWhitespace'],
+ \ 'returns': [0, 1] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'sml',
+ \ 'name': 'smlnj',
+ \ 'exec': 'sml'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/spec/rpmlint.vim b/vim/bundle/syntastic/syntax_checkers/spec/rpmlint.vim
new file mode 100644
index 0000000..7e9431b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/spec/rpmlint.vim
@@ -0,0 +1,43 @@
+"============================================================================
+"File: rpmlint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_spec_rpmlint_checker')
+ finish
+endif
+let g:loaded_syntastic_spec_rpmlint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_spec_rpmlint_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%E%f:%l: E: %m,' .
+ \ '%E%f: E: %m,' .
+ \ '%W%f:%l: W: %m,' .
+ \ '%W%f: W: %m,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'spec',
+ \ 'name': 'rpmlint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/sql/sqlint.vim b/vim/bundle/syntastic/syntax_checkers/sql/sqlint.vim
new file mode 100644
index 0000000..1e1eea5
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/sql/sqlint.vim
@@ -0,0 +1,50 @@
+"============================================================================
+"File: sqlint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Steve Purcell <steve@sanityinc.com>
+"License: MIT
+"============================================================================
+
+if exists('g:loaded_syntastic_sql_sqlint_checker')
+ finish
+endif
+let g:loaded_syntastic_sql_sqlint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_sql_sqlint_GetHighlightRegex(i)
+ let term = matchstr(a:i['text'], '\m at or near "\zs[^"]\+\ze"')
+ return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : ''
+endfunction
+
+function! SyntaxCheckers_sql_sqlint_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+ return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 0, 3])
+endfunction
+
+function! SyntaxCheckers_sql_sqlint_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%E%f:%l:%c:ERROR %m,' .
+ \ '%W%f:%l:%c:WARNING %m,' .
+ \ '%C %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'returns': [0, 1] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'sql',
+ \ 'name': 'sqlint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/stylus/stylint.vim b/vim/bundle/syntastic/syntax_checkers/stylus/stylint.vim
new file mode 100644
index 0000000..f489910
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/stylus/stylint.vim
@@ -0,0 +1,43 @@
+"============================================================================
+"File: stylint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_stylus_stylint_checker')
+ finish
+endif
+let g:loaded_syntastic_stylus_stylint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_stylus_stylint_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%WWarning: %m,' .
+ \ '%EError: %m,' .
+ \ '%CFile: %f,' .
+ \ '%CLine: %l:%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'stylus',
+ \ 'name': 'stylint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/tcl/nagelfar.vim b/vim/bundle/syntastic/syntax_checkers/tcl/nagelfar.vim
new file mode 100644
index 0000000..adbce63
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/tcl/nagelfar.vim
@@ -0,0 +1,44 @@
+"============================================================================
+"File: nagelfar.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: James Pickard <james.pickard at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+"
+"Notes: Requires nagelfar v1.1.12 or later with support for -H option.
+" See nagelfar homepage http://nagelfar.berlios.de/.
+
+if exists('g:loaded_syntastic_tcl_nagelfar_checker')
+ finish
+endif
+let g:loaded_syntastic_tcl_nagelfar_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_tcl_nagelfar_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-H' })
+
+ let errorformat =
+ \ '%I%f: %l: N %m,'.
+ \ '%f: %l: %t %m,'.
+ \ '%-GChecking file %f'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'tcl',
+ \ 'name': 'nagelfar'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/tex/chktex.vim b/vim/bundle/syntastic/syntax_checkers/tex/chktex.vim
new file mode 100644
index 0000000..9b35902
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/tex/chktex.vim
@@ -0,0 +1,52 @@
+"============================================================================
+"File: chktex.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_tex_chktex_checker')
+ finish
+endif
+let g:loaded_syntastic_tex_chktex_checker = 1
+
+if !exists('g:syntastic_tex_chktex_showmsgs')
+ let g:syntastic_tex_chktex_showmsgs = 1
+endif
+
+if !exists('g:syntastic_tex_chktex_sort')
+ let g:syntastic_tex_chktex_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_tex_chktex_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-q -v1' })
+
+ let errorformat =
+ \ '%EError %n in %f line %l: %m,' .
+ \ '%WWarning %n in %f line %l: %m,' .
+ \ (g:syntastic_tex_chktex_showmsgs ? '%WMessage %n in %f line %l: %m,' : '') .
+ \ '%Z%p^,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'tex',
+ \ 'name': 'chktex'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/tex/lacheck.vim b/vim/bundle/syntastic/syntax_checkers/tex/lacheck.vim
new file mode 100644
index 0000000..f156520
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/tex/lacheck.vim
@@ -0,0 +1,40 @@
+"============================================================================
+"File: tex.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_tex_lacheck_checker')
+ finish
+endif
+let g:loaded_syntastic_tex_lacheck_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_tex_lacheck_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%-G** %f:,' .
+ \ '%E"%f"\, line %l: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'tex',
+ \ 'name': 'lacheck'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/texinfo/makeinfo.vim b/vim/bundle/syntastic/syntax_checkers/texinfo/makeinfo.vim
new file mode 100644
index 0000000..a66e787
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/texinfo/makeinfo.vim
@@ -0,0 +1,47 @@
+"============================================================================
+"File: makeinfo.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_texinfo_makeinfo_checker')
+ finish
+endif
+let g:loaded_syntastic_texinfo_makeinfo_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_texinfo_makeinfo_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], "\\m`\\zs[^']\\+\\ze'")
+ return term !=# '' ? '\V' . escape(term, '\') : ''
+endfunction
+
+function! SyntaxCheckers_texinfo_makeinfo_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': syntastic#c#NullOutput() })
+
+ let errorformat =
+ \ '%f:%l: %tarning: %m,' .
+ \ '%f:%l: %m,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'type': 'e' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'texinfo',
+ \ 'name': 'makeinfo'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/text/atdtool.vim b/vim/bundle/syntastic/syntax_checkers/text/atdtool.vim
new file mode 100644
index 0000000..e43d9dc
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/text/atdtool.vim
@@ -0,0 +1,61 @@
+"============================================================================
+"File: atdtool.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_text_atdtool_checker')
+ finish
+endif
+let g:loaded_syntastic_text_atdtool_checker = 1
+
+if !exists('g:syntastic_text_atdtool_sort')
+ let g:syntastic_text_atdtool_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_text_atdtool_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], '\m "\zs[^"]\+\ze"\($\| | suggestions:\)')
+ if term !=# ''
+ let col = get(a:item, 'col', 0)
+ let term = (col != 0 ? '\%' . col . 'c' : '') . '\V' . escape(term, '\')
+ endif
+ return term
+endfunction
+
+function! SyntaxCheckers_text_atdtool_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'tail': '2> ' . syntastic#util#DevNull() })
+
+ let errorformat =
+ \ '%W%f:%l:%c: %m,'.
+ \ '%+C suggestions:%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0],
+ \ 'subtype': 'Style' })
+
+ for e in loclist
+ let e['text'] = substitute(e['text'], '\m\n\s\+', ' | ', 'g')
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'text',
+ \ 'name': 'atdtool'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/text/igor.vim b/vim/bundle/syntastic/syntax_checkers/text/igor.vim
new file mode 100644
index 0000000..588cf3b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/text/igor.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: igor.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_text_igor_checker')
+ finish
+endif
+let g:loaded_syntastic_text_igor_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'text',
+ \ 'name': 'igor',
+ \ 'redirect': 'docbk/igor'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/text/language_check.vim b/vim/bundle/syntastic/syntax_checkers/text/language_check.vim
new file mode 100644
index 0000000..e1aa69f
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/text/language_check.vim
@@ -0,0 +1,37 @@
+"============================================================================
+"File: language_check.vim
+"Description: Grammar checker (https://github.com/myint/language-check)
+"Authors: Steven Myint <git@stevenmyint.com>
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_text_language_check_checker')
+ finish
+endif
+let g:loaded_syntastic_text_language_check_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_text_language_check_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%f:%l:%c: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'returns': [0, 2] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'text',
+ \ 'name': 'language_check',
+ \ 'exec': 'language-check'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/text/textlint.vim b/vim/bundle/syntastic/syntax_checkers/text/textlint.vim
new file mode 100644
index 0000000..3b51ae7
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/text/textlint.vim
@@ -0,0 +1,42 @@
+"============================================================================
+"File: textlint.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_text_textlint_checker')
+ finish
+endif
+let g:loaded_syntastic_text_textlint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_text_textlint_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-f compact' })
+
+ let errorformat =
+ \ '%f: line %l\, col %c\, %tarning - %m,' .
+ \ '%f: line %l\, col %c\, %trror - %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'subtype': 'Style',
+ \ 'returns': [0, 1] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'text',
+ \ 'name': 'textlint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/trig/rapper.vim b/vim/bundle/syntastic/syntax_checkers/trig/rapper.vim
new file mode 100644
index 0000000..f459cda
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/trig/rapper.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: rapper.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: Sebastian Tramp <mail@sebastian.tramp.name>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_trig_rapper_checker')
+ finish
+endif
+let g:loaded_syntastic_trig_rapper_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'trig',
+ \ 'name': 'rapper',
+ \ 'redirect': 'turtle/rapper'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/turtle/rapper.vim b/vim/bundle/syntastic/syntax_checkers/turtle/rapper.vim
new file mode 100644
index 0000000..4585a07
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/turtle/rapper.vim
@@ -0,0 +1,46 @@
+"============================================================================
+"File: rapper.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: Sebastian Tramp <mail@sebastian.tramp.name>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_turtle_rapper_checker')
+ finish
+endif
+let g:loaded_syntastic_turtle_rapper_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_turtle_rapper_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], '\mFailed to convert qname \zs\S\+\ze to URI')
+ return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : ''
+endfunction
+
+function! SyntaxCheckers_turtle_rapper_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args': '-i guess -q --count' })
+
+ let errorformat =
+ \ 'rapper: %trror - URI file://%f:%l - %m,' .
+ \ 'rapper: %tarning - URI file://%f:%l - %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 1] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'turtle',
+ \ 'name': 'rapper'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/turtle/ttl.vim b/vim/bundle/syntastic/syntax_checkers/turtle/ttl.vim
new file mode 100644
index 0000000..c28e354
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/turtle/ttl.vim
@@ -0,0 +1,43 @@
+"============================================================================
+"File: ttl.vim
+"Description: turtle syntax checker - using ttl from turtle-validator (npm)
+"Maintainer: Antoine Reilles (tonio@NetBSD.org)
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_turtle_ttl_checker')
+ finish
+endif
+let g:loaded_syntastic_turtle_ttl_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_turtle_ttl_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], '\m"\zs[^"]\+\ze"')
+ return term !=# '' ? '\V\<' . escape(term, '\') . '\>' : ''
+endfunction
+
+function! SyntaxCheckers_turtle_ttl_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat = '%\m[Error: %m %\%%(at%\|on%\) line %l%\%.]'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'turtle',
+ \ 'name': 'ttl'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/twig/twiglint.vim b/vim/bundle/syntastic/syntax_checkers/twig/twiglint.vim
new file mode 100644
index 0000000..547648f
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/twig/twiglint.vim
@@ -0,0 +1,41 @@
+"============================================================================
+"File: twig.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Alexander <iam.asm89 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_twig_twiglint_checker')
+ finish
+endif
+let g:loaded_syntastic_twig_twiglint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_twig_twiglint_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_before': 'lint',
+ \ 'args_after': '--format=csv' })
+
+ let errorformat = '"%f"\,%l\,%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat})
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'twig',
+ \ 'name': 'twiglint',
+ \ 'exec': 'twig-lint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/typescript/eslint.vim b/vim/bundle/syntastic/syntax_checkers/typescript/eslint.vim
new file mode 100644
index 0000000..41e5276
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/typescript/eslint.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: eslint.vim
+"Description: Syntax checking plugin for syntastic
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_typescript_eslint_checker')
+ finish
+endif
+let g:loaded_syntastic_typescript_eslint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'typescript',
+ \ 'name': 'eslint',
+ \ 'redirect': 'javascript/eslint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/typescript/tsc.vim b/vim/bundle/syntastic/syntax_checkers/typescript/tsc.vim
new file mode 100644
index 0000000..de9242e
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/typescript/tsc.vim
@@ -0,0 +1,66 @@
+"============================================================================
+"File: tsc.vim
+"Description: TypeScript syntax checker
+"Maintainer: Bill Casarin <bill@casarin.ca>
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_typescript_tsc_checker')
+ finish
+endif
+let g:loaded_syntastic_typescript_tsc_checker = 1
+
+if !exists('g:syntastic_typescript_tsc_sort')
+ let g:syntastic_typescript_tsc_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_typescript_tsc_IsAvailable() dict
+ if !executable(self.getExec())
+ return 0
+ endif
+
+ let version_output = split(syntastic#util#system(self.getExecEscaped() . ' --version'), '\n', 1)
+ let ver = filter(copy(version_output), 'v:val =~# ''\m\<Version ''')
+ let parsed_ver = len(ver) ? syntastic#util#parseVersion(ver[0], '\v<Version \zs\d+(\.\d+)\ze') : []
+
+ if len(parsed_ver)
+ call self.setVersion(parsed_ver)
+ let s:tsc_new = syntastic#util#versionIsAtLeast(parsed_ver, [1, 5])
+ else
+ call syntastic#log#ndebug(g:_SYNTASTIC_DEBUG_LOCLIST, 'checker output:', version_output)
+ call syntastic#log#error("checker typescript/tsc: can't parse version string (abnormal termination?)")
+ let s:tsc_new = -1
+ endif
+
+ return s:tsc_new >= 0
+endfunction
+
+function! SyntaxCheckers_typescript_tsc_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args': '--module commonjs',
+ \ 'args_after': (s:tsc_new ? '--noEmit' : '--out ' . syntastic#util#DevNull()) })
+
+ let errorformat =
+ \ '%E%f %#(%l\,%c): error %m,' .
+ \ '%E%f %#(%l\,%c): %m,' .
+ \ '%Eerror %m,' .
+ \ '%C%\s%\+%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['guards'],
+ \ 'defaults': {'bufnr': bufnr('')} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'typescript',
+ \ 'name': 'tsc'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/typescript/tslint.vim b/vim/bundle/syntastic/syntax_checkers/typescript/tslint.vim
new file mode 100644
index 0000000..de224b6
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/typescript/tslint.vim
@@ -0,0 +1,51 @@
+"============================================================================
+"File: typescript/tslint.vim
+"Description: TypeScript linter
+"Maintainer: Seon-Wook Park <seon.wook@swook.net>
+"============================================================================
+
+if exists('g:loaded_syntastic_typescript_tslint_checker')
+ finish
+endif
+let g:loaded_syntastic_typescript_tslint_checker = 1
+
+if !exists('g:syntastic_typescript_tslint_sort')
+ let g:syntastic_typescript_tslint_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_typescript_tslint_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], "\\m\\s'\\zs.\\{-}\\ze'\\s")
+ return term !=# '' ? '\V' . escape(term, '\') : ''
+endfunction
+
+function! SyntaxCheckers_typescript_tslint_GetLocList() dict
+ if !exists('s:tslint_new')
+ let s:tslint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [2, 4])
+ endif
+
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '--format verbose',
+ \ 'fname_before': (s:tslint_new ? '' : '-f') })
+
+ " (comment-format) ts/app.ts[12, 36]: comment must start with lowercase letter
+ let errorformat = '%f[%l\, %c]: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'tslint',
+ \ 'subtype': 'Style',
+ \ 'returns': [0, 2] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'typescript',
+ \ 'name': 'tslint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/vala/valac.vim b/vim/bundle/syntastic/syntax_checkers/vala/valac.vim
new file mode 100644
index 0000000..a60c249
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/vala/valac.vim
@@ -0,0 +1,86 @@
+"============================================================================
+"File: vala.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Konstantin Stepanov (me@kstep.me)
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_vala_valac_checker')
+ finish
+endif
+let g:loaded_syntastic_vala_valac_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_vala_valac_GetHighlightRegex(pos) " {{{1
+ let length = strlen(matchstr(a:pos['text'], '\m\^\+$'))
+ return '\%>' . (a:pos['col'] - 1) . 'c\%<' . (a:pos['col'] + length) . 'c'
+endfunction " }}}1
+
+function! SyntaxCheckers_vala_valac_GetLocList() dict " {{{1
+ let vala_pkg_args = join(map(s:GetValaModules(), '"--pkg ".v:val'), ' ')
+ let vala_vapi_args = join(map(s:GetValaVapiDirs(), '"--vapidir ".v:val'), ' ')
+ let makeprg = self.makeprgBuild({ 'args': '-C ' . vala_pkg_args . ' ' . vala_vapi_args })
+
+ let errorformat =
+ \ '%A%f:%l.%c-%\d%\+.%\d%\+: %t%[a-z]%\+: %m,'.
+ \ '%C%m,'.
+ \ '%Z%m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction " }}}1
+
+" Utilities {{{1
+
+function! s:GetValaModules() " {{{2
+ if exists('g:syntastic_vala_modules') || exists('b:syntastic_vala_modules')
+ let modules = syntastic#util#var('vala_modules')
+ if type(modules) == type('')
+ return split(modules, '\m\s\+')
+ elseif type(modules) == type([])
+ return copy(modules)
+ else
+ echoerr 'syntastic_vala_modules must be either list or string: fallback to in file modules string'
+ endif
+ endif
+
+ let modules_line = search('^// modules: ', 'n')
+ let modules_str = getline(modules_line)
+ return split(strpart(modules_str, 12), '\m\s\+')
+endfunction " }}}2
+
+function! s:GetValaVapiDirs() " {{{2
+ if exists('g:syntastic_vala_vapi_dirs') || exists('b:syntastic_vala_vapi_dirs')
+ let vapi_dirs = syntastic#util#var('vala_vapi_dirs')
+ if type(vapi_dirs) == type('')
+ return split(vapi_dirs, '\m\s\+')
+ elseif type(vapi_dirs) == type([])
+ return copy(vapi_dirs)
+ else
+ echoerr 'syntastic_vala_vapi_dirs must be either a list, or a string: fallback to in-file modules string'
+ endif
+ endif
+
+ let vapi_line = search('^//\s*vapidirs:\s*','n')
+ let vapi_str = getline(vapi_line)
+ return split( substitute( vapi_str, '\m^//\s*vapidirs:\s*', '', 'g' ), '\m\s\+' )
+endfunction " }}}2
+
+" }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'vala',
+ \ 'name': 'valac'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/verilog/iverilog.vim b/vim/bundle/syntastic/syntax_checkers/verilog/iverilog.vim
new file mode 100644
index 0000000..c34fec1
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/verilog/iverilog.vim
@@ -0,0 +1,38 @@
+"============================================================================
+"File: iverilog.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Psidium <psiidium at gmail dot com>
+"License: The MIT License
+"============================================================================
+
+if exists('g:loaded_syntastic_verilog_iverilog_checker')
+ finish
+endif
+let g:loaded_syntastic_verilog_iverilog_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_verilog_iverilog_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_before': '-t null',
+ \ 'args': '-Wall' })
+
+ let errorformat =
+ \ '%f:%l: %trror: %m,' .
+ \ '%f:%l: %tarning: %m,' .
+ \ '%E%f:%l: : %m,' .
+ \ '%W%f:%l: : %m,' .
+ \ '%f:%l: %m'
+
+ return SyntasticMake({'makeprg': makeprg, 'errorformat': errorformat})
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'verilog',
+ \ 'name': 'iverilog'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/verilog/verilator.vim b/vim/bundle/syntastic/syntax_checkers/verilog/verilator.vim
new file mode 100644
index 0000000..e5cfddc
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/verilog/verilator.vim
@@ -0,0 +1,42 @@
+"============================================================================
+"File: verilator.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Kocha <kocha dot lsifrontend at gmail dot com>
+"============================================================================
+
+if exists('g:loaded_syntastic_verilog_verilator_checker')
+ finish
+endif
+let g:loaded_syntastic_verilog_verilator_checker = 1
+
+if !exists('g:syntastic_verilog_compiler_options')
+ let g:syntastic_verilog_compiler_options = '-Wall'
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_verilog_verilator_IsAvailable() dict
+ if !exists('g:syntastic_verilog_compiler')
+ let g:syntastic_verilog_compiler = self.getExec()
+ endif
+ call self.log('g:syntastic_verilog_compiler =', g:syntastic_verilog_compiler)
+ return executable(expand(g:syntastic_verilog_compiler, 1))
+endfunction
+
+function! SyntaxCheckers_verilog_verilator_GetLocList() dict
+ return syntastic#c#GetLocList('verilog', 'verilator', {
+ \ 'errorformat':
+ \ '%%%trror-%\=%\w%#: %f:%l: %m,' .
+ \ '%%%tarning-%\=%\w%#: %f:%l: %m',
+ \ 'main_flags': '--lint-only' })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'verilog',
+ \ 'name': 'verilator' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/vhdl/ghdl.vim b/vim/bundle/syntastic/syntax_checkers/vhdl/ghdl.vim
new file mode 100644
index 0000000..497152b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/vhdl/ghdl.vim
@@ -0,0 +1,38 @@
+"============================================================================
+"File: ghdl.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Jan Wagner <jaydyou at janidom dot de>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_vhdl_ghdl_checker')
+ finish
+endif
+let g:loaded_syntastic_vhdl_ghdl_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_vhdl_ghdl_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_before': '-s' })
+
+ let errorformat = '%f:%l:%c: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'vhdl',
+ \ 'name': 'ghdl'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/vhdl/vcom.vim b/vim/bundle/syntastic/syntax_checkers/vhdl/vcom.vim
new file mode 100644
index 0000000..6cdf4fb
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/vhdl/vcom.vim
@@ -0,0 +1,55 @@
+"============================================================================
+"File: vcom.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Jim Vogel <jim dot e dot vogel at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_vhdl_vcom_checker')
+ finish
+endif
+let g:loaded_syntastic_vhdl_vcom_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_vhdl_vcom_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_before': '-lint' })
+
+ let errorformat =
+ \ '** %tRROR: %f(%l): %m,' .
+ \ '** %tRROR: %m,' .
+ \ '** %tARNING: %f(%l): %m,' .
+ \ '** %tARNING: %m,' .
+ \ '** %tOTE: %m,' .
+ \ '%tRROR: %f(%l): %m,' .
+ \ '%tARNING[%*[0-9]]: %f(%l): %m,' .
+ \ '%tRROR: %m,' .
+ \ '%tARNING[%*[0-9]]: %m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+
+ for e in loclist
+ if e['type'] !=? 'E' && e['type'] !=? 'W'
+ let e['type'] = 'W'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'vhdl',
+ \ 'name': 'vcom'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/vim/vimlint.vim b/vim/bundle/syntastic/syntax_checkers/vim/vimlint.vim
new file mode 100644
index 0000000..0e03ed0
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/vim/vimlint.vim
@@ -0,0 +1,108 @@
+"============================================================================
+"File: vimlint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_vim_vimlint_checker')
+ finish
+endif
+let g:loaded_syntastic_vim_vimlint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_vim_vimlint_GetHighlightRegex(item) " {{{1
+ let term = matchstr(a:item['text'], '\m `\zs[^`]\+\ze`')
+ if term !=# ''
+ let col = get(a:item, 'col', 0)
+
+ if col && term[0:1] ==# 'l:'
+ if getline(a:item.lnum)[col-1:col] !=# 'l:'
+ let term = term[2:]
+ endif
+ endif
+
+ return col ? '\%>' . (col - 1) . 'c\%<' . (col + strlen(term)) . 'c' : '\V' . escape(term, '\')
+ endif
+
+ return ''
+endfunction " }}}1
+
+function! SyntaxCheckers_vim_vimlint_IsAvailable() dict " {{{1
+ let vimlparser = globpath(&runtimepath, 'autoload/vimlparser.vim', 1)
+ let vimlint = globpath(&runtimepath, 'autoload/vimlint.vim', 1)
+ call self.log("globpath(&runtimepath, 'autoload/vimlparser.vim', 1) = " . string(vimlparser) . ', ' .
+ \ "globpath(&runtimepath, 'autoload/vimlint.vim', 1) = " . string(vimlint))
+ return vimlparser !=# '' && vimlint !=# ''
+endfunction " }}}1
+
+function! SyntaxCheckers_vim_vimlint_GetLocList() dict " {{{1
+ " EVL102: unused variable v
+ " EVL103: unused argument v
+ " EVL104: variable may not be initialized on some execution path: v
+ " EVL105: global variable v is defined without g:
+ " EVL106: local variable v is used without l:
+ " EVL201: unreachable code
+ " EVL204: constant in conditional context
+ " EVL205: missing scriptencoding
+ " value 3: the message is a warning
+ "
+ " References: :help vimlint-errorcode and :help vimlint-variables
+ let param = {
+ \ 'output': function('s:vimlintOutput'),
+ \ 'quiet': 1,
+ \ 'EVL102': 3,
+ \ 'EVL103': 3,
+ \ 'EVL104': 3,
+ \ 'EVL105': 3,
+ \ 'EVL106': 3,
+ \ 'EVL201': 3,
+ \ 'EVL204': 3,
+ \ 'EVL205': 3 }
+
+ if exists('g:syntastic_vimlint_options') || exists('b:syntastic_vimlint_options')
+ let opts = syntastic#util#var('vimlint_options')
+ if type(opts) == type({})
+ let options = filter(copy(opts), 'v:key =~# "\\m^EVL"')
+ call extend(param, options, 'force')
+ endif
+ endif
+
+ call self.log('options =', param)
+
+ return vimlint#vimlint(expand('%', 1), param)
+endfunction " }}}1
+
+" Utilities {{{1
+
+" @vimlint(EVL103, 1, a:filename)
+function! s:vimlintOutput(filename, pos, ev, eid, mes, obj) " {{{2
+ call add(a:obj.error, {
+ \ 'bufnr': bufnr(''),
+ \ 'lnum': a:pos.lnum,
+ \ 'col': a:pos.col,
+ \ 'vcol': 0,
+ \ 'type': a:ev[0],
+ \ 'text': '[' . a:eid . '] ' . a:mes,
+ \ 'valid': a:pos.lnum > 0 })
+endfunction " }}}2
+" @vimlint(EVL103, 0, a:filename)
+
+" }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'vim',
+ \ 'name': 'vimlint',
+ \ 'exec': '' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/vim/vint.vim b/vim/bundle/syntastic/syntax_checkers/vim/vint.vim
new file mode 100644
index 0000000..23a041e
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/vim/vint.vim
@@ -0,0 +1,55 @@
+"============================================================================
+"File: vint.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_vim_vint_checker')
+ finish
+endif
+let g:loaded_syntastic_vim_vint_checker = 1
+
+if !exists('g:syntastic_vim_vint_sort')
+ let g:syntastic_vim_vint_sort = 1
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_vim_vint_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'post_args': '--json' })
+
+ let errorformat = '%f:%l:%c:%t: %m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'vint',
+ \ 'returns': [0, 1] })
+
+ for e in loclist
+ if e['type'] ==? 's'
+ let e['type'] = 'w'
+ let e['subtype'] = 'Style'
+ elseif e['type'] !=? 'e' && e['type'] !=? 'w'
+ let e['type'] = 'e'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'vim',
+ \ 'name': 'vint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/xhtml/jshint.vim b/vim/bundle/syntastic/syntax_checkers/xhtml/jshint.vim
new file mode 100644
index 0000000..f4536e2
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/xhtml/jshint.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: jshint.vim
+"Description: Javascript syntax checker for xHTML - using jshint
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_xhtml_jshint_checker')
+ finish
+endif
+let g:loaded_syntastic_xhtml_jshint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'xhtml',
+ \ 'name': 'jshint',
+ \ 'redirect': 'html/jshint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/xhtml/tidy.vim b/vim/bundle/syntastic/syntax_checkers/xhtml/tidy.vim
new file mode 100644
index 0000000..7f76d8b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/xhtml/tidy.vim
@@ -0,0 +1,92 @@
+"============================================================================
+"File: xhtml.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_xhtml_tidy_checker')
+ finish
+endif
+let g:loaded_syntastic_xhtml_tidy_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+if !exists('g:syntastic_xhtml_tidy_ignore_errors')
+ let g:syntastic_xhtml_tidy_ignore_errors = []
+endif
+
+" Constants {{{1
+
+" TODO: join this with html.vim DRY's sake?
+function! s:TidyEncOptByFenc()
+ let TIDY_OPTS = {
+ \ 'utf-8': '-utf8',
+ \ 'ascii': '-ascii',
+ \ 'latin1': '-latin1',
+ \ 'iso-2022-jp': '-iso-2022',
+ \ 'cp1252': '-win1252',
+ \ 'macroman': '-mac',
+ \ 'utf-16le': '-utf16le',
+ \ 'utf-16': '-utf16',
+ \ 'big5': '-big5',
+ \ 'cp932': '-shiftjis',
+ \ 'sjis': '-shiftjis',
+ \ 'cp850': '-ibm858',
+ \ }
+ return get(TIDY_OPTS, &fileencoding, '-utf8')
+endfunction
+
+" }}}1
+
+function! SyntaxCheckers_xhtml_tidy_GetLocList() dict " {{{1
+ let encopt = s:TidyEncOptByFenc()
+ let makeprg = self.makeprgBuild({ 'args_after': encopt . ' -xml -e' })
+
+ let errorformat=
+ \ '%Wline %l column %v - Warning: %m,' .
+ \ '%Eline %l column %v - Error: %m,' .
+ \ '%-G%.%#'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')},
+ \ 'returns': [0, 1, 2] })
+
+ for e in loclist
+ if e['valid'] && s:IgnoreError(e['text']) == 1
+ let e['valid'] = 0
+ endif
+ endfor
+
+ return loclist
+endfunction " }}}1
+
+" Utilities {{{1
+
+function! s:IgnoreError(text) " {{{2
+ for item in g:syntastic_xhtml_tidy_ignore_errors
+ if stridx(a:text, item) != -1
+ return 1
+ endif
+ endfor
+ return 0
+endfunction " }}}2
+
+" }}}1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'xhtml',
+ \ 'name': 'tidy'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/xml/plutil.vim b/vim/bundle/syntastic/syntax_checkers/xml/plutil.vim
new file mode 100644
index 0000000..8e80dde
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/xml/plutil.vim
@@ -0,0 +1,42 @@
+"============================================================================
+"File: plutil.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_xml_plutil_checker')
+ finish
+endif
+let g:loaded_syntastic_xml_plutil_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_xml_plutil_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_before': '-lint -s',
+ \ 'fname_before': '--' })
+
+ let errorformat =
+ \ '%E%f: %m at line %l'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 1] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'xml',
+ \ 'name': 'plutil'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/xml/xmllint.vim b/vim/bundle/syntastic/syntax_checkers/xml/xmllint.vim
new file mode 100644
index 0000000..1300437
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/xml/xmllint.vim
@@ -0,0 +1,54 @@
+"============================================================================
+"File: xml.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Sebastian Kusnier <sebastian at kusnier dot net>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_xml_xmllint_checker')
+ finish
+endif
+let g:loaded_syntastic_xml_xmllint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+" You can use a local installation of DTDs to significantly speed up validation
+" and allow you to validate XML data without network access, see xmlcatalog(1)
+" and http://www.xmlsoft.org/catalog.html for more information.
+
+function! SyntaxCheckers_xml_xmllint_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args': '--xinclude --postvalid',
+ \ 'args_after': '--noout' })
+
+ let errorformat=
+ \ '%E%f:%l: error : %m,' .
+ \ '%-G%f:%l: validity error : Validation failed: no DTD found %m,' .
+ \ '%W%f:%l: warning : %m,' .
+ \ '%W%f:%l: validity warning : %m,' .
+ \ '%E%f:%l: validity error : %m,' .
+ \ '%E%f:%l: parser error : %m,' .
+ \ '%E%f:%l: %m,' .
+ \ '%-Z%p^,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'returns': [0, 1, 2, 3, 4, 5] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'xml',
+ \ 'name': 'xmllint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/xquery/basex.vim b/vim/bundle/syntastic/syntax_checkers/xquery/basex.vim
new file mode 100644
index 0000000..640a191
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/xquery/basex.vim
@@ -0,0 +1,51 @@
+"============================================================================
+"File: basex.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: James Wright <james dot jw at hotmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_xquery_basex_checker')
+ finish
+endif
+let g:loaded_syntastic_xquery_basex_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_xquery_basex_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': '-z',
+ \ 'fname_before': '-q',
+ \ 'fname': syntastic#util#shescape('inspect:module("' . escape(expand('%:p', 1), '"') . '")') })
+
+ let errorformat =
+ \ '%f:%l:%c:%t:%n:%m,' .
+ \ '%m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'preprocess': 'basex' })
+
+ for e in loclist
+ if e['type'] !=# 'W' && e['type'] !=# 'E'
+ let e['type'] = 'E'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'xquery',
+ \ 'name': 'basex'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/xslt/xmllint.vim b/vim/bundle/syntastic/syntax_checkers/xslt/xmllint.vim
new file mode 100644
index 0000000..9ffb548
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/xslt/xmllint.vim
@@ -0,0 +1,23 @@
+"============================================================================
+"File: xslt.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Sebastian Kusnier <sebastian at kusnier dot net>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_xslt_xmllint_checker')
+ finish
+endif
+let g:loaded_syntastic_xslt_xmllint_checker = 1
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'xslt',
+ \ 'name': 'xmllint',
+ \ 'redirect': 'xml/xmllint'})
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/yacc/bison.vim b/vim/bundle/syntastic/syntax_checkers/yacc/bison.vim
new file mode 100644
index 0000000..af8ac91
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/yacc/bison.vim
@@ -0,0 +1,55 @@
+"============================================================================
+"File: yacc.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_yacc_bison_checker')
+ finish
+endif
+let g:loaded_syntastic_yacc_bison_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_yacc_bison_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_after': syntastic#c#NullOutput() })
+
+ let errorformat =
+ \ '%E%f:%l%.%v-%.%\{-}: %trror: %m,' .
+ \ '%E%f:%l%.%v: %trror: %m,' .
+ \ '%W%f:%l%.%v-%.%\{-}: %tarning: %m,' .
+ \ '%W%f:%l%.%v: %tarning: %m,' .
+ \ '%I%f:%l%.%v-%.%\{-}: %\s%\+%m,' .
+ \ '%I%f:%l%.%v: %\s%\+%m'
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+
+ let last_type = 'E'
+ for e in loclist
+ if e['type'] ==? 'I'
+ let e['type'] = last_type
+ endif
+ let last_type = e['type']
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'yacc',
+ \ 'name': 'bison'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/yaml/jsyaml.vim b/vim/bundle/syntastic/syntax_checkers/yaml/jsyaml.vim
new file mode 100644
index 0000000..e8baa7e
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/yaml/jsyaml.vim
@@ -0,0 +1,48 @@
+"============================================================================
+"File: yaml.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_yaml_jsyaml_checker')
+ finish
+endif
+let g:loaded_syntastic_yaml_jsyaml_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_yaml_jsyaml_GetLocList() dict
+ if !exists('s:js_yaml_new')
+ let s:js_yaml_new = syntastic#util#versionIsAtLeast(self.getVersion(), [2])
+ endif
+
+ let makeprg = self.makeprgBuild({ 'args_after': (s:js_yaml_new ? '' : '--compact') })
+
+ let errorformat =
+ \ 'Error on line %l\, col %c:%m,' .
+ \ 'JS-YAML: %m at line %l\, column %c:,' .
+ \ 'YAMLException: %m at line %l\, column %c:,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'defaults': {'bufnr': bufnr('')} })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'yaml',
+ \ 'name': 'jsyaml',
+ \ 'exec': 'js-yaml'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/yaml/yamllint.vim b/vim/bundle/syntastic/syntax_checkers/yaml/yamllint.vim
new file mode 100644
index 0000000..130877d
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/yaml/yamllint.vim
@@ -0,0 +1,52 @@
+"============================================================================
+"File: yamllint.vim
+"Description: YAML files linting for syntastic.vim
+"Maintainer: Adrien Vergé
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_yaml_yamllint_checker')
+ finish
+endif
+let g:loaded_syntastic_yaml_yamllint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_yaml_yamllint_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-f parsable' })
+
+ let errorformat =
+ \ '%f:%l:%c: [%trror] %m,' .
+ \ '%f:%l:%c: [%tarning] %m'
+
+ let env = syntastic#util#isRunningWindows() ? {} : { 'TERM': 'dumb' }
+
+ let loclist = SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'env': env,
+ \ 'returns': [0, 1] })
+
+ for e in loclist
+ if e['type'] ==? 'W'
+ let e['subtype'] = 'Style'
+ endif
+ endfor
+
+ return loclist
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'yaml',
+ \ 'name': 'yamllint' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/yaml/yamlxs.vim b/vim/bundle/syntastic/syntax_checkers/yaml/yamlxs.vim
new file mode 100644
index 0000000..ace118a
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/yaml/yamlxs.vim
@@ -0,0 +1,72 @@
+"============================================================================
+"File: yamlxs.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: LCD 47 <lcd047 at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_yaml_yamlxs_checker')
+ finish
+endif
+let g:loaded_syntastic_yaml_yamlxs_checker = 1
+
+if !exists('g:syntastic_perl_lib_path')
+ let g:syntastic_perl_lib_path = []
+endif
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_yaml_yamlxs_IsAvailable() dict
+ if !exists('g:syntastic_yaml_yamlxs_exec') && exists('g:syntastic_perl_interpreter')
+ let g:syntastic_yaml_yamlxs_exec = g:syntastic_perl_interpreter
+ endif
+
+ " don't call executable() here, to allow things like
+ " let g:syntastic_perl_interpreter='/usr/bin/env perl'
+ silent! call syntastic#util#system(self.getExecEscaped() . ' ' . s:Modules() . ' -e ' . syntastic#util#shescape('exit(0)'))
+ return v:shell_error == 0
+endfunction
+
+function! SyntaxCheckers_yaml_yamlxs_GetLocList() dict
+ let makeprg = self.makeprgBuild({
+ \ 'args_before': s:Modules() . ' -e ' . syntastic#util#shescape('YAML::XS::LoadFile($ARGV[0])') })
+
+ let errorformat =
+ \ '%EYAML::XS::Load Error: The problem:,' .
+ \ '%-C,' .
+ \ '%C %m,' .
+ \ '%Cwas found at document: %\d%\+\, line: %l\, column: %c,' .
+ \ '%-G%.%#'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['compressWhitespace'],
+ \ 'defaults': {'bufnr': bufnr('')} })
+endfunction
+
+function s:Modules()
+ if type(g:syntastic_perl_lib_path) == type('')
+ call syntastic#log#oneTimeWarn('variable g:syntastic_perl_lib_path should be a list')
+ let includes = split(g:syntastic_perl_lib_path, ',')
+ else
+ let includes = copy(syntastic#util#var('perl_lib_path'))
+ endif
+ return join(map(includes, '"-I" . v:val') + ['-MYAML::XS'])
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'yaml',
+ \ 'name': 'yamlxs',
+ \ 'exec': 'perl' })
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/yang/pyang.vim b/vim/bundle/syntastic/syntax_checkers/yang/pyang.vim
new file mode 100644
index 0000000..f397fa0
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/yang/pyang.vim
@@ -0,0 +1,46 @@
+"============================================================================
+"File: pyang.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Authors: joshua.downer@gmail.com
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_yang_pyang_checker')
+ finish
+endif
+let g:loaded_syntastic_yang_pyang_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_yang_pyang_GetHighlightRegex(item)
+ let term = matchstr(a:item['text'], '\m"\zs[^"]\+\ze"')
+ return term != '' ? '\V\<' . escape(term, '\') . '\>' : ''
+endfunction
+
+function! SyntaxCheckers_yang_pyang_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat =
+ \ '%f:%l: %trror: %m,' .
+ \ '%f:%l: %tarning: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat,
+ \ 'postprocess': ['filterForeignErrors'] })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'yang',
+ \ 'name': 'pyang'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/z80/z80syntaxchecker.vim b/vim/bundle/syntastic/syntax_checkers/z80/z80syntaxchecker.vim
new file mode 100644
index 0000000..af61a8b
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/z80/z80syntaxchecker.vim
@@ -0,0 +1,39 @@
+"============================================================================
+"File: z80syntaxchecker.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Romain Giot <giot.romain at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_z80_z80syntaxchecker_checker')
+ finish
+endif
+let g:loaded_syntastic_z80_z80syntaxchecker_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_z80_z80syntaxchecker_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat = '%f:%l %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'z80',
+ \ 'name': 'z80syntaxchecker',
+ \ 'exec': 'z80_syntax_checker.py'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/zpt/zptlint.vim b/vim/bundle/syntastic/syntax_checkers/zpt/zptlint.vim
new file mode 100644
index 0000000..31a6093
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/zpt/zptlint.vim
@@ -0,0 +1,42 @@
+"============================================================================
+"File: zpt.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: claytron <robots at claytron dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_zpt_zptlint_checker')
+ finish
+endif
+let g:loaded_syntastic_zpt_zptlint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_zpt_zptlint_GetLocList() dict
+ let makeprg = self.makeprgBuild({})
+
+ let errorformat=
+ \ '%-P*** Error in: %f,'.
+ \ '%Z%*\s\, at line %l\, column %c,'.
+ \ '%E%*\s%m,'.
+ \ '%-Q'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'zpt',
+ \ 'name': 'zptlint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/syntastic/syntax_checkers/zsh/zsh.vim b/vim/bundle/syntastic/syntax_checkers/zsh/zsh.vim
new file mode 100644
index 0000000..4d458de
--- /dev/null
+++ b/vim/bundle/syntastic/syntax_checkers/zsh/zsh.vim
@@ -0,0 +1,38 @@
+"============================================================================
+"File: zsh.vim
+"Description: Syntax checking plugin for syntastic.vim
+"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
+"License: This program is free software. It comes without any warranty,
+" to the extent permitted by applicable law. You can redistribute
+" it and/or modify it under the terms of the Do What The Fuck You
+" Want To Public License, Version 2, as published by Sam Hocevar.
+" See http://sam.zoy.org/wtfpl/COPYING for more details.
+"
+"============================================================================
+
+if exists('g:loaded_syntastic_zsh_zsh_checker')
+ finish
+endif
+let g:loaded_syntastic_zsh_zsh_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_zsh_zsh_GetLocList() dict
+ let makeprg = self.makeprgBuild({ 'args_after': '-n' })
+
+ let errorformat = '%f:%l: %m'
+
+ return SyntasticMake({
+ \ 'makeprg': makeprg,
+ \ 'errorformat': errorformat})
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+ \ 'filetype': 'zsh',
+ \ 'name': 'zsh'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/vim/bundle/tagbar/.gitattributes b/vim/bundle/tagbar/.gitattributes
new file mode 100644
index 0000000..3b1db11
--- /dev/null
+++ b/vim/bundle/tagbar/.gitattributes
@@ -0,0 +1,4 @@
+.gitignore export-ignore
+.gitattributes export-ignore
+README export-ignore
+.info export-ignore
diff --git a/vim/bundle/tagbar/.gitignore b/vim/bundle/tagbar/.gitignore
new file mode 100644
index 0000000..0a56e3f
--- /dev/null
+++ b/vim/bundle/tagbar/.gitignore
@@ -0,0 +1 @@
+/doc/tags
diff --git a/vim/bundle/tagbar/.info b/vim/bundle/tagbar/.info
new file mode 100644
index 0000000..f4d9137
--- /dev/null
+++ b/vim/bundle/tagbar/.info
@@ -0,0 +1,2 @@
+tagbar
+3465
diff --git a/vim/bundle/tagbar/LICENSE b/vim/bundle/tagbar/LICENSE
new file mode 100644
index 0000000..5ae1a75
--- /dev/null
+++ b/vim/bundle/tagbar/LICENSE
@@ -0,0 +1,82 @@
+TAGBAR LICENSE
+
+This is the normal Vim license (see ':h license' in Vim) with the necessary
+replacements for the project and maintainer information.
+
+I) There are no restrictions on distributing unmodified copies of Tagbar
+ except that they must include this license text. You can also distribute
+ unmodified parts of Tagbar, likewise unrestricted except that they must
+ include this license text. You are also allowed to include executables
+ that you made from the unmodified Tagbar sources, plus your own usage
+ examples and scripts.
+
+II) It is allowed to distribute a modified (or extended) version of Tagbar,
+ including executables and/or source code, when the following four
+ conditions are met:
+ 1) This license text must be included unmodified.
+ 2) The modified Tagbar must be distributed in one of the following five ways:
+ a) If you make changes to Tagbar yourself, you must clearly describe in
+ the distribution how to contact you. When the maintainer asks you
+ (in any way) for a copy of the modified Tagbar you distributed, you
+ must make your changes, including source code, available to the
+ maintainer without fee. The maintainer reserves the right to
+ include your changes in the official version of Tagbar. What the
+ maintainer will do with your changes and under what license they
+ will be distributed is negotiable. If there has been no negotiation
+ then this license, or a later version, also applies to your changes.
+ The current maintainer is Jan Larres <jan@majutsushi.net>. If this
+ changes it will be announced in appropriate places (most likely
+ majutsushi.github.io/tagbar and/or github.com/majutsushi/tagbar).
+ When it is completely impossible to contact the maintainer, the
+ obligation to send him your changes ceases. Once the maintainer has
+ confirmed that he has received your changes they will not have to be
+ sent again.
+ b) If you have received a modified Tagbar that was distributed as
+ mentioned under a) you are allowed to further distribute it
+ unmodified, as mentioned at I). If you make additional changes the
+ text under a) applies to those changes.
+ c) Provide all the changes, including source code, with every copy of
+ the modified Tagbar you distribute. This may be done in the form of
+ a context diff. You can choose what license to use for new code you
+ add. The changes and their license must not restrict others from
+ making their own changes to the official version of Tagbar.
+ d) When you have a modified Tagbar which includes changes as mentioned
+ under c), you can distribute it without the source code for the
+ changes if the following three conditions are met:
+ - The license that applies to the changes permits you to distribute
+ the changes to the Tagbar maintainer without fee or restriction, and
+ permits the Tagbar maintainer to include the changes in the official
+ version of Tagbar without fee or restriction.
+ - You keep the changes for at least three years after last
+ distributing the corresponding modified Tagbar. When the
+ maintainer or someone who you distributed the modified Tagbar to
+ asks you (in any way) for the changes within this period, you must
+ make them available to him.
+ - You clearly describe in the distribution how to contact you. This
+ contact information must remain valid for at least three years
+ after last distributing the corresponding modified Tagbar, or as
+ long as possible.
+ e) When the GNU General Public License (GPL) applies to the changes,
+ you can distribute the modified Tagbar under the GNU GPL version 2
+ or any later version.
+ 3) A message must be added, at least in the documentation, such that the
+ user of the modified Tagbar is able to see that it was modified. When
+ distributing as mentioned under 2)e) adding the message is only
+ required for as far as this does not conflict with the license used for
+ the changes.
+ 4) The contact information as required under 2)a) and 2)d) must not be
+ removed or changed, except that the person himself can make
+ corrections.
+
+III) If you distribute a modified version of Tagbar, you are encouraged to use
+ the Tagbar license for your changes and make them available to the
+ maintainer, including the source code. The preferred way to do this is
+ by e-mail or by uploading the files to a server and e-mailing the URL. If
+ the number of changes is small (e.g., a modified Makefile) e-mailing a
+ context diff will do. The e-mail address to be used is
+ <jan@majutsushi.net>
+
+IV) It is not allowed to remove this license from the distribution of the
+ Tagbar sources, parts of it or from a modified version. You may use this
+ license for previous Tagbar releases instead of the license that they
+ came with, at your option.
diff --git a/vim/bundle/tagbar/README.md b/vim/bundle/tagbar/README.md
new file mode 100644
index 0000000..eceddbe
--- /dev/null
+++ b/vim/bundle/tagbar/README.md
@@ -0,0 +1,89 @@
+# Tagbar: a class outline viewer for Vim
+
+## What Tagbar is
+
+Tagbar is a Vim plugin that provides an easy way to browse the tags of the
+current file and get an overview of its structure. It does this by creating a
+sidebar that displays the ctags-generated tags of the current file, ordered by
+their scope. This means that for example methods in C++ are displayed under
+the class they are defined in.
+
+## What Tagbar is not
+
+Tagbar is not a general-purpose tool for managing `tags` files. It only
+creates the tags it needs on-the-fly in-memory without creating any files.
+`tags` file management is provided by other plugins, like for example
+[easytags](https://github.com/xolox/vim-easytags).
+
+## Dependencies
+
+[Vim 7.0](http://www.vim.org/) (But see note below)
+[Exuberant ctags 5.5](http://ctags.sourceforge.net/)
+
+## Installation
+
+Extract the archive or clone the repository into a directory in your
+`'runtimepath'`, or use a plugin manager of your choice like
+[pathogen](https://github.com/tpope/vim-pathogen). Don't forget to run
+`:helptags` if your plugin manager doesn't do it for you so you can access the
+documentation with `:help tagbar`.
+
+Note: Vim versions < 7.0.167 have a bug that prevents Tagbar from working. If
+you are affected by this use this alternate Tagbar download instead:
+[zip](https://github.com/majutsushi/tagbar/zipball/70fix). It is on par with
+version 2.2 but probably won't be updated after that due to the amount of
+changes required.
+
+If the ctags executable is not installed in one of the directories in your
+`$PATH` environment variable you have to set the `g:tagbar_ctags_bin`
+variable, see the documentation for more info.
+
+## Quickstart
+
+Put something like the following into your ~/.vimrc:
+
+```vim
+nmap <F8> :TagbarToggle<CR>
+```
+
+If you do this the F8 key will toggle the Tagbar window. You can of course use
+any shortcut you want. For more flexible ways to open and close the window
+(and the rest of the functionality) see the documentation.
+
+## Support for additional filetypes
+
+For filetypes that are not supported by Exuberant Ctags check out [the
+wiki](https://github.com/majutsushi/tagbar/wiki) to see whether other projects
+offer support for them and how to use them. Please add any other
+projects/configurations that you find or create yourself so that others can
+benefit from them, too.
+
+## Note: If the file structure display is wrong
+
+If you notice that there are some errors in the way your file's structure is
+displayed in Tagbar, please make sure that the bug is actually in Tagbar
+before you report an issue. Since Tagbar uses
+[exuberant-ctags](http://ctags.sourceforge.net/) and compatible programs to do
+the actual file parsing, it is likely that the bug is actually in the program
+responsible for that filetype instead.
+
+There is an example in `:h tagbar-issues` about how to run ctags manually so
+you can determine where the bug actually is. If the bug is actually in ctags,
+please report it on their website instead, as there is nothing I can do about
+it in Tagbar. Thank you!
+
+You can also have a look at [ctags bugs that have previously been filed
+against Tagbar](https://github.com/majutsushi/tagbar/issues?labels=ctags-bug&page=1&state=closed).
+
+## Screenshots
+
+![screenshot1](https://i.imgur.com/Sf9Ls2r.png)
+![screenshot2](https://i.imgur.com/n4bpPv3.png)
+
+## License
+
+Vim license, see LICENSE
+
+## Maintainer
+
+Jan Larres <[jan@majutsushi.net](mailto:jan@majutsushi.net)>
diff --git a/vim/bundle/tagbar/autoload/tagbar.vim b/vim/bundle/tagbar/autoload/tagbar.vim
new file mode 100644
index 0000000..34e3f48
--- /dev/null
+++ b/vim/bundle/tagbar/autoload/tagbar.vim
@@ -0,0 +1,4268 @@
+" ============================================================================
+" File: tagbar.vim
+" Description: List the current file's tags in a sidebar, ordered by class etc
+" Author: Jan Larres <jan@majutsushi.net>
+" Licence: Vim licence
+" Website: http://majutsushi.github.com/tagbar/
+" Version: 2.6.1
+" Note: This plugin was heavily inspired by the 'Taglist' plugin by
+" Yegappan Lakshmanan and uses a small amount of code from it.
+"
+" Original taglist copyright notice:
+" Permission is hereby granted to use and distribute this code,
+" with or without modifications, provided that this copyright
+" notice is copied with it. Like anything else that's free,
+" taglist.vim is provided *as is* and comes with no warranty of
+" any kind, either expressed or implied. In no event will the
+" copyright holder be liable for any damamges resulting from the
+" use of this software.
+" ============================================================================
+
+scriptencoding utf-8
+
+" Initialization {{{1
+
+" If another plugin calls an autoloaded Tagbar function on startup before the
+" plugin/tagbar.vim file got loaded, load it explicitly
+if exists(':Tagbar') == 0
+ runtime plugin/tagbar.vim
+endif
+
+if exists(':Tagbar') == 0
+ echomsg 'Tagbar: Could not load plugin code, check your runtimepath!'
+ finish
+endif
+
+" Basic init {{{2
+
+redir => s:ftype_out
+silent filetype
+redir END
+if s:ftype_out !~# 'detection:ON'
+ echomsg 'Tagbar: Filetype detection is turned off, skipping plugin'
+ unlet s:ftype_out
+ finish
+endif
+unlet s:ftype_out
+
+let s:icon_closed = g:tagbar_iconchars[0]
+let s:icon_open = g:tagbar_iconchars[1]
+
+let s:type_init_done = 0
+let s:autocommands_done = 0
+let s:statusline_in_use = 0
+
+" 0: not checked yet; 1: checked and found; 2: checked and not found
+let s:checked_ctags = 0
+let s:checked_ctags_types = 0
+let s:ctags_types = {}
+
+let s:new_window = 1
+let s:is_maximized = 0
+let s:winrestcmd = ''
+let s:short_help = 1
+let s:nearby_disabled = 0
+let s:paused = 0
+let s:pwin_by_tagbar = 0
+
+let s:window_expanded = 0
+let s:expand_bufnr = -1
+let s:window_pos = {
+ \ 'pre' : { 'x' : 0, 'y' : 0 },
+ \ 'post' : { 'x' : 0, 'y' : 0 }
+\}
+
+" Script-local variable needed since compare functions can't
+" take extra arguments
+let s:compare_typeinfo = {}
+
+let s:visibility_symbols = {
+ \ 'public' : '+',
+ \ 'protected' : '#',
+ \ 'private' : '-'
+\ }
+
+let g:loaded_tagbar = 1
+
+let s:last_highlight_tline = 0
+let s:debug = 0
+let s:debug_file = ''
+
+let s:warnings = {
+ \ 'type': [],
+ \ 'encoding': 0
+\ }
+
+" s:Init() {{{2
+function! s:Init(silent) abort
+ if s:checked_ctags == 2 && a:silent
+ return 0
+ elseif s:checked_ctags != 1
+ if !s:CheckForExCtags(a:silent)
+ return 0
+ endif
+ endif
+
+ if !s:checked_ctags_types
+ call s:GetSupportedFiletypes()
+ endif
+
+ if !s:type_init_done
+ call s:InitTypes()
+ endif
+
+ if !s:autocommands_done
+ call s:CreateAutocommands()
+ call s:AutoUpdate(fnamemodify(expand('%'), ':p'), 0)
+ endif
+
+ return 1
+endfunction
+
+" s:InitTypes() {{{2
+function! s:InitTypes() abort
+ call s:debug('Initializing types')
+
+ let s:known_types = {}
+
+ " Ant {{{3
+ let type_ant = s:TypeInfo.New()
+ let type_ant.ctagstype = 'ant'
+ let type_ant.kinds = [
+ \ {'short' : 'p', 'long' : 'projects', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 't', 'long' : 'targets', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.ant = type_ant
+ " Asm {{{3
+ let type_asm = s:TypeInfo.New()
+ let type_asm.ctagstype = 'asm'
+ let type_asm.kinds = [
+ \ {'short' : 'm', 'long' : 'macros', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'd', 'long' : 'defines', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.asm = type_asm
+ " ASP {{{3
+ let type_aspvbs = s:TypeInfo.New()
+ let type_aspvbs.ctagstype = 'asp'
+ let type_aspvbs.kinds = [
+ \ {'short' : 'd', 'long' : 'constants', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.aspvbs = type_aspvbs
+ " Awk {{{3
+ let type_awk = s:TypeInfo.New()
+ let type_awk.ctagstype = 'awk'
+ let type_awk.kinds = [
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.awk = type_awk
+ " Basic {{{3
+ let type_basic = s:TypeInfo.New()
+ let type_basic.ctagstype = 'basic'
+ let type_basic.kinds = [
+ \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'g', 'long' : 'enumerations', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.basic = type_basic
+ " BETA {{{3
+ let type_beta = s:TypeInfo.New()
+ let type_beta.ctagstype = 'beta'
+ let type_beta.kinds = [
+ \ {'short' : 'f', 'long' : 'fragments', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 's', 'long' : 'slots', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'v', 'long' : 'patterns', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.beta = type_beta
+ " C {{{3
+ let type_c = s:TypeInfo.New()
+ let type_c.ctagstype = 'c'
+ let type_c.kinds = [
+ \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
+ \ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0},
+ \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let type_c.sro = '::'
+ let type_c.kind2scope = {
+ \ 'g' : 'enum',
+ \ 's' : 'struct',
+ \ 'u' : 'union'
+ \ }
+ let type_c.scope2kind = {
+ \ 'enum' : 'g',
+ \ 'struct' : 's',
+ \ 'union' : 'u'
+ \ }
+ let s:known_types.c = type_c
+ " C++ {{{3
+ let type_cpp = s:TypeInfo.New()
+ let type_cpp.ctagstype = 'c++'
+ let type_cpp.kinds = [
+ \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
+ \ {'short' : 'p', 'long' : 'prototypes', 'fold' : 1, 'stl' : 0},
+ \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'u', 'long' : 'unions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}
+ \ ]
+ let type_cpp.sro = '::'
+ let type_cpp.kind2scope = {
+ \ 'g' : 'enum',
+ \ 'n' : 'namespace',
+ \ 'c' : 'class',
+ \ 's' : 'struct',
+ \ 'u' : 'union'
+ \ }
+ let type_cpp.scope2kind = {
+ \ 'enum' : 'g',
+ \ 'namespace' : 'n',
+ \ 'class' : 'c',
+ \ 'struct' : 's',
+ \ 'union' : 'u'
+ \ }
+ let s:known_types.cpp = type_cpp
+ let s:known_types.cuda = type_cpp
+ " C# {{{3
+ let type_cs = s:TypeInfo.New()
+ let type_cs.ctagstype = 'c#'
+ let type_cs.kinds = [
+ \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
+ \ {'short' : 'f', 'long' : 'fields', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 't', 'long' : 'typedefs', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 's', 'long' : 'structs', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'E', 'long' : 'events', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let type_cs.sro = '.'
+ let type_cs.kind2scope = {
+ \ 'n' : 'namespace',
+ \ 'i' : 'interface',
+ \ 'c' : 'class',
+ \ 's' : 'struct',
+ \ 'g' : 'enum'
+ \ }
+ let type_cs.scope2kind = {
+ \ 'namespace' : 'n',
+ \ 'interface' : 'i',
+ \ 'class' : 'c',
+ \ 'struct' : 's',
+ \ 'enum' : 'g'
+ \ }
+ let s:known_types.cs = type_cs
+ " COBOL {{{3
+ let type_cobol = s:TypeInfo.New()
+ let type_cobol.ctagstype = 'cobol'
+ let type_cobol.kinds = [
+ \ {'short' : 'd', 'long' : 'data items', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'file descriptions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'g', 'long' : 'group items', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'p', 'long' : 'paragraphs', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'P', 'long' : 'program ids', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 's', 'long' : 'sections', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.cobol = type_cobol
+ " DOS Batch {{{3
+ let type_dosbatch = s:TypeInfo.New()
+ let type_dosbatch.ctagstype = 'dosbatch'
+ let type_dosbatch.kinds = [
+ \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.dosbatch = type_dosbatch
+ " Eiffel {{{3
+ let type_eiffel = s:TypeInfo.New()
+ let type_eiffel.ctagstype = 'eiffel'
+ let type_eiffel.kinds = [
+ \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'features', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let type_eiffel.sro = '.' " Not sure, is nesting even possible?
+ let type_eiffel.kind2scope = {
+ \ 'c' : 'class',
+ \ 'f' : 'feature'
+ \ }
+ let type_eiffel.scope2kind = {
+ \ 'class' : 'c',
+ \ 'feature' : 'f'
+ \ }
+ let s:known_types.eiffel = type_eiffel
+ " Erlang {{{3
+ let type_erlang = s:TypeInfo.New()
+ let type_erlang.ctagstype = 'erlang'
+ let type_erlang.kinds = [
+ \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'd', 'long' : 'macro definitions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'r', 'long' : 'record definitions', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let type_erlang.sro = '.' " Not sure, is nesting even possible?
+ let type_erlang.kind2scope = {
+ \ 'm' : 'module'
+ \ }
+ let type_erlang.scope2kind = {
+ \ 'module' : 'm'
+ \ }
+ let s:known_types.erlang = type_erlang
+ " Flex {{{3
+ " Vim doesn't support Flex out of the box, this is based on rough
+ " guesses and probably requires
+ " http://www.vim.org/scripts/script.php?script_id=2909
+ " Improvements welcome!
+ let type_as = s:TypeInfo.New()
+ let type_as.ctagstype = 'flex'
+ let type_as.kinds = [
+ \ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'p', 'long' : 'properties', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'x', 'long' : 'mxtags', 'fold' : 0, 'stl' : 0}
+ \ ]
+ let type_as.sro = '.'
+ let type_as.kind2scope = {
+ \ 'c' : 'class'
+ \ }
+ let type_as.scope2kind = {
+ \ 'class' : 'c'
+ \ }
+ let s:known_types.mxml = type_as
+ let s:known_types.actionscript = type_as
+ " Fortran {{{3
+ let type_fortran = s:TypeInfo.New()
+ let type_fortran.ctagstype = 'fortran'
+ let type_fortran.kinds = [
+ \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'p', 'long' : 'programs', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'k', 'long' : 'components', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 't', 'long' : 'derived types and structures', 'fold' : 0,
+ \ 'stl' : 1},
+ \ {'short' : 'c', 'long' : 'common blocks', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'b', 'long' : 'block data', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'e', 'long' : 'entry points', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'n', 'long' : 'namelists', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}
+ \ ]
+ let type_fortran.sro = '.' " Not sure, is nesting even possible?
+ let type_fortran.kind2scope = {
+ \ 'm' : 'module',
+ \ 'p' : 'program',
+ \ 'f' : 'function',
+ \ 's' : 'subroutine'
+ \ }
+ let type_fortran.scope2kind = {
+ \ 'module' : 'm',
+ \ 'program' : 'p',
+ \ 'function' : 'f',
+ \ 'subroutine' : 's'
+ \ }
+ let s:known_types.fortran = type_fortran
+ " HTML {{{3
+ let type_html = s:TypeInfo.New()
+ let type_html.ctagstype = 'html'
+ let type_html.kinds = [
+ \ {'short' : 'f', 'long' : 'JavaScript funtions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'a', 'long' : 'named anchors', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.html = type_html
+ " Java {{{3
+ let type_java = s:TypeInfo.New()
+ let type_java.ctagstype = 'java'
+ let type_java.kinds = [
+ \ {'short' : 'p', 'long' : 'packages', 'fold' : 1, 'stl' : 0},
+ \ {'short' : 'f', 'long' : 'fields', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'g', 'long' : 'enum types', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'e', 'long' : 'enum constants', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let type_java.sro = '.'
+ let type_java.kind2scope = {
+ \ 'g' : 'enum',
+ \ 'i' : 'interface',
+ \ 'c' : 'class'
+ \ }
+ let type_java.scope2kind = {
+ \ 'enum' : 'g',
+ \ 'interface' : 'i',
+ \ 'class' : 'c'
+ \ }
+ let s:known_types.java = type_java
+ " JavaScript {{{3
+ " jsctags/doctorjs will be used if available.
+ let type_javascript = s:TypeInfo.New()
+ let type_javascript.ctagstype = 'javascript'
+ let jsctags = s:CheckFTCtags('jsctags', 'javascript')
+ if jsctags != ''
+ let type_javascript.kinds = [
+ \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let type_javascript.sro = '.'
+ let type_javascript.kind2scope = {
+ \ 'v' : 'namespace',
+ \ 'f' : 'namespace'
+ \ }
+ let type_javascript.scope2kind = {
+ \ 'namespace' : 'v'
+ \ }
+ let type_javascript.ctagsbin = jsctags
+ let type_javascript.ctagsargs = '-f -'
+ else
+ let type_javascript.kinds = [
+ \ {'short': 'v', 'long': 'global variables', 'fold': 0, 'stl': 0},
+ \ {'short': 'c', 'long': 'classes', 'fold': 0, 'stl': 1},
+ \ {'short': 'p', 'long': 'properties', 'fold': 0, 'stl': 0},
+ \ {'short': 'm', 'long': 'methods', 'fold': 0, 'stl': 1},
+ \ {'short': 'f', 'long': 'functions', 'fold': 0, 'stl': 1},
+ \ ]
+ let type_javascript.sro = '.'
+ let type_javascript.kind2scope = {
+ \ 'c' : 'class',
+ \ 'f' : 'function',
+ \ 'm' : 'method',
+ \ 'p' : 'property',
+ \ }
+ let type_javascript.scope2kind = {
+ \ 'class' : 'c',
+ \ 'function' : 'f',
+ \ }
+ endif
+ let s:known_types.javascript = type_javascript
+ " Lisp {{{3
+ let type_lisp = s:TypeInfo.New()
+ let type_lisp.ctagstype = 'lisp'
+ let type_lisp.kinds = [
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.lisp = type_lisp
+ let s:known_types.clojure = type_lisp
+ " Lua {{{3
+ let type_lua = s:TypeInfo.New()
+ let type_lua.ctagstype = 'lua'
+ let type_lua.kinds = [
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.lua = type_lua
+ " Make {{{3
+ let type_make = s:TypeInfo.New()
+ let type_make.ctagstype = 'make'
+ let type_make.kinds = [
+ \ {'short' : 'm', 'long' : 'macros', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.make = type_make
+ " Matlab {{{3
+ let type_matlab = s:TypeInfo.New()
+ let type_matlab.ctagstype = 'matlab'
+ let type_matlab.kinds = [
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.matlab = type_matlab
+ " Ocaml {{{3
+ let type_ocaml = s:TypeInfo.New()
+ let type_ocaml.ctagstype = 'ocaml'
+ let type_ocaml.kinds = [
+ \ {'short' : 'M', 'long' : 'modules or functors', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'v', 'long' : 'global variables', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'C', 'long' : 'constructors', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'e', 'long' : 'exceptions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 't', 'long' : 'type names', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'r', 'long' : 'structure fields', 'fold' : 0, 'stl' : 0}
+ \ ]
+ let type_ocaml.sro = '.' " Not sure, is nesting even possible?
+ let type_ocaml.kind2scope = {
+ \ 'M' : 'Module',
+ \ 'c' : 'class',
+ \ 't' : 'type'
+ \ }
+ let type_ocaml.scope2kind = {
+ \ 'Module' : 'M',
+ \ 'class' : 'c',
+ \ 'type' : 't'
+ \ }
+ let s:known_types.ocaml = type_ocaml
+ " Pascal {{{3
+ let type_pascal = s:TypeInfo.New()
+ let type_pascal.ctagstype = 'pascal'
+ let type_pascal.kinds = [
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.pascal = type_pascal
+ " Perl {{{3
+ let type_perl = s:TypeInfo.New()
+ let type_perl.ctagstype = 'perl'
+ let type_perl.kinds = [
+ \ {'short' : 'p', 'long' : 'packages', 'fold' : 1, 'stl' : 0},
+ \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'f', 'long' : 'formats', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.perl = type_perl
+ " PHP {{{3
+ let type_php = s:TypeInfo.New()
+ let type_php.ctagstype = 'php'
+ let type_php.kinds = [
+ \ {'short' : 'i', 'long' : 'interfaces', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'd', 'long' : 'constant definitions', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'j', 'long' : 'javascript functions', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.php = type_php
+ " Python {{{3
+ let type_python = s:TypeInfo.New()
+ let type_python.ctagstype = 'python'
+ let type_python.kinds = [
+ \ {'short' : 'i', 'long' : 'imports', 'fold' : 1, 'stl' : 0},
+ \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}
+ \ ]
+ let type_python.sro = '.'
+ let type_python.kind2scope = {
+ \ 'c' : 'class',
+ \ 'f' : 'function',
+ \ 'm' : 'function'
+ \ }
+ let type_python.scope2kind = {
+ \ 'class' : 'c',
+ \ 'function' : 'f'
+ \ }
+ let s:known_types.python = type_python
+ let s:known_types.pyrex = type_python
+ let s:known_types.cython = type_python
+ " REXX {{{3
+ let type_rexx = s:TypeInfo.New()
+ let type_rexx.ctagstype = 'rexx'
+ let type_rexx.kinds = [
+ \ {'short' : 's', 'long' : 'subroutines', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.rexx = type_rexx
+ " Ruby {{{3
+ let type_ruby = s:TypeInfo.New()
+ let type_ruby.ctagstype = 'ruby'
+ let type_ruby.kinds = [
+ \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'F', 'long' : 'singleton methods', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let type_ruby.sro = '.'
+ let type_ruby.kind2scope = {
+ \ 'c' : 'class',
+ \ 'm' : 'class'
+ \ }
+ let type_ruby.scope2kind = {
+ \ 'class' : 'c'
+ \ }
+ let s:known_types.ruby = type_ruby
+ " Scheme {{{3
+ let type_scheme = s:TypeInfo.New()
+ let type_scheme.ctagstype = 'scheme'
+ let type_scheme.kinds = [
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 's', 'long' : 'sets', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.scheme = type_scheme
+ let s:known_types.racket = type_scheme
+ " Shell script {{{3
+ let type_sh = s:TypeInfo.New()
+ let type_sh.ctagstype = 'sh'
+ let type_sh.kinds = [
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.sh = type_sh
+ let s:known_types.csh = type_sh
+ let s:known_types.zsh = type_sh
+ " SLang {{{3
+ let type_slang = s:TypeInfo.New()
+ let type_slang.ctagstype = 'slang'
+ let type_slang.kinds = [
+ \ {'short' : 'n', 'long' : 'namespaces', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.slang = type_slang
+ " SML {{{3
+ let type_sml = s:TypeInfo.New()
+ let type_sml.ctagstype = 'sml'
+ let type_sml.kinds = [
+ \ {'short' : 'e', 'long' : 'exception declarations', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'f', 'long' : 'function definitions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'c', 'long' : 'functor definitions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 's', 'long' : 'signature declarations', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'r', 'long' : 'structure declarations', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 't', 'long' : 'type definitions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'v', 'long' : 'value bindings', 'fold' : 0, 'stl' : 0}
+ \ ]
+ let s:known_types.sml = type_sml
+ " SQL {{{3
+ " The SQL ctags parser seems to be buggy for me, so this just uses the
+ " normal kinds even though scopes should be available. Improvements
+ " welcome!
+ let type_sql = s:TypeInfo.New()
+ let type_sql.ctagstype = 'sql'
+ let type_sql.kinds = [
+ \ {'short' : 'P', 'long' : 'packages', 'fold' : 1, 'stl' : 1},
+ \ {'short' : 'd', 'long' : 'prototypes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'c', 'long' : 'cursors', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'F', 'long' : 'record fields', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'L', 'long' : 'block label', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 's', 'long' : 'subtypes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 't', 'long' : 'tables', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'T', 'long' : 'triggers', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'i', 'long' : 'indexes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'e', 'long' : 'events', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'U', 'long' : 'publications', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'R', 'long' : 'services', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'D', 'long' : 'domains', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'V', 'long' : 'views', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'n', 'long' : 'synonyms', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'x', 'long' : 'MobiLink Table Scripts', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'y', 'long' : 'MobiLink Conn Scripts', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'z', 'long' : 'MobiLink Properties', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.sql = type_sql
+ " Tcl {{{3
+ let type_tcl = s:TypeInfo.New()
+ let type_tcl.ctagstype = 'tcl'
+ let type_tcl.kinds = [
+ \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'm', 'long' : 'methods', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.tcl = type_tcl
+ " LaTeX {{{3
+ let type_tex = s:TypeInfo.New()
+ let type_tex.ctagstype = 'tex'
+ let type_tex.kinds = [
+ \ {'short' : 'i', 'long' : 'includes', 'fold' : 1, 'stl' : 0},
+ \ {'short' : 'p', 'long' : 'parts', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'c', 'long' : 'chapters', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 's', 'long' : 'sections', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'u', 'long' : 'subsections', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'b', 'long' : 'subsubsections', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'P', 'long' : 'paragraphs', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'G', 'long' : 'subparagraphs', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 0}
+ \ ]
+ let type_tex.sro = '""'
+ let type_tex.kind2scope = {
+ \ 'p' : 'part',
+ \ 'c' : 'chapter',
+ \ 's' : 'section',
+ \ 'u' : 'subsection',
+ \ 'b' : 'subsubsection'
+ \ }
+ let type_tex.scope2kind = {
+ \ 'part' : 'p',
+ \ 'chapter' : 'c',
+ \ 'section' : 's',
+ \ 'subsection' : 'u',
+ \ 'subsubsection' : 'b'
+ \ }
+ let type_tex.sort = 0
+ let s:known_types.tex = type_tex
+ " Vala {{{3
+ " Vala is supported by the ctags fork provided by Anjuta, so only add the
+ " type if the fork is used to prevent error messages otherwise
+ if has_key(s:ctags_types, 'vala') || executable('anjuta-tags')
+ let type_vala = s:TypeInfo.New()
+ let type_vala.ctagstype = 'vala'
+ let type_vala.kinds = [
+ \ {'short' : 'e', 'long' : 'Enumerations', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'v', 'long' : 'Enumeration values', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 's', 'long' : 'Structures', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'i', 'long' : 'Interfaces', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'd', 'long' : 'Delegates', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'c', 'long' : 'Classes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'p', 'long' : 'Properties', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'f', 'long' : 'Fields', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'm', 'long' : 'Methods', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'E', 'long' : 'Error domains', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'r', 'long' : 'Error codes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'S', 'long' : 'Signals', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let type_vala.sro = '.'
+ " 'enum' doesn't seem to be used as a scope, but it can't hurt to have
+ " it here
+ let type_vala.kind2scope = {
+ \ 's' : 'struct',
+ \ 'i' : 'interface',
+ \ 'c' : 'class',
+ \ 'e' : 'enum'
+ \ }
+ let type_vala.scope2kind = {
+ \ 'struct' : 's',
+ \ 'interface' : 'i',
+ \ 'class' : 'c',
+ \ 'enum' : 'e'
+ \ }
+ let s:known_types.vala = type_vala
+ endif
+ if !has_key(s:ctags_types, 'vala') && executable('anjuta-tags')
+ let s:known_types.vala.ctagsbin = 'anjuta-tags'
+ endif
+ " Vera {{{3
+ " Why are variables 'virtual'?
+ let type_vera = s:TypeInfo.New()
+ let type_vera.ctagstype = 'vera'
+ let type_vera.kinds = [
+ \ {'short' : 'd', 'long' : 'macros', 'fold' : 1, 'stl' : 0},
+ \ {'short' : 'g', 'long' : 'enums', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'T', 'long' : 'typedefs', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'c', 'long' : 'classes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'e', 'long' : 'enumerators', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'm', 'long' : 'members', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 't', 'long' : 'tasks', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'p', 'long' : 'programs', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let type_vera.sro = '.' " Nesting doesn't seem to be possible
+ let type_vera.kind2scope = {
+ \ 'g' : 'enum',
+ \ 'c' : 'class',
+ \ 'v' : 'virtual'
+ \ }
+ let type_vera.scope2kind = {
+ \ 'enum' : 'g',
+ \ 'class' : 'c',
+ \ 'virtual' : 'v'
+ \ }
+ let s:known_types.vera = type_vera
+ " Verilog {{{3
+ let type_verilog = s:TypeInfo.New()
+ let type_verilog.ctagstype = 'verilog'
+ let type_verilog.kinds = [
+ \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'e', 'long' : 'events', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'm', 'long' : 'modules', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'n', 'long' : 'net data types', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'p', 'long' : 'ports', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'r', 'long' : 'register data types', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 't', 'long' : 'tasks', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.verilog = type_verilog
+ " VHDL {{{3
+ " The VHDL ctags parser unfortunately doesn't generate proper scopes
+ let type_vhdl = s:TypeInfo.New()
+ let type_vhdl.ctagstype = 'vhdl'
+ let type_vhdl.kinds = [
+ \ {'short' : 'P', 'long' : 'packages', 'fold' : 1, 'stl' : 0},
+ \ {'short' : 'c', 'long' : 'constants', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 't', 'long' : 'types', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'T', 'long' : 'subtypes', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'r', 'long' : 'records', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'e', 'long' : 'entities', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'p', 'long' : 'procedures', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.vhdl = type_vhdl
+ " Vim {{{3
+ let type_vim = s:TypeInfo.New()
+ let type_vim.ctagstype = 'vim'
+ let type_vim.kinds = [
+ \ {'short' : 'n', 'long' : 'vimball filenames', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'v', 'long' : 'variables', 'fold' : 1, 'stl' : 0},
+ \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1},
+ \ {'short' : 'a', 'long' : 'autocommand groups', 'fold' : 1, 'stl' : 1},
+ \ {'short' : 'c', 'long' : 'commands', 'fold' : 0, 'stl' : 0},
+ \ {'short' : 'm', 'long' : 'maps', 'fold' : 1, 'stl' : 0}
+ \ ]
+ let s:known_types.vim = type_vim
+ " YACC {{{3
+ let type_yacc = s:TypeInfo.New()
+ let type_yacc.ctagstype = 'yacc'
+ let type_yacc.kinds = [
+ \ {'short' : 'l', 'long' : 'labels', 'fold' : 0, 'stl' : 1}
+ \ ]
+ let s:known_types.yacc = type_yacc
+ " }}}3
+
+ for [type, typeinfo] in items(s:known_types)
+ let typeinfo.ftype = type
+ endfor
+
+ call s:LoadUserTypeDefs()
+
+ for typeinfo in values(s:known_types)
+ call typeinfo.createKinddict()
+ endfor
+
+ let s:type_init_done = 1
+endfunction
+
+" s:LoadUserTypeDefs() {{{2
+function! s:LoadUserTypeDefs(...) abort
+ if a:0 > 0
+ let type = a:1
+
+ call s:debug("Initializing user type '" . type . "'")
+
+ let defdict = {}
+ let defdict[type] = g:tagbar_type_{type}
+ else
+ call s:debug('Initializing user types')
+
+ let defdict = tagbar#getusertypes()
+ endif
+
+ let transformed = {}
+ for [type, def] in items(defdict)
+ let transformed[type] = s:TransformUserTypeDef(def)
+ let transformed[type].ftype = type
+ endfor
+
+ for [key, value] in items(transformed)
+ if !has_key(s:known_types, key) || get(value, 'replace', 0)
+ let s:known_types[key] = s:TypeInfo.New(value)
+ else
+ call extend(s:known_types[key], value)
+ endif
+ endfor
+
+ if a:0 > 0
+ call s:known_types[type].createKinddict()
+ endif
+endfunction
+
+" s:TransformUserTypeDef() {{{2
+" Transform the user definitions into the internal format
+function! s:TransformUserTypeDef(def) abort
+ let newdef = copy(a:def)
+
+ if has_key(a:def, 'kinds')
+ let newdef.kinds = []
+ let kinds = a:def.kinds
+ for kind in kinds
+ let kindlist = split(kind, ':')
+ let kinddict = {'short' : kindlist[0], 'long' : kindlist[1]}
+ let kinddict.fold = get(kindlist, 2, 0)
+ let kinddict.stl = get(kindlist, 3, 1)
+ call add(newdef.kinds, kinddict)
+ endfor
+ endif
+
+ " If the user only specified one of kind2scope and scope2kind then use it
+ " to generate the respective other
+ if has_key(a:def, 'kind2scope') && !has_key(a:def, 'scope2kind')
+ let newdef.scope2kind = {}
+ for [key, value] in items(a:def.kind2scope)
+ let newdef.scope2kind[value] = key
+ endfor
+ elseif has_key(a:def, 'scope2kind') && !has_key(a:def, 'kind2scope')
+ let newdef.kind2scope = {}
+ for [key, value] in items(a:def.scope2kind)
+ let newdef.kind2scope[value] = key
+ endfor
+ endif
+
+ return newdef
+endfunction
+
+" s:RestoreSession() {{{2
+" Properly restore Tagbar after a session got loaded
+function! s:RestoreSession() abort
+ call s:debug('Restoring session')
+
+ let curfile = fnamemodify(bufname('%'), ':p')
+
+ let tagbarwinnr = bufwinnr('__Tagbar__')
+ if tagbarwinnr == -1
+ " Tagbar wasn't open in the saved session, nothing to do
+ return
+ else
+ let in_tagbar = 1
+ if winnr() != tagbarwinnr
+ call s:goto_win(tagbarwinnr)
+ let in_tagbar = 0
+ endif
+ endif
+
+ let s:last_autofocus = 0
+
+ call s:Init(0)
+
+ call s:InitWindow(g:tagbar_autoclose)
+
+ call s:AutoUpdate(curfile, 0)
+
+ if !in_tagbar
+ call s:goto_win('p')
+ endif
+endfunction
+
+" s:MapKeys() {{{2
+function! s:MapKeys() abort
+ call s:debug('Mapping keys')
+
+ nnoremap <script> <silent> <buffer> <2-LeftMouse>
+ \ :call <SID>JumpToTag(0)<CR>
+ nnoremap <script> <silent> <buffer> <LeftRelease>
+ \ <LeftRelease>:call <SID>CheckMouseClick()<CR>
+
+ inoremap <script> <silent> <buffer> <2-LeftMouse>
+ \ <C-o>:call <SID>JumpToTag(0)<CR>
+ inoremap <script> <silent> <buffer> <LeftRelease>
+ \ <LeftRelease><C-o>:call <SID>CheckMouseClick()<CR>
+
+ let maps = [
+ \ ['jump', 'JumpToTag(0)'],
+ \ ['preview', 'JumpToTag(1)'],
+ \ ['previewwin', 'ShowInPreviewWin()'],
+ \ ['nexttag', 'GotoNextToplevelTag(1)'],
+ \ ['prevtag', 'GotoNextToplevelTag(-1)'],
+ \ ['showproto', 'ShowPrototype(0)'],
+ \ ['hidenonpublic', 'ToggleHideNonPublicTags()'],
+ \
+ \ ['openfold', 'OpenFold()'],
+ \ ['closefold', 'CloseFold()'],
+ \ ['togglefold', 'ToggleFold()'],
+ \ ['openallfolds', 'SetFoldLevel(99, 1)'],
+ \ ['closeallfolds', 'SetFoldLevel(0, 1)'],
+ \ ['nextfold', 'GotoNextFold()'],
+ \ ['prevfold', 'GotoPrevFold()'],
+ \
+ \ ['togglesort', 'ToggleSort()'],
+ \ ['toggleautoclose', 'ToggleAutoclose()'],
+ \ ['zoomwin', 'ZoomWindow()'],
+ \ ['close', 'CloseWindow()'],
+ \ ['help', 'ToggleHelp()'],
+ \ ]
+
+ for [map, func] in maps
+ let def = get(g:, 'tagbar_map_' . map)
+ if type(def) == type("")
+ let keys = [def]
+ else
+ let keys = def
+ endif
+ for key in keys
+ execute 'nnoremap <script> <silent> <buffer> ' . key .
+ \ ' :call <SID>' . func . '<CR>'
+ endfor
+ unlet def
+ endfor
+
+ let b:tagbar_mapped_keys = 1
+endfunction
+
+" s:CreateAutocommands() {{{2
+function! s:CreateAutocommands() abort
+ call s:debug('Creating autocommands')
+
+ augroup TagbarAutoCmds
+ autocmd!
+ autocmd CursorHold __Tagbar__ call s:ShowPrototype(1)
+ autocmd WinEnter __Tagbar__ call s:SetStatusLine('current')
+ autocmd WinLeave __Tagbar__ call s:SetStatusLine('noncurrent')
+
+ if g:tagbar_autopreview
+ autocmd CursorMoved __Tagbar__ nested call s:ShowInPreviewWin()
+ endif
+
+ autocmd WinEnter * nested call s:QuitIfOnlyWindow()
+ autocmd WinEnter * if bufwinnr('__Tagbar__') == -1 |
+ \ call s:ShrinkIfExpanded() |
+ \ endif
+
+ autocmd BufWritePost * call
+ \ s:AutoUpdate(fnamemodify(expand('<afile>'), ':p'), 1)
+ " BufReadPost is needed for reloading the current buffer if the file
+ " was changed by an external command; see commit 17d199f
+ autocmd BufReadPost,BufEnter,CursorHold,FileType * call
+ \ s:AutoUpdate(fnamemodify(expand('<afile>'), ':p'), 0)
+ autocmd BufDelete,BufWipeout * call
+ \ s:known_files.rm(fnamemodify(expand('<afile>'), ':p'))
+
+ autocmd QuickFixCmdPre * let s:tagbar_qf_active = 1
+ autocmd QuickFixCmdPost * if exists('s:tagbar_qf_active') |
+ \ unlet s:tagbar_qf_active |
+ \ endif
+
+ autocmd VimEnter * call s:CorrectFocusOnStartup()
+ augroup END
+
+ let s:autocommands_done = 1
+endfunction
+
+" s:CheckForExCtags() {{{2
+" Test whether the ctags binary is actually Exuberant Ctags and not BSD ctags
+" (or something else)
+function! s:CheckForExCtags(silent) abort
+ call s:debug('Checking for Exuberant Ctags')
+
+ if !exists('g:tagbar_ctags_bin')
+ let ctagsbins = []
+ let ctagsbins += ['ctags-exuberant'] " Debian
+ let ctagsbins += ['exuberant-ctags']
+ let ctagsbins += ['exctags'] " FreeBSD, NetBSD
+ let ctagsbins += ['/usr/local/bin/ctags'] " Homebrew
+ let ctagsbins += ['/opt/local/bin/ctags'] " Macports
+ let ctagsbins += ['ectags'] " OpenBSD
+ let ctagsbins += ['ctags']
+ let ctagsbins += ['ctags.exe']
+ let ctagsbins += ['tags']
+ for ctags in ctagsbins
+ if executable(ctags)
+ let g:tagbar_ctags_bin = ctags
+ break
+ endif
+ endfor
+ if !exists('g:tagbar_ctags_bin')
+ let errmsg = 'Tagbar: Exuberant ctags not found!'
+ let infomsg = 'Please download Exuberant Ctags from' .
+ \ ' ctags.sourceforge.net and install it in a' .
+ \ ' directory in your $PATH or set g:tagbar_ctags_bin.'
+ call s:CtagsErrMsg(errmsg, infomsg, a:silent)
+ let s:checked_ctags = 2
+ return 0
+ endif
+ else
+ " reset 'wildignore' temporarily in case *.exe is included in it
+ let wildignore_save = &wildignore
+ set wildignore&
+
+ let g:tagbar_ctags_bin = expand(g:tagbar_ctags_bin)
+
+ let &wildignore = wildignore_save
+
+ if !executable(g:tagbar_ctags_bin)
+ let errmsg = "Tagbar: Exuberant ctags not found at " .
+ \ "'" . g:tagbar_ctags_bin . "'!"
+ let infomsg = 'Please check your g:tagbar_ctags_bin setting.'
+ call s:CtagsErrMsg(errmsg, infomsg, a:silent)
+ let s:checked_ctags = 2
+ return 0
+ endif
+ endif
+
+ let ctags_cmd = s:EscapeCtagsCmd(g:tagbar_ctags_bin, '--version')
+ if ctags_cmd == ''
+ let s:checked_ctags = 2
+ return 0
+ endif
+
+ let ctags_output = s:ExecuteCtags(ctags_cmd)
+
+ if v:shell_error || ctags_output !~# '\(Exuberant\|Universal\) Ctags'
+ let errmsg = 'Tagbar: Ctags doesn''t seem to be Exuberant Ctags!'
+ let infomsg = 'BSD ctags will NOT WORK.' .
+ \ ' Please download Exuberant Ctags from ctags.sourceforge.net' .
+ \ ' and install it in a directory in your $PATH' .
+ \ ' or set g:tagbar_ctags_bin.'
+ call s:CtagsErrMsg(errmsg, infomsg, a:silent, ctags_cmd, ctags_output)
+ let s:checked_ctags = 2
+ return 0
+ elseif !s:CheckExCtagsVersion(ctags_output)
+ let errmsg = 'Tagbar: Exuberant Ctags is too old!'
+ let infomsg = 'You need at least version 5.5 for Tagbar to work.' .
+ \ ' Please download a newer version from ctags.sourceforge.net.'
+ call s:CtagsErrMsg(errmsg, infomsg, a:silent, ctags_cmd, ctags_output)
+ let s:checked_ctags = 2
+ return 0
+ else
+ let s:checked_ctags = 1
+ return 1
+ endif
+endfunction
+
+" s:CtagsErrMsg() {{{2
+function! s:CtagsErrMsg(errmsg, infomsg, silent, ...) abort
+ call s:debug(a:errmsg)
+ let ctags_cmd = a:0 > 0 ? a:1 : ''
+ let ctags_output = a:0 > 0 ? a:2 : ''
+
+ if ctags_output != ''
+ call s:debug("Command output:\n" . ctags_output)
+ endif
+
+ if !a:silent
+ call s:warning(a:errmsg)
+ echomsg a:infomsg
+
+ if ctags_cmd == ''
+ return
+ endif
+
+ echomsg 'Executed command: "' . ctags_cmd . '"'
+ if ctags_output != ''
+ echomsg 'Command output:'
+ for line in split(ctags_output, '\n')
+ echomsg line
+ endfor
+ else
+ echomsg 'Command output is empty.'
+ endif
+ endif
+endfunction
+
+
+" s:CheckExCtagsVersion() {{{2
+function! s:CheckExCtagsVersion(output) abort
+ call s:debug('Checking Exuberant Ctags version')
+
+ if a:output =~ 'Exuberant Ctags Development'
+ call s:debug("Found development version, assuming compatibility")
+ return 1
+ endif
+
+ if a:output =~ 'Universal Ctags'
+ call s:debug("Found Universal Ctags, assuming compatibility")
+ return 1
+ endif
+
+ let matchlist = matchlist(a:output, '\vExuberant Ctags (\d+)\.(\d+)')
+ let major = matchlist[1]
+ let minor = matchlist[2]
+
+ call s:debug("Ctags version: major='" . major . "', minor='" . minor . "'")
+
+ return major >= 6 || (major == 5 && minor >= 5)
+endfunction
+
+" s:CheckFTCtags() {{{2
+function! s:CheckFTCtags(bin, ftype) abort
+ if executable(a:bin)
+ return a:bin
+ endif
+
+ if exists('g:tagbar_type_' . a:ftype)
+ let userdef = g:tagbar_type_{a:ftype}
+ if has_key(userdef, 'ctagsbin')
+ return userdef.ctagsbin
+ else
+ return ''
+ endif
+ endif
+
+ return ''
+endfunction
+
+" s:GetSupportedFiletypes() {{{2
+function! s:GetSupportedFiletypes() abort
+ call s:debug('Getting filetypes sypported by Exuberant Ctags')
+
+ let ctags_cmd = s:EscapeCtagsCmd(g:tagbar_ctags_bin, '--list-languages')
+ if ctags_cmd == ''
+ return
+ endif
+
+ let ctags_output = s:ExecuteCtags(ctags_cmd)
+
+ if v:shell_error
+ " this shouldn't happen as potential problems would have already been
+ " caught by the previous ctags checking
+ return
+ endif
+
+ let types = split(ctags_output, '\n\+')
+
+ for type in types
+ let s:ctags_types[tolower(type)] = 1
+ endfor
+
+ let s:checked_ctags_types = 1
+endfunction
+
+" Prototypes {{{1
+" Base tag {{{2
+let s:BaseTag = {}
+
+" s:BaseTag.New() {{{3
+function! s:BaseTag.New(name) abort dict
+ let newobj = copy(self)
+
+ call newobj._init(a:name)
+
+ return newobj
+endfunction
+
+" s:BaseTag._init() {{{3
+function! s:BaseTag._init(name) abort dict
+ let self.name = a:name
+ let self.fields = {}
+ let self.fields.line = 0
+ let self.fields.column = 1
+ let self.prototype = ''
+ let self.path = ''
+ let self.fullpath = a:name
+ let self.depth = 0
+ let self.parent = {}
+ let self.tline = -1
+ let self.fileinfo = {}
+ let self.typeinfo = {}
+endfunction
+
+" s:BaseTag.isNormalTag() {{{3
+function! s:BaseTag.isNormalTag() abort dict
+ return 0
+endfunction
+
+" s:BaseTag.isPseudoTag() {{{3
+function! s:BaseTag.isPseudoTag() abort dict
+ return 0
+endfunction
+
+" s:BaseTag.isKindheader() {{{3
+function! s:BaseTag.isKindheader() abort dict
+ return 0
+endfunction
+
+" s:BaseTag.getPrototype() {{{3
+function! s:BaseTag.getPrototype(short) abort dict
+ return self.prototype
+endfunction
+
+" s:BaseTag._getPrefix() {{{3
+function! s:BaseTag._getPrefix() abort dict
+ let fileinfo = self.fileinfo
+
+ if has_key(self, 'children') && !empty(self.children)
+ if fileinfo.tagfolds[self.fields.kind][self.fullpath]
+ let prefix = s:icon_closed
+ else
+ let prefix = s:icon_open
+ endif
+ else
+ let prefix = ' '
+ endif
+ " Visibility is called 'access' in the ctags output
+ if g:tagbar_show_visibility
+ if has_key(self.fields, 'access')
+ let prefix .= get(s:visibility_symbols, self.fields.access, ' ')
+ elseif has_key(self.fields, 'file')
+ let prefix .= s:visibility_symbols.private
+ else
+ let prefix .= ' '
+ endif
+ endif
+
+ return prefix
+endfunction
+
+" s:BaseTag.initFoldState() {{{3
+function! s:BaseTag.initFoldState() abort dict
+ let fileinfo = self.fileinfo
+
+ if s:known_files.has(fileinfo.fpath) &&
+ \ has_key(fileinfo, '_tagfolds_old') &&
+ \ has_key(fileinfo._tagfolds_old[self.fields.kind], self.fullpath)
+ " The file has been updated and the tag was there before, so copy its
+ " old fold state
+ let fileinfo.tagfolds[self.fields.kind][self.fullpath] =
+ \ fileinfo._tagfolds_old[self.fields.kind][self.fullpath]
+ elseif self.depth >= fileinfo.foldlevel
+ let fileinfo.tagfolds[self.fields.kind][self.fullpath] = 1
+ else
+ let fileinfo.tagfolds[self.fields.kind][self.fullpath] =
+ \ fileinfo.kindfolds[self.fields.kind]
+ endif
+endfunction
+
+" s:BaseTag.getClosedParentTline() {{{3
+function! s:BaseTag.getClosedParentTline() abort dict
+ let tagline = self.tline
+
+ " Find the first closed parent, starting from the top of the hierarchy.
+ let parents = []
+ let curparent = self.parent
+ while !empty(curparent)
+ call add(parents, curparent)
+ let curparent = curparent.parent
+ endwhile
+ for parent in reverse(parents)
+ if parent.isFolded()
+ let tagline = parent.tline
+ break
+ endif
+ endfor
+
+ return tagline
+endfunction
+
+" s:BaseTag.isFoldable() {{{3
+function! s:BaseTag.isFoldable() abort dict
+ return has_key(self, 'children') && !empty(self.children)
+endfunction
+
+" s:BaseTag.isFolded() {{{3
+function! s:BaseTag.isFolded() abort dict
+ return self.fileinfo.tagfolds[self.fields.kind][self.fullpath]
+endfunction
+
+" s:BaseTag.openFold() {{{3
+function! s:BaseTag.openFold() abort dict
+ if self.isFoldable()
+ let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = 0
+ endif
+endfunction
+
+" s:BaseTag.closeFold() {{{3
+function! s:BaseTag.closeFold() abort dict
+ let newline = line('.')
+
+ if !empty(self.parent) && self.parent.isKindheader()
+ " Tag is child of generic 'kind'
+ call self.parent.closeFold()
+ let newline = self.parent.tline
+ elseif self.isFoldable() && !self.isFolded()
+ " Tag is parent of a scope and is not folded
+ let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = 1
+ let newline = self.tline
+ elseif !empty(self.parent)
+ " Tag is normal child, so close parent
+ let parent = self.parent
+ let self.fileinfo.tagfolds[parent.fields.kind][parent.fullpath] = 1
+ let newline = parent.tline
+ endif
+
+ return newline
+endfunction
+
+" s:BaseTag.setFolded() {{{3
+function! s:BaseTag.setFolded(folded) abort dict
+ let self.fileinfo.tagfolds[self.fields.kind][self.fullpath] = a:folded
+endfunction
+
+" s:BaseTag.openParents() {{{3
+function! s:BaseTag.openParents() abort dict
+ let parent = self.parent
+
+ while !empty(parent)
+ call parent.openFold()
+ let parent = parent.parent
+ endwhile
+endfunction
+
+" Normal tag {{{2
+let s:NormalTag = copy(s:BaseTag)
+
+" s:NormalTag.isNormalTag() {{{3
+function! s:NormalTag.isNormalTag() abort dict
+ return 1
+endfunction
+
+" s:NormalTag.strfmt() {{{3
+function! s:NormalTag.strfmt() abort dict
+ let typeinfo = self.typeinfo
+
+ let suffix = get(self.fields, 'signature', '')
+ if has_key(self.fields, 'type')
+ let suffix .= ' : ' . self.fields.type
+ elseif has_key(typeinfo, 'kind2scope') &&
+ \ has_key(typeinfo.kind2scope, self.fields.kind)
+ let suffix .= ' : ' . typeinfo.kind2scope[self.fields.kind]
+ endif
+
+ return self._getPrefix() . self.name . suffix . "\n"
+endfunction
+
+" s:NormalTag.str() {{{3
+function! s:NormalTag.str(longsig, full) abort dict
+ if a:full && self.path != ''
+ let str = self.path . self.typeinfo.sro . self.name
+ else
+ let str = self.name
+ endif
+
+ if has_key(self.fields, 'signature')
+ if a:longsig
+ let str .= self.fields.signature
+ else
+ let str .= '()'
+ endif
+ endif
+
+ return str
+endfunction
+
+" s:NormalTag.getPrototype() {{{3
+function! s:NormalTag.getPrototype(short) abort dict
+ if self.prototype != ''
+ let prototype = self.prototype
+ else
+ let bufnr = self.fileinfo.bufnr
+
+ if self.fields.line == 0 || !bufloaded(bufnr)
+ " No linenumber available or buffer not loaded (probably due to
+ " 'nohidden'), try the pattern instead
+ return substitute(self.pattern, '^\\V\\^\\C\s*\(.*\)\\$$', '\1', '')
+ endif
+
+ let line = getbufline(bufnr, self.fields.line)[0]
+ let list = split(line, '\zs')
+
+ let start = index(list, '(')
+ if start == -1
+ return substitute(line, '^\s\+', '', '')
+ endif
+
+ let opening = count(list, '(', 0, start)
+ let closing = count(list, ')', 0, start)
+ if closing >= opening
+ return substitute(line, '^\s\+', '', '')
+ endif
+
+ let balance = opening - closing
+
+ let prototype = line
+ let curlinenr = self.fields.line + 1
+ while balance > 0
+ let curline = getbufline(bufnr, curlinenr)[0]
+ let curlist = split(curline, '\zs')
+ let balance += count(curlist, '(')
+ let balance -= count(curlist, ')')
+ let prototype .= "\n" . curline
+ let curlinenr += 1
+ endwhile
+
+ let self.prototype = prototype
+ endif
+
+ if a:short
+ " join all lines and remove superfluous spaces
+ let prototype = substitute(prototype, '^\s\+', '', '')
+ let prototype = substitute(prototype, '\_s\+', ' ', 'g')
+ let prototype = substitute(prototype, '(\s\+', '(', 'g')
+ let prototype = substitute(prototype, '\s\+)', ')', 'g')
+ " Avoid hit-enter prompts
+ let maxlen = &columns - 12
+ if len(prototype) > maxlen
+ let prototype = prototype[:maxlen - 1 - 3]
+ let prototype .= '...'
+ endif
+ endif
+
+ return prototype
+endfunction
+
+" Pseudo tag {{{2
+let s:PseudoTag = copy(s:BaseTag)
+
+" s:PseudoTag.isPseudoTag() {{{3
+function! s:PseudoTag.isPseudoTag() abort dict
+ return 1
+endfunction
+
+" s:PseudoTag.strfmt() {{{3
+function! s:PseudoTag.strfmt() abort dict
+ let typeinfo = self.typeinfo
+
+ let suffix = get(self.fields, 'signature', '')
+ if has_key(typeinfo.kind2scope, self.fields.kind)
+ let suffix .= ' : ' . typeinfo.kind2scope[self.fields.kind]
+ endif
+
+ return self._getPrefix() . self.name . '*' . suffix
+endfunction
+
+" Kind header {{{2
+let s:KindheaderTag = copy(s:BaseTag)
+
+" s:KindheaderTag.isKindheader() {{{3
+function! s:KindheaderTag.isKindheader() abort dict
+ return 1
+endfunction
+
+" s:KindheaderTag.getPrototype() {{{3
+function! s:KindheaderTag.getPrototype(short) abort dict
+ return self.name . ': ' .
+ \ self.numtags . ' ' . (self.numtags > 1 ? 'tags' : 'tag')
+endfunction
+
+" s:KindheaderTag.isFoldable() {{{3
+function! s:KindheaderTag.isFoldable() abort dict
+ return 1
+endfunction
+
+" s:KindheaderTag.isFolded() {{{3
+function! s:KindheaderTag.isFolded() abort dict
+ return self.fileinfo.kindfolds[self.short]
+endfunction
+
+" s:KindheaderTag.openFold() {{{3
+function! s:KindheaderTag.openFold() abort dict
+ let self.fileinfo.kindfolds[self.short] = 0
+endfunction
+
+" s:KindheaderTag.closeFold() {{{3
+function! s:KindheaderTag.closeFold() abort dict
+ let self.fileinfo.kindfolds[self.short] = 1
+ return line('.')
+endfunction
+
+" s:KindheaderTag.toggleFold() {{{3
+function! s:KindheaderTag.toggleFold() abort dict
+ let fileinfo = s:known_files.getCurrent(0)
+
+ let fileinfo.kindfolds[self.short] = !fileinfo.kindfolds[self.short]
+endfunction
+
+" Type info {{{2
+let s:TypeInfo = {}
+
+" s:TypeInfo.New() {{{3
+function! s:TypeInfo.New(...) abort dict
+ let newobj = copy(self)
+
+ let newobj.kinddict = {}
+
+ if a:0 > 0
+ call extend(newobj, a:1)
+ endif
+
+ return newobj
+endfunction
+
+" s:TypeInfo.getKind() {{{3
+function! s:TypeInfo.getKind(kind) abort dict
+ let idx = self.kinddict[a:kind]
+ return self.kinds[idx]
+endfunction
+
+" s:TypeInfo.createKinddict() {{{3
+" Create a dictionary of the kind order for fast access in sorting functions
+function! s:TypeInfo.createKinddict() abort dict
+ let i = 0
+ for kind in self.kinds
+ let self.kinddict[kind.short] = i
+ let i += 1
+ endfor
+endfunction
+
+" File info {{{2
+let s:FileInfo = {}
+
+" s:FileInfo.New() {{{3
+function! s:FileInfo.New(fname, ftype, typeinfo) abort dict
+ let newobj = copy(self)
+
+ " The complete file path
+ let newobj.fpath = a:fname
+
+ let newobj.bufnr = bufnr(a:fname)
+
+ " File modification time
+ let newobj.mtime = getftime(a:fname)
+
+ " The vim file type
+ let newobj.ftype = a:ftype
+
+ " List of the tags that are present in the file, sorted according to the
+ " value of 'g:tagbar_sort'
+ let newobj.tags = []
+
+ " Dictionary of the tags, indexed by line number in the file
+ let newobj.fline = {}
+
+ " Dictionary of the tags, indexed by line number in the tagbar
+ let newobj.tline = {}
+
+ " Dictionary of the folding state of 'kind's, indexed by short name
+ let newobj.kindfolds = {}
+ let newobj.typeinfo = a:typeinfo
+ " copy the default fold state from the type info
+ for kind in a:typeinfo.kinds
+ let newobj.kindfolds[kind.short] =
+ \ g:tagbar_foldlevel == 0 ? 1 : kind.fold
+ endfor
+
+ " Dictionary of dictionaries of the folding state of individual tags,
+ " indexed by kind and full path
+ let newobj.tagfolds = {}
+ for kind in a:typeinfo.kinds
+ let newobj.tagfolds[kind.short] = {}
+ endfor
+
+ " The current foldlevel of the file
+ let newobj.foldlevel = g:tagbar_foldlevel
+
+ return newobj
+endfunction
+
+" s:FileInfo.reset() {{{3
+" Reset stuff that gets regenerated while processing a file and save the old
+" tag folds
+function! s:FileInfo.reset() abort dict
+ let self.mtime = getftime(self.fpath)
+ let self.tags = []
+ let self.fline = {}
+ let self.tline = {}
+
+ let self._tagfolds_old = self.tagfolds
+ let self.tagfolds = {}
+
+ for kind in self.typeinfo.kinds
+ let self.tagfolds[kind.short] = {}
+ endfor
+endfunction
+
+" s:FileInfo.clearOldFolds() {{{3
+function! s:FileInfo.clearOldFolds() abort dict
+ if exists('self._tagfolds_old')
+ unlet self._tagfolds_old
+ endif
+endfunction
+
+" s:FileInfo.sortTags() {{{3
+function! s:FileInfo.sortTags() abort dict
+ if get(s:compare_typeinfo, 'sort', g:tagbar_sort)
+ call s:SortTags(self.tags, 's:CompareByKind')
+ else
+ call s:SortTags(self.tags, 's:CompareByLine')
+ endif
+endfunction
+
+" s:FileInfo.openKindFold() {{{3
+function! s:FileInfo.openKindFold(kind) abort dict
+ let self.kindfolds[a:kind.short] = 0
+endfunction
+
+" s:FileInfo.closeKindFold() {{{3
+function! s:FileInfo.closeKindFold(kind) abort dict
+ let self.kindfolds[a:kind.short] = 1
+endfunction
+
+" Known files {{{2
+let s:known_files = {
+ \ '_current' : {},
+ \ '_paused' : {},
+ \ '_files' : {}
+\ }
+
+" s:known_files.getCurrent() {{{3
+function! s:known_files.getCurrent(forcecurrent) abort dict
+ if !s:paused || a:forcecurrent
+ return self._current
+ else
+ return self._paused
+ endif
+endfunction
+
+" s:known_files.setCurrent() {{{3
+function! s:known_files.setCurrent(fileinfo) abort dict
+ let self._current = a:fileinfo
+endfunction
+
+" s:known_files.setPaused() {{{3
+function! s:known_files.setPaused() abort dict
+ let self._paused = self._current
+endfunction
+
+" s:known_files.get() {{{3
+function! s:known_files.get(fname) abort dict
+ return get(self._files, a:fname, {})
+endfunction
+
+" s:known_files.put() {{{3
+" Optional second argument is the filename
+function! s:known_files.put(fileinfo, ...) abort dict
+ if a:0 == 1
+ let self._files[a:1] = a:fileinfo
+ else
+ let fname = a:fileinfo.fpath
+ let self._files[fname] = a:fileinfo
+ endif
+endfunction
+
+" s:known_files.has() {{{3
+function! s:known_files.has(fname) abort dict
+ return has_key(self._files, a:fname)
+endfunction
+
+" s:known_files.rm() {{{3
+function! s:known_files.rm(fname) abort dict
+ if s:known_files.has(a:fname)
+ call s:debug('Removing fileinfo for [' . a:fname . ']')
+ call remove(self._files, a:fname)
+ endif
+endfunction
+
+" Window management {{{1
+" s:ToggleWindow() {{{2
+function! s:ToggleWindow() abort
+ call s:debug('ToggleWindow called')
+
+ let tagbarwinnr = bufwinnr("__Tagbar__")
+ if tagbarwinnr != -1
+ call s:CloseWindow()
+ return
+ endif
+
+ call s:OpenWindow('')
+
+ call s:debug('ToggleWindow finished')
+endfunction
+
+" s:OpenWindow() {{{2
+function! s:OpenWindow(flags) abort
+ call s:debug("OpenWindow called with flags: '" . a:flags . "'")
+
+ let autofocus = a:flags =~# 'f'
+ let jump = a:flags =~# 'j'
+ let autoclose = a:flags =~# 'c'
+
+ let curfile = fnamemodify(bufname('%'), ':p')
+ let curline = line('.')
+
+ " If the tagbar window is already open check jump flag
+ " Also set the autoclose flag if requested
+ let tagbarwinnr = bufwinnr('__Tagbar__')
+ if tagbarwinnr != -1
+ if winnr() != tagbarwinnr && jump
+ call s:goto_win(tagbarwinnr)
+ call s:HighlightTag(g:tagbar_autoshowtag != 2, 1, curline)
+ endif
+ call s:debug("OpenWindow finished, Tagbar already open")
+ return
+ endif
+
+ " This is only needed for the CorrectFocusOnStartup() function
+ let s:last_autofocus = autofocus
+
+ if !s:Init(0)
+ return 0
+ endif
+
+ " Expand the Vim window to accomodate for the Tagbar window if requested
+ " and save the window positions to be able to restore them later.
+ if g:tagbar_expand >= 1 && !s:window_expanded &&
+ \ (has('gui_running') || g:tagbar_expand == 2)
+ let s:window_pos.pre.x = getwinposx()
+ let s:window_pos.pre.y = getwinposy()
+ let &columns += g:tagbar_width + 1
+ let s:window_pos.post.x = getwinposx()
+ let s:window_pos.post.y = getwinposy()
+ let s:window_expanded = 1
+ endif
+
+ let s:window_opening = 1
+ if g:tagbar_vertical == 0
+ let openpos = g:tagbar_left ? 'topleft vertical ' : 'botright vertical '
+ let width = g:tagbar_width
+ else
+ let openpos = g:tagbar_left ? 'leftabove ' : 'rightbelow '
+ let width = g:tagbar_vertical
+ endif
+ exe 'silent keepalt ' . openpos . width . 'split ' . '__Tagbar__'
+ unlet s:window_opening
+
+ call s:InitWindow(autoclose)
+
+ " If the current file exists, but is empty, it means that it had a
+ " processing error before opening the window, most likely due to a call to
+ " currenttag() in the statusline. Remove the entry so an error message
+ " will be shown if the processing still fails.
+ if empty(s:known_files.get(curfile))
+ call s:known_files.rm(curfile)
+ endif
+
+ call s:AutoUpdate(curfile, 0)
+ call s:HighlightTag(g:tagbar_autoshowtag != 2, 1, curline)
+
+ if !(g:tagbar_autoclose || autofocus || g:tagbar_autofocus)
+ call s:goto_win('p')
+ endif
+
+ call s:debug('OpenWindow finished')
+endfunction
+
+" s:InitWindow() {{{2
+function! s:InitWindow(autoclose) abort
+ call s:debug('InitWindow called with autoclose: ' . a:autoclose)
+
+ setlocal filetype=tagbar
+
+ setlocal noreadonly " in case the "view" mode is used
+ setlocal buftype=nofile
+ setlocal bufhidden=hide
+ setlocal noswapfile
+ setlocal nobuflisted
+ setlocal nomodifiable
+ setlocal nolist
+ setlocal nowrap
+ setlocal winfixwidth
+ setlocal textwidth=0
+ setlocal nospell
+
+ if g:tagbar_show_linenumbers == 0
+ setlocal nonumber
+ if exists('+relativenumber')
+ setlocal norelativenumber
+ endif
+ elseif g:tagbar_show_linenumbers == 1
+ setlocal number
+ elseif g:tagbar_show_linenumbers == 2
+ setlocal relativenumber
+ else
+ set number<
+ if exists('+relativenumber')
+ set relativenumber<
+ endif
+ endif
+
+ setlocal nofoldenable
+ setlocal foldcolumn=0
+ " Reset fold settings in case a plugin set them globally to something
+ " expensive. Apparently 'foldexpr' gets executed even if 'foldenable' is
+ " off, and then for every appended line (like with :put).
+ setlocal foldmethod&
+ setlocal foldexpr&
+
+ let w:autoclose = a:autoclose
+
+ call s:SetStatusLine('current')
+
+ let s:new_window = 1
+
+ if has('balloon_eval')
+ setlocal balloonexpr=TagbarBalloonExpr()
+ set ballooneval
+ endif
+
+ let cpoptions_save = &cpoptions
+ set cpoptions&vim
+
+ if !exists('b:tagbar_mapped_keys')
+ call s:MapKeys()
+ endif
+
+ let &cpoptions = cpoptions_save
+
+ if g:tagbar_expand
+ let s:expand_bufnr = bufnr('%')
+ endif
+
+ call s:debug('InitWindow finished')
+endfunction
+
+" s:CloseWindow() {{{2
+function! s:CloseWindow() abort
+ call s:debug('CloseWindow called')
+
+ let tagbarwinnr = bufwinnr('__Tagbar__')
+ if tagbarwinnr == -1
+ return
+ endif
+
+ " Close the preview window if it was opened by us
+ if s:pwin_by_tagbar
+ pclose
+ let tagbarwinnr = bufwinnr('__Tagbar__')
+ endif
+
+ if winnr() == tagbarwinnr
+ if winbufnr(2) != -1
+ " Other windows are open, only close the tagbar one
+
+ let curfile = s:known_files.getCurrent(0)
+
+ close
+
+ " Try to jump to the correct window after closing
+ call s:goto_win('p')
+
+ if !empty(curfile)
+ let filebufnr = bufnr(curfile.fpath)
+
+ if bufnr('%') != filebufnr
+ let filewinnr = bufwinnr(filebufnr)
+ if filewinnr != -1
+ call s:goto_win(filewinnr)
+ endif
+ endif
+ endif
+ endif
+ else
+ " Go to the tagbar window, close it and then come back to the original
+ " window. Save a win-local variable in the original window so we can
+ " jump back to it even if the window number changed.
+ call s:mark_window()
+ call s:goto_win(tagbarwinnr)
+ close
+
+ call s:goto_markedwin()
+ endif
+
+ call s:ShrinkIfExpanded()
+
+ " The window sizes may have changed due to the shrinking happening after
+ " the window closing, so equalize them again.
+ if &equalalways
+ wincmd =
+ endif
+
+ if s:autocommands_done && !s:statusline_in_use
+ autocmd! TagbarAutoCmds
+ let s:autocommands_done = 0
+ endif
+
+ call s:debug('CloseWindow finished')
+endfunction
+
+" s:ShrinkIfExpanded() {{{2
+" If the Vim window has been expanded, and Tagbar is not open in any other
+" tabpages, shrink the window again
+function! s:ShrinkIfExpanded() abort
+ if !s:window_expanded || &filetype == 'tagbar' || s:expand_bufnr == -1
+ return
+ endif
+
+ let tablist = []
+ for i in range(tabpagenr('$'))
+ call extend(tablist, tabpagebuflist(i + 1))
+ endfor
+
+ if index(tablist, s:expand_bufnr) == -1
+ let &columns -= g:tagbar_width + 1
+ let s:window_expanded = 0
+ let s:expand_bufnr = -1
+ " Only restore window position if it is available and if the
+ " window hasn't been moved manually after the expanding
+ if getwinposx() != -1 &&
+ \ getwinposx() == s:window_pos.post.x &&
+ \ getwinposy() == s:window_pos.post.y
+ execute 'winpos ' . s:window_pos.pre.x .
+ \ ' ' . s:window_pos.pre.y
+ endif
+ endif
+endfunction
+
+" s:ZoomWindow() {{{2
+function! s:ZoomWindow() abort
+ if s:is_maximized
+ execute 'vertical resize ' . g:tagbar_width
+ execute s:winrestcmd
+ let s:is_maximized = 0
+ else
+ let s:winrestcmd = winrestcmd()
+ if g:tagbar_zoomwidth == 1
+ vertical resize
+ elseif g:tagbar_zoomwidth == 0
+ let func = exists('*strdisplaywidth') ? 'strdisplaywidth' : 'strlen'
+ let maxline = max(map(getline(line('w0'), line('w$')),
+ \ func . '(v:val)'))
+ execute 'vertical resize ' . maxline
+ elseif g:tagbar_zoomwidth > 1
+ execute 'vertical resize ' . g:tagbar_zoomwidth
+ endif
+ let s:is_maximized = 1
+ endif
+endfunction
+
+" s:CorrectFocusOnStartup() {{{2
+" For whatever reason the focus will be on the Tagbar window if
+" tagbar#autoopen is used with a FileType autocommand on startup and
+" g:tagbar_left is set. This should work around it by jumping to the window of
+" the current file after startup.
+function! s:CorrectFocusOnStartup() abort
+ if bufwinnr('__Tagbar__') != -1 && !g:tagbar_autofocus && !s:last_autofocus
+ let curfile = s:known_files.getCurrent(1)
+ if !empty(curfile) && curfile.fpath != fnamemodify(bufname('%'), ':p')
+ let winnr = bufwinnr(curfile.fpath)
+ if winnr != -1
+ call s:goto_win(winnr)
+ endif
+ endif
+ endif
+endfunction
+
+" Tag processing {{{1
+" s:ProcessFile() {{{2
+" Execute ctags and put the information into a 'FileInfo' object
+function! s:ProcessFile(fname, ftype) abort
+ call s:debug('ProcessFile called [' . a:fname . ']')
+
+ if !s:IsValidFile(a:fname, a:ftype)
+ call s:debug('Not a valid file, returning')
+ return
+ endif
+
+ let typeinfo = s:known_types[a:ftype]
+
+ " If the file has only been updated preserve the fold states, otherwise
+ " create a new entry
+ if s:known_files.has(a:fname) && !empty(s:known_files.get(a:fname)) &&
+ \ s:known_files.get(a:fname).ftype == a:ftype
+ let fileinfo = s:known_files.get(a:fname)
+ let typeinfo = fileinfo.typeinfo
+ call fileinfo.reset()
+ else
+ if exists('#TagbarProjects#User')
+ execute 'doautocmd <nomodeline> TagbarProjects User ' . a:fname
+ if exists('b:tagbar_type')
+ let typeinfo = extend(copy(typeinfo),
+ \ s:TransformUserTypeDef(b:tagbar_type))
+ call typeinfo.createKinddict()
+ endif
+ endif
+ let fileinfo = s:FileInfo.New(a:fname, a:ftype, typeinfo)
+ endif
+
+ call s:debug('typeinfo for file to process: ' . string(typeinfo))
+
+ " Use a temporary files for ctags processing instead of the original one.
+ " This allows using Tagbar for files accessed with netrw, and also doesn't
+ " slow down Tagbar for files that sit on slow network drives.
+ let tempfile = tempname()
+ let ext = fnamemodify(fileinfo.fpath, ':e')
+ if ext != ''
+ let tempfile .= '.' . ext
+ endif
+
+ call writefile(getbufline(fileinfo.bufnr, 1, '$'), tempfile)
+ let fileinfo.mtime = getftime(tempfile)
+
+ let ctags_output = s:ExecuteCtagsOnFile(tempfile, a:fname, typeinfo)
+
+ call delete(tempfile)
+
+ if ctags_output == -1
+ call s:debug('Ctags error when processing file')
+ " Put an empty entry into known_files so the error message is only
+ " shown once
+ call s:known_files.put({}, a:fname)
+ return
+ elseif ctags_output == ''
+ call s:debug('Ctags output empty')
+ " No need to go through the tag processing if there are no tags, and
+ " preserving the old fold state isn't necessary either
+ call s:known_files.put(s:FileInfo.New(a:fname, a:ftype,
+ \ s:known_types[a:ftype]), a:fname)
+ return
+ endif
+
+ call s:debug('Filetype tag kinds: ' . string(keys(typeinfo.kinddict)))
+
+ " Parse the ctags output lines
+ call s:debug('Parsing ctags output')
+ let rawtaglist = split(ctags_output, '\n\+')
+ for line in rawtaglist
+ " skip comments
+ if line =~# '^!_TAG_'
+ continue
+ endif
+
+ let parts = split(line, ';"')
+ if len(parts) == 2 " Is a valid tag line
+ let taginfo = s:ParseTagline(parts[0], parts[1], typeinfo, fileinfo)
+ if !empty(taginfo)
+ let fileinfo.fline[taginfo.fields.line] = taginfo
+ call add(fileinfo.tags, taginfo)
+ endif
+ endif
+ endfor
+
+ " Process scoped tags
+ let processedtags = []
+ if has_key(typeinfo, 'kind2scope')
+ call s:debug('Processing scoped tags')
+
+ let scopedtags = []
+ let is_scoped = 'has_key(typeinfo.kind2scope, v:val.fields.kind) ||
+ \ has_key(v:val, "scope")'
+ let scopedtags += filter(copy(fileinfo.tags), is_scoped)
+ call filter(fileinfo.tags, '!(' . is_scoped . ')')
+
+ call s:AddScopedTags(scopedtags, processedtags, {}, 0,
+ \ typeinfo, fileinfo, line('$'))
+
+ if !empty(scopedtags)
+ echoerr 'Tagbar: ''scopedtags'' not empty after processing,'
+ \ 'this should never happen!'
+ \ 'Please contact the script maintainer with an example.'
+ endif
+ endif
+ call s:debug('Number of top-level tags: ' . len(processedtags))
+
+ " Create a placeholder tag for the 'kind' header for folding purposes
+ for kind in typeinfo.kinds
+
+ let curtags = filter(copy(fileinfo.tags),
+ \ 'v:val.fields.kind ==# kind.short')
+ call s:debug('Processing kind: ' . kind.short .
+ \ ', number of tags: ' . len(curtags))
+
+ if empty(curtags)
+ continue
+ endif
+
+ let kindtag = s:KindheaderTag.New(kind.long)
+ let kindtag.short = kind.short
+ let kindtag.numtags = len(curtags)
+ let kindtag.fileinfo = fileinfo
+
+ for tag in curtags
+ let tag.parent = kindtag
+ endfor
+ endfor
+
+ if !empty(processedtags)
+ call extend(fileinfo.tags, processedtags)
+ endif
+
+ " Clear old folding information from previous file version to prevent leaks
+ call fileinfo.clearOldFolds()
+
+ " Sort the tags
+ let s:compare_typeinfo = typeinfo
+ call fileinfo.sortTags()
+
+ call s:known_files.put(fileinfo)
+endfunction
+
+" s:ExecuteCtagsOnFile() {{{2
+function! s:ExecuteCtagsOnFile(fname, realfname, typeinfo) abort
+ call s:debug('ExecuteCtagsOnFile called [' . a:fname . ']')
+
+ if has_key(a:typeinfo, 'ctagsargs') && type(a:typeinfo.ctagsargs) == type('')
+ " if ctagsargs is a string, prepend and append space separators
+ let ctags_args = ' ' . a:typeinfo.ctagsargs . ' '
+ elseif has_key(a:typeinfo, 'ctagsargs') && type(a:typeinfo.ctagsargs) == type([])
+ let ctags_args = a:typeinfo.ctagsargs
+ " otherwise ctagsargs is not defined or not defined as a valid type
+ else
+ "Prefer constructing ctags_args as a list rather than a string
+ "See s:EscapeCtagsCmd() - It's a best practice to shellescape()
+ "each arg separately because in special cases where space is
+ "intended to be in an argument, spaces in a single ctag_args
+ "string would be ambiguous. Is the space an argument separator
+ "or to be included in the argument
+ let ctags_args = [ '-f',
+ \ '-',
+ \ '--format=2',
+ \ '--excmd=pattern',
+ \ '--fields=nksSaf',
+ \ '--extra=',
+ \ '--sort=no',
+ \ '--append=no'
+ \ ]
+
+ " Include extra type definitions
+ if has_key(a:typeinfo, 'deffile')
+ let ctags_args += ['--options=' . expand(a:typeinfo.deffile)]
+ endif
+
+ " Third-party programs may not necessarily make use of this
+ if has_key(a:typeinfo, 'ctagstype')
+ let ctags_type = a:typeinfo.ctagstype
+
+ let ctags_kinds = ''
+ for kind in a:typeinfo.kinds
+ let ctags_kinds .= kind.short
+ endfor
+
+ let ctags_args += ['--language-force=' . ctags_type]
+ let ctags_args += ['--' . ctags_type . '-kinds=' . ctags_kinds]
+ endif
+ endif
+
+ if has_key(a:typeinfo, 'ctagsbin')
+ " reset 'wildignore' temporarily in case *.exe is included in it
+ let wildignore_save = &wildignore
+ set wildignore&
+ let ctags_bin = expand(a:typeinfo.ctagsbin)
+ let &wildignore = wildignore_save
+ else
+ let ctags_bin = g:tagbar_ctags_bin
+ endif
+
+ let ctags_cmd = s:EscapeCtagsCmd(ctags_bin, ctags_args, a:fname)
+ if ctags_cmd == ''
+ return ''
+ endif
+
+ let ctags_output = s:ExecuteCtags(ctags_cmd)
+
+ if v:shell_error || ctags_output =~ 'Warning: cannot open source file'
+ call s:debug('Command output:')
+ call s:debug(ctags_output)
+ " Only display an error message if the Tagbar window is open and we
+ " haven't seen the error before.
+ if bufwinnr("__Tagbar__") != -1 &&
+ \ (!s:known_files.has(a:realfname) ||
+ \ !empty(s:known_files.get(a:realfname)))
+ call s:warning('Tagbar: Could not execute ctags for ' . a:realfname . '!')
+ echomsg 'Executed command: "' . ctags_cmd . '"'
+ if !empty(ctags_output)
+ echomsg 'Command output:'
+ for line in split(ctags_output, '\n')
+ echomsg line
+ endfor
+ endif
+ endif
+ return -1
+ endif
+
+ call s:debug('Ctags executed successfully')
+ return ctags_output
+endfunction
+
+" s:ParseTagline() {{{2
+" Structure of a tag line:
+" tagname<TAB>filename<TAB>expattern;"fields
+" fields: <TAB>name:value
+" fields that are always present: kind, line
+function! s:ParseTagline(part1, part2, typeinfo, fileinfo) abort
+ let basic_info = split(a:part1, '\t')
+
+ let taginfo = s:NormalTag.New(basic_info[0])
+ let taginfo.file = basic_info[1]
+
+ " the pattern can contain tabs and thus may have been split up, so join
+ " the rest of the items together again
+ let pattern = join(basic_info[2:], "\t")
+ let start = 2 " skip the slash and the ^
+ let end = strlen(pattern) - 1
+ if pattern[end - 1] ==# '$'
+ let end -= 1
+ let dollar = '\$'
+ else
+ let dollar = ''
+ endif
+ let pattern = strpart(pattern, start, end - start)
+ let taginfo.pattern = '\V\^\C' . pattern . dollar
+
+ " When splitting fields make sure not to create empty keys or values in
+ " case a value illegally contains tabs
+ let fields = split(a:part2, '^\t\|\t\ze\w\+:')
+ if fields[0] !~# ':'
+ let taginfo.fields.kind = remove(fields, 0)
+ endif
+ for field in fields
+ " can't use split() since the value can contain ':'
+ let delimit = stridx(field, ':')
+ let key = strpart(field, 0, delimit)
+ " Remove all tabs that may illegally be in the value
+ let val = substitute(strpart(field, delimit + 1), '\t', '', 'g')
+ " File-restricted scoping
+ if key == "file"
+ let taginfo.fields[key] = 'yes'
+ endif
+ if len(val) > 0
+ if key == 'line' || key == 'column'
+ let taginfo.fields[key] = str2nr(val)
+ else
+ let taginfo.fields[key] = val
+ endif
+ endif
+ endfor
+ " Needed for jsctags
+ if has_key(taginfo.fields, 'lineno')
+ let taginfo.fields.line = str2nr(taginfo.fields.lineno)
+ endif
+ " Do some sanity checking in case ctags reports invalid line numbers
+ if taginfo.fields.line < 0
+ let taginfo.fields.line = 0
+ endif
+
+ if !has_key(taginfo.fields, 'kind')
+ call s:debug("Warning: No 'kind' field found for tag " . basic_info[0] . "!")
+ if index(s:warnings.type, a:typeinfo.ftype) == -1
+ call s:warning("No 'kind' field found for tag " . basic_info[0] . "!" .
+ \ " Please read the last section of ':help tagbar-extend'.")
+ call add(s:warnings.type, a:typeinfo.ftype)
+ endif
+ return {}
+ endif
+
+ " Make some information easier accessible
+ if has_key(a:typeinfo, 'scope2kind')
+ for scope in keys(a:typeinfo.scope2kind)
+ if has_key(taginfo.fields, scope)
+ let taginfo.scope = scope
+ let taginfo.path = taginfo.fields[scope]
+
+ let taginfo.fullpath = taginfo.path . a:typeinfo.sro .
+ \ taginfo.name
+ break
+ endif
+ endfor
+ let taginfo.depth = len(split(taginfo.path, '\V' . a:typeinfo.sro))
+ endif
+
+ let taginfo.fileinfo = a:fileinfo
+ let taginfo.typeinfo = a:typeinfo
+
+ " Needed for folding
+ try
+ call taginfo.initFoldState()
+ catch /^Vim(\a\+):E716:/ " 'Key not present in Dictionary'
+ " The tag has a 'kind' that doesn't exist in the type definition
+ call s:debug('Warning: Unknown tag kind: ' . taginfo.fields.kind)
+ if index(s:warnings.type, a:typeinfo.ftype) == -1
+ call s:warning('Unknown tag kind encountered: ' .
+ \ '"' . taginfo.fields.kind . '".' .
+ \ ' Your ctags and Tagbar configurations are out of sync!' .
+ \ ' Please read '':help tagbar-extend''.')
+ call add(s:warnings.type, a:typeinfo.ftype)
+ endif
+ return {}
+ endtry
+
+ return taginfo
+endfunction
+
+" s:AddScopedTags() {{{2
+" Recursively process tags. Unfortunately there is a problem: not all tags in
+" a hierarchy are actually there. For example, in C++ a class can be defined
+" in a header file and implemented in a .cpp file (so the class itself doesn't
+" appear in the .cpp file and thus doesn't generate a tag). Another example
+" are anonymous structures like namespaces, structs, enums, and unions, that
+" also don't get a tag themselves. These tags are thus called 'pseudo-tags' in
+" Tagbar. Properly parsing them is quite tricky, so try not to think about it
+" too much.
+function! s:AddScopedTags(tags, processedtags, parent, depth,
+ \ typeinfo, fileinfo, maxline) abort
+ if !empty(a:parent)
+ let curpath = a:parent.fullpath
+ let pscope = a:typeinfo.kind2scope[a:parent.fields.kind]
+ else
+ let curpath = ''
+ let pscope = ''
+ endif
+
+ let is_cur_tag = 'v:val.depth == a:depth'
+
+ if !empty(curpath)
+ " Check whether the tag is either a direct child at the current depth
+ " or at least a proper grandchild with pseudo-tags in between. If it
+ " is a direct child also check for matching scope.
+ let is_cur_tag .= ' &&
+ \ (v:val.path ==# curpath ||
+ \ match(v:val.path, ''\V\^\C'' . curpath . a:typeinfo.sro) == 0) &&
+ \ (v:val.path ==# curpath ? (v:val.scope ==# pscope) : 1) &&
+ \ v:val.fields.line >= a:parent.fields.line &&
+ \ v:val.fields.line <= a:maxline'
+ endif
+
+ let curtags = filter(copy(a:tags), is_cur_tag)
+
+ if !empty(curtags)
+ call filter(a:tags, '!(' . is_cur_tag . ')')
+
+ let realtags = []
+ let pseudotags = []
+
+ while !empty(curtags)
+ let tag = remove(curtags, 0)
+
+ if tag.path != curpath
+ " tag is child of a pseudo-tag, so create a new pseudo-tag and
+ " add all its children to it
+ let pseudotag = s:ProcessPseudoTag(curtags, tag, a:parent,
+ \ a:typeinfo, a:fileinfo)
+
+ call add(pseudotags, pseudotag)
+ else
+ call add(realtags, tag)
+ endif
+ endwhile
+
+ " Recursively add the children of the tags on the current level
+ for tag in realtags
+ let tag.parent = a:parent
+
+ if !has_key(a:typeinfo.kind2scope, tag.fields.kind)
+ continue
+ endif
+
+ if !has_key(tag, 'children')
+ let tag.children = []
+ endif
+
+ " Check for tags with the exact same name that may be created
+ " alternatively in a conditional (Issue #139). The only way to
+ " distinguish between them is by line number.
+ let twins = filter(copy(realtags),
+ \ "v:val.fullpath ==# '" .
+ \ substitute(tag.fullpath, "'", "''", 'g') . "'" .
+ \ " && v:val.fields.line != " . tag.fields.line)
+ let maxline = line('$')
+ for twin in twins
+ if twin.fields.line <= maxline &&
+ \ twin.fields.line > tag.fields.line
+ let maxline = twin.fields.line - 1
+ endif
+ endfor
+
+ call s:AddScopedTags(a:tags, tag.children, tag, a:depth + 1,
+ \ a:typeinfo, a:fileinfo, maxline)
+ endfor
+ call extend(a:processedtags, realtags)
+
+ " Recursively add the children of the tags that are children of the
+ " pseudo-tags on the current level
+ for tag in pseudotags
+ call s:ProcessPseudoChildren(a:tags, tag, a:depth, a:typeinfo,
+ \ a:fileinfo)
+ endfor
+ call extend(a:processedtags, pseudotags)
+ endif
+
+ " Now we have to check if there are any pseudo-tags at the current level
+ " so we have to check for real tags at a lower level, i.e. grandchildren
+ let is_grandchild = 'v:val.depth > a:depth'
+
+ if !empty(curpath)
+ let is_grandchild .=
+ \ ' && match(v:val.path, ''\V\^\C'' . curpath . a:typeinfo.sro) == 0'
+ endif
+
+ let grandchildren = filter(copy(a:tags), is_grandchild)
+
+ if !empty(grandchildren)
+ call s:AddScopedTags(a:tags, a:processedtags, a:parent, a:depth + 1,
+ \ a:typeinfo, a:fileinfo, a:maxline)
+ endif
+endfunction
+
+" s:ProcessPseudoTag() {{{2
+function! s:ProcessPseudoTag(curtags, tag, parent, typeinfo, fileinfo) abort
+ let curpath = !empty(a:parent) ? a:parent.fullpath : ''
+
+ let pseudoname = substitute(a:tag.path, curpath, '', '')
+ let pseudoname = substitute(pseudoname, '\V\^' . a:typeinfo.sro, '', '')
+ let pseudotag = s:CreatePseudoTag(pseudoname, a:parent, a:tag.scope,
+ \ a:typeinfo, a:fileinfo)
+ let pseudotag.children = [a:tag]
+
+ " get all the other (direct) children of the current pseudo-tag
+ let ispseudochild = 'v:val.path ==# a:tag.path && v:val.scope ==# a:tag.scope'
+ let pseudochildren = filter(copy(a:curtags), ispseudochild)
+ if !empty(pseudochildren)
+ call filter(a:curtags, '!(' . ispseudochild . ')')
+ call extend(pseudotag.children, pseudochildren)
+ endif
+
+ return pseudotag
+endfunction
+
+" s:ProcessPseudoChildren() {{{2
+function! s:ProcessPseudoChildren(tags, tag, depth, typeinfo, fileinfo) abort
+ for childtag in a:tag.children
+ let childtag.parent = a:tag
+
+ if !has_key(a:typeinfo.kind2scope, childtag.fields.kind)
+ continue
+ endif
+
+ if !has_key(childtag, 'children')
+ let childtag.children = []
+ endif
+
+ call s:AddScopedTags(a:tags, childtag.children, childtag, a:depth + 1,
+ \ a:typeinfo, a:fileinfo, line('$'))
+ endfor
+
+ let is_grandchild = 'v:val.depth > a:depth && ' .
+ \ 'match(v:val.path,' .
+ \ '''^\C'' . substitute(a:tag.fullpath, "''", "''''", "g")) == 0'
+ let grandchildren = filter(copy(a:tags), is_grandchild)
+ if !empty(grandchildren)
+ call s:AddScopedTags(a:tags, a:tag.children, a:tag, a:depth + 1,
+ \ a:typeinfo, a:fileinfo, line('$'))
+ endif
+endfunction
+
+" s:CreatePseudoTag() {{{2
+function! s:CreatePseudoTag(name, parent, scope, typeinfo, fileinfo) abort
+ if !empty(a:parent)
+ let curpath = a:parent.fullpath
+ let pscope = a:typeinfo.kind2scope[a:parent.fields.kind]
+ else
+ let curpath = ''
+ let pscope = ''
+ endif
+
+ let pseudotag = s:PseudoTag.New(a:name)
+ let pseudotag.fields.kind = a:typeinfo.scope2kind[a:scope]
+
+ let parentscope = substitute(curpath, a:name . '$', '', '')
+ let parentscope = substitute(parentscope,
+ \ '\V\^' . a:typeinfo.sro . '\$', '', '')
+
+ if pscope != ''
+ let pseudotag.fields[pscope] = parentscope
+ let pseudotag.scope = pscope
+ let pseudotag.path = parentscope
+ let pseudotag.fullpath =
+ \ pseudotag.path . a:typeinfo.sro . pseudotag.name
+ endif
+ let pseudotag.depth = len(split(pseudotag.path, '\V' . a:typeinfo.sro))
+
+ let pseudotag.parent = a:parent
+
+ let pseudotag.fileinfo = a:fileinfo
+ let pseudotag.typeinfo = a:typeinfo
+
+ call pseudotag.initFoldState()
+
+ return pseudotag
+endfunction
+
+" Sorting {{{1
+" s:SortTags() {{{2
+function! s:SortTags(tags, comparemethod) abort
+ call sort(a:tags, a:comparemethod)
+
+ for tag in a:tags
+ if has_key(tag, 'children')
+ call s:SortTags(tag.children, a:comparemethod)
+ endif
+ endfor
+endfunction
+
+" s:CompareByKind() {{{2
+function! s:CompareByKind(tag1, tag2) abort
+ let typeinfo = s:compare_typeinfo
+
+ if typeinfo.kinddict[a:tag1.fields.kind] <#
+ \ typeinfo.kinddict[a:tag2.fields.kind]
+ return -1
+ elseif typeinfo.kinddict[a:tag1.fields.kind] >#
+ \ typeinfo.kinddict[a:tag2.fields.kind]
+ return 1
+ else
+ " Ignore '~' prefix for C++ destructors to sort them directly under
+ " the constructors
+ if a:tag1.name[0] ==# '~'
+ let name1 = a:tag1.name[1:]
+ else
+ let name1 = a:tag1.name
+ endif
+ if a:tag2.name[0] ==# '~'
+ let name2 = a:tag2.name[1:]
+ else
+ let name2 = a:tag2.name
+ endif
+
+ if name1 <=# name2
+ return -1
+ else
+ return 1
+ endif
+ endif
+endfunction
+
+" s:CompareByLine() {{{2
+function! s:CompareByLine(tag1, tag2) abort
+ return a:tag1.fields.line - a:tag2.fields.line
+endfunction
+
+" s:ToggleSort() {{{2
+function! s:ToggleSort() abort
+ let fileinfo = s:known_files.getCurrent(0)
+ if empty(fileinfo)
+ return
+ endif
+
+ " Save the tag the cursor is currently on
+ let curline = line('.')
+ let taginfo = s:GetTagInfo(curline, 0)
+
+ match none
+
+ let s:compare_typeinfo = s:known_types[fileinfo.ftype]
+
+ if has_key(s:compare_typeinfo, 'sort')
+ let s:compare_typeinfo.sort = !s:compare_typeinfo.sort
+ else
+ let g:tagbar_sort = !g:tagbar_sort
+ endif
+
+ call fileinfo.sortTags()
+
+ call s:RenderContent()
+ call s:SetStatusLine('current')
+
+ " If we were on a tag before sorting then jump to it, otherwise restore
+ " the cursor to the current line
+ if !empty(taginfo)
+ execute taginfo.tline
+ else
+ execute curline
+ endif
+endfunction
+
+" Display {{{1
+" s:RenderContent() {{{2
+function! s:RenderContent(...) abort
+ call s:debug('RenderContent called')
+ let s:new_window = 0
+
+ if a:0 == 1
+ let fileinfo = a:1
+ else
+ let fileinfo = s:known_files.getCurrent(0)
+ endif
+
+ if empty(fileinfo)
+ call s:debug('Empty fileinfo, returning')
+ return
+ endif
+
+ let tagbarwinnr = bufwinnr('__Tagbar__')
+
+ if &filetype == 'tagbar'
+ let in_tagbar = 1
+ else
+ let in_tagbar = 0
+ let prevwinnr = winnr()
+
+ " Get the previous window number, so that we can reproduce
+ " the window entering history later. Do not run autocmd on
+ " this command, make sure nothing is interfering.
+ " let pprevwinnr = winnr('#') " Messes up windows for some reason
+ call s:goto_win('p', 1)
+ let pprevwinnr = winnr()
+ call s:goto_win(tagbarwinnr, 1)
+ endif
+
+ if !empty(s:known_files.getCurrent(0)) &&
+ \ fileinfo.fpath ==# s:known_files.getCurrent(0).fpath
+ " We're redisplaying the same file, so save the view
+ call s:debug('Redisplaying file [' . fileinfo.fpath . ']')
+ let saveline = line('.')
+ let savecol = col('.')
+ let topline = line('w0')
+ endif
+
+ let lazyredraw_save = &lazyredraw
+ set lazyredraw
+ let eventignore_save = &eventignore
+ set eventignore=all
+
+ setlocal modifiable
+
+ silent %delete _
+
+ call s:PrintHelp()
+
+ let typeinfo = fileinfo.typeinfo
+
+ if !empty(fileinfo.tags)
+ " Print tags
+ call s:PrintKinds(typeinfo, fileinfo)
+ else
+ call s:debug('No tags found, skipping printing.')
+ if g:tagbar_compact && s:short_help
+ silent 0put ='\" No tags found.'
+ else
+ silent put ='\" No tags found.'
+ endif
+ endif
+
+ " Delete empty lines at the end of the buffer
+ for linenr in range(line('$'), 1, -1)
+ if getline(linenr) =~ '^$'
+ execute 'silent ' . linenr . 'delete _'
+ else
+ break
+ endif
+ endfor
+
+ setlocal nomodifiable
+
+ if !empty(s:known_files.getCurrent(0)) &&
+ \ fileinfo.fpath ==# s:known_files.getCurrent(0).fpath
+ let scrolloff_save = &scrolloff
+ set scrolloff=0
+
+ call cursor(topline, 1)
+ normal! zt
+ call cursor(saveline, savecol)
+
+ let &scrolloff = scrolloff_save
+ else
+ " Make sure as much of the Tagbar content as possible is shown in the
+ " window by jumping to the top after drawing
+ execute 1
+ call winline()
+
+ " Invalidate highlight cache from old file
+ let s:last_highlight_tline = 0
+ endif
+
+ let &lazyredraw = lazyredraw_save
+ let &eventignore = eventignore_save
+
+ if !in_tagbar
+ call s:goto_win(pprevwinnr, 1)
+ call s:goto_win(prevwinnr, 1)
+ endif
+endfunction
+
+" s:PrintKinds() {{{2
+function! s:PrintKinds(typeinfo, fileinfo) abort
+ call s:debug('PrintKinds called')
+
+ let is_first_tag = 1
+
+ for kind in a:typeinfo.kinds
+ let curtags = filter(copy(a:fileinfo.tags),
+ \ 'v:val.fields.kind ==# kind.short')
+ call s:debug('Printing kind: ' . kind.short .
+ \ ', number of (top-level) tags: ' . len(curtags))
+
+ if empty(curtags)
+ continue
+ endif
+
+ if has_key(a:typeinfo, 'kind2scope') &&
+ \ has_key(a:typeinfo.kind2scope, kind.short)
+ " Scoped tags
+ for tag in curtags
+ call s:PrintTag(tag, 0, is_first_tag, a:fileinfo, a:typeinfo)
+
+ if !g:tagbar_compact
+ silent put _
+ endif
+
+ let is_first_tag = 0
+ endfor
+ else
+ " Non-scoped tags
+ let kindtag = curtags[0].parent
+
+ if kindtag.isFolded()
+ let foldmarker = s:icon_closed
+ else
+ let foldmarker = s:icon_open
+ endif
+
+ let padding = g:tagbar_show_visibility ? ' ' : ''
+ if g:tagbar_compact && is_first_tag && s:short_help
+ silent 0put =foldmarker . padding . kind.long
+ else
+ silent put =foldmarker . padding . kind.long
+ endif
+
+ let curline = line('.')
+ let kindtag.tline = curline
+ let a:fileinfo.tline[curline] = kindtag
+
+ if !kindtag.isFolded()
+ for tag in curtags
+ let str = tag.strfmt()
+ silent put =repeat(' ', g:tagbar_indent) . str
+
+ " Save the current tagbar line in the tag for easy
+ " highlighting access
+ let curline = line('.')
+ let tag.tline = curline
+ let a:fileinfo.tline[curline] = tag
+ let tag.depth = 1
+ endfor
+ endif
+
+ if !g:tagbar_compact
+ silent put _
+ endif
+
+ let is_first_tag = 0
+ endif
+ endfor
+endfunction
+
+" s:PrintTag() {{{2
+function! s:PrintTag(tag, depth, is_first, fileinfo, typeinfo) abort
+ if g:tagbar_hide_nonpublic &&
+ \ get(a:tag.fields, 'access', 'public') !=# 'public'
+ let a:tag.tline = -1
+ return
+ endif
+
+ " Print tag indented according to depth
+ let tagstr = repeat(' ', a:depth * g:tagbar_indent) . a:tag.strfmt()
+ if a:is_first && g:tagbar_compact && s:short_help
+ silent 0put =tagstr
+ else
+ silent put =tagstr
+ endif
+
+ " Save the current tagbar line in the tag for easy highlighting access
+ let curline = line('.')
+ let a:tag.tline = curline
+ let a:fileinfo.tline[curline] = a:tag
+
+ " Recursively print children
+ if a:tag.isFoldable() && !a:tag.isFolded()
+ for ckind in a:typeinfo.kinds
+ let childfilter = 'v:val.fields.kind ==# ckind.short'
+ if g:tagbar_hide_nonpublic
+ let childfilter .=
+ \ ' && get(v:val.fields, "access", "public") ==# "public"'
+ endif
+ let childtags = filter(copy(a:tag.children), childfilter)
+ if len(childtags) > 0
+ " Print 'kind' header of following children, but only if they
+ " are not scope-defining tags (since those already have an
+ " identifier)
+ if !has_key(a:typeinfo.kind2scope, ckind.short)
+ let indent = (a:depth + 1) * g:tagbar_indent
+ let indent += g:tagbar_show_visibility
+ let indent += 1 " fold symbol
+ silent put =repeat(' ', indent) . '[' . ckind.long . ']'
+ " Add basic tag to allow folding when on the header line
+ let headertag = s:BaseTag.New(ckind.long)
+ let headertag.parent = a:tag
+ let headertag.fileinfo = a:tag.fileinfo
+ let a:fileinfo.tline[line('.')] = headertag
+ endif
+ for childtag in childtags
+ call s:PrintTag(childtag, a:depth + 1, 0,
+ \ a:fileinfo, a:typeinfo)
+ endfor
+ endif
+ endfor
+ endif
+endfunction
+
+" s:PrintHelp() {{{2
+function! s:PrintHelp() abort
+ if !g:tagbar_compact && s:short_help
+ silent 0put ='\" Press ' . s:get_map_str('help') . ' for help'
+ silent put _
+ elseif !s:short_help
+ silent 0put ='\" Tagbar keybindings'
+ silent put ='\"'
+ silent put ='\" --------- General ---------'
+ silent put ='\" ' . s:get_map_str('jump') . ': Jump to tag definition'
+ silent put ='\" ' . s:get_map_str('preview') . ': As above, but stay in'
+ silent put ='\" Tagbar window'
+ silent put ='\" ' . s:get_map_str('previewwin') . ': Show tag in preview window'
+ silent put ='\" ' . s:get_map_str('nexttag') . ': Go to next top-level tag'
+ silent put ='\" ' . s:get_map_str('prevtag') . ': Go to previous top-level tag'
+ silent put ='\" ' . s:get_map_str('showproto') . ': Display tag prototype'
+ silent put ='\" ' . s:get_map_str('hidenonpublic') . ': Hide non-public tags'
+ silent put ='\"'
+ silent put ='\" ---------- Folds ----------'
+ silent put ='\" ' . s:get_map_str('openfold') . ': Open fold'
+ silent put ='\" ' . s:get_map_str('closefold') . ': Close fold'
+ silent put ='\" ' . s:get_map_str('togglefold') . ': Toggle fold'
+ silent put ='\" ' . s:get_map_str('openallfolds') . ': Open all folds'
+ silent put ='\" ' . s:get_map_str('closeallfolds') . ': Close all folds'
+ silent put ='\" ' . s:get_map_str('nextfold') . ': Go to next fold'
+ silent put ='\" ' . s:get_map_str('prevfold') . ': Go to previous fold'
+ silent put ='\"'
+ silent put ='\" ---------- Misc -----------'
+ silent put ='\" ' . s:get_map_str('togglesort') . ': Toggle sort'
+ silent put ='\" ' . s:get_map_str('toggleautoclose') . ': Toggle autoclose option'
+ silent put ='\" ' . s:get_map_str('zoomwin') . ': Zoom window in/out'
+ silent put ='\" ' . s:get_map_str('close') . ': Close window'
+ silent put ='\" ' . s:get_map_str('help') . ': Toggle help'
+ silent put _
+ endif
+endfunction
+function! s:get_map_str(map) abort
+ let def = get(g:, 'tagbar_map_' . a:map)
+ if type(def) == type("")
+ return def
+ else
+ return join(def, ', ')
+ endif
+endfunction
+
+" s:RenderKeepView() {{{2
+" The gist of this function was taken from NERDTree by Martin Grenfell.
+function! s:RenderKeepView(...) abort
+ if a:0 == 1
+ let line = a:1
+ else
+ let line = line('.')
+ endif
+
+ let curcol = col('.')
+ let topline = line('w0')
+
+ call s:RenderContent()
+
+ let scrolloff_save = &scrolloff
+ set scrolloff=0
+
+ call cursor(topline, 1)
+ normal! zt
+ call cursor(line, curcol)
+
+ let &scrolloff = scrolloff_save
+
+ redraw
+endfunction
+
+" User actions {{{1
+" s:HighlightTag() {{{2
+function! s:HighlightTag(openfolds, ...) abort
+ let tagline = 0
+
+ let force = a:0 > 0 ? a:1 : 0
+
+ if a:0 > 1
+ let tag = s:GetNearbyTag(1, 0, a:2)
+ else
+ let tag = s:GetNearbyTag(1, 0)
+ endif
+ if !empty(tag)
+ let tagline = tag.tline
+ endif
+
+ " Don't highlight the tag again if it's the same one as last time.
+ " This prevents the Tagbar window from jumping back after scrolling with
+ " the mouse.
+ if !force && tagline == s:last_highlight_tline
+ return
+ else
+ let s:last_highlight_tline = tagline
+ endif
+
+ let tagbarwinnr = bufwinnr('__Tagbar__')
+ if tagbarwinnr == -1
+ return
+ endif
+ let prevwinnr = winnr()
+ call s:goto_win(tagbarwinnr)
+
+ match none
+
+ " No tag above cursor position so don't do anything
+ if tagline == 0
+ call s:goto_win(prevwinnr)
+ redraw
+ return
+ endif
+
+ if g:tagbar_autoshowtag == 1 || a:openfolds
+ call s:OpenParents(tag)
+ endif
+
+ " Check whether the tag is inside a closed fold and highlight the parent
+ " instead in that case
+ let tagline = tag.getClosedParentTline()
+
+ " Parent tag line number is invalid, better don't do anything
+ if tagline <= 0
+ call s:goto_win(prevwinnr)
+ redraw
+ return
+ endif
+
+ " Go to the line containing the tag
+ execute tagline
+
+ " Make sure the tag is visible in the window
+ call winline()
+
+ let foldpat = '[' . s:icon_open . s:icon_closed . ' ]'
+ let pattern = '/^\%' . tagline . 'l\s*' . foldpat . '[-+# ]\zs[^( ]\+\ze/'
+ call s:debug("Highlight pattern: '" . pattern . "'")
+ if hlexists('TagbarHighlight') " Safeguard in case syntax highlighting is disabled
+ execute 'match TagbarHighlight ' . pattern
+ else
+ execute 'match Search ' . pattern
+ endif
+
+
+ if a:0 <= 1 " no line explicitly given, so assume we were in the file window
+ call s:goto_win(prevwinnr)
+ endif
+
+ redraw
+endfunction
+
+" s:JumpToTag() {{{2
+function! s:JumpToTag(stay_in_tagbar) abort
+ let taginfo = s:GetTagInfo(line('.'), 1)
+
+ let autoclose = w:autoclose
+
+ if empty(taginfo) || !taginfo.isNormalTag()
+ return
+ endif
+
+ let tagbarwinnr = winnr()
+
+ call s:GotoFileWindow(taginfo.fileinfo)
+
+ " Mark current position so it can be jumped back to
+ mark '
+
+ " Jump to the line where the tag is defined. Don't use the search pattern
+ " since it doesn't take the scope into account and thus can fail if tags
+ " with the same name are defined in different scopes (e.g. classes)
+ execute taginfo.fields.line
+
+ " If the file has been changed but not saved, the tag may not be on the
+ " saved line anymore, so search for it in the vicinity of the saved line
+ if match(getline('.'), taginfo.pattern) == -1
+ let interval = 1
+ let forward = 1
+ while search(taginfo.pattern, 'W' . forward ? '' : 'b') == 0
+ if !forward
+ if interval > line('$')
+ break
+ else
+ let interval = interval * 2
+ endif
+ endif
+ let forward = !forward
+ endwhile
+ endif
+
+ " If the tag is on a different line after unsaved changes update the tag
+ " and file infos/objects
+ let curline = line('.')
+ if taginfo.fields.line != curline
+ let taginfo.fields.line = curline
+ let taginfo.fileinfo.fline[curline] = taginfo
+ endif
+
+ " Center the tag in the window and jump to the correct column if available
+ normal! z.
+ call cursor(taginfo.fields.line, taginfo.fields.column)
+
+ normal! zv
+
+ if a:stay_in_tagbar
+ call s:HighlightTag(0)
+ call s:goto_win(tagbarwinnr)
+ redraw
+ elseif g:tagbar_autoclose || autoclose
+ " Also closes preview window
+ call s:CloseWindow()
+ else
+ " Close the preview window if it was opened by us
+ if s:pwin_by_tagbar
+ pclose
+ endif
+ call s:HighlightTag(0)
+ endif
+endfunction
+
+" s:ShowInPreviewWin() {{{2
+function! s:ShowInPreviewWin() abort
+ let pos = getpos('.')
+ let taginfo = s:GetTagInfo(pos[1], 1)
+
+ if empty(taginfo) || !taginfo.isNormalTag()
+ return
+ endif
+
+ let pwin_open = 0
+ for win in range(1, winnr('$'))
+ if getwinvar(win, '&previewwindow')
+ let pwin_open = 1
+ break
+ endif
+ endfor
+
+ " We want the preview window to be relative to the file window in normal
+ " (horizontal) mode, and relative to the Tagbar window in vertical mode,
+ " to make the best use of space.
+ if g:tagbar_vertical == 0
+ call s:GotoFileWindow(taginfo.fileinfo, 1)
+ call s:mark_window()
+ endif
+
+ " Open the preview window if it is not already open. This has to be done
+ " explicitly before the :psearch below to better control its positioning.
+ if !pwin_open
+ silent execute
+ \ g:tagbar_previewwin_pos . ' pedit ' . taginfo.fileinfo.fpath
+ if g:tagbar_vertical != 0
+ silent execute 'vertical resize ' . g:tagbar_width
+ endif
+ " Remember that the preview window was opened by Tagbar so we can
+ " safely close it by ourselves
+ let s:pwin_by_tagbar = 1
+ endif
+
+ if g:tagbar_vertical != 0
+ call s:GotoFileWindow(taginfo.fileinfo, 1)
+ call s:mark_window()
+ endif
+
+ " Use psearch instead of pedit since pedit essentially reloads the file
+ " and creates an empty undo entry. psearch has to be called from the file
+ " window, and since we only want matches in the current file we disable
+ " the 'include' option. Also start searching at the correct line number to
+ " find the correct tag in case of tags with the same name and to speed up
+ " the searching. Unfortunately the /\%l pattern doesn't seem to work with
+ " psearch.
+ let include_save = &include
+ set include=
+ silent! execute taginfo.fields.line . ',$psearch! /' . taginfo.pattern . '/'
+ let &include = include_save
+
+ call s:goto_win('P', 1)
+ normal! zv
+ normal! zz
+ call s:goto_markedwin(1)
+ call s:goto_tagbar(1)
+ call cursor(pos[1], pos[2])
+endfunction
+
+" s:ShowPrototype() {{{2
+function! s:ShowPrototype(short) abort
+ let taginfo = s:GetTagInfo(line('.'), 1)
+
+ if empty(taginfo)
+ return ''
+ endif
+
+ echo taginfo.getPrototype(a:short)
+endfunction
+
+" s:ToggleHelp() {{{2
+function! s:ToggleHelp() abort
+ let s:short_help = !s:short_help
+
+ " Prevent highlighting from being off after adding/removing the help text
+ match none
+
+ call s:RenderContent()
+
+ execute 1
+ redraw
+endfunction
+
+" s:GotoNextToplevelTag() {{{2
+function! s:GotoNextToplevelTag(direction) abort
+ let curlinenr = line('.')
+ let newlinenr = line('.')
+
+ if a:direction == 1
+ let range = range(line('.') + 1, line('$'))
+ else
+ let range = range(line('.') - 1, 1, -1)
+ endif
+
+ for tmplinenr in range
+ let taginfo = s:GetTagInfo(tmplinenr, 0)
+
+ if empty(taginfo)
+ continue
+ elseif empty(taginfo.parent)
+ let newlinenr = tmplinenr
+ break
+ endif
+ endfor
+
+ if curlinenr != newlinenr
+ execute newlinenr
+ call winline()
+ endif
+
+ redraw
+endfunction
+
+" Folding {{{1
+" s:OpenFold() {{{2
+function! s:OpenFold() abort
+ let fileinfo = s:known_files.getCurrent(0)
+ if empty(fileinfo)
+ return
+ endif
+
+ let curline = line('.')
+
+ let tag = s:GetTagInfo(curline, 0)
+ if empty(tag)
+ return
+ endif
+
+ call tag.openFold()
+
+ call s:RenderKeepView()
+endfunction
+
+" s:CloseFold() {{{2
+function! s:CloseFold() abort
+ let fileinfo = s:known_files.getCurrent(0)
+ if empty(fileinfo)
+ return
+ endif
+
+ match none
+
+ let curline = line('.')
+
+ let curtag = s:GetTagInfo(curline, 0)
+ if empty(curtag)
+ return
+ endif
+
+ let newline = curtag.closeFold()
+
+ call s:RenderKeepView(newline)
+endfunction
+
+" s:ToggleFold() {{{2
+function! s:ToggleFold() abort
+ let fileinfo = s:known_files.getCurrent(0)
+ if empty(fileinfo)
+ return
+ endif
+
+ match none
+
+ let curtag = s:GetTagInfo(line('.'), 0)
+ if empty(curtag)
+ return
+ endif
+
+ let newline = line('.')
+
+ if curtag.isKindheader()
+ call curtag.toggleFold()
+ elseif curtag.isFoldable()
+ if curtag.isFolded()
+ call curtag.openFold()
+ else
+ let newline = curtag.closeFold()
+ endif
+ else
+ let newline = curtag.closeFold()
+ endif
+
+ call s:RenderKeepView(newline)
+endfunction
+
+" s:SetFoldLevel() {{{2
+function! s:SetFoldLevel(level, force) abort
+ if a:level < 0
+ call s:warning('Foldlevel can''t be negative')
+ return
+ endif
+
+ let fileinfo = s:known_files.getCurrent(0)
+ if empty(fileinfo)
+ return
+ endif
+
+ call s:SetFoldLevelRecursive(fileinfo, fileinfo.tags, a:level)
+
+ let typeinfo = fileinfo.typeinfo
+
+ " Apply foldlevel to 'kind's
+ if a:level == 0
+ for kind in typeinfo.kinds
+ call fileinfo.closeKindFold(kind)
+ endfor
+ else
+ for kind in typeinfo.kinds
+ if a:force || !kind.fold
+ call fileinfo.openKindFold(kind)
+ endif
+ endfor
+ endif
+
+ let fileinfo.foldlevel = a:level
+
+ call s:RenderContent()
+endfunction
+
+" s:SetFoldLevelRecursive() {{{2
+" Apply foldlevel to normal tags
+function! s:SetFoldLevelRecursive(fileinfo, tags, level) abort
+ for tag in a:tags
+ if tag.depth >= a:level
+ call tag.setFolded(1)
+ else
+ call tag.setFolded(0)
+ endif
+
+ if has_key(tag, 'children')
+ call s:SetFoldLevelRecursive(a:fileinfo, tag.children, a:level)
+ endif
+ endfor
+endfunction
+
+" s:OpenParents() {{{2
+function! s:OpenParents(...) abort
+ if a:0 == 1
+ let tag = a:1
+ else
+ let tag = s:GetNearbyTag(1, 0)
+ endif
+
+ if !empty(tag)
+ call tag.openParents()
+ call s:RenderKeepView()
+ endif
+endfunction
+
+" s:GotoNextFold() {{{2
+function! s:GotoNextFold() abort
+ let curlinenr = line('.')
+ let newlinenr = line('.')
+
+ let range = range(line('.') + 1, line('$'))
+
+ for linenr in range
+ let taginfo = s:GetTagInfo(linenr, 0)
+
+ if empty(taginfo)
+ continue
+ elseif !empty(get(taginfo, 'children', [])) || taginfo.isKindheader()
+ let newlinenr = linenr
+ break
+ endif
+ endfor
+
+ if curlinenr != newlinenr
+ execute linenr
+ call winline()
+ endif
+
+ redraw
+endfunction
+
+" s:GotoPrevFold() {{{2
+function! s:GotoPrevFold() abort
+ let curlinenr = line('.')
+ let newlinenr = line('.')
+ let curtag = s:GetTagInfo(curlinenr, 0)
+ let curparent = get(curtag, 'parent', {})
+
+ let range = range(line('.') - 1, 1, -1)
+
+ for linenr in range
+ let taginfo = s:GetTagInfo(linenr, 0)
+
+ if empty(taginfo)
+ continue
+ " Check for the first tag that is either:
+ " - the last tag in an open fold, that is skip all tags that have the
+ " same parent as the current one, or
+ " - a closed parent fold.
+ elseif (!empty(taginfo.parent) && taginfo.parent != curparent &&
+ \ empty(get(taginfo, 'children', []))) ||
+ \ ((!empty(get(taginfo, 'children', [])) || taginfo.isKindheader()) &&
+ \ taginfo.isFolded())
+ let newlinenr = linenr
+ break
+ endif
+ endfor
+
+ if curlinenr != newlinenr
+ execute linenr
+ call winline()
+ endif
+
+ redraw
+endfunction
+
+" Helper functions {{{1
+" s:AutoUpdate() {{{2
+function! s:AutoUpdate(fname, force) abort
+ call s:debug('AutoUpdate called [' . a:fname . ']')
+
+ " This file is being loaded due to a quickfix command like vimgrep, so
+ " don't process it
+ if exists('s:tagbar_qf_active')
+ return
+ elseif exists('s:window_opening')
+ " This can happen if another plugin causes the active window to change
+ " with an autocmd during the initial Tagbar window creation. In that
+ " case InitWindow() hasn't had a chance to run yet and things can
+ " break. MiniBufExplorer does this, for example. Completely disabling
+ " autocmds at that point is also not ideal since for example
+ " statusline plugins won't be able to update.
+ call s:debug('Still opening window, stopping processing')
+ return
+ endif
+
+ " Get the filetype of the file we're about to process
+ let bufnr = bufnr(a:fname)
+ let ftype = getbufvar(bufnr, '&filetype')
+
+ " Don't do anything if we're in the tagbar window
+ if ftype == 'tagbar'
+ call s:debug('In Tagbar window, stopping processing')
+ return
+ endif
+
+ " Only consider the main filetype in cases like 'python.django'
+ let sftype = get(split(ftype, '\.'), 0, '')
+ call s:debug("Vim filetype: '" . ftype . "', " .
+ \ "sanitized filetype: '" . sftype . "'")
+
+ " Don't do anything if the file isn't supported
+ if !s:IsValidFile(a:fname, sftype)
+ call s:debug('Not a valid file, stopping processing')
+ let s:nearby_disabled = 1
+ return
+ endif
+
+ let updated = 0
+
+ " Process the file if it's unknown or the information is outdated.
+ " Testing the mtime of the file is necessary in case it got changed
+ " outside of Vim, for example by checking out a different version from a
+ " VCS.
+ if s:known_files.has(a:fname)
+ let curfile = s:known_files.get(a:fname)
+ " if a:force || getbufvar(curfile.bufnr, '&modified') ||
+ if a:force || empty(curfile) || curfile.ftype != sftype ||
+ \ (filereadable(a:fname) && getftime(a:fname) > curfile.mtime)
+ call s:debug('File data outdated, updating [' . a:fname . ']')
+ call s:ProcessFile(a:fname, sftype)
+ let updated = 1
+ else
+ call s:debug('File data seems up to date [' . a:fname . ']')
+ endif
+ elseif !s:known_files.has(a:fname)
+ call s:debug('New file, processing [' . a:fname . ']')
+ call s:ProcessFile(a:fname, sftype)
+ let updated = 1
+ endif
+
+ let fileinfo = s:known_files.get(a:fname)
+
+ " If we don't have an entry for the file by now something must have gone
+ " wrong, so don't change the tagbar content
+ if empty(fileinfo)
+ call s:debug('fileinfo empty after processing [' . a:fname . ']')
+ return
+ endif
+
+ " Display the tagbar content if the tags have been updated or a different
+ " file is being displayed
+ if bufwinnr('__Tagbar__') != -1 && !s:paused &&
+ \ (s:new_window || updated ||
+ \ (!empty(s:known_files.getCurrent(0)) &&
+ \ a:fname != s:known_files.getCurrent(0).fpath))
+ call s:RenderContent(fileinfo)
+ endif
+
+ " Call setCurrent after rendering so RenderContent can check whether the
+ " same file is being redisplayed
+ if !empty(fileinfo)
+ call s:debug('Setting current file [' . a:fname . ']')
+ call s:known_files.setCurrent(fileinfo)
+ let s:nearby_disabled = 0
+ endif
+
+ call s:HighlightTag(0)
+ call s:debug('AutoUpdate finished successfully')
+endfunction
+
+" s:CheckMouseClick() {{{2
+function! s:CheckMouseClick() abort
+ let line = getline('.')
+ let curcol = col('.')
+
+ if (match(line, s:icon_open . '[-+ ]') + 1) == curcol
+ call s:CloseFold()
+ elseif (match(line, s:icon_closed . '[-+ ]') + 1) == curcol
+ call s:OpenFold()
+ elseif g:tagbar_singleclick
+ call s:JumpToTag(0)
+ endif
+endfunction
+
+" s:DetectFiletype() {{{2
+function! s:DetectFiletype(bufnr) abort
+ " Filetype has already been detected for loaded buffers, but not
+ " necessarily for unloaded ones
+ let ftype = getbufvar(a:bufnr, '&filetype')
+
+ if bufloaded(a:bufnr)
+ return ftype
+ endif
+
+ if ftype != ''
+ return ftype
+ endif
+
+ " Unloaded buffer with non-detected filetype, need to detect filetype
+ " manually
+ let bufname = bufname(a:bufnr)
+
+ let eventignore_save = &eventignore
+ set eventignore=FileType
+ let filetype_save = &filetype
+
+ exe 'doautocmd filetypedetect BufRead ' . bufname
+ let ftype = &filetype
+
+ let &filetype = filetype_save
+ let &eventignore = eventignore_save
+
+ return ftype
+endfunction
+
+" s:EscapeCtagsCmd() {{{2
+" Assemble the ctags command line in a way that all problematic characters are
+" properly escaped and converted to the system's encoding
+" Optional third parameter is a file name to run ctags on
+" Note: The second parameter (a:args) can be a list of args or
+" a single string of the args.
+" When a:args is a list, each argument in the list will be escaped for the
+" current &shell type.
+" When a:args is a string, all arguments should be escaped appropriately
+" (if required). In most use cases no escaping is required so a string
+" is acceptable. But in cases where arguments may need to be escaped
+" differently for each &shell type, then pass a list of arguments.
+function! s:EscapeCtagsCmd(ctags_bin, args, ...) abort
+ call s:debug('EscapeCtagsCmd called')
+ call s:debug('ctags_bin: ' . a:ctags_bin)
+ if type(a:args)==type('')
+ call s:debug('ctags_args (is a string): ' . a:args)
+ elseif type(a:args)==type([])
+ call s:debug('ctags_args (is a list): ' . string(a:args))
+ endif
+
+ if exists('+shellslash')
+ let shellslash_save = &shellslash
+ set noshellslash
+ endif
+
+ "Set up 0th argument of ctags_cmd
+ "a:ctags_bin may have special characters that require escaping.
+ if &shell =~ 'cmd\.exe$' && a:ctags_bin !~ '\s'
+ "For windows cmd.exe, escaping the 0th argument can cause
+ "problems if it references a batch file and the batch file uses %~dp0.
+ "So for windows cmd.exe, only escape the 0th argument iff necessary.
+ "Only known necessary case is when ctags_bin executable filename has
+ "whitespace character(s).
+
+ " Example: If 0th argument is wrapped in double quotes AND it is not
+ " an absolute path to ctags_bin, but rather an executable in %PATH%,
+ " then %~dp0 resolves to the current working directory rather than
+ " the batch file's directory. Batch files like this generally exepect
+ " and depend on %~dp0 to resolve the batch file's directory.
+ " Note: Documentation such as `help cmd.exe` and
+ " http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true
+ " suggest other special characters that require escaping for command
+ " line completion. But tagbar.vim does not use the command line
+ " completion feature of cmd.exe and testing shows that the only special
+ " character that needs to be escaped for tagbar.vim is <space> for
+ " windows cmd.exe.
+ let ctags_cmd = a:ctags_bin
+ else
+ let ctags_cmd = shellescape(a:ctags_bin)
+ endif
+
+ "Add additional arguments to ctags_cmd
+ if type(a:args)==type('')
+ "When a:args is a string, append the arguments
+ "Note: In this case, do not attempt to shell escape a:args string.
+ "This function expects the string to already be escaped properly for
+ "the shell type. Why not escape? Because it could be ambiguous about
+ "whether a space is an argument separator or included in the argument.
+ "Since escaping rules vary from shell to shell, it is better to pass a
+ "list of arguments to a:args. With a list, each argument is clearly
+ "separated, so shellescape() can calculate the appropriate escaping
+ "for each argument for the current &shell.
+ let ctags_cmd .= ' ' . a:args
+ elseif type(a:args)==type([])
+ "When a:args is a list, shellescape() each argument and append ctags_cmd
+ "Note: It's a better practice to shellescape() each argument separately so that
+ "spaces used as a separator between arguments can be distinguished with
+ "spaces used inside a single argument.
+ for arg in a:args
+ let ctags_cmd .= ' ' . shellescape(arg)
+ endfor
+ endif
+
+ "if a filename was specified, add filename as final argument to ctags_cmd.
+ if a:0 == 1
+ let ctags_cmd .= ' ' . shellescape(a:1)
+ endif
+
+ if exists('+shellslash')
+ let &shellslash = shellslash_save
+ endif
+
+ " Needed for cases where 'encoding' is different from the system's
+ " encoding
+ if has('multi_byte')
+ if g:tagbar_systemenc != &encoding
+ let ctags_cmd = iconv(ctags_cmd, &encoding, g:tagbar_systemenc)
+ elseif $LANG != ''
+ let ctags_cmd = iconv(ctags_cmd, &encoding, $LANG)
+ endif
+ endif
+
+ call s:debug('Escaped ctags command: ' . ctags_cmd)
+
+ if ctags_cmd == ''
+ if !s:warnings.encoding
+ call s:warning('Tagbar: Ctags command encoding conversion failed!' .
+ \ ' Please read ":h g:tagbar_systemenc".')
+ let s:warnings.encoding = 1
+ endif
+ endif
+
+ return ctags_cmd
+endfunction
+
+" s:ExecuteCtags() {{{2
+" Execute ctags with necessary shell settings
+" Partially based on the discussion at
+" http://vim.1045645.n5.nabble.com/bad-default-shellxquote-in-Widows-td1208284.html
+function! s:ExecuteCtags(ctags_cmd) abort
+ call s:debug('Executing ctags command: ' . a:ctags_cmd)
+
+ if &shell =~# 'fish$'
+ " Reset shell since fish isn't really compatible
+ let shell_save = &shell
+ set shell=sh
+ endif
+
+ if exists('+shellslash')
+ let shellslash_save = &shellslash
+ set noshellslash
+ endif
+
+ if &shell =~ 'cmd\.exe'
+ let shellxquote_save = &shellxquote
+ set shellxquote=\"
+ let shellcmdflag_save = &shellcmdflag
+ set shellcmdflag=/s\ /c
+ endif
+
+ if s:debug
+ silent 5verbose let ctags_output = system(a:ctags_cmd)
+ call s:debug(v:statusmsg)
+ redraw!
+ else
+ silent let ctags_output = system(a:ctags_cmd)
+ endif
+
+ if &shell =~ 'cmd\.exe'
+ let &shellxquote = shellxquote_save
+ let &shellcmdflag = shellcmdflag_save
+ endif
+
+ if exists('+shellslash')
+ let &shellslash = shellslash_save
+ endif
+
+ if exists('shell_save')
+ let &shell = shell_save
+ endif
+
+ return ctags_output
+endfunction
+
+" s:GetNearbyTag() {{{2
+" Get the tag info for a file near the cursor in the current file
+function! s:GetNearbyTag(all, forcecurrent, ...) abort
+ if s:nearby_disabled
+ return {}
+ endif
+
+ let fileinfo = s:known_files.getCurrent(a:forcecurrent)
+ if empty(fileinfo)
+ return {}
+ endif
+
+ let typeinfo = fileinfo.typeinfo
+ if a:0 > 0
+ let curline = a:1
+ else
+ let curline = line('.')
+ endif
+ let tag = {}
+
+ " If a tag appears in a file more than once (for example namespaces in
+ " C++) only one of them has a 'tline' entry and can thus be highlighted.
+ " The only way to solve this would be to go over the whole tag list again,
+ " making everything slower. Since this should be a rare occurence and
+ " highlighting isn't /that/ important ignore it for now.
+ for line in range(curline, 1, -1)
+ if has_key(fileinfo.fline, line)
+ let curtag = fileinfo.fline[line]
+ if a:all || typeinfo.getKind(curtag.fields.kind).stl
+ let tag = curtag
+ break
+ endif
+ endif
+ endfor
+
+ return tag
+endfunction
+
+" s:GetTagInfo() {{{2
+" Return the info dictionary of the tag on the specified line. If the line
+" does not contain a valid tag (for example because it is empty or only
+" contains a pseudo-tag) return an empty dictionary.
+function! s:GetTagInfo(linenr, ignorepseudo) abort
+ let fileinfo = s:known_files.getCurrent(0)
+
+ if empty(fileinfo)
+ return {}
+ endif
+
+ " Don't do anything in empty and comment lines
+ let curline = getbufline(bufnr('__Tagbar__'), a:linenr)[0]
+ if curline =~ '^\s*$' || curline[0] == '"'
+ return {}
+ endif
+
+ " Check if there is a tag on the current line
+ if !has_key(fileinfo.tline, a:linenr)
+ return {}
+ endif
+
+ let taginfo = fileinfo.tline[a:linenr]
+
+ " Check if the current tag is not a pseudo-tag
+ if a:ignorepseudo && taginfo.isPseudoTag()
+ return {}
+ endif
+
+ return taginfo
+endfunction
+
+" s:GetFileWinnr() {{{2
+" Get the number of the window that has Tagbar's current file loaded into it,
+" or 0 if no window has loaded it. It tries the previous window first, if that
+" does not have the correct buffer loaded it will look for the first one with
+" the correct buffer in it.
+function! s:GetFileWinnr(fileinfo) abort
+ let filewinnr = 0
+ let prevwinnr = winnr("#")
+
+ if winbufnr(prevwinnr) == a:fileinfo.bufnr &&
+ \ !getwinvar(prevwinnr, '&previewwindow')
+ let filewinnr = prevwinnr
+ else
+ " Search for the first real window that has the correct buffer loaded
+ " in it. Similar to bufwinnr() but skips the previewwindow.
+ for i in range(1, winnr('$'))
+ call s:goto_win(i, 1)
+ if bufnr('%') == a:fileinfo.bufnr && !&previewwindow
+ let filewinnr = winnr()
+ break
+ endif
+ endfor
+
+ call s:goto_tagbar(1)
+ endif
+
+ return filewinnr
+endfunction
+
+" s:GotoFileWindow() {{{2
+" Try to switch to the window that has Tagbar's current file loaded in it, or
+" open the file in an existing window otherwise.
+function! s:GotoFileWindow(fileinfo, ...) abort
+ let noauto = a:0 > 0 ? a:1 : 0
+
+ let filewinnr = s:GetFileWinnr(a:fileinfo)
+
+ " If there is no window with the correct buffer loaded then load it
+ " into the first window that has a non-special buffer in it.
+ if filewinnr == 0
+ for i in range(1, winnr('$'))
+ call s:goto_win(i, 1)
+ if &buftype == '' && !&previewwindow
+ execute 'buffer ' . a:fileinfo.bufnr
+ break
+ endif
+ endfor
+ else
+ call s:goto_win(filewinnr, 1)
+ endif
+
+ " To make ctrl-w_p work we switch between the Tagbar window and the
+ " correct window once
+ call s:goto_tagbar(noauto)
+ call s:goto_win('p', noauto)
+endfunction
+
+" s:ToggleHideNonPublicTags() {{{2
+function! s:ToggleHideNonPublicTags() abort
+ let g:tagbar_hide_nonpublic = !g:tagbar_hide_nonpublic
+ call s:RenderKeepView()
+ call s:SetStatusLine('current')
+endfunction
+
+" s:ToggleAutoclose() {{{2
+function! s:ToggleAutoclose() abort
+ let g:tagbar_autoclose = !g:tagbar_autoclose
+ call s:SetStatusLine('current')
+endfunction
+
+" s:IsValidFile() {{{2
+function! s:IsValidFile(fname, ftype) abort
+ call s:debug('Checking if file is valid [' . a:fname . ']')
+
+ if a:fname == '' || a:ftype == ''
+ call s:debug('Empty filename or type')
+ return 0
+ endif
+
+ if !filereadable(a:fname) && getbufvar(a:fname, 'netrw_tmpfile') == ''
+ call s:debug('File not readable')
+ return 0
+ endif
+
+ if getbufvar(a:fname, 'tagbar_ignore') == 1
+ call s:debug('File is marked as ignored')
+ return 0
+ endif
+
+ if &previewwindow
+ call s:debug('In preview window')
+ return 0
+ endif
+
+ if !has_key(s:known_types, a:ftype)
+ if exists('g:tagbar_type_' . a:ftype)
+ " Filetype definition must have been specified in an 'ftplugin'
+ " file, so load it now
+ call s:LoadUserTypeDefs(a:ftype)
+ else
+ call s:debug('Unsupported filetype: ' . a:ftype)
+ return 0
+ endif
+ endif
+
+ return 1
+endfunction
+
+" s:SetStatusLine() {{{2
+function! s:SetStatusLine(current)
+ " Make sure we're actually in the Tagbar window
+ let tagbarwinnr = bufwinnr('__Tagbar__')
+ if tagbarwinnr == -1
+ return
+ endif
+ if tagbarwinnr != winnr()
+ let in_tagbar = 0
+ call s:goto_win(tagbarwinnr)
+ else
+ let in_tagbar = 1
+ endif
+ let current = a:current == 'current'
+
+ let sort = g:tagbar_sort ? 'Name' : 'Order'
+
+ if !empty(s:known_files.getCurrent(0))
+ let fname = fnamemodify(s:known_files.getCurrent(0).fpath, ':t')
+ else
+ let fname = ''
+ endif
+
+ let flags = []
+ let flags += exists('w:autoclose') && w:autoclose ? ['c'] : []
+ let flags += g:tagbar_autoclose ? ['C'] : []
+ let flags += g:tagbar_hide_nonpublic ? ['v'] : []
+
+ if exists('g:tagbar_status_func')
+ let args = [current, sort, fname, flags]
+ let &l:statusline = call(g:tagbar_status_func, args)
+ else
+ let colour = current ? '%#StatusLine#' : '%#StatusLineNC#'
+ let flagstr = join(flags, '')
+ if flagstr != ''
+ let flagstr = '[' . flagstr . '] '
+ endif
+ let text = colour . '[' . sort . '] ' . flagstr . fname
+ let &l:statusline = text
+ endif
+
+ if !in_tagbar
+ call s:goto_win('p')
+ endif
+endfunction
+
+" s:QuitIfOnlyWindow() {{{2
+function! s:QuitIfOnlyWindow() abort
+ let tagbarwinnr = bufwinnr('__Tagbar__')
+ if tagbarwinnr == -1
+ return
+ endif
+
+ let curwinnr = winnr()
+ let prevwinnr = winnr('#') == 0 ? curwinnr : winnr('#')
+ call s:goto_win(tagbarwinnr, 1)
+
+ " Check if there is more than one window
+ if s:NextNormalWindow() == -1
+ " Check if there is more than one tab page
+ if tabpagenr('$') == 1
+ " Before quitting Vim, delete the tagbar buffer so that
+ " the '0 mark is correctly set to the previous buffer.
+ " Also disable autocmd on this command to avoid unnecessary
+ " autocmd nesting.
+ if winnr('$') == 1
+ noautocmd bdelete
+ endif
+ quit
+ else
+ close
+ endif
+ endif
+
+ call s:goto_win(prevwinnr, 1)
+ call s:goto_win(curwinnr, 1)
+endfunction
+
+" s:NextNormalWindow() {{{2
+function! s:NextNormalWindow() abort
+ for i in range(1, winnr('$'))
+ let buf = winbufnr(i)
+
+ " skip unlisted buffers
+ if !buflisted(buf)
+ continue
+ endif
+
+ " skip temporary buffers with buftype set
+ if getbufvar(buf, '&buftype') != ''
+ continue
+ endif
+
+ " skip the preview window
+ if getwinvar(i, '&previewwindow')
+ continue
+ endif
+
+ " skip current window
+ if i == winnr()
+ continue
+ endif
+
+ return i
+ endfor
+
+ return -1
+endfunction
+
+" s:goto_win() {{{2
+function! s:goto_win(winnr, ...) abort
+ let cmd = type(a:winnr) == type(0) ? a:winnr . 'wincmd w'
+ \ : 'wincmd ' . a:winnr
+ let noauto = a:0 > 0 ? a:1 : 0
+
+ call s:debug("goto_win(): " . cmd . ", " . noauto)
+
+ if noauto
+ noautocmd execute cmd
+ else
+ execute cmd
+ endif
+endfunction
+
+" s:goto_tagbar() {{{2
+function! s:goto_tagbar(...) abort
+ let noauto = a:0 > 0 ? a:1 : 0
+ call s:goto_win(bufwinnr('__Tagbar__'), noauto)
+endfunction
+
+" s:mark_window() {{{2
+" Mark window with a window-local variable so we can jump back to it even if
+" the window numbers have changed.
+function! s:mark_window() abort
+ let w:tagbar_mark = 1
+endfunction
+
+" s:goto_markedwin() {{{2
+" Go to a previously marked window and delete the mark.
+function! s:goto_markedwin(...) abort
+ let noauto = a:0 > 0 ? a:1 : 0
+ for window in range(1, winnr('$'))
+ call s:goto_win(window, noauto)
+ if exists('w:tagbar_mark')
+ unlet w:tagbar_mark
+ break
+ endif
+ endfor
+endfunction
+
+" s:warning() {{{2
+function! s:warning(msg) abort
+ echohl WarningMsg
+ echomsg a:msg
+ echohl None
+endfunction
+
+" TagbarBalloonExpr() {{{2
+function! TagbarBalloonExpr() abort
+ let taginfo = s:GetTagInfo(v:beval_lnum, 1)
+
+ if empty(taginfo)
+ return ''
+ endif
+
+ return taginfo.getPrototype(0)
+endfunction
+
+" Debugging {{{1
+" s:StartDebug() {{{2
+function! s:StartDebug(filename) abort
+ if empty(a:filename)
+ let s:debug_file = 'tagbardebug.log'
+ else
+ let s:debug_file = a:filename
+ endif
+
+ " Empty log file
+ exe 'redir! > ' . s:debug_file
+ redir END
+
+ " Check whether the log file could be created
+ if !filewritable(s:debug_file)
+ echomsg 'Tagbar: Unable to create log file ' . s:debug_file
+ let s:debug_file = ''
+ return
+ endif
+
+ let s:debug = 1
+endfunction
+
+" s:StopDebug() {{{2
+function! s:StopDebug() abort
+ let s:debug = 0
+ let s:debug_file = ''
+endfunction
+
+" s:debug() {{{2
+if has('reltime')
+ function! s:gettime() abort
+ let time = split(reltimestr(reltime()), '\.')
+ return strftime('%Y-%m-%d %H:%M:%S.', time[0]) . time[1]
+ endfunction
+else
+ function! s:gettime() abort
+ return strftime('%Y-%m-%d %H:%M:%S')
+ endfunction
+endif
+function! s:debug(msg) abort
+ if s:debug
+ execute 'redir >> ' . s:debug_file
+ silent echon s:gettime() . ': ' . a:msg . "\n"
+ redir END
+ endif
+endfunction
+
+" Autoload functions {{{1
+
+" Wrappers {{{2
+function! tagbar#ToggleWindow() abort
+ call s:ToggleWindow()
+endfunction
+
+function! tagbar#OpenWindow(...) abort
+ let flags = a:0 > 0 ? a:1 : ''
+ call s:OpenWindow(flags)
+endfunction
+
+function! tagbar#CloseWindow() abort
+ call s:CloseWindow()
+endfunction
+
+function! tagbar#SetFoldLevel(level, force) abort
+ call s:SetFoldLevel(a:level, a:force)
+endfunction
+
+function! tagbar#highlighttag(openfolds, force) abort
+ let tagbarwinnr = bufwinnr('__Tagbar__')
+ if tagbarwinnr == -1
+ echohl WarningMsg
+ echomsg "Warning: Can't highlight tag, Tagbar window not open"
+ echohl None
+ return
+ endif
+ call s:HighlightTag(a:openfolds, a:force)
+endfunction
+
+function! tagbar#StartDebug(...) abort
+ let filename = a:0 > 0 ? a:1 : ''
+ call s:StartDebug(filename)
+endfunction
+
+function! tagbar#StopDebug() abort
+ call s:StopDebug()
+endfunction
+
+function! tagbar#RestoreSession() abort
+ call s:RestoreSession()
+endfunction
+
+" }}}2
+
+" tagbar#toggle_pause() {{{2
+function! tagbar#toggle_pause() abort
+ let s:paused = !s:paused
+
+ if s:paused
+ call s:known_files.setPaused()
+ else
+ call s:AutoUpdate(fnamemodify(expand('%'), ':p'), 1)
+ endif
+endfunction
+
+" tagbar#getusertypes() {{{2
+function! tagbar#getusertypes() abort
+ let userdefs = filter(copy(g:), 'v:key =~ "^tagbar_type_"')
+
+ let typedict = {}
+ for [key, val] in items(userdefs)
+ let type = substitute(key, '^tagbar_type_', '', '')
+ let typedict[type] = val
+ endfor
+
+ return typedict
+endfunction
+
+" tagbar#autoopen() {{{2
+" Automatically open Tagbar if one of the open buffers contains a supported
+" file
+function! tagbar#autoopen(...) abort
+ call s:debug('tagbar#autoopen called [' . bufname('%') . ']')
+ let always = a:0 > 0 ? a:1 : 1
+
+ call s:Init(0)
+
+ for bufnr in range(1, bufnr('$'))
+ if buflisted(bufnr) && (always || bufwinnr(bufnr) != -1)
+ let ftype = s:DetectFiletype(bufnr)
+ if s:IsValidFile(bufname(bufnr), ftype)
+ call s:OpenWindow('')
+ call s:debug('tagbar#autoopen finished after finding valid ' .
+ \ 'file [' . bufname(bufnr) . ']')
+ return
+ endif
+ endif
+ endfor
+
+ call s:debug('tagbar#autoopen finished without finding valid file')
+endfunction
+
+" tagbar#currenttag() {{{2
+function! tagbar#currenttag(fmt, default, ...) abort
+ " Indicate that the statusline functionality is being used. This prevents
+ " the CloseWindow() function from removing the autocommands.
+ let s:statusline_in_use = 1
+
+ if a:0 > 0
+ " also test for non-zero value for backwards compatibility
+ let longsig = a:1 =~# 's' || (type(a:1) == type(0) && a:1 != 0)
+ let fullpath = a:1 =~# 'f'
+ let prototype = a:1 =~# 'p'
+ else
+ let longsig = 0
+ let fullpath = 0
+ let prototype = 0
+ endif
+
+ if !s:Init(1)
+ return a:default
+ endif
+
+ let tag = s:GetNearbyTag(0, 1)
+
+ if !empty(tag)
+ if prototype
+ return tag.getPrototype(1)
+ else
+ return printf(a:fmt, tag.str(longsig, fullpath))
+ endif
+ else
+ return a:default
+ endif
+endfunction
+
+" tagbar#currentfile() {{{2
+function! tagbar#currentfile() abort
+ let filename = ''
+
+ if !empty(s:known_files.getCurrent(1))
+ let filename = fnamemodify(s:known_files.getCurrent(1).fpath, ':t')
+ endif
+
+ return filename
+endfunction
+
+" tagbar#gettypeconfig() {{{2
+function! tagbar#gettypeconfig(type) abort
+ if !s:Init(1)
+ return ''
+ endif
+
+ let typeinfo = get(s:known_types, a:type, {})
+
+ if empty(typeinfo)
+ call s:warning('Unknown type ' . a:type . '!')
+ return
+ endif
+
+ let output = "let g:tagbar_type_" . a:type . " = {\n"
+
+ let output .= " \\ 'kinds' : [\n"
+ for kind in typeinfo.kinds
+ let output .= " \\ '" . kind.short . ":" . kind.long
+ if kind.fold || !kind.stl
+ if kind.fold
+ let output .= ":1"
+ else
+ let output .= ":0"
+ endif
+ endif
+ if !kind.stl
+ let output .= ":0"
+ endif
+ let output .= "',\n"
+ endfor
+ let output .= " \\ ],\n"
+
+ let output .= "\\ }"
+
+ silent put =output
+endfunction
+
+" tagbar#inspect() {{{2
+function! tagbar#inspect(var) abort
+ return get(s:, a:var)
+endfunction
+
+" Modeline {{{1
+" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
diff --git a/vim/bundle/tagbar/doc/tagbar.txt b/vim/bundle/tagbar/doc/tagbar.txt
new file mode 100644
index 0000000..898cdcc
--- /dev/null
+++ b/vim/bundle/tagbar/doc/tagbar.txt
@@ -0,0 +1,1508 @@
+*tagbar.txt* Display tags of a file ordered by scope
+
+Author: Jan Larres <jan@majutsushi.net>
+Licence: Vim licence, see |license|
+Homepage: http://majutsushi.github.com/tagbar/
+Version: 2.6.1
+
+==============================================================================
+Contents *tagbar* *tagbar-contents*
+
+ 1. Intro ........................... |tagbar-intro|
+ Pseudo-tags ................... |tagbar-pseudotags|
+ Supported features ............ |tagbar-features|
+ Other ctags-compatible programs |tagbar-other|
+ 2. Requirements .................... |tagbar-requirements|
+ 3. Installation .................... |tagbar-installation|
+ 4. Usage ........................... |tagbar-usage|
+ Commands ...................... |tagbar-commands|
+ Key mappings .................. |tagbar-keys|
+ 5. Configuration ................... |tagbar-configuration|
+ Highlight colours ............. |tagbar-highlight|
+ Automatically opening Tagbar .. |tagbar-autoopen|
+ Show current tag in statusline |tagbar-statusline|
+ Ignoring specific files ....... |tagbar-ignore|
+ 6. Extending Tagbar ................ |tagbar-extend|
+ 7. Troubleshooting & Known issues .. |tagbar-issues|
+ 8. History ......................... |tagbar-history|
+ 9. Todo ............................ |tagbar-todo|
+ 10. Credits ......................... |tagbar-credits|
+
+==============================================================================
+1. Intro *tagbar-intro*
+
+Tagbar is a plugin for browsing the tags of source code files. It provides a
+sidebar that displays the ctags-generated tags of the current file, ordered by
+their scope. This means that for example methods in C++ are displayed under
+the class they are defined in.
+
+Let's say we have the following code inside of a C++ file:
+>
+ namespace {
+ char a;
+
+ class Foo
+ {
+ public:
+ Foo();
+ ~Foo();
+ private:
+ int var;
+ };
+ };
+<
+Then Tagbar would display the tag information like so:
+>
+ __anon1* : namespace
+ Foo : class
+ +Foo()
+ +~Foo()
+ -var
+ a
+<
+This example shows several important points. First, the tags are listed
+indented below the scope they are defined in. Second, the type of a scope is
+listed after its name and a colon. Third, tags for which the visibility
+information is known are prefixed with a symbol indicating that.
+
+------------------------------------------------------------------------------
+PSEUDO-TAGS *tagbar-pseudotags*
+
+The example also introduces the concept of "pseudo-tags". Pseudo-tags are tags
+that are not explicitly defined in the file but have children in it. In this
+example the namespace doesn't have a name and thus ctags doesn't generate a
+tag for it, but since it has children it still needs to be displayed using an
+auto-generated name.
+
+Another case where pseudo-tags appear is in C++ implementation files. Since
+classes are usually defined in a header file but the member methods and
+variables in the implementation file the class itself won't generate a tag
+in that file.
+
+Since pseudo-tags don't really exist they cannot be jumped to from the Tagbar
+window.
+
+Pseudo-tags are denoted with an asterisk ('*') at the end of their name.
+
+------------------------------------------------------------------------------
+SUPPORTED FEATURES *tagbar-features*
+
+The following features are supported by Tagbar:
+
+ - Display tags under their correct scope.
+ - Automatically update the tags when switching between buffers and editing
+ files.
+ - Display visibility information of tags if available.
+ - Highlight the tag near the cursor while editing files.
+ - Jump to a tag from the Tagbar window.
+ - Display the complete prototype of a tag.
+ - Tags can be sorted either by name or order of appearance in the file.
+ - Scopes can be folded to hide uninteresting information.
+ - Supports all of the languages that ctags does, i.e. Ant, Assembler, ASP,
+ Awk, Basic, BETA, C, C++, C#, COBOL, DosBatch, Eiffel, Erlang, Flex,
+ Fortran, HTML, Java, JavaScript, Lisp, Lua, Make, MatLab, OCaml, Pascal,
+ Perl, PHP, Python, REXX, Ruby, Scheme, Shell script, SLang, SML, SQL, Tcl,
+ Tex, Vera, Verilog, VHDL, Vim and YACC.
+ - Can be extended to support arbitrary new types.
+
+------------------------------------------------------------------------------
+OTHER CTAGS-COMPATIBLE PROGRAMS *tagbar-other*
+
+Tagbar also supports filetype-specific programs that can produce
+ctags-compatible output, as long as these programs can write to the standard
+output. Tagbar has been tested with doctorjs/jsctags and will use that if
+present, other programs require some configuration (see |tagbar-extend|). If a
+program does not work even with correct configuration please contact me.
+
+Note: Please check |tagbar-issues| for some potential issues with jsctags.
+
+==============================================================================
+2. Requirements *tagbar-requirements*
+
+The following requirements have to be met in order to be able to use tagbar:
+
+ - Vim 7.0 or higher. Older versions will not work since Tagbar uses data
+ structures that were only introduced in Vim 7.
+ - Exuberant ctags 5.5 or higher. Ctags is the program that generates the
+ tag information that Tagbar uses. It is shipped with most Linux
+ distributions, otherwise it can be downloaded from the following
+ website:
+
+ http://ctags.sourceforge.net/
+
+ Tagbar will work on any platform that ctags runs on -- this includes
+ UNIX derivatives, Mac OS X and Windows. Note that other versions like
+ BSD ctags will not work.
+ Tagbar generates the tag information by itself and doesn't need (or use)
+ already existing tag files.
+ - File type detection must be turned on in vim. This can be done with the
+ following command in your vimrc:
+>
+ filetype on
+<
+ See |filetype| for more information.
+ - Tagbar will not work in |restricted-mode| or with 'compatible' set.
+
+==============================================================================
+3. Installation *tagbar-installation*
+
+Use the normal Vimball install method for installing tagbar.vba:
+>
+ vim tagbar.vba
+ :so %
+ :q
+<
+Alternatively you can clone the git repository and then add the path to
+'runtimepath' or use the pathogen plugin. Don't forget to run |:helptags|.
+
+If the ctags executable is not installed in one of the directories in your
+$PATH environment variable you have to set the g:tagbar_ctags_bin variable,
+see |g:tagbar_ctags_bin|.
+
+==============================================================================
+4. Usage *tagbar-usage*
+
+There are essentially two ways to use Tagbar:
+
+ 1. Have it running all the time in a window on the side of the screen. In
+ this case Tagbar will update its contents whenever the source file is
+ changed and highlight the tag the cursor is currently on in the file. If
+ a tag is selected in Tagbar the file window will jump to the tag and the
+ Tagbar window will stay open. |g:tagbar_autoclose| has to be unset for
+ this mode.
+ 2. Only open Tagbar when you want to jump to a specific tag and have it
+ close automatically once you have selected one. This can be useful for
+ example for small screens where a permanent window would take up too much
+ space. You have to set the option |g:tagbar_autoclose| in this case. The
+ cursor will also automatically jump to the Tagbar window when opening it.
+
+Opening and closing the Tagbar window~
+Use |:TagbarOpen| or |:TagbarToggle| to open the Tagbar window if it is
+closed. By default the window is opened on the right side, set the option
+|g:tagbar_left| to open it on the left instead. If the window is already open,
+|:TagbarOpen| will jump to it and |:TagbarToggle| will close it again.
+|:TagbarClose| will simply close the window if it is open.
+
+It is probably a good idea to assign a key to these commands. For example, put
+this into your |vimrc|:
+>
+ nnoremap <silent> <F9> :TagbarToggle<CR>
+<
+You can then open and close Tagbar by simply pressing the <F9> key.
+
+You can also use |:TagbarOpenAutoClose| to open the Tagbar window, jump to it
+and have it close automatically on tag selection regardless of the
+|g:tagbar_autoclose| setting.
+
+Pausing the Tagbar window~
+Use |:TagbarTogglePause| to toggle freezing/locking the Tagbar window on its
+currently displayed file. Freezing the window stops the Tagbar contents from
+changing when switching to a different source file. All Tagbar functionality
+continues to work as expected. Unfreezing the window will cause it to load the
+current source file.
+
+Jumping to tags~
+When you're inside the Tagbar window you can jump to the definition of a tag
+by moving the cursor to a tag and pressing <Enter> or double-clicking on it
+with the mouse. The source file will then move to the definition and put the
+cursor in the corresponding line. This won't work for pseudo-tags.
+
+Sorting~
+You can sort the tags in the Tagbar window in two ways: by name or by file
+order. Sorting them by name simply displays the tags in their alphabetical
+order under their corresponding scope. Sorting by file order means that the
+tags keep the order they have in the source file, but are still associated
+with the correct scope. You can change the sort order by pressing the "s" key
+in the Tagbar window. The current sort order is displayed in the statusline of
+the Tagbar window.
+
+Folding~
+The displayed scopes (and unscoped types) can be folded to hide uninteresting
+information. Mappings similar to Vim's built-in ones are provided. Folds can
+also be opened and closed by clicking on the fold icon with the mouse.
+
+Highlighting the current tag~
+When the Tagbar window is open the current tag will automatically be
+highlighted in it after a short pause if the cursor is not moving. The length
+of this pause is determined by the 'updatetime' option. If you want to make
+that pause shorter you can change the option, but don't set it too low or
+strange things will happen. This is unfortunately unavoidable.
+
+Displaying the prototype of a tag~
+Tagbar can display the prototype of a tag. More precisely it can display the
+line(s) in which the tag is defined. This can be done by either pressing
+<Space> when on a tag or hovering over a tag with the mouse. In the former
+case the prototype will be displayed in the |Command-line|, in the latter case
+it will be displayed in a pop-up window. The prototype will also be displayed
+if the cursor stays on a tag for 'updatetime' milliseconds. In that case the
+prototype may be abbreviated in order to avoid |hit-enter| prompts.
+
+------------------------------------------------------------------------------
+COMMANDS *tagbar-commands*
+
+:TagbarOpen [{flags}] *:TagbarOpen*
+ Open the Tagbar window if it is closed.
+
+ Additional behaviour can be specified with the optional {flags} argument.
+ It is a string which can contain these character flags:
+ 'f' Jump to Tagbar window when opening (just as if |g:tagbar_autofocus|
+ were set to 1)
+ 'j' Jump to Tagbar window if already open
+ 'c' Close Tagbar on tag selection (just as if |g:tagbar_autoclose| were
+ set to 1, but doesn't imply 'f'), but only if the Tagbar window was
+ opened using this command. If this is used the "c" flag will be
+ shown in the statusline of the Tagbar window.
+
+ For example, the following command would always jump to the Tagbar window,
+ opening it first if necessary, but keep it open after selecting a tag
+ (unless |g:tagbar_autoclose| is set): >
+ :TagbarOpen fj
+<
+:TagbarClose *:TagbarClose*
+ Close the Tagbar window if it is open.
+
+:TagbarToggle *:TagbarToggle*
+:Tagbar
+ Open the Tagbar window if it is closed, or close it if it is open.
+
+:TagbarOpenAutoClose *:TagbarOpenAutoClose*
+ Open the Tagbar window, jump to it and close it on tag selection. This is
+ an alias for ":TagbarOpen fjc".
+
+:TagbarTogglePause *:TagbarTogglePause*
+ Freezes/Unfreezes the Tagbar window. Stops the contents of the window
+ from changing when a different source file is selected.
+
+:TagbarSetFoldlevel[!] {number} *:TagbarSetFoldlevel*
+ Set the foldlevel of the tags of the current file to {number}. The
+ foldlevel of tags in other files remains unaffected. Works in the same way
+ as 'foldlevel'. Folds that are specified to be closed by default in the
+ type configuration will not be opened, use a "!" to force applying the new
+ foldlevel to those folds as well.
+
+:TagbarShowTag *:TagbarShowTag*
+ Open the parent folds of the current tag in the file window as much as
+ needed for the tag to be visible in the Tagbar window.
+
+:TagbarCurrentTag [{flags}] *:TagbarCurrentTag*
+ Echo the current tag in the command line. For {flags} see
+ |tagbar-statusline|.
+
+:TagbarGetTypeConfig {filetype} *:TagbarGetTypeConfig*
+ Paste the Tagbar configuration of the vim filetype {filetype} at the
+ current cursor position (provided that filetype is supported by Tagbar)
+ for easy customization. The configuration will be ready to use as is but
+ will only contain the "kinds" entry as that is the only one that really
+ makes sense to customize. See |tagbar-extend| for more information about
+ type configurations.
+
+:TagbarDebug [logfile] *:TagbarDebug*
+ Start debug mode. This will write debug messages to file [logfile] while
+ using Tagbar. If no argument is given "tagbardebug.log" in the current
+ directory is used. Note: an existing file will be overwritten!
+ Note also that it is usually necessary to call this command before loading
+ a file that creates problems in order to get all of the needed data.
+
+:TagbarDebugEnd *:TagbarDebugEnd*
+ End debug mode, debug messages will no longer be written to the logfile.
+
+------------------------------------------------------------------------------
+KEY MAPPINGS *tagbar-keys*
+
+The following mappings are valid in the Tagbar window:
+
+<F1>/? Display key mapping help.
+ Map option: tagbar_map_help
+<CR>/<Enter> Jump to the tag under the cursor. Doesn't work for pseudo-tags
+ or generic headers.
+ Map option: tagbar_map_jump
+p Jump to the tag under the cursor, but stay in the Tagbar window.
+ Map option: tagbar_map_preview
+P Open the tag in a |preview-window|.
+ Map option: tagbar_map_previewwin
+<LeftMouse> When on a fold icon, open or close the fold depending on the
+ current state.
+<2-LeftMouse> Same as <CR>. See |g:tagbar_singleclick| if you want to use a
+ single- instead of a double-click.
+<C-N> Go to the next top-level tag.
+ Map option: tagbar_map_nexttag
+<C-P> Go to the previous top-level tag.
+ Map option: tagbar_map_prevtag
+<Space> Display the prototype of the current tag (i.e. the line defining
+ it) in the command line.
+ Map option: tagbar_map_showproto
+v Hide tags that are declared non-public. Tags without any
+ visibility information will still be shown.
+ Map option: tagbar_map_hidenonpublic
++/zo Open the fold under the cursor.
+ Map option: tagbar_map_openfold
+-/zc Close the fold under the cursor or the current one if there is
+ no fold under the cursor.
+ Map option: tagbar_map_closefold
+o/za Toggle the fold under the cursor or the current one if there is
+ no fold under the cursor.
+ Map option: tagbar_map_togglefold
+*/zR Open all folds by setting foldlevel to 99.
+ Map option: tagbar_map_openallfolds
+=/zM Close all folds by setting foldlevel to 0.
+ Map option: tagbar_map_closeallfolds
+zj Go to the start of the next fold, like the standard Vim |zj|.
+ Map option: tagbar_map_nextfold
+zk Go to the end of the previous fold, like the standard Vim |zk|.
+ Map option: tagbar_map_prevfold
+s Toggle sort order between name and file order.
+ Map option: tagbar_map_togglesort
+c Toggle the |g:tagbar_autoclose| option.
+ Map option: tagbar_map_toggleautoclose
+x Toggle zooming the window.
+ Map option: tagbar_map_zoomwin
+q Close the Tagbar window.
+ Map option: tagbar_map_close
+
+These mappings can be redefined with the given map options. The argument can
+be either a string or a |List| of strings. In the latter case the
+functionality will be assigned to all of the keys in the list. For example, if
+you want to remap the sort toggling functionality to "r":
+>
+ let g:tagbar_map_togglesort = "r"
+<
+See |key-notation| for how to write special keys like <Space> or the keypad
+keys.
+
+==============================================================================
+5. Configuration *tagbar-configuration*
+
+ *g:tagbar_ctags_bin*
+g:tagbar_ctags_bin~
+Default: empty
+
+Use this option to specify the location of your ctags executable. Only needed
+if it is not in one of the directories in your $PATH environment variable.
+
+Example:
+>
+ let g:tagbar_ctags_bin = 'C:\Ctags5.8\ctags.exe'
+<
+
+ *g:tagbar_left*
+g:tagbar_left~
+Default: 0
+
+By default the Tagbar window will be opened on the right-hand side of vim. Set
+this option to open it on the left instead.
+
+If |g:tagbar_vertical| is used then setting this variable will open the Tagbar
+window at the top, otherwise it will open at the bottom.
+
+Example:
+>
+ let g:tagbar_left = 1
+<
+
+ *g:tagbar_vertical*
+g:tagbar_vertical~
+Default: 0
+
+If this is set to a positive value then the Tagbar window will be opened at
+the top or bottom of the Vim window instead of at the side. This can be useful
+for monitors that have been rotated into a vertical position. The value of
+this variable will determine the number of lines to use for the Tagbar window.
+See |g:tagbar_left| for configuring the position of the window.
+
+Example:
+>
+ let g:tagbar_vertical = 30
+<
+
+ *g:tagbar_width*
+g:tagbar_width~
+Default: 40
+
+Width of the Tagbar window in characters.
+
+Example:
+>
+ let g:tagbar_width = 30
+<
+
+ *g:tagbar_zoomwidth*
+g:tagbar_zoomwidth~
+Default: 1
+
+Width of the Tagbar window when zoomed.
+
+Possible values are:
+ 1: Use the maximum width available.
+ 0: Use the width of the longest currently visible tag.
+ >1: Use this width in characters.
+
+Example:
+>
+ let g:tagbar_zoomwidth = 0
+<
+
+ *g:tagbar_autoclose*
+g:tagbar_autoclose~
+Default: 0
+
+If you set this option the Tagbar window will automatically close when you
+jump to a tag. This implies |g:tagbar_autofocus|. If enabled the "C" flag will
+be shown in the statusline of the Tagbar window. This can also be toggled with
+a key, see |tagbar-keys|.
+
+Example:
+>
+ let g:tagbar_autoclose = 1
+<
+
+ *g:tagbar_autofocus*
+g:tagbar_autofocus~
+Default: 0
+
+If you set this option the cursor will move to the Tagbar window when it is
+opened.
+
+Example:
+>
+ let g:tagbar_autofocus = 1
+<
+
+ *g:tagbar_sort*
+g:tagbar_sort~
+Default: 1
+
+If this option is set the tags are sorted according to their name. If it is
+unset they are sorted according to their order in the source file. Note that
+in the second case Pseudo-tags are always sorted before normal tags of the
+same kind since they don't have a real position in the file.
+
+Example:
+>
+ let g:tagbar_sort = 0
+<
+
+ *g:tagbar_compact*
+g:tagbar_compact~
+Default: 0
+
+Setting this option will result in Tagbar omitting the short help at the
+top of the window and the blank lines in between top-level scopes in order to
+save screen real estate.
+
+Example:
+>
+ let g:tagbar_compact = 1
+<
+
+ *g:tagbar_indent*
+g:tagbar_indent~
+Default: 2
+
+The number of spaces by which each level is indented. This allows making the
+display more compact or more spacious.
+
+Example:
+>
+ let g:tagbar_indent = 1
+<
+
+ *g:tagbar_show_visibility*
+g:tagbar_show_visibility~
+Default: 1
+
+Show the visibility symbols (public/protected/private) to the left of the tag
+name.
+
+Example:
+>
+ let g:tagbar_show_visibility = 0
+<
+
+ *g:tagbar_show_linenumbers*
+g:tagbar_show_linenumbers~
+Default: 0
+
+Whether line numbers should be shown in the Tagbar window.
+
+Possible values are:
+ 0: Don't show any line numbers.
+ 1: Show absolute line numbers.
+ 2: Show relative line numbers.
+ -1: Use the global line number settings.
+
+Example:
+>
+ let g:tagbar_show_linenumbers = 2
+<
+
+ *g:tagbar_hide_nonpublic*
+g:tagbar_hide_nonpublic~
+Default: 0
+
+Hide tags that are declared non-public. Tags without any visibility
+information will still be shown. If enabled the "v" flag will be shown in the
+statusline of the Tagbar window. This can also be toggled with a key, see
+|tagbar-keys|.
+
+Example:
+>
+ let g:tagbar_hide_nonpublic = 1
+<
+
+ *g:tagbar_expand*
+g:tagbar_expand~
+Default: 0
+
+If this option is set to 1 the Vim window will be expanded by the width of the
+Tagbar window if using a GUI version of Vim. Setting it to 2 will also try
+expanding a terminal, but note that this is not supported by all terminals.
+See also |xterm-resize|.
+
+Example:
+>
+ let g:tagbar_expand = 1
+<
+
+ *g:tagbar_singleclick*
+g:tagbar_singleclick~
+Default: 0
+
+If this option is set then a single- instead of a double-click is used to jump
+to the tag definition.
+
+Example:
+>
+ let g:tagbar_singleclick = 1
+<
+
+ *g:tagbar_foldlevel*
+g:tagbar_foldlevel~
+Default: 99
+
+The initial foldlevel for folds in the Tagbar window. Folds with a level
+higher than this number will be closed.
+
+Example:
+>
+ let g:tagbar_foldlevel = 2
+<
+
+ *g:tagbar_iconchars*
+g:tagbar_iconchars~
+
+Since the display of the icons used to indicate open or closed folds depends
+on the actual font used, different characters may be optimal for different
+fonts. With this variable you can set the icons to characters of your liking.
+The first character in the list specifies the icon to use for a closed fold,
+and the second one for an open fold.
+
+Examples (don't worry if some of the characters aren't displayed correctly,
+just choose other characters in that case):
+>
+ let g:tagbar_iconchars = ['▶', '▼'] (default on Linux and Mac OS X)
+ let g:tagbar_iconchars = ['▸', '▾']
+ let g:tagbar_iconchars = ['▷', '◢']
+ let g:tagbar_iconchars = ['+', '-'] (default on Windows)
+<
+
+ *g:tagbar_autoshowtag*
+g:tagbar_autoshowtag~
+Default: 0
+
+If this variable is set to 1 and the current tag is inside of a closed fold
+then the folds will be opened as much as needed for the tag to be visible so
+it can be highlighted. If it is set to 0 then the folds will only be opened
+when opening the Tagbar window and the current tag is inside a closed fold,
+otherwise the folds won't be opened and the parent tag will be highlighted
+instead. If it is set to 2 then the folds will never be opened automatically.
+
+You can use the |:TagbarShowTag| command to open the folds manually.
+
+Example:
+>
+ let g:tagbar_autoshowtag = 1
+<
+
+ *g:tagbar_previewwin_pos*
+g:tagbar_previewwin_pos~
+Default: "topleft", or "rightbelow vertical" if |g:tagbar_vertical| is set
+
+The position of the preview window. Valid values are the window splitting
+commands that are described starting from |:vertical|. Set it to an empty
+string to use the options 'splitbelow' and 'splitright'.
+
+Example:
+>
+ let g:tagbar_previewwin_pos = "aboveleft"
+<
+If you want to disable line numbers in the preview window put something like
+this into your vimrc:
+>
+ autocmd BufWinEnter * if &previewwindow | setlocal nonumber | endif
+<
+
+ *g:tagbar_autopreview*
+g:tagbar_autopreview~
+Default: 0
+
+If this variable is set to 1 then moving the cursor in the Tagbar window will
+automatically show the current tag in the preview window.
+
+Example:
+>
+ let g:tagbar_autopreview = 1
+<
+
+ *g:tagbar_updateonsave_maxlines*
+g:tagbar_updateonsave_maxlines~
+
+Deprecated. Tagbar will now always get updated when the file is being saved.
+
+
+ *g:tagbar_systemenc*
+g:tagbar_systemenc~
+Default: value of 'encoding'
+
+This variable is for cases where the character encoding of your operating
+system is different from the one set in Vim, i.e. the 'encoding' option. For
+example, if you use a Simplified Chinese Windows version that has a system
+encoding of "cp936", and you have set 'encoding' to "utf-8", then you would
+have to set this variable to "cp936".
+Note that this requires Vim to be compiled with the |+multi_byte| and |+iconv|
+features to work.
+
+Example:
+>
+ let g:tagbar_systemenc = 'cp936'
+<
+
+ *g:tagbar_status_func*
+g:tagbar_status_func~
+Default: undefined
+
+This is the name of a function whose return value will be used to draw the
+statusline of the Tagbar window.
+
+The function has to take four arguments:
+ 1. current: Whether Tagbar is the current window; 0 or 1.
+ 2. sort: The sort order of the tags; 'Name' if they are sorted by name and
+ 'Order' if they are sorted by their order of appearance in the file.
+ 3. fname: The name of the file that the tags belong to.
+ 4. flags: A list of characters that represent various state in the Tagbar
+ window.
+
+In order to avoid possible future additions to the arguments resulting in an
+error it is recommended to add an additional vararg to the signature (see
+|a:0|).
+
+Here is an example that, when put into your vimrc, will emulate Tagbar's
+default statusline:
+>
+ function! TagbarStatusFunc(current, sort, fname, flags, ...) abort
+ let colour = a:current ? '%#StatusLine#' : '%#StatusLineNC#'
+ let flagstr = join(flags, '')
+ if flagstr != ''
+ let flagstr = '[' . flagstr . '] '
+ endif
+ return colour . '[' . sort . '] ' . flagstr . fname
+ endfunction
+ let g:tagbar_status_func = 'TagbarStatusFunc'
+<
+
+------------------------------------------------------------------------------
+HIGHLIGHT COLOURS *tagbar-highlight*
+
+All of the colours used by Tagbar can be customized. Here is a list of the
+highlight groups that are defined by Tagbar:
+
+TagbarComment
+ The help at the top of the buffer.
+
+TagbarKind
+ The header of generic "kinds" like "functions" and "variables".
+
+TagbarNestedKind
+ The "kind" headers in square brackets inside of scopes.
+
+TagbarScope
+ Tags that define a scope like classes, structs etc.
+
+TagbarType
+ The type of a tag or scope if available.
+
+TagbarSignature
+ Function signatures.
+
+TagbarPseudoID
+ The asterisk (*) that signifies a pseudo-tag.
+
+TagbarFoldIcon
+ The fold icon on the left of foldable tags.
+
+TagbarHighlight
+ The colour that is used for automatically highlighting the current tag.
+
+TagbarVisibilityPublic
+ The "public" visibility symbol.
+
+TagbarVisibilityProtected
+ The "protected" visibility symbol.
+
+TagbarVisibilityPrivate
+ The "private" visibility symbol.
+
+If you want to change any of those colours put a line like the following in
+your vimrc:
+>
+ highlight TagbarScope guifg=Green ctermfg=Green
+<
+See |:highlight| for more information.
+
+------------------------------------------------------------------------------
+AUTOMATICALLY OPENING TAGBAR *tagbar-autoopen*
+
+Since there are several different situations in which you might want to open
+Tagbar automatically there is no single option to enable automatic opening.
+Instead, autocommands can be used together with a convenience function that
+opens Tagbar only if a supported file is open(ed). It has a boolean parameter
+that specifies whether Tagbar should be opened if any loaded buffer is
+supported (in case the parameter is set to true) or only if a supported
+file/buffer is currently being shown in a window. This can be useful if you
+use multiple tabs and don't edit supported files in all of them.
+
+If you want to open Tagbar automatically on Vim startup no matter what put
+this into your vimrc:
+>
+ autocmd VimEnter * nested :TagbarOpen
+<
+If you want to open it only if you're opening Vim with a supported file/files
+use this instead:
+>
+ autocmd VimEnter * nested :call tagbar#autoopen(1)
+<
+The above is exactly what the Taglist plugin does if you set the
+Tlist_Auto_Open option, in case you want to emulate this behaviour.
+
+For opening Tagbar also if you open a supported file in an already running
+Vim:
+>
+ autocmd FileType * nested :call tagbar#autoopen(0)
+<
+If you use multiple tabs and want Tagbar to also open in the current tab when
+you switch to an already loaded, supported buffer:
+>
+ autocmd BufEnter * nested :call tagbar#autoopen(0)
+<
+And if you want to open Tagbar only for specific filetypes, not for all of the
+supported ones:
+>
+ autocmd FileType c,cpp nested :TagbarOpen
+<
+Check out |autocmd.txt| if you want it to open automatically in more
+complicated cases.
+
+------------------------------------------------------------------------------
+SHOWING THE CURRENT TAG IN THE STATUSLINE *tagbar-statusline*
+
+You can show the current tag in the 'statusline', or in any other place that
+you want to, by calling the tagbar#currenttag() function. The current tag is
+exactly the same as would be highlighted in the Tagbar window if it is open.
+It is defined as the nearest tag upwards in the file starting from the cursor
+position. This means that for example in a function it should usually be the
+name of the function. You can define which tags will be shown in this manner,
+read |tagbar-extend| (especially the "kinds" entry) on how to do that.
+
+The function has the following signature:
+
+tagbar#currenttag({format}, {default} [, {flags}])
+ {format} is a |printf()|-compatible format string where "%s" will be
+ replaced by the name of the tag. {default} will be displayed instead of
+ the format string if no tag can be found.
+
+ The optional {flags} argument specifies some additional properties of the
+ displayed tags. It is a string which can contain these character flags:
+ 'f' Display the full hierarchy of the tag, not just the tag itself.
+ 's' If the tag is a function, the complete signature will be shown,
+ otherwise just "()" will be appended to distinguish functions from
+ other tags.
+ 'p' Display the raw prototype instead of the parsed tag. This can be
+ useful in cases where ctags doesn't report some information, like
+ the signature. Note that this can get quite long.
+
+ For example, if you put the following into your statusline: >
+ %{tagbar#currenttag('[%s] ','')}
+< then the function "myfunc" will be shown as "[myfunc()] ".
+
+Note that if there is an error when processing the current file no error
+message will be shown in order to not disrupt the statusline. If the function
+doesn't seem to work right open the Tagbar window to see any error messages.
+
+------------------------------------------------------------------------------
+IGNORING SPECIFIC FILES *tagbar-ignore*
+
+You can ignore specific files by setting the |buffer-variable|
+"b:tagbar_ignore" to 1. This is best done with an |autocommand|:
+>
+ autocmd BufNewFile,BufReadPost foo.cpp let b:tagbar_ignore = 1
+<
+Note that autocommands are order-sensitive, so make sure that this autocommand
+gets defined before the ones that Tagbar defines so the variable will get
+found at the right time.
+
+==============================================================================
+6. Extending Tagbar *tagbar-extend*
+
+Tagbar has a flexible mechanism for extending the existing file type (i.e.
+language) definitions. This can be used both to change the settings of the
+existing types and to add completely new types. For Tagbar to support a
+filetype two things are needed: a program that generates the tag information,
+usually Exuberant Ctags, and a Tagbar type definition in your |vimrc| or an
+|ftplugin| that tells Tagbar how to interpret the generated tags.
+
+Note: if you only want to customize an existing definition (like changing the
+order in which tag kinds are displayed) see "Changing an existing definition"
+below.
+
+There are two ways to generate the tag information for new filetypes: add a
+definition to Exuberant Ctags or create a specialized program for your
+language that generates ctags-compatible tag information (see
+|tags-file-format| for information about how a "tags" file is structured). The
+former allows simple regular expression-based parsing that is easy to get
+started with, but doesn't support scopes unless you instead want to write a
+C-based parser module for Exuberant Ctags. The regex approach is described in
+more detail below.
+Writing your own program is the approach used by for example jsctags and can
+be useful if your language can best be parsed by a program written in the
+language itself, or if you want to provide the program as part of a complete
+support package for the language. Some tips on how to write such a program are
+given at the end of this section.
+
+Before writing your own extension have a look at the wiki
+(https://github.com/majutsushi/tagbar/wiki) or try googling for existing ones.
+If you do end up creating your own extension please consider adding it to the
+wiki so that others can benefit from it, too.
+
+Every type definition in Tagbar is a dictionary with the following keys:
+
+ctagstype: The name of the language as recognized by ctags. Use the command >
+ ctags --list-languages
+< to get a list of the languages ctags supports. The case doesn't
+ matter.
+kinds: A list of the "language kinds" that should be listed in Tagbar,
+ ordered by the order they should appear in in the Tagbar window.
+ Use the command >
+ ctags --list-kinds={language name}
+< to get a list of the kinds ctags supports for a given language. An
+ entry in this list is a colon-separated string with the following
+ syntax: >
+ {short}:{long}[:{fold}[:{stl}]]
+< {short} is the one-character abbreviation that ctags uses, and
+ {long} is an arbitrary string that will be used in Tagbar as the
+ header for the the tags of this kind that are not listed under a
+ specific scope. {fold} determines whether tags of this kind should
+ be folded by default, with 1 meaning they should be folded and 0
+ they should not. If this part is omitted the tags will not be
+ folded by default. {stl} is used by the tagbar#currenttag()
+ function (see |tagbar-statusline|) to decide whether tags of this
+ kind should be shown in the statusline or not, with 1 meaning they
+ will be shown and 0 meaning they will be ignored. Omitting this
+ part means that the tags will be shown. Note that you have to
+ specify {fold} too if you want to specify {stl}.
+ For example, the string >
+ "f:functions:1"
+< would list all the function definitions in a file under the header
+ "functions", fold them, and implicitly show them in the statusline
+ if tagbar#currenttag() is used.
+sro: The scope resolution operator. For example, in C++ it is "::" and
+ in Java it is ".". If in doubt run ctags as shown below and check
+ the output.
+kind2scope: A dictionary describing the mapping of tag kinds (in their
+ one-character representation) to the scopes their children will
+ appear in, for example classes, structs etc.
+ Unfortunately there is no ctags option to list the scopes, you
+ have to look at the tags ctags generates manually. For example,
+ let's say we have a C++ file "test.cpp" with the following
+ contents: >
+ class Foo
+ {
+ public:
+ Foo();
+ ~Foo();
+ private:
+ int var;
+ };
+< We then run ctags in the following way: >
+ ctags -f - --format=2 --excmd=pattern --extra= --fields=nksaSmt test.cpp
+< Then the output for the variable "var" would look like this: >
+ var tmp.cpp /^ int var;$/;" kind:m line:11 class:Foo access:private
+< This shows that the scope name for an entry in a C++ class is
+ simply "class". So this would be the word that the "kind"
+ character of a class has to be mapped to.
+scope2kind: The opposite of the above, mapping scopes to the kinds of their
+ parents. Most of the time it is the exact inverse of the above,
+ but in some cases it can be different, for example when more than
+ one kind maps to the same scope. If it is the exact inverse for
+ your language you only need to specify one of the two keys.
+replace: If you set this entry to 1 your definition will completely replace
+{optional} an existing default definition. This is useful if you want to
+ disable scopes for a file type for some reason. Note that in this
+ case you have to provide all the needed entries yourself!
+sort: This entry can be used to override the global sort setting for
+{optional} this specific file type. The meaning of the value is the same as
+ with the global setting, that is if you want to sort tags by name
+ set it to 1 and if you want to sort them according to their order
+ in the file set it to 0.
+deffile: The path to a file with additional ctags definitions (see the
+{optional} section below on adding a new definition for what exactly that
+ means). This is especially useful for ftplugins since they can
+ provide a complete type definition with ctags and Tagbar
+ configurations without requiring user intervention.
+ Let's say you have an ftplugin that adds support for the language
+ "mylang", and your directory structure looks like this: >
+ ctags/mylang.cnf
+ ftplugin/mylang.vim
+< Then the "deffile" entry would look like this to allow for the
+ plugin to be installed in an arbitray location (for example
+ with pathogen): >
+
+ 'deffile' : expand('<sfile>:p:h:h') . '/ctags/mylang.cnf'
+<
+ctagsbin: The path to a filetype-specific ctags-compatible program like
+{optional} jsctags. Set it in the same way as |g:tagbar_ctags_bin|. jsctags is
+ used automatically if found in your $PATH and does not have to be
+ set in that case. If it is not in your path you have to set this
+ key, the rest of the configuration should not be necessary (unless
+ you want to change something, of course). Note: if you use this
+ then the "ctagstype" key is not needed.
+ctagsargs: The arguments to be passed to the filetype-specific ctags program
+{optional} (without the filename). Make sure you set an option that makes the
+ program output its data on stdout. Not used for the normal ctags
+ program.
+
+ The value of ctagsargs may be a |List| of strings (a string for
+ each argument), or a single string (|expr-string|) of all the
+ arguments.
+
+ When the value of ctagsargs is a list, tagbar.vim takes care of
+ escaping each argument in the list as required for the current
+ 'shell' type.
+
+ When the value of ctagsargs is a string, it must be properly
+ escaped (if required by the current shell type). The reason
+ tagbar.vim does not attempt to escape the string in this case is
+ because if there is a space, it is ambiguous as to whether the
+ space is delimiting an argument or included in the argument. To
+ avoid this amiguity, tagbar.vim expects the string to be already
+ escaped as required.
+
+ If special escaping is required for different OS shell types or if
+ in doubt, then it is recommended to define ctagsargs with a List.
+
+
+You then have to assign this dictionary to a variable in your vimrc with the
+name
+>
+ g:tagbar_type_{vim filetype}
+<
+For example, for C++ the name would be "g:tagbar_type_cpp". If you don't know
+the vim file type then run the following command:
+>
+ :set filetype?
+<
+and vim will display the file type of the current buffer.
+
+Example: C++~
+Here is a complete example that shows the default configuration for C++ as
+used in Tagbar. This is just for illustration purposes since user
+configurations will usually be less complicated.
+>
+ let g:tagbar_type_cpp = {
+ \ 'ctagstype' : 'c++',
+ \ 'kinds' : [
+ \ 'd:macros:1:0',
+ \ 'p:prototypes:1:0',
+ \ 'g:enums',
+ \ 'e:enumerators:0:0',
+ \ 't:typedefs:0:0',
+ \ 'n:namespaces',
+ \ 'c:classes',
+ \ 's:structs',
+ \ 'u:unions',
+ \ 'f:functions',
+ \ 'm:members:0:0',
+ \ 'v:variables:0:0'
+ \ ],
+ \ 'sro' : '::',
+ \ 'kind2scope' : {
+ \ 'g' : 'enum',
+ \ 'n' : 'namespace',
+ \ 'c' : 'class',
+ \ 's' : 'struct',
+ \ 'u' : 'union'
+ \ },
+ \ 'scope2kind' : {
+ \ 'enum' : 'g',
+ \ 'namespace' : 'n',
+ \ 'class' : 'c',
+ \ 'struct' : 's',
+ \ 'union' : 'u'
+ \ }
+ \ }
+<
+
+Which of the keys you have to specify depends on what you want to do.
+
+Changing an existing definition~
+If you want to change an existing definition you only need to specify the
+parts that you want to change. It probably only makes sense to change "kinds",
+which would be the case if you wanted to for example change the order of
+certain kinds, change their default fold state or exclude them from appearing
+in Tagbar. The easiest way to do that is to use the |:TagbarGetTypeConfig|
+command, which will paste a ready-to-use configuration with the "kinds" entry
+for the specified type at the current cursor position.
+
+As an example, if you didn't want Tagbar to show prototypes for C++ files,
+switch the order of enums and typedefs, and show macros in the statusline, you
+would first run ":TagbarGetTypeConfig cpp" in your vimrc and then change the
+definition like this:
+>
+ let g:tagbar_type_cpp = {
+ \ 'kinds' : [
+ \ 'd:macros:1',
+ \ 'g:enums',
+ \ 't:typedefs:0:0',
+ \ 'e:enumerators:0:0',
+ \ 'n:namespaces',
+ \ 'c:classes',
+ \ 's:structs',
+ \ 'u:unions',
+ \ 'f:functions',
+ \ 'm:members:0:0',
+ \ 'v:variables:0:0'
+ \ ]
+ \ }
+<
+Compare with the complete example above to see the difference.
+
+Adding a definition for a new language/file type~
+In order to be able to add a new language to Tagbar you first have to create a
+configuration for ctags that it can use to parse the files. This can be done
+in two ways:
+
+ 1. Use the --regex argument for specifying regular expressions that are used
+ to parse the files. An example of this is given below. A disadvantage of
+ this approach is that you can't specify scopes.
+ 2. Write a parser plugin in C for ctags. This approach is much more powerful
+ than the regex approach since you can make use of all of ctags'
+ functionality but it also requires much more work. Read the ctags
+ documentation for more information about how to do this.
+
+For the first approach the only keys that are needed in the Tagbar definition
+are "ctagstype" and "kinds". A definition that supports scopes has to define
+those two and in addition "scopes", "sro" and at least one of "kind2scope" and
+"scope2kind".
+
+Let's assume we want to add support for LaTeX to Tagbar using the regex
+approach. First we put the following text into ~/.ctags or a file pointed to
+by the "deffile" definition entry:
+>
+ --langdef=latex
+ --langmap=latex:.tex
+ --regex-latex=/^\\tableofcontents/TABLE OF CONTENTS/s,toc/
+ --regex-latex=/^\\frontmatter/FRONTMATTER/s,frontmatter/
+ --regex-latex=/^\\mainmatter/MAINMATTER/s,mainmatter/
+ --regex-latex=/^\\backmatter/BACKMATTER/s,backmatter/
+ --regex-latex=/^\\bibliography\{/BIBLIOGRAPHY/s,bibliography/
+ --regex-latex=/^\\part[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/PART \2/s,part/
+ --regex-latex=/^\\part[[:space:]]*\*[[:space:]]*\{([^}]+)\}/PART \1/s,part/
+ --regex-latex=/^\\chapter[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/CHAP \2/s,chapter/
+ --regex-latex=/^\\chapter[[:space:]]*\*[[:space:]]*\{([^}]+)\}/CHAP \1/s,chapter/
+ --regex-latex=/^\\section[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\. \2/s,section/
+ --regex-latex=/^\\section[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\. \1/s,section/
+ --regex-latex=/^\\subsection[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\.\. \2/s,subsection/
+ --regex-latex=/^\\subsection[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\.\. \1/s,subsection/
+ --regex-latex=/^\\subsubsection[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\.\.\. \2/s,subsubsection/
+ --regex-latex=/^\\subsubsection[[:space:]]*\*[[:space:]]*\{([^}]+)\}/\.\.\. \1/s,subsubsection/
+ --regex-latex=/^\\includegraphics[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\3/g,graphic+listing/
+ --regex-latex=/^\\lstinputlisting[[:space:]]*(\[[^]]*\])?[[:space:]]*(\[[^]]*\])?[[:space:]]*\{([^}]+)\}/\3/g,graphic+listing/
+ --regex-latex=/\\label[[:space:]]*\{([^}]+)\}/\1/l,label/
+ --regex-latex=/\\ref[[:space:]]*\{([^}]+)\}/\1/r,ref/
+ --regex-latex=/\\pageref[[:space:]]*\{([^}]+)\}/\1/p,pageref/
+<
+This will create a new language definition with the name "latex" and associate
+it with files with the extension ".tex". It will also define the kinds "s" for
+sections, chapters and the like, "g" for included graphics, "l" for labels,
+"r" for references and "p" for page references. See the ctags documentation
+for more information about the exact syntax.
+
+Now we have to create the Tagbar language definition in our vimrc:
+>
+ let g:tagbar_type_tex = {
+ \ 'ctagstype' : 'latex',
+ \ 'kinds' : [
+ \ 's:sections',
+ \ 'g:graphics:0:0',
+ \ 'l:labels',
+ \ 'r:refs:1:0',
+ \ 'p:pagerefs:1:0'
+ \ ],
+ \ 'sort' : 0,
+ \ 'deffile' : expand('<sfile>:p:h:h') . '/ctags/latex.cnf'
+ \ }
+<
+The "deffile" field is of course only needed if the ctags definition actually
+is in that file and not in ~/.ctags.
+
+Sort has been disabled for LaTeX so that the sections appear in their correct
+order. They unfortunately can't be shown nested with their correct scopes
+since as already mentioned the regular expression approach doesn't support
+that.
+
+Tagbar should now be able to show the sections and other tags from LaTeX
+files.
+
+Note: As of 2012-05-05 the ctags development version contains an improved
+LaTeX parser that works better than the example configuration presented here.
+So if you are using a development build newer than that or a stable version
+newer than 5.8 you should use the built-in support instead of this example.
+
+Project-specific configuration~
+
+In addition to the normal global configuration it is also possible to have
+project-specific settings. This is mostly useful for additional ctags options,
+like for example macros to ignore. Or maybe you want to do things like folding
+certain tag kinds in some projects.
+
+In order to use this feature you need to create User |autocommand|s in an
+augroup called "TagbarProjects" and have it create a buffer-local variable
+called "b:tagbar_type". This variable has to hold a type definition just like
+the normal ones described in this chapter. This definition will then be
+applied only to the files matched by the autocommand.
+
+Note that there can be multiple definitions of the augroup with their own
+autocommands (for example in separate project directories); they will get
+merged automatically by Vim.
+
+Example:
+>
+ augroup TagbarProjects
+ autocmd User ~/myproject/*.c let b:tagbar_type = {'deffile' : '~/myproject/ctags.cnf'}
+ augroup END
+<
+
+Writing your own tag-generating program~
+If you want to write your own program for generating tags then here are some
+imporant tips to get it to integrate well with Tagbar:
+
+ - Tagbar supports the same tag format as Vim itself. The format is described
+ in |tags-file-format|, the third format mentioned there is the relevant
+ one. Note that the {tagaddress} part should be a search pattern since the
+ line number can be specified in a field (see below).
+ - Tagbar reads the tag information from a program's standard output
+ (stdout), it doesn't generate files and reads them in after that. So make
+ sure that your program has an option to output the tags on stdout.
+ - Some fields are supported for providing additional information about a
+ tag. One field is required: the "kind" field as a single letter, either
+ with or without a "kind:" fieldname. If it is used without the fieldname
+ then it has to be the first field in the list. All other fields need to
+ have a fieldname in order to determine what they are. The following fields
+ are supported for all filetypes:
+
+ * line: The line number of the tag.
+ * column: The column number of the tag.
+ * signature: The signature of a function.
+ * access: Visibility information of a tag; the values "public",
+ "protected" and "private" will be denoted with a special
+ symbol in Tagbar.
+
+ In addition fields that describe the surrounding scope of the tag are
+ supported if they are specified in the type configuration as explained at
+ the beginning of this section. For example, for a tag in class "Foo" this
+ could look like "class:Foo".
+ Important: the value of such a scope-specifying field should be the entire
+ hierarchy of scopes that the tag is in, so if for example in C++ you have
+ a member in class "Foo" which is in namespace "Bar" then the scope field
+ should be "class:Bar::Foo".
+
+==============================================================================
+7. Troubleshooting & Known issues *tagbar-issues*
+
+As a general rule, if the tag information displayed by Tagbar is wrong (for
+example, a method doesn't show up or is in the wrong place) you should first
+try running ctags manually to see whether ctags reports the wrong information
+or whether that information is correct and Tagbar does something wrong. To run
+ctags manually execute the following command in a terminal:
+>
+ ctags -f - --format=2 --excmd=pattern --extra= --fields=nksaSmt myfile
+<
+If you set the |g:tagbar_ctags_bin| variable you probably have to use the same
+value here instead of simply "ctags".
+
+If something more fundamental isn't working right then try running the
+|:messages| command to see if Tagbar printed any error messages that might
+have been missed.
+
+If the bug does seem to be in Tagbar then you can use Tagbar's debug mode to
+try to find the source of the problem. Usually you would use it like this:
+
+ 1. Open Vim without loading any files.
+ 2. Run :TagbarDebug.
+ 3. Open the file you are having problems with.
+ 4. Open Tagbar. If the problem is with the statusline functionality this
+ step may not be necessary.
+ 5. Exit Vim.
+
+This should leave a file called "tagbardebug.log" in the current directory.
+See |tagbar-commands| for more information on the debug commands. When you
+look at the file you should especially pay attention to the reported file type
+and the ctags command line in the log file.
+
+
+Known issues~
+
+ - jsctags has to be newer than 2011-01-06 since it needs the "-f" option to
+ work. Also, the output of jsctags seems to be a bit unreliable at the
+ moment (especially regarding line numbers), so if you notice some strange
+ behaviour with it please run it manually in a terminal to check whether
+ the bug is in jsctags or Tagbar.
+
+ - Nested pseudo-tags cannot be properly parsed since only the direct parent
+ scope of a tag gets assigned a type, the type of the grandparents is not
+ reported by ctags (assuming the grandparents don't have direct, real
+ children).
+
+ For example, if we have a C++ file with the following content:
+>
+ foo::Bar::init()
+ {
+ // ...
+ }
+ foo::Baz::method()
+ {
+ // ...
+ }
+<
+ In this case the type of "foo" is not known. Is it a namespace? A class?
+ For this reason the methods are displayed in Tagbar like this:
+>
+ foo::Bar* : class
+ init()
+ foo::Baz* : class
+ method()
+<
+ - Scope-defining tags at the top level that have the same name but a
+ different kind/scope type can lead to an incorrect display. For example,
+ the following Python code will incorrectly insert a pseudo-tag "Inner2"
+ into the "test" class:
+>
+ class test:
+ class Inner:
+ def foo(self):
+ pass
+
+ def test():
+ class Inner2:
+ def bar(self):
+ pass
+<
+ I haven't found a proper way around this yet, but it shouldn't be much of
+ a problem in practice anyway. Tags with the same name at any other level
+ are no problem, though.
+
+==============================================================================
+8. History *tagbar-history*
+
+2.6.1 (2014-01-23)
+ - Automatically close the preview window when jumping to a tag
+ - Don't forget the previous window in certain situations, which was
+ causing problems with for example fugitive
+ - Fixed toggling kind-specific folds
+ - Fixed ctags error that can happen with Cygwin
+
+2.6 (2013-12-06)
+ - Added possibility to show tags in the preview window, either manually or
+ automatically.
+ - Allow customizing the statusline, see :help g:tagbar_status_func.
+ - Type configuration can now be project-specific.
+ - The keybindings in the Tagbar window are now configurable.
+ - Improvements to Ctags execution on Windows, thanks to Darcy Parker.
+ - Added function tagbar#currentfile() that returns the path to the file
+ currently being displayed in Tagbar, thanks to Zhao Cai.
+ - Added a :Tagbar command as an alias for :TagbarToggle.
+ - Added an way to ignore specific files in case they create problems.
+ - Optionally show line numbers in the Tagbar window.
+ - The usual bunch of small improvements and bugfixes.
+
+2.5 (2013-03-25)
+ - New command :TagbarTogglePause to freeze Tagbar in its current state so
+ you can switch to other files while keeping the old information
+ displayed for reference. (Kian Ryan)
+ - New command :TagbarCurrentTag which reports the same information as
+ currenttag().
+ - New option tagbar_indent to configure the indentation depth of the tags.
+ - New option tagbar_show_visibility to allow disabling the visibility
+ symbols.
+ - Files are now cached locally to avoid additional slowdowns for slow
+ connections. This also makes it possible to use Tagbar with files
+ accessed through Netrw.
+ - Execute ctags again even if the previous run reported errors, in case it
+ was a parse error that has since been fixed. If the error persists,
+ don't display it again.
+ - Improved window switching and Vim exit behaviours. (Techlive Zheng)
+ - The currenttag() function now can show the prototype instead of the
+ actual tag, which can be useful in some cases where ctags doesn't report
+ all the interesting information.
+ - The prototype shown in the tooltip or command line should now always be
+ complete, even if it is spread out over more than one line in the source
+ file.
+ - The TagbarAccessPublic etc. highlight groups have been renamed to
+ TagbarVisibilityPublic etc. to keep them in line with standard
+ terminology. The old names are still supported.
+ - Various smaller improvements and bugfixes.
+
+2.4.1 (2012-07-16)
+ - Fixed some bugs related to the currenttag() function when it was called
+ before the rest of the plugin was loaded. Also fail silently in case
+ something goes wrong so the statusline doesn't get messed up.
+ - In certain cases highlighting tags in deeply nested folds could cause an
+ error message.
+ - Spellchecking is now correctly getting disabled in the Tagbar window.
+
+2.4 (2012-06-17)
+ - New function tagbar#currenttag() that reports the current tag, for
+ example for putting it into the statusline.
+ - New command TagbarGetTypeConfig for easy customization of an existing
+ type.
+ - Type definitions now can be loaded from ftplugins.
+ - The autoopen() function is now a bit more flexible.
+ - Vala is now supported if Anjuta is installed.
+ - Various other small improvements and bugfixes.
+
+2.3 (2011-12-24)
+ - Add a convenience function that allows more flexible ways to
+ automatically open Tagbar.
+ - Replace option tagbar_usearrows with tagbar_iconchars to allow custom
+ characters to be specified. This helps with fonts that don't display the
+ default characters properly.
+ - Remove the need to provide the complete jsctags configuration if jsctags
+ is not found in $PATH, now only the concrete path has to be specified.
+ - Add debugging functionality.
+
+2.2 (2011-11-26)
+ - Small incompatible change: TagbarOpen now doesn't jump to the Tagbar
+ window anymore if it is already open. Use "TagbarOpen j" instead or see
+ its documentation for more options.
+ - Tags inside of scopes now have a header displaying their "kind".
+ - The Tagbar contents are now immediately updated on save for files
+ smaller than a configurable size.
+ - Tagbar can now be configured to jump to a tag with only a single-click
+ instead of a double-click.
+ - Most of the script has been moved to the |autoload| directory, so Vim
+ startup should be faster (thanks to Kien N).
+ - Jumping to tags should work most of the time even if the file has been
+ modified and not saved.
+ - If Ctags has been installed into the default location using Homebrew or
+ MacPorts it should now be found automatically.
+ - Several bugfixes.
+
+2.1 (2011-05-29)
+ - Make Tagbar work in (hopefully) all cases under Windows
+ - Handle cases where 'encoding' is different from system encoding, for
+ example on a Chinese Windows with 'encoding' set to "utf-8" (see manual
+ for details in case it doesn't work out-of-the-box)
+ - Fixed a bug with the handling of subtypes like "python.django"
+ - If a session got saved with Tagbar open it now gets restored properly
+ - Locally reset foldmethod/foldexpr in case foldexpr got set to something
+ expensive globally
+ - Tagbar now tries hard to go to the correct window when jumping to a tag
+ - Explain some possible issues with the current jsctags version in the
+ manual
+ - Explicitly check for some possible configuration problems to be able to
+ give better feedback
+ - A few other small fixes
+
+2.0.1 (2011-04-26)
+ - Fix sorting bug when 'ignorecase' is set
+
+2.0 (2011-04-26)
+ - Folding now works correctly. Folds will be preserved when leaving the
+ Tagbar window and when switching between files. Also tag types can be
+ configured to be folded by default, which is useful for things like
+ includes and imports.
+ - DoctorJS/jsctags and other compatible programs are now supported.
+ - All of the highlight groups can now be overridden.
+ - Added keybinding to quickly jump to next/previous top-level tag.
+ - Added Taglist's "p" keybinding for jumping to a tag without leaving the
+ Tagbar window.
+ - Several bugfixes and other small improvements.
+
+1.5 (2011-03-06)
+ - Type definitions can now include a path to a file with the ctags
+ definition. This is especially useful for ftplugins that can now ship
+ with a complete ctags and Tagbar configuration without requiring user
+ intervention. Thanks to Jan Christoph Ebersbach for the suggestion.
+ - Added autofocus setting by Taybin Rutkin. This will put the cursor in
+ the Tagbar window when it is opened.
+ - The "scopes" field is no longer needed in type definitions, the
+ information is already there in "scope2kind". Existing definitions will
+ be ignored.
+ - Some fixes and improvements related to redrawing and window switching.
+
+1.2 (2011-02-28)
+ - Fix typo in Ruby definition
+
+1.1 (2011-02-26)
+ - Don't lose syntax highlighting when ':syntax enable' is called
+ - Allow expanding the Vim window when Tagbar is opened
+
+1.0 (2011-02-23)
+ - Initial release
+
+==============================================================================
+9. Todo *tagbar-todo*
+
+ - Allow filtering the Tagbar content by some criteria like tag name,
+ visibility, kind ...
+ - Integrate Tagbar with the FSwitch plugin to provide header file
+ information in C/C++.
+ - Allow jumping to a tag in the preview window, a split window or a new tab.
+
+==============================================================================
+10. Credits *tagbar-credits*
+
+Tagbar was written by Jan Larres and is released under the Vim licence, see
+|license|. It was heavily inspired by the Taglist plugin by Yegappan
+Lakshmanan and uses a small amount of code from it.
+
+Original taglist copyright notice:
+Permission is hereby granted to use and distribute this code, with or without
+modifications, provided that this copyright notice is copied with it. Like
+anything else that's free, taglist.vim is provided *as is* and comes with no
+warranty of any kind, either expressed or implied. In no event will the
+copyright holder be liable for any damamges resulting from the use of this
+software.
+
+The folding technique was inspired by NERDTree by Martin Grenfell.
+
+Thanks to the following people for code contributions, feature suggestions etc:
+Peter Butkovic
+Zhao Cai
+Jan Christoph Ebersbach
+Vadim Fint
+Leandro Freitas
+Ingo Karkat
+Audrius Kažukauskas
+Michael McClimon
+Seth Milliken
+Kien N
+Darcy Parker
+fritzophrenic
+pielgrzym
+Taybin Rutkin
+Kian Ryan
+John Szakmeister
+Ville Valkonen
+Techlive Zheng
+
+==============================================================================
+ vim: tw=78 ts=8 sw=4 sts=4 et ft=help
diff --git a/vim/bundle/tagbar/plugin/tagbar.vim b/vim/bundle/tagbar/plugin/tagbar.vim
new file mode 100644
index 0000000..a852357
--- /dev/null
+++ b/vim/bundle/tagbar/plugin/tagbar.vim
@@ -0,0 +1,146 @@
+" ============================================================================
+" File: tagbar.vim
+" Description: List the current file's tags in a sidebar, ordered by class etc
+" Author: Jan Larres <jan@majutsushi.net>
+" Licence: Vim licence
+" Website: http://majutsushi.github.com/tagbar/
+" Version: 2.6.1
+" Note: This plugin was heavily inspired by the 'Taglist' plugin by
+" Yegappan Lakshmanan and uses a small amount of code from it.
+"
+" Original taglist copyright notice:
+" Permission is hereby granted to use and distribute this code,
+" with or without modifications, provided that this copyright
+" notice is copied with it. Like anything else that's free,
+" taglist.vim is provided *as is* and comes with no warranty of
+" any kind, either expressed or implied. In no event will the
+" copyright holder be liable for any damamges resulting from the
+" use of this software.
+" ============================================================================
+
+scriptencoding utf-8
+
+if &cp || exists('g:loaded_tagbar')
+ finish
+endif
+
+" Basic init {{{1
+
+if v:version < 700
+ echohl WarningMsg
+ echomsg 'Tagbar: Vim version is too old, Tagbar requires at least 7.0'
+ echohl None
+ finish
+endif
+
+if v:version == 700 && !has('patch167')
+ echohl WarningMsg
+ echomsg 'Tagbar: Vim versions lower than 7.0.167 have a bug'
+ \ 'that prevents this version of Tagbar from working.'
+ \ 'Please use the alternate version posted on the website.'
+ echohl None
+ finish
+endif
+
+function! s:init_var(var, value) abort
+ if !exists('g:tagbar_' . a:var)
+ execute 'let g:tagbar_' . a:var . ' = ' . string(a:value)
+ endif
+endfunction
+
+function! s:setup_options() abort
+ if !exists('g:tagbar_vertical') || g:tagbar_vertical == 0
+ let previewwin_pos = 'topleft'
+ else
+ let previewwin_pos = 'rightbelow vertical'
+ endif
+ let options = [
+ \ ['autoclose', 0],
+ \ ['autofocus', 0],
+ \ ['autopreview', 0],
+ \ ['autoshowtag', 0],
+ \ ['compact', 0],
+ \ ['expand', 0],
+ \ ['foldlevel', 99],
+ \ ['hide_nonpublic', 0],
+ \ ['indent', 2],
+ \ ['left', 0],
+ \ ['previewwin_pos', previewwin_pos],
+ \ ['show_visibility', 1],
+ \ ['show_linenumbers', 0],
+ \ ['singleclick', 0],
+ \ ['sort', 1],
+ \ ['systemenc', &encoding],
+ \ ['vertical', 0],
+ \ ['width', 40],
+ \ ['zoomwidth', 1],
+ \ ]
+
+ for [opt, val] in options
+ call s:init_var(opt, val)
+ endfor
+endfunction
+call s:setup_options()
+
+if !exists('g:tagbar_iconchars')
+ if has('multi_byte') && has('unix') && &encoding == 'utf-8' &&
+ \ (empty(&termencoding) || &termencoding == 'utf-8')
+ let g:tagbar_iconchars = ['▶', '▼']
+ else
+ let g:tagbar_iconchars = ['+', '-']
+ endif
+endif
+
+function! s:setup_keymaps() abort
+ let keymaps = [
+ \ ['jump', '<CR>'],
+ \ ['preview', 'p'],
+ \ ['previewwin', 'P'],
+ \ ['nexttag', '<C-N>'],
+ \ ['prevtag', '<C-P>'],
+ \ ['showproto', '<Space>'],
+ \ ['hidenonpublic', 'v'],
+ \
+ \ ['openfold', ['+', '<kPlus>', 'zo']],
+ \ ['closefold', ['-', '<kMinus>', 'zc']],
+ \ ['togglefold', ['o', 'za']],
+ \ ['openallfolds', ['*', '<kMultiply>', 'zR']],
+ \ ['closeallfolds', ['=', 'zM']],
+ \ ['nextfold', 'zj'],
+ \ ['prevfold', 'zk'],
+ \
+ \ ['togglesort', 's'],
+ \ ['toggleautoclose', 'c'],
+ \ ['zoomwin', 'x'],
+ \ ['close', 'q'],
+ \ ['help', ['<F1>', '?']],
+ \ ]
+
+ for [map, key] in keymaps
+ call s:init_var('map_' . map, key)
+ unlet key
+ endfor
+endfunction
+call s:setup_keymaps()
+
+augroup TagbarSession
+ autocmd!
+ autocmd SessionLoadPost * nested call tagbar#RestoreSession()
+augroup END
+
+" Commands {{{1
+command! -nargs=0 Tagbar call tagbar#ToggleWindow()
+command! -nargs=0 TagbarToggle call tagbar#ToggleWindow()
+command! -nargs=? TagbarOpen call tagbar#OpenWindow(<f-args>)
+command! -nargs=0 TagbarOpenAutoClose call tagbar#OpenWindow('fcj')
+command! -nargs=0 TagbarClose call tagbar#CloseWindow()
+command! -nargs=1 -bang TagbarSetFoldlevel call tagbar#SetFoldLevel(<args>, <bang>0)
+command! -nargs=0 TagbarShowTag call tagbar#highlighttag(1, 1)
+command! -nargs=? TagbarCurrentTag echo tagbar#currenttag('%s', 'No current tag', <f-args>)
+command! -nargs=1 TagbarGetTypeConfig call tagbar#gettypeconfig(<f-args>)
+command! -nargs=? TagbarDebug call tagbar#StartDebug(<f-args>)
+command! -nargs=0 TagbarDebugEnd call tagbar#StopDebug()
+command! -nargs=0 TagbarTogglePause call tagbar#toggle_pause()
+
+" Modeline {{{1
+" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
diff --git a/vim/bundle/tagbar/syntax/tagbar.vim b/vim/bundle/tagbar/syntax/tagbar.vim
new file mode 100644
index 0000000..a1d450b
--- /dev/null
+++ b/vim/bundle/tagbar/syntax/tagbar.vim
@@ -0,0 +1,63 @@
+" File: tagbar.vim
+" Description: Tagbar syntax settings
+" Author: Jan Larres <jan@majutsushi.net>
+" Licence: Vim licence
+" Website: http://majutsushi.github.com/tagbar/
+" Version: 2.6.1
+
+scriptencoding utf-8
+
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:ics = escape(join(g:tagbar_iconchars, ''), ']^\-')
+let s:pattern = '\(^[' . s:ics . '] \?\)\@<=[^-+: ]\+[^:]\+$'
+execute "syntax match TagbarKind '" . s:pattern . "'"
+
+let s:pattern = '\(\S\@<![' . s:ics . '][-+# ]\?\)\@<=[^*(]\+\(\*\?\(([^)]\+)\)\? :\)\@='
+execute "syntax match TagbarScope '" . s:pattern . "'"
+
+let s:pattern = '\S\@<![' . s:ics . ']\([-+# ]\?\)\@='
+execute "syntax match TagbarFoldIcon '" . s:pattern . "'"
+
+let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=+\([^-+# ]\)\@='
+execute "syntax match TagbarVisibilityPublic '" . s:pattern . "'"
+let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=#\([^-+# ]\)\@='
+execute "syntax match TagbarVisibilityProtected '" . s:pattern . "'"
+let s:pattern = '\(\S\@<![' . s:ics . ' ]\)\@<=-\([^-+# ]\)\@='
+execute "syntax match TagbarVisibilityPrivate '" . s:pattern . "'"
+
+unlet s:pattern
+
+syntax match TagbarHelp '^".*' contains=TagbarHelpKey,TagbarHelpTitle
+syntax match TagbarHelpKey '" \zs.*\ze:' contained
+syntax match TagbarHelpTitle '" \zs-\+ \w\+ -\+' contained
+
+syntax match TagbarNestedKind '^\s\+\[[^]]\+\]$'
+syntax match TagbarType ' : \zs.*'
+syntax match TagbarSignature '(.*)'
+syntax match TagbarPseudoID '\*\ze :'
+
+highlight default link TagbarHelp Comment
+highlight default link TagbarHelpKey Identifier
+highlight default link TagbarHelpTitle PreProc
+highlight default link TagbarKind Identifier
+highlight default link TagbarNestedKind TagbarKind
+highlight default link TagbarScope Title
+highlight default link TagbarType Type
+highlight default link TagbarSignature SpecialKey
+highlight default link TagbarPseudoID NonText
+highlight default link TagbarFoldIcon Statement
+highlight default link TagbarHighlight Search
+
+highlight default TagbarAccessPublic guifg=Green ctermfg=Green
+highlight default TagbarAccessProtected guifg=Blue ctermfg=Blue
+highlight default TagbarAccessPrivate guifg=Red ctermfg=Red
+highlight default link TagbarVisibilityPublic TagbarAccessPublic
+highlight default link TagbarVisibilityProtected TagbarAccessProtected
+highlight default link TagbarVisibilityPrivate TagbarAccessPrivate
+
+let b:current_syntax = "tagbar"
+
+" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
diff --git a/vim/bundle/tlib_vim/.gitignore b/vim/bundle/tlib_vim/.gitignore
new file mode 100644
index 0000000..b9a9d10
--- /dev/null
+++ b/vim/bundle/tlib_vim/.gitignore
@@ -0,0 +1,10 @@
+tags
+Makefile
+TODO.TXT
+TODO_archived.viki
+*.vba
+*.vmb
+*.zip
+.last_*
+test
+test_*
diff --git a/vim/bundle/tlib_vim/CHANGES.TXT b/vim/bundle/tlib_vim/CHANGES.TXT
new file mode 100644
index 0000000..84357bf
--- /dev/null
+++ b/vim/bundle/tlib_vim/CHANGES.TXT
@@ -0,0 +1,755 @@
+0.1
+Initial release
+
+0.2
+- More list convenience functions
+- tlib#EditList()
+- tlib#InputList(): properly handle duplicate items; it type contains
+'i', the list index + 1 is returned, not the element
+
+0.3
+- tlib#InputList(): Show feedback in statusline instead of the echo area
+- tlib#GetVar(), tlib#GetValue()
+
+0.4
+- tlib#InputList(): Up/Down keys wrap around list
+- tlib#InputList(): FIX: Problem when reducing the filter & using AND
+- tlib#InputList(): Made <a-numeric> work (can be configured via
+- tlib#InputList(): special display_format: "filename"
+- tlib#Object: experimental support for some kind of OOP
+- tlib#World: Extracted some functions from tlib.vim to tlib/World.vim
+- tlib#FileJoin(), tlib#FileSplit(), tlib#RelativeFilename()
+- tlib#Let()
+- tlib#EnsureDirectoryExists(dir)
+- tlib#DirName(dir)
+- tlib#DecodeURL(url), tlib#EncodeChar(char), tlib#EncodeURL(url)
+- FIX: Problem when using shift-up/down with filtered lists
+
+0.5
+- tlib#InputList(): FIX: Selecting items in filtered view
+- tlib#InputList(): <c-bs>: Remove last AND pattern from filter
+
+0.6
+- tlib#InputList(): Disabled <c-space> map
+- tlib#InputList(): try to be smart about user itentions only if a
+list's length is < g:tlib_sortprefs_threshold (default: 200)
+- tlib#Object: Super() method
+- tlib#MyRuntimeDir()
+- tlib#GetCacheName(), tlib#CacheSave(), tlib#CacheGet()
+- tlib#Args(), tlib#GetArg()
+- FIX: tlib#InputList(): Display problem with first item
+
+0.7
+- tlib#InputList(): <c-z> ... Suspend/Resume input
+- tlib#InputList(): <c-q> ... Input text on the command line (useful on
+slow systems when working with very large lists)
+- tlib#InputList(): AND-pattern starting with '!' will work as 'exclude
+matches'
+- tlib#InputList(): FIX <c-bs> pop OR-patterns properly
+- tlib#InputList(): display_format == filename: don't add '/' to
+directory names (avoid filesystem access)
+
+0.8
+- FIX: Return empty cache name for buffers that have no files attached to it
+- Some re-arranging
+
+0.9
+- Re-arrangements & modularization (this means many function names have
+changed, on the other hand only those functions are loaded that are
+actually needed)
+- tlib#input#List(): Added maps with m-modifiers for <c-q>, <c-z>, <c-a>
+- tlib#input#List(): Make sure &fdm is manual
+- tlib#input#List(): When exiting the list view, consume the next 5
+characters in the queue (if any)
+- tlib#input#EditList(): Now has cut, copy, paste functionality.
+- Added documentation and examples
+
+0.10
+- tlib#input#List(): (v)split type of commands leave the original window
+untouched (you may use <c-w> to replace its contents)
+- tlib#file#With(): Check whether an existing buffer is loaded.
+- Scratch related functions went to tlib/scratch.vim so that they are
+accessible from other scripts.
+- Configure the list window height via g:tlib_inputlist_pct (1..100%)
+
+0.11
+NEW:
+ - The :TLet command replaces :TLLet (which was removed)
+ - :TScratch[!] command (with ! don't split but use the whole window)
+ - tlib#rx#Escape(text, ?magic='m')
+ - tlib#buffer#GetList(?show_hidden=0)
+ - tlib#dir#CD(), tlib#dir#Push(), tlib#dir#Pop()
+ - tlib#input#ListW: A slightly remodeled version of tlib#input#List
+ that takes a World as second argument.
+ - Added some documentation doc/tlib.txt (most of it is automatically
+ compiled from the source files)
+CHANGES:
+ - tlib#input#List(): The default keys for AND, NOT have changed to
+ be more Google-like (space, minus); the keys can be configured via
+ global variables.
+IMPROVEMENTS:
+ - In file listings, indicate if a file is loaded, listed, modified
+ etc.
+ - tlib#input#List(): Highlight the filter pattern
+ - tlib#input#List(): <c-up/down> scrolls g:tlib_scroll_lines
+ (default=10) lines
+FIXES:
+ - tlib#input#List(): Centering line, clear match, clear & restore
+ the search register
+ - tlib#input#List(): Ensure the window layout doesn't change (if the
+ number of windows hasn't changed)
+ - tlib#arg#Ex(): Don't escape backslashes by default
+
+0.12
+NEW:
+ - tlib/tab.vim
+CHANGES:
+ - Renamed tlib#win#SetWin() to tlib#win#Set()
+IMPROVEMENTS:
+ - tlib#input#List(): <left>, <right> keys work in some lists
+ - tlib#input#List(): If an index_table is provided this will be used
+ instead of the item's list index.
+FIXES:
+ - tlib#input#List(): Problem with scrolling, when the list was
+ shorter than the window (eg when using a vertical window).
+ - tlib#cache#Filename(): Don't rewrite name as relative filename if
+ explicitly given as argument. Avoid double (back)slashes.
+ - TLet: simplified
+
+0.13
+CHANGES:
+ - Scratch: Set &fdc=0.
+ - The cache directory can be configured via g:tlib_cache
+ - Renamed tlib#buffer#SetBuffer() to tlib#buffer#Set().
+FIXES:
+ - tlib#input#List(): Select the active item per mouse.
+ - TLet: simplified
+
+0.14
+NEW:
+ - tlib#buffer#InsertText()
+CHANGES:
+ - tlib#win#[SG]etLayout(): Use a dictionnary, set &cmdheight.
+FIXES:
+ - Wrong order with pre-defined filters.
+
+0.15
+NEW:
+ - tlib#string#TrimLeft(), tlib#string#TrimRight(), tlib#string#Strip()
+ - Progress bar
+
+0.16
+NEW:
+ - tlib#string#Printf1()
+
+0.17
+NEW:
+ - TBrowseOutput
+- Some minor changes
+
+0.18
+NEW:
+ - tlib/time.vim
+ - g:tlib_inputlist_livesearch_threshold
+CHANGES:
+ - tlib#input#ListD(), World: Don't redisplay the list while typing
+ new letters; calculate filter regexps only once before filtering the
+ list.
+ - World.vim: Minor changes to how filenames are handled.
+
+0.19
+NEW:
+ - tag.vim
+FIX:
+ - dir.vim: Use plain dir name in tlib#dir#Ensure()
+ - tlib#input#List(): An initial filter argument creates [[filter]]
+ and not as before [[''], [filter]].
+ - tlib#input#List(): When type was "si" and the item was picked by
+ filter, the wrong index was returned.
+ - tlib#input#List(): Don't check if chars are typed when displaying
+ the list for the first time.
+
+0.20
+- The arguments of tlib#tag#Collect() have changed.
+- tlib#input#List(): The view can be "suspended" on initial display.
+- tlib#input#List(): Follow/trace cursor functionality
+
+0.21
+- tlib#buffer#InsertText(): Respect tabs and (experimental) formatoptions+=or
+- tlib/syntax.vim: Syntax-related functions
+
+0.22
+- FIX: very magic mode for tlib#rx#Escape() (thanks A Politz)
+- FIX: tlib#arg#Ex: escape "!"
+
+0.23
+- Respect the setting of g:tlib_inputlist_filename_indicators
+- tlib#input#List(): Reset syntax on resume; option to make list window "sticky"
+- tlib#agent#ToggleStickyList()
+- Simplified tlib#url#Decode()
+- tlib#arg#Ex(): use fnameescape() if available
+
+0.24
+- s:prototype.SetInitialFilter: accept list as argument
+- Maintain buffer MRU if required
+
+0.25
+- NEW: tlib#notify#TrimMessage(): trim message to prevent "Press ENTER"
+messages (contributed by Erik Falor)
+- NEW: tlib#notify#Echo()
+- FIX: World.CloseScratch(): Set window
+- FIX: tlib#input#ListW(): Set initial_display = 1 on reset
+
+0.26
+- NEW: tlib#normal#WithRegister()
+- FIX: Try not to change numbered registers
+
+0.27
+- FIX: Cosmetic bug, wrong packaging (thanks Nathan Neff)
+- Meaning of World#filter_format changed; new World#filter_options
+- Filtering didn't work as advertised
+- tlib#string#Count()
+
+0.28
+- tlib#input#List():
+-- Improved handling of sticky lists; <cr> and <Leftmouse> resume a
+suspended list and immediately selects the item under the cursor
+-- Experimental "seq" matching style: the conjunctions are sequentially
+ordered, they are combined with "OR" (disjunctions), the regexp is
+'magic', and "." is expanded to '.\{-}'
+-- Experimental "cnfd" matching style: Same as cnf but with an "elastic"
+dot "." that matches '\.\{-}'
+-- Filtering acts as if &ic=1 && $sc=1
+-- Weighting is done by the filter
+- tlib#agent#Input(): Consume <esc> when aborting input()
+- INCOMPATIBLE CHANGE: Changed eligible values of g:tlib_inputlist_match
+to "cnf", "cnfd", "seq" and "fuzzy"
+- NEW: tlib#buffer#KeepCursorPosition()
+- tlib#buffer#InsertText(): Take care of the extra line when appending
+text to an empty buffer.
+
+0.29
+- tlib#string#Strip(): Strip also control characters (newlines etc.)
+- tlib#rx#Suffixes(): 'suffixes' as Regexp
+- World#RestoreOrigin(): Don't assume &splitbelow
+
+0.30
+- World#RestoreOrigin(): Don't assume &splitright
+
+0.31
+- :TRequire command
+-tlib#input#List: For i-type list views, make sure agents are called
+with the base indices.
+
+0.32
+- tlib#agent#Exit: explicitly return empty value (as a consequence,
+pressing <esc> when browsing an index-list, returns 0 and not "")
+- tlib#signs
+- tlib#input#List: set local statusline
+
+0.33
+- Don't reset statusline
+- Don't use fnamemodify() to split filenames (for performance reasons)
+- scratch: Set ft after setting up scratch options
+- tlib#map#PumAccept(key)
+
+0.34
+- tlib#buffer#HighlightLine(line): call tlib#autocmdgroup#Init()
+(reported by Sergey Khorev)
+
+0.35
+- tlib#input#EditList(): return the list if the user presses esc
+
+0.36
+- Display a message when the filter is for whatever reason invalid
+- Removed tlib#paragraph#Delete()
+- New: tlib#paragraph#Define(), tlib#textobjects#StandardParagraph()
+- Try to speed up list display (a rewrite of World.DisplayList() etc. is
+required)
+
+0.37
+- g:tlib_inputlist_livesearch_threshold defaults to 1000
+- tlib#World: optional scratch_pos field
+- tlib#input#List: By default <m-NUMBER> selects by number but NUMBER is
+interpreted as string
+- tlib#date
+- TTimeCommand
+
+0.38
+- tlib#World#Resize: set winfix{height|width}
+
+0.39
+- g:tlib#cache#dont_purge
+- tlib#vim#RestoreWindow()
+- tlib#ballon#...()
+
+0.40
+- tlib#agent#ViewFile: Use split/sbuffer if nohidden && modified
+- tlib#buffer#GetList(): order by "basename"
+
+version: "0.41"
+ - World.UseScratch(): keepalt
+ - Really include balloon.vim
+ MD5 checksum: 3fcbc4f7556f5378d39622e62ab8f379
+
+version: "0.42"
+ - tlib#input#List: <s-space> inserts a *-like wildcard (represented as "__")
+ - Check if a cache file cannot be created because a directory of the same name exists (display a message if so)
+ - tlib#cache#Filename: Removed check if a directory of the same name exists (due to inconsistent use)
+ - Minor improvements related to buffer handling (scratch_split)
+ - .gitignore
+ - docs (thanks to blueyed)
+ - There is no "edit" answer possibility.
+ - Fix first purge: do nothing if no timestamp file.
+ - g:tlib_pick_single_item
+ - Removed pick_single_item. Changed the default behavour when a list has only 1 item. See doc for g:tlib_pick_last_item.
+ - Updated help for tlib#input#List(); help_extra attribute
+ - EXPERIMENTAL: cache_var, restore_from_cache, on_leave properties; #Initialize(), #Leave()
+ - added tlib#cmd#BrowseOutputWithCallback function and :TBrowseScriptnames command
+ - tlib#cmd#BrowseOutputWithCallback function and :TBrowseScriptnames command documentation
+ - s:prototype.Initialize(): unlet self.cache_var after restoring values
+ - tlib#input#List: filter-specific help
+ - Removed the seq filter (use cnfd or fuzzy instead)
+ - tlib#input#List: temp_prompt (for help message)
+ MD5 checksum: aa8b5a4602235cc1a5bc9ee45d801b81
+
+version: "0.42"
+ - g:tlib#cache#silent: don't display messages when purging the cache (fixes #9)
+ - Changed message when deleting directories in the cache.
+ - g:tlib#input#use_popup: Don't rely on has('menu') but also check for gtk & win gui (fixes #10)
+ - debug
+ - tlib#input#ListW(): Didn't return a list when type == "m"
+ - docs (solves #11)
+ MD5 checksum: aa8b5a4602235cc1a5bc9ee45d801b81
+
+version: "0.45"
+ - fuzzy mode: prototype.highlight defaults to g:tlib_inputlist_higroup
+ - tlib#scratch: Use noautocmd
+ - tlib#input#ListW(): Use world.RestoreOrigin() instead of tlib#win#SetLayout(world.winview)
+ - tlib#input#ListW(): Revert to tlib#win#SetLayout(world.winview)
+ - tlib#cmd#OutputAsList(): Also save output in g:tlib#cmd#last_output
+ - tlib#agent#Suspend(): Resume on BufEnter
+ - tlib#input#Resume(): Make sure we are in the right buffer
+ - tlib#agent#Suspend(): Use only BufEnter event to trigger a Resume
+ - tlib#input#ListW(): When redisplaying a list, make sure prefix > 0
+ - tlib#vcs: Access vcs (initially only git is supported)
+ - tlib#vcs: improved
+ - tlib#persistent: Persistent data file names
+ - tlib#file#With(): Trigger BufRead autocommands
+ - Duplicate help tags (fixes #13)
+ - Make sure scrolloff is 0 while viewing the list (fixes https://github.com/tomtom/vikitasks_vim/issues/2)
+ MD5 checksum: 0af19ebc0e424727a598a988fdc90f4e
+
+ - Support for tinykeymap (move paragraph)
+ - Moved para_move to autoload/tinykeymap/map
+ - tlib#vcs: some "diff" commands were defined as "ls"; updated hg def; %s is optional
+ MD5 checksum: f2f2fe0893e75bb9423c1ddcd01f38f6
+version: "0.46"
+
+ - tlib#input#List: optimizations
+ - Prepare for multi-mode maps
+ - tlib#input#List: cnfx is new default filter
+ - Filters: minor changes to how the pattern is displayed
+ - g:tlib#input#format_filename: alternative method for formatting filenames
+ - tlib#input#List: allow multiple keymaps / modes
+ - Handle rezise events
+ - Don't initialize the same window twice
+ - Minor optimizations to how help is displayed
+ - Handle VimResize event per buffer
+ - Improve display of filenames & highlighting
+ - Filename highlighter: set Highlight_filename()
+ - RunStateHandlers(): set world variable
+ - Optimize help display
+ MD5 checksum: e3652927722bdc51935eb1a04238546b
+version: "1.00"
+
+ - Set g:tlib_inputlist_and to ' ' again
+ - g:tlib#input#filename_max_width: maximum display width of filenames
+ - tlib#input#List: <s-esc>, <f10>: run command by name
+ MD5 checksum: a42f90275cdbe9f7d92cac61b884a2d1
+version: "1.01"
+
+ - #UseInputListScratch(): Make sure the TLib autogroup was created (fixes #14)
+ MD5 checksum: 5a6da7fc99c7fc7584e8fc2f7bf86fe4
+version: "1.02"
+
+ - tlib#cache#Value(cfile, generator, ftime, ...): cache value & check timestamp
+ - Replaced g:tlib#cache#silent with g:tlib#cache#verbosity
+ - FormatFilenames: improved handling of utf8 characters
+ - tlib#persistent#Value()
+ - tlib#input#List: Allow filename indiactors defined by the caller
+ - Custom filename_indicators are displayed after (and clearly separted from) the standard indicators
+ - Check the return value of an unknown_key agent
+ - Format filename = "l": Allow ".." as start of a directory name
+ - Format filename = "l": If the filename is just a filename's tail, display it on both sides
+ - Set g:tlib_filename_sep to "\" on Windows (again)
+ - g:tlib#cache#max_filename: If the cache filename is longer than N characters, use |pathshorten()|.
+ MD5 checksum: b64ce6764f39f40bfc95f3916bbb0057
+version: "1.04"
+
+version: "1.05"
+ - tlib#hash: Adler32 & CRC32 (using zlib via ruby) algorithms
+ - tlib#cache#Filename(): If the cache filename is too long, add the Adler32 checksum to the shortened path
+ - tlib#cache#Filename(): Use tlib#hash#Adler32() only if the or() function exists
+ - tlib#hash#Adler32(): Raise error, if or() doesn't exist
+ - tlib#hash#CRC32(): Alternative implementation of crc32 (doesn't work yet, thus currently disabled)
+ - tlib#bitwise: Bitwise operations for older versions of vim
+ - tlib#number: Base conversion
+ - tlib#input#ListW(): Handle mouse clicks more correctly
+ - tlib#bitwise#Num2Bits(): Supports returning floats
+ - tlib#hash#CRC32(): Alternative implementation of crc32 (doesn't work yet)
+ - tlib#hash#CRC32(): Re-enable ruby version
+ - tlib#hash#CRC32B(): Implementation of CRC32B checksum in vimscript (used only if +ruby isn't available)
+ - tlib#hash#CRC32B(): vim version: cache the crc table
+ - tlib#cache#Filename(): Use tlib#hash#CRC32B(file) instead of not Adler32 for filenames too long
+ - tlib#hash#CRC32B(): ruby version: return upper case hex value
+ - g:tlib#hash#use_crc32: define which crc32b version should be used
+ - Moved spec files from vimtlib to tlib_vim
+ - tlib#bitwise#Add() and tlib#bitwise#Sub()
+ - tlib#file#Relative(): Wrong results for filenames that don't exist
+ - Implementation of hash#Adler32 for earlier vim versions; g:tlib#hash#use_adler32
+ - tlib#cache#Filename(): Use adler32 again
+ - addon-info
+ - tlib#file#Absolute(): remove redundant "." parts in full filename
+ - win32: Fix moving window when using :vertical for tlib#inpu#List()
+ - tlib#cache#Filename(): Don't create wrong directory if the cache filename is too long
+ - tlib#file#Join(): if strip_slashes, also strip redundant (back)slashes
+ - tlib#input#ListW(): Always set post_keys variable
+ - tlib#file#With(): escape backslashes
+ - tlib#cmd#OutputAsList(): Support for nesting
+ - tlib#dir#NativeName(dirname)
+ MD5 checksum: 493f9beca44374de386f20d1613155e3
+
+ - Rename g:tlib_debug to g:tlib#debug
+ - Renamed g:tlib_sortprefs_threshold to g:tlib#input#sortprefs_threshold
+ - Renamed g:tlib#input#livesearch_threshold
+ - Renamed g:tlib_inputlist_match to g:tlib#input#filter_mode
+ - Renamed g:tlib_inputlist_higroup to g:tlib#input#higroup
+ - Renamed g:tlib#debug
+ - Moved g:tlib_pick_last_item
+ - Renamed g:tlib#input#and, g:tlib#input#or, g:tlib#input#not
+ - Moved g:tlib_numeric_chars to autoload/tlib/input.vim
+ - Renamed g:tlib#input#keyagents_InputList_s, g:tlib#input#keyagents_InputList_m, g:tlib#input#handlers_EditList
+ - Moved g:tlib_inputlist_pct, g:tlib_inputlist_width_filename, g:tlib_inputlist_filename_indicators, g:tlib_inputlist_shortmessage to autoload/tlib/World.vim
+ - Renamed tlib#input#pick_last_item (2)
+ - prototype.SelectItemsByNames()
+ - filtered_items: Restricted view
+ - prototype.PrintLines()
+ - Restricted view (2)
+ - Moved g:tlib_scroll_lines to autoload/tlib/agent.vim
+ - prototype.PrintLines() (2)
+ - tlib#input: Improved handling of popup menu (allows submenu)
+ - tlib#input: Allow mods in keys
+ - Moved g:tlib_scratch_pos to autoload/tlib/scratch.vim
+ - Moved g:tlib_tags_extra, g:tlib_tag_substitute to autoload/tlib/tag.vim
+ - tlib#agent#CompleteAgentNames(): Respect Arglead
+ - Move g:tlib_viewline_position to autoload/tlib/buffer.vim
+ - Move g:tlib_cache to autoload/tlib/cache.vim
+ - Renamed g:tlib_filename_sep to g:tlib#dir#sep
+ - prototype.UseScratch(): Set b:tlib_world
+ - tlib#input: f9 toggles resticted view
+ - tlib#input: next_agent, next_eval
+ - tlib#input: Revised use of the popup menu
+ - tlib#input: Disable popup menu for gui_gtk
+ - tlib#input: Re-enabled the popup menu for gtk gui
+ - tlib#input: FIX popup menu on Windows
+ - Renamed g:tlib_numeric_chars to g:tlib#input#numeric_chars (disabled per-buffer values) (fixes #35)
+ - Improve scratch list
+ - New: tlib#grep
+ - Merge branch 'master' of https://github.com/bruno-/tlib_vim into pull16
+ - g:tlib_scratch_hidden: Configure how to "hide" the scratch buffer
+ - tlib#grep#Do: don't escape "*" in patterns
+ - Optimize use of visible scratch buffers
+ - World.scratch_hidden parameter
+ - scratch: Always use keepalt & keepjumps
+ MD5 checksum: 2e40449c47dc606ccef57aa0b1e22e8e
+version: "1.06"
+
+version: "1.07"
+ - Help template
+ - prototype.Highlight_filename(): Use matchstr() instead of fnamemodify()
+ - Display buffer-related filename indicators only if g:tlib_inputlist_filename_indicators is true
+ - tlib#file#Join(): strip_slashes defaults to 1
+ MD5 checksum: 6c8fa96fd3747be05df848ee93dd789b
+
+version: "1.08"
+ - list#input: Improved support for file indicators (closes #17)
+ - tlib#char#Get(): Optionally, also return mod
+ - tlib#input#ListW: Use #DisplayFormat(world.list)
+ - Renamed cnfx filter to glob & minor filter-related enhancements
+ - list#input: Make help available as command; help cannot be called via ?
+ - list#input: Improved help message
+ - list#input: Support Home & End keys
+ - list#input: Added glob filter
+ - tlib#agent#ShowInfo: Show full filename
+ - tlib#cmd#BrowseOutputWithCallback: Support calling callback with multiple results
+ - tlib#cmd#ParseScriptname: Properly parse results from :scriptnames
+ - tlib#tab#Set()
+ - Prepare for proper handling of scratch_split == -1
+ - tlib#vim#CopyFunction()
+ - tlib#cache#Value(): If generator is empty, use the optional argument as start value
+ - tlib#persistent#Get() refers to tlib#cache#Get()
+ MD5 checksum: 459ec620168d1ae9b18c69eb3f991832
+
+ - tlib#cache#Filename(): Use sha256() for VIM >= 7.4
+ - tlib#cache#Value(): Undo previous hack
+ - tlib#list#Uniq(): option to remove empty values
+ - tlib#cache#MTime(); tlib#persistent#Save() calls tlib#cache#Save()
+ - tlib#input#ListW: Temporarily set noshowmode
+ - tlib#list#Uniq(): Fix handling of empty items
+ - lis picker: Remove <C-Space> from help
+ - tlib#list#Uniq(): Implementation based on syntastic#util#unique(list) by scrooloose
+ MD5 checksum: b5fb4107d63930c2c8b1f0f6b3a7ff07
+version: "1.09"
+
+ - tlib#cache#Filename(): Use sha256() for VIM >= 7.4
+ - tlib#cache#Value(): Undo previous hack
+ - tlib#list#Uniq(): option to remove empty values
+ - tlib#cache#MTime(); tlib#persistent#Save() calls tlib#cache#Save()
+ - tlib#input#ListW: Temporarily set noshowmode
+ - tlib#list#Uniq(): Fix handling of empty items
+ - lis picker: Remove <C-Space> from help
+ - tlib#list#Uniq(): Implementation based on syntastic#util#unique(list) by scrooloose
+ MD5 checksum: b5fb4107d63930c2c8b1f0f6b3a7ff07
+version: "1.09"
+
+ - tlib#string#Chomp: Optional argument: max number of chars that should be removed
+ MD5 checksum: 8c1b94e25045580874e2f892d509291b
+version: "1.10"
+
+ - tlib#vcs#FindVCS(filename): Wrong parameters to fnamemodifiy if filename is a directory
+ - Some system-related functions (e.g. facilitate use of cygwin tools)
+ - tlib#arg#StringAsKeyArgsEqual(), tlib#arg#StringAsKeyArgs(): Support "key=val" type argument lists
+ - tlib#vcs#Executable()
+ - scripts/create_crc_table.rb
+ - tlib#var#Get(): For namespaces other than global, replace "#" with "_"
+ MD5 checksum: 4a33f2f23e1fc6600b32e7f8323e001e
+version: "1.11"
+
+ - tlib#list#ToDictionary()
+ - tlib#dir#CanonicName(): Use tlib#file#Canonic()
+ - tlib#file#Canonic()
+ MD5 checksum: 7995ab58f31eb6673d20deab8761838e
+version: "1.12"
+
+ - SetInitialFilter(): Use deepcopy()
+ - tlib#var#List(): use keys(namespace) for newer versions of vim
+ - g:tlib#input#user_shortcuts (not functional yet)
+ - tlib#input#List: state "picked"
+ - UseInputListScratch(): Allow customization via self.index_next_syntax
+ - tlib#cmd#Capture()
+ - Facilitate customization of key agents via g:tlib_extend_keyagents_InputList_s, g:tlib_extend_keyagents_InputList_m
+ MD5 checksum: 7dd8b17a1a5b555df979381dcbd4c9aa
+version: "1.13"
+
+ - SetInitialFilter(): Use deepcopy()
+ - tlib#var#List(): use keys(namespace) for newer versions of vim
+ - g:tlib#input#user_shortcuts (not functional yet)
+ - tlib#input#List: state "picked"
+ - UseInputListScratch(): Allow customization via self.index_next_syntax
+ - tlib#cmd#Capture()
+ - Facilitate customization of key agents via g:tlib_extend_keyagents_InputList_s, g:tlib_extend_keyagents_InputList_m
+ MD5 checksum: 7dd8b17a1a5b555df979381dcbd4c9aa
+version: "1.13"
+
+version: "1.14"
+ - FIX #18: Make sure the scratch isn't readonly
+ - FIX: display filter (properly handle backslashes)
+ - Remove loaded_* guard from autoload files
+ - tlib#notify#Echo(): minor changes
+ - tlib#file#Edit() (used by tlib#agent#ViewFile)
+ - tlib#buffer#GetList(): Buffer numbers are converted to numbers
+ - tlib#sys: Change order of functions (move tlib#sys#IsCygwinBin to the (possibly FIX #19)
+ - g:tlib#sys#check_cygpath: Call tlib#sys#IsExecutable('cygpath', 1) (possibly FIX #19)
+ MD5 checksum: 2cf6386218736a2d09db43c8e751e5a4
+
+version: "1.15"
+ - tlib#file#Join(): New optional argument: maybe_absolute Drop preceding parts if a part looks like an absolute filename
+ - tlib#sys#Open(), tlib#sys#IsSpecial() (moved from viki)
+ - tlib#list#Uniq(): Handle hetergenous lists
+ - FIX #21: duplicate help tag
+ - NEW tlib#dictionary#Rev()
+ - tlib#input#List(): Use <Tab> to complete current word
+ - NEW tlib#arg#GetOpts(); ENH tlib#arg#StringAsKeyArgsEqual()
+ - cache: Allow for in memory cache
+ - NEW tlib#eval#Extend()
+ - Move qfl/loclist browser from trag to tlib
+ - FIX tlib#eval#Extend()
+ - Simplify tlib#eval#Extend()
+ - World.index_next_syntax may be a dict
+ - tlib#qfl#QflList: Use copy()
+ - tlib#arg#GetOpts: Handle exit code
+ MD5 checksum: 13fd8b0e4ba9cd932c57fc40ac3f641f
+
+version: "1.15"
+ - tlib#file#Join(): New optional argument: maybe_absolute Drop preceding parts if a part looks like an absolute filename
+ - tlib#sys#Open(), tlib#sys#IsSpecial() (moved from viki)
+ - tlib#list#Uniq(): Handle hetergenous lists
+ - FIX #21: duplicate help tag
+ - NEW tlib#dictionary#Rev()
+ - tlib#input#List(): Use <Tab> to complete current word
+ - NEW tlib#arg#GetOpts(); ENH tlib#arg#StringAsKeyArgsEqual()
+ - cache: Allow for in memory cache
+ - NEW tlib#eval#Extend()
+ - Move qfl/loclist browser from trag to tlib
+ - FIX tlib#eval#Extend()
+ - Simplify tlib#eval#Extend()
+ - World.index_next_syntax may be a dict
+ - tlib#qfl#QflList: Use copy()
+ - tlib#arg#GetOpts: Handle exit code
+ MD5 checksum: 13fd8b0e4ba9cd932c57fc40ac3f641f
+
+ - tlib#arg#GetOpts: Handle short options
+ - tlib#arg: support short flags & facilitate completion
+ - NEW :TLibTrace
+ - tlib#sys#system_browser: FIX XDG string
+ - NEW tlib#sys#SystemInDir() (used by tlib#vcs#Ls)
+ - tlib#agent#Complete: improve fltrx
+ - Remove tlib#arg#Key(), :TKeyArg
+ - Move :TRequire, :TTimeCommand to macros/tlib.vim
+ - NEW tlib#cmd#TBrowseScriptnames()
+ - TScratch: use empty('<bang>')
+ - NEW :TLibTrace
+ - tlib#qfl: FIX TTagedFilesFilename regexp
+ - Remove tlib#arg#Key()
+ - tlib#buffer#InsertText(): Don't use TKeyArg
+ - tlib#eval#Extend: don't assign value
+ - NEW :TLibTrace, tlib#trace (was tlib#debug)
+ - NEW tlib#string#SplitCommaList()
+ - NEW tlib#time#FormatNow()
+ - tlib#arg#GetOpts: selectively disable "long", "short" flags
+ - tlib#arg#CComplete(): Support values completion (complete_customlist field)
+ - NEW tlib#date#Shift()
+ - tlib#qfl#Balloon(): Handle items with no bufnr
+ - NEW tlib#file#Glob, tlib#file#Globpath
+ - tlib#progressbar#Display(): optional "always" argument
+ - tlib#vcs#GitLsPostprocess(): Try to handle encoded filenames from git ls-files
+ - tlib#vcs#GitLsPostprocess: Eval only \ddd substrings
+ - FIX #22: duplicate tag
+ - tlib#buffer: Use 2match instead of 3match (incompatibility with matchparen)
+ - FIX #23: duplicate help tag
+ - tlib#string#SplitCommaList: optional "sep" argument
+ - Rename TLibTrace -> Tlibtrace; NEW Tlibtraceset command
+ - Rename s:SetSyntax -> tlib#qfl#SetSyntax
+ - mv tlib#rx#Convert to incubator
+ MD5 checksum: f3656fb35b7b3033084d6c5e504aca61
+version: "1.16"
+
+ - tlib#input#List: #ReduceFilter: make sure the regexp is valid
+ - TTimeCommand -> Ttimecommand
+ - tlib#eval#Extend: mode argument for expand() compatibility
+ - tlib#input#List: Key handlers can have additional arguments
+ - tlib#qfl#AgentWithSelected: Set world
+ - prototype.UseInputListScratch: Run tlib_UseInputListScratch hook earlier
+ - tlib#qfl#AgentWithSelected: typo
+ - tlib#arg#GetOpts: type conversion (comma-separated lists etc.)
+ - tlib#arg: validators
+ - NEW tlib#date#IsDate()
+ - tlib#balloon#Remove: Unset &ballooneval, &balloonexpr
+ - NEW tlib#balloon#Expand()
+ - NEW tlib#date#Format()
+ - FIX tlib#date#Shift(..., "+Xm") for months
+ - NEW tlib#trace#Backtrace()
+ - NEW tlib#type#Is(), tlib#type#Are(), tlib#type#Has(), tlib#type#Have()
+ - NEW :Tlibassert
+ MD5 checksum: 3c4125a28ff1860accd254846651c251
+version: "1.17"
+
+ - tlib#input#List: #ReduceFilter: make sure the regexp is valid
+ - TTimeCommand -> Ttimecommand
+ - tlib#eval#Extend: mode argument for expand() compatibility
+ - tlib#input#List: Key handlers can have additional arguments
+ - tlib#qfl#AgentWithSelected: Set world
+ - prototype.UseInputListScratch: Run tlib_UseInputListScratch hook earlier
+ - tlib#qfl#AgentWithSelected: typo
+ - tlib#arg#GetOpts: type conversion (comma-separated lists etc.)
+ - tlib#arg: validators
+ - NEW tlib#date#IsDate()
+ - tlib#balloon#Remove: Unset &ballooneval, &balloonexpr
+ - NEW tlib#balloon#Expand()
+ - NEW tlib#date#Format()
+ - FIX tlib#date#Shift(..., "+Xm") for months
+ - NEW tlib#trace#Backtrace()
+ - NEW tlib#type#Is(), tlib#type#Are(), tlib#type#Has(), tlib#type#Have()
+ - NEW :Tlibassert
+ MD5 checksum: 3c4125a28ff1860accd254846651c251
+version: "1.17"
+
+ - tlib#input#List: #ReduceFilter: make sure the regexp is valid
+ - TTimeCommand -> Ttimecommand
+ - tlib#eval#Extend: mode argument for expand() compatibility
+ - tlib#input#List: Key handlers can have additional arguments
+ - tlib#qfl#AgentWithSelected: Set world
+ - prototype.UseInputListScratch: Run tlib_UseInputListScratch hook earlier
+ - tlib#qfl#AgentWithSelected: typo
+ - tlib#arg#GetOpts: type conversion (comma-separated lists etc.)
+ - tlib#arg: validators
+ - NEW tlib#date#IsDate()
+ - tlib#balloon#Remove: Unset &ballooneval, &balloonexpr
+ - NEW tlib#balloon#Expand()
+ - NEW tlib#date#Format()
+ - FIX tlib#date#Shift(..., "+Xm") for months
+ - NEW tlib#trace#Backtrace()
+ - NEW tlib#type#Is(), tlib#type#Are(), tlib#type#Has(), tlib#type#Have()
+ - NEW :Tlibassert
+ MD5 checksum: 3c4125a28ff1860accd254846651c251
+version: "1.17"
+
+ - tlib#input#List: #ReduceFilter: make sure the regexp is valid
+ - TTimeCommand -> Ttimecommand
+ - tlib#eval#Extend: mode argument for expand() compatibility
+ - tlib#input#List: Key handlers can have additional arguments
+ - tlib#qfl#AgentWithSelected: Set world
+ - prototype.UseInputListScratch: Run tlib_UseInputListScratch hook earlier
+ - tlib#qfl#AgentWithSelected: typo
+ - tlib#arg#GetOpts: type conversion (comma-separated lists etc.)
+ - tlib#arg: validators
+ - NEW tlib#date#IsDate()
+ - tlib#balloon#Remove: Unset &ballooneval, &balloonexpr
+ - NEW tlib#balloon#Expand()
+ - NEW tlib#date#Format()
+ - FIX tlib#date#Shift(..., "+Xm") for months
+ - NEW tlib#trace#Backtrace()
+ - NEW tlib#type#Is(), tlib#type#Are(), tlib#type#Has(), tlib#type#Have()
+ - NEW :Tlibassert
+ MD5 checksum: 3c4125a28ff1860accd254846651c251
+version: "1.17"
+
+ - tlib#arg: Completion for comma-separated lists
+ - Use "silent cd"
+ - NEW tlib#type#DefSchema(); FIX tlib#type#Has()
+ - tlib#cache#Value(): minor change
+ - tlib#date#IsDate() also checks whether the date is valid
+ - ! tlib#sys#Open(): escape special chars only once
+ - tlib#trace#Print: Allow for strings
+ - :Tlibtrace, :Tlibtraceset, :Tlibassert remove `-bar`
+ - NEW :Tlibtype (type/schema assertions); tlib#type#Is() also accepts schemas as "types"
+ - tlib#dir#CD(): Use haslocaldir()
+ - tlib#qfl#AgentGotoQFE: Don't use wincmd w
+ - NEW tlib#string#Input()
+ - FIX g:tlib#sys#system_rx; add OpenOffice exensions to g:tlib#sys#special_suffixes
+ - NEW tlib#selection#GetSelection()
+ - tlib#date#Shift(): Fix "Xm", ++specs
+ - tlib#trace#Set: FIX Properly handly "-label"
+ MD5 checksum: c3a1fe7d3cd86becbd3f7b0ba7ae9cd8
+version: "1.19"
+
+version: "1.20"
+ - tlib#arg: Completion for comma-separated lists
+ - Use "silent cd"
+ - NEW tlib#type#DefSchema(); FIX tlib#type#Has()
+ - tlib#cache#Value(): minor change
+ - tlib#date#IsDate() also checks whether the date is valid
+ - ! tlib#sys#Open(): escape special chars only once
+ - tlib#trace#Print: Allow for strings
+ - :Tlibtrace, :Tlibtraceset, :Tlibassert remove `-bar`
+ - NEW :Tlibtype (type/schema assertions); tlib#type#Is() also accepts schemas as "types"
+ - tlib#dir#CD(): Use haslocaldir()
+ - tlib#qfl#AgentGotoQFE: Don't use wincmd w
+ - NEW tlib#string#Input()
+ - FIX g:tlib#sys#system_rx; add OpenOffice exensions to g:tlib#sys#special_suffixes
+ - NEW tlib#selection#GetSelection()
+ - tlib#date#Shift(): Fix "Xm", ++specs
+ - tlib#trace#Set: FIX Properly handly "-label"
+ MD5 checksum: c919e0782931a8c628c6996903f989d3
+
diff --git a/vim/bundle/tlib_vim/LICENSE.TXT b/vim/bundle/tlib_vim/LICENSE.TXT
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/vim/bundle/tlib_vim/LICENSE.TXT
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/vim/bundle/tlib_vim/README b/vim/bundle/tlib_vim/README
new file mode 100644
index 0000000..70f6958
--- /dev/null
+++ b/vim/bundle/tlib_vim/README
@@ -0,0 +1,21 @@
+This library provides some utility functions. There isn't much need to
+install it unless another plugin requires you to do so.
+
+Most of the library is included in autoload files. No autocommands are
+created. With the exception of loading ../plugin/02tlib.vim at startup
+the library has no impact on startup time or anything else.
+
+The change-log is included at the bottom of ../plugin/02tlib.vim
+(move the cursor over the file name and type gfG)
+
+Demo of |tlib#input#List()|:
+http://vimsomnia.blogspot.com/2010/11/selecting-items-from-list-with-tlibs.html
+
+
+-----------------------------------------------------------------------
+
+
+License: GPLv3 or later
+Install: See http://github.com/tomtom/vimtlib/blob/master/INSTALL.TXT
+See http://github.com/tomtom for related plugins.
+
diff --git a/vim/bundle/tlib_vim/addon-info.json b/vim/bundle/tlib_vim/addon-info.json
new file mode 100644
index 0000000..3585531
--- /dev/null
+++ b/vim/bundle/tlib_vim/addon-info.json
@@ -0,0 +1,9 @@
+{
+ "name" : "tlib",
+ "version" : "dev",
+ "author" : "Tom Link <micathom at gmail com>",
+ "maintainer" : "Tom Link <micathom at gmail com>",
+ "repository" : {"type": "git", "url": "git://github.com/tomtom/tlib_vim.git"},
+ "dependencies" : {},
+ "description" : "tlib -- A library of vim functions"
+}
diff --git a/vim/bundle/tlib_vim/autoload/tinykeymap/map/para_move.vim b/vim/bundle/tlib_vim/autoload/tinykeymap/map/para_move.vim
new file mode 100644
index 0000000..908f5f7
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tinykeymap/map/para_move.vim
@@ -0,0 +1,12 @@
+" para_move.vim
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2012-08-28.
+" @Last Change: 2012-08-29.
+" @Revision: 3
+
+" Move paragraphs
+call tinykeymap#EnterMap("para_move", "gp", {'name': 'move paragraph'})
+call tinykeymap#Map("para_move", "j", "silent call tlib#paragraph#Move('Down', '<count>')")
+call tinykeymap#Map("para_move", "k", "silent call tlib#paragraph#Move('Up', '<count>')")
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib.vim b/vim/bundle/tlib_vim/autoload/tlib.vim
new file mode 100755
index 0000000..5d805ac
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib.vim
@@ -0,0 +1,8 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 13
+
+" :nodefault:
+TLet g:tlib#debug = 0
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/Filter_cnf.vim b/vim/bundle/tlib_vim/autoload/tlib/Filter_cnf.vim
new file mode 100755
index 0000000..0bcb6c0
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/Filter_cnf.vim
@@ -0,0 +1,151 @@
+" Filter_cnf.vim
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2008-11-25.
+" @Last Change: 2014-11-18.
+" @Revision: 0.0.114
+
+let s:prototype = tlib#Object#New({'_class': ['Filter_cnf'], 'name': 'cnf'}) "{{{2
+let s:prototype.highlight = g:tlib#input#higroup
+
+" The search pattern for |tlib#input#List()| is in conjunctive normal
+" form: (P1 OR P2 ...) AND (P3 OR P4 ...) ...
+" The pattern is a '/\V' very no-'/magic' regexp pattern.
+"
+" Pressing <space> joins two patterns with AND.
+" Pressing | joins two patterns with OR.
+" I.e. In order to get "lala AND (foo OR bar)", you type
+" "lala foo|bar".
+"
+" This is also the base class for other filters.
+function! tlib#Filter_cnf#New(...) "{{{3
+ let object = s:prototype.New(a:0 >= 1 ? a:1 : {})
+ return object
+endf
+
+
+" :nodoc:
+function! s:prototype.Init(world) dict "{{{3
+endf
+
+
+" :nodoc:
+function! s:prototype.Help(world) dict "{{{3
+ call a:world.PushHelp(
+ \ printf('"%s", "%s", "%sWORD"', g:tlib#input#and, g:tlib#input#or, g:tlib#input#not),
+ \ 'AND, OR, NOT')
+endf
+
+
+" :nodoc:
+function! s:prototype.AssessName(world, name) dict "{{{3
+ let xa = 0
+ let prefix = self.FilterRxPrefix()
+ for flt in a:world.filter_pos
+ " let flt = prefix . a:world.GetRx(fltl)
+ " if flt =~# '\u' && a:name =~# flt
+ " let xa += 5
+ " endif
+
+ if a:name =~ '\^'. flt
+ let xa += 4
+ elseif a:name =~ '\<'. flt
+ let xa += 3
+ " elseif a:name =~ '[[:punct:][:space:][:digit:]]'. flt
+ " let xa += 2
+ elseif a:name =~ '\A'. flt .'\|'. flt .'\A'
+ let xa += 1
+ endif
+ endfor
+ " TLogVAR a:name, xa
+ return xa
+endf
+
+
+" :nodoc:
+function! s:prototype.Match(world, text) dict "{{{3
+ " TLogVAR a:text
+ " let sc = &smartcase
+ " let ic = &ignorecase
+ " if &ignorecase
+ " set smartcase
+ " endif
+ " try
+ if !empty(a:world.filter_neg)
+ for rx in a:world.filter_neg
+ " TLogVAR rx
+ if a:text =~ rx
+ return 0
+ endif
+ endfor
+ endif
+ if !empty(a:world.filter_pos)
+ for rx in a:world.filter_pos
+ " TLogVAR rx
+ if a:text !~ rx
+ return 0
+ endif
+ endfor
+ endif
+ " finally
+ " let &smartcase = sc
+ " let &ignorecase = ic
+ " endtry
+ return 1
+endf
+
+
+" :nodoc:
+function! s:prototype.DisplayFilter(filter) dict "{{{3
+ let filter1 = deepcopy(a:filter)
+ call map(filter1, '"(". join(reverse(self.Pretty(v:val)), " OR ") .")"')
+ return join(reverse(filter1), ' AND ')
+endf
+
+
+function! s:prototype.Pretty(filter) dict "{{{3
+ " call map(a:filter, 'substitute(v:val, ''\\\.\\{-}'', ''=>'', ''g'')')
+ call map(a:filter, 'self.CleanFilter(v:val)')
+ return a:filter
+endf
+
+
+" :nodoc:
+function! s:prototype.SetFrontFilter(world, pattern) dict "{{{3
+ let a:world.filter[0] = reverse(split(a:pattern, '\s*|\s*')) + a:world.filter[0][1 : -1]
+endf
+
+
+" :nodoc:
+function! s:prototype.PushFrontFilter(world, char) dict "{{{3
+ let a:world.filter[0][0] .= nr2char(a:char)
+endf
+
+
+" :nodoc:
+function! s:prototype.ReduceFrontFilter(world) dict "{{{3
+ let filter = a:world.filter[0][0]
+ " TLogVAR filter
+ let str = matchstr(filter, '\(\\\(\.\\{-}\|[.?*+$^]\)\|\)$')
+ if empty(str)
+ let filter = filter[0 : -2]
+ else
+ let filter = strpart(filter, 0, len(filter) - len(str))
+ endif
+ " TLogVAR str, filter
+ let a:world.filter[0][0] = filter
+endf
+
+
+" :nodoc:
+function! s:prototype.FilterRxPrefix() dict "{{{3
+ return '\V'
+endf
+
+
+" :nodoc:
+function! s:prototype.CleanFilter(filter) dict "{{{3
+ return a:filter
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/Filter_cnfd.vim b/vim/bundle/tlib_vim/autoload/tlib/Filter_cnfd.vim
new file mode 100755
index 0000000..27f00fe
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/Filter_cnfd.vim
@@ -0,0 +1,53 @@
+" Filter_cnfd.vim
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2008-11-25.
+" @Last Change: 2014-01-23.
+" @Revision: 0.0.57
+
+let s:prototype = tlib#Filter_cnf#New({'_class': ['Filter_cnfd'], 'name': 'cnfd'}) "{{{2
+let s:prototype.highlight = g:tlib#input#higroup
+
+
+" The same as |tlib#Filter_cnf#New()| but a dot is expanded to '\.\{-}'.
+" As a consequence, patterns cannot match dots.
+" The pattern is a '/\V' very no-'/magic' regexp pattern.
+function! tlib#Filter_cnfd#New(...) "{{{3
+ let object = s:prototype.New(a:0 >= 1 ? a:1 : {})
+ return object
+endf
+
+
+" :nodoc:
+function! s:prototype.Init(world) dict "{{{3
+endf
+
+
+let s:Help = s:prototype.Help
+
+" :nodoc:
+function! s:prototype.Help(world) dict "{{{3
+ call call(s:Help, [a:world], self)
+ call a:world.PushHelp('.', 'Any characters')
+endf
+
+
+" :nodoc:
+function! s:prototype.SetFrontFilter(world, pattern) dict "{{{3
+ let pattern = substitute(a:pattern, '\.', '\\.\\{-}', 'g')
+ let a:world.filter[0] = reverse(split(pattern, '\s*|\s*')) + a:world.filter[0][1 : -1]
+endf
+
+
+" :nodoc:
+function! s:prototype.PushFrontFilter(world, char) dict "{{{3
+ let a:world.filter[0][0] .= a:char == 46 ? '\.\{-}' : nr2char(a:char)
+endf
+
+
+" :nodoc:
+function! s:prototype.CleanFilter(filter) dict "{{{3
+ return substitute(a:filter, '\\.\\{-}', '.', 'g')
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/Filter_fuzzy.vim b/vim/bundle/tlib_vim/autoload/tlib/Filter_fuzzy.vim
new file mode 100755
index 0000000..349bfd5
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/Filter_fuzzy.vim
@@ -0,0 +1,83 @@
+" Filter_fuzzy.vim
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2008-11-25.
+" @Last Change: 2013-09-25.
+" @Revision: 0.0.47
+
+let s:prototype = tlib#Filter_cnf#New({'_class': ['Filter_fuzzy'], 'name': 'fuzzy'}) "{{{2
+let s:prototype.highlight = g:tlib#input#higroup
+
+
+" Support for "fuzzy" pattern matching in |tlib#input#List()|.
+" Patterns are interpreted as if characters were connected with '.\{-}'.
+"
+" In "fuzzy" mode, the pretty printing of filenames is disabled.
+function! tlib#Filter_fuzzy#New(...) "{{{3
+ let object = s:prototype.New(a:0 >= 1 ? a:1 : {})
+ return object
+endf
+
+
+" :nodoc:
+function! s:prototype.Init(world) dict "{{{3
+ " TLogVAR a:world.display_format
+ " :nodoc:
+ function! a:world.Set_display_format(value) dict
+ if a:value == 'filename'
+ let self.display_format = ''
+ else
+ let self.display_format = a:value
+ endif
+ endf
+endf
+
+
+let s:Help = s:prototype.Help
+
+" :nodoc:
+function! s:prototype.Help(world) dict "{{{3
+ call call(s:Help, [a:world], self)
+ call a:world.PushHelp('Patterns are interpreted as if characters were connected with .\{-}')
+endf
+
+
+" :nodoc:
+function! s:prototype.DisplayFilter(filter) dict "{{{3
+ " TLogVAR a:filter
+ let filter1 = deepcopy(a:filter)
+ call map(filter1, '"{". join(reverse(v:val), " OR ") ."}"')
+ return join(reverse(filter1), ' AND ')
+endf
+
+
+" :nodoc:
+function! s:prototype.SetFrontFilter(world, pattern) dict "{{{3
+ let a:world.filter[0] = map(reverse(split(a:pattern, '\s*|\s*')), 'join(map(split(v:val, ''\zs''), ''tlib#rx#Escape(v:val, "V")''), ''\.\{-}'')') + a:world.filter[0][1 : -1]
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.PushFrontFilter(world, char) dict "{{{3
+ let ch = tlib#rx#Escape(nr2char(a:char), 'V')
+ if empty(a:world.filter[0][0])
+ let a:world.filter[0][0] .= ch
+ else
+ let a:world.filter[0][0] .= '\.\{-}'. ch
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.ReduceFrontFilter(world) dict "{{{3
+ let a:world.filter[0][0] = substitute(a:world.filter[0][0], '\(\\\.\\{-}\)\?.$', '', '')
+endf
+
+
+" :nodoc:
+function! s:prototype.CleanFilter(filter) dict "{{{3
+ return substitute(a:filter, '\\\.\\{-}', '', 'g')
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/Filter_glob.vim b/vim/bundle/tlib_vim/autoload/tlib/Filter_glob.vim
new file mode 100644
index 0000000..904b226
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/Filter_glob.vim
@@ -0,0 +1,68 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2008-11-25.
+" @Last Change: 2014-11-18.
+" @Revision: 0.0.82
+
+let s:prototype = tlib#Filter_cnf#New({'_class': ['Filter_glob'], 'name': 'glob'}) "{{{2
+let s:prototype.highlight = g:tlib#input#higroup
+
+
+" A character that should be expanded to '\.\{-}'.
+TLet g:tlib#Filter_glob#seq = '*'
+
+
+" A character that should be expanded to '\.\?'.
+TLet g:tlib#Filter_glob#char = '?'
+
+
+" The same as |tlib#Filter_cnf#New()| but a a customizable character
+" |see tlib#Filter_glob#seq| is expanded to '\.\{-}' and
+" |g:tlib#Filter_glob#char| is expanded to '\.'.
+" The pattern is a '/\V' very no-'/magic' regexp pattern.
+function! tlib#Filter_glob#New(...) "{{{3
+ let object = s:prototype.New(a:0 >= 1 ? a:1 : {})
+ return object
+endf
+
+
+let s:Help = s:prototype.Help
+
+" :nodoc:
+function! s:prototype.Help(world) dict "{{{3
+ call call(s:Help, [a:world], self)
+ call a:world.PushHelp(g:tlib#Filter_glob#seq, 'Any characters')
+ call a:world.PushHelp(g:tlib#Filter_glob#char, 'Single characters')
+endf
+
+
+" :nodoc:
+function! s:prototype.SetFrontFilter(world, pattern) dict "{{{3
+ let pattern = substitute(a:pattern, tlib#rx#Escape(g:tlib#Filter_glob#seq, 'V'), '\\.\\{-}', 'g')
+ let pattern = substitute(a:pattern, tlib#rx#Escape(g:tlib#Filter_glob#char, 'V'), '\\.', 'g')
+ let a:world.filter[0] = reverse(split(pattern, '\s*|\s*')) + a:world.filter[0][1 : -1]
+endf
+
+
+" :nodoc:
+function! s:prototype.PushFrontFilter(world, char) dict "{{{3
+ " TLogVAR a:char, nr2char(a:char)
+ if a:char == char2nr(g:tlib#Filter_glob#seq)
+ let char = '\.\{-}'
+ elseif a:char == char2nr(g:tlib#Filter_glob#char)
+ let char = '\.'
+ else
+ let char = nr2char(a:char)
+ endif
+ let a:world.filter[0][0] .= char
+endf
+
+
+" :nodoc:
+function! s:prototype.CleanFilter(filter) dict "{{{3
+ let filter = substitute(a:filter, '\\\.\\{-}', g:tlib#Filter_glob#seq, 'g')
+ let filter = substitute(filter, '\\\.', g:tlib#Filter_glob#char, 'g')
+ return filter
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/Object.vim b/vim/bundle/tlib_vim/autoload/tlib/Object.vim
new file mode 100755
index 0000000..21f38b2
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/Object.vim
@@ -0,0 +1,154 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 127
+
+" :filedoc:
+" Provides a prototype plus some OO-like methods.
+
+let s:id_counter = 0
+let s:prototype = {'_class': ['object'], '_super': [], '_id': 0} "{{{2
+
+" :def: function! tlib#Object#New(?fields={})
+" This function creates a prototype that provides some kind of
+" inheritance mechanism and a way to call parent/super methods.
+"
+" The usage demonstrated in the following example works best when every
+" class/prototype is defined in a file of its own.
+"
+" The reason for why there is a dedicated constructor function is that
+" this layout facilitates the use of templates and that methods are
+" hidden from the user. Other solutions are possible.
+"
+" EXAMPLES: >
+" let s:prototype = tlib#Object#New({
+" \ '_class': ['FooBar'],
+" \ 'foo': 1,
+" \ 'bar': 2,
+" \ })
+" " Constructor
+" function! FooBar(...)
+" let object = s:prototype.New(a:0 >= 1 ? a:1 : {})
+" return object
+" endf
+" function! s:prototype.babble() {
+" echo "I think, therefore I am ". (self.foo * self.bar) ." months old."
+" }
+"
+" < This could now be used like this: >
+" let myfoo = FooBar({'foo': 3})
+" call myfoo.babble()
+" => I think, therefore I am 6 months old.
+" echo myfoo.IsA('FooBar')
+" => 1
+" echo myfoo.IsA('object')
+" => 1
+" echo myfoo.IsA('Foo')
+" => 0
+" echo myfoo.RespondTo('babble')
+" => 1
+" echo myfoo.RespondTo('speak')
+" => 0
+function! tlib#Object#New(...) "{{{3
+ return s:prototype.New(a:0 >= 1 ? a:1 : {})
+endf
+
+
+function! s:prototype.New(...) dict "{{{3
+ let object = deepcopy(self)
+ let s:id_counter += 1
+ let object._id = s:id_counter
+ if a:0 >= 1 && !empty(a:1)
+ " call object.Extend(deepcopy(a:1))
+ call object.Extend(a:1)
+ endif
+ return object
+endf
+
+
+function! s:prototype.Inherit(object) dict "{{{3
+ let class = copy(self._class)
+ " TLogVAR class
+ let objid = self._id
+ for c in get(a:object, '_class', [])
+ " TLogVAR c
+ if index(class, c) == -1
+ call add(class, c)
+ endif
+ endfor
+ call extend(self, a:object, 'keep')
+ let self._class = class
+ " TLogVAR self._class
+ let self._id = objid
+ " let self._super = [super] + self._super
+ call insert(self._super, a:object)
+ return self
+endf
+
+
+function! s:prototype.Extend(dictionary) dict "{{{3
+ let super = copy(self)
+ let class = copy(self._class)
+ " TLogVAR class
+ let objid = self._id
+ let thisclass = get(a:dictionary, '_class', [])
+ for c in type(thisclass) == 3 ? thisclass : [thisclass]
+ " TLogVAR c
+ if index(class, c) == -1
+ call add(class, c)
+ endif
+ endfor
+ call extend(self, a:dictionary)
+ let self._class = class
+ " TLogVAR self._class
+ let self._id = objid
+ " let self._super = [super] + self._super
+ call insert(self._super, super)
+ return self
+endf
+
+
+function! s:prototype.IsA(class) dict "{{{3
+ return index(self._class, a:class) != -1
+endf
+
+
+function! s:prototype.IsRelated(object) dict "{{{3
+ return len(filter(a:object._class, 'self.IsA(v:val)')) > 1
+endf
+
+
+function! s:prototype.RespondTo(name) dict "{{{3
+ " return has_key(self, a:name) && type(self[a:name]) == 2
+ return has_key(self, a:name)
+endf
+
+
+function! s:prototype.Super(method, arglist) dict "{{{3
+ for o in self._super
+ " TLogVAR o
+ if o.RespondTo(a:method)
+ " let self._tmp_method = o[a:method]
+ " TLogVAR self._tmp_method
+ " return call(self._tmp_method, a:arglist, self)
+ return call(o[a:method], a:arglist, self)
+ endif
+ endfor
+ echoerr 'tlib#Object: Does not respond to '. a:method .': '. string(self)
+endf
+
+
+function! tlib#Object#Methods(object, ...) "{{{3
+ TVarArg ['pattern', '\d\+']
+ let o = items(a:object)
+ call filter(o, 'type(v:val[1]) == 2 && string(v:val[1]) =~ "^function(''\\d\\+'')"')
+ let acc = {}
+ for e in o
+ let id = matchstr(string(e[1]), pattern)
+ if !empty(id)
+ let acc[id] = e[0]
+ endif
+ endfor
+ return acc
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/Test.vim b/vim/bundle/tlib_vim/autoload/tlib/Test.vim
new file mode 100755
index 0000000..4a4281e
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/Test.vim
@@ -0,0 +1,19 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 11
+
+" :enddoc:
+
+
+let s:prototype = tlib#Object#New({'_class': ['Test']}) "{{{2
+function! tlib#Test#New(...) "{{{3
+ let object = s:prototype.New(a:0 >= 1 ? a:1 : {})
+ return object
+endf
+
+
+function! s:prototype.Dummy() dict "{{{3
+ return 'Test.vim'
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/TestChild.vim b/vim/bundle/tlib_vim/autoload/tlib/TestChild.vim
new file mode 100755
index 0000000..16979a7
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/TestChild.vim
@@ -0,0 +1,19 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 15
+
+" :enddoc:
+
+
+let s:prototype = tlib#Test#New({'_class': ['TestChild']}) "{{{2
+function! tlib#TestChild#New(...) "{{{3
+ let object = s:prototype.New(a:0 >= 1 ? a:1 : {})
+ return object
+endf
+
+
+function! s:prototype.Dummy() dict "{{{3
+ return 'TestChild.vim'
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/World.vim b/vim/bundle/tlib_vim/autoload/tlib/World.vim
new file mode 100755
index 0000000..aa1bc9e
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/World.vim
@@ -0,0 +1,1404 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 1434
+
+" :filedoc:
+" A prototype used by |tlib#input#List|.
+" Inherits from |tlib#Object#New|.
+
+
+" Size of the input list window (in percent) from the main size (of &lines).
+" See |tlib#input#List()|.
+TLet g:tlib_inputlist_pct = 50
+
+" Size of filename columns when listing filenames.
+" See |tlib#input#List()|.
+TLet g:tlib_inputlist_width_filename = '&co / 3'
+" TLet g:tlib_inputlist_width_filename = 25
+
+" If true, |tlib#input#List()| will show some indicators about the
+" status of a filename (e.g. buflisted(), bufloaded() etc.).
+" This is disabled by default because vim checks also for the file on
+" disk when doing this.
+TLet g:tlib_inputlist_filename_indicators = 0
+
+" If not null, display only a short info about the filter.
+TLet g:tlib_inputlist_shortmessage = 0
+
+
+
+" Known keys & values:
+" scratch_split ... See |tlib#scratch#UseScratch()|
+let s:prototype = tlib#Object#New({
+ \ '_class': 'World',
+ \ 'name': 'world',
+ \ 'allow_suspend': 1,
+ \ 'base': [],
+ \ 'bufnr': -1,
+ \ 'buffer_local': 1,
+ \ 'cache_var': '',
+ \ 'display_format': '',
+ \ 'fileencoding': &fileencoding,
+ \ 'fmt_display': {},
+ \ 'fmt_filter': {},
+ \ 'fmt_options': {},
+ \ 'filetype': '',
+ \ 'filter': [['']],
+ \ 'filter_format': '',
+ \ 'filter_options': '',
+ \ 'follow_cursor': '',
+ \ 'has_menu': 0,
+ \ 'help_extra': [],
+ \ 'index_table': [],
+ \ 'initial_filter': [['']],
+ \ 'initial_index': 1,
+ \ 'initial_display': 1,
+ \ 'initialized': 0,
+ \ 'key_handlers': [],
+ \ 'list': [],
+ \ 'matcher': {},
+ \ 'next_agent': '',
+ \ 'next_eval': '',
+ \ 'next_state': '',
+ \ 'numeric_chars': g:tlib#input#numeric_chars,
+ \ 'offset': 1,
+ \ 'offset_horizontal': 0,
+ \ 'on_leave': [],
+ \ 'pick_last_item': tlib#var#Get('tlib#input#pick_last_item', 'bg'),
+ \ 'post_handlers': [],
+ \ 'query': '',
+ \ 'resize': 0,
+ \ 'resize_vertical': 0,
+ \ 'restore_from_cache': [],
+ \ 'filtered_items': [],
+ \ 'resume_state': '',
+ \ 'retrieve_eval': '',
+ \ 'return_agent': '',
+ \ 'rv': '',
+ \ 'scratch': '__InputList__',
+ \ 'scratch_filetype': 'tlibInputList',
+ \ 'scratch_hidden': g:tlib#scratch#hidden,
+ \ 'scratch_vertical': 0,
+ \ 'scratch_split': 1,
+ \ 'sel_idx': [],
+ \ 'show_empty': 0,
+ \ 'state': 'display',
+ \ 'state_handlers': [],
+ \ 'sticky': 0,
+ \ 'temp_lines': [],
+ \ 'temp_prompt': [],
+ \ 'timeout': 0,
+ \ 'timeout_resolution': 2,
+ \ 'tabpagenr': -1,
+ \ 'type': '',
+ \ 'win_wnr': -1,
+ \ 'win_height': -1,
+ \ 'win_width': -1,
+ \ 'win_pct': 25,
+ \ })
+ " \ 'handlers': [],
+ " \ 'filter_options': '\c',
+
+function! tlib#World#New(...)
+ let object = s:prototype.New(a:0 >= 1 ? a:1 : {})
+ call object.SetMatchMode(tlib#var#Get('tlib#input#filter_mode', 'g', 'cnf'))
+ return object
+endf
+
+
+" :nodoc:
+function! s:prototype.Set_display_format(value) dict "{{{3
+ if a:value == 'filename'
+ call self.Set_highlight_filename()
+ let self.display_format = 'world.FormatFilename(%s)'
+ else
+ let self.display_format = a:value
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.DisplayFormat(list) dict "{{{3
+ let display_format = self.display_format
+ if !empty(display_format)
+ if has_key(self, 'InitFormatName')
+ call self.InitFormatName()
+ endif
+ let cache = self.fmt_display
+ " TLogVAR display_format, fmt_entries
+ return map(copy(a:list), 'self.FormatName(cache, display_format, v:val)')
+ else
+ return a:list
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.Set_highlight_filename() dict "{{{3
+ let self.tlib_UseInputListScratch = 'call world.Highlight_filename()'
+endf
+
+
+if g:tlib#input#format_filename == 'r'
+
+ " :nodoc:
+ function! s:prototype.Highlight_filename() dict "{{{3
+ syntax match TLibDir /\s\+\zs.\{-}[\/]\ze[^\/]\+$/
+ hi def link TLibDir Directory
+ syntax match TLibFilename /[^\/]\+$/
+ hi def link TLibFilename Normal
+ endf
+
+ " :nodoc:
+ function! s:prototype.FormatFilename(file) dict "{{{3
+ if !has_key(self.fmt_options, 'maxlen')
+ let maxco = &co - len(len(self.base)) - eval(g:tlib#input#filename_padding_r)
+ let maxfi = max(map(copy(self.base), 'strwidth(v:val)'))
+ let self.fmt_options.maxlen = min([maxco, maxfi])
+ " TLogVAR maxco, maxfi, self.fmt_options.maxlen
+ endif
+ let max = self.fmt_options.maxlen
+ if len(a:file) > max
+ let filename = '...' . strpart(a:file, len(a:file) - max + 3)
+ else
+ let filename = printf('% '. max .'s', a:file)
+ endif
+ return filename
+ endf
+
+else
+
+ " :nodoc:
+ function! s:prototype.Highlight_filename() dict "{{{3
+ " let self.width_filename = 1 + eval(g:tlib_inputlist_width_filename)
+ " TLogVAR self.base
+ let self.width_filename = min([
+ \ get(self, 'width_filename', &co),
+ \ empty(g:tlib#input#filename_max_width) ? &co : eval(g:tlib#input#filename_max_width),
+ \ max(map(copy(self.base), 'strwidth(matchstr(v:val, "[^\\/]*$"))'))
+ \ ])
+ " TLogVAR self.width_filename
+ exec 'syntax match TLibDir /\%>'. (1 + self.width_filename) .'c \(|\|\[[^]]*\]\) \zs\(\(\a:\|\.\.\|\.\.\..\{-}\)\?[\/][^&<>*|]\{-}\)\?[^\/]\+$/ contained containedin=TLibMarker contains=TLibFilename'
+ exec 'syntax match TLibMarker /\%>'. (1 + self.width_filename) .'c \(|\|\[[^]]*\]\) \S.*$/ contains=TLibDir'
+ " exec 'syntax match TLibDir /\(|\|\[.\{-}\]\) \zs\(\(\a:\|\.\.\|\.\.\..\{-}\)\?[\/][^&<>*|]\{-}\)\?[^\/]\+$/ contained containedin=TLibMarker contains=TLibFilename'
+ " exec 'syntax match TLibMarker /\(|\|\[.\{-}\]\) \S.*$/ contains=TLibDir'
+ exec 'syntax match TLibFilename /[^\/]\+$/ contained containedin=TLibDir'
+ hi def link TLibMarker Special
+ hi def link TLibDir Directory
+ hi def link TLibFilename NonText
+ " :nodoc:
+ function! self.Highlighter(rx) dict
+ let rx = '/\c\%>'. (1 + self.width_filename) .'c \(|\|\[[^]]*\]\) .\{-}\zs'. escape(a:rx, '/') .'/'
+ exec 'match' self.matcher.highlight rx
+ endf
+ endf
+
+
+ " :nodoc:
+ function! s:prototype.UseFilenameIndicators() dict "{{{3
+ return g:tlib_inputlist_filename_indicators || has_key(self, 'filename_indicators')
+ endf
+
+
+ " :nodoc:
+ function! s:prototype.InitFormatName() dict "{{{3
+ if self.UseFilenameIndicators()
+ let self._buffers = {}
+ for bufnr in range(1, bufnr('$'))
+ let filename = fnamemodify(bufname(bufnr), ':p')
+ " TLogVAR filename
+ let bufdef = {
+ \ 'bufnr': bufnr,
+ \ }
+ " '&buflisted'
+ for opt in ['&modified', '&bufhidden']
+ let bufdef[opt] = getbufvar(bufnr, opt)
+ endfor
+ let self._buffers[filename] = bufdef
+ endfor
+ endif
+ endf
+
+
+ " :nodoc:
+ function! s:prototype.FormatFilename(file) dict "{{{3
+ " TLogVAR a:file
+ let width = self.width_filename
+ let split = match(a:file, '[/\\]\zs[^/\\]\+$')
+ if split == -1
+ let fname = a:file
+ let dname = a:file
+ else
+ let fname = strpart(a:file, split)
+ " let dname = strpart(a:file, 0, split - 1)
+ let dname = a:file
+ endif
+ if strwidth(fname) > width
+ let fname = strpart(fname, 0, width - 3) .'...'
+ endif
+ let dnmax = &co - max([width, strwidth(fname)]) - 8 - self.index_width - &fdc
+ let use_indicators = self.UseFilenameIndicators()
+ " TLogVAR use_indicators
+ let marker = []
+ if use_indicators
+ call insert(marker, '[')
+ if g:tlib_inputlist_filename_indicators
+ let bufdef = get(self._buffers, a:file, {})
+ " let bnr = bufnr(a:file)
+ let bnr = get(bufdef, 'bufnr', -1)
+ " TLogVAR a:file, bnr, self.bufnr
+ if bnr != -1
+ if bnr == self.bufnr
+ call add(marker, '%')
+ else
+ call add(marker, bnr)
+ endif
+ if get(bufdef, '&modified', 0)
+ call add(marker, '+')
+ endif
+ if get(bufdef, '&bufhidden', '') == 'hide'
+ call add(marker, 'h')
+ endif
+ " if !get(bufdef, '&buflisted', 1)
+ " call add(marker, 'u')
+ " endif
+ " echom "DBG" a:file string(get(self,'filename_indicators'))
+ endif
+ endif
+ if has_key(self, 'filename_indicators') && has_key(self.filename_indicators, a:file)
+ if len(marker) > 1
+ call add(marker, '|')
+ endif
+ call add(marker, self.filename_indicators[a:file])
+ endif
+ if len(marker) <= 1
+ call add(marker, ' ')
+ endif
+ call add(marker, ']')
+ else
+ call add(marker, '|')
+ endif
+ let markers = join(marker, '')
+ if !empty(markers)
+ let dnmax -= len(markers)
+ endif
+ if strwidth(dname) > dnmax
+ let dname = '...'. strpart(dname, len(dname) - dnmax)
+ endif
+ return printf("%-*s %s %s",
+ \ self.width_filename + len(fname) - strwidth(fname),
+ \ fname, markers, dname)
+ endf
+
+endif
+
+
+" :nodoc:
+function! s:prototype.GetSelectedItems(current) dict "{{{3
+ " TLogVAR a:current
+ if stridx(self.type, 'i') != -1
+ let rv = copy(self.sel_idx)
+ else
+ let rv = map(copy(self.sel_idx), 'self.GetBaseItem(v:val)')
+ endif
+ if !empty(a:current)
+ " TLogVAR a:current, rv, type(a:current)
+ if tlib#type#IsNumber(a:current) || tlib#type#IsString(a:current)
+ call s:InsertSelectedItems(rv, a:current)
+ elseif tlib#type#IsList(a:current)
+ for item in a:current
+ call s:InsertSelectedItems(rv, item)
+ endfor
+ elseif tlib#type#IsDictionary(a:current)
+ for [inum, item] in items(a:current)
+ call s:InsertSelectedItems(rv, item)
+ endfor
+ endif
+ endif
+ " TAssert empty(rv) || rv[0] == a:current
+ if stridx(self.type, 'i') != -1
+ if !empty(self.index_table)
+ " TLogVAR rv, self.index_table
+ call map(rv, 'self.index_table[v:val - 1]')
+ " TLogVAR rv
+ endif
+ endif
+ return rv
+endf
+
+
+function! s:InsertSelectedItems(rv, current) "{{{3
+ let ci = index(a:rv, a:current)
+ if ci != -1
+ call remove(a:rv, ci)
+ endif
+ call insert(a:rv, a:current)
+endf
+
+
+" :nodoc:
+function! s:prototype.SelectItemsByNames(mode, items) dict "{{{3
+ for item in a:items
+ let bi = index(self.base, item) + 1
+ " TLogVAR item, bi
+ if bi > 0
+ let si = index(self.sel_idx, bi)
+ " TLogVAR self.sel_idx
+ " TLogVAR si
+ if si == -1
+ call add(self.sel_idx, bi)
+ elseif a:mode == 'toggle'
+ call remove(self.sel_idx, si)
+ endif
+ endif
+ endfor
+ return 1
+endf
+
+
+" :nodoc:
+function! s:prototype.SelectItem(mode, index) dict "{{{3
+ " TLogVAR a:mode, a:index
+ let bi = self.GetBaseIdx(a:index)
+ " if self.RespondTo('MaySelectItem')
+ " if !self.MaySelectItem(bi)
+ " return 0
+ " endif
+ " endif
+ " TLogVAR bi
+ let si = index(self.sel_idx, bi)
+ " TLogVAR self.sel_idx
+ " TLogVAR si
+ if si == -1
+ call add(self.sel_idx, bi)
+ elseif a:mode == 'toggle'
+ call remove(self.sel_idx, si)
+ endif
+ return 1
+endf
+
+
+" :nodoc:
+function! s:prototype.FormatBaseFromData() abort dict "{{{3
+ if has_key(self, 'format_data') && has_key(self, 'data')
+ let self.base = map(copy(self.data), 'call(self.format_data, [v:val], self)')
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.FormatArgs(format_string, arg) dict "{{{3
+ let nargs = len(substitute(a:format_string, '%%\|[^%]', '', 'g'))
+ return [a:format_string] + repeat([string(a:arg)], nargs)
+endf
+
+
+" :nodoc:
+function! s:prototype.GetRx(filter) dict "{{{3
+ return '\('. join(filter(copy(a:filter), 'v:val[0] != "!"'), '\|') .'\)'
+endf
+
+
+" :nodoc:
+function! s:prototype.GetRx0(...) dict "{{{3
+ exec tlib#arg#Let(['negative'])
+ let rx0 = []
+ for filter in self.filter
+ " TLogVAR filter
+ let rx = join(reverse(filter(copy(filter), '!empty(v:val)')), '\|')
+ " TLogVAR rx
+ if !empty(rx) && (negative ? rx[0] == g:tlib#input#not : rx[0] != g:tlib#input#not)
+ call add(rx0, rx)
+ endif
+ endfor
+ let rx0s = join(rx0, '\|')
+ if empty(rx0s)
+ return ''
+ else
+ return self.FilterRxPrefix() .'\('. rx0s .'\)'
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.FormatName(cache, format, value) dict "{{{3
+ " TLogVAR a:format, a:value
+ " TLogDBG has_key(self.fmt_display, a:value)
+ if has_key(a:cache, a:value)
+ " TLogDBG "cached"
+ return a:cache[a:value]
+ else
+ let world = self
+ let ftpl = self.FormatArgs(a:format, a:value)
+ let fn = call(function("printf"), ftpl)
+ let fmt = eval(fn)
+ " TLogVAR ftpl, fn, fmt
+ let a:cache[a:value] = fmt
+ return fmt
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.GetItem(idx) dict "{{{3
+ return self.list[a:idx - 1]
+endf
+
+
+" :nodoc:
+function! s:prototype.GetListIdx(baseidx) dict "{{{3
+ " if empty(self.index_table)
+ let baseidx = a:baseidx
+ " else
+ " let baseidx = 0 + self.index_table[a:baseidx - 1]
+ " " TLogVAR a:baseidx, baseidx, self.index_table
+ " endif
+ let rv = index(self.table, baseidx)
+ " TLogVAR rv, self.table
+ return rv
+endf
+
+
+" :nodoc:
+" The first index is 1.
+function! s:prototype.GetBaseIdx(idx) dict "{{{3
+ " TLogVAR a:idx, self.table, self.index_table
+ if !empty(self.table) && a:idx > 0 && a:idx <= len(self.table)
+ return self.table[a:idx - 1]
+ else
+ return 0
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.GetBaseIdx0(idx) dict "{{{3
+ let idx0 = self.GetBaseIdx(a:idx) - 1
+ if idx0 < 0
+ call tlib#notify#Echo('TLIB: Internal Error: GetBaseIdx0: idx0 < 0', 'WarningMsg')
+ endif
+ return idx0
+endf
+
+
+" :nodoc:
+function! s:prototype.GetBaseItem(idx) dict "{{{3
+ return self.base[a:idx - 1]
+endf
+
+
+" :nodoc:
+function! s:prototype.SetBaseItem(idx, item) dict "{{{3
+ let self.base[a:idx - 1] = a:item
+endf
+
+
+" :nodoc:
+function! s:prototype.GetLineIdx(lnum) dict "{{{3
+ let line = getline(a:lnum)
+ let prefidx = substitute(matchstr(line, '^\d\+\ze[*:]'), '^0\+', '', '')
+ return prefidx
+endf
+
+
+" :nodoc:
+function! s:prototype.SetPrefIdx() dict "{{{3
+ " let pref = sort(range(1, self.llen), 'self.SortPrefs')
+ " let self.prefidx = get(pref, 0, self.initial_index)
+ let pref_idx = -1
+ let pref_weight = -1
+ " TLogVAR self.filter_pos, self.filter_neg
+ " let t0 = localtime() " DBG
+ for idx in range(1, self.llen)
+ let item = self.GetItem(idx)
+ let weight = self.matcher.AssessName(self, item)
+ " TLogVAR item, weight
+ if weight > pref_weight
+ let pref_idx = idx
+ let pref_weight = weight
+ endif
+ endfor
+ " TLogVAR localtime() - t0
+ " TLogVAR pref_idx
+ " TLogDBG self.GetItem(pref_idx)
+ if pref_idx == -1
+ let self.prefidx = self.initial_index
+ else
+ let self.prefidx = pref_idx
+ endif
+endf
+
+
+" " :nodoc:
+" function! s:prototype.GetCurrentItem() dict "{{{3
+" let idx = self.prefidx
+" " TLogVAR idx
+" if stridx(self.type, 'i') != -1
+" return idx
+" elseif !empty(self.list)
+" if len(self.list) >= idx
+" let idx1 = idx - 1
+" let rv = self.list[idx - 1]
+" " TLogVAR idx, idx1, rv, self.list
+" return rv
+" endif
+" else
+" return ''
+" endif
+" endf
+
+
+" :nodoc:
+function! s:prototype.CurrentItem() dict "{{{3
+ if stridx(self.type, 'i') != -1
+ return self.GetBaseIdx(self.llen == 1 ? 1 : self.prefidx)
+ else
+ if self.llen == 1
+ " TLogVAR self.llen
+ return self.list[0]
+ elseif self.prefidx > 0
+ " TLogVAR self.prefidx
+ " return self.GetCurrentItem()
+ if len(self.list) >= self.prefidx
+ let rv = self.list[self.prefidx - 1]
+ " TLogVAR idx, rv, self.list
+ return rv
+ endif
+ else
+ return ''
+ endif
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.FilterRxPrefix() dict "{{{3
+ return self.matcher.FilterRxPrefix()
+endf
+
+
+" :nodoc:
+function! s:prototype.SetFilter() dict "{{{3
+ " let mrx = '\V'. (a:0 >= 1 && a:1 ? '\C' : '')
+ let mrx = self.FilterRxPrefix() . self.filter_options
+ let self.filter_pos = []
+ let self.filter_neg = []
+ " TLogVAR mrx, self.filter
+ for filter in self.filter
+ " TLogVAR filter
+ let rx = join(reverse(filter(copy(filter), '!empty(v:val)')), '\|')
+ " TLogVAR rx
+ if !empty(rx)
+ if rx =~ '\u'
+ let mrx1 = mrx .'\C'
+ else
+ let mrx1 = mrx
+ endif
+ " TLogVAR rx
+ if rx[0] == g:tlib#input#not
+ if len(rx) > 1
+ call add(self.filter_neg, mrx1 .'\('. rx[1:-1] .'\)')
+ endif
+ else
+ call add(self.filter_pos, mrx1 .'\('. rx .'\)')
+ endif
+ endif
+ endfor
+ " TLogVAR self.filter_pos, self.filter_neg
+endf
+
+
+" :nodoc:
+function! s:prototype.IsValidFilter() dict "{{{3
+ let last = self.FilterRxPrefix() .'\('. self.filter[0][0] .'\)'
+ Tlibtrace 'tlib', last
+ " TLogVAR last
+ try
+ let a = match("", last)
+ return 1
+ catch
+ Tlibtrace 'tlib', v:exception
+ return 0
+ endtry
+endf
+
+
+" :nodoc:
+function! s:prototype.SetMatchMode(match_mode) dict "{{{3
+ " TLogVAR a:match_mode
+ if !empty(a:match_mode)
+ unlet self.matcher
+ try
+ let self.matcher = tlib#Filter_{a:match_mode}#New()
+ call self.matcher.Init(self)
+ catch /^Vim\%((\a\+)\)\=:E117/
+ throw 'tlib: Unknown mode for tlib#input#filter_mode: '. a:match_mode
+ endtry
+ endif
+endf
+
+
+" function! s:prototype.Match(text) dict "{{{3
+" return self.matcher.Match(self, text)
+" endf
+
+
+" :nodoc:
+function! s:prototype.MatchBaseIdx(idx) dict "{{{3
+ let text = self.GetBaseItem(a:idx)
+ if !empty(self.filter_format)
+ let text = self.FormatName(self.fmt_filter, self.filter_format, text)
+ endif
+ " TLogVAR text
+ " return self.Match(text)
+ return self.matcher.Match(self, text)
+endf
+
+
+" :nodoc:
+function! s:prototype.BuildTableList() dict "{{{3
+ " let time0 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time0
+ call self.SetFilter()
+ " TLogVAR self.filter_neg, self.filter_pos
+ let self.table = range(1, len(self.base))
+ " TLogVAR self.filtered_items
+ let copy_base = 1
+ if !empty(self.filtered_items)
+ let self.table = filter(self.table, 'index(self.filtered_items, v:val) != -1')
+ let copy_base = 0
+ endif
+ if !empty(self.filter_pos) || !empty(self.filter_neg)
+ let self.table = filter(self.table, 'self.MatchBaseIdx(v:val)')
+ let copy_base = 0
+ endif
+ if copy_base
+ let self.list = copy(self.base)
+ else
+ let self.list = map(copy(self.table), 'self.GetBaseItem(v:val)')
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.ReduceFilter() dict "{{{3
+ " TLogVAR self.filter
+ let reduced = 0
+ while !reduced
+ if self.filter[0] == [''] && len(self.filter) > 1
+ call remove(self.filter, 0)
+ elseif empty(self.filter[0][0]) && len(self.filter[0]) > 1
+ call remove(self.filter[0], 0)
+ else
+ call self.matcher.ReduceFrontFilter(self)
+ endif
+ if self.IsValidFilter()
+ let reduced = 1
+ endif
+ endwh
+endf
+
+
+" :nodoc:
+" filter is either a string or a list of list of strings.
+function! s:prototype.SetInitialFilter(filter) dict "{{{3
+ " let self.initial_filter = [[''], [a:filter]]
+ Tlibtrace 'tlib', a:filter
+ if type(a:filter) == 3
+ let self.initial_filter = deepcopy(a:filter)
+ else
+ let self.initial_filter = [[a:filter]]
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.PopFilter() dict "{{{3
+ " TLogVAR self.filter
+ if len(self.filter[0]) > 1
+ call remove(self.filter[0], 0)
+ elseif len(self.filter) > 1
+ call remove(self.filter, 0)
+ else
+ let self.filter[0] = ['']
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.FilterIsEmpty() dict "{{{3
+ " TLogVAR self.filter
+ return self.filter == copy(self.initial_filter)
+endf
+
+
+" :nodoc:
+function! s:prototype.DisplayFilter() dict "{{{3
+ let filter1 = copy(self.filter)
+ call filter(filter1, 'v:val != [""]')
+ " TLogVAR self.matcher['_class']
+ let rv = self.matcher.DisplayFilter(filter1)
+ let rv = self.CleanFilter(rv)
+ return rv
+endf
+
+
+" :nodoc:
+function! s:prototype.SetFrontFilter(pattern) dict "{{{3
+ call self.matcher.SetFrontFilter(self, a:pattern)
+endf
+
+
+" :nodoc:
+function! s:prototype.PushFrontFilter(char) dict "{{{3
+ call self.matcher.PushFrontFilter(self, a:char)
+endf
+
+
+" :nodoc:
+function! s:prototype.CleanFilter(filter) dict "{{{3
+ return self.matcher.CleanFilter(a:filter)
+endf
+
+
+" :nodoc:
+function! s:prototype.UseScratch() dict "{{{3
+ " if type(self.scratch) != 0 && get(self, 'buffer_local', 1)
+ " if self.scratch != fnamemodify(self.scratch, ':p')
+ " let self.scratch = tlib#file#Join([expand('%:p:h'), self.scratch])
+ " " TLogVAR self.scratch
+ " endif
+ " " let self.scratch_hidden = 'wipe'
+ " endif
+ keepjumps keepalt let rv = tlib#scratch#UseScratch(self)
+ " if expand('%:t') == self.scratch
+ let b:tlib_world = self
+ " endif
+ return rv
+endf
+
+
+" :nodoc:
+function! s:prototype.CloseScratch(...) dict "{{{3
+ TVarArg ['reset_scratch', 0]
+ " TVarArg ['reset_scratch', 1]
+ " TLogVAR reset_scratch
+ if self.sticky
+ return 0
+ else
+ let rv = tlib#scratch#CloseScratch(self, reset_scratch)
+ " TLogVAR rv
+ if rv
+ call self.SwitchWindow('win')
+ endif
+ return rv
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.Initialize() dict "{{{3
+ let self.initialized = 1
+ call self.SetOrigin(1)
+ call self.Reset(1)
+ if !empty(self.cache_var) && exists(self.cache_var)
+ for prop in self.restore_from_cache
+ exec 'let self[prop] = get('. self.cache_var .', prop, self[prop])'
+ endfor
+ exec 'unlet '. self.cache_var
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.Leave() dict "{{{3
+ if !empty(self.cache_var)
+ exec 'let '. self.cache_var .' = self'
+ endif
+ for handler in self.on_leave
+ call call(handler, [self])
+ endfor
+endf
+
+
+" :nodoc:
+function! s:prototype.UseInputListScratch() dict "{{{3
+ let scratch = self.UseScratch()
+ if !exists('b:tlib_list_init')
+ call tlib#autocmdgroup#Init()
+ autocmd TLib VimResized <buffer> call feedkeys("\<c-j>", 't')
+ " autocmd TLib WinLeave <buffer> let b:tlib_world_event = 'WinLeave' | call feedkeys("\<c-j>", 't')
+ let b:tlib_list_init = 1
+ endif
+ if !exists('w:tlib_list_init')
+ " TLogVAR scratch
+ if has_key(self, 'index_next_syntax')
+ if type(self.index_next_syntax) == 1
+ exec 'syntax match InputlListIndex /^\d\+:\s/ nextgroup='. self.index_next_syntax
+ elseif type(self.index_next_syntax) == 4
+ for [n, nsyn] in items(self.index_next_syntax)
+ let fn = printf('%0'. world.index_width .'d', n)
+ exec 'syntax match InputlListIndex /^'. fn .':\s/ nextgroup='. nsyn
+ endfor
+ endif
+ else
+ syntax match InputlListIndex /^\d\+:\s/
+ endif
+ call tlib#hook#Run('tlib_UseInputListScratch', self)
+ syntax match InputlListCursor /^\d\+\* .*$/ contains=InputlListIndex
+ syntax match InputlListSelected /^\d\+# .*$/ contains=InputlListIndex
+ hi def link InputlListIndex Constant
+ hi def link InputlListCursor Search
+ hi def link InputlListSelected IncSearch
+ setlocal nowrap
+ " hi def link InputlListIndex Special
+ " let b:tlibDisplayListMarks = {}
+ let b:tlibDisplayListMarks = []
+ let b:tlibDisplayListWorld = self
+ let w:tlib_list_init = 1
+ endif
+ return scratch
+endf
+
+
+" s:prototype.Reset(?initial=0)
+" :nodoc:
+function! s:prototype.Reset(...) dict "{{{3
+ TVarArg ['initial', 0]
+ " TLogVAR initial
+ Tlibtrace 'tlib', initial, self.initial_filter
+ let self.state = 'display'
+ let self.offset = 1
+ let self.filter = deepcopy(self.initial_filter)
+ let self.idx = ''
+ let self.prefidx = 0
+ let self.initial_display = 1
+ let self.fmt_display = {}
+ let self.fmt_filter = {}
+ call self.UseInputListScratch()
+ call self.ResetSelected()
+ call self.Retrieve(!initial)
+ call self.FormatBaseFromData()
+ return self
+endf
+
+
+" :nodoc:
+function! s:prototype.ResetSelected() dict "{{{3
+ let self.sel_idx = []
+endf
+
+
+" :nodoc:
+function! s:prototype.Retrieve(anyway) dict "{{{3
+ " TLogVAR a:anyway, self.base
+ " TLogDBG (a:anyway || empty(self.base))
+ if (a:anyway || empty(self.base))
+ let ra = self.retrieve_eval
+ " TLogVAR ra
+ if !empty(ra)
+ let back = self.SwitchWindow('win')
+ let world = self
+ let self.base = eval(ra)
+ " TLogVAR self.base
+ exec back
+ return 1
+ endif
+ endif
+ return 0
+endf
+
+
+function! s:FormatHelp(help) "{{{3
+ " TLogVAR a:help
+ let max = [0, 0]
+ for item in a:help
+ " TLogVAR item
+ if type(item) == 3
+ let itemlen = map(copy(item), 'strwidth(v:val)')
+ " TLogVAR itemlen
+ let max = map(range(2), 'max[v:val] >= itemlen[v:val] ? max[v:val] : itemlen[v:val]')
+ endif
+ unlet item
+ endfor
+ " TLogVAR max
+ let cols = float2nr((winwidth(0) - &foldcolumn - 1) / (max[0] + max[1] + 2))
+ if cols < 1
+ let cols = 1
+ endif
+ let fmt = printf('%%%ds: %%-%ds', max[0], max[1])
+ " TLogVAR cols, fmt
+ let help = []
+ let idx = -1
+ let maxidx = len(a:help)
+ while idx < maxidx
+ let push_item = 0
+ let accum = []
+ for i in range(cols)
+ let idx += 1
+ if idx >= maxidx
+ break
+ endif
+ let item = a:help[idx]
+ if type(item) == 3
+ call add(accum, item)
+ else
+ let push_item = 1
+ break
+ endif
+ unlet item
+ endfor
+ if !empty(accum)
+ call add(help, s:FormatHelpItem(accum, fmt))
+ endif
+ if push_item
+ call add(help, a:help[idx])
+ endif
+ endwh
+ " TLogVAR help
+ return help
+endf
+
+
+function! s:FormatHelpItem(item, fmt) "{{{3
+ let args = [join(repeat([a:fmt], len(a:item)), ' ')]
+ for item in a:item
+ " TLogVAR item
+ let args += item
+ endfor
+ " TLogVAR args
+ return call('printf', args)
+endf
+
+
+" :nodoc:
+function! s:prototype.InitHelp() dict "{{{3
+ return []
+endf
+
+
+" :nodoc:
+function! s:prototype.PushHelp(...) dict "{{{3
+ " TLogVAR a:000
+ if a:0 == 1
+ if type(a:1) == 3
+ let self.temp_lines += a:1
+ else
+ call add(self.temp_lines, a:1)
+ endif
+ elseif a:0 == 2
+ call add(self.temp_lines, a:000)
+ else
+ throw "TLIB: PushHelp: Wrong number of arguments: ". string(a:000)
+ endif
+ " TLogVAR helpstring
+endf
+
+
+" :nodoc:
+function! s:prototype.DisplayHelp() dict "{{{3
+ let self.temp_lines = self.InitHelp()
+ call self.PushHelp('<Esc>', self.key_mode == 'default' ? 'Abort' : 'Reset keymap')
+ call self.PushHelp('Enter, <cr>', 'Pick the current item')
+ call self.PushHelp('Mouse', 'L: Pick item, R: Show menu')
+ call self.PushHelp('<M-Number>', 'Select an item')
+ call self.PushHelp('<BS>, <C-BS>', 'Reduce filter')
+ call self.PushHelp('<Tab>', 'Complete word')
+ call self.PushHelp('<S-Esc>, <F10>', 'Enter command')
+
+ if self.key_mode == 'default'
+ call self.PushHelp('<C|M-r>', 'Reset the display')
+ call self.PushHelp('Up/Down', 'Next/previous item')
+ call self.PushHelp('<C|M-q>', 'Edit top filter string')
+ call self.PushHelp('Page Up/Down', 'Scroll')
+ call self.PushHelp('<S-Space>', 'Enter * Wildcard')
+ if self.allow_suspend
+ call self.PushHelp('<C|M-z>', 'Suspend/Resume')
+ call self.PushHelp('<C-o>', 'Switch to origin')
+ endif
+ if stridx(self.type, 'm') != -1
+ call self.PushHelp('<S-Up/Down>', '(Un)Select items')
+ call self.PushHelp('#', '(Un)Select the current item')
+ call self.PushHelp('<C|M-a>', '(Un)Select all items')
+ call self.PushHelp('<F9>', '(Un)Restrict view to selection')
+ " \ '<c-\> ... Show only selected',
+ endif
+ endif
+
+ " TLogVAR len(self.temp_lines)
+ call self.matcher.Help(self)
+
+ " TLogVAR self.key_mode
+ for handler in values(self.key_map[self.key_mode])
+ " TLogVAR handler
+ let key = get(handler, 'key_name', '')
+ " TLogVAR key
+ if !empty(key)
+ let desc = get(handler, 'help', '')
+ if empty(desc)
+ let desc = get(handler, 'agent', '')
+ endif
+ call self.PushHelp(key, desc)
+ endif
+ endfor
+
+ if !has_key(self.key_map[self.key_mode], 'unknown_key')
+ call self.PushHelp('Letter', 'Filter the list')
+ endif
+
+ if self.key_mode == 'default' && !empty(self.help_extra)
+ call self.PushHelp(self.help_extra)
+ endif
+
+ " TLogVAR len(self.temp_lines)
+ call self.PushHelp([
+ \ '',
+ \ 'Matches at word boundaries are prioritized.',
+ \ ])
+ let self.temp_lines = s:FormatHelp(self.temp_lines)
+ call self.PrintLines()
+endf
+
+
+function! s:prototype.PrintLines() dict "{{{3
+ let self.temp_prompt = ['Press any key to continue.', 'Question']
+ call tlib#buffer#DeleteRange('1', '$')
+ call append(0, self.temp_lines)
+ call tlib#buffer#DeleteRange('$', '$')
+ 1
+ call self.Resize(len(self.temp_lines), 0)
+ let self.temp_lines = []
+endf
+
+
+" :nodoc:
+function! s:prototype.Resize(hsize, vsize) dict "{{{3
+ " TLogVAR self.scratch_vertical, a:hsize, a:vsize
+ let world_resize = ''
+ let winpos = ''
+ let scratch_split = get(self, 'scratch_split', 1)
+ " TLogVAR scratch_split
+ if scratch_split > 0
+ if self.scratch_vertical
+ if a:vsize
+ let world_resize = 'vert resize '. a:vsize
+ let winpos = tlib#fixes#Winpos()
+ " let w:winresize = {'v': a:vsize}
+ setlocal winfixwidth
+ endif
+ else
+ if a:hsize
+ let world_resize = 'resize '. a:hsize
+ " let w:winresize = {'h': a:hsize}
+ setlocal winfixheight
+ endif
+ endif
+ endif
+ if !empty(world_resize)
+ " TLogVAR world_resize, winpos
+ exec world_resize
+ if !empty(winpos)
+ exec winpos
+ endif
+ " redraw!
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.GetResize(size) dict "{{{3
+ let resize0 = get(self, 'resize', 0)
+ let resize = empty(resize0) ? 0 : eval(resize0)
+ " TLogVAR resize0, resize
+ let resize = resize == 0 ? a:size : min([a:size, resize])
+ " let min = self.scratch_vertical ? &cols : &lines
+ let min1 = (self.scratch_vertical ? self.win_width : self.win_height) * g:tlib_inputlist_pct
+ let min2 = (self.scratch_vertical ? &columns : &lines) * self.win_pct
+ let min = max([min1, min2])
+ let resize = min([resize, (min / 100)])
+ " TLogVAR resize, a:size, min, min1, min2
+ return resize
+endf
+
+
+" function! s:prototype.DisplayList(?query=self.Query(), ?list=[])
+" :nodoc:
+function! s:prototype.DisplayList(...) dict "{{{3
+ " TLogVAR self.state
+ let query = a:0 >= 1 ? a:1 : self.Query()
+ let list = a:0 >= 2 ? a:2 : []
+ " TLogVAR query, len(list)
+ " TLogDBG 'len(list) = '. len(list)
+ call self.UseScratch()
+ " TLogVAR self.scratch
+ " TAssert IsNotEmpty(self.scratch)
+ if self.state == 'scroll'
+ call self.ScrollToOffset()
+ elseif self.state == 'help'
+ call self.DisplayHelp()
+ call self.SetStatusline(query)
+ elseif self.state == 'printlines'
+ call self.PrintLines()
+ call self.SetStatusline(query)
+ else
+ " TLogVAR query
+ " let ll = len(list)
+ let ll = self.llen
+ " let x = len(ll) + 1
+ let x = self.index_width + 1
+ " TLogVAR ll
+ if self.state =~ '\<display\>'
+ call self.Resize(self.GetResize(ll), eval(get(self, 'resize_vertical', 0)))
+ call tlib#normal#WithRegister('gg"tdG', 't')
+ let lines = copy(list)
+ let lines = map(lines, 'substitute(v:val, ''[[:cntrl:][:space:]]'', " ", "g")')
+ let w = winwidth(0) - &fdc
+ " let w = winwidth(0) - &fdc - 1
+ let lines = map(lines, 'printf("%-'. w .'.'. w .'s", v:val)')
+ " TLogVAR lines
+ call append(0, lines)
+ call tlib#normal#WithRegister('G"tddgg', 't')
+ endif
+ " TLogVAR self.prefidx
+ let base_pref = self.GetBaseIdx(self.prefidx)
+ " TLogVAR base_pref
+ if self.state =~ '\<redisplay\>'
+ call filter(b:tlibDisplayListMarks, 'index(self.sel_idx, v:val) == -1 && v:val != base_pref')
+ " TLogVAR b:tlibDisplayListMarks
+ call map(b:tlibDisplayListMarks, 'self.DisplayListMark(x, v:val, ":")')
+ " let b:tlibDisplayListMarks = map(copy(self.sel_idx), 'self.DisplayListMark(x, v:val, "#")')
+ " call add(b:tlibDisplayListMarks, self.prefidx)
+ " call self.DisplayListMark(x, self.GetBaseIdx(self.prefidx), '*')
+ endif
+ let b:tlibDisplayListMarks = map(copy(self.sel_idx), 'self.DisplayListMark(x, v:val, "#")')
+ call add(b:tlibDisplayListMarks, base_pref)
+ call self.DisplayListMark(x, base_pref, '*')
+ call self.SetOffset()
+ call self.SetStatusline(query)
+ " TLogVAR self.offset
+ call self.ScrollToOffset()
+ let rx0 = self.GetRx0()
+ " TLogVAR rx0
+ if !empty(self.matcher.highlight)
+ if empty(rx0)
+ match none
+ elseif self.IsValidFilter()
+ if has_key(self, 'Highlighter')
+ call self.Highlighter(rx0)
+ else
+ exec 'match '. self.matcher.highlight .' /\c'. escape(rx0, '/') .'/'
+ endif
+ endif
+ endif
+ endif
+ redraw
+endf
+
+
+" :nodoc:
+function! s:prototype.SetStatusline(query) dict "{{{3
+ " TLogVAR a:query
+ if !empty(self.temp_prompt)
+ let echo = get(self.temp_prompt, 0, '')
+ let hl = get(self.temp_prompt, 1, 'Normal')
+ let self.temp_prompt = []
+ else
+ let hl = 'Normal'
+ let query = a:query
+ let options = [self.matcher.name]
+ if self.sticky
+ call add(options, '#')
+ endif
+ if self.key_mode != 'default'
+ call add(options, 'map:'. self.key_mode)
+ endif
+ if !empty(self.filtered_items)
+ if g:tlib_inputlist_shortmessage
+ call add(options, 'R')
+ else
+ call add(options, 'restricted')
+ endif
+ endif
+ if !empty(options)
+ let sopts = printf('[%s]', join(options, ', '))
+ " let echo = query . repeat(' ', &columns - len(sopts) - len(query) - 20) . sopts
+ let echo = query . ' ' . sopts
+ " let query .= '%%='. sopts .' '
+ endif
+ " TLogVAR &l:statusline, query
+ " let &l:statusline = query
+ endif
+ echo
+ if hl != 'Normal'
+ exec 'echohl' hl
+ echo echo
+ echohl None
+ else
+ echo echo
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.Query() dict "{{{3
+ let flt = self.DisplayFilter()
+ if g:tlib_inputlist_shortmessage
+ let query = 'Filter: '. flt
+ else
+ let query = self.query .' (filter: '. flt .'; press <F1> for help)'
+ endif
+ return query
+endf
+
+
+" :nodoc:
+function! s:prototype.ScrollToOffset() dict "{{{3
+ " TLogVAR self.scratch_vertical, self.llen, winheight(0)
+ exec 'norm! '. self.offset .'zt'
+endf
+
+
+" :nodoc:
+function! s:prototype.SetOffset() dict "{{{3
+ " TLogVAR self.prefidx, self.offset
+ " TLogDBG winheight(0)
+ " TLogDBG self.prefidx > self.offset + winheight(0) - 1
+ let listtop = len(self.list) - winheight(0) + 1
+ if listtop < 1
+ let listtop = 1
+ endif
+ if self.prefidx > listtop
+ let self.offset = listtop
+ elseif self.prefidx > self.offset + winheight(0) - 1
+ let listoff = self.prefidx - winheight(0) + 1
+ let self.offset = min([listtop, listoff])
+ " TLogVAR self.prefidx
+ " TLogDBG len(self.list)
+ " TLogDBG winheight(0)
+ " TLogVAR listtop, listoff, self.offset
+ elseif self.prefidx < self.offset
+ let self.offset = self.prefidx
+ endif
+ " TLogVAR self.offset
+endf
+
+
+" :nodoc:
+function! s:prototype.ClearAllMarks() dict "{{{3
+ let x = self.index_width + 1
+ call map(range(1, line('$')), 'self.DisplayListMark(x, v:val, ":")')
+endf
+
+
+" :nodoc:
+function! s:prototype.MarkCurrent(y) dict "{{{3
+ let x = self.index_width + 1
+ call self.DisplayListMark(x, a:y, '*')
+endf
+
+
+" :nodoc:
+function! s:prototype.DisplayListMark(x, y, mark) dict "{{{3
+ " TLogVAR a:y, a:mark
+ if a:x > 0 && a:y >= 0
+ " TLogDBG a:x .'x'. a:y .' '. a:mark
+ let sy = self.GetListIdx(a:y) + 1
+ " TLogVAR sy
+ if sy >= 1
+ call setpos('.', [0, sy, a:x, 0])
+ exec 'norm! r'. a:mark
+ " exec 'norm! '. a:y .'gg'. a:x .'|r'. a:mark
+ endif
+ endif
+ return a:y
+endf
+
+
+" :nodoc:
+function! s:prototype.SwitchWindow(where) dict "{{{3
+ " TLogDBG string(tlib#win#List())
+ if self.tabpagenr != tabpagenr()
+ call tlib#tab#Set(self.tabpagenr)
+ endif
+ let wnr = get(self, a:where.'_wnr')
+ " TLogVAR self, wnr
+ return tlib#win#Set(wnr)
+endf
+
+
+" :nodoc:
+function! s:prototype.FollowCursor() dict "{{{3
+ if !empty(self.follow_cursor)
+ let back = self.SwitchWindow('win')
+ " TLogVAR back
+ " TLogDBG winnr()
+ try
+ call call(self.follow_cursor, [self, [self.CurrentItem()]])
+ finally
+ exec back
+ endtry
+ endif
+endf
+
+
+" :nodoc:
+function! s:prototype.SetOrigin(...) dict "{{{3
+ TVarArg ['winview', 0]
+ " TLogVAR self.win_wnr, self.bufnr
+ " TLogDBG bufname('%')
+ " TLogDBG winnr()
+ " TLogDBG winnr('$')
+ let self.win_wnr = winnr()
+ let self.win_height = winheight(self.win_wnr)
+ let self.win_width = winwidth(self.win_wnr)
+ " TLogVAR self.win_wnr, self.win_height, self.win_width
+ let self.bufnr = bufnr('%')
+ let self.tabpagenr = tabpagenr()
+ let self.cursor = getpos('.')
+ if winview
+ let self.winview = tlib#win#GetLayout()
+ endif
+ " TLogVAR self.win_wnr, self.bufnr, self.winview
+ return self
+endf
+
+
+" :nodoc:
+function! s:prototype.RestoreOrigin(...) dict "{{{3
+ TVarArg ['winview', 0]
+ if winview
+ " TLogVAR winview
+ call tlib#win#SetLayout(self.winview)
+ endif
+ " TLogVAR self.win_wnr, self.bufnr, self.cursor, &splitbelow
+ " TLogDBG "RestoreOrigin0 ". string(tlib#win#List())
+ " If &splitbelow or &splitright is false, we cannot rely on
+ " self.win_wnr to be our source buffer since, e.g, opening a buffer
+ " in a split window changes the whole layout.
+ " Possible solutions:
+ " - Restrict buffer switching to cases when the number of windows
+ " hasn't changed.
+ " - Guess the right window, which we try to do here.
+ if &splitbelow == 0 || &splitright == 0
+ let wn = bufwinnr(self.bufnr)
+ " TLogVAR wn
+ if wn == -1
+ let wn = 1
+ end
+ else
+ let wn = self.win_wnr
+ endif
+ if wn != winnr()
+ exec wn .'wincmd w'
+ endif
+ exec 'buffer! '. self.bufnr
+ call setpos('.', self.cursor)
+ " TLogDBG "RestoreOrigin1 ". string(tlib#win#List())
+endf
+
+
+function! s:prototype.Suspend() dict "{{{3
+ call tlib#agent#Suspend(self, self.rv)
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/agent.vim b/vim/bundle/tlib_vim/autoload/tlib/agent.vim
new file mode 100644
index 0000000..e61f24b
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/agent.vim
@@ -0,0 +1,665 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 329
+
+
+" :filedoc:
+" Various agents for use as key handlers in tlib#input#List()
+
+" Number of items to move when pressing <c-up/down> in the input list window.
+TLet g:tlib_scroll_lines = 10
+
+
+" General {{{1
+
+function! tlib#agent#Exit(world, selected) "{{{3
+ if a:world.key_mode == 'default'
+ call a:world.CloseScratch()
+ let a:world.state = 'exit empty escape'
+ let a:world.list = []
+ " let a:world.base = []
+ call a:world.ResetSelected()
+ else
+ let a:world.key_mode = 'default'
+ let a:world.state = 'redisplay'
+ endif
+ return a:world
+endf
+
+
+function! tlib#agent#CopyItems(world, selected) "{{{3
+ let @* = join(a:selected, "\n")
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+
+" InputList related {{{1
+
+function! tlib#agent#PageUp(world, selected) "{{{3
+ let a:world.offset -= (winheight(0) / 2)
+ let a:world.state = 'scroll'
+ return a:world
+endf
+
+
+function! tlib#agent#PageDown(world, selected) "{{{3
+ let a:world.offset += (winheight(0) / 2)
+ let a:world.state = 'scroll'
+ return a:world
+endf
+
+
+function! tlib#agent#Home(world, selected) "{{{3
+ let a:world.prefidx = 1
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+function! tlib#agent#End(world, selected) "{{{3
+ let a:world.prefidx = len(a:world.list)
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+function! tlib#agent#Up(world, selected, ...) "{{{3
+ TVarArg ['lines', 1]
+ let a:world.idx = ''
+ if a:world.prefidx > lines
+ let a:world.prefidx -= lines
+ else
+ let a:world.prefidx = len(a:world.list)
+ endif
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+function! tlib#agent#Down(world, selected, ...) "{{{3
+ TVarArg ['lines', 1]
+ let a:world.idx = ''
+ if a:world.prefidx <= (len(a:world.list) - lines)
+ let a:world.prefidx += lines
+ else
+ let a:world.prefidx = 1
+ endif
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+function! tlib#agent#UpN(world, selected) "{{{3
+ return tlib#agent#Up(a:world, a:selected, g:tlib_scroll_lines)
+endf
+
+
+function! tlib#agent#DownN(world, selected) "{{{3
+ return tlib#agent#Down(a:world, a:selected, g:tlib_scroll_lines)
+endf
+
+
+function! tlib#agent#ShiftLeft(world, selected) "{{{3
+ let a:world.offset_horizontal -= (winwidth(0) / 2)
+ if a:world.offset_horizontal < 0
+ let a:world.offset_horizontal = 0
+ endif
+ let a:world.state = 'display shift'
+ return a:world
+endf
+
+
+function! tlib#agent#ShiftRight(world, selected) "{{{3
+ let a:world.offset_horizontal += (winwidth(0) / 2)
+ let a:world.state = 'display shift'
+ return a:world
+endf
+
+
+function! tlib#agent#Reset(world, selected) "{{{3
+ let a:world.state = 'reset'
+ return a:world
+endf
+
+
+function! tlib#agent#ToggleRestrictView(world, selected) "{{{3
+ if empty(a:world.filtered_items)
+ return tlib#agent#RestrictView(a:world, a:selected)
+ else
+ return tlib#agent#UnrestrictView(a:world, a:selected)
+ endif
+endf
+
+
+function! tlib#agent#RestrictView(world, selected) "{{{3
+ " TLogVAR a:selected
+ let filtered_items = map(copy(a:selected), 'index(a:world.base, v:val) + 1')
+ " TLogVAR 1, filtered_items
+ let filtered_items = filter(filtered_items, 'v:val > 0')
+ " TLogVAR 2, filtered_items
+ if !empty(filtered_items)
+ let a:world.filtered_items = filtered_items
+ endif
+ let a:world.state = 'display'
+ return a:world
+endf
+
+
+function! tlib#agent#UnrestrictView(world, selected) "{{{3
+ let a:world.filtered_items = []
+ let a:world.state = 'display'
+ return a:world
+endf
+
+
+function! tlib#agent#Input(world, selected) "{{{3
+ let flt0 = a:world.CleanFilter(a:world.filter[0][0])
+ let flt1 = input('Filter: ', flt0)
+ echo
+ if flt1 != flt0
+ if empty(flt1)
+ call getchar(0)
+ else
+ call a:world.SetFrontFilter(flt1)
+ endif
+ endif
+ let a:world.state = 'display'
+ return a:world
+endf
+
+
+" Suspend (see |tlib#agent#Suspend|) the input loop and jump back to the
+" original position in the parent window.
+function! tlib#agent#SuspendToParentWindow(world, selected) "{{{3
+ let world = a:world
+ let winnr = world.win_wnr
+ " TLogVAR winnr
+ if winnr != -1
+ let world = tlib#agent#Suspend(world, a:selected)
+ if world.state =~ '\<suspend\>'
+ call world.SwitchWindow('win')
+ " let pos = world.cursor
+ " " TLogVAR pos
+ " if !empty(pos)
+ " call setpos('.', pos)
+ " endif
+ return world
+ endif
+ endif
+ let world.state = 'redisplay'
+ return world
+endf
+
+
+" Suspend lets you temporarily leave the input loop of
+" |tlib#input#List|. You can resume editing the list by pressing <c-z>,
+" <m-z>. <space>, <c-LeftMouse> or <MiddleMouse> in the suspended window.
+" <cr> and <LeftMouse> will immediatly select the item under the cursor.
+" < will select the item but the window will remain opened.
+function! tlib#agent#Suspend(world, selected) "{{{3
+ if a:world.allow_suspend
+ " TAssert IsNotEmpty(a:world.scratch)
+ " TLogDBG bufnr('%')
+ let br = tlib#buffer#Set(a:world.scratch)
+ " TLogVAR br, a:world.bufnr, a:world.scratch
+ if bufnr('%') != a:world.scratch
+ echohl WarningMsg
+ echom "tlib#agent#Suspend: Internal error: Not a scratch buffer:" bufname('%')
+ echohl NONE
+ endif
+ " TLogVAR bufnr('%'), bufname('%'), a:world.scratch
+ call tlib#autocmdgroup#Init()
+ exec 'autocmd TLib BufEnter <buffer='. a:world.scratch .'> call tlib#input#Resume("world", 0, '. a:world.scratch .')'
+ let b:tlib_world = a:world
+ exec br
+ let a:world.state = 'exit suspend'
+ else
+ echom 'Suspend disabled'
+ let a:world.state = 'redisplay'
+ endif
+ return a:world
+endf
+
+
+function! tlib#agent#Help(world, selected) "{{{3
+ let a:world.state = 'help'
+ return a:world
+endf
+
+
+function! tlib#agent#OR(world, selected) "{{{3
+ if !empty(a:world.filter[0])
+ call insert(a:world.filter[0], '')
+ endif
+ let a:world.state = 'display'
+ return a:world
+endf
+
+
+function! tlib#agent#AND(world, selected) "{{{3
+ if !empty(a:world.filter[0])
+ call insert(a:world.filter, [''])
+ endif
+ let a:world.state = 'display'
+ return a:world
+endf
+
+
+function! tlib#agent#ReduceFilter(world, selected) "{{{3
+ call a:world.ReduceFilter()
+ let a:world.offset = 1
+ let a:world.state = 'display'
+ return a:world
+endf
+
+
+function! tlib#agent#PopFilter(world, selected) "{{{3
+ call a:world.PopFilter()
+ let a:world.offset = 1
+ let a:world.state = 'display'
+ return a:world
+endf
+
+
+function! tlib#agent#Debug(world, selected) "{{{3
+ " echo string(world.state)
+ echo string(a:world.filter)
+ echo string(a:world.idx)
+ echo string(a:world.prefidx)
+ echo string(a:world.sel_idx)
+ call getchar()
+ let a:world.state = 'display'
+ return a:world
+endf
+
+
+function! tlib#agent#Select(world, selected) "{{{3
+ call a:world.SelectItem('toggle', a:world.prefidx)
+ " let a:world.state = 'display keepcursor'
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+function! tlib#agent#SelectUp(world, selected) "{{{3
+ call a:world.SelectItem('toggle', a:world.prefidx)
+ if a:world.prefidx > 1
+ let a:world.prefidx -= 1
+ endif
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+function! tlib#agent#SelectDown(world, selected) "{{{3
+ call a:world.SelectItem('toggle', a:world.prefidx)
+ if a:world.prefidx < len(a:world.list)
+ let a:world.prefidx += 1
+ endif
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+function! tlib#agent#SelectAll(world, selected) "{{{3
+ let listrange = range(1, len(a:world.list))
+ let mode = empty(filter(copy(listrange), 'index(a:world.sel_idx, a:world.GetBaseIdx(v:val)) == -1'))
+ \ ? 'toggle' : 'set'
+ for i in listrange
+ call a:world.SelectItem(mode, i)
+ endfor
+ let a:world.state = 'display keepcursor'
+ return a:world
+endf
+
+
+function! tlib#agent#ToggleStickyList(world, selected) "{{{3
+ let a:world.sticky = !a:world.sticky
+ let a:world.state = 'display keepcursor'
+ return a:world
+endf
+
+
+
+" EditList related {{{1
+
+function! tlib#agent#EditItem(world, selected) "{{{3
+ let lidx = a:world.prefidx
+ " TLogVAR lidx
+ " TLogVAR a:world.table
+ let bidx = a:world.GetBaseIdx(lidx)
+ " TLogVAR bidx
+ let item = a:world.GetBaseItem(bidx)
+ let item = input(lidx .'@'. bidx .': ', item)
+ if item != ''
+ call a:world.SetBaseItem(bidx, item)
+ endif
+ let a:world.state = 'display'
+ return a:world
+endf
+
+
+" Insert a new item below the current one.
+function! tlib#agent#NewItem(world, selected) "{{{3
+ let basepi = a:world.GetBaseIdx(a:world.prefidx)
+ let item = input('New item: ')
+ call insert(a:world.base, item, basepi)
+ let a:world.state = 'reset'
+ return a:world
+endf
+
+
+function! tlib#agent#DeleteItems(world, selected) "{{{3
+ let remove = copy(a:world.sel_idx)
+ let basepi = a:world.GetBaseIdx(a:world.prefidx)
+ if index(remove, basepi) == -1
+ call add(remove, basepi)
+ endif
+ " call map(remove, 'a:world.GetBaseIdx(v:val)')
+ for idx in reverse(sort(remove))
+ call remove(a:world.base, idx - 1)
+ endfor
+ let a:world.state = 'display'
+ call a:world.ResetSelected()
+ " let a:world.state = 'reset'
+ return a:world
+endf
+
+
+function! tlib#agent#Cut(world, selected) "{{{3
+ let world = tlib#agent#Copy(a:world, a:selected)
+ return tlib#agent#DeleteItems(world, a:selected)
+endf
+
+
+function! tlib#agent#Copy(world, selected) "{{{3
+ let a:world.clipboard = []
+ let bidxs = copy(a:world.sel_idx)
+ call add(bidxs, a:world.GetBaseIdx(a:world.prefidx))
+ for bidx in sort(bidxs)
+ call add(a:world.clipboard, a:world.GetBaseItem(bidx))
+ endfor
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+function! tlib#agent#Paste(world, selected) "{{{3
+ if has_key(a:world, 'clipboard')
+ for e in reverse(copy(a:world.clipboard))
+ call insert(a:world.base, e, a:world.prefidx)
+ endfor
+ endif
+ let a:world.state = 'display'
+ call a:world.ResetSelected()
+ return a:world
+endf
+
+
+function! tlib#agent#EditReturnValue(world, rv) "{{{3
+ return [a:world.state !~ '\<exit\>', a:world.base]
+endf
+
+
+
+" Files related {{{1
+
+function! tlib#agent#ViewFile(world, selected) "{{{3
+ if !empty(a:selected)
+ let back = a:world.SwitchWindow('win')
+ " TLogVAR back
+ for filename in a:selected
+ call tlib#file#Edit(filename)
+ endfor
+ " if !&hidden && &l:modified
+ " let cmd0 = 'split'
+ " let cmd1 = 'sbuffer'
+ " else
+ " let cmd0 = 'edit'
+ " let cmd1 = 'buffer'
+ " endif
+ " call tlib#file#With(cmd0, cmd1, a:selected, a:world)
+ " TLogVAR &filetype
+ exec back
+ let a:world.state = 'display'
+ endif
+ return a:world
+endf
+
+
+function! tlib#agent#EditFile(world, selected) "{{{3
+ return tlib#agent#Exit(tlib#agent#ViewFile(a:world, a:selected), a:selected)
+endf
+
+
+function! tlib#agent#EditFileInSplit(world, selected) "{{{3
+ call a:world.CloseScratch()
+ " call tlib#file#With('edit', 'buffer', a:selected[0:0], a:world)
+ " call tlib#file#With('split', 'sbuffer', a:selected[1:-1], a:world)
+ call tlib#file#With('split', 'sbuffer', a:selected, a:world)
+ return tlib#agent#Exit(a:world, a:selected)
+endf
+
+
+function! tlib#agent#EditFileInVSplit(world, selected) "{{{3
+ call a:world.CloseScratch()
+ " call tlib#file#With('edit', 'buffer', a:selected[0:0], a:world)
+ " call tlib#file#With('vertical split', 'vertical sbuffer', a:selected[1:-1], a:world)
+ let winpos = tlib#fixes#Winpos()
+ call tlib#file#With('vertical split', 'vertical sbuffer', a:selected, a:world)
+ if !empty(winpos)
+ exec winpos
+ endif
+ return tlib#agent#Exit(a:world, a:selected)
+endf
+
+
+function! tlib#agent#EditFileInTab(world, selected) "{{{3
+ " TLogVAR a:selected
+ call a:world.CloseScratch()
+ call tlib#file#With('tabedit', 'tab sbuffer', a:selected, a:world)
+ return tlib#agent#Exit(a:world, a:selected)
+endf
+
+
+function! tlib#agent#ToggleScrollbind(world, selected) "{{{3
+ let a:world.scrollbind = get(a:world, 'scrollbind') ? 0 : 1
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+function! tlib#agent#ShowInfo(world, selected)
+ let lines = []
+ for f in a:selected
+ if filereadable(f)
+ let desc = [getfperm(f), strftime('%c', getftime(f)), getfsize(f) .' bytes', getftype(f)]
+ call add(lines, fnamemodify(f, ':p'))
+ call add(lines, ' '. join(desc, '; '))
+ endif
+ endfor
+ let a:world.temp_lines = lines
+ let a:world.state = 'printlines'
+ return a:world
+endf
+
+
+
+" Buffer related {{{1
+
+function! tlib#agent#PreviewLine(world, selected) "{{{3
+ let l = a:selected[0]
+ let ww = winnr()
+ exec a:world.win_wnr .'wincmd w'
+ call tlib#buffer#ViewLine(l, 1)
+ exec ww .'wincmd w'
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+" If not called from the scratch, we assume/guess that we don't have to
+" suspend the input-evaluation loop.
+function! tlib#agent#GotoLine(world, selected) "{{{3
+ if !empty(a:selected)
+
+ " let l = a:selected[0]
+ " " TLogVAR l
+ " let back = a:world.SwitchWindow('win')
+ " " TLogVAR back
+ " " if a:world.win_wnr != winnr()
+ " " let world = tlib#agent#Suspend(a:world, a:selected)
+ " " exec a:world.win_wnr .'wincmd w'
+ " " endif
+ " call tlib#buffer#ViewLine(l)
+ " exec back
+ " let a:world.state = 'display'
+
+ let l = a:selected[0]
+ if a:world.win_wnr != winnr()
+ let world = tlib#agent#Suspend(a:world, a:selected)
+ exec a:world.win_wnr .'wincmd w'
+ endif
+ call tlib#buffer#ViewLine(l, 1)
+
+ endif
+ return a:world
+endf
+
+
+function! tlib#agent#DoAtLine(world, selected) "{{{3
+ if !empty(a:selected)
+ let cmd = input('Command: ', '', 'command')
+ if !empty(cmd)
+ call a:world.SwitchWindow('win')
+ " let pos = getpos('.')
+ let view = winsaveview()
+ for l in a:selected
+ call tlib#buffer#ViewLine(l, '')
+ exec cmd
+ endfor
+ " call setpos('.', pos)
+ call winrestview(view)
+ endif
+ endif
+ call a:world.ResetSelected()
+ let a:world.state = 'exit'
+ return a:world
+endf
+
+
+function! tlib#agent#Wildcard(world, selected) "{{{3
+ if !empty(a:world.filter[0])
+ let rx_type = a:world.matcher.FilterRxPrefix()
+ let flt0 = a:world.CleanFilter(a:world.filter[0][0])
+ if rx_type == '\V'
+ let flt0 .= '\.\{-}'
+ else
+ let flt0 .= '.\{-}'
+ endif
+ call a:world.SetFrontFilter(flt0)
+ endif
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+function! tlib#agent#Null(world, selected) "{{{3
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+function! tlib#agent#ExecAgentByName(world, selected) "{{{3
+ let s:agent_names_world = a:world
+ let agent_names = {'Help': 'tlib#agent#Help'}
+ for def in values(a:world.key_map[a:world.key_mode])
+ if has_key(def, 'help') && !empty(def.help) && has_key(def, 'agent') && !empty(def.agent)
+ let agent_names[def.help] = def.agent
+ endif
+ endfor
+ let s:agent_names = sort(keys(agent_names))
+ let command = input('Command: ', '', 'customlist,tlib#agent#CompleteAgentNames')
+ " TLogVAR command
+ if !has_key(agent_names, command)
+ " TLogVAR command
+ silent! let matches = filter(keys(agent_names), 'v:val =~ command')
+ " TLogVAR matches
+ if len(matches) == 1
+ let command = matches[0]
+ endif
+ endif
+ if has_key(agent_names, command)
+ let agent = agent_names[command]
+ return call(agent, [a:world, a:selected])
+ else
+ if !empty(command)
+ echohl WarningMsg
+ echom "Unknown command:" command
+ echohl NONE
+ sleep 1
+ endif
+ let a:world.state = 'display'
+ return a:world
+ endif
+endf
+
+
+function! tlib#agent#CompleteAgentNames(ArgLead, CmdLine, CursorPos)
+ let arglead = tolower(a:Arglead)
+ return filter(copy(s:agent_names), 'stridx(tolower(v:val), arglead) != -1')
+endf
+
+
+function! tlib#agent#Complete(world, selected) abort "{{{3
+ let rxprefix = a:world.matcher.FilterRxPrefix()
+ let flt = a:world.filter[0][0]
+ " TLogVAR flt
+ let fltrx = rxprefix . flt . '\m[^[:space:][:cntrl:][:punct:]<>*+?&~{}()\[\]\\/]\+'
+ let fltrx0 = '\m^' . fltrx
+ " TLogVAR fltrx, fltrx0
+ let words = {}
+ for item in a:world.list
+ let parts = split(item, '\ze'. fltrx)
+ " TLogVAR item, parts
+ for part in parts
+ let word = matchstr(part, fltrx0)
+ " TLogVAR part, word
+ if !empty(word)
+ let words[word] = 1
+ endif
+ endfor
+ endfor
+ " TLogVAR keys(words)
+ let completions = keys(words)
+ " let completions = filter(keys(words), 'matchstr(v:val, fltrx0)')
+ let completions = sort(completions, 's:SortCompletions')
+ let completions = tlib#list#Uniq(completions)
+ " TLogVAR 0, completions
+ while len(completions) > 1
+ let nchar = strwidth(completions[0]) - 1
+ let completions = map(completions, 'strpart(v:val, 0, nchar)')
+ " TLogVAR 'reduce', completions
+ let completions = tlib#list#Uniq(completions)
+ " TLogVAR 'unique', len(completions), completions
+ endwh
+ " TLogVAR 9, completions
+ if empty(completions)
+ let a:world.state = 'redisplay update'
+ else
+ let a:world.filter[0][0] = completions[0]
+ let a:world.state = 'display update'
+ endif
+ return a:world
+endf
+
+
+function! s:SortCompletions(a, b) abort "{{{3
+ let i1 = strwidth(a:a)
+ let i2 = strwidth(a:b)
+ return i2 - i1
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/arg.vim b/vim/bundle/tlib_vim/autoload/tlib/arg.vim
new file mode 100755
index 0000000..f7d479e
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/arg.vim
@@ -0,0 +1,338 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2016-06-06.
+" @Revision: 267
+
+
+" :def: function! tlib#arg#Get(n, var, ?default="", ?test='')
+" Set a positional argument from a variable argument list.
+" See tlib#string#RemoveBackslashes() for an example.
+function! tlib#arg#Get(n, var, ...) "{{{3
+ let default = a:0 >= 1 ? a:1 : ''
+ let atest = a:0 >= 2 ? a:2 : ''
+ " TLogVAR default, atest
+ if !empty(atest)
+ let atest = ' && (a:'. a:n .' '. atest .')'
+ endif
+ let test = printf('a:0 >= %d', a:n) . atest
+ return printf('let %s = %s ? a:%d : %s', a:var, test, a:n, string(default))
+endf
+
+
+" :def: function! tlib#arg#Let(list, ?default='')
+" Set a positional arguments from a variable argument list.
+" See tlib#input#List() for an example.
+function! tlib#arg#Let(list, ...) "{{{3
+ let default = a:0 >= 1 ? a:1 : ''
+ let list = map(copy(a:list), 'type(v:val) == 3 ? v:val : [v:val, default]')
+ let args = map(range(1, len(list)), 'call("tlib#arg#Get", [v:val] + list[v:val - 1])')
+ return join(args, ' | ')
+endf
+
+
+" :def: function! tlib#arg#StringAsKeyArgs(string, ?keys=[], ?evaluate=0, ?sep=':', ?booleans=0)
+function! tlib#arg#StringAsKeyArgs(string, ...) "{{{1
+ TVarArg ['keys', {}], ['evaluate', 0], ['sep', ':'], ['booleans', 0]
+ let keyargs = {}
+ let args = split(a:string, '\\\@<! ')
+ let key_rx = booleans ? '\([-+]\?\w\+\)' : '\(\w\+\)'
+ let arglist = map(args, 'matchlist(v:val, ''^\%('. key_rx . sep .'\(.*\)\|\(.*\)\)$'')')
+ " TLogVAR a:string, args, arglist
+ let pos = -1
+ for matchlist in arglist
+ if !empty(matchlist[3])
+ if booleans && matchlist[3] =~ '^[-+]'
+ let key = substitute(matchlist[3], '^[-+]', '', '')
+ let val = matchstr(matchlist[3], '^[-+]')
+ let keyargs[key] = val ==# '+'
+ else
+ let pos += 1
+ let keyargs[pos] = matchlist[3]
+ endif
+ else
+ let [match, key, val; rest] = matchlist
+ if empty(keys) || has_key(keys, key)
+ let val = substitute(val, '\\\\', '\\', 'g')
+ if evaluate
+ let val = eval(val)
+ endif
+ let keyargs[key] = val
+ else
+ echom 'Unknown key: '. key .'='. val
+ endif
+ endif
+ endfor
+ if pos >= 0
+ let keyargs['__posargs__'] = range(0, pos)
+ endif
+ return keyargs
+endf
+
+
+function! tlib#arg#StringAsKeyArgsEqual(string) "{{{1
+ return tlib#arg#StringAsKeyArgs(a:string, [], 0, '=', 1)
+endf
+
+
+" :display: tlib#arg#GetOpts(args, ?def={})
+" Convert a list of strings of command-line arguments into a dictonary.
+"
+" The main use case is to pass [<f-args>], i.e. the command-line
+" arguments of a command as list, from a command definition to this
+" function.
+"
+" Example:
+" ['-h']
+" => If def contains a 'help' key, invoke |:help| on its value.
+"
+" ['-ab', '--foo', '--bar=BAR', 'bla', bla']
+" => {'a': 1, 'b': 1, 'foo': 1, 'bar': 'BAR', '__rest__': ['bla', 'bla']}
+"
+" ['-ab', '--', '--foo', '--bar=BAR']
+" => {'a': 1, 'b': 1, '__rest__': ['--foo', '--bar=BAR']}
+function! tlib#arg#GetOpts(args, ...) abort "{{{3
+ let throw = a:0 == 0
+ TVarArg ['def', {}]
+ " TLogVAR def
+ let opts = {'__exit__': 0}
+ for [key, vdef] in items(get(def, 'values', {}))
+ if has_key(vdef, 'default')
+ let opts[key] = vdef.default
+ endif
+ endfor
+ let idx = 0
+ for o in a:args
+ let [break, idx] = s:SetOpt(def, opts, idx, o)
+ if break == 1
+ break
+ elseif break == 2
+ if throw
+ throw 'tlib#arg#GetOpts: Show help'
+ else
+ let opts.__exit__ = 5
+ endif
+ endif
+ endfor
+ let opts.__rest__ = a:args[idx : -1]
+ return opts
+endf
+
+
+function! s:GetValueType(def) abort "{{{3
+ return get(a:def, 'type', type(get(a:def, 'default', '')))
+endf
+
+
+function! s:SetOpt(def, opts, idx, opt) abort "{{{3
+ " TLogVAR a:def
+ let idx = a:idx + 1
+ let break = 0
+ let long = get(a:def, 'long', 1)
+ let short = get(a:def, 'short', 1)
+ if (short && a:opt =~# '^-[?h]$') || (long && a:opt ==# '--help')
+ if has_key(a:def, 'help')
+ exec 'help' a:def.help
+ else
+ " TLogVAR a:def
+ let values = get(a:def, 'values', {})
+ let flags = get(a:def, 'flags', {})
+ if empty(values) && empty(flags)
+ echom 'No help'
+ else
+ if !empty(values)
+ echom 'Options:'
+ for [key, vdef] in sort(items(values))
+ let opt = key
+ let default = get(vdef, 'default', '')
+ let type = s:GetValueType(vdef)
+ if default =~ '^-\?\d\+\%(\.\d\+\)$'
+ if type == -1
+ let opt .= ' (flag)'
+ elseif type == 1
+ let opt .= '=INT'
+ else
+ let opt .= '=INT or maybe BOOL'
+ endif
+ elseif type(default) == 1
+ let opt .= '=STRING'
+ elseif type(default) == 3
+ let opt .= '=COMMA-LIST'
+ endif
+ echom printf(' --%20s (default: %s)', opt, string(default))
+ endfor
+ endif
+ if !empty(flags)
+ echom 'Short flags:'
+ for [sflag, lflag] in sort(items(flags))
+ echom printf(' -%s -> %s', sflag, lflag)
+ endfor
+ endif
+ endif
+ endif
+ let break = 2
+ elseif long && a:opt =~# '^--\%(no-\)\?debug$'
+ if has_key(a:def, 'trace')
+ let mod = a:opt =~# '--no-' ? '-' : '+'
+ exec 'Tlibtraceset' mod . a:def.trace
+ endif
+ elseif long && a:opt =~# '^--no-.\+'
+ let key = matchstr(a:opt, '^--no-\zs.\+$')
+ let a:opts[key] = s:Validate(a:def, key, 0)
+ elseif long && a:opt =~# '^--\w\+$'
+ let key = matchstr(a:opt, '^--\zs.\+$')
+ let a:opts[key] = s:Validate(a:def, key, 1)
+ elseif long && a:opt =~# '^--\w\+='
+ let ml = matchlist(a:opt, '^--\(\w\+\)=\(.*\)$')
+ if empty(ml)
+ throw 'tlib#arg#GetOpts: Cannot parse: '. a:opt
+ else
+ let values = get(a:def, 'values', {})
+ if has_key(values, ml[1])
+ let vdef = values[ml[1]]
+ let type = s:GetValueType(vdef)
+ if type == -1
+ let opt_value = !!str2nr(ml[2])
+ elseif type == 0
+ let opt_value = str2nr(ml[2])
+ elseif type == 1
+ let opt_value = ml[2]
+ elseif type == 2
+ let opt_value = function(ml[2])
+ elseif type == 3
+ let opt_value = tlib#string#SplitCommaList(ml[2])
+ elseif type == 4
+ throw 'tlib#arg#GetOpts: Unsupported type conversion for '. ml[1]
+ elseif type == 5
+ let opt_value = str2float(ml[2])
+ endif
+ else
+ let opt_value = ml[2]
+ endif
+ let a:opts[ml[1]] = s:Validate(a:def, ml[1], opt_value)
+ unlet opt_value
+ endif
+ elseif short && a:opt =~# '^-\w='
+ let flagdefs = get(a:def, 'flags', {})
+ let flag = matchstr(a:opt, '^-\zs\w')
+ let rest = matchstr(a:opt, '^-\w\zs.*$')
+ call s:SetFlag(a:def, a:opts, idx, flag, rest, flagdefs)
+ elseif short && a:opt =~# '^-\w\+$'
+ let flagdefs = get(a:def, 'flags', {})
+ for flag in split(substitute(a:opt, '^-', '', ''), '\zs')
+ call s:SetFlag(a:def, a:opts, idx, flag, '', flagdefs)
+ endfor
+ else
+ let break = 1
+ if a:opt !=# '--'
+ let idx -= 1
+ endif
+ endif
+ return [break, idx]
+endf
+
+
+function! s:SetFlag(def, opts, idx, flag, rest, flagdefs) abort "{{{3
+ " TLogVAR a:def
+ if has_key(a:flagdefs, a:flag)
+ call s:SetOpt(a:def, a:opts, a:idx, a:flagdefs[a:flag] . a:rest)
+ else
+ let a:opts[a:flag] = s:Validate(a:def, a:flag, 1)
+ endif
+endf
+
+
+function! s:Validate(def, name, value) abort "{{{3
+ let values = get(a:def, 'values', {})
+ if has_key(values, a:name)
+ let vdef = values[a:name]
+ if has_key(vdef, 'validate')
+ if !call(vdef.validate, [a:value])
+ throw printf('tlib#arg: %s has invalid value: %s', string(a:name), string(a:value))
+ endif
+ endif
+ endif
+ return a:value
+endf
+
+
+":nodoc:
+function! tlib#arg#CComplete(def, ArgLead) abort "{{{3
+ let values = get(a:def, 'values', {})
+ let opt = matchstr(a:ArgLead, '^--\zs\w\+\ze=')
+ if has_key(values, opt)
+ let words = []
+ let vals = values[opt]
+ let complete_customlist = get(vals, 'complete_customlist', '')
+ if !empty(complete_customlist)
+ let words = eval(complete_customlist)
+ " else
+ " let complete = get(vals, 'complete', '')
+ " if !empty(complete)
+ " endif
+ endif
+ if !empty(words)
+ let prefix = matchstr(a:ArgLead, '^--\w\+=\%([^,]\+,\s*\)*')
+ let lead = substitute(a:ArgLead, '^--\w\+=\%([^,]\+,\s*\)*', '', '')
+ " TLogVAR a:ArgLead, lead
+ if !empty(lead)
+ let nchar = len(lead)
+ call filter(words, 'strpart(v:val, 0, nchar) ==# lead')
+ endif
+ let words = map(words, 'prefix . v:val')
+ return sort(words)
+ endif
+ endif
+ let cs = {'-h': 1, '--help': 1}
+ for [name, vdef] in items(values)
+ let type = s:GetValueType(vdef)
+ if type >= 0
+ let name .= '='
+ else
+ let cs['--no-'. name] = 1
+ endif
+ let cs['--'. name] = 1
+ endfor
+ for [name, subst] in items(get(a:def, 'flags', {}))
+ let ldef = get(values, substitute(subst, '^--', '', ''), {})
+ let type = s:GetValueType(ldef)
+ if type >= 0
+ let name .= '='
+ endif
+ let cs['-'. name] = 1
+ endfor
+ if has_key(a:def, 'trace')
+ let cs['--debug'] = 1
+ endif
+ let nchar = len(a:ArgLead)
+ if nchar > 0
+ call filter(cs, 'strpart(v:key, 0, nchar) ==# a:ArgLead')
+ endif
+ return sort(keys(cs))
+endf
+
+
+
+""" Command line {{{1
+
+" :def: function! tlib#arg#Ex(arg, ?chars='%#! ')
+" Escape some characters in a string.
+"
+" Use |fnamescape()| if available.
+"
+" EXAMPLES: >
+" exec 'edit '. tlib#arg#Ex('foo%#bar.txt')
+function! tlib#arg#Ex(arg, ...) "{{{3
+ if exists('*fnameescape') && a:0 == 0
+ return fnameescape(a:arg)
+ else
+ " let chars = '%# \'
+ let chars = '%#! '
+ if a:0 >= 1
+ let chars .= a:1
+ endif
+ return escape(a:arg, chars)
+ endif
+endf
+
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/assert.vim b/vim/bundle/tlib_vim/autoload/tlib/assert.vim
new file mode 100644
index 0000000..5d4dea7
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/assert.vim
@@ -0,0 +1,44 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: https://github.com/tomtom
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2015-12-04
+" @Revision: 41
+
+
+" Enable tracing via |:Tlibassert|.
+function! tlib#assert#Enable() abort "{{{3
+ " :nodoc:
+ command! -nargs=+ -bang Tlibassert call tlib#assert#Assert(expand('<sfile>'), <q-args>, [<args>])
+endf
+
+
+" Disable tracing via |:Tlibassert|.
+function! tlib#assert#Disable() abort "{{{3
+ " :nodoc:
+ command! -nargs=+ -bang Tlibassert :
+endf
+
+
+function! tlib#assert#Assert(caller, check, vals) abort "{{{3
+ for val in a:vals
+ " TLogVAR val
+ if type(val) == 3
+ call tlib#assert#Assert(a:caller, a:check, val)
+ elseif !val
+ throw 'Tlibassert: '. tlib#trace#Backtrace(a:caller) .': '. a:check
+ endif
+ endfor
+endf
+
+
+function! tlib#assert#Map(vals, expr) abort "{{{3
+ return tlib#assert#All(map(a:vals, a:expr))
+endf
+
+
+function! tlib#assert#All(vals) abort "{{{3
+ " TLogVAR a:vals, empty(filter(a:vals, '!v:val'))
+ return empty(filter(a:vals, '!v:val'))
+endf
+
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/autocmdgroup.vim b/vim/bundle/tlib_vim/autoload/tlib/autocmdgroup.vim
new file mode 100755
index 0000000..8439524
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/autocmdgroup.vim
@@ -0,0 +1,14 @@
+" autocmdgroup.vim
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 7
+
+augroup TLib
+ autocmd!
+augroup END
+
+
+function! tlib#autocmdgroup#Init() "{{{3
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/balloon.vim b/vim/bundle/tlib_vim/autoload/tlib/balloon.vim
new file mode 100644
index 0000000..6967523
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/balloon.vim
@@ -0,0 +1,73 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @GIT: http://github.com/tomtom/tlib_vim/
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2010-08-30.
+" @Last Change: 2015-11-23.
+" @Revision: 48
+
+
+function! tlib#balloon#Register(expr) "{{{3
+ if !has('balloon_eval')
+ return
+ endif
+ if !exists('b:tlib_balloons')
+ let b:tlib_balloons = []
+ endif
+ if !&ballooneval
+ setlocal ballooneval
+ endif
+ if &balloonexpr != 'tlib#balloon#Expr()'
+ if !empty(&balloonexpr)
+ call add(b:tlib_balloons, &balloonexpr)
+ endif
+ setlocal ballooneval balloonexpr=tlib#balloon#Expr()
+ endif
+ if index(b:tlib_balloons, a:expr) == -1
+ call add(b:tlib_balloons, a:expr)
+ endif
+endf
+
+
+function! tlib#balloon#Remove(expr) "{{{3
+ if exists('b:tlib_balloons')
+ call filter(b:tlib_balloons, 'v:val != a:expr')
+ if empty(b:tlib_balloons)
+ setlocal ballooneval&
+ setlocal balloonexpr&
+ unlet b:tlib_balloons
+ endif
+ endif
+endf
+
+
+function! tlib#balloon#Expr() "{{{3
+ " TLogVAR exists('b:tlib_balloons')
+ if !exists('b:tlib_balloons')
+ return ''
+ endif
+ let text = map(copy(b:tlib_balloons), 'eval(v:val)')
+ " TLogVAR b:tlib_balloons, text
+ call filter(text, '!empty(v:val)')
+ if has('balloon_multiline')
+ return join(text, "\n----------------------------------\n")
+ else
+ return get(text, 0, '')
+ endif
+endf
+
+
+function! tlib#balloon#Expand(expr) abort "{{{3
+ if v:beval_bufnr != bufnr('%')
+ " TLogVAR v:beval_bufnr, bufnr('%')
+ return ''
+ endif
+ let win = winsaveview()
+ try
+ call setpos('.', [v:beval_bufnr, v:beval_lnum, v:beval_col, 0])
+ return expand(a:expr)
+ finally
+ call winrestview(win)
+ endtry
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/bitwise.vim b/vim/bundle/tlib_vim/autoload/tlib/bitwise.vim
new file mode 100644
index 0000000..54a4258
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/bitwise.vim
@@ -0,0 +1,141 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 124
+
+
+function! tlib#bitwise#Num2Bits(num) "{{{3
+ if type(a:num) <= 1 || type(a:num) == 5
+ let bits = reverse(tlib#number#ConvertBase(a:num, 2, 'list'))
+ elseif type(a:num) == 3
+ let bits = copy(a:num)
+ else
+ throw "tlib#bitwise#Num2Bits: Must be number of list: ". string(a:num)
+ endif
+ return bits
+endf
+
+
+function! tlib#bitwise#Bits2Num(bits, ...) "{{{3
+ let base = a:0 >= 1 ? a:1 : 10
+ " TLogVAR a:bits
+ let num = 0.0
+ for i in range(len(a:bits))
+ if get(a:bits, i, 0)
+ let num += pow(2, i)
+ endif
+ endfor
+ " TLogVAR num
+ if base == 10
+ if type(base) == 5
+ return num
+ else
+ return float2nr(num)
+ endif
+ else
+ return tlib#number#ConvertBase(num, base)
+ endif
+endf
+
+
+function! tlib#bitwise#AND(num1, num2, ...) "{{{3
+ let rtype = a:0 >= 1 ? a:1 : 'num'
+ return s:BitwiseComparison(a:num1, a:num2, rtype,
+ \ 'get(bits1, v:val) && get(bits2, v:val)')
+endf
+
+
+function! tlib#bitwise#OR(num1, num2, ...) "{{{3
+ let rtype = a:0 >= 1 ? a:1 : 'num'
+ return s:BitwiseComparison(a:num1, a:num2, rtype,
+ \ 'get(bits1, v:val) || get(bits2, v:val)')
+endf
+
+
+function! tlib#bitwise#XOR(num1, num2, ...) "{{{3
+ let rtype = a:0 >= 1 ? a:1 : 'num'
+ return s:BitwiseComparison(a:num1, a:num2, rtype,
+ \ 'get(bits1, v:val) ? !get(bits2, v:val) : get(bits2, v:val)')
+endf
+
+
+function! s:BitwiseComparison(num1, num2, rtype, expr) "{{{3
+ let bits1 = tlib#bitwise#Num2Bits(a:num1)
+ let bits2 = tlib#bitwise#Num2Bits(a:num2)
+ let range = range(max([len(bits1), len(bits2)]))
+ let bits = map(range, a:expr)
+ if a:rtype == 'num' || (a:rtype == 'auto' && type(a:num1) <= 1)
+ return tlib#bitwise#Bits2Num(bits)
+ else
+ return bits
+ endif
+endf
+
+
+function! tlib#bitwise#ShiftRight(bits, n) "{{{3
+ let bits = a:bits[a:n : -1]
+ if empty(bits)
+ let bits = [0]
+ endif
+ return bits
+endf
+
+
+function! tlib#bitwise#ShiftLeft(bits, n) "{{{3
+ let bits = repeat([0], a:n) + a:bits
+ return bits
+endf
+
+
+function! tlib#bitwise#Add(num1, num2, ...) "{{{3
+ let rtype = a:0 >= 1 ? a:1 : 'num'
+ let bits1 = tlib#bitwise#Num2Bits(a:num1)
+ let bits2 = tlib#bitwise#Num2Bits(a:num2)
+ let range = range(max([len(bits1), len(bits2)]))
+ " TLogVAR bits1, bits2, range
+ let carry = 0
+ let bits = []
+ for i in range
+ let sum = get(bits1, i) + get(bits2, i) + carry
+ if sum == 3
+ let bit = 1
+ let carry = 1
+ elseif sum == 2
+ let bit = 0
+ let carry = 1
+ elseif sum == 1
+ let bit = 1
+ let carry = 0
+ elseif sum == 0
+ let bit = 0
+ let carry = 0
+ endif
+ call add(bits, bit)
+ " TLogVAR i, bits, bit
+ endfor
+ if carry == 1
+ call add(bits, carry)
+ endif
+ if rtype == 'num' || (rtype == 'auto' && type(a:num1) <= 1)
+ return tlib#bitwise#Bits2Num(bits)
+ else
+ return bits
+ endif
+endf
+
+
+function! tlib#bitwise#Sub(num1, num2, ...) "{{{3
+ let rtype = a:0 >= 1 ? a:1 : 'num'
+ let bits1 = tlib#bitwise#Num2Bits(a:num1)
+ let bits2 = tlib#bitwise#Num2Bits(a:num2)
+ let range = range(max([len(bits1), len(bits2)]))
+ let bits2 = map(range, '!get(bits2, v:val)')
+ let bits2 = tlib#bitwise#Add(bits2, [1], 'bits')
+ let bits3 = tlib#bitwise#Add(bits1, bits2, 'bits')
+ let bits = bits3[0 : -2]
+ if rtype == 'num' || (rtype == 'auto' && type(a:num1) <= 1)
+ return tlib#bitwise#Bits2Num(bits)
+ else
+ return bits
+ endif
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/buffer.vim b/vim/bundle/tlib_vim/autoload/tlib/buffer.vim
new file mode 100644
index 0000000..aa75545
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/buffer.vim
@@ -0,0 +1,401 @@
+" buffer.vim
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2007-06-30.
+" @Last Change: 2015-11-06.
+" @Revision: 7.1.352
+
+
+" Where to display the line when using |tlib#buffer#ViewLine|.
+" For possible values for position see |scroll-cursor|.
+TLet g:tlib_viewline_position = 'zz'
+
+
+let s:bmru = []
+
+
+function! tlib#buffer#EnableMRU() "{{{3
+ call tlib#autocmdgroup#Init()
+ autocmd TLib BufEnter * call s:BMRU_Push(bufnr('%'))
+endf
+
+
+function! tlib#buffer#DisableMRU() "{{{3
+ call tlib#autocmdgroup#Init()
+ autocmd! TLib BufEnter
+endf
+
+
+function! s:BMRU_Push(bnr) "{{{3
+ let i = index(s:bmru, a:bnr)
+ if i >= 0
+ call remove(s:bmru, i)
+ endif
+ call insert(s:bmru, a:bnr)
+endf
+
+
+function! s:CompareBuffernameByBasename(a, b) "{{{3
+ let rx = '"\zs.\{-}\ze" \+\S\+ \+\d\+$'
+ let an = matchstr(a:a, rx)
+ let an = fnamemodify(an, ':t')
+ let bn = matchstr(a:b, rx)
+ let bn = fnamemodify(bn, ':t')
+ let rv = an == bn ? 0 : an > bn ? 1 : -1
+ return rv
+endf
+
+
+function! s:CompareBufferNrByMRU(a, b) "{{{3
+ let an = matchstr(a:a, '\s*\zs\d\+\ze')
+ let bn = matchstr(a:b, '\s*\zs\d\+\ze')
+ let ai = index(s:bmru, 0 + an)
+ if ai == -1
+ return 1
+ else
+ let bi = index(s:bmru, 0 + bn)
+ if bi == -1
+ return -1
+ else
+ return ai == bi ? 0 : ai > bi ? 1 : -1
+ endif
+ endif
+endf
+
+
+" Set the buffer to buffer and return a command as string that can be
+" evaluated by |:execute| in order to restore the original view.
+function! tlib#buffer#Set(buffer) "{{{3
+ let lazyredraw = &lazyredraw
+ set lazyredraw
+ try
+ let cb = bufnr('%')
+ let sn = bufnr(a:buffer)
+ if sn != cb
+ let ws = bufwinnr(sn)
+ if ws != -1
+ let wb = bufwinnr('%')
+ exec ws.'wincmd w'
+ return wb.'wincmd w'
+ else
+ silent exec 'sbuffer! '. sn
+ return 'wincmd c'
+ endif
+ else
+ return ''
+ endif
+ finally
+ let &lazyredraw = lazyredraw
+ endtry
+endf
+
+
+" :def: function! tlib#buffer#Eval(buffer, code)
+" Evaluate CODE in BUFFER.
+"
+" EXAMPLES: >
+" call tlib#buffer#Eval('foo.txt', 'echo b:bar')
+function! tlib#buffer#Eval(buffer, code) "{{{3
+ " let cb = bufnr('%')
+ " let wb = bufwinnr('%')
+ " " TLogVAR cb
+ " let sn = bufnr(a:buffer)
+ " let sb = sn != cb
+ let lazyredraw = &lazyredraw
+ set lazyredraw
+ let restore = tlib#buffer#Set(a:buffer)
+ try
+ exec a:code
+ " if sb
+ " let ws = bufwinnr(sn)
+ " if ws != -1
+ " try
+ " exec ws.'wincmd w'
+ " exec a:code
+ " finally
+ " exec wb.'wincmd w'
+ " endtry
+ " else
+ " try
+ " silent exec 'sbuffer! '. sn
+ " exec a:code
+ " finally
+ " wincmd c
+ " endtry
+ " endif
+ " else
+ " exec a:code
+ " endif
+ finally
+ exec restore
+ let &lazyredraw = lazyredraw
+ endtry
+endf
+
+
+" :def: function! tlib#buffer#GetList(?show_hidden=0, ?show_number=0, " ?order='bufnr')
+" Possible values for the "order" argument:
+" bufnr :: Default behaviour
+" mru :: Sort buffers according to most recent use
+" basename :: Sort by the file's basename (last component)
+"
+" NOTE: MRU order works on second invocation only. If you want to always
+" use MRU order, call tlib#buffer#EnableMRU() in your ~/.vimrc file.
+function! tlib#buffer#GetList(...)
+ TVarArg ['show_hidden', 0], ['show_number', 0], ['order', '']
+ " TLogVAR show_hidden, show_number, order
+ let ls_bang = show_hidden ? '!' : ''
+ redir => bfs
+ exec 'silent ls'. ls_bang
+ redir END
+ let buffer_list = split(bfs, '\n')
+ if order == 'mru'
+ if empty(s:bmru)
+ call tlib#buffer#EnableMRU()
+ echom 'tlib: Installed Buffer MRU logger; disable with: call tlib#buffer#DisableMRU()'
+ else
+ call sort(buffer_list, function('s:CompareBufferNrByMRU'))
+ endif
+ elseif order == 'basename'
+ call sort(buffer_list, function('s:CompareBuffernameByBasename'))
+ endif
+ let buffer_nr = map(copy(buffer_list), 'str2nr(matchstr(v:val, ''\s*\zs\d\+\ze''))')
+ " TLogVAR buffer_list, buffer_nr
+ if show_number
+ call map(buffer_list, 'matchstr(v:val, ''^\s*\d\+.\{-}\ze\s\+\S\+ \d\+\s*$'')')
+ else
+ call map(buffer_list, 'matchstr(v:val, ''^\s*\d\+\zs.\{-}\ze\s\+\S\+ \d\+\s*$'')')
+ endif
+ " TLogVAR buffer_list
+ " call map(buffer_list, 'matchstr(v:val, ''^.\{-}\ze\s\+line \d\+\s*$'')')
+ " TLogVAR buffer_list
+ call map(buffer_list, 'matchstr(v:val, ''^[^"]\+''). printf("%-20s %s", fnamemodify(matchstr(v:val, ''"\zs.\{-}\ze"$''), ":t"), fnamemodify(matchstr(v:val, ''"\zs.\{-}\ze"$''), ":h"))')
+ " TLogVAR buffer_list
+ return [buffer_nr, buffer_list]
+endf
+
+
+" :def: function! tlib#buffer#ViewLine(line, ?position='z')
+" line is either a number or a string that begins with a number.
+" For possible values for position see |scroll-cursor|.
+" See also |g:tlib_viewline_position|.
+function! tlib#buffer#ViewLine(line, ...) "{{{3
+ if a:line
+ TVarArg 'pos'
+ let ln = matchstr(a:line, '^\d\+')
+ let lt = matchstr(a:line, '^\d\+: \zs.*')
+ " TLogVAR pos, ln, lt
+ exec ln
+ if empty(pos)
+ let pos = tlib#var#Get('tlib_viewline_position', 'wbg')
+ endif
+ " TLogVAR pos
+ if !empty(pos)
+ exec 'norm! '. pos
+ endif
+ call tlib#buffer#HighlightLine(ln)
+ " let @/ = '\%'. ln .'l.*'
+ endif
+endf
+
+
+function! s:UndoHighlightLine() "{{{3
+ 2match none
+ autocmd! TLib CursorMoved,CursorMovedI <buffer>
+ autocmd! TLib CursorHold,CursorHoldI <buffer>
+ autocmd! TLib InsertEnter,InsertChange,InsertLeave <buffer>
+ autocmd! TLib BufLeave,BufWinLeave,WinLeave,BufHidden <buffer>
+endf
+
+
+function! tlib#buffer#HighlightLine(...) "{{{3
+ TVarArg ['line', line('.')]
+ " exec '2match MatchParen /^\%'. a:line .'l.*/'
+ exec '2match Search /^\%'. line .'l.*/'
+ call tlib#autocmdgroup#Init()
+ exec 'autocmd TLib CursorMoved,CursorMovedI <buffer> if line(".") != '. line .' | call s:UndoHighlightLine() | endif'
+ autocmd TLib CursorHold,CursorHoldI <buffer> call s:UndoHighlightLine()
+ autocmd TLib InsertEnter <buffer> call s:UndoHighlightLine()
+ " autocmd TLib BufLeave,BufWinLeave,WinLeave,BufHidden <buffer> call s:UndoHighlightLine()
+endf
+
+
+" Delete the lines in the current buffer. Wrapper for |:delete|.
+function! tlib#buffer#DeleteRange(line1, line2) "{{{3
+ let r = @t
+ try
+ exec a:line1.','.a:line2.'delete t'
+ finally
+ let @t = r
+ endtry
+endf
+
+
+" Replace a range of lines.
+function! tlib#buffer#ReplaceRange(line1, line2, lines)
+ call tlib#buffer#DeleteRange(a:line1, a:line2)
+ call append(a:line1 - 1, a:lines)
+endf
+
+
+" Initialize some scratch area at the bottom of the current buffer.
+function! tlib#buffer#ScratchStart() "{{{3
+ norm! Go
+ let b:tlib_inbuffer_scratch = line('$')
+ return b:tlib_inbuffer_scratch
+endf
+
+
+" Remove the in-buffer scratch area.
+function! tlib#buffer#ScratchEnd() "{{{3
+ if !exists('b:tlib_inbuffer_scratch')
+ echoerr 'tlib: In-buffer scratch not initalized'
+ endif
+ call tlib#buffer#DeleteRange(b:tlib_inbuffer_scratch, line('$'))
+ unlet b:tlib_inbuffer_scratch
+endf
+
+
+" Run exec on all buffers via bufdo and return to the original buffer.
+function! tlib#buffer#BufDo(exec) "{{{3
+ let bn = bufnr('%')
+ exec 'bufdo '. a:exec
+ exec 'buffer! '. bn
+endf
+
+
+" :def: function! tlib#buffer#InsertText(text, keyargs)
+" Keyargs:
+" 'shift': 0|N
+" 'col': col('.')|N
+" 'lineno': line('.')|N
+" 'indent': 0|1
+" 'pos': 'e'|'s' ... Where to locate the cursor (somewhat like s and e in {offset})
+" Insert text (a string) in the buffer.
+function! tlib#buffer#InsertText(text, ...) "{{{3
+ TVarArg ['keyargs', {}]
+ " TLogVAR a:text, keyargs
+ let keyargs = extend({
+ \ 'shift': 0, 'col': col('.'), 'lineno': line('.'), 'pos': 'e', 'indent': 0
+ \ }, keyargs)
+ " TLogVAR keyargs
+ let grow = 0
+ let post_del_last_line = line('$') == 1
+ let line = getline(keyargs.lineno)
+ if keyargs.col + keyargs.shift > 0
+ let pre = line[0 : (keyargs.col - 1 + keyargs.shift)]
+ let post = line[(keyargs.col + keyargs.shift): -1]
+ else
+ let pre = ''
+ let post = line
+ endif
+ " TLogVAR keyargs.lineno, line, pre, post
+ let text0 = pre . a:text . post
+ let text = split(text0, '\n', 1)
+ " TLogVAR text
+ let icol = len(pre)
+ " exec 'norm! '. keyargs.lineno .'G'
+ call cursor(keyargs.lineno, keyargs.col)
+ if keyargs.indent && keyargs.col > 1
+ if &fo =~# '[or]'
+ " FIXME: Is the simple version sufficient?
+ " VERSION 1
+ " " This doesn't work because it's not guaranteed that the
+ " " cursor is set.
+ " let cline = getline('.')
+ " norm! a
+ " "norm! o
+ " " TAssertExec redraw | sleep 3
+ " let idt = strpart(getline('.'), 0, keyargs.col('.') + keyargs.shift)
+ " " TLogVAR idt
+ " let idtl = len(idt)
+ " -1,.delete
+ " " TAssertExec redraw | sleep 3
+ " call append(keyargs.lineno - 1, cline)
+ " call cursor(keyargs.lineno, keyargs.col)
+ " " TAssertExec redraw | sleep 3
+ " if idtl == 0 && icol != 0
+ " let idt = matchstr(pre, '^\s\+')
+ " let idtl = len(idt)
+ " endif
+ " VERSION 2
+ let idt = matchstr(pre, '^\s\+')
+ let idtl = len(idt)
+ else
+ let [m_0, idt, iline; rest] = matchlist(pre, '^\(\s*\)\(.*\)$')
+ let idtl = len(idt)
+ endif
+ if idtl < icol
+ let idt .= repeat(' ', icol - idtl)
+ endif
+ " TLogVAR idt
+ let idtl1 = len(idt)
+ for i in range(1, len(text) - 1)
+ let text[i] = idt . text[i]
+ let grow += idtl1
+ endfor
+ endif
+ " TLogVAR text
+ " exec 'norm! '. keyargs.lineno .'Gdd'
+ call tlib#normal#WithRegister('"tdd', 't')
+ call append(keyargs.lineno - 1, text)
+ if post_del_last_line
+ call tlib#buffer#KeepCursorPosition('$delete')
+ endif
+ let tlen = len(text)
+ let posshift = matchstr(keyargs.pos, '\d\+')
+ " TLogVAR keyargs.pos
+ if keyargs.pos =~ '^e'
+ exec keyargs.lineno + tlen - 1
+ exec 'norm! 0'. (len(text[-1]) - len(post) + posshift - 1) .'l'
+ elseif keyargs.pos =~ '^s'
+ " TLogVAR keyargs.lineno, pre, posshift
+ exec keyargs.lineno
+ exec 'norm! '. len(pre) .'|'
+ if !empty(posshift)
+ exec 'norm! '. posshift .'h'
+ endif
+ endif
+ " TLogDBG getline(keyargs.lineno)
+ " TLogDBG string(getline(1, '$'))
+ return grow
+endf
+
+
+function! tlib#buffer#InsertText0(text, ...) "{{{3
+ TVarArg ['keyargs', {}]
+ let mode = get(keyargs, 'mode', 'i')
+ " TLogVAR mode
+ if !has_key(keyargs, 'shift')
+ let col = col('.')
+ " if mode =~ 'i'
+ " let col += 1
+ " endif
+ let keyargs.shift = col >= col('$') ? 0 : -1
+ " let keyargs.shift = col('.') >= col('$') ? 0 : -1
+ " TLogVAR col
+ " TLogDBG col('.') .'-'. col('$') .': '. string(getline('.'))
+ endif
+ " TLogVAR keyargs.shift
+ return tlib#buffer#InsertText(a:text, keyargs)
+endf
+
+
+function! tlib#buffer#CurrentByte() "{{{3
+ return line2byte(line('.')) + col('.')
+endf
+
+
+" Evaluate cmd while maintaining the cursor position and jump registers.
+function! tlib#buffer#KeepCursorPosition(cmd) "{{{3
+ " let pos = getpos('.')
+ let view = winsaveview()
+ try
+ keepjumps exec a:cmd
+ finally
+ " call setpos('.', pos)
+ call winrestview(view)
+ endtry
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/cache.vim b/vim/bundle/tlib_vim/autoload/tlib/cache.vim
new file mode 100755
index 0000000..0f59f34
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/cache.vim
@@ -0,0 +1,360 @@
+" cache.vim
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2007-06-30.
+" @Last Change: 2015-11-26.
+" @Revision: 35.1.243
+
+
+" The cache directory. If empty, use |tlib#dir#MyRuntime|.'/cache'.
+" You might want to delete old files from this directory from time to
+" time with a command like: >
+" find ~/vimfiles/cache/ -atime +31 -type f -print -delete
+TLet g:tlib_cache = ''
+
+" |tlib#cache#Purge()|: Remove cache files older than N days.
+TLet g:tlib#cache#purge_days = 31
+
+" Purge the cache every N days. Disable automatic purging by setting
+" this value to a negative value.
+TLet g:tlib#cache#purge_every_days = 31
+
+" The encoding used for the purge-cache script.
+" Default: 'enc'
+TLet g:tlib#cache#script_encoding = &enc
+
+" Whether to run the directory removal script:
+" 0 ... No
+" 1 ... Query user
+" 2 ... Yes
+TLet g:tlib#cache#run_script = 1
+
+" Verbosity level:
+" 0 ... Be quiet
+" 1 ... Display informative message
+" 2 ... Display detailed messages
+TLet g:tlib#cache#verbosity = 1
+
+" A list of regexps that are matched against partial filenames of the
+" cached files. If a regexp matches, the file won't be removed by
+" |tlib#cache#Purge()|.
+TLet g:tlib#cache#dont_purge = ['[\/]\.last_purge$']
+
+" If the cache filename is longer than N characters, use
+" |pathshorten()|.
+TLet g:tlib#cache#max_filename = 200
+
+let s:cache = {}
+
+
+" :display: tlib#cache#Dir(?mode = 'bg')
+" The default cache directory.
+function! tlib#cache#Dir(...) "{{{3
+ TVarArg ['mode', 'bg']
+ let dir = tlib#var#Get('tlib_cache', mode)
+ if empty(dir)
+ let dir = tlib#file#Join([tlib#dir#MyRuntime(), 'cache'])
+ endif
+ return dir
+endf
+
+
+" :def: function! tlib#cache#Filename(type, ?file=%, ?mkdir=0, ?dir='')
+function! tlib#cache#Filename(type, ...) "{{{3
+ " TLogDBG 'bufname='. bufname('.')
+ let dir0 = a:0 >= 3 && !empty(a:3) ? a:3 : tlib#cache#Dir()
+ let dir = dir0
+ if a:0 >= 1 && !empty(a:1)
+ let file = a:1
+ else
+ if empty(expand('%:t'))
+ return ''
+ endif
+ let file = expand('%:p')
+ let file = tlib#file#Relative(file, tlib#file#Join([dir, '..']))
+ endif
+ " TLogVAR file, dir
+ let mkdir = a:0 >= 2 ? a:2 : 0
+ let file = substitute(file, '\.\.\|[:&<>]\|//\+\|\\\\\+', '_', 'g')
+ let dirs = [dir, a:type]
+ let dirf = fnamemodify(file, ':h')
+ if dirf != '.'
+ call add(dirs, dirf)
+ endif
+ let dir = tlib#file#Join(dirs)
+ " TLogVAR dir
+ let dir = tlib#dir#PlainName(dir)
+ " TLogVAR dir
+ let file = fnamemodify(file, ':t')
+ " TLogVAR file, dir, mkdir
+ let cache_file = tlib#file#Join([dir, file])
+ if len(cache_file) > g:tlib#cache#max_filename
+ if v:version >= 704
+ let shortfilename = pathshorten(file) .'_'. sha256(file)
+ else
+ let shortfilename = pathshorten(file) .'_'. tlib#hash#Adler32(file)
+ endif
+ let cache_file = tlib#cache#Filename(a:type, shortfilename, mkdir, dir0)
+ else
+ if mkdir && !isdirectory(dir)
+ try
+ call mkdir(dir, 'p')
+ catch /^Vim\%((\a\+)\)\=:E739:/
+ if filereadable(dir) && !isdirectory(dir)
+ echoerr 'TLib: Cannot create directory for cache file because a file with the same name exists (please delete it):' dir
+ " call delete(dir)
+ " call mkdir(dir, 'p')
+ endif
+ endtry
+ endif
+ endif
+ " TLogVAR cache_file
+ return cache_file
+endf
+
+
+let s:timestamps = {}
+
+
+function! s:SetTimestamp(cfile, type) "{{{3
+ if !has_key(s:timestamps, a:cfile)
+ let s:timestamps[a:cfile] = {}
+ endif
+ let s:timestamps[a:cfile].atime = getftime(a:cfile)
+ let s:timestamps[a:cfile][a:type] = s:timestamps[a:cfile].atime
+endf
+
+
+function! tlib#cache#Save(cfile, dictionary, ...) "{{{3
+ TVarArg ['options', {}]
+ let in_memory = get(options, 'in_memory', 0)
+ if in_memory
+ " TLogVAR in_memory, a:cfile, localtime()
+ let s:cache[a:cfile] = {'mtime': localtime(), 'data': a:dictionary}
+ elseif !empty(a:cfile)
+ " TLogVAR a:dictionary
+ call writefile([string(a:dictionary)], a:cfile, 'b')
+ call s:SetTimestamp(a:cfile, 'write')
+ endif
+endf
+
+
+function! tlib#cache#MTime(cfile) "{{{3
+ let mtime = {'mtime': getftime(a:cfile)}
+ let mtime = extend(mtime, get(s:timestamps, a:cfile, {}))
+ return mtime
+endf
+
+
+function! tlib#cache#Get(cfile, ...) "{{{3
+ TVarArg ['default', {}], ['options', {}]
+ let in_memory = get(options, 'in_memory', 0)
+ if in_memory
+ " TLogVAR in_memory, a:cfile
+ return get(get(s:cache, a:cfile, {}), 'data', default)
+ else
+ call tlib#cache#MaybePurge()
+ if !empty(a:cfile) && filereadable(a:cfile)
+ let val = readfile(a:cfile, 'b')
+ call s:SetTimestamp(a:cfile, 'read')
+ return eval(join(val, "\n"))
+ else
+ return default
+ endif
+ endif
+endf
+
+
+" :display: tlib#cache#Value(cfile, generator, ftime, ?generator_args=[], ?options={})
+" Get a cached value from cfile. If it is outdated (compared to ftime)
+" or does not exist, create it calling a generator function.
+function! tlib#cache#Value(cfile, generator, ftime, ...) "{{{3
+ TVarArg ['args', []], ['options', {}]
+ let in_memory = get(options, 'in_memory', 0)
+ if in_memory
+ let not_found = !has_key(s:cache, a:cfile)
+ let cftime = not_found ? -1 : s:cache[a:cfile].mtime
+ else
+ let cftime = getftime(a:cfile)
+ endif
+ " TLogVAR in_memory, cftime
+ if cftime == -1 || (a:ftime != 0 && cftime < a:ftime)
+ " TLogVAR a:generator, args
+ let val = call(a:generator, args)
+ " TLogVAR val
+ let cval = {'val': val}
+ " TLogVAR cval
+ call tlib#cache#Save(a:cfile, cval, options)
+ return val
+ else
+ let val = tlib#cache#Get(a:cfile, {}, options)
+ if !has_key(val, 'val')
+ throw 'tlib#cache#Value: Internal error: '. a:cfile
+ else
+ return val.val
+ endif
+ endif
+endf
+
+
+" Call |tlib#cache#Purge()| if the last purge was done before
+" |g:tlib#cache#purge_every_days|.
+function! tlib#cache#MaybePurge() "{{{3
+ if g:tlib#cache#purge_every_days < 0
+ return
+ endif
+ let dir = tlib#cache#Dir('g')
+ let last_purge = tlib#file#Join([dir, '.last_purge'])
+ let last_purge_exists = filereadable(last_purge)
+ if last_purge_exists
+ let threshold = localtime() - g:tlib#cache#purge_every_days * g:tlib#date#dayshift
+ let should_purge = getftime(last_purge) < threshold
+ else
+ let should_purge = 0 " should ignore empty dirs, like the tmru one: !empty(glob(tlib#file#Join([dir, '**'])))
+ endif
+ if should_purge
+ if last_purge_exists
+ let yn = 'y'
+ else
+ let txt = "TLib: The cache directory '". dir ."' should be purged of old files.\nDelete files older than ". g:tlib#cache#purge_days ." days now?"
+ let yn = tlib#input#Dialog(txt, ['yes', 'no'], 'no')
+ endif
+ if yn =~ '^y\%[es]$'
+ call tlib#cache#Purge()
+ else
+ let g:tlib#cache#purge_every_days = -1
+ if !last_purge_exists
+ call s:PurgeTimestamp(dir)
+ endif
+ echohl WarningMsg
+ echom "TLib: Please run :call tlib#cache#Purge() to clean up ". dir
+ echohl NONE
+ endif
+ elseif !last_purge_exists
+ call s:PurgeTimestamp(dir)
+ endif
+endf
+
+
+" Delete old files.
+function! tlib#cache#Purge() "{{{3
+ let threshold = localtime() - g:tlib#cache#purge_days * g:tlib#date#dayshift
+ let dir = tlib#cache#Dir('g')
+ if g:tlib#cache#verbosity >= 1
+ echohl WarningMsg
+ echom "TLib: Delete files older than ". g:tlib#cache#purge_days ." days from ". dir
+ echohl NONE
+ endif
+ let files = tlib#cache#ListFilesInCache()
+ let deldir = []
+ let newer = []
+ let msg = []
+ let more = &more
+ set nomore
+ try
+ for file in files
+ if isdirectory(file)
+ if empty(filter(copy(newer), 'strpart(v:val, 0, len(file)) ==# file'))
+ call add(deldir, file)
+ endif
+ else
+ if getftime(file) < threshold
+ if delete(file)
+ call add(msg, "TLib: Could not delete cache file: ". file)
+ elseif g:tlib#cache#verbosity >= 2
+ call add(msg, "TLib: Delete cache file: ". file)
+ endif
+ else
+ call add(newer, file)
+ endif
+ endif
+ endfor
+ finally
+ let &more = more
+ endtry
+ if !empty(msg) && g:tlib#cache#verbosity >= 1
+ echo join(msg, "\n")
+ endif
+ if !empty(deldir)
+ if &shell =~ 'sh\(\.exe\)\?$'
+ let scriptfile = 'deldir.sh'
+ let rmdir = 'rm -rf %s'
+ else
+ let scriptfile = 'deldir.bat'
+ let rmdir = 'rmdir /S /Q %s'
+ endif
+ let enc = g:tlib#cache#script_encoding
+ if has('multi_byte') && enc != &enc
+ call map(deldir, 'iconv(v:val, &enc, enc)')
+ endif
+ let scriptfile = tlib#file#Join([dir, scriptfile])
+ if filereadable(scriptfile)
+ let script = readfile(scriptfile)
+ else
+ let script = []
+ endif
+ let script += map(copy(deldir), 'printf(rmdir, shellescape(v:val, 1))')
+ let script = tlib#list#Uniq(script)
+ call writefile(script, scriptfile)
+ call inputsave()
+ if g:tlib#cache#run_script == 0
+ if g:tlib#cache#verbosity >= 1
+ echohl WarningMsg
+ if g:tlib#cache#verbosity >= 2
+ echom "TLib: Purged cache. Need to run script to delete directories"
+ endif
+ echom "TLib: Please review and execute: ". scriptfile
+ echohl NONE
+ endif
+ else
+ try
+ let yn = g:tlib#cache#run_script == 2 ? 'y' : tlib#input#Dialog("TLib: About to delete directories by means of a shell script.\nDirectory removal script: ". scriptfile ."\nRun script to delete directories now?", ['yes', 'no', 'edit'], 'no')
+ if yn =~ '^y\%[es]$'
+ exec 'silent cd '. fnameescape(dir)
+ exec '! ' &shell shellescape(scriptfile, 1)
+ exec 'silent cd -'
+ call delete(scriptfile)
+ elseif yn =~ '^e\%[dit]$'
+ exec 'edit '. fnameescape(scriptfile)
+ endif
+ finally
+ call inputrestore()
+ endtry
+ endif
+ endif
+ call s:PurgeTimestamp(dir)
+endf
+
+
+function! s:PurgeTimestamp(dir) "{{{3
+ let last_purge = tlib#file#Join([a:dir, '.last_purge'])
+ " TLogVAR last_purge
+ call writefile([" "], last_purge)
+endf
+
+function! tlib#cache#ListFilesInCache(...) "{{{3
+ let dir = a:0 >= 1 ? a:1 : tlib#cache#Dir('g')
+ if v:version > 702 || (v:version == 702 && has('patch51'))
+ let filess = glob(tlib#file#Join([dir, '**']), 1)
+ else
+ let filess = glob(tlib#file#Join([dir, '**']))
+ endif
+ let files = reverse(split(filess, '\n'))
+ let pos0 = len(tlib#dir#CanonicName(dir))
+ call filter(files, 's:ShouldPurge(strpart(v:val, pos0))')
+ return files
+endf
+
+
+function! s:ShouldPurge(partial_filename) "{{{3
+ " TLogVAR a:partial_filename
+ for rx in g:tlib#cache#dont_purge
+ if a:partial_filename =~ rx
+ " TLogVAR a:partial_filename, rx
+ return 0
+ endif
+ endfor
+ return 1
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/char.vim b/vim/bundle/tlib_vim/autoload/tlib/char.vim
new file mode 100755
index 0000000..d3d2cb6
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/char.vim
@@ -0,0 +1,59 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 38
+
+
+" :def: function! tlib#char#Get(?timeout=0)
+" Get a character.
+"
+" EXAMPLES: >
+" echo tlib#char#Get()
+" echo tlib#char#Get(5)
+function! tlib#char#Get(...) "{{{3
+ TVarArg ['timeout', 0], ['resolution', 0], ['getmod', 0]
+ let char = -1
+ let mode = 0
+ if timeout == 0 || !has('reltime')
+ let char = getchar()
+ else
+ let char = tlib#char#GetWithTimeout(timeout, resolution)
+ endif
+ if getmod
+ if char != -1
+ let mode = getcharmod()
+ endif
+ return [char, mode]
+ else
+ return char
+ endif
+endf
+
+
+function! tlib#char#IsAvailable() "{{{3
+ let ch = getchar(1)
+ return type(ch) == 0 && ch != 0
+endf
+
+
+function! tlib#char#GetWithTimeout(timeout, ...) "{{{3
+ TVarArg ['resolution', 2]
+ " TLogVAR a:timeout, resolution
+ let start = tlib#time#MSecs()
+ while 1
+ let c = getchar(0)
+ if type(c) != 0 || c != 0
+ return c
+ else
+ let now = tlib#time#MSecs()
+ let diff = tlib#time#DiffMSecs(now, start, resolution)
+ " TLogVAR diff
+ if diff > a:timeout
+ return -1
+ endif
+ endif
+ endwh
+ return -1
+endf
+
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/cmd.vim b/vim/bundle/tlib_vim/autoload/tlib/cmd.vim
new file mode 100755
index 0000000..f65a237
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/cmd.vim
@@ -0,0 +1,117 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 58
+
+
+let g:tlib#cmd#last_output = []
+
+
+function! tlib#cmd#OutputAsList(command) "{{{3
+ " TLogVAR a:command
+ if exists('s:redir_lines')
+ redir END
+ let cache = s:redir_lines
+ endif
+ let s:redir_lines = ''
+ redir =>> s:redir_lines
+ silent! exec a:command
+ redir END
+ let g:tlib#cmd#last_output = split(s:redir_lines, '\n')
+ unlet s:redir_lines
+ if exists('cache')
+ let s:redir_lines = cache
+ redir =>> s:redir_lines
+ endif
+ return g:tlib#cmd#last_output
+endf
+
+
+" See |:TBrowseOutput|.
+function! tlib#cmd#BrowseOutput(command) "{{{3
+ call tlib#cmd#BrowseOutputWithCallback("tlib#cmd#DefaultBrowseOutput", a:command)
+endf
+
+" :def: function! tlib#cmd#BrowseOutputWithCallback(callback, command)
+" Execute COMMAND and present its output in a |tlib#input#List()|;
+" when a line is selected, execute the function named as the CALLBACK
+" and pass in that line as an argument.
+"
+" The CALLBACK function gives you an opportunity to massage the COMMAND output
+" and possibly act on it in a meaningful way. For example, if COMMAND listed
+" all URIs found in the current buffer, CALLBACK could validate and then open
+" the selected URI in the system's default browser.
+"
+" This function is meant to be a tool to help compose the implementations of
+" powerful commands that use |tlib#input#List()| as a common interface. See
+" |TBrowseScriptnames| as an example.
+"
+" EXAMPLES: >
+" call tlib#cmd#BrowseOutputWithCallback('tlib#cmd#ParseScriptname', 'scriptnames')
+function! tlib#cmd#BrowseOutputWithCallback(callback, command) "{{{3
+ let list = tlib#cmd#OutputAsList(a:command)
+ let cmds = tlib#input#List('m', 'Output of: '. a:command, list)
+ if !empty(cmds)
+ for cmd in cmds
+ let Callback = function(a:callback)
+ call call(Callback, [cmd])
+ endfor
+ endif
+endf
+
+function! tlib#cmd#DefaultBrowseOutput(cmd) "{{{3
+ call feedkeys(':'. a:cmd)
+endf
+
+function! tlib#cmd#ParseScriptname(line) "{{{3
+ " let parsedValue = substitute(a:line, '^.\{-}\/', '/', '')
+ let parsedValue = matchstr(a:line, '^\s*\d\+:\s*\zs.*$')
+ exe 'drop '. fnameescape(parsedValue)
+endf
+
+
+function! tlib#cmd#TBrowseScriptnames() abort "{{{3
+ call tlib#cmd#BrowseOutputWithCallback("tlib#cmd#ParseScriptname", "scriptnames")
+endf
+
+
+" :def: function! tlib#cmd#UseVertical(?rx='')
+" Look at the history whether the command was called with vertical. If
+" an rx is provided check first if the last entry in the history matches
+" this rx.
+function! tlib#cmd#UseVertical(...) "{{{3
+ TVarArg ['rx']
+ let h0 = histget(':')
+ let rx0 = '\C\<vert\%[ical]\>\s\+'
+ if !empty(rx)
+ let rx0 .= '.\{-}'.rx
+ endif
+ " TLogVAR h0, rx0
+ return h0 =~ rx0
+endf
+
+
+" Print the time in seconds or milliseconds (if your version of VIM
+" has |+reltime|) a command takes.
+function! tlib#cmd#Time(cmd) "{{{3
+ if has('reltime')
+ let start = tlib#time#Now()
+ exec a:cmd
+ let end = tlib#time#Now()
+ let diff = string(tlib#time#Diff(end, start)) .'ms'
+ else
+ let start = localtime()
+ exec a:cmd
+ let diff = (localtime() - start) .'s'
+ endif
+ echom 'Time: '. diff .': '. a:cmd
+endf
+
+
+function! tlib#cmd#Capture(cmd) "{{{3
+ redir => s
+ silent exec a:cmd
+ redir END
+ return s
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/comments.vim b/vim/bundle/tlib_vim/autoload/tlib/comments.vim
new file mode 100755
index 0000000..879cde1
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/comments.vim
@@ -0,0 +1,26 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 25
+
+
+" function! tlib#comments#Comments(?rx='')
+function! tlib#comments#Comments(...)
+ TVarArg ['rx', '']
+ let comments = {}
+ let co = &comments
+ while !empty(co)
+ " TLogVAR co
+ let [m_0, m_key, m_val, m_val1, co0, co; rest] = matchlist(co, '^\([^:]*\):\(\(\\.\|[^,]*\)\+\)\(,\(.*\)$\|$\)')
+ " TLogVAR m_key, m_val, co
+ if empty(m_key)
+ let m_key = ':'
+ endif
+ if empty(rx) || m_key =~ rx
+ let comments[m_key] = m_val
+ endif
+ endwh
+ return comments
+endf
+
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/date.vim b/vim/bundle/tlib_vim/autoload/tlib/date.vim
new file mode 100755
index 0000000..8268424
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/date.vim
@@ -0,0 +1,189 @@
+" date.vim
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2010-03-25.
+" @Last Change: 2016-06-06.
+" @Revision: 41.0.34
+
+
+if !exists('g:tlib#date#ShortDatePrefix') | let g:tlib#date#ShortDatePrefix = '20' | endif "{{{2
+if !exists('g:tlib#date#TimeZoneShift') | let g:tlib#date#TimeZoneShift = 0 | endif "{{{2
+
+let g:tlib#date#dayshift = 60 * 60 * 24
+" let g:tlib#date#date_rx = '\<\(\d\{4}\)-\(\d\d\)-\(\d\d\)\%(\s\+\(\(\d\d\):\(\d\d\)\)\)\?\>'
+let g:tlib#date#date_rx = '\<\(\d\{4}\)-\(\d\d\)-\(\d\d\)\>'
+let g:tlib#date#date_format = '%Y-%m-%d'
+
+
+function! tlib#date#IsDate(text) abort "{{{3
+ return a:text =~# '^'. g:tlib#date#date_rx .'$' &&
+ \ !empty(tlib#date#Parse(a:text, 0, 1))
+endf
+
+
+function! tlib#date#Format(...) abort "{{{3
+ let secs1970 = a:0 >= 1 ? a:1 : localtime()
+ return strftime(g:tlib#date#date_format, secs1970)
+endf
+
+
+" :display: tlib#date#DiffInDays(date1, ?date2=localtime(), ?allow_zero=0)
+function! tlib#date#DiffInDays(date, ...)
+ let allow_zero = a:0 >= 2 ? a:2 : 0
+ let s0 = tlib#date#SecondsSince1970(a:date, 0, allow_zero)
+ let s1 = a:0 >= 1 ? tlib#date#SecondsSince1970(a:1, 0, allow_zero) : localtime()
+ let dd = (s0 - s1) / g:tlib#date#dayshift
+ " TLogVAR dd
+ return dd
+endf
+
+
+" :display: tlib#date#Parse(date, ?allow_zero=0, ?silent=0) "{{{3
+function! tlib#date#Parse(date, ...) "{{{3
+ let min = a:0 >= 1 && a:1 ? 0 : 1
+ let silent = a:0 >= 2 ? a:2 : 0
+ " TLogVAR a:date, min
+ let m = matchlist(a:date, '^\(\d\{2}\|\d\{4}\)-\(\d\{1,2}\)-\(\d\{1,2}\)$')
+ if !empty(m)
+ let year = m[1]
+ let month = m[2]
+ let days = m[3]
+ else
+ let m = matchlist(a:date, '^\(\d\+\)/\(\d\{1,2}\)/\(\d\{1,2}\)$')
+ if !empty(m)
+ let year = m[1]
+ let month = m[3]
+ let days = m[2]
+ else
+ let m = matchlist(a:date, '^\(\d\{1,2}\)\.\s*\(\d\{1,2}\)\.\s*\(\d\d\{2}\|\d\{4}\)$')
+ if !empty(m)
+ let year = m[3]
+ let month = m[2]
+ let days = m[1]
+ endif
+ endif
+ endif
+ if empty(m) || year == '' || month == '' || days == '' ||
+ \ month < min || month > 12 || days < min || days > 31
+ if !silent
+ echoerr 'TLib: Invalid date: '. a:date
+ endif
+ return []
+ endif
+ if strlen(year) == 2
+ let year = g:tlib#date#ShortDatePrefix . year
+ endif
+ return [0 + year, 0 + month, 0 + days]
+endf
+
+
+" tlib#date#SecondsSince1970(date, ?daysshift=0, ?allow_zero=0)
+function! tlib#date#SecondsSince1970(date, ...) "{{{3
+ let allow_zero = a:0 >= 2 ? a:2 : 0
+ " TLogVAR a:date, allow_zero
+ let date = tlib#date#Parse(a:date, allow_zero)
+ if empty(date)
+ return 0
+ endif
+ let [year, month, days] = date
+ if a:0 >= 1 && a:1 > 0
+ let days = days + a:1
+ end
+ let days_passed = days
+ let i = 1970
+ while i < year
+ let days_passed = days_passed + 365
+ if i % 4 == 0 || i == 2000
+ let days_passed = days_passed + 1
+ endif
+ let i = i + 1
+ endwh
+ let i = 1
+ while i < month
+ if i == 1
+ let days_passed = days_passed + 31
+ elseif i == 2
+ let days_passed = days_passed + 28
+ if year % 4 == 0 || year == 2000
+ let days_passed = days_passed + 1
+ endif
+ elseif i == 3
+ let days_passed = days_passed + 31
+ elseif i == 4
+ let days_passed = days_passed + 30
+ elseif i == 5
+ let days_passed = days_passed + 31
+ elseif i == 6
+ let days_passed = days_passed + 30
+ elseif i == 7
+ let days_passed = days_passed + 31
+ elseif i == 8
+ let days_passed = days_passed + 31
+ elseif i == 9
+ let days_passed = days_passed + 30
+ elseif i == 10
+ let days_passed = days_passed + 31
+ elseif i == 11
+ let days_passed = days_passed + 30
+ endif
+ let i = i + 1
+ endwh
+ let seconds = (days_passed - 1) * 24 * 60 * 60
+ let seconds = seconds + (strftime('%H') + g:tlib#date#TimeZoneShift) * 60 * 60
+ let seconds = seconds + strftime('%M') * 60
+ let seconds = seconds + strftime('%S')
+ return seconds
+endf
+
+
+function! tlib#date#Shift(date, shift) abort "{{{3
+ let n = str2nr(matchstr(a:shift, '\d\+'))
+ let ml = matchlist(a:date, g:tlib#date#date_rx)
+ " TLogVAR a:date, a:shift, n, ml
+ if a:shift =~ 'd$'
+ let date = tlib#date#AddDays(a:date, n)
+ elseif a:shift =~ 'b$'
+ let n1 = n
+ let secs = tlib#date#SecondsSince1970(a:date)
+ while n1 > 0
+ let n1 -= 1
+ let secs += g:tlib#date#dayshift
+ let uday = strftime('%u', secs)
+ if uday == 6
+ let secs += g:tlib#date#dayshift * 2
+ elseif uday == 7
+ let secs += g:tlib#date#dayshift
+ endif
+ endwh
+ let date = tlib#date#Format(secs)
+ elseif a:shift =~ 'w$'
+ let date = tlib#date#AddDays(a:date, n * 7)
+ elseif a:shift =~ 'm$'
+ let d = str2nr(ml[3])
+ let ms = str2nr(ml[2]) + n
+ let m = (ms - 1) % 12 + 1
+ let yr = str2nr(ml[1]) + (ms - 1) / 12
+ let date = printf('%04d-%02d-%02d', yr, m, d)
+ " TLogVAR d, ms, m, yr, date
+ elseif a:shift =~ 'y$'
+ let yr = str2nr(ml[1]) + n
+ let date = substitute(a:date, '^\d\{4}', yr, '')
+ else
+ throw 'tlib#date#Shift: Unsupported arguments: '. string(a:shift)
+ endif
+ " if !empty(ml[4]) && date !~ '\s'. ml[4] .'$'
+ " let date .= ' '. ml[4]
+ " endif
+ " TLogVAR date
+ return date
+endf
+
+
+function! tlib#date#AddDays(date, n) abort "{{{3
+ let secs = tlib#date#SecondsSince1970(a:date) + g:tlib#date#dayshift * a:n
+ " TLogVAR secs
+ let date = tlib#date#Format(secs)
+ return date
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/dictionary.vim b/vim/bundle/tlib_vim/autoload/tlib/dictionary.vim
new file mode 100644
index 0000000..a778519
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/dictionary.vim
@@ -0,0 +1,45 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: https://github.com/tomtom
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2016-04-06
+" @Revision: 22
+
+
+" :display: tlib#dictionary#Rev(dict, ?opts = {}) abort "{{{3
+function! tlib#dictionary#Rev(dict, ...) abort "{{{3
+ let opts = a:0 >= 1 ? a:1 : {}
+ Tlibtype a:dict, 'dict', opts, 'dict'
+ let rev = {}
+ let use_string = get(opts, 'use_string', 0)
+ let use_eval = get(opts, 'use_eval', 0)
+ let values_as_list = get(opts, 'values_as_list', 0)
+ for [m, f] in items(a:dict)
+ if use_string
+ let k = string(f)
+ else
+ let k = type(f) == 1 ? f : string(f)
+ if k ==# ''
+ let k = get(opts, 'empty', '')
+ if empty(k)
+ continue
+ endif
+ endif
+ endif
+ if use_eval
+ let v = eval(m)
+ else
+ let v = m
+ endif
+ if values_as_list
+ if has_key(rev, k)
+ call add(rev[k], v)
+ else
+ let rev[k] = [v]
+ endif
+ else
+ let rev[k] = v
+ endif
+ endfor
+ return rev
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/dir.vim b/vim/bundle/tlib_vim/autoload/tlib/dir.vim
new file mode 100755
index 0000000..0208107
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/dir.vim
@@ -0,0 +1,93 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 43
+
+" TLet g:tlib#dir#sep = '/'
+TLet g:tlib#dir#sep = exists('+shellslash') && !&shellslash ? '\' : '/'
+
+
+let s:dir_stack = []
+
+" EXAMPLES: >
+" tlib#dir#CanonicName('foo/bar')
+" => 'foo/bar/'
+function! tlib#dir#CanonicName(dirname) "{{{3
+ let dirname = tlib#file#Canonic(a:dirname)
+ if dirname !~ '[/\\]$'
+ return dirname . g:tlib#dir#sep
+ endif
+ return dirname
+endf
+
+
+" EXAMPLES: >
+" tlib#dir#NativeName('foo/bar/')
+" On Windows:
+" => 'foo\bar\'
+" On Linux:
+" => 'foo/bar/'
+function! tlib#dir#NativeName(dirname) "{{{3
+ let sep = tlib#rx#EscapeReplace(g:tlib#dir#sep)
+ let dirname = substitute(a:dirname, '[\/]', sep, 'g')
+ return dirname
+endf
+
+
+" EXAMPLES: >
+" tlib#dir#PlainName('foo/bar/')
+" => 'foo/bar'
+function! tlib#dir#PlainName(dirname) "{{{3
+ let dirname = a:dirname
+ while index(['/', '\'], dirname[-1 : -1]) != -1
+ let dirname = dirname[0 : -2]
+ endwh
+ return dirname
+ " return substitute(a:dirname, tlib#rx#Escape(g:tlib#dir#sep).'\+$', '', '')
+endf
+
+
+" Create a directory if it doesn't already exist.
+function! tlib#dir#Ensure(dir) "{{{3
+ if !isdirectory(a:dir)
+ let dir = tlib#dir#PlainName(a:dir)
+ return mkdir(dir, 'p')
+ endif
+ return 1
+endf
+
+
+" Return the first directory in &rtp.
+function! tlib#dir#MyRuntime() "{{{3
+ return get(split(&rtp, ','), 0)
+endf
+
+
+" :def: function! tlib#dir#CD(dir, ?locally=0) => CWD
+function! tlib#dir#CD(dir, ...) "{{{3
+ TVarArg ['locally', haslocaldir()]
+ let cmd = locally ? 'lcd! ' : 'cd! '
+ " let cwd = getcwd()
+ let cmd .= tlib#arg#Ex(a:dir)
+ " TLogVAR a:dir, locally, cmd
+ exec 'silent' cmd
+ " return cwd
+ return getcwd()
+endf
+
+
+" :def: function! tlib#dir#Push(dir, ?locally=0) => CWD
+function! tlib#dir#Push(dir, ...) "{{{3
+ TVarArg ['locally', haslocaldir()]
+ call add(s:dir_stack, [getcwd(), locally])
+ return tlib#dir#CD(a:dir, locally)
+endf
+
+
+" :def: function! tlib#dir#Pop() => CWD
+function! tlib#dir#Pop() "{{{3
+ let [dir, locally] = remove(s:dir_stack, -1)
+ return tlib#dir#CD(dir, locally)
+endf
+
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/eval.vim b/vim/bundle/tlib_vim/autoload/tlib/eval.vim
new file mode 100755
index 0000000..117209e
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/eval.vim
@@ -0,0 +1,72 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 56
+
+
+function! tlib#eval#FormatValue(value, ...) "{{{3
+ TVarArg ['indent', 0]
+ " TLogVAR a:value, indent
+ let indent1 = indent + 1
+ let indenti = repeat(' ', &sw)
+ let type = type(a:value)
+ let acc = []
+ if type == 0 || type == 1 || type == 2
+ " TLogDBG 'Use string() for type='. type
+ call add(acc, string(a:value))
+ elseif type == 3 "List
+ " TLogDBG 'List'
+ call add(acc, '[')
+ for e in a:value
+ call add(acc, printf('%s%s,', indenti, tlib#eval#FormatValue(e, indent1)))
+ unlet e
+ endfor
+ call add(acc, ']')
+ elseif type == 4 "Dictionary
+ " TLogDBG 'Dictionary'
+ call add(acc, '{')
+ let indent1 = indent + 1
+ for [k, v] in items(a:value)
+ call add(acc, printf("%s%s: %s,", indenti, string(k), tlib#eval#FormatValue(v, indent1)))
+ unlet k v
+ endfor
+ call add(acc, '}')
+ else
+ " TLogDBG 'Unknown type: '. string(a:value)
+ call add(acc, string(a:value))
+ endif
+ if indent > 0
+ let is = repeat(' ', indent * &sw)
+ for i in range(1,len(acc) - 1)
+ let acc[i] = is . acc[i]
+ endfor
+ endif
+ return join(acc, "\n")
+endf
+
+
+function! tlib#eval#Extend(a, b, ...) abort "{{{3
+ let mode = a:0 >= 1 ? a:1 : 'force'
+ if type(a:a) != type(a:b)
+ throw 'tlib#eval#Extend: Incompatible types: a='. string(a:a) .' b='. string(a:b)
+ elseif type(a:a) == 3 " list
+ return extend(a:a, a:b, mode)
+ elseif type(a:a) == 4 " dict
+ for k in keys(a:b)
+ if has_key(a:a, k)
+ if mode == 'force'
+ let a:a[k] = tlib#eval#Extend(copy(a:a[k]), a:b[k], mode)
+ elseif mode == 'error'
+ throw 'tlib#eval#Extend: Key already exists: '. k
+ endif
+ else
+ let a:a[k] = a:b[k]
+ endif
+ unlet! k
+ endfor
+ return a:a
+ else
+ return a:b
+ endif
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/file.vim b/vim/bundle/tlib_vim/autoload/tlib/file.vim
new file mode 100644
index 0000000..44ba044
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/file.vim
@@ -0,0 +1,283 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 169
+
+
+if !exists('g:tlib#file#drop')
+ " If true, use |:drop| to edit loaded buffers (only available with GUI).
+ let g:tlib#file#drop = has('gui') "{{{2
+endif
+
+
+if !exists('g:tlib#file#use_tabs')
+ let g:tlib#file#use_tabs = 0 "{{{2
+endif
+
+
+if !exists('g:tlib#file#edit_cmds')
+ let g:tlib#file#edit_cmds = g:tlib#file#use_tabs ? {'buffer': 'tab split | buffer', 'edit': 'tabedit'} : {} "{{{2
+endif
+
+
+if !exists('g:tlib#file#absolute_filename_rx')
+ let g:tlib#file#absolute_filename_rx = '^\~\?[\/]' "{{{2
+endif
+
+""" File related {{{1
+" For the following functions please see ../../test/tlib.vim for examples.
+
+
+" EXAMPLES: >
+" tlib#file#Split('foo/bar/filename.txt')
+" => ['foo', 'bar', 'filename.txt']
+function! tlib#file#Split(filename) "{{{3
+ let prefix = matchstr(a:filename, '^\(\w\+:\)\?/\+')
+ " TLogVAR prefix
+ if !empty(prefix)
+ let filename = a:filename[len(prefix) : -1]
+ else
+ let filename = a:filename
+ endif
+ let rv = split(filename, '[\/]')
+ " let rv = split(filename, '[\/]', 1)
+ if !empty(prefix)
+ call insert(rv, prefix[0:-2])
+ endif
+ return rv
+endf
+
+
+" :display: tlib#file#Join(filename_parts, ?strip_slashes=1, ?maybe_absolute=0)
+" EXAMPLES: >
+" tlib#file#Join(['foo', 'bar', 'filename.txt'])
+" => 'foo/bar/filename.txt'
+function! tlib#file#Join(filename_parts, ...) "{{{3
+ TVarArg ['strip_slashes', 1], 'maybe_absolute'
+ " TLogVAR a:filename_parts, strip_slashes
+ if maybe_absolute
+ let filename_parts = []
+ for part in a:filename_parts
+ if part =~ g:tlib#file#absolute_filename_rx
+ let filename_parts = []
+ endif
+ call add(filename_parts, part)
+ endfor
+ else
+ let filename_parts = a:filename_parts
+ endif
+ if strip_slashes
+ " let rx = tlib#rx#Escape(g:tlib#dir#sep) .'$'
+ let rx = '[/\\]\+$'
+ let parts = map(copy(filename_parts), 'substitute(v:val, rx, "", "")')
+ " TLogVAR parts
+ return join(parts, g:tlib#dir#sep)
+ else
+ return join(filename_parts, g:tlib#dir#sep)
+ endif
+endf
+
+
+" EXAMPLES: >
+" tlib#file#Relative('foo/bar/filename.txt', 'foo')
+" => 'bar/filename.txt'
+function! tlib#file#Relative(filename, basedir) "{{{3
+ " TLogVAR a:filename, a:basedir
+ " TLogDBG getcwd()
+ " TLogDBG expand('%:p')
+ let b0 = tlib#file#Absolute(a:basedir)
+ let b = tlib#file#Split(b0)
+ " TLogVAR b
+ let f0 = tlib#file#Absolute(a:filename)
+ let fn = fnamemodify(f0, ':t')
+ let fd = fnamemodify(f0, ':h')
+ let f = tlib#file#Split(fd)
+ " TLogVAR f0, fn, fd, f
+ if f[0] != b[0]
+ let rv = f0
+ else
+ while !empty(f) && !empty(b)
+ if f[0] != b[0]
+ break
+ endif
+ call remove(f, 0)
+ call remove(b, 0)
+ endwh
+ " TLogVAR f, b
+ let rv = tlib#file#Join(repeat(['..'], len(b)) + f + [fn])
+ endif
+ " TLogVAR rv
+ return rv
+endf
+
+
+function! tlib#file#IsAbsolute(filename) "{{{3
+ return a:filename =~? '^\%(/\|\w\+:/\)'
+endf
+
+
+function! tlib#file#Absolute(filename, ...) "{{{3
+ if filereadable(a:filename)
+ let filename = fnamemodify(a:filename, ':p')
+ elseif a:filename =~ '^\(/\|[^\/]\+:\)'
+ let filename = a:filename
+ else
+ let cwd = a:0 >= 1 ? a:1 : getcwd()
+ let filename = tlib#file#Join([cwd, a:filename])
+ endif
+ let filename = substitute(filename, '\(^\|[\/]\)\zs\.[\/]', '', 'g')
+ let filename = substitute(filename, '[\/]\zs[^\/]\+[\/]\.\.[\/]', '', 'g')
+ return filename
+endf
+
+
+function! tlib#file#Canonic(filename, ...) "{{{3
+ TVarArg ['mode', '']
+ if a:filename =~ '^\\\\'
+ let mode = 'windows'
+ elseif a:filename =~ '^\(file\|ftp\|http\)s\?:'
+ let mode = 'url'
+ elseif (empty(mode) && g:tlib#sys#windows)
+ let mode = 'windows'
+ endif
+ let filename = a:filename
+ if mode == 'windows'
+ let filename = substitute(filename, '/', '\\', 'g')
+ else
+ let filename = substitute(filename, '\\', '/', 'g')
+ endif
+ return filename
+endf
+
+
+function! s:SetScrollBind(world) "{{{3
+ let sb = get(a:world, 'scrollbind', &scrollbind)
+ if sb != &scrollbind
+ let &scrollbind = sb
+ endif
+endf
+
+
+" :def: function! tlib#file#With(fcmd, bcmd, files, ?world={})
+function! tlib#file#With(fcmd, bcmd, files, ...) "{{{3
+ " TLogVAR a:fcmd, a:bcmd, a:files
+ exec tlib#arg#Let([['world', {}]])
+ call tlib#autocmdgroup#Init()
+ augroup TLibFileRead
+ autocmd!
+ augroup END
+ for f in a:files
+ let bn = bufnr('^'.f.'$')
+ " TLogVAR f, bn
+ let bufloaded = bufloaded(bn)
+ let ok = 0
+ let s:bufread = ""
+ if bn != -1 && buflisted(bn)
+ if !empty(a:bcmd)
+ " TLogDBG a:bcmd .' '. bn
+ exec a:bcmd .' '. bn
+ let ok = 1
+ call s:SetScrollBind(world)
+ endif
+ else
+ if filereadable(f)
+ if !empty(a:fcmd)
+ " TLogDBG a:fcmd .' '. tlib#arg#Ex(f)
+ exec 'autocmd TLibFileRead BufRead' escape(f, '\ ') 'let s:bufread=expand("<afile>:p")'
+ try
+ exec a:fcmd .' '. tlib#arg#Ex(f)
+ finally
+ exec 'autocmd! TLibFileRead BufRead'
+ endtry
+ let ok = 1
+ call s:SetScrollBind(world)
+ endif
+ else
+ echohl error
+ echom 'File not readable: '. f
+ echohl NONE
+ endif
+ endif
+ " TLogVAR ok, bufloaded, &filetype
+ if empty(s:bufread) && ok && !bufloaded && empty(&filetype)
+ doautocmd BufRead
+ endif
+ endfor
+ augroup! TLibFileRead
+ unlet! s:bufread
+ " TLogDBG "done"
+endf
+
+
+" Return 0 if the file isn't readable/doesn't exist.
+" Otherwise return 1.
+function! tlib#file#Edit(fileid) "{{{3
+ if type(a:fileid) == 0
+ let bn = a:fileid
+ let filename = fnamemodify(bufname(bn), ':p')
+ else
+ let filename = fnamemodify(a:fileid, ':p')
+ let bn = bufnr(filename)
+ endif
+ if filename == expand('%:p')
+ return 1
+ else
+ " TLogVAR a:fileid, bn, filename, g:tlib#file#drop, filereadable(filename)
+ if bn != -1 && buflisted(bn)
+ if g:tlib#file#drop
+ " echom "DBG" get(g:tlib#file#edit_cmds, 'drop', 'drop') fnameescape(filename)
+ exec get(g:tlib#file#edit_cmds, 'drop', 'drop') fnameescape(filename)
+ else
+ " echom "DBG" get(g:tlib#file#edit_cmds, 'buffer', 'buffer') bn
+ exec get(g:tlib#file#edit_cmds, 'buffer', 'buffer') bn
+ endif
+ return 1
+ elseif filereadable(filename)
+ try
+ " let file = tlib#arg#Ex(filename)
+ " " TLogVAR file
+ " echom "DBG" get(g:tlib#file#edit_cmds, 'edit', 'edit') fnameescape(filename)
+ exec get(g:tlib#file#edit_cmds, 'edit', 'edit') fnameescape(filename)
+ catch /E325/
+ " swap file exists, let the user handle it
+ catch
+ echohl error
+ echom v:exception
+ echohl NONE
+ endtry
+ return 1
+ else
+ echom "TLIB: File not readable: " . filename
+ if filename != a:fileid
+ echom "TLIB: original filename: " . a:fileid
+ endif
+ endif
+ endif
+ return 0
+endf
+
+
+if v:version > 704 || (v:version == 704 && has('patch279'))
+
+ function! tlib#file#Glob(pattern) abort "{{{3
+ return glob(a:pattern, 0, 1)
+ endf
+
+ function! tlib#file#Globpath(path, pattern) abort "{{{3
+ return globpath(a:path, a:pattern, 0, 1)
+ endf
+
+else
+
+ " :nodoc:
+ function! tlib#file#Glob(pattern) abort "{{{3
+ return split(glob(a:pattern), '\n')
+ endf
+
+ " :nodoc:
+ function! tlib#file#Globpath(path, pattern) abort "{{{3
+ return split(globpath(a:path, a:pattern), '\n')
+ endf
+
+endif
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/fixes.vim b/vim/bundle/tlib_vim/autoload/tlib/fixes.vim
new file mode 100644
index 0000000..e9247dd
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/fixes.vim
@@ -0,0 +1,14 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2013-02-22.
+" @Revision: 3
+
+
+function! tlib#fixes#Winpos() "{{{3
+ if has('gui_win32')
+ return 'winpos '. getwinposx() .' '. getwinposy()
+ else
+ return ''
+ endif
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/grep.vim b/vim/bundle/tlib_vim/autoload/tlib/grep.vim
new file mode 100644
index 0000000..894b1ee
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/grep.vim
@@ -0,0 +1,38 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2013-10-16.
+" @Revision: 31
+
+
+function! tlib#grep#Do(cmd, rx, files) "{{{3
+ " TLogVAR a:cmd, a:rx, a:files
+ let files = join(map(copy(a:files), 'tlib#arg#Ex(v:val, "")'), ' ')
+ let rx = '/'. escape(a:rx, '/') .'/j'
+ " TLogVAR rx, files
+ silent exec a:cmd rx files
+endf
+
+
+function! tlib#grep#LocList(rx, files) "{{{3
+ return tlib#grep#Do('noautocmd lvimgrep', a:rx, a:files)
+endf
+
+
+function! tlib#grep#QuickFixList(rx, files) "{{{3
+ return tlib#grep#Do('noautocmd vimgrep', a:rx, a:files)
+endf
+
+
+function! tlib#grep#List(rx, files) "{{{3
+ call setqflist([])
+ call tlib#grep#Do('noautocmd vimgrepadd', a:rx, a:files)
+ let qfl = getqflist()
+ " TLogVAR qfl
+ " try
+ silent! colder
+ " catch
+ " call setqflist([], 'r')
+ " endtry
+ return qfl
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/hash.vim b/vim/bundle/tlib_vim/autoload/tlib/hash.vim
new file mode 100644
index 0000000..29c9ef6
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/hash.vim
@@ -0,0 +1,145 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 276
+
+
+if !exists('g:tlib#hash#use_crc32')
+ let g:tlib#hash#use_crc32 = '' "{{{2
+endif
+
+
+if !exists('g:tlib#hash#use_adler32')
+ let g:tlib#hash#use_adler32 = '' "{{{2
+endif
+
+
+function! tlib#hash#CRC32B(chars) "{{{3
+ if !empty(g:tlib#hash#use_crc32)
+ let use = g:tlib#hash#use_crc32
+ elseif has('ruby')
+ let use = 'ruby'
+ else
+ let use = 'vim'
+ endif
+ if exists('*tlib#hash#CRC32B_'. use)
+ return tlib#hash#CRC32B_{use}(a:chars)
+ else
+ throw "Unknown version of tlib#hash#CRC32B: ". use
+ endif
+endf
+
+
+function! tlib#hash#CRC32B_ruby(chars) "{{{3
+ if has('ruby')
+ let rv = ''
+ if !exists('s:loaded_ruby_zlib')
+ ruby require 'zlib'
+ let s:loaded_ruby_zlib = 1
+ endif
+ ruby VIM::command('let rv = "%08X"' % Zlib.crc32(VIM::evaluate("a:chars")))
+ return rv
+ else
+ throw "tlib#hash#CRC32B_ruby not supported in this version of vim"
+ endif
+endf
+
+
+function! tlib#hash#CRC32B_vim(chars) "{{{3
+ if !exists('s:crc_table')
+ let cfile = tlib#persistent#Filename('tlib', 'crc_table', 1)
+ let s:crc_table = tlib#persistent#Value(cfile, 'tlib#hash#CreateCrcTable', 0)
+ endif
+ let xFFFF_FFFF = repeat([1], 32)
+ let crc = tlib#bitwise#XOR([0], xFFFF_FFFF, 'bits')
+ for char in split(a:chars, '\zs')
+ let octet = char2nr(char)
+ let r1 = tlib#bitwise#ShiftRight(crc, 8)
+ let i0 = tlib#bitwise#AND(crc, xFFFF_FFFF, 'bits')
+ let i1 = tlib#bitwise#XOR(i0, octet, 'bits')
+ let i2 = tlib#bitwise#Bits2Num(tlib#bitwise#AND(i1, 0xff, 'bits'))
+ let r2 = s:crc_table[i2]
+ let crc = tlib#bitwise#XOR(r1, r2, 'bits')
+ endfor
+ let crc = tlib#bitwise#XOR(crc, xFFFF_FFFF, 'bits')
+ let rv = tlib#bitwise#Bits2Num(crc, 16)
+ if len(rv) < 8
+ let rv = repeat('0', 8 - len(rv)) . rv
+ endif
+ return rv
+endf
+
+
+" :nodoc:
+function! tlib#hash#CreateCrcTable() "{{{3
+ let sum = 0.0
+ for exponent in [0, 1, 2, 4, 5, 7, 8, 10, 11, 12, 16, 22, 23, 26, 32]
+ let exp = tlib#bitwise#Bits2Num(repeat([0], 32 - exponent) + [1], 10.0)
+ let sum += exp
+ endfor
+ let divisor = tlib#bitwise#Num2Bits(sum)
+ let crc_table = []
+ for octet in range(256)
+ let remainder = tlib#bitwise#Num2Bits(octet)
+ for i in range(8)
+ if get(remainder, i) != 0
+ let remainder = tlib#bitwise#XOR(remainder, tlib#bitwise#ShiftLeft(divisor, i), "bits")
+ endif
+ endfor
+ let remainder = tlib#bitwise#ShiftRight(remainder, 8)
+ call add(crc_table, remainder)
+ endfor
+ return crc_table
+endf
+
+
+function! tlib#hash#Adler32(chars) "{{{3
+ if !empty(g:tlib#hash#use_adler32)
+ let use = g:tlib#hash#use_adler32
+ elseif exists('*or')
+ let use = 'vim'
+ else
+ let use = 'tlib'
+ endif
+ if exists('*tlib#hash#Adler32_'. use)
+ return tlib#hash#Adler32_{use}(a:chars)
+ else
+ throw "Unknown version of tlib#hash#Adler32_: ". use
+ endif
+endf
+
+
+function! tlib#hash#Adler32_vim(chars) "{{{3
+ if exists('*or')
+ let mod_adler = 65521
+ let a = 1
+ let b = 0
+ for index in range(len(a:chars))
+ let c = char2nr(a:chars[index])
+ let a = (a + c) % mod_adler
+ let b = (b + a) % mod_adler
+ endfor
+ let bb = b * float2nr(pow(2, 16))
+ let checksum = or(bb, a)
+ " TLogVAR checksum, a, b, bb
+ return printf("%08X", checksum)
+ else
+ throw "TLIB: Vim version doesn't support bitwise or()"
+ endif
+endf
+
+
+function! tlib#hash#Adler32_tlib(chars) "{{{3
+ let mod_adler = 65521
+ let a = 1
+ let b = 0
+ for index in range(len(a:chars))
+ let c = char2nr(a:chars[index])
+ let a = (a + c) % mod_adler
+ let b = (b + a) % mod_adler
+ endfor
+ let bb = tlib#bitwise#ShiftLeft(tlib#bitwise#Num2Bits(b), 16)
+ let checksum = tlib#bitwise#OR(bb, a, "bits")
+ return printf('%08s', tlib#bitwise#Bits2Num(checksum, 16))
+endf
+
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/hook.vim b/vim/bundle/tlib_vim/autoload/tlib/hook.vim
new file mode 100755
index 0000000..07d0504
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/hook.vim
@@ -0,0 +1,25 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 11
+
+
+" :def: function! tlib#hook#Run(hook, ?dict={})
+" Execute dict[hook], w:{hook}, b:{hook}, or g:{hook} if existent.
+function! tlib#hook#Run(hook, ...) "{{{3
+ TVarArg ['dict', {}]
+ if has_key(dict, a:hook)
+ let hook = dict[a:hook]
+ else
+ let hook = tlib#var#Get(a:hook, 'wbg')
+ endif
+ if empty(hook)
+ return 0
+ else
+ let world = dict
+ exec hook
+ return 1
+ endif
+endf
+
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/input.vim b/vim/bundle/tlib_vim/autoload/tlib/input.vim
new file mode 100644
index 0000000..e8f892b
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/input.vim
@@ -0,0 +1,1336 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 1366
+
+
+" :filedoc:
+" Input-related, select from a list etc.
+
+" If a list is bigger than this value, don't try to be smart when
+" selecting an item. Be slightly faster instead.
+" See |tlib#input#List()|.
+TLet g:tlib#input#sortprefs_threshold = 200
+
+
+" If a list contains more items, |tlib#input#List()| does not perform an
+" incremental "live search" but uses |input()| to query the user for a
+" filter. This is useful on slower machines or with very long lists.
+TLet g:tlib#input#livesearch_threshold = 1000
+
+
+" Determine how |tlib#input#List()| and related functions work.
+" Can be "glob", "cnf", "cnfd", "seq", or "fuzzy". See:
+" glob ... Like cnf but "*" and "?" (see |g:tlib#Filter_glob#seq|,
+" |g:tlib#Filter_glob#char|) are interpreted as glob-like
+" |wildcards| (this is the default method)
+" - Examples:
+" - "f*o" matches "fo", "fxo", and "fxxxoo", but doesn't match
+" "far".
+" - Otherwise it is a derivate of the cnf method (see below).
+" - See also |tlib#Filter_glob#New()|.
+" cnfd ... Like cnf but "." is interpreted as a wildcard, i.e. it is
+" expanded to "\.\{-}"
+" - A period character (".") acts as a wildcard as if ".\{-}" (see
+" |/\{-|) were entered.
+" - Examples:
+" - "f.o" matches "fo", "fxo", and "fxxxoo", but doesn't match
+" "far".
+" - Otherwise it is a derivate of the cnf method (see below).
+" - See also |tlib#Filter_cnfd#New()|.
+" cnf .... Match substrings
+" - A blank creates an AND conjunction, i.e. the next pattern has to
+" match too.
+" - A pipe character ("|") creates an OR conjunction, either this or
+" the next next pattern has to match.
+" - Patterns are very 'nomagic' |regexp| with a |\V| prefix.
+" - A pattern starting with "-" makes the filter exclude items
+" matching that pattern.
+" - Examples:
+" - "foo bar" matches items that contain the strings "foo" AND
+" "bar".
+" - "foo|bar boo|far" matches items that contain either ("foo" OR
+" "bar") AND ("boo" OR "far").
+" - See also |tlib#Filter_cnf#New()|.
+" seq .... Match sequences of characters
+" - |tlib#Filter_seq#New()|
+" fuzzy .. Match fuzzy character sequences
+" - |tlib#Filter_fuzzy#New()|
+TLet g:tlib#input#filter_mode = 'glob'
+
+
+" The highlight group to use for showing matches in the input list
+" window.
+" See |tlib#input#List()|.
+TLet g:tlib#input#higroup = 'IncSearch'
+
+" When 1, automatically select the last remaining item only if the list
+" had only one item to begin with.
+" When 2, automatically select a last remaining item after applying
+" any filters.
+" See |tlib#input#List()|.
+TLet g:tlib_pick_last_item = 1
+
+
+" :doc:
+" Keys for |tlib#input#List|~
+
+TLet g:tlib#input#and = ' '
+TLet g:tlib#input#or = '|'
+TLet g:tlib#input#not = '-'
+
+" When editing a list with |tlib#input#List|, typing these numeric chars
+" (as returned by getchar()) will select an item based on its index, not
+" based on its name. I.e. in the default setting, typing a "4" will
+" select the fourth item, not the item called "4".
+" In order to make keys 0-9 filter the items in the list and make
+" <m-[0-9]> select an item by its index, remove the keys 48 to 57 from
+" this dictionary.
+" Format: [KEY] = BASE ... the number is calculated as KEY - BASE.
+" :nodefault:
+TLet g:tlib#input#numeric_chars = {
+ \ 176: 176,
+ \ 177: 176,
+ \ 178: 176,
+ \ 179: 176,
+ \ 180: 176,
+ \ 181: 176,
+ \ 182: 176,
+ \ 183: 176,
+ \ 184: 176,
+ \ 185: 176,
+ \}
+ " \ 48: 48,
+ " \ 49: 48,
+ " \ 50: 48,
+ " \ 51: 48,
+ " \ 52: 48,
+ " \ 53: 48,
+ " \ 54: 48,
+ " \ 55: 48,
+ " \ 56: 48,
+ " \ 57: 48,
+
+
+" :nodefault:
+" The default key bindings for single-item-select list views.
+"
+" This variable is best customized via the variable
+" g:tlib_extend_keyagents_InputList_s. If you want to use <c-j>, <c-k>
+" to move the cursor up and down, add these two lines to your |vimrc|
+" file:
+"
+" let g:tlib_extend_keyagents_InputList_s = {
+" \ 10: 'tlib#agent#Down',
+" \ 11: 'tlib#agent#Up'
+" \ }
+TLet g:tlib#input#keyagents_InputList_s = {
+ \ "\<PageUp>": 'tlib#agent#PageUp',
+ \ "\<PageDown>": 'tlib#agent#PageDown',
+ \ "\<Home>": 'tlib#agent#Home',
+ \ "\<End>": 'tlib#agent#End',
+ \ "\<Up>": 'tlib#agent#Up',
+ \ "\<Down>": 'tlib#agent#Down',
+ \ 9: 'tlib#agent#Complete',
+ \ "\<c-Up>": 'tlib#agent#UpN',
+ \ "\<c-Down>": 'tlib#agent#DownN',
+ \ "\<Left>": 'tlib#agent#ShiftLeft',
+ \ "\<Right>": 'tlib#agent#ShiftRight',
+ \ 18: 'tlib#agent#Reset',
+ \ 242: 'tlib#agent#Reset',
+ \ 17: 'tlib#agent#Input',
+ \ 241: 'tlib#agent#Input',
+ \ 27: 'tlib#agent#Exit',
+ \ 26: 'tlib#agent#Suspend',
+ \ 250: 'tlib#agent#Suspend',
+ \ 15: 'tlib#agent#SuspendToParentWindow',
+ \ "\<F1>": 'tlib#agent#Help',
+ \ "\<F10>": 'tlib#agent#ExecAgentByName',
+ \ "\<S-Esc>": 'tlib#agent#ExecAgentByName',
+ \ "\<bs>": 'tlib#agent#ReduceFilter',
+ \ "\<del>": 'tlib#agent#ReduceFilter',
+ \ "\<c-bs>": 'tlib#agent#PopFilter',
+ \ "\<m-bs>": 'tlib#agent#PopFilter',
+ \ "\<c-del>": 'tlib#agent#PopFilter',
+ \ "\<m-del>": 'tlib#agent#PopFilter',
+ \ "\<s-space>": 'tlib#agent#Wildcard',
+ \ 191: 'tlib#agent#Debug',
+ \ char2nr(g:tlib#input#or): 'tlib#agent#OR',
+ \ char2nr(g:tlib#input#and): 'tlib#agent#AND',
+ \ }
+ " \ 63: 'tlib#agent#Help',
+
+if exists('g:tlib_extend_keyagents_InputList_s')
+ let g:tlib#input#keyagents_InputList_s = extend(g:tlib#input#keyagents_InputList_s, g:tlib_extend_keyagents_InputList_s)
+endif
+
+
+" :nodefault:
+TLet g:tlib#input#keyagents_InputList_m = {
+ \ 35: 'tlib#agent#Select',
+ \ "\<s-up>": 'tlib#agent#SelectUp',
+ \ "\<s-down>": 'tlib#agent#SelectDown',
+ \ 1: 'tlib#agent#SelectAll',
+ \ 225: 'tlib#agent#SelectAll',
+ \ "\<F9>": 'tlib#agent#ToggleRestrictView',
+ \ }
+" "\<c-space>": 'tlib#agent#Select'
+
+if exists('g:tlib_extend_keyagents_InputList_m')
+ let g:tlib#input#keyagents_InputList_m = extend(g:tlib#input#keyagents_InputList_m, g:tlib_extend_keyagents_InputList_m)
+endif
+
+
+
+" :nodefault:
+TLet g:tlib#input#handlers_EditList = [
+ \ {'key': 5, 'agent': 'tlib#agent#EditItem', 'key_name': '<c-e>', 'help': 'Edit item'},
+ \ {'key': 4, 'agent': 'tlib#agent#DeleteItems', 'key_name': '<c-d>', 'help': 'Delete item(s)'},
+ \ {'key': 14, 'agent': 'tlib#agent#NewItem', 'key_name': '<c-n>', 'help': 'New item'},
+ \ {'key': 24, 'agent': 'tlib#agent#Cut', 'key_name': '<c-x>', 'help': 'Cut item(s)'},
+ \ {'key': 3, 'agent': 'tlib#agent#Copy', 'key_name': '<c-c>', 'help': 'Copy item(s)'},
+ \ {'key': 22, 'agent': 'tlib#agent#Paste', 'key_name': '<c-v>', 'help': 'Paste item(s)'},
+ \ {'pick_last_item': 0},
+ \ {'return_agent': 'tlib#agent#EditReturnValue'},
+ \ {'help_extra': [
+ \ 'Submit changes by pressing ENTER or <c-s> or <c-w><cr>',
+ \ 'Cancel editing by pressing <c-w>c'
+ \ ]},
+ \ ]
+
+
+" A dictionary KEY => {'agent': AGENT, 'key_name': KEY_NAME} to
+" customize keyboard shortcuts in the list view.
+TLet g:tlib#input#user_shortcuts = {}
+
+
+" If true, define a popup menu for |tlib#input#List()| and related
+" functions.
+TLet g:tlib#input#use_popup = has('menu') && (has('gui_gtk') || has('gui_gtk2') || has('gui_win32'))
+
+
+" How to format filenames:
+" l ... Show basenames on the left side, separated from the
+" directory names
+" r ... Show basenames on the right side
+TLet g:tlib#input#format_filename = 'l'
+
+
+" If g:tlib#input#format_filename == 'r', how much space should be kept
+" free on the right side.
+TLet g:tlib#input#filename_padding_r = '&co / 10'
+
+
+" If g:tlib#input#format_filename == 'l', an expression that
+" |eval()|uates to the maximum display width of filenames.
+TLet g:tlib#input#filename_max_width = '&co / 2'
+
+
+" Functions related to tlib#input#List(type, ...) "{{{2
+
+" :def: function! tlib#input#List(type. ?query='', ?list=[], ?handlers=[], ?default="", ?timeout=0)
+" Select a single or multiple items from a list. Return either the list
+" of selected elements or its indexes.
+"
+" By default, typing numbers will select an item by its index. See
+" |g:tlib#input#numeric_chars| to find out how to change this.
+"
+" The item is automatically selected if the numbers typed equals the
+" number of digits of the list length. I.e. if a list contains 20 items,
+" typing 1 will first highlight item 1 but it won't select/use it
+" because 1 is an ambiguous input in this context. If you press enter,
+" the first item will be selected. If you press another digit (e.g. 0),
+" item 10 will be selected. Another way to select item 1 would be to
+" type 01. If the list contains only 9 items, typing 1 would select the
+" first item right away.
+"
+" type can be:
+" s ... Return one selected element
+" si ... Return the index of the selected element
+" m ... Return a list of selected elements
+" mi ... Return a list of indexes
+"
+" Several pattern matching styles are supported. See
+" |g:tlib#input#filter_mode|.
+"
+" Users can type <Tab> to complete the current filter with the longest
+" match.
+"
+" EXAMPLES: >
+" echo tlib#input#List('s', 'Select one item', [100,200,300])
+" echo tlib#input#List('si', 'Select one item', [100,200,300])
+" echo tlib#input#List('m', 'Select one or more item(s)', [100,200,300])
+" echo tlib#input#List('mi', 'Select one or more item(s)', [100,200,300])
+"
+" See ../samples/tlib/input/tlib_input_list.vim (move the cursor over
+" the filename and press gf) for a more elaborated example.
+function! tlib#input#List(type, ...) "{{{3
+ exec tlib#arg#Let([
+ \ ['query', ''],
+ \ ['list', []],
+ \ ['handlers', []],
+ \ ['rv', ''],
+ \ ['timeout', 0],
+ \ ])
+ " let handlers = a:0 >= 1 ? a:1 : []
+ " let rv = a:0 >= 2 ? a:2 : ''
+ " let timeout = a:0 >= 3 ? a:3 : 0
+ " let backchar = ["\<bs>", "\<del>"]
+
+ if a:type =~ '^resume'
+ let world = b:tlib_{matchstr(a:type, ' \zs.\+')}
+ else
+ let world = tlib#World#New({
+ \ 'type': a:type,
+ \ 'base': list,
+ \ 'query': query,
+ \ 'timeout': timeout,
+ \ 'rv': rv,
+ \ 'handlers': handlers,
+ \ })
+ let scratch_name = tlib#list#Find(handlers, 'has_key(v:val, "scratch_name")', '', 'v:val.scratch_name')
+ if !empty(scratch_name)
+ let world.scratch = scratch_name
+ endif
+ let world.scratch_vertical = tlib#list#Find(handlers, 'has_key(v:val, "scratch_vertical")', 0, 'v:val.scratch_vertical')
+ call world.Set_display_format(tlib#list#Find(handlers, 'has_key(v:val, "display_format")', '', 'v:val.display_format'))
+ let world.initial_index = tlib#list#Find(handlers, 'has_key(v:val, "initial_index")', 1, 'v:val.initial_index')
+ let world.index_table = tlib#list#Find(handlers, 'has_key(v:val, "index_table")', [], 'v:val.index_table')
+ let world.state_handlers = filter(copy(handlers), 'has_key(v:val, "state")')
+ let world.post_handlers = filter(copy(handlers), 'has_key(v:val, "postprocess")')
+ let world.filter_format = tlib#list#Find(handlers, 'has_key(v:val, "filter_format")', '', 'v:val.filter_format')
+ let world.return_agent = tlib#list#Find(handlers, 'has_key(v:val, "return_agent")', '', 'v:val.return_agent')
+ let world.help_extra = tlib#list#Find(handlers, 'has_key(v:val, "help_extra")', '', 'v:val.help_extra')
+ let world.resize = tlib#list#Find(handlers, 'has_key(v:val, "resize")', '', 'v:val.resize')
+ let world.show_empty = tlib#list#Find(handlers, 'has_key(v:val, "show_empty")', 0, 'v:val.show_empty')
+ let world.pick_last_item = tlib#list#Find(handlers, 'has_key(v:val, "pick_last_item")',
+ \ tlib#var#Get('tlib_pick_last_item', 'bg'), 'v:val.pick_last_item')
+ let world.numeric_chars = tlib#list#Find(handlers, 'has_key(v:val, "numeric_chars")',
+ \ g:tlib#input#numeric_chars, 'v:val.numeric_chars')
+ let world.key_handlers = filter(copy(handlers), 'has_key(v:val, "key")')
+ let filter = tlib#list#Find(handlers, 'has_key(v:val, "filter")', '', 'v:val.filter')
+ if !empty(filter)
+ " let world.initial_filter = [[''], [filter]]
+ " let world.initial_filter = [[filter]]
+ " TLogVAR world.initial_filter
+ call world.SetInitialFilter(filter)
+ endif
+ endif
+ return tlib#input#ListW(world)
+endf
+
+
+" A wrapper for |tlib#input#ListW()| that builds |tlib#World#New| from
+" dict.
+function! tlib#input#ListD(dict) "{{{3
+ return tlib#input#ListW(tlib#World#New(a:dict))
+endf
+
+
+" :def: function! tlib#input#ListW(world, ?command='')
+" The second argument (command) is meant for internal use only.
+" The same as |tlib#input#List| but the arguments are packed into world
+" (an instance of tlib#World as returned by |tlib#World#New|).
+function! tlib#input#ListW(world, ...) "{{{3
+ TVarArg 'cmd'
+ " let time0 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time0
+ let world = a:world
+ if world.pick_last_item >= 1 && stridx(world.type, 'e') == -1 && len(world.base) <= 1
+ let rv = get(world.base, 0, world.rv)
+ if stridx(world.type, 'm') != -1
+ return [rv]
+ else
+ return rv
+ endif
+ endif
+ call s:Init(world, cmd)
+ " TLogVAR world.state, world.sticky, world.initial_index
+ " let statusline = &l:statusline
+ " let laststatus = &laststatus
+ let showmode = &showmode
+ set noshowmode
+ let lastsearch = @/
+ let scrolloff = &l:scrolloff
+ let &l:scrolloff = 0
+ let @/ = ''
+ let dlist = []
+ let post_keys = ''
+ " let &laststatus = 2
+
+ try
+ while !empty(world.state) && world.state !~ '^exit' && (world.show_empty || !empty(world.base))
+ let post_keys = ''
+ " TLogDBG 'while'
+ " TLogVAR world.state
+ " let time01 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time01, time01 - time0
+ try
+ let world = s:RunStateHandlers(world)
+
+ " if exists('b:tlib_world_event')
+ " let event = b:tlib_world_event
+ " unlet! b:tlib_world_event
+ " if event == 'WinLeave'
+ " " let world.resume_state = world.state
+ " let world = tlib#agent#Suspend(world, world.rv)
+ " break
+ " endif
+ " endif
+
+ " let time02 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time02, time02 - time0
+ if world.state =~ '\<reset\>'
+ " TLogDBG 'reset'
+ " call world.Reset(world.state =~ '\<initial\>')
+ call world.Reset()
+ continue
+ endif
+
+ call s:SetOffset(world)
+
+ " let time02 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time02, time02 - time0
+ " TLogDBG 1
+ " TLogVAR world.state
+ if world.state == 'scroll'
+ let world.prefidx = world.offset
+ let world.state = 'redisplay'
+ endif
+
+ if world.state =~ '\<sticky\>'
+ let world.sticky = 1
+ endif
+
+ " TLogVAR world.filter
+ " TLogVAR world.sticky
+ if world.state =~ '\<picked\>'
+ " TLogVAR world.rv
+ throw 'picked'
+ elseif world.state =~ '\<pick\>'
+ let world.rv = world.CurrentItem()
+ " TLogVAR world.rv
+ throw 'picked'
+ elseif world.state =~ 'display'
+ if world.state =~ '^display'
+ " let time03 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time03, time03 - time0
+ if world.IsValidFilter()
+
+ " let time1 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time1, time1 - time0
+ call world.BuildTableList()
+ " let time2 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time2, time2 - time0
+ " TLogDBG 2
+ " TLogDBG len(world.table)
+ " TLogVAR world.table
+ " let world.list = map(copy(world.table), 'world.GetBaseItem(v:val)')
+ " TLogDBG 3
+ let world.llen = len(world.list)
+ " TLogVAR world.index_table
+ if empty(world.index_table)
+ let dindex = range(1, world.llen)
+ let world.index_width = len(world.llen)
+ else
+ let dindex = world.index_table
+ let world.index_width = len(max(dindex))
+ endif
+ " let time3 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time3, time3 - time0
+ if world.llen == 0 && !world.show_empty
+ call world.ReduceFilter()
+ let world.offset = 1
+ " TLogDBG 'ReduceFilter'
+ continue
+ else
+ if world.llen == 1
+ let world.last_item = world.list[0]
+ if world.pick_last_item >= 2
+ " echom 'Pick last item: '. world.list[0]
+ let world.prefidx = '1'
+ " TLogDBG 'pick last item'
+ throw 'pick'
+ endif
+ else
+ let world.last_item = ''
+ endif
+ endif
+ " let time4 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time4, time4 - time0
+ " TLogDBG 4
+ " TLogVAR world.idx, world.llen, world.state
+ " TLogDBG world.FilterIsEmpty()
+ if world.state == 'display'
+ if world.idx == '' && world.llen < g:tlib#input#sortprefs_threshold && !world.FilterIsEmpty()
+ call world.SetPrefIdx()
+ else
+ let world.prefidx = world.idx == '' ? world.initial_index : world.idx
+ endif
+ if world.prefidx > world.llen
+ let world.prefidx = world.llen
+ elseif world.prefidx < 1
+ let world.prefidx = 1
+ endif
+ endif
+ " let time5 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time5, time5 - time0
+ " TLogVAR world.initial_index, world.prefidx
+ " TLogDBG 5
+ " TLogDBG len(world.list)
+ " TLogVAR world.list
+ let dlist = world.DisplayFormat(world.list)
+ " TLogVAR world.prefidx
+ " TLogDBG 6
+ " let time6 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time6, time6 - time0
+ if world.offset_horizontal > 0
+ call map(dlist, 'v:val[world.offset_horizontal:-1]')
+ endif
+ " let time7 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time7, time7 - time0
+ " TLogVAR dindex
+ let dlist = map(range(0, world.llen - 1), 'printf("%0'. world.index_width .'d", dindex[v:val]) .": ". dlist[v:val]')
+ " TLogVAR dlist
+ " let time8 = str2float(reltimestr(reltime())) " DBG
+ " TLogVAR time8, time8 - time0
+
+ else
+
+ let dlist = ['Malformed filter']
+
+ endif
+ else
+ if world.prefidx == 0
+ let world.prefidx = 1
+ endif
+ endif
+ " TLogVAR world.idx, world.prefidx
+
+ " TLogDBG 7
+ " TLogVAR world.prefidx, world.offset
+ " TLogDBG (world.prefidx > world.offset + winheight(0) - 1)
+ " if world.prefidx > world.offset + winheight(0) - 1
+ " let listtop = world.llen - winheight(0) + 1
+ " let listoff = world.prefidx - winheight(0) + 1
+ " let world.offset = min([listtop, listoff])
+ " TLogVAR world.prefidx
+ " TLogDBG len(list)
+ " TLogDBG winheight(0)
+ " TLogVAR listtop, listoff, world.offset
+ " elseif world.prefidx < world.offset
+ " let world.offset = world.prefidx
+ " endif
+ " TLogDBG 8
+ " TLogVAR world.initial_display, !tlib#char#IsAvailable()
+ if world.state =~ '\<update\>' || world.initial_display || !tlib#char#IsAvailable()
+ " TLogDBG len(dlist)
+ call world.DisplayList(world.Query(), dlist)
+ call world.FollowCursor()
+ let world.initial_display = 0
+ " TLogDBG 9
+ endif
+ if world.state =~ '\<hibernate\>'
+ let world.state = 'suspend'
+ else
+ let world.state = ''
+ endif
+ else
+ " if world.state == 'scroll'
+ " let world.prefidx = world.offset
+ " endif
+ call world.DisplayList()
+ if world.state == 'help' || world.state == 'printlines'
+ let world.state = 'display'
+ else
+ let world.state = ''
+ call world.FollowCursor()
+ endif
+ endif
+ " TAssert IsNotEmpty(world.scratch)
+ let world.list_wnr = winnr()
+
+ " TLogVAR world.state, world.next_state
+ if !empty(world.next_state)
+ let world.state = world.next_state
+ let world.next_state = ''
+ endif
+
+ if world.state =~ '\<suspend\>'
+ let world = tlib#agent#SuspendToParentWindow(world, world.rv)
+ continue
+ endif
+
+ if world.state =~ '\<eval\>'
+ let query = matchstr(world.state, '\<eval\[\zs.\{-}\ze\]')
+ if empty(query)
+ let query = 'Waiting for input ... Press ESC to continue'
+ endif
+ if has('gui_win32')
+ let exec_cmd = input(query, '')
+ " TLogVAR exec_cmd
+ if exec_cmd == ''
+ let world.state = 'redisplay'
+ else
+ exec exec_cmd
+ endif
+ elseif has('gui_gtk') || has('gui_gtk2')
+ let c = s:GetModdedChar(world)
+ " TLogVAR c
+ endif
+ else
+ " TLogVAR world.timeout
+ let c = s:GetModdedChar(world)
+ " TLogVAR c, has_key(world.key_map[world.key_mode],c)
+ endif
+ " TLogVAR c
+ " TLogDBG string(sort(keys(world.key_map[world.key_mode])))
+
+ " TLogVAR world.next_agent, world.next_eval
+ if !empty(world.next_agent)
+ let nagent = world.next_agent
+ let world.next_agent = ''
+ " let world = call(nagent, [world, world.GetSelectedItems(world.CurrentItem())])
+ " call s:CheckAgentReturnValue(nagent, world)
+ let world = s:CallAgent({'agent': nagent}, world, world.GetSelectedItems(world.CurrentItem()))
+ elseif !empty(world.next_eval)
+ let selected = world.GetSelectedItems(world.CurrentItem())
+ let neval = world.next_eval
+ let world.next_eval = ''
+ exec neval
+ call s:CheckAgentReturnValue(neval, world)
+ elseif world.state != ''
+ " continue
+ elseif has_key(world.key_map[world.key_mode], c)
+ let sr = @/
+ silent! let @/ = lastsearch
+ " TLogVAR c, world.key_map[world.key_mode][c]
+ " TLog "Agent: ". string(world.key_map[world.key_mode][c])
+ let handler = world.key_map[world.key_mode][c]
+ " " TLogVAR handler
+ " let world = call(handler.agent, [world, world.GetSelectedItems(world.CurrentItem())])
+ " call s:CheckAgentReturnValue(c, world)
+ let world = s:CallAgent(handler, world, world.GetSelectedItems(world.CurrentItem()))
+ silent! let @/ = sr
+ " continue
+ elseif c == 13
+ throw 'pick'
+ elseif c == 27
+ " TLogVAR c, world.key_mode
+ if world.key_mode != 'default'
+ let world.key_mode = 'default'
+ let world.state = 'redisplay'
+ else
+ let world.state = 'exit empty'
+ endif
+ elseif c == "\<LeftMouse>"
+ if v:mouse_win == world.list_wnr
+ let world.prefidx = world.GetLineIdx(v:mouse_lnum)
+ " let world.offset = world.prefidx
+ if empty(world.prefidx)
+ " call feedkeys(c, 't')
+ let c = s:GetModdedChar(world)
+ let world.state = 'help'
+ continue
+ endif
+ throw 'pick'
+ else
+ let post_keys = v:mouse_lnum .'gg'. v:mouse_col .'|'. c
+ if world.allow_suspend
+ let world = tlib#agent#SuspendToParentWindow(world, world.rv)
+ else
+ let world.state = 'exit empty'
+ endif
+ endif
+ elseif c == "\<RightMouse>"
+ if v:mouse_win == world.list_wnr
+ call s:BuildMenu(world)
+ let world.state = 'redisplay'
+ if s:PopupmenuExists() == 1
+ " if v:mouse_lnum != line('.')
+ " endif
+ let world.prefidx = world.GetLineIdx(v:mouse_lnum)
+ let world.next_state = 'eval[Waiting for popup menu ... Press ESC to continue]'
+ call world.DisplayList()
+ if line('w$') - v:mouse_lnum < 6
+ popup ]TLibInputListPopupMenu
+ else
+ popup! ]TLibInputListPopupMenu
+ endif
+ endif
+ else
+ let post_keys = v:mouse_lnum .'gg'. v:mouse_col .'|'. c
+ if world.allow_suspend
+ let world = tlib#agent#SuspendToParentWindow(world, world.rv)
+ else
+ let world.state = 'exit empty'
+ endif
+ endif
+ " TLogVAR world.prefidx, world.state
+ elseif has_key(world.key_map[world.key_mode], 'unknown_key')
+ let agent = world.key_map[world.key_mode].unknown_key.agent
+ " let world = call(agent, [world, c])
+ " call s:CheckAgentReturnValue(agent, world)
+ let world = s:CallAgent({'agent': agent}, world, c)
+ elseif c >= 32
+ let world.state = 'display'
+ let numbase = get(world.numeric_chars, c, -99999)
+ " TLogVAR numbase, world.numeric_chars, c
+ if numbase != -99999
+ let world.idx .= (c - numbase)
+ if len(world.idx) == world.index_width
+ let world.prefidx = world.idx
+ " TLogVAR world.prefidx
+ throw 'pick'
+ endif
+ else
+ let world.idx = ''
+ " TLogVAR world.filter
+ if world.llen > g:tlib#input#livesearch_threshold
+ let pattern = input('Filter: ', world.CleanFilter(world.filter[0][0]) . nr2char(c))
+ if empty(pattern)
+ let world.state = 'exit empty'
+ else
+ call world.SetFrontFilter(pattern)
+ echo
+ endif
+ elseif c == 124
+ call insert(world.filter[0], [])
+ else
+ call world.PushFrontFilter(c)
+ endif
+ " continue
+ if c == 45 && world.filter[0][0] == '-'
+ let world.state = 'redisplay'
+ end
+ endif
+ else
+ let world.state = 'redisplay'
+ " let world.state = 'continue'
+ endif
+
+ catch /^picked$/
+ call world.ClearAllMarks()
+ call world.MarkCurrent(world.prefidx)
+ let world.state = 'exit'
+
+ catch /^pick$/
+ call world.ClearAllMarks()
+ call world.MarkCurrent(world.prefidx)
+ let world.state = ''
+ " TLogDBG 'Pick item #'. world.prefidx
+
+ finally
+ " TLogDBG 'finally 1', world.state
+ if world.state =~ '\<suspend\>'
+ " if !world.allow_suspend
+ " echom "Cannot be suspended"
+ " let world.state = 'redisplay'
+ " endif
+ elseif !empty(world.list) && !empty(world.base)
+ " TLogVAR world.list
+ if empty(world.state)
+ let world.rv = world.CurrentItem()
+ " TLogVAR world.state, world.rv
+ endif
+ " TLogVAR "postprocess"
+ for handler in world.post_handlers
+ let state = get(handler, 'postprocess', '')
+ " TLogVAR handler
+ " TLogVAR state
+ " TLogVAR world.state
+ if state == world.state
+ let agent = handler.agent
+ let [world, world.rv] = call(agent, [world, world.rv])
+ " TLogVAR world.state, world.rv
+ call s:CheckAgentReturnValue(agent, world)
+ endif
+ endfor
+ endif
+ " TLogDBG 'state0='. world.state
+ endtry
+ " TLogDBG 'state1='. world.state
+ endwh
+
+ " TLogVAR world.state
+ " TLogDBG string(tlib#win#List())
+ " TLogDBG 'exit while loop'
+ " TLogVAR world.list
+ " TLogVAR world.sel_idx
+ " TLogVAR world.idx
+ " TLogVAR world.prefidx
+ " TLogVAR world.rv
+ " TLogVAR world.type, world.state, world.return_agent, world.index_table, world.rv
+ if world.state =~ '\<\(empty\|escape\)\>'
+ let world.sticky = 0
+ endif
+ if world.state =~ '\<suspend\>'
+ " TLogDBG 'return suspended'
+ " TLogVAR world.prefidx
+ " exec world.prefidx
+ return
+ elseif world.state =~ '\<empty\>'
+ " TLog "empty"
+ " TLogDBG 'return empty'
+ " TLogVAR world.type
+ if stridx(world.type, 'm') != -1
+ return []
+ elseif stridx(world.type, 'i') != -1
+ return 0
+ else
+ return ''
+ endif
+ elseif !empty(world.return_agent)
+ " TLogDBG 'return agent'
+ " TLogVAR world.return_agent
+ call world.CloseScratch()
+ " TLogDBG "return_agent ". string(tlib#win#List())
+ " TAssert IsNotEmpty(world.scratch)
+ return call(world.return_agent, [world, world.GetSelectedItems(world.rv)])
+ elseif stridx(world.type, 'w') != -1
+ " TLog "return_world"
+ " TLogDBG 'return world'
+ return world
+ elseif stridx(world.type, 'm') != -1
+ " TLog "return_multi"
+ " TLogDBG 'return multi'
+ return world.GetSelectedItems(world.rv)
+ elseif stridx(world.type, 'i') != -1
+ " TLog "return_index"
+ " TLogDBG 'return index'
+ if empty(world.index_table)
+ return world.rv
+ else
+ return world.index_table[world.rv - 1]
+ endif
+ else
+ " TLog "return_else"
+ " TLogDBG 'return normal'
+ return world.rv
+ endif
+
+ finally
+ call world.Leave()
+
+ " TLogVAR statusline
+ " let &l:statusline = statusline
+ " let &laststatus = laststatus
+ if &showmode != showmode
+ let &showmode = showmode
+ endif
+ silent! let @/ = lastsearch
+ let &l:scrolloff = scrolloff
+ if s:PopupmenuExists() == 1
+ silent! aunmenu ]TLibInputListPopupMenu
+ endif
+
+ " TLogDBG 'finally 2'
+ " TLogDBG string(world.Methods())
+ " TLogVAR world.state
+ " TLogDBG string(tlib#win#List())
+ if world.state !~ '\<suspend\>'
+ " redraw
+ " TLogVAR world.sticky, bufnr("%")
+ if world.sticky
+ " TLogDBG "sticky"
+ " TLogVAR world.bufnr
+ " TLogDBG bufwinnr(world.bufnr)
+ if world.scratch_split > 0
+ if bufwinnr(world.bufnr) == -1
+ " TLogDBG "UseScratch"
+ call world.UseScratch()
+ endif
+ let world = tlib#agent#SuspendToParentWindow(world, world.GetSelectedItems(world.rv))
+ endif
+ else
+ " TLogDBG "non sticky"
+ " TLogVAR world.state, world.win_wnr, world.bufnr
+ if world.CloseScratch()
+ " TLogVAR world.winview
+ call tlib#win#SetLayout(world.winview)
+ endif
+ endif
+ endif
+ " for i in range(0,5)
+ " call getchar(0)
+ " endfor
+ echo
+ redraw!
+ if !empty(post_keys)
+ " TLogVAR post_keys
+ call feedkeys(post_keys)
+ endif
+ endtry
+endf
+
+
+function! s:CallAgent(handler, world, list) abort "{{{3
+ let agent = a:handler.agent
+ let args = [a:world, a:list]
+ if has_key(a:handler, 'args')
+ let args += a:handler.args
+ endif
+ let world = call(agent, args)
+ " TLogVAR world.state, world.rv
+ call s:CheckAgentReturnValue(agent, world)
+ return world
+endf
+
+function! s:GetModdedChar(world) "{{{3
+ let [char, mode] = tlib#char#Get(a:world.timeout, a:world.timeout_resolution, 1)
+ if char !~ '\D' && char > 0 && mode != 0
+ return printf("<%s-%s>", mode, char)
+ else
+ return char
+ endif
+endf
+
+
+function! s:Init(world, cmd) "{{{3
+ " TLogVAR a:cmd
+ let a:world.initial_display = 1
+ if a:cmd =~ '\<sticky\>'
+ let a:world.sticky = 1
+ endif
+ if a:cmd =~ '^resume'
+ call a:world.UseInputListScratch()
+ let a:world.initial_index = line('.')
+ if a:cmd =~ '\<pick\>'
+ let a:world.state = 'pick'
+ let a:world.prefidx = a:world.initial_index
+ else
+ call a:world.Retrieve(1)
+ endif
+ " if !empty(a:world.resume_state)
+ " let a:world.state = a:world.resume_state
+ " endif
+ elseif !a:world.initialized
+ " TLogVAR a:world.initialized, a:world.win_wnr, a:world.bufnr
+ let a:world.filetype = &filetype
+ let a:world.fileencoding = &fileencoding
+ call a:world.SetMatchMode(tlib#var#Get('tlib#input#filter_mode', 'wb'))
+ call a:world.Initialize()
+ if !has_key(a:world, 'key_mode')
+ let a:world.key_mode = 'default'
+ endif
+ " TLogVAR has_key(a:world,'key_map')
+ if has_key(a:world, 'key_map')
+ " TLogVAR has_key(a:world.key_map,a:world.key_mode)
+ if has_key(a:world.key_map, a:world.key_mode)
+ let a:world.key_map[a:world.key_mode] = extend(
+ \ a:world.key_map[a:world.key_mode],
+ \ copy(g:tlib#input#keyagents_InputList_s),
+ \ 'keep')
+ else
+ let a:world.key_map[a:world.key_mode] = copy(g:tlib#input#keyagents_InputList_s)
+ endif
+ else
+ let a:world.key_map = {
+ \ a:world.key_mode : copy(g:tlib#input#keyagents_InputList_s)
+ \ }
+ endif
+ " TLogVAR a:world.type
+ if stridx(a:world.type, 'm') != -1
+ call extend(a:world.key_map[a:world.key_mode], g:tlib#input#keyagents_InputList_m, 'force')
+ endif
+ for key_mode in keys(a:world.key_map)
+ let a:world.key_map[key_mode] = map(a:world.key_map[key_mode], 'type(v:val) == 4 ? v:val : {"agent": v:val}')
+ endfor
+ " TLogVAR a:world.key_mode
+ if type(a:world.key_handlers) == 3
+ call s:ExtendKeyMap(a:world, a:world.key_mode, a:world.key_handlers)
+ elseif type(a:world.key_handlers) == 4
+ for [world_key_mode, world_key_handlers] in items(a:world.key_handlers)
+ call s:ExtendKeyMap(a:world, world_key_mode, world_key_handlers)
+ endfor
+ else
+ throw "tlib#input#ListW: key_handlers must be either a list or a dictionary"
+ endif
+ " TLogVAR a:world.type, a:world.key_map
+ if !empty(a:cmd)
+ let a:world.state .= ' '. a:cmd
+ endif
+ endif
+ " TLogVAR a:world.state, a:world.sticky
+endf
+
+
+function! s:ExtendKeyMap(world, key_mode, key_handlers) "{{{3
+ for handler in a:key_handlers
+ let k = get(handler, 'key', '')
+ if !empty(k)
+ let a:world.key_map[a:key_mode][k] = handler
+ endif
+ endfor
+endf
+
+
+function! s:PopupmenuExists()
+ if !g:tlib#input#use_popup
+ \ || exists(':popup') != 2
+ \ || !(has('gui_win32') || has('gui_gtk') || has('gui_gtk2'))
+ " \ || !has('gui_win32')
+ let rv = -1
+ else
+ try
+ let rv = 1
+ silent amenu ]TLibInputListPopupMenu
+ catch
+ let rv = 0
+ endtry
+ endif
+ " TLogVAR rv
+ return rv
+endf
+
+
+function! s:BuildMenu(world) "{{{3
+ if g:tlib#input#use_popup && s:PopupmenuExists() == 0
+ call s:BuildItem('Pick\ selected\ item', {'key_name': '<cr>', 'eval': 'let world.state = "pick"'})
+ call s:BuildItem('Cancel', {'key_name': '<esc>', 'agent': 'tlib#agent#Exit'})
+ call s:BuildItem('Select', {'key_name': '#', 'agent': 'tlib#agent#Select'})
+ call s:BuildItem('Select\ all', {'key_name': '<c-a>', 'agent': 'tlib#agent#SelectAll'})
+ call s:BuildItem('Reset\ list', {'key_name': '<c-r>', 'agent': 'tlib#agent#Reset'})
+ call s:BuildItem('-StandardEntries-', {'key': ":", 'eval': 'let world.state = "redisplay"'})
+ for [key_mode, key_handlers] in items(a:world.key_map)
+ let keys = sort(keys(key_handlers))
+ let mitems = {}
+ for key in keys
+ let handler = key_handlers[key]
+ let k = get(handler, 'key', '')
+ if !empty(k) && has_key(handler, 'help') && !empty(handler.help)
+ if empty(key_mode) || key_mode == 'default'
+ let mname = ''
+ else
+ let mname = escape(key_mode, ' .\') .'.'
+ endif
+ if has_key(handler, 'submenu')
+ let submenu = escape(handler.submenu, ' .\')
+ else
+ let submenu = '~'
+ endif
+ for mfield in ['menu', 'help', 'key_name', 'agent']
+ if has_key(handler, mfield)
+ let mname .= escape(handler[mfield], ' .\')
+ break
+ endif
+ endfor
+ if !has_key(mitems, submenu)
+ let mitems[submenu] = {}
+ endif
+ let mitems[submenu][mname] = handler
+ endif
+ endfor
+ for msubname in sort(keys(mitems))
+ let msubitems = mitems[msubname]
+ if msubname == '~'
+ let msubmname = ''
+ else
+ let msubmname = msubname .'.'
+ endif
+ for mname in sort(keys(msubitems))
+ let msname = msubmname . mname
+ let handler = msubitems[mname]
+ call s:BuildItem(msname, handler)
+ " if has_key(handler, 'agent')
+ " call s:BuildItem(msname, {'agent': handler.agent})
+ " else
+ " call s:BuildItem(msname, {'key': handler.key_name})
+ " endif
+ endfor
+ endfor
+ endfor
+ endif
+endf
+
+
+function! s:BuildItem(menu, def) "{{{3
+ if has('gui_win32')
+ let key_mode = 'c'
+ elseif has('gui_gtk') || has('gui_gtk2')
+ let key_mode = 'raw'
+ endif
+ for k in ['agent', 'eval', 'key_name', 'key']
+ if has('gui_win32')
+ elseif has('gui_gtk') || has('gui_gtk')
+ if k == 'agent' || k == 'eval'
+ continue
+ endif
+ endif
+ try
+ if has_key(a:def, k)
+ let v = a:def[k]
+ if k == 'key'
+ if key_mode == 'c'
+ " echom 'DBG amenu' (']TLibInputListPopupMenu.'. a:menu) ':let c = "'. v .'"<cr>'
+ exec 'amenu' (']TLibInputListPopupMenu.'. a:menu) ':let c = "'. v .'"<cr>'
+ else
+ " echom 'DBG amenu' (']TLibInputListPopupMenu.'. a:menu) v
+ exec 'amenu' (']TLibInputListPopupMenu.'. a:menu) v
+ endif
+ elseif k == 'key_name'
+ if key_mode == 'c'
+ " echom 'DBG amenu' (']TLibInputListPopupMenu.'. a:menu) ':let c = "\'. v .'"<cr>'
+ exec 'amenu' (']TLibInputListPopupMenu.'. a:menu) ':let c = "\'. v .'"<cr>'
+ else
+ let key = v
+ " echom 'DBG amenu' (']TLibInputListPopupMenu.'. a:menu) key
+ exec 'amenu' (']TLibInputListPopupMenu.'. a:menu) key
+ endif
+ elseif k == 'agent'
+ " echom 'DBG amenu' (']TLibInputListPopupMenu.'. a:menu) ':let world.next_agent ='. string(v) .'<cr>'
+ exec 'amenu' (']TLibInputListPopupMenu.'. a:menu) ':let world.next_agent ='. string(v) .'<cr>'
+ elseif k == 'eval'
+ " echom 'DBG amenu' (']TLibInputListPopupMenu.'. a:menu) ':let world.next_eval ='. string(v) .'<cr>'
+ exec 'amenu' (']TLibInputListPopupMenu.'. a:menu) ':let world.next_eval ='. string(v) .'<cr>'
+ endif
+ return
+ endif
+ catch
+ endtry
+ endfor
+endf
+
+
+function! s:RunStateHandlers(world) "{{{3
+ " Provide the variable "world" in the environment of an "exec"
+ " handler (ea).
+ let world = a:world
+ for handler in a:world.state_handlers
+ let eh = get(handler, 'state', '')
+ if !empty(eh) && a:world.state =~ eh
+ let ea = get(handler, 'exec', '')
+ if !empty(ea)
+ exec ea
+ else
+ let agent = get(handler, 'agent', '')
+ " let world = call(agent, [a:world, a:world.GetSelectedItems(a:world.CurrentItem())])
+ " call s:CheckAgentReturnValue(agent, a:world)
+ let world = s:CallAgent({'agent': agent}, world, world.GetSelectedItems(world.CurrentItem()))
+ endif
+ endif
+ endfor
+ return world
+endf
+
+
+function! s:CheckAgentReturnValue(name, value) "{{{3
+ if type(a:value) != 4 && !has_key(a:value, 'state')
+ echoerr 'Malformed agent: '. a:name
+ endif
+ return a:value
+endf
+
+
+function! s:SetOffset(world) "{{{3
+ let llenw = len(a:world.base) - winheight(0) + 1
+ if a:world.offset > llenw
+ let a:world.offset = llenw
+ endif
+ if a:world.offset < 1
+ let a:world.offset = 1
+ endif
+endf
+
+
+" Functions related to tlib#input#EditList(type, ...) "{{{2
+
+" :def: function! tlib#input#EditList(query, list, ?timeout=0)
+" Edit a list.
+"
+" EXAMPLES: >
+" echo tlib#input#EditList('Edit:', [100,200,300])
+function! tlib#input#EditList(query, list, ...) "{{{3
+ let handlers = a:0 >= 1 && !empty(a:1) ? a:1 : g:tlib#input#handlers_EditList
+ let default = a:0 >= 2 ? a:2 : []
+ let timeout = a:0 >= 3 ? a:3 : 0
+ " TLogVAR handlers
+ let rv = tlib#input#List('me', a:query, copy(a:list), handlers, default, timeout)
+ " TLogVAR rv
+ if empty(rv)
+ return a:list
+ else
+ let [success, list] = rv
+ return success ? list : a:list
+ endif
+endf
+
+
+function! tlib#input#Resume(name, pick, bufnr) "{{{3
+ " TLogVAR a:name, a:pick
+ echo
+ if bufnr('%') != a:bufnr
+ if g:tlib#debug
+ echohl WarningMsg
+ echom "tlib#input#Resume: Internal error: Not in scratch buffer:" bufname('%')
+ echohl NONE
+ endif
+ let br = tlib#buffer#Set(a:bufnr)
+ endif
+ if !exists('b:tlib_'. a:name)
+ if g:tlib#debug
+ echohl WarningMsg
+ echom "tlib#input#Resume: Internal error: b:tlib_". a:name ." does not exist:" bufname('%')
+ echohl NONE
+ redir => varss
+ silent let b:
+ redir END
+ let vars = split(varss, '\n')
+ call filter(vars, 'v:val =~ "^b:tlib_"')
+ echom "DEBUG tlib#input#Resume" string(vars)
+ endif
+ else
+ call tlib#autocmdgroup#Init()
+ autocmd! TLib BufEnter <buffer>
+ if b:tlib_{a:name}.state =~ '\<suspend\>'
+ let b:tlib_{a:name}.state = 'redisplay'
+ else
+ let b:tlib_{a:name}.state .= ' redisplay'
+ endif
+ " call tlib#input#List('resume '. a:name)
+ let cmd = 'resume '. a:name
+ if a:pick >= 1
+ let cmd .= ' pick'
+ if a:pick >= 2
+ let cmd .= ' sticky'
+ end
+ endif
+ call tlib#input#ListW(b:tlib_{a:name}, cmd)
+ endif
+endf
+
+
+" :def: function! tlib#input#CommandSelect(command, ?keyargs={})
+" Take a command, view the output, and let the user select an item from
+" its output.
+"
+" EXAMPLE: >
+" command! TMarks exec 'norm! `'. matchstr(tlib#input#CommandSelect('marks'), '^ \+\zs.')
+" command! TAbbrevs exec 'norm i'. matchstr(tlib#input#CommandSelect('abbrev'), '^\S\+\s\+\zs\S\+')
+function! tlib#input#CommandSelect(command, ...) "{{{3
+ TVarArg ['args', {}]
+ if has_key(args, 'retrieve')
+ let list = call(args.retrieve)
+ elseif has_key(args, 'list')
+ let list = args.list
+ else
+ let list = tlib#cmd#OutputAsList(a:command)
+ endif
+ if has_key(args, 'filter')
+ call map(list, args.filter)
+ endif
+ let type = has_key(args, 'type') ? args.type : 's'
+ let handlers = has_key(args, 'handlers') ? args.handlers : []
+ let rv = tlib#input#List(type, 'Select', list, handlers)
+ if !empty(rv)
+ if has_key(args, 'process')
+ let rv = call(args.process, [rv])
+ endif
+ endif
+ return rv
+endf
+
+
+" :def: function! tlib#input#Edit(name, value, callback, ?cb_args=[])
+"
+" Edit a value (asynchronously) in a scratch buffer. Use name for
+" identification. Call callback when done (or on cancel).
+" In the scratch buffer:
+" Press <c-s> or <c-w><cr> to enter the new value, <c-w>c to cancel
+" editing.
+" EXAMPLES: >
+" fun! FooContinue(success, text)
+" if a:success
+" let b:var = a:text
+" endif
+" endf
+" call tlib#input#Edit('foo', b:var, 'FooContinue')
+function! tlib#input#Edit(name, value, callback, ...) "{{{3
+ " TLogVAR a:value
+ TVarArg ['args', []]
+ let sargs = {'scratch': '__EDIT__'. a:name .'__', 'win_wnr': winnr()}
+ let scr = tlib#scratch#UseScratch(sargs)
+
+ " :nodoc:
+ map <buffer> <c-w>c :call <SID>EditCallback(0)<cr>
+ " :nodoc:
+ imap <buffer> <c-w>c <c-o>call <SID>EditCallback(0)<cr>
+ " :nodoc:
+ map <buffer> <c-s> :call <SID>EditCallback(1)<cr>
+ " :nodoc:
+ imap <buffer> <c-s> <c-o>call <SID>EditCallback(1)<cr>
+ " :nodoc:
+ map <buffer> <c-w><cr> :call <SID>EditCallback(1)<cr>
+ " :nodoc:
+ imap <buffer> <c-w><cr> <c-o>call <SID>EditCallback(1)<cr>
+
+ call tlib#normal#WithRegister('gg"tdG', 't')
+ call append(1, split(a:value, "\<c-j>", 1))
+ " let hrm = 'DON''T DELETE THIS HEADER'
+ " let hr3 = repeat('"', (tlib#win#Width(0) - len(hrm)) / 2)
+ let s:horizontal_line = repeat('`', tlib#win#Width(0))
+ " hr3.hrm.hr3
+ let hd = ['Keys: <c-s>, <c-w><cr> ... save/accept; <c-w>c ... cancel', s:horizontal_line]
+ call append(1, hd)
+ call tlib#normal#WithRegister('gg"tdd', 't')
+ syntax match TlibEditComment /^\%1l.*/
+ syntax match TlibEditComment /^```.*/
+ hi link TlibEditComment Comment
+ exec len(hd) + 1
+ if type(a:callback) == 4
+ let b:tlib_scratch_edit_callback = get(a:callback, 'submit', '')
+ call call(get(a:callback, 'init', ''), [])
+ else
+ let b:tlib_scratch_edit_callback = a:callback
+ endif
+ let b:tlib_scratch_edit_args = args
+ let b:tlib_scratch_edit_scratch = sargs
+ " exec 'autocmd BufDelete,BufHidden,BufUnload <buffer> call s:EditCallback('. string(a:name) .')'
+ " echohl MoreMsg
+ " echom 'Press <c-s> to enter, <c-w>c to cancel editing.'
+ " echohl NONE
+endf
+
+
+function! s:EditCallback(...) "{{{3
+ TVarArg ['ok', -1]
+ " , ['bufnr', -1]
+ " autocmd! BufDelete,BufHidden,BufUnload <buffer>
+ if ok == -1
+ let ok = confirm('Use value')
+ endif
+ let start = getline(2) == s:horizontal_line ? 3 : 1
+ let text = ok ? join(getline(start, '$'), "\n") : ''
+ let cb = b:tlib_scratch_edit_callback
+ let args = b:tlib_scratch_edit_args
+ let sargs = b:tlib_scratch_edit_scratch
+ " TLogVAR cb, args, sargs
+ call tlib#scratch#CloseScratch(b:tlib_scratch_edit_scratch)
+ call tlib#win#Set(sargs.win_wnr)
+ call call(cb, args + [ok, text])
+endf
+
+
+function! tlib#input#Dialog(text, options, default) "{{{3
+ if has('dialog_con') || has('dialog_gui')
+ let opts = join(map(a:options, '"&". v:val'), "\n")
+ let val = confirm(a:text, opts)
+ if val
+ let yn = a:options[val - 1]
+ else
+ let yn = a:default
+ endif
+ else
+ let oi = index(a:options, a:default)
+ if oi == -1
+ let opts = printf("(%s|%s)", join(a:options, '/'), a:default)
+ else
+ let options = copy(a:options)
+ let options[oi] = toupper(options[oi])
+ let opts = printf("(%s)", join(a:options, '/'))
+ endif
+ let yn = inputdialog(a:text .' '. opts)
+ endif
+ return yn
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/list.vim b/vim/bundle/tlib_vim/autoload/tlib/list.vim
new file mode 100755
index 0000000..a18f27f
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/list.vim
@@ -0,0 +1,194 @@
+" list.vim
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2007-06-30.
+" @Last Change: 2016-03-22.
+" @Revision: 68
+
+
+""" List related functions {{{1
+" For the following functions please see ../../test/tlib.vim for examples.
+
+" :def: function! tlib#list#Inject(list, initial_value, funcref)
+" EXAMPLES: >
+" echo tlib#list#Inject([1,2,3], 0, function('Add')
+" => 6
+function! tlib#list#Inject(list, value, Function) "{{{3
+ if empty(a:list)
+ return a:value
+ else
+ let item = a:list[0]
+ let rest = a:list[1:-1]
+ let value = call(a:Function, [a:value, item])
+ return tlib#list#Inject(rest, value, a:Function)
+ endif
+endf
+
+
+" EXAMPLES: >
+" tlib#list#Compact([0,1,2,3,[], {}, ""])
+" => [1,2,3]
+function! tlib#list#Compact(list) "{{{3
+ return filter(copy(a:list), '!empty(v:val)')
+endf
+
+
+" EXAMPLES: >
+" tlib#list#Flatten([0,[1,2,[3,""]]])
+" => [0,1,2,3,""]
+function! tlib#list#Flatten(list) "{{{3
+ let acc = []
+ for e in a:list
+ if type(e) == 3
+ let acc += tlib#list#Flatten(e)
+ else
+ call add(acc, e)
+ endif
+ unlet e
+ endfor
+ return acc
+endf
+
+
+" :def: function! tlib#list#FindAll(list, filter, ?process_expr="")
+" Basically the same as filter()
+"
+" EXAMPLES: >
+" tlib#list#FindAll([1,2,3], 'v:val >= 2')
+" => [2, 3]
+function! tlib#list#FindAll(list, filter, ...) "{{{3
+ let rv = filter(copy(a:list), a:filter)
+ if a:0 >= 1 && a:1 != ''
+ let rv = map(rv, a:1)
+ endif
+ return rv
+endf
+
+
+" :def: function! tlib#list#Find(list, filter, ?default="", ?process_expr="")
+"
+" EXAMPLES: >
+" tlib#list#Find([1,2,3], 'v:val >= 2')
+" => 2
+function! tlib#list#Find(list, filter, ...) "{{{3
+ let default = a:0 >= 1 ? a:1 : ''
+ let expr = a:0 >= 2 ? a:2 : ''
+ return get(tlib#list#FindAll(a:list, a:filter, expr), 0, default)
+endf
+
+
+" EXAMPLES: >
+" tlib#list#Any([1,2,3], 'v:val >= 2')
+" => 1
+function! tlib#list#Any(list, expr) "{{{3
+ return !empty(tlib#list#FindAll(a:list, a:expr))
+endf
+
+
+" EXAMPLES: >
+" tlib#list#All([1,2,3], 'v:val >= 2')
+" => 0
+function! tlib#list#All(list, expr) "{{{3
+ return len(tlib#list#FindAll(a:list, a:expr)) == len(a:list)
+endf
+
+
+" EXAMPLES: >
+" tlib#list#Remove([1,2,1,2], 2)
+" => [1,1,2]
+function! tlib#list#Remove(list, element) "{{{3
+ let idx = index(a:list, a:element)
+ if idx != -1
+ call remove(a:list, idx)
+ endif
+ return a:list
+endf
+
+
+" EXAMPLES: >
+" tlib#list#RemoveAll([1,2,1,2], 2)
+" => [1,1]
+function! tlib#list#RemoveAll(list, element) "{{{3
+ call filter(a:list, 'v:val != a:element')
+ return a:list
+endf
+
+
+" :def: function! tlib#list#Zip(lists, ?default='')
+" EXAMPLES: >
+" tlib#list#Zip([[1,2,3], [4,5,6]])
+" => [[1,4], [2,5], [3,6]]
+function! tlib#list#Zip(lists, ...) "{{{3
+ TVarArg 'default'
+ let lists = copy(a:lists)
+ let max = 0
+ for l in lists
+ let ll = len(l)
+ if ll > max
+ let max = ll
+ endif
+ endfor
+ " TLogVAR default, max
+ return map(range(0, max - 1), 's:GetNthElement(v:val, lists, default)')
+endf
+
+function! s:GetNthElement(n, lists, default) "{{{3
+ " TLogVAR a:n, a:lists, a:default
+ return map(copy(a:lists), 'get(v:val, a:n, a:default)')
+endf
+
+
+function! tlib#list#Uniq(list, ...) "{{{3
+ " TLogVAR a:list
+ TVarArg ['get_value', ''], ['remove_empty', 0]
+ if remove_empty
+ call filter(a:list, 'type(v:val) == 0 || !empty(v:val)')
+ endif
+ " CREDITS: Based on syntastic#util#unique(list) by scrooloose
+ let emptystring = 0
+ let seen = {}
+ let uniques = []
+ if empty(get_value)
+ for e in a:list
+ if e == ''
+ if !emptystring
+ let emptystring = 1
+ call add(uniques, e)
+ endif
+ elseif !has_key(seen, e)
+ let seen[e] = 1
+ call add(uniques, e)
+ endif
+ unlet e
+ endfor
+ else
+ for e in a:list
+ let v = eval(printf(get_value, string(e)))
+ if v == ''
+ if !emptystring
+ let emptystring = 1
+ call add(uniques, v)
+ endif
+ elseif !has_key(seen, v)
+ let seen[v] = 1
+ call add(uniques, v)
+ endif
+ unlet e v
+ endfor
+ endif
+ return uniques
+endf
+
+
+function! tlib#list#ToDictionary(list, default, ...) "{{{3
+ TVarArg ['generator', '']
+ let dict = {}
+ for item in a:list
+ if !empty(item)
+ let dict[item] = empty(generator) ? a:default : call(generator, [item, a:default])
+ endif
+ endfor
+ return dict
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/loclist.vim b/vim/bundle/tlib_vim/autoload/tlib/loclist.vim
new file mode 100644
index 0000000..198dd1b
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/loclist.vim
@@ -0,0 +1,13 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2015-10-24
+" @Revision: 2
+
+
+function! tlib#loclist#Browse(...) abort "{{{3
+ let list = getloclist(0)
+ return call(function('tlib#qfl#QflList'), [list] + a:000)
+endf
+
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/map.vim b/vim/bundle/tlib_vim/autoload/tlib/map.vim
new file mode 100755
index 0000000..c1af13f
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/map.vim
@@ -0,0 +1,23 @@
+" map.vim
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2009-08-23.
+" @Last Change: 2009-08-23.
+" @Revision: 0.0.4
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+" If |pumvisible()| is true, return "\<c-y>". Otherwise return a:key.
+" For use in maps like: >
+" imap <expr> <cr> tlib#map#PumAccept("\<cr>")
+function! tlib#map#PumAccept(key) "{{{3
+ return pumvisible() ? "\<c-y>" : a:key
+endf
+
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/autoload/tlib/normal.vim b/vim/bundle/tlib_vim/autoload/tlib/normal.vim
new file mode 100755
index 0000000..faaa444
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/normal.vim
@@ -0,0 +1,34 @@
+" normal.vim
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2008-10-06.
+" @Last Change: 2010-09-22.
+" @Revision: 28
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+" :display: tlib#normal#WithRegister(cmd, ?register='t', ?norm_cmd='norm!')
+" Execute a normal command while maintaining all registers.
+function! tlib#normal#WithRegister(cmd, ...) "{{{3
+ TVarArg ['register', 't'], ['norm_cmd', 'norm!']
+ let registers = {}
+ for reg in split('123456789'. register, '\zs')
+ exec 'let registers[reg] = @'. reg
+ endfor
+ exec 'let reg = @'. register
+ try
+ exec norm_cmd .' '. a:cmd
+ exec 'return @'. register
+ finally
+ for [reg, value] in items(registers)
+ exec 'let @'. reg .' = value'
+ endfor
+ endtry
+endf
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/autoload/tlib/notify.vim b/vim/bundle/tlib_vim/autoload/tlib/notify.vim
new file mode 100755
index 0000000..541dbd0
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/notify.vim
@@ -0,0 +1,113 @@
+" notify.vim
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2008-09-19.
+" @Last Change: 2016-06-28.
+" @Revision: 2.3.19
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+" :display: tlib#notify#Echo(text, ?style='')
+" Print text in the echo area. Temporarily disable 'ruler' and 'showcmd'
+" in order to prevent |press-enter| messages.
+function! tlib#notify#Echo(text, ...)
+ TVarArg 'style'
+ let ruler = &ruler
+ let showcmd = &showcmd
+ let text = substitute(a:text, '\n', '|', 'g')
+ try
+ set noruler
+ set noshowcmd
+ if !empty(style)
+ exec 'echohl' style
+ endif
+ echo strpart(text, 0, &columns - 1)
+ finally
+ if !empty(style)
+ echohl None
+ endif
+ let &ruler = ruler
+ let &showcmd = showcmd
+ endtry
+endf
+
+
+" Contributed by Erik Falor:
+" If the line containing the message is too long, echoing it will cause
+" a 'Hit ENTER' prompt to appear. This function cleans up the line so
+" that does not happen.
+" The echoed line is too long if it is wider than the width of the
+" window, minus cmdline space taken up by the ruler and showcmd
+" features.
+function! tlib#notify#TrimMessage(message) "{{{3
+ let filler = '...'
+
+ " If length of message with tabs converted into spaces + length of
+ " line number + 2 (for the ': ' that follows the line number) is
+ " greater than the width of the screen, truncate in the middle
+ let to_fill = &columns
+ " TLogVAR to_fill
+
+ " Account for space used by elements in the command-line to avoid
+ " 'Hit ENTER' prompts.
+ " If showcmd is on, it will take up 12 columns.
+ " If the ruler is enabled, but not displayed in the statusline, it
+ " will in its default form take 17 columns. If the user defines a
+ " custom &rulerformat, they will need to specify how wide it is.
+ if has('cmdline_info')
+ if &showcmd
+ let to_fill -= 12
+ else
+ let to_fill -= 1
+ endif
+ " TLogVAR &showcmd, to_fill
+
+ " TLogVAR &laststatus, &ruler, &rulerformat
+ if &ruler
+ if &laststatus == 0 || winnr('$') == 1
+ if has('statusline')
+ if &rulerformat == ''
+ " default ruler is 17 chars wide
+ let to_fill -= 17
+ elseif exists('g:MP_rulerwidth')
+ let to_fill -= g:MP_rulerwidth
+ else
+ " tml: fallback: guess length
+ let to_fill -= strlen(&rulerformat)
+ endif
+ else
+ endif
+ endif
+ else
+ endif
+ else
+ let to_fill -= 1
+ endif
+
+ " TLogVAR to_fill
+ " TLogDBG strlen(a:message)
+ if strlen(a:message) > to_fill
+ let front = to_fill / 2 - 1
+ let back = front
+ if to_fill % 2 == 0 | let back -= 1 | endif
+ return strpart(a:message, 0, front) . filler .
+ \strpart(a:message, strlen(a:message) - back)
+ else
+ return a:message
+ endif
+endfunction
+
+
+function! tlib#notify#PrintError() abort "{{{3
+ echohl ErrorMsg
+ echom v:exception
+ echom v:throwpoint
+ echohl NONE
+endf
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/autoload/tlib/number.vim b/vim/bundle/tlib_vim/autoload/tlib/number.vim
new file mode 100644
index 0000000..94fde02
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/number.vim
@@ -0,0 +1,30 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 14
+
+
+function! tlib#number#ConvertBase(num, base, ...) "{{{3
+ let rtype = a:0 >= 1 ? a:1 : 'string'
+ " TLogVAR a:num, a:base, rtype
+ let rv = []
+ let num = 0.0 + a:num
+ while floor(num) > 0.0
+ let div = floor(num / a:base)
+ let num1 = float2nr(num - a:base * div)
+ if a:base <= 10
+ call insert(rv, num1)
+ elseif a:base == 16
+ let char = "0123456789ABCDEF"[num1]
+ call insert(rv, char)
+ endif
+ let num = num / a:base
+ endwh
+ " TLogVAR rv
+ if rtype == 'list'
+ return rv
+ else
+ return join(rv, '')
+ endif
+endf
+
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/paragraph.vim b/vim/bundle/tlib_vim/autoload/tlib/paragraph.vim
new file mode 100755
index 0000000..dd0d112
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/paragraph.vim
@@ -0,0 +1,97 @@
+" paragraph.vim
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2009-10-26.
+" @Last Change: 2011-04-03.
+" @Revision: 62
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+" Return an object describing a |paragraph|.
+function! tlib#paragraph#GetMetric() "{{{3
+ let sp = {'text_start': line("'{") + 1}
+ if line("'}") == line("$")
+ let sp.last = 1
+ let sp.text_end = line("'}")
+ if line("'{") == 1
+ let sp.ws_start = 0
+ let sp.ws_end = 0
+ let sp.top = sp.text_start
+ let sp.bottom = sp.text_end
+ else
+ let sp.ws_start = prevnonblank(line("'{")) + 1
+ let sp.ws_end = line("'{")
+ let sp.top = sp.ws_start
+ let sp.bottom = sp.text_end
+ endif
+ else
+ let sp.last = 0
+ let sp.text_end = line("'}") - 1
+ let sp.ws_start = line("'}")
+ for i in range(line("'}"), line('$'))
+ if getline(i) =~ '\w'
+ let sp.ws_end = i - 1
+ break
+ elseif i == line("$")
+ let sp.ws_end = i
+ endif
+ endfor
+ let sp.top = sp.text_start
+ let sp.bottom = sp.ws_end
+ endif
+ return sp
+endf
+
+
+" This function can be used with the tinymode plugin to move around
+" paragraphs.
+"
+" Example configuration: >
+"
+" call tinymode#EnterMap("para_move", "gp")
+" call tinymode#ModeMsg("para_move", "Move paragraph: j/k")
+" call tinymode#Map("para_move", "j", "silent call tlib#paragraph#Move('Down', '[N]')")
+" call tinymode#Map("para_move", "k", "silent call tlib#paragraph#Move('Up', '[N]')")
+" call tinymode#ModeArg("para_move", "owncount", 1)
+function! tlib#paragraph#Move(direction, count)
+ " TLogVAR a:direction, a:count
+ let mycount = empty(a:count) ? 1 : a:count
+ for i in range(1, mycount)
+ let para = tlib#paragraph#GetMetric()
+ " TLogVAR para
+ let text = getline(para.text_start, para.text_end)
+ let ws = getline(para.ws_start, para.ws_end)
+ " TLogVAR text, ws
+ exec para.top .','. para.bottom .'delete'
+ if a:direction == "Down"
+ let other = tlib#paragraph#GetMetric()
+ let target = other.bottom + 1
+ if other.last
+ let lines = ws + text
+ let pos = target + len(ws)
+ else
+ let lines = text + ws
+ let pos = target
+ endif
+ elseif a:direction == "Up"
+ if !para.last
+ norm! {
+ endif
+ let other = tlib#paragraph#GetMetric()
+ let target = other.text_start
+ let lines = text + ws
+ let pos = target
+ endif
+ " TLogVAR other, target
+ " TLogVAR lines
+ call append(target - 1, lines)
+ exec pos
+ endfor
+endf
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/autoload/tlib/persistent.vim b/vim/bundle/tlib_vim/autoload/tlib/persistent.vim
new file mode 100644
index 0000000..de3d487
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/persistent.vim
@@ -0,0 +1,47 @@
+" persistent.vim -- Persistent data
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2012-05-11.
+" @Last Change: 2012-05-11.
+" @Revision: 12
+
+" The directory for persistent data files. If empty, use
+" |tlib#dir#MyRuntime|.'/share'.
+TLet g:tlib_persistent = ''
+
+
+" :display: tlib#persistent#Dir(?mode = 'bg')
+" Return the full directory name for persistent data files.
+function! tlib#persistent#Dir() "{{{3
+ TVarArg ['mode', 'bg']
+ let dir = tlib#var#Get('tlib_persistent', mode)
+ if empty(dir)
+ let dir = tlib#file#Join([tlib#dir#MyRuntime(), 'share'])
+ endif
+ return dir
+endf
+
+" :def: function! tlib#persistent#Filename(type, ?file=%, ?mkdir=0)
+function! tlib#persistent#Filename(type, ...) "{{{3
+ " TLogDBG 'bufname='. bufname('.')
+ let file = a:0 >= 1 ? a:1 : ''
+ let mkdir = a:0 >= 2 ? a:2 : 0
+ return tlib#cache#Filename(a:type, file, mkdir, tlib#persistent#Dir())
+endf
+
+function! tlib#persistent#Get(...) "{{{3
+ return call('tlib#cache#Get', a:000)
+endf
+
+function! tlib#persistent#MTime(cfile) "{{{3
+ return tlib#cache#MTime(a:cfile)
+endf
+
+function! tlib#persistent#Value(...) "{{{3
+ return call('tlib#cache#Value', a:000)
+endf
+
+function! tlib#persistent#Save(cfile, dictionary) "{{{3
+ call tlib#cache#Save(a:cfile, a:dictionary)
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/progressbar.vim b/vim/bundle/tlib_vim/autoload/tlib/progressbar.vim
new file mode 100755
index 0000000..e739eb3
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/progressbar.vim
@@ -0,0 +1,72 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 72
+
+let s:statusline = []
+let s:laststatus = []
+let s:max = []
+let s:format = []
+let s:width = []
+let s:value = []
+let s:timestamp = -1
+
+" EXAMPLE: >
+" call tlib#progressbar#Init(20)
+" try
+" for i in range(20)
+" call tlib#progressbar#Display(i)
+" call DoSomethingThatTakesSomeTime(i)
+" endfor
+" finally
+" call tlib#progressbar#Restore()
+" endtry
+function! tlib#progressbar#Init(max, ...) "{{{3
+ TVarArg ['format', '%s'], ['width', 10]
+ call insert(s:statusline, &statusline)
+ call insert(s:laststatus, &laststatus)
+ call insert(s:max, a:max)
+ call insert(s:format, format)
+ call insert(s:width, width)
+ call insert(s:value, -1)
+ let &laststatus = 2
+ let s:timestamp = localtime()
+endf
+
+
+function! tlib#progressbar#Display(value, ...) "{{{3
+ TVarArg 'extra', ['always', 0]
+ let ts = localtime()
+ if !always && ts == s:timestamp
+ return
+ else
+ let s:timestamp = ts
+ endif
+ let val = a:value * s:width[0] / s:max[0]
+ if always || val != s:value[0]
+ let s:value[0] = val
+ let pbl = repeat('#', val)
+ let pbr = repeat('.', s:width[0] - val)
+ let txt = printf(s:format[0], '['.pbl.pbr.']') . extra
+ let &l:statusline = txt
+ " TLogDBG txt
+ redrawstatus
+ " redraw
+ " call tlib#notify#Echo(txt)
+ endif
+endf
+
+
+function! tlib#progressbar#Restore() "{{{3
+ let &l:statusline = remove(s:statusline, 0)
+ let &laststatus = remove(s:laststatus, 0)
+ redrawstatus
+ " redraw
+ " echo
+ call remove(s:max, 0)
+ call remove(s:format, 0)
+ call remove(s:width, 0)
+ call remove(s:value, 0)
+endf
+
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/qfl.vim b/vim/bundle/tlib_vim/autoload/tlib/qfl.vim
new file mode 100644
index 0000000..148620a
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/qfl.vim
@@ -0,0 +1,312 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: https://github.com/tomtom
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2015-12-06
+" @Revision: 60
+
+" :nodoc:
+TLet g:tlib#qfl#world = {
+ \ 'type': 'mi',
+ \ 'query': 'Select entry',
+ \ 'pick_last_item': 0,
+ \ 'resize_vertical': 0,
+ \ 'resize': 20,
+ \ 'scratch': '__TLibQFL__',
+ \ 'tlib_UseInputListScratch': 'call tlib#qfl#InitListBuffer(world)',
+ \ 'key_handlers': [
+ \ {'key': 5, 'agent': 'tlib#qfl#AgentWithSelected', 'key_name': '<c-e>', 'help': 'Run a command on selected lines'},
+ \ {'key': 16, 'agent': 'tlib#qfl#AgentPreviewQFE', 'key_name': '<c-p>', 'help': 'Preview'},
+ \ {'key': 60, 'agent': 'tlib#qfl#AgentGotoQFE', 'key_name': '<', 'help': 'Jump (don''t close the list)'},
+ \ {'key': 19, 'agent': 'tlib#qfl#AgentSplitBuffer', 'key_name': '<c-s>', 'help': 'Show in split buffer'},
+ \ {'key': 20, 'agent': 'tlib#qfl#AgentTabBuffer', 'key_name': '<c-t>', 'help': 'Show in tab'},
+ \ {'key': 22, 'agent': 'tlib#qfl#AgentVSplitBuffer', 'key_name': '<c-v>', 'help': 'Show in vsplit buffer'},
+ \ {'key': 12, 'agent': 'tlib#qfl#AgentEditLine', 'key_name': '<c-l>', 'help': 'Edit selected line(s)'},
+ \ {'key': "\<c-insert>", 'agent': 'tlib#qfl#SetFollowCursor', 'key_name': '<c-ins>', 'help': 'Toggle trace cursor'},
+ \ ],
+ \ 'return_agent': 'tlib#qfl#AgentEditQFE',
+ \ }
+
+
+function! tlib#qfl#FormatQFLE(qfe) dict abort "{{{3
+ let filename = tlib#qfl#QfeFilename(a:qfe)
+ if get(self, 'qfl_short_filename', '')
+ let filename = pathshorten(filename)
+ endif
+ return printf("%s|%d| %s", filename, a:qfe.lnum, get(a:qfe, "text"))
+endf
+
+
+function! tlib#qfl#QfeFilename(qfe) abort "{{{3
+ let filename = get(a:qfe, 'filename')
+ if empty(filename)
+ let filename = bufname(get(a:qfe, 'bufnr'))
+ endif
+ return filename
+endf
+
+
+function! tlib#qfl#InitListBuffer(world) "{{{3
+ let set_syntax = get(a:world, 'set_syntax', 'tlib#qfl#SetSyntax')
+ call call(set_syntax, [], a:world)
+ if has('balloon_eval')
+ setlocal ballooneval balloonexpr=tlib#qfl#Balloon()
+ endif
+endf
+
+
+function! tlib#qfl#SetSyntax() dict abort "{{{3
+ let syntax = get(self, 'qfl_list_syntax', '')
+ let nextgroup = get(self, 'qfl_list_syntax_nextgroup', '')
+ " TLogVAR syntax, nextgroup
+ if !empty(syntax)
+ exec printf('runtime syntax/%s.vim', syntax)
+ endif
+ syn match TTagedFilesFilename /\%(\f\+\| \)\+\ze|\d\+| / nextgroup=TTagedFilesLNum
+ if !empty(nextgroup)
+ exec 'syn match TTagedFilesLNum /|\d\+|\s\+/ nextgroup='. nextgroup
+ else
+ syn match TTagedFilesLNum /|\d\+|/
+ endif
+ hi def link TTagedFilesFilename Directory
+ hi def link TTagedFilesLNum LineNr
+endf
+
+
+function! tlib#qfl#Balloon() "{{{3
+ let world = getbufvar(v:beval_bufnr, 'tlibDisplayListWorld')
+ let current = max([1, world.offset]) + v:beval_lnum - 1
+ if current > len(world.table)
+ let current = len(world.table)
+ endif
+ let baseidx = world.GetBaseIdx0(current)
+ " TLogVAR world.offset, v:beval_lnum, current, baseidx
+ let item = world.data[baseidx]
+ let bufnr = get(item, 'bufnr', 0)
+ let bufname = get(item, 'filename', '')
+ if bufnr == 0 && !empty(bufname)
+ let bufnr = bufnr(bufname)
+ endif
+ if empty(bufname) && bufnr > 0
+ let bufname = bufname(bufnr)
+ endif
+ " TLogVAR item
+ if bufnr == 0
+ return ''
+ else
+ let lines = [printf("%d#%d: %s", bufnr, item.lnum, bufname)]
+ if has('balloon_multiline')
+ let desc = {'nr': 'Error number', 'type': 'Error type', 'text': ''}
+ for key in ['nr', 'type', 'text']
+ if has_key(item, key) && !empty(item[key])
+ let keydesc = get(desc, key, key)
+ if empty(keydesc)
+ let text = item[key]
+ else
+ let text = printf("%s: %s", key, item[key])
+ endif
+ call add(lines, text)
+ endif
+ endfor
+ endif
+ return join(lines, "\n")
+ endif
+ " v:beval_bufnr number of the buffer in which balloon is going to show
+ " v:beval_winnr number of the window
+ " v:beval_lnum line number
+ " v:beval_col column number (byte index)
+ " v:beval_text word under or after the mouse pointer
+endf
+
+
+function! tlib#qfl#AgentEditQFE(world, selected, ...) "{{{3
+ TVarArg ['cmd_edit', ''], ['cmd_buffer', '']
+ " TVarArg ['cmd_edit', 'edit'], ['cmd_buffer', 'buffer']
+ " TLogVAR a:selected
+ if empty(a:selected)
+ call a:world.RestoreOrigin()
+ " call a:world.ResetSelected()
+ else
+ call a:world.RestoreOrigin()
+ for idx in a:selected
+ let idx -= 1
+ " TLogVAR idx
+ if idx >= 0
+ " TLogVAR a:world.data
+ " call tlog#Debug(string(map(copy(a:world.data), 'v:val.bufnr')))
+ " TLogVAR idx, a:world.data[idx]
+ let qfe = a:world.data[idx]
+ " let back = a:world.SwitchWindow('win')
+ " TLogVAR cmd_edit, cmd_buffer, qfe
+ let fn = tlib#qfl#QfeFilename(qfe)
+ " TLogVAR cmd_edit, cmd_buffer, fn
+ if empty(cmd_edit) && empty(cmd_buffer)
+ if tlib#file#Edit(fn)
+ call tlib#buffer#ViewLine(qfe.lnum)
+ endif
+ else
+ call tlib#file#With(cmd_edit, cmd_buffer, [fn], a:world)
+ " TLogDBG bufname('%')
+ " TLogVAR &filetype
+ call tlib#buffer#ViewLine(qfe.lnum)
+ " call a:world.SetOrigin()
+ " exec back
+ endif
+ endif
+ endfor
+ endif
+ return a:world
+endf
+
+
+function! tlib#qfl#AgentPreviewQFE(world, selected) "{{{3
+ " TLogVAR a:selected
+ let back = a:world.SwitchWindow('win')
+ call tlib#qfl#AgentEditQFE(a:world, a:selected[0:0])
+ exec back
+ redraw
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+function! tlib#qfl#AgentGotoQFE(world, selected) "{{{3
+ let world = a:world
+ if !empty(a:selected)
+ let world = tlib#agent#Suspend(world, a:selected)
+ call tlib#qfl#AgentEditQFE(world, a:selected[0:0])
+ endif
+ return world
+endf
+
+
+function! tlib#qfl#AgentWithSelected(world, selected, ...) "{{{3
+ let cmd = a:0 >= 1 ? a:1 : input('Ex command: ', '', 'command')
+ let world = a:world
+ if !empty(cmd)
+ let world = tlib#qfl#RunCmdOnSelected(world, a:selected, cmd)
+ else
+ let world.state = 'redisplay'
+ endif
+ return world
+endf
+
+
+function! tlib#qfl#RunCmdOnSelected(world, selected, cmd, ...) "{{{3
+ let close_scratch = a:0 >= 1 ? a:1 : 1
+ if close_scratch
+ call a:world.CloseScratch()
+ endif
+ " TLogVAR a:cmd
+ for entry in a:selected
+ " TLogVAR entry, a:world.GetBaseItem(entry)
+ call tlib#qfl#AgentEditQFE(a:world, [entry])
+ " TLogDBG bufname('%')
+ exec a:cmd
+ " let item = a:world.data[a:world.GetBaseIdx(entry - 1)]
+ " <+TODO+>
+ let item = a:world.data[entry - 1]
+ " TLogVAR entry, item, getline('.')
+ if has_key(a:world, 'GetBufferLines')
+ let lines = a:world.GetBufferLines('.', '.')
+ else
+ let lines = getline('.', '.')
+ endif
+ let item['text'] = tlib#string#Strip(lines[0])
+ endfor
+ if has_key(a:world, 'AfterRunCmd')
+ if bufnr('%') == a:world.bufnr
+ call a:world.AfterRunCmd()
+ else
+ " <+TODO+> Run in other buffer
+ endif
+ endif
+ " call s:FormatBase(a:world)
+ call a:world.RestoreOrigin()
+ let a:world.state = 'reset'
+ return a:world
+endf
+
+
+function! tlib#qfl#AgentSplitBuffer(world, selected) "{{{3
+ call a:world.CloseScratch()
+ return tlib#qfl#AgentEditQFE(a:world, a:selected, 'split', 'sbuffer')
+endf
+
+
+function! tlib#qfl#AgentTabBuffer(world, selected) "{{{3
+ call a:world.CloseScratch()
+ return tlib#qfl#AgentEditQFE(a:world, a:selected, 'tabedit', 'tab sbuffer')
+endf
+
+
+function! tlib#qfl#AgentVSplitBuffer(world, selected) "{{{3
+ call a:world.CloseScratch()
+ return tlib#qfl#AgentEditQFE(a:world, a:selected, 'vertical split', 'vertical sbuffer')
+endf
+
+
+" function! tlib#qfl#AgentOpenBuffer(world, selected) "{{{3
+" endf
+
+
+function! tlib#qfl#AgentEditLine(world, selected) "{{{3
+ call a:world.CloseScratch()
+ let cmd = 'call tlib#qfl#EditLine(".")'
+ return tlib#qfl#RunCmdOnSelected(a:world, a:selected, cmd)
+ let a:world.state = 'reset'
+ return a:world
+endf
+
+
+function! tlib#qfl#EditLine(lnum) "{{{3
+ call inputsave()
+ let line = input('', getline(a:lnum))
+ call inputrestore()
+ if !empty(line)
+ call setline(line(a:lnum), line)
+ endif
+endf
+
+
+function! tlib#qfl#SetFollowCursor(world, selected) "{{{3
+ if empty(a:world.follow_cursor)
+ let a:world.follow_cursor = 'tlib#qfl#AgentPreviewQFE'
+ else
+ let a:world.follow_cursor = ''
+ endif
+ let a:world.state = 'redisplay'
+ return a:world
+endf
+
+
+function! tlib#qfl#QflList(list, ...) abort "{{{3
+ TVarArg ['world_dict', {}], ['anyway', 0], ['suspended', 0]
+ Tlibtrace 'tlib', world_dict, anyway, suspended
+ " TLogVAR a:list, world_dict, anyway, suspended
+ if !anyway && empty(a:list)
+ return
+ endif
+ let world = copy(g:tlib#qfl#world)
+ if !empty(world_dict)
+ let world = tlib#eval#Extend(world, world_dict)
+ endif
+ " TLogVAR world
+ let world = tlib#World#New(world)
+ " echom "DBG world" string(sort(keys(world)))
+ let world.data = copy(a:list)
+ if !has_key(world, 'format_data')
+ let world.format_data = 'tlib#qfl#FormatQFLE'
+ endif
+ " TLogVAR world
+ " TLogVAR world.data
+ " call s:FormatBase(world)
+ " TLogVAR world.base
+ return tlib#input#ListW(world, suspended ? 'hibernate' : '')
+endf
+
+
+function! tlib#qfl#Browse(...) abort "{{{3
+ let list = getqflist()
+ return call(function('tlib#qfl#QflList'), [list] + a:000)
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/rx.vim b/vim/bundle/tlib_vim/autoload/tlib/rx.vim
new file mode 100644
index 0000000..8389983
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/rx.vim
@@ -0,0 +1,60 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 113
+
+
+" :def: function! tlib#rx#Escape(text, ?magic='m')
+" magic can be one of: m, M, v, V
+" See :help 'magic'
+function! tlib#rx#Escape(text, ...) "{{{3
+ TVarArg 'magic'
+ if empty(magic)
+ let magic = 'm'
+ endif
+ if magic =~# '^\\\?m$'
+ return escape(a:text, '^$.*\[]~')
+ elseif magic =~# '^\\\?M$'
+ return escape(a:text, '^$\')
+ elseif magic =~# '^\\\?V$'
+ return escape(a:text, '\')
+ elseif magic =~# '^\\\?v$'
+ return substitute(a:text, '[^0-9a-zA-Z_]', '\\&', 'g')
+ else
+ echoerr 'tlib: Unsupported magic type'
+ return a:text
+ endif
+endf
+
+" :def: function! tlib#rx#EscapeReplace(text, ?magic='m')
+" Escape return |sub-replace-special|.
+function! tlib#rx#EscapeReplace(text, ...) "{{{3
+ TVarArg ['magic', 'm']
+ if magic ==# 'm' || magic ==# 'v'
+ return escape(a:text, '\&~')
+ elseif magic ==# 'M' || magic ==# 'V'
+ return escape(a:text, '\')
+ else
+ echoerr 'magic must be one of: m, v, M, V'
+ endif
+endf
+
+
+function! tlib#rx#Suffixes(...) "{{{3
+ TVarArg ['magic', 'm']
+ let sfx = split(&suffixes, ',')
+ call map(sfx, 'tlib#rx#Escape(v:val, magic)')
+ if magic ==# 'v'
+ return '('. join(sfx, '|') .')$'
+ elseif magic ==# 'V'
+ return '\('. join(sfx, '\|') .'\)\$'
+ else
+ return '\('. join(sfx, '\|') .'\)$'
+ endif
+endf
+
+
+function! tlib#rx#LooksLikeRegexp(text) abort "{{{3
+ return a:text =~ '[.?*+{}\[\]]'
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/scratch.vim b/vim/bundle/tlib_vim/autoload/tlib/scratch.vim
new file mode 100755
index 0000000..c9df64d
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/scratch.vim
@@ -0,0 +1,136 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 255
+
+
+" Scratch window position. By default the list window is opened on the
+" bottom. Set this variable to 'topleft' or '' to change this behaviour.
+" See |tlib#input#List()|.
+TLet g:tlib_scratch_pos = 'botright'
+
+" If you want the scratch buffer to be fully removed, you might want to
+" set this variable to 'wipe'.
+" See also https://github.com/tomtom/tlib_vim/pull/16
+TLet g:tlib#scratch#hidden = 'hide'
+
+
+" :def: function! tlib#scratch#UseScratch(?keyargs={})
+" Display a scratch buffer (a buffer with no file). See :TScratch for an
+" example.
+" Return the scratch buffer's number.
+" Values for keyargs:
+" scratch_split ... 1: split, 0: window, -1: tab
+function! tlib#scratch#UseScratch(...) "{{{3
+ exec tlib#arg#Let([['keyargs', {}]])
+ " TLogDBG string(keys(keyargs))
+ let id = get(keyargs, 'scratch', '__Scratch__')
+ " TLogVAR id, bufwinnr(id)
+ " TLogVAR bufnr(id), bufname(id)
+ " TLogVAR 1, winnr(), bufnr('%'), bufname("%")
+ if bufwinnr(id) != -1
+ " echom 'DBG noautocmd keepalt keepj' bufwinnr(id) 'wincmd w'
+ exec 'noautocmd keepalt keepj' bufwinnr(id) 'wincmd w'
+ " TLogVAR "reuse", bufnr("%"), bufname("%")
+ else
+ let winpos = ''
+ let bn = bufnr(id)
+ let wpos = get(keyargs, 'scratch_pos', g:tlib_scratch_pos)
+ " TLogVAR keyargs.scratch_vertical
+ if get(keyargs, 'scratch_vertical')
+ let wpos .= ' vertical'
+ let winpos = tlib#fixes#Winpos()
+ endif
+ " TLogVAR wpos
+ let scratch_split = get(keyargs, 'scratch_split', 1)
+ if bn != -1
+ " TLogVAR bn
+ let wn = bufwinnr(bn)
+ if wn != -1
+ " TLogVAR wn
+ exec 'noautocmd keepalt keepj' (wn .'wincmd w')
+ else
+ if scratch_split == 1
+ let cmd = wpos.' sbuffer!'
+ elseif scratch_split == -1
+ let cmd = wpos.' tab sbuffer!'
+ else
+ let cmd = 'buffer!'
+ endif
+ " TLogVAR cmd, bn
+ silent exec 'noautocmd keepalt keepj' cmd bn
+ endif
+ else
+ " TLogVAR id
+ if scratch_split == 1
+ let cmd = wpos.' split'
+ elseif scratch_split == -1
+ let cmd = wpos.' tab split'
+ else
+ let cmd = 'edit'
+ endif
+ " TLogVAR cmd, id
+ silent exec 'noautocmd keepalt keepj' cmd escape(id, '%#\ ')
+ " silent exec 'split '. id
+ endif
+ let ft = get(keyargs, 'scratch_filetype', '')
+ " TLogVAR ft, winpos
+ if !empty(winpos)
+ exec winpos
+ endif
+ setlocal buftype=nofile
+ let &l:bufhidden = get(keyargs, 'scratch_hidden', g:tlib#scratch#hidden)
+ setlocal noswapfile
+ setlocal nobuflisted
+ setlocal foldmethod=manual
+ setlocal foldcolumn=0
+ setlocal nospell
+ setlocal modifiable
+ setlocal noreadonly
+ " TLogVAR &ft, ft
+ if !empty(ft)
+ let &l:ft = ft
+ endif
+ endif
+ let keyargs.scratch = bufnr('%')
+ let keyargs.scratch_tabpagenr = tabpagenr()
+ let keyargs.scratch_winnr = winnr()
+ " TLogVAR 2, winnr(), bufnr('%'), bufname("%"), keyargs.scratch
+ return keyargs.scratch
+endf
+
+
+" Close a scratch buffer as defined in keyargs (usually a World).
+" Return 1 if the scratch buffer is closed (or if it already was
+" closed).
+function! tlib#scratch#CloseScratch(keyargs, ...) "{{{3
+ TVarArg ['reset_scratch', 1]
+ let scratch = get(a:keyargs, 'scratch', '')
+ " TLogVAR scratch, reset_scratch
+ " TLogDBG string(tlib#win#List())
+ if !empty(scratch) && winnr('$') > 1
+ let wn = bufwinnr(scratch)
+ " TLogVAR wn
+ try
+ if wn != -1
+ " TLogDBG winnr()
+ let wb = tlib#win#Set(wn)
+ let winpos = tlib#fixes#Winpos()
+ wincmd c
+ if get(a:keyargs, 'scratch_vertical') && !empty(winpos)
+ exec winpos
+ endif
+ " exec wb
+ " redraw
+ " TLogVAR winnr()
+ endif
+ return 1
+ finally
+ if reset_scratch
+ let a:keyargs.scratch = ''
+ endif
+ endtry
+ endif
+ return 0
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/selection.vim b/vim/bundle/tlib_vim/autoload/tlib/selection.vim
new file mode 100644
index 0000000..4417157
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/selection.vim
@@ -0,0 +1,40 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2016-01-03
+" @Revision: 3
+
+
+" :display: tlib#selection#GetSelection(mode, ?mbeg="'<", ?mend="'>", ?opmode='selection')
+" mode can be one of: selection, lines, block
+function! tlib#selection#GetSelection(mode, ...) range "{{{3
+ if a:0 >= 2
+ let mbeg = a:1
+ let mend = a:2
+ else
+ let mbeg = "'<"
+ let mend = "'>"
+ endif
+ let opmode = a:0 >= 3 ? a:3 : 'selection'
+ let l0 = line(mbeg)
+ let l1 = line(mend)
+ let text = getline(l0, l1)
+ let c0 = col(mbeg)
+ let c1 = col(mend)
+ " TLogVAR mbeg, mend, opmode, l0, l1, c0, c1
+ " TLogVAR text[-1]
+ " TLogVAR len(text[-1])
+ if opmode == 'block'
+ let clen = c1 - c0
+ call map(text, 'strpart(v:val, c0, clen)')
+ elseif opmode == 'selection'
+ if c1 > 1
+ let text[-1] = strpart(text[-1], 0, c1 - (a:mode == 'o' || c1 > len(text[-1]) ? 0 : 1))
+ endif
+ if c0 > 1
+ let text[0] = strpart(text[0], c0 - 1)
+ endif
+ endif
+ return text
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/signs.vim b/vim/bundle/tlib_vim/autoload/tlib/signs.vim
new file mode 100755
index 0000000..1664680
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/signs.vim
@@ -0,0 +1,103 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2009-03-12.
+" @Last Change: 2011-03-10.
+" @Revision: 0.0.45
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+let s:base = 2327
+let s:register = {}
+
+
+" Clear all signs with name SIGN.
+function! tlib#signs#ClearAll(sign) "{{{3
+ " TLog a:sign
+ for bn in keys(s:register)
+ let idxs = keys(s:register)
+ call filter(idxs, 's:register[v:val].sign == a:sign')
+ " TLogVAR bns
+ for idx in idxs
+ exec 'sign unplace '. idx .' buffer='. s:register[idx].bn
+ call remove(s:register, idx)
+ endfor
+ endfor
+endf
+
+
+" Clear all signs with name SIGN in buffer BUFNR.
+function! tlib#signs#ClearBuffer(sign, bufnr) "{{{3
+ for bn in keys(s:register)
+ let idxs = keys(s:register)
+ call filter(idxs, 's:register[v:val].sign == a:sign && s:register[v:val].bn == a:bufnr')
+ " TLogVAR bns
+ for idx in idxs
+ exec 'sign unplace '. idx .' buffer='. s:register[idx].bn
+ call remove(s:register, idx)
+ endfor
+ endfor
+endf
+
+
+" function! tlib#signs#Clear(sign, list) "{{{3
+" " TLogVAR a:sign
+" let done = []
+" for item in a:list
+" let bn = get(item, 'bufnr', -1)
+" if index(done, bn) == -1
+" let idxs = keys(s:register)
+" call filter(idxs, 's:register[v:val].sign == a:sign && s:register[v:val].bn == bn')
+" for idx in idxs
+" exec 'sign unplace '. idx .' buffer='. s:register[idx].bn
+" call remove(s:register, idx)
+" endfor
+" call add(done, bn)
+" endif
+" endfor
+" endf
+
+
+" Add signs for all locations in LIST. LIST must adhere with the
+" quickfix list format (see |getqflist()|; only the fields lnum and
+" bufnr are required).
+"
+" list:: a quickfix or location list
+" sign:: a sign defined with |:sign-define|
+function! tlib#signs#Mark(sign, list) "{{{3
+ " TLogVAR a:sign
+ for item in a:list
+ let idx = s:SignId(item)
+ if idx >= 0
+ let lnum = get(item, 'lnum', 0)
+ if lnum > 0
+ let bn = get(item, 'bufnr')
+ exec ':sign place '. idx .' line='. lnum .' name='. a:sign .' buffer='. bn
+ let s:register[idx] = {'sign': a:sign, 'bn': bn}
+ endif
+ endif
+ endfor
+endf
+
+
+function! s:SignId(item) "{{{3
+ " TLogVAR a:item
+ " let bn = bufnr('%')
+ let bn = get(a:item, 'bufnr', -1)
+ if bn == -1
+ return -1
+ else
+ let idx = s:base + bn * 500
+ while has_key(s:register, idx)
+ let idx += 1
+ endwh
+ return idx
+ endif
+endf
+
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/autoload/tlib/string.vim b/vim/bundle/tlib_vim/autoload/tlib/string.vim
new file mode 100755
index 0000000..26b1f32
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/string.vim
@@ -0,0 +1,172 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 126
+
+
+" :def: function! tlib#string#RemoveBackslashes(text, ?chars=' ')
+" Remove backslashes from text (but only in front of the characters in
+" chars).
+function! tlib#string#RemoveBackslashes(text, ...) "{{{3
+ exec tlib#arg#Get(1, 'chars', ' ')
+ " TLogVAR chars
+ let rv = substitute(a:text, '\\\(['. chars .']\)', '\1', 'g')
+ return rv
+endf
+
+
+" :display: tlib#string#Chomp(string, ?max=0)
+function! tlib#string#Chomp(string, ...) "{{{3
+ let quant = a:0 >= 1 ? '\{,'. a:1 .'}' : '\+'
+ return substitute(a:string, '[[:cntrl:][:space:]]'. quant .'$', '', '')
+endf
+
+
+" Format a template string. Placeholders have the format "%{NAME}". A
+" "%" can be inserted as "%%".
+"
+" Examples:
+" echo tlib#string#Format("foo %{bar} foo", {'bar': 123})
+" => foo 123 foo
+function! tlib#string#Format(template, dict) "{{{3
+ let parts = split(a:template, '\ze%\({.\{-}}\|.\)')
+ let out = []
+ for part in parts
+ let ml = matchlist(part, '^%\({\(.\{-}\)}\|\(.\)\)\(.*\)$')
+ if empty(ml)
+ let rest = part
+ else
+ let var = empty(ml[2]) ? ml[3] : ml[2]
+ let rest = ml[4]
+ if has_key(a:dict, var)
+ call add(out, a:dict[var])
+ elseif var == '%%'
+ call add(out, '%')
+ else
+ call add(out, ml[1])
+ endif
+ endif
+ call add(out, rest)
+ endfor
+ return join(out, '')
+endf
+
+
+" This function deviates from |printf()| in certain ways.
+" Additional items:
+" %{rx} ... insert escaped regexp
+" %{fuzzyrx} ... insert typo-tolerant regexp
+function! tlib#string#Printf1(format, string) "{{{3
+ let s = split(a:format, '%.\zs')
+ " TLogVAR s
+ return join(map(s, 's:PrintFormat(v:val, a:string)'), '')
+endf
+
+function! s:PrintFormat(format, string) "{{{3
+ let cut = match(a:format, '%\({.\{-}}\|.\)$')
+ if cut == -1
+ return a:format
+ else
+ let head = cut > 0 ? a:format[0 : cut - 1] : ''
+ let tail = a:format[cut : -1]
+ " TLogVAR head, tail
+ if tail == '%{fuzzyrx}'
+ let frx = []
+ for i in range(len(a:string))
+ if i > 0
+ let pb = i - 1
+ else
+ let pb = 0
+ endif
+ let slice = tlib#rx#Escape(a:string[pb : i + 1])
+ call add(frx, '['. slice .']')
+ call add(frx, '.\?')
+ endfor
+ let tail = join(frx, '')
+ elseif tail == '%{rx}'
+ let tail = tlib#rx#Escape(a:string)
+ elseif tail == '%%'
+ let tail = '%'
+ elseif tail == '%s'
+ let tail = a:string
+ endif
+ " TLogVAR tail
+ return head . tail
+ endif
+endf
+" function! tlib#string#Printf1(format, string) "{{{3
+" let n = len(split(a:format, '%\@<!%s', 1)) - 1
+" let f = a:format
+" if f =~ '%\@<!%{fuzzyrx}'
+" let frx = []
+" for i in range(len(a:string))
+" if i > 0
+" let pb = i - 1
+" else
+" let pb = 0
+" endif
+" let slice = tlib#rx#Escape(a:string[pb : i + 1])
+" call add(frx, '['. slice .']')
+" call add(frx, '.\?')
+" endfor
+" let f = s:RewriteFormatString(f, '%{fuzzyrx}', join(frx, ''))
+" endif
+" if f =~ '%\@<!%{rx}'
+" let f = s:RewriteFormatString(f, '%{rx}', tlib#rx#Escape(a:string))
+" endif
+" if n == 0
+" return substitute(f, '%%', '%', 'g')
+" else
+" let a = repeat([a:string], n)
+" return call('printf', insert(a, f))
+" endif
+" endf
+
+
+function! s:RewriteFormatString(format, pattern, string) "{{{3
+ let string = substitute(a:string, '%', '%%', 'g')
+ return substitute(a:format, tlib#rx#Escape(a:pattern), escape(string, '\'), 'g')
+endf
+
+
+function! tlib#string#TrimLeft(string) "{{{3
+ return substitute(a:string, '^[[:space:][:cntrl:]]\+', '', '')
+endf
+
+
+function! tlib#string#TrimRight(string) "{{{3
+ return substitute(a:string, '[[:space:][:cntrl:]]\+$', '', '')
+endf
+
+
+function! tlib#string#Strip(string) "{{{3
+ return tlib#string#TrimRight(tlib#string#TrimLeft(a:string))
+endf
+
+
+function! tlib#string#Count(string, rx) "{{{3
+ let s:count = 0
+ call substitute(a:string, a:rx, '\=s:CountHelper()', 'g')
+ return s:count
+endf
+
+function! s:CountHelper() "{{{3
+ let s:count += 1
+endf
+
+
+function! tlib#string#SplitCommaList(text, ...) abort "{{{3
+ let sep = a:0 >= 1 ? a:1 : ',\s*'
+ let parts = split(a:text, '\\\@<!\zs'. sep)
+ let parts = map(parts, 'substitute(v:val, ''\\\(.\)'', ''\1'', ''g'')')
+ return parts
+endf
+
+
+function! tlib#string#Input(...) abort "{{{3
+ TVarArg ['text', ''], ['completion', '']
+ call inputsave()
+ let rv = call(function('input'), a:000)
+ call inputrestore()
+ return rv
+endf
diff --git a/vim/bundle/tlib_vim/autoload/tlib/syntax.vim b/vim/bundle/tlib_vim/autoload/tlib/syntax.vim
new file mode 100755
index 0000000..aa30b66
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/syntax.vim
@@ -0,0 +1,38 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 13
+
+
+function! tlib#syntax#Collect() "{{{3
+ let acc = {}
+ let syn = ''
+ for line in tlib#cmd#OutputAsList('syntax')
+ if line =~ '^---'
+ continue
+ elseif line =~ '^\w'
+ let ml = matchlist(line, '^\(\w\+\)\s\+\(xxx\s\+\(.*\)\|\(cluster.*\)\)$')
+ if empty(ml)
+ " echoerr 'Internal error: '. string(line)
+ else
+ let [m_0, syn, m_1, m_def1, m_def2; m_rest] = ml
+ let acc[syn] = [empty(m_def1) ? m_def2 : m_def1]
+ endif
+ else
+ call add(acc[syn], matchstr(line, '^\s\+\zs.*$'))
+ endif
+ endfor
+ return acc
+endf
+
+
+" :def: function! tlib#syntax#Names(?rx='')
+function! tlib#syntax#Names(...) "{{{3
+ TVarArg 'rx'
+ let names = keys(tlib#syntax#Collect())
+ if !empty(rx)
+ call filter(names, 'v:val =~ rx')
+ endif
+ return names
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/sys.vim b/vim/bundle/tlib_vim/autoload/tlib/sys.vim
new file mode 100644
index 0000000..0ed24f0
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/sys.vim
@@ -0,0 +1,212 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2015-12-12.
+" @Revision: 59
+
+
+if !exists('g:tlib#sys#special_protocols')
+ " A list of |regexp|s matching protocol names that should be handled
+ " by |g:tlib#sys#system_browser|.
+ " CAVEAT: Must be a |\V| |regexp|.
+ let g:tlib#sys#special_protocols = ['https\?', 'nntp', 'mailto'] "{{{2
+endif
+
+
+if !exists('g:tlib#sys#special_suffixes')
+ " A list of |regexp|s matching suffixes that should be handled by
+ " |g:tlib#sys#system_browser|.
+ " CAVEAT: Must be a |\V| |regexp|.
+ let g:tlib#sys#special_suffixes = ['xlsx\?', 'docx\?', 'pptx\?', 'accdb', 'mdb', 'sqlite', 'pdf', 'jpg', 'png', 'gif', 'od\[tspg]'] "{{{2
+endif
+
+
+if !exists('g:tlib#sys#system_rx')
+ " Open links matching this |regexp| with |g:tlib#sys#system_browser|.
+ " CAVEAT: Must be a |\V| |regexp|.
+ let g:tlib#sys#system_rx = printf('\V\%(\^\%(%s\):\|.\%(%s\)\$\)', join(g:tlib#sys#special_protocols, '\|'), join(g:tlib#sys#special_suffixes, '\|')) "{{{2
+endif
+
+
+if !exists("g:tlib#sys#system_browser")
+ if exists('g:netrw_browsex_viewer')
+ " Open files in the system browser.
+ " :read: let g:tlib#sys#system_browser = ... "{{{2
+ let g:tlib#sys#system_browser = "exec 'silent !'. g:netrw_browsex_viewer shellescape('%s')"
+ elseif has("win32") || has("win16") || has("win64")
+ " let g:tlib#sys#system_browser = "exec 'silent ! start \"\"' shellescape('%s')"
+ let g:tlib#sys#system_browser = "exec 'silent ! RunDll32.EXE URL.DLL,FileProtocolHandler' shellescape('%s')"
+ elseif has("mac")
+ let g:tlib#sys#system_browser = "exec 'silent !open' shellescape('%s')"
+ elseif exists('$XDG_CURRENT_DESKTOP') && !empty($XDG_CURRENT_DESKTOP)
+ let g:tlib#sys#system_browser = "exec 'silent !xdg-open' shellescape('%s') '&'"
+ elseif $GNOME_DESKTOP_SESSION_ID != "" || $DESKTOP_SESSION == 'gnome'
+ let g:tlib#sys#system_browser = "exec 'silent !gnome-open' shellescape('%s')"
+ elseif exists("$KDEDIR") && !empty($KDEDIR)
+ let g:tlib#sys#system_browser = "exec 'silent !kfmclient exec' shellescape('%s')"
+ else
+ let g:tlib#sys#system_browser = ''
+ endif
+endif
+
+
+if !exists('g:tlib#sys#windows')
+ let g:tlib#sys#windows = &shell !~ 'sh' && (has('win16') || has('win32') || has('win64')) "{{{2
+endif
+
+
+if !exists('g:tlib#sys#null')
+ let g:tlib#sys#null = g:tlib#sys#windows ? 'NUL' : (filereadable('/dev/null') ? '/dev/null' : '') "{{{2
+endif
+
+
+let s:cygwin = {}
+
+function! tlib#sys#IsCygwinBin(cmd) "{{{3
+ " TLogVAR a:cmd
+ if !g:tlib#sys#windows
+ return 0
+ elseif has_key(s:cygwin, a:cmd)
+ let rv = s:cygwin[a:cmd]
+ else
+ if !tlib#sys#IsExecutable('cygpath', 1) || !tlib#sys#IsExecutable('which', 1)
+ let rv = 0
+ else
+ let which = substitute(system('which '. shellescape(a:cmd)), '\n$', '', '')
+ " echom "DBG which:" which
+ if which =~ '^/'
+ let filename = system('cygpath -ma '. shellescape(which))
+ " echom "DBG filename:" filename
+ let rv = filename =~ g:tlib#sys#cygwin_path_rx
+ else
+ let rv = 0
+ endif
+ endif
+ let s:cygwin[a:cmd] = rv
+ endif
+ " TLogVAR rv
+ return rv
+endf
+
+
+let s:executables = {}
+
+function! tlib#sys#IsExecutable(cmd, ...) "{{{3
+ " TLogVAR a:cmd
+ " echom "DBG has_key(s:executables, a:cmd)" has_key(s:executables, a:cmd)
+ if !has_key(s:executables, a:cmd)
+ let executable = executable(a:cmd)
+ " TLogVAR 1, executable
+ let ignore_cyg = a:0 >= 1 ? a:1 : !g:tlib#sys#windows
+ if !executable && !ignore_cyg
+ let executable = tlib#sys#IsCygwinBin(a:cmd)
+ " TLogVAR 2, executable
+ endif
+ let s:executables[a:cmd] = executable
+ endif
+ " echom "DBG s:executables[a:cmd]" s:executables[a:cmd]
+ return s:executables[a:cmd]
+endf
+
+
+if !exists('g:tlib#sys#check_cygpath')
+ " If true, check whether we have to convert a path via cyppath --
+ " see |tlib#sys#MaybeUseCygpath|
+ let g:tlib#sys#check_cygpath = g:tlib#sys#windows && tlib#sys#IsExecutable('cygpath', 1) "{{{2
+endif
+
+
+if !exists('g:tlib#sys#cygwin_path_rx')
+ " If a full windows filename (with slashes instead of backslashes)
+ " matches this |regexp|, it is assumed to be a cygwin executable.
+ let g:tlib#sys#cygwin_path_rx = '/cygwin/' "{{{2
+endif
+
+
+if !exists('g:tlib#sys#cygwin_expr')
+ " For cygwin binaries, convert command calls using this vim
+ " expression.
+ let g:tlib#sys#cygwin_expr = '"bash -c ''". escape(%s, "''\\") ."''"' "{{{2
+endif
+
+
+function! tlib#sys#GetCmd(cmd) "{{{3
+ if !empty(g:tlib#sys#cygwin_expr) && tlib#sys#IsCygwinBin(matchstr(a:cmd, '^\S\+'))
+ let cmd = eval(printf(g:tlib#sys#cygwin_expr, string(a:cmd)))
+ " TLogVAR cmd
+ return cmd
+ else
+ return a:cmd
+ endif
+endf
+
+
+" If cmd seems to be a cygwin executable, use cygpath to convert
+" filenames. This assumes that cygwin's which command returns full
+" filenames for non-cygwin executables.
+function! tlib#sys#MaybeUseCygpath(cmd) "{{{3
+ " echom "DBG" a:cmd
+ if g:tlib#sys#check_cygpath && tlib#sys#IsCygwinBin(a:cmd)
+ return 'cygpath -u "%s"'
+ endif
+ return ''
+endf
+
+
+function! tlib#sys#ConvertPath(converter, filename) "{{{3
+ return tlib#string#Chomp(system(printf(a:converter, shellescape(a:filename))))
+endf
+
+
+let s:native_filenames = {}
+
+function! tlib#sys#FileArgs(cmd, files) "{{{3
+ let cygpath = tlib#sys#MaybeUseCygpath(a:cmd)
+ " TLogVAR cygpath
+ if empty(cygpath)
+ return a:files
+ else
+ let files = map(copy(a:files), 'has_key(s:native_filenames, v:val) ? s:native_filenames[v:val] : tlib#sys#CygPath(v:val)')
+ return files
+ endif
+endf
+
+
+" Check whether filename matches |g:tlib#sys#system_rx|, i.e. whether it
+" is a special file that should not be opened in vim.
+function! tlib#sys#IsSpecial(filename) abort "{{{3
+ return a:filename =~ g:tlib#sys#system_rx
+endf
+
+
+" Open filename with the default OS application (see
+" |g:tlib#sys#system_browser|), if |tlib#sys#IsSpecial()| return 1.
+" Returns 1 if successful or 0 otherwise.
+function! tlib#sys#Open(filename) abort "{{{3
+ Tlibtrace 'tlib', a:filename
+ if !empty(g:tlib#sys#system_browser) && tlib#sys#IsSpecial(a:filename)
+ try
+ let cmd = printf(g:tlib#sys#system_browser, a:filename)
+ " let cmd = printf(g:tlib#sys#system_browser, escape(a:filename, ' %#!'))
+ Tlibtrace 'tlib', cmd
+ exec cmd
+ return 1
+ catch
+ echohl ErrorMsg
+ echom v:exception
+ echohl NONE
+ endtry
+ endif
+ return 0
+endf
+
+
+" :def: function! tlib#sys#SystemInDir(dir, expr, ?input='')
+function! tlib#sys#SystemInDir(dir, ...) abort "{{{3
+ call tlib#dir#CD(a:dir)
+ try
+ return call(function('system'), a:000)
+ finally
+ silent cd! -
+ endtry
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/tab.vim b/vim/bundle/tlib_vim/autoload/tlib/tab.vim
new file mode 100755
index 0000000..fa6bb8d
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/tab.vim
@@ -0,0 +1,49 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 31
+
+
+" Return a dictionary of bufnumbers => [[tabpage, winnr] ...]
+function! tlib#tab#BufMap() "{{{3
+ let acc = {}
+ for t in range(tabpagenr('$'))
+ let bb = tabpagebuflist(t + 1)
+ for b in range(len(bb))
+ let bn = bb[b]
+ let bd = [t + 1, b + 1]
+ if has_key(acc, bn)
+ call add(acc[bn], bd)
+ else
+ let acc[bn] = [bd]
+ endif
+ endfor
+ endfor
+ return acc
+endf
+
+
+" Find a buffer's window at some tab page.
+function! tlib#tab#TabWinNr(buffer) "{{{3
+ let bn = bufnr(a:buffer)
+ let bt = tlib#tab#BufMap()
+ let tn = tabpagenr()
+ let wn = winnr()
+ let bc = get(bt, bn)
+ if !empty(bc)
+ for [t, w] in bc
+ if t == tn
+ return [t, w]
+ endif
+ endfor
+ return bc[0]
+ endif
+endf
+
+
+function! tlib#tab#Set(tabnr) "{{{3
+ if a:tabnr > 0
+ exec a:tabnr .'tabnext'
+ endif
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/tag.vim b/vim/bundle/tlib_vim/autoload/tlib/tag.vim
new file mode 100755
index 0000000..e4239d3
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/tag.vim
@@ -0,0 +1,132 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 59
+
+
+" Extra tags for |tlib#tag#Retrieve()| (see there). Can also be buffer-local.
+TLet g:tlib_tags_extra = ''
+
+" Filter the tag description through |substitute()| for these filetypes.
+" This applies only if the tag cmd field (see |taglist()|) is used.
+" :nodefault:
+TLet g:tlib_tag_substitute = {
+ \ 'java': [['\s*{\s*$', '', '']],
+ \ 'ruby': [['\<\(def\|class\|module\)\>\s\+', '', '']],
+ \ 'vim': [
+ \ ['^\s*com\%[mand]!\?\(\s\+-\S\+\)*\s*\u\w*\zs.*$', '', ''],
+ \ ['^\s*\(let\|aug\%[roup]\|fu\%[nction]!\?\|com\%[mand]!\?\(\s\+-\S\+\)*\)\s*', '', ''],
+ \ ['"\?\s*{{{\d.*$', '', ''],
+ \ ],
+ \ }
+
+
+" :def: function! tlib#tag#Retrieve(rx, ?extra_tags=0)
+" Get all tags matching rx. Basically, this function simply calls
+" |taglist()|, but when extra_tags is true, the list of the tag files
+" (see 'tags') is temporarily expanded with |g:tlib_tags_extra|.
+"
+" Example use:
+" If you want to include tags for, eg, JDK, normal tags use can become
+" slow. You could proceed as follows:
+" 1. Create a tags file for the JDK sources. When creating the tags
+" file, make sure to include inheritance information and the like
+" (command-line options like --fields=+iaSm --extra=+q should be ok).
+" In this example, we want tags only for public methods (there are
+" most likely better ways to do this): >
+" ctags -R --fields=+iaSm --extra=+q ${JAVA_HOME}/src
+" head -n 6 tags > tags0
+" grep access:public tags >> tags0
+" < 2. Make 'tags' include project specific tags files. In
+" ~/vimfiles/after/ftplugin/java.vim insert: >
+" let b:tlib_tags_extra = $JAVA_HOME .'/tags0'
+" < 3. When this function is invoked as >
+" echo tlib#tag#Retrieve('print')
+" < it will return only project-local tags. If it is invoked as >
+" echo tlib#tag#Retrieve('print', 1)
+" < tags from the JDK will be included.
+function! tlib#tag#Retrieve(rx, ...) "{{{3
+ TVarArg ['extra_tags', 0]
+ " TLogVAR a:rx, extra_tags
+ if extra_tags
+ let tags_orig = &l:tags
+ if empty(tags_orig)
+ setlocal tags<
+ endif
+ try
+ let more_tags = tlib#var#Get('tlib_tags_extra', 'bg')
+ if !empty(more_tags)
+ let &l:tags .= ','. more_tags
+ endif
+ let taglist = taglist(a:rx)
+ finally
+ let &l:tags = tags_orig
+ endtry
+ else
+ let taglist = taglist(a:rx)
+ endif
+ return taglist
+endf
+
+
+" Retrieve tags that meet the constraints (a dictionnary of fields and
+" regexp, with the exception of the kind field which is a list of chars).
+" For the use of the optional use_extra argument see
+" |tlib#tag#Retrieve()|.
+" :def: function! tlib#tag#Collect(constraints, ?use_extra=1, ?match_front=1)
+function! tlib#tag#Collect(constraints, ...) "{{{3
+ TVarArg ['use_extra', 0], ['match_end', 1], ['match_front', 1]
+ " TLogVAR a:constraints, use_extra
+ let rx = get(a:constraints, 'name', '')
+ if empty(rx) || rx == '*'
+ let rx = '.'
+ else
+ let rxl = ['\C']
+ if match_front
+ call add(rxl, '^')
+ endif
+ " call add(rxl, tlib#rx#Escape(rx))
+ call add(rxl, rx)
+ if match_end
+ call add(rxl, '$')
+ endif
+ let rx = join(rxl, '')
+ endif
+ " TLogVAR rx, use_extra
+ let tags = tlib#tag#Retrieve(rx, use_extra)
+ " TLogDBG len(tags)
+ for [field, rx] in items(a:constraints)
+ if !empty(rx) && rx != '*'
+ " TLogVAR field, rx
+ if field == 'kind'
+ call filter(tags, 'v:val.kind =~ "['. rx .']"')
+ elseif field != 'name'
+ call filter(tags, '!empty(get(v:val, field)) && get(v:val, field) =~ rx')
+ endif
+ endif
+ endfor
+ " TLogVAR tags
+ return tags
+endf
+
+
+function! tlib#tag#Format(tag) "{{{3
+ if has_key(a:tag, 'signature')
+ let name = a:tag.name . a:tag.signature
+ elseif a:tag.cmd[0] == '/'
+ let name = a:tag.cmd
+ let name = substitute(name, '^/\^\?\s*', '', '')
+ let name = substitute(name, '\s*\$\?/$', '', '')
+ let name = substitute(name, '\s\{2,}', ' ', 'g')
+ let tsub = tlib#var#Get('tlib_tag_substitute', 'bg')
+ if has_key(tsub, &filetype)
+ for [rx, rplc, sub] in tsub[&filetype]
+ let name = substitute(name, rx, rplc, sub)
+ endfor
+ endif
+ else
+ let name = a:tag.name
+ endif
+ return name
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/textobjects.vim b/vim/bundle/tlib_vim/autoload/tlib/textobjects.vim
new file mode 100755
index 0000000..fb4170e
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/textobjects.vim
@@ -0,0 +1,45 @@
+" textobjects.vim
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2010-01-09.
+" @Last Change: 2010-01-10.
+" @Revision: 0.0.29
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+" :tag: standard-paragraph
+" Select a "Standard Paragraph", i.e. a text block followed by blank
+" lines. Other than |ap|, the last paragraph in a document is handled
+" just the same.
+"
+" The |text-object| can be accessed as "sp". Example: >
+"
+" vsp ... select the current standard paragraph
+"
+" Return 1, if the paragraph is the last one in the document.
+function! tlib#textobjects#StandardParagraph() "{{{3
+ if line("'}") == line('$')
+ norm! vip
+ return 1
+ else
+ norm! vap
+ return 0
+ endif
+endf
+
+
+function! tlib#textobjects#Init() "{{{3
+ if !exists('s:tlib_done_textobjects')
+ " sp ... Standard paragraph (for use as |text-objects|).
+ vnoremap <silent> sp <Esc>:call tlib#textobjects#StandardParagraph()<CR>
+ onoremap <silent> sp :<C-u>normal Vsp<CR>
+ let s:tlib_done_textobjects = 1
+ endif
+endf
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/autoload/tlib/time.vim b/vim/bundle/tlib_vim/autoload/tlib/time.vim
new file mode 100755
index 0000000..2273d55
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/time.vim
@@ -0,0 +1,67 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 36
+
+
+function! tlib#time#MSecs() "{{{3
+ let rts = reltimestr(reltime())
+ return substitute(rts, '\.', '', '')
+endf
+
+
+function! tlib#time#Now() "{{{3
+ if has('reltime')
+ let rts = reltimestr(reltime())
+ let rtl = map(split(rts, '\.'), 'str2nr(v:val)')
+ else
+ let rtl = [localtime()]
+ endif
+ return rtl
+endf
+
+
+function! tlib#time#FormatNow() "{{{3
+ let rtl = tlib#time#Now()
+ if len(rtl) == 2
+ let rts = strftime(g:tlib#date#date_format .' %H:%M:%S', rtl[0]) .'.'. rtl[1]
+ else
+ let rts = strftime(g:tlib#date#date_format .' %H:%M:%S', rtl[0])
+ endif
+ return rts
+endf
+
+
+function! tlib#time#Diff(a, b, ...) "{{{3
+ TVarArg ['resolution', 2]
+ let [as, am] = a:a
+ let [bs, bm] = a:b
+ let rv = 0 + (as - bs)
+ if resolution > 0
+ let rv .= repeat('0', resolution)
+ let am = am[0 : resolution - 1]
+ let bm = bm[0 : resolution - 1]
+ let rv += (am - bm)
+ endif
+ return rv
+endf
+
+
+function! tlib#time#DiffMSecs(a, b, ...) "{{{3
+ TVarArg ['resolution', 2]
+ if a:a == a:b
+ return 0
+ endif
+ let a = printf('%30s', a:a[0 : -(7 - resolution)])
+ let b = printf('%30s', a:b[0 : -(7 - resolution)])
+ for i in range(0, 29)
+ if a[i] != b[i]
+ let a = a[i : -1]
+ let b = b[i : -1]
+ return a - b
+ endif
+ endfor
+ return 0
+endf
+
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/trace.vim b/vim/bundle/tlib_vim/autoload/tlib/trace.vim
new file mode 100644
index 0000000..cdda1de
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/trace.vim
@@ -0,0 +1,159 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: https://github.com/tomtom
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2016-06-08
+" @Revision: 177
+
+
+if !exists('g:tlib#trace#backtrace')
+ " The length of the backtrace that should be included in
+ " |tlib#trace#Print()|.
+ let g:tlib#trace#backtrace = 2 "{{{2
+endif
+
+
+if !exists('g:tlib#trace#printer')
+ " Possible values:
+ " - 'echom'
+ " - ['file', FILENAME]
+ let g:tlib#trace#printer = 'echom' "{{{2
+endif
+
+
+if !exists('g:tlib#trace#hl')
+ let g:tlib#trace#hl = {'error': 'ErrorMsg', 'fatal': 'ErrorMsg', 'warn': 'WarningMsg'} "{{{2
+endif
+
+
+" Print traces from |tlib#trace#Print()|.
+function! tlib#trace#Printer_echom(type, text, args) abort "{{{3
+ let hl = get(g:tlib#trace#hl, a:type, '')
+ try
+ if !empty(hl)
+ exec 'echohl' hl
+ endif
+ echom a:text
+ finally
+ if !empty(hl)
+ echohl NONE
+ endif
+ endtry
+endf
+
+
+function! tlib#trace#Printer_file(type, text, args) abort "{{{3
+ let filename = get(a:args, 0, '')
+ if !filewritable(filename)
+ throw 'tlib#trace#Printer_file: Cannot write to file: '. filename
+ else
+ call writefile([a:text], filename, 'a')
+ endif
+endf
+
+
+" Set the tracing |regexp|. See |:Tlibtrace|.
+" This will also call |tlib#trace#Enable()|.
+"
+" Examples:
+" call tlib#trace#Set(["+foo", "-bar"])
+" call tlib#trace#Set("+foo,-bar")
+function! tlib#trace#Set(vars) abort "{{{3
+ call tlib#trace#Enable()
+ if type(a:vars) == 1
+ let vars = tlib#string#SplitCommaList(a:vars, '[,[:space:]]\+')
+ else
+ let vars = a:vars
+ endif
+ " TLogVAR vars
+ for rx in vars
+ let rx1 = substitute(rx, '^[+-]', '', 'g')
+ if rx1 !~# '^\%(error\|warn\|fatal\)$'
+ let erx1 = tlib#rx#Escape(rx1)
+ " TLogVAR rx, rx1
+ " echom "DBG" s:trace_rx
+ if rx =~ '^+'
+ if s:trace_rx !~# '[(|]'. erx1 .'\\'
+ let s:trace_rx = substitute(s:trace_rx, '\ze\\)\$', '\\|'. erx1, '')
+ endif
+ elseif rx =~ '^-'
+ if s:trace_rx =~# '[(|]'. erx1 .'\\'
+ let s:trace_rx = substitute(s:trace_rx, '\\|'. erx1, '', '')
+ endif
+ else
+ echohl WarningMsg
+ echom 'tlib#trace#Print: Unsupported syntax:' rx
+ echohl NONE
+ endif
+ " echom "DBG" s:trace_rx
+ endif
+ endfor
+ echom "SetTrace:" s:trace_rx
+endf
+
+
+function! tlib#trace#Backtrace(caller) abort "{{{3
+ let caller = split(a:caller, '\.\.')
+ let start = max([0, len(caller) - g:tlib#trace#backtrace - 1])
+ let caller = caller[start : -1]
+ return join(caller, '..')
+endf
+
+
+" Print the values of vars. The first value is a "guard" (see
+" |:Tlibtrace|).
+function! tlib#trace#Print(caller, vars, values) abort "{{{3
+ let msg = ['TRACE']
+ let guard = a:values[0]
+ if type(guard) == 0
+ let cond = guard
+ else
+ let cond = guard =~# s:trace_rx
+ endif
+ " TLogVAR guard, cond, a:vars, a:values
+ if cond
+ call add(msg, guard)
+ call add(msg, tlib#time#FormatNow() .':')
+ if g:tlib#trace#backtrace > 0
+ let bt = tlib#trace#Backtrace(a:caller)
+ if !empty(bt)
+ call add(msg, bt .':')
+ endif
+ endif
+ for i in range(1, len(a:vars) - 1)
+ let v = substitute(a:vars[i], ',$', '', '')
+ let r = a:values[i]
+ if v =~# '^\([''"]\).\{-}\1$'
+ call add(msg, r .';')
+ else
+ call add(msg, v .'='. string(r) .';')
+ endif
+ unlet r
+ endfor
+ if type(g:tlib#trace#printer) == 1
+ let printer = g:tlib#trace#printer
+ let args = []
+ else
+ let [printer; args] = g:tlib#trace#printer
+ endif
+ call tlib#trace#Printer_{printer}(guard, join(msg), args)
+ endif
+endf
+
+
+" Enable tracing via |:Tlibtrace|.
+function! tlib#trace#Enable() abort "{{{3
+ if !exists('s:trace_rx')
+ let s:trace_rx = '^\%(error\|fatal\|warn\|info\)$'
+ " :nodoc:
+ command! -nargs=+ -bang Tlibtrace call tlib#trace#Print(expand('<sfile>'), [<f-args>], [<args>])
+ endif
+endf
+
+
+" Disable tracing via |:Tlibtrace|.
+function! tlib#trace#Disable() abort "{{{3
+ " :nodoc:
+ command! -nargs=+ -bang Tlibtrace :
+ unlet! s:trace_rx
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/type.vim b/vim/bundle/tlib_vim/autoload/tlib/type.vim
new file mode 100755
index 0000000..63116d2
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/type.vim
@@ -0,0 +1,126 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2007-09-30.
+" @Last Change: 2015-12-04.
+" @Revision: 44
+
+
+" Enable type assertiona via |:Tlibtype|.
+function! tlib#type#Enable() abort "{{{3
+ " :nodoc:
+ command! -nargs=+ Tlibtype call tlib#type#Check(expand('<sfile>'), [<f-args>], [<args>])
+endf
+
+
+" Disable type assertiona via |:Tlibtype|.
+function! tlib#type#Disable() abort "{{{3
+ " :nodoc:
+ command! -nargs=+ Tlibtype :
+endf
+
+
+function! tlib#type#IsNumber(expr)
+ return tlib#type#Is(a:expr, 0)
+endf
+
+
+function! tlib#type#IsString(expr)
+ return tlib#type#Is(a:expr, 1)
+endf
+
+
+function! tlib#type#IsFuncref(expr)
+ return tlib#type#Is(a:expr, 2)
+endf
+
+
+function! tlib#type#IsList(expr)
+ return tlib#type#Is(a:expr, 3)
+endf
+
+
+function! tlib#type#IsDictionary(expr)
+ return tlib#type#Is(a:expr, 4)
+endf
+
+
+function! tlib#type#Is(val, type) abort "{{{3
+ if has_key(s:schemas, a:type)
+ return tlib#type#Has(a:val, a:type)
+ else
+ if type(a:type) == 0
+ let type = a:type
+ elseif a:type =~? '^n\%[umber]'
+ let type = 0
+ elseif a:type =~? '^s\%[tring]'
+ let type = 1
+ elseif a:type =~? '^fu\%[ncref]'
+ let type = 2
+ elseif a:type =~? '^l\%[ist]'
+ let type = 3
+ elseif a:type =~? '^d\%[ictionary]'
+ let type = 4
+ elseif a:type =~? '^fl\%[oat]'
+ let type = 5
+ else
+ throw 'tlib#type#Is: Unknown type: ' a:type
+ endif
+ " TLogVAR a:val, a:type, type, type(a:val), type(a:val) == a:type
+ return type(a:val) == type
+ endif
+endf
+
+
+function! tlib#type#Are(vals, type) abort "{{{3
+ return tlib#assert#Map(a:vals, 'tlib#type#Is(v:val,'. string(a:type) .')')
+endf
+
+
+let s:schemas = {}
+
+
+function! tlib#type#Define(name, schema) abort "{{{3
+ let s:schemas[a:name] = deepcopy(a:schema)
+endf
+
+
+function! tlib#type#Has(val, schema) abort "{{{3
+ " TLogVAR type(a:val), type(a:schema)
+ if !tlib#type#IsDictionary(a:val)
+ " TLogVAR 'not a dictionary', a:val
+ return 0
+ endif
+ if tlib#type#IsString(a:schema)
+ " TLogVAR a:schema
+ let schema = copy(s:schemas[a:schema])
+ else
+ let schema = copy(a:schema)
+ endif
+ if tlib#type#IsDictionary(schema)
+ return tlib#assert#All(map(schema, 'has_key(a:val, v:key) && tlib#type#Is(a:val[v:key], v:val)'))
+ else
+ " TLogVAR keys(a:val), schema
+ return tlib#assert#All(map(schema, 'has_key(a:val, v:val)'))
+ endif
+endf
+
+
+function! tlib#type#Have(vals, schema) abort "{{{3
+ return tlib#assert#Map(a:vals, 'tlib#type#Has(v:val,'. string(a:schema) .')')
+endf
+
+
+function! tlib#type#Check(caller, names, vals) abort "{{{3
+ " TLogVAR a:names, a:vals, len(a:names)
+ for i in range(0, len(a:names) - 1, 2)
+ let val = a:vals[i]
+ let type = a:vals[i + 1]
+ " TLogVAR i, val, type
+ if !tlib#type#Is(val, type)
+ let name = matchstr(a:names[i], '^''\zs.\{-}\ze'',\?$')
+ throw 'tlib#type#Check: Type mismatch: '. name .':'. a:vals[i + 1]
+ endif
+ endfor
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/url.vim b/vim/bundle/tlib_vim/autoload/tlib/url.vim
new file mode 100755
index 0000000..b948d48
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/url.vim
@@ -0,0 +1,52 @@
+" url.vim
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2007-06-30.
+" @Last Change: 2011-03-10.
+" @Revision: 0.0.28
+
+
+" TODO: These functions could use printf() now.
+
+" Decode an encoded URL.
+function! tlib#url#Decode(url) "{{{3
+ return substitute(a:url, '\(+\|%\(%\|\x\x\)\)', '\=tlib#url#DecodeChar(submatch(1))', 'g')
+endf
+
+
+" Decode a single character.
+function! tlib#url#DecodeChar(char) "{{{3
+ if a:char == '%%'
+ return '%'
+ elseif a:char == '+'
+ return ' '
+ else
+ return nr2char("0x".a:char[1 : -1])
+ endif
+endf
+
+
+" Encode a single character.
+function! tlib#url#EncodeChar(char) "{{{3
+ if a:char == '%'
+ return '%%'
+ elseif a:char == ' '
+ return '+'
+ else
+ return printf("%%%X", char2nr(a:char))
+ endif
+endf
+
+
+" Encode an URL.
+function! tlib#url#Encode(url, ...) "{{{3
+ TVarArg ['extrachars', '']
+ let rx = '\([^a-zA-Z0-9_.'. extrachars .'-]\)'
+ " TLogVAR a:url, rx
+ let rv = substitute(a:url, rx, '\=tlib#url#EncodeChar(submatch(1))', 'g')
+ " TLogVAR rv
+ return rv
+endf
+
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/var.vim b/vim/bundle/tlib_vim/autoload/tlib/var.vim
new file mode 100755
index 0000000..dcd9264
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/var.vim
@@ -0,0 +1,83 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 30
+
+
+" Define a variable called NAME if yet undefined.
+" You can also use the :TLLet command.
+"
+" EXAMPLES: >
+" exec tlib#var#Let('g:foo', 1)
+" TLet g:foo = 1
+function! tlib#var#Let(name, val) "{{{3
+ return printf('if !exists(%s) | let %s = %s | endif', string(a:name), a:name, string(a:val))
+ " return printf('if !exists(%s) | let %s = %s | endif', string(a:name), a:name, a:val)
+endf
+
+
+" :def: function! tlib#var#EGet(var, namespace, ?default='')
+" Retrieve a variable by searching several namespaces.
+"
+" EXAMPLES: >
+" let g:foo = 1
+" let b:foo = 2
+" let w:foo = 3
+" echo eval(tlib#var#EGet('foo', 'vg')) => 1
+" echo eval(tlib#var#EGet('foo', 'bg')) => 2
+" echo eval(tlib#var#EGet('foo', 'wbg')) => 3
+function! tlib#var#EGet(var, namespace, ...) "{{{3
+ let pre = []
+ let post = []
+ for namespace in split(a:namespace, '\zs')
+ let var = namespace .':'. a:var
+ call add(pre, printf('exists("%s") ? %s : (', var, var))
+ call add(post, ')')
+ endfor
+ let default = a:0 >= 1 ? a:1 : ''
+ return join(pre) . string(default) . join(post)
+endf
+
+
+" :def: function! tlib#var#Get(var, namespace, ?default='')
+" Retrieve a variable by searching several namespaces.
+"
+" EXAMPLES: >
+" let g:foo = 1
+" let b:foo = 2
+" let w:foo = 3
+" echo tlib#var#Get('foo', 'bg') => 1
+" echo tlib#var#Get('foo', 'bg') => 2
+" echo tlib#var#Get('foo', 'wbg') => 3
+function! tlib#var#Get(var, namespace, ...) "{{{3
+ let var_ = substitute(a:var, '#', '_', 'g')
+ for namespace in split(a:namespace, '\zs')
+ let vname = namespace == 'g' ? a:var : var_
+ let var = namespace .':'. vname
+ if exists(var)
+ return {var}
+ endif
+ endfor
+ return a:0 >= 1 ? a:1 : ''
+endf
+
+
+" :def: function! tlib#var#List(rx, ?prefix='')
+" Get a list of variables matching rx.
+" EXAMPLE:
+" echo tlib#var#List('tlib_', 'g:')
+function! tlib#var#List(rx, ...) "{{{3
+ TVarArg ['prefix', 'g:']
+ if v:version >= 704
+ exec 'let varlist = keys('. prefix .')'
+ else
+ redir => vars
+ silent! exec 'let '. prefix
+ redir END
+ let varlist = split(vars, '\n')
+ call map(varlist, 'matchstr(v:val, ''^\S\+'')')
+ endif
+ call filter(varlist, 'v:val =~ a:rx')
+ return varlist
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/vcs.vim b/vim/bundle/tlib_vim/autoload/tlib/vcs.vim
new file mode 100644
index 0000000..15d051f
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/vcs.vim
@@ -0,0 +1,189 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2012-03-08.
+" @Last Change: 2015-11-07.
+" @Revision: 190
+
+scriptencoding utf-8
+
+
+" A dictionarie of supported VCS (currently: git, hg, svn, bzr).
+" :display: g:tlib#vcs#def {...}
+TLet g:tlib#vcs#def = {
+ \ 'git': {
+ \ 'dir': '.git',
+ \ 'ls': 'git ls-files --full-name',
+ \ 'ls.postprocess': '*tlib#vcs#GitLsPostprocess',
+ \ 'diff': 'git diff --no-ext-diff -U0 %s'
+ \ },
+ \ 'hg': {
+ \ 'dir': '.hg',
+ \ 'diff': 'hg diff -U0 %s',
+ \ 'ls': 'hg manifest'
+ \ },
+ \ 'svn': {
+ \ 'dir': '.svn',
+ \ 'diff': 'svn diff --diff-cmd diff --extensions -U0 %s',
+ \ },
+ \ 'bzr': {
+ \ 'dir': '.bzr',
+ \ 'diff': 'bzr diff --diff-options=-U0 %s',
+ \ }
+ \ }
+
+
+" A dictionary of custom executables for VCS commands. If the value is
+" empty, support for that VCS will be removed. If no key is present, it
+" is assumed that the VCS "type" is the name of the executable.
+" :display: g:tlib#vcs#executables {...}
+TLet g:tlib#vcs#executables = {}
+
+
+" If non-empty, use it as a format string to check whether a VCS is
+" installed on your computer.
+TLet g:tlib#vcs#check = has('win16') || has('win32') || has('win64') ? '%s.exe' : '%s'
+
+
+if !empty(g:tlib#vcs#check)
+ for [s:cmd, s:def] in items(g:tlib#vcs#def)
+ if !has_key(g:tlib#vcs#executables, s:cmd)
+ let s:cmd1 = printf(g:tlib#vcs#check, s:cmd)
+ let g:tlib#vcs#executables[s:cmd] = executable(s:cmd1) ? s:cmd1 : ''
+ endif
+ endfor
+ unlet! s:cmd s:def s:cmd1
+endif
+
+
+function! tlib#vcs#Executable(type) "{{{3
+ return get(g:tlib#vcs#executables, a:type, '')
+endf
+
+
+function! tlib#vcs#FindVCS(filename) "{{{3
+ let type = ''
+ let dir = ''
+ let dirname = fnamemodify(a:filename, isdirectory(a:filename) ? ':p' : ':p:h')
+ let path = escape(dirname, ';') .';'
+ " TLogVAR a:filename, dirname, path
+ Tlibtrace 'tlib', a:filename, path
+ let depth = -1
+ for vcs in keys(g:tlib#vcs#def)
+ let subdir = g:tlib#vcs#def[vcs].dir
+ let vcsdir = finddir(subdir, path)
+ " TLogVAR vcs, subdir, vcsdir
+ Tlibtrace 'tlib', vcs, subdir, vcsdir
+ if !empty(vcsdir)
+ let vcsdir_depth = len(split(fnamemodify(vcsdir, ':p'), '\/'))
+ if vcsdir_depth > depth
+ let depth = vcsdir_depth
+ let type = vcs
+ let dir = vcsdir
+ " TLogVAR type, depth
+ endif
+ endif
+ endfor
+ Tlibtrace 'tlib', type, dir
+ " TLogVAR type, dir
+ if empty(type)
+ return ['', '']
+ else
+ return [type, dir]
+ endif
+endf
+
+
+function! s:GetCmd(vcstype, cmd)
+ let vcsdef = get(g:tlib#vcs#def, a:vcstype, {})
+ if has_key(vcsdef, a:cmd)
+ let cmd = vcsdef[a:cmd]
+ if cmd =~ '^\*'
+ let cmd = substitute(cmd, '^\*', '', '')
+ else
+ let bin = get(g:tlib#vcs#executables, a:vcstype, '')
+ if empty(bin)
+ let cmd = ''
+ elseif bin != a:vcstype
+ " let bin = escape(shellescape(bin), '\')
+ let bin = escape(bin, '\')
+ let cmd = substitute(cmd, '^.\{-}\zs'. escape(a:vcstype, '\'), bin, '')
+ endif
+ endif
+ return cmd
+ else
+ return ''
+ endif
+endf
+
+
+" :display: tlib#vcs#Ls(?filename=bufname('%'), ?vcs=[type, dir])
+" Return the files under VCS.
+function! tlib#vcs#Ls(...) "{{{3
+ if a:0 >= 2
+ let vcs = a:2
+ else
+ let vcs = tlib#vcs#FindVCS(a:0 >= 1 ? a:1 : bufname('%'))
+ endif
+ Tlibtrace 'tlib', vcs, a:000
+ " TLogVAR vcs
+ if !empty(vcs)
+ let [vcstype, vcsdir] = vcs
+ if has_key(g:tlib#vcs#def, vcstype)
+ let ls = s:GetCmd(vcstype, 'ls')
+ " TLogVAR ls
+ if !empty(ls)
+ let rootdir = fnamemodify(vcsdir, ':p:h:h')
+ " TLogVAR vcsdir, rootdir
+ if ls =~ '%s'
+ let cmd = printf(ls, shellescape(rootdir))
+ else
+ let cmd = ls
+ endif
+ " TLogVAR cmd, getcwd()
+ Tlibtrace 'tlib', getcwd(), vcstype, vcsdir, rootdir, cmd
+ let filess = tlib#sys#SystemInDir(rootdir, cmd)
+ " TLogVAR filess
+ let files = split(filess, '\n')
+ let postprocess = s:GetCmd(vcstype, 'ls.postprocess')
+ if !empty(postprocess)
+ call map(files, 'call(postprocess, [v:val])')
+ endif
+ call map(files, 'join([rootdir, v:val], "/")')
+ " TLogVAR files
+ return files
+ endif
+ endif
+ endif
+ return []
+endf
+
+
+" :display: tlib#vcs#Diff(filename, ?vcs=[type, dir])
+" Return the diff for "filename"
+function! tlib#vcs#Diff(filename, ...) "{{{3
+ let vcs = a:0 >= 1 ? a:1 : tlib#vcs#FindVCS(a:filename)
+ if !empty(vcs)
+ let [vcstype, vcsdir] = vcs
+ let diff = s:GetCmd(vcstype, 'diff')
+ if !empty(diff)
+ let cmd = printf(diff, shellescape(fnamemodify(a:filename, ':p')))
+ let patch = system(cmd)
+ return patch
+ endif
+ endif
+ return []
+endf
+
+
+function! tlib#vcs#GitLsPostprocess(filename) abort "{{{3
+ if a:filename =~ '^".\{-}"$'
+ let filename = matchstr(a:filename, '^"\zs.\{-}\ze"$')
+ let filename = substitute(filename, '\%(\\\@<!\\\(\d\d\d\)\)\+', '\=eval(''"''. submatch(0) .''"'')', 'g')
+ " let filename = eval(a:filename)
+ " TLogVAR a:filename, filename, &enc
+ return filename
+ else
+ return a:filename
+ endif
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/vim.vim b/vim/bundle/tlib_vim/autoload/tlib/vim.vim
new file mode 100644
index 0000000..7154aeb
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/vim.vim
@@ -0,0 +1,152 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @GIT: http://github.com/tomtom/tlib_vim/
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2010-07-19.
+" @Last Change: 2012-06-08.
+" @Revision: 37
+
+
+let s:restoreframecmd = ''
+let s:fullscreen = 0
+
+if has('win16') || has('win32') || has('win64')
+
+ if !exists('g:tlib#vim#simalt_maximize')
+ " The alt-key for maximizing the window.
+ " CAUTION: The value of this paramter depends on your locale and
+ " maybe the windows version you are running.
+ let g:tlib#vim#simalt_maximize = 'x' "{{{2
+ endif
+
+ if !exists('g:tlib#vim#simalt_restore')
+ " The alt-key for restoring the window.
+ " CAUTION: The value of this paramter depends on your locale and
+ " maybe the windows version you are running.
+ let g:tlib#vim#simalt_restore = 'r' "{{{2
+ endif
+
+ if !exists('g:tlib#vim#use_vimtweak')
+ " If true, use the vimtweak.dll for windows. This will enable
+ " tlib to remove the caption for fullscreen windows.
+ let g:tlib#vim#use_vimtweak = 0 "{{{2
+ endif
+
+ " Maximize the window.
+ " You might need to redefine |g:tlib#vim#simalt_maximize| if it doesn't
+ " work for you.
+ fun! tlib#vim#Maximize(fullscreen) "{{{3
+ if !has("gui_running")
+ return
+ endif
+ call s:SaveFrameParams()
+ let s:fullscreen = a:fullscreen
+ if g:tlib#vim#use_vimtweak && a:fullscreen
+ call libcallnr("vimtweak.dll", "EnableCaption", 0)
+ endif
+ exec 'simalt ~'. g:tlib#vim#simalt_maximize
+ endf
+
+ " Restore the original vimsize after having called |tlib#vim#Maximize()|.
+ function! tlib#vim#RestoreWindow() "{{{3
+ if !has("gui_running")
+ return
+ endif
+ if g:tlib#vim#use_vimtweak
+ call libcallnr("vimtweak.dll", "EnableCaption", 1)
+ endif
+ exec 'simalt ~'. g:tlib#vim#simalt_restore
+ call s:RestoreFrameParams()
+ endf
+
+else
+
+ if !exists('g:tlib#vim#use_wmctrl')
+ " If true, use wmctrl for X windows to make a window
+ " maximized/fullscreen.
+ "
+ " This is the preferred method for maximizing windows under X
+ " windows. Some window managers have problem coping with the
+ " default method of setting 'lines' and 'columns' to a large
+ " value.
+ let g:tlib#vim#use_wmctrl = executable('wmctrl') "{{{2
+ endif
+
+ " :nodoc:
+ fun! tlib#vim#Maximize(fullscreen) "{{{3
+ if !has("gui_running")
+ return
+ endif
+ call s:SaveFrameParams()
+ let s:fullscreen = a:fullscreen
+ if g:tlib#vim#use_wmctrl
+ if a:fullscreen
+ silent !wmctrl -r :ACTIVE: -b add,fullscreen
+ else
+ silent !wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
+ endif
+ else
+ set lines=1000 columns=1000
+ endif
+ endf
+
+ " :nodoc:
+ function! tlib#vim#RestoreWindow() "{{{3
+ if !has("gui_running")
+ return
+ endif
+ if g:tlib#vim#use_wmctrl
+ if s:fullscreen
+ silent !wmctrl -r :ACTIVE: -b remove,fullscreen
+ else
+ silent !wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
+ endif
+ endif
+ call s:RestoreFrameParams()
+ endf
+
+endif
+
+
+function! s:SaveFrameParams() "{{{3
+ let s:restoreframecmd = printf("set lines=%d columns=%d | winpos %d %d", &lines, &columns, getwinposx(), getwinposy())
+endf
+
+
+function! s:RestoreFrameParams() "{{{3
+ if !empty(s:restoreframecmd)
+ exec s:restoreframecmd
+ let s:restoreframecmd = ''
+ endif
+endf
+
+
+" :display: tlib#vim##CopyFunction(old, new, overwrite=0)
+function! tlib#vim#CopyFunction(old, new, ...) "{{{3
+ let overwrite = a:0 >= 1 ? a:1 : 0
+ redir => oldfn
+ exec 'silent function' a:old
+ redir END
+ if exists('*'. a:new)
+ if overwrite > 0
+ exec 'delfunction' a:new
+ elseif overwrite < 0
+ throw 'tlib#vim##CopyFunction: Function already exists: '. a:old .' -> '. a:new
+ else
+ return
+ endif
+ endif
+ let fn = split(oldfn, '\n')
+ let fn = map(fn, 'substitute(v:val, ''^\d\+'', "", "")')
+ let fn[0] = substitute(fn[0], '\V\^\s\*fu\%[nction]!\?\s\+\zs'. a:old, a:new, '')
+ let t = @t
+ try
+ let @t = join(fn, "\n")
+ redir => out
+ @t
+ redir END
+ finally
+ let @t = t
+ endtry
+endf
+
diff --git a/vim/bundle/tlib_vim/autoload/tlib/win.vim b/vim/bundle/tlib_vim/autoload/tlib/win.vim
new file mode 100755
index 0000000..4963af1
--- /dev/null
+++ b/vim/bundle/tlib_vim/autoload/tlib/win.vim
@@ -0,0 +1,128 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 55
+
+
+" Return vim code to jump back to the original window.
+function! tlib#win#Set(winnr) "{{{3
+ if a:winnr > 0
+ " TLogVAR a:winnr
+ " TLogDBG winnr()
+ " TLogDBG string(tlib#win#List())
+ if winnr() != a:winnr && winbufnr(a:winnr) != -1
+ let rv = winnr().'wincmd w'
+ exec a:winnr .'wincmd w'
+ " TLogVAR rv
+ " TLogDBG string(tlib#win#List())
+ return rv
+ endif
+ endif
+ return ''
+endf
+
+
+" :def: function! tlib#win#GetLayout(?save_view=0)
+function! tlib#win#GetLayout(...) "{{{3
+ TVarArg ['save_view', 0]
+ let views = {}
+ if save_view
+ let winnr = winnr()
+ windo let views[winnr()] = winsaveview()
+ " for w in range(1, winnr('$'))
+ " call tlib#win#Set(w)
+ " let views[w] = winsaveview()
+ " endfor
+ call tlib#win#Set(winnr)
+ endif
+ return {'winnr': winnr('$'), 'winrestcmd': winrestcmd(), 'views': views, 'cmdheight': &cmdheight, 'guioptions': &guioptions, 'tabpagenr': tabpagenr()}
+endf
+
+
+function! tlib#win#SetLayout(layout) "{{{3
+ if a:layout.tabpagenr == tabpagenr() && a:layout.winnr == winnr('$')
+ " TLogVAR a:layout.winrestcmd
+ " TLogDBG string(tlib#win#List())
+ exec a:layout.winrestcmd
+ if !empty(a:layout.views)
+ let winnr = winnr()
+ " TLogVAR winnr
+ for [w, v] in items(a:layout.views)
+ " TLogVAR w, v
+ call tlib#win#Set(w)
+ call winrestview(v)
+ endfor
+ call tlib#win#Set(winnr)
+ endif
+ if a:layout.cmdheight != &cmdheight
+ let &cmdheight = a:layout.cmdheight
+ endif
+ " TLogDBG string(tlib#win#List())
+ return 1
+ endif
+ return 0
+endf
+
+
+function! tlib#win#List() "{{{3
+ let wl = {}
+ for wn in range(1, winnr('$'))
+ let wl[wn] = bufname(winbufnr(wn))
+ endfor
+ return wl
+endf
+
+
+" " :def: function! tlib#win#GetLayout1(?save_view=0)
+" " Contrary to |tlib#win#GetLayout|, this version doesn't use
+" " |winrestcmd()|. It can also save windows views.
+" function! tlib#win#GetLayout1(...) "{{{3
+" TVarArg ['save_view', 0]
+" let winnr = winnr()
+" let acc = {}
+" for w in range(1, winnr('$'))
+" let def = {'h': winheight(w), 'w': winwidth(w)}
+" if save_view
+" call tlib#win#Set(w)
+" let def.view = winsaveview()
+" endif
+" let acc[w] = def
+" endfor
+" call tlib#win#Set(winnr)
+" return acc
+" endf
+"
+"
+" " Reset layout from the value of |tlib#win#GetLayout1|.
+" function! tlib#win#SetLayout1(layout) "{{{3
+" if len(a:layout) != winnr('$')
+" return 0
+" endif
+" let winnr = winnr()
+" for [w, def] in items(a:layout)
+" if tlib#win#Set(w)
+" exec 'resize '. def.h
+" exec 'vertical resize '. def.w
+" if has_key(def, 'view')
+" call winrestview(def.view)
+" endif
+" else
+" break
+" endif
+" endfor
+" call tlib#win#Set(winnr)
+" return 1
+" endf
+
+
+function! tlib#win#Width(wnr) "{{{3
+ return winwidth(a:wnr) - &fdc
+endf
+
+
+function! tlib#win#WinDo(ex) "{{{3
+ let w = winnr()
+ exec 'windo '. a:ex
+ exec w .'wincmd w'
+endf
+
diff --git a/vim/bundle/tlib_vim/doc/tlib.txt b/vim/bundle/tlib_vim/doc/tlib.txt
new file mode 100755
index 0000000..9d2d1a0
--- /dev/null
+++ b/vim/bundle/tlib_vim/doc/tlib.txt
@@ -0,0 +1,2559 @@
+*tlib.txt* tlib -- A library of vim functions
+ Author: Tom Link, micathom at gmail com
+
+This library provides some utility functions. There isn't much need to
+install it unless another plugin requires you to do so.
+
+Most of the library is included in autoload files. No autocommands are
+created. With the exception of loading ../plugin/02tlib.vim at startup
+the library has no impact on startup time or anything else.
+
+The change-log is included at the bottom of ../plugin/02tlib.vim
+(move the cursor over the file name and type gfG)
+
+Demo of |tlib#input#List()|:
+http://vimsomnia.blogspot.com/2010/11/selecting-items-from-list-with-tlibs.html
+
+
+-----------------------------------------------------------------------
+Install~
+
+Edit the vba file and type: >
+
+ :so %
+
+See :help vimball for details. If you have difficulties, please make
+sure, you have the current version of vimball (vimscript #1502)
+installed.
+
+
+========================================================================
+Contents~
+
+ :TLet .................................. |:TLet|
+ :TScratch .............................. |:TScratch|
+ :TVarArg ............................... |:TVarArg|
+ :TBrowseOutput ......................... |:TBrowseOutput|
+ :TBrowseScriptnames .................... |:TBrowseScriptnames|
+ :Tlibtrace ............................. |:Tlibtrace|
+ :Tlibtraceset .......................... |:Tlibtraceset|
+ :Tlibassert ............................ |:Tlibassert|
+ :Tlibtype .............................. |:Tlibtype|
+ Add .................................... |Add()|
+ TestGetArg ............................. |TestGetArg()|
+ TestGetArg1 ............................ |TestGetArg1()|
+ TestArgs ............................... |TestArgs()|
+ TestArgs1 .............................. |TestArgs1()|
+ TestArgs2 .............................. |TestArgs2()|
+ TestArgs3 .............................. |TestArgs3()|
+ g:tlib#debug ........................... |g:tlib#debug|
+ tlib#notify#Echo ....................... |tlib#notify#Echo()|
+ tlib#notify#TrimMessage ................ |tlib#notify#TrimMessage()|
+ tlib#notify#PrintError ................. |tlib#notify#PrintError()|
+ g:tlib#trace#backtrace ................. |g:tlib#trace#backtrace|
+ g:tlib#trace#printer ................... |g:tlib#trace#printer|
+ g:tlib#trace#hl ........................ |g:tlib#trace#hl|
+ tlib#trace#Printer_echom ............... |tlib#trace#Printer_echom()|
+ tlib#trace#Printer_file ................ |tlib#trace#Printer_file()|
+ tlib#trace#Set ......................... |tlib#trace#Set()|
+ tlib#trace#Backtrace ................... |tlib#trace#Backtrace()|
+ tlib#trace#Print ....................... |tlib#trace#Print()|
+ tlib#trace#Enable ...................... |tlib#trace#Enable()|
+ tlib#trace#Disable ..................... |tlib#trace#Disable()|
+ tlib#dictionary#Rev .................... |tlib#dictionary#Rev()|
+ g:tlib_persistent ...................... |g:tlib_persistent|
+ tlib#persistent#Dir .................... |tlib#persistent#Dir()|
+ tlib#persistent#Filename ............... |tlib#persistent#Filename()|
+ tlib#persistent#Get .................... |tlib#persistent#Get()|
+ tlib#persistent#MTime .................. |tlib#persistent#MTime()|
+ tlib#persistent#Value .................. |tlib#persistent#Value()|
+ tlib#persistent#Save ................... |tlib#persistent#Save()|
+ g:tlib#vim#simalt_maximize ............. |g:tlib#vim#simalt_maximize|
+ g:tlib#vim#simalt_restore .............. |g:tlib#vim#simalt_restore|
+ g:tlib#vim#use_vimtweak ................ |g:tlib#vim#use_vimtweak|
+ tlib#vim#Maximize ...................... |tlib#vim#Maximize()|
+ tlib#vim#RestoreWindow ................. |tlib#vim#RestoreWindow()|
+ g:tlib#vim#use_wmctrl .................. |g:tlib#vim#use_wmctrl|
+ tlib#vim#CopyFunction .................. |tlib#vim#CopyFunction()|
+ tlib#progressbar#Init .................. |tlib#progressbar#Init()|
+ tlib#progressbar#Display ............... |tlib#progressbar#Display()|
+ tlib#progressbar#Restore ............... |tlib#progressbar#Restore()|
+ tlib#selection#GetSelection ............ |tlib#selection#GetSelection()|
+ tlib#eval#FormatValue .................. |tlib#eval#FormatValue()|
+ tlib#eval#Extend ....................... |tlib#eval#Extend()|
+ tlib#list#Inject ....................... |tlib#list#Inject()|
+ tlib#list#Compact ...................... |tlib#list#Compact()|
+ tlib#list#Flatten ...................... |tlib#list#Flatten()|
+ tlib#list#FindAll ...................... |tlib#list#FindAll()|
+ tlib#list#Find ......................... |tlib#list#Find()|
+ tlib#list#Any .......................... |tlib#list#Any()|
+ tlib#list#All .......................... |tlib#list#All()|
+ tlib#list#Remove ....................... |tlib#list#Remove()|
+ tlib#list#RemoveAll .................... |tlib#list#RemoveAll()|
+ tlib#list#Zip .......................... |tlib#list#Zip()|
+ tlib#list#Uniq ......................... |tlib#list#Uniq()|
+ tlib#list#ToDictionary ................. |tlib#list#ToDictionary()|
+ tlib#cmd#OutputAsList .................. |tlib#cmd#OutputAsList()|
+ tlib#cmd#BrowseOutput .................. |tlib#cmd#BrowseOutput()|
+ tlib#cmd#BrowseOutputWithCallback ...... |tlib#cmd#BrowseOutputWithCallback()|
+ tlib#cmd#DefaultBrowseOutput ........... |tlib#cmd#DefaultBrowseOutput()|
+ tlib#cmd#ParseScriptname ............... |tlib#cmd#ParseScriptname()|
+ tlib#cmd#TBrowseScriptnames ............ |tlib#cmd#TBrowseScriptnames()|
+ tlib#cmd#UseVertical ................... |tlib#cmd#UseVertical()|
+ tlib#cmd#Time .......................... |tlib#cmd#Time()|
+ tlib#cmd#Capture ....................... |tlib#cmd#Capture()|
+ tlib#syntax#Collect .................... |tlib#syntax#Collect()|
+ tlib#syntax#Names ...................... |tlib#syntax#Names()|
+ tlib#balloon#Register .................. |tlib#balloon#Register()|
+ tlib#balloon#Remove .................... |tlib#balloon#Remove()|
+ tlib#balloon#Expr ...................... |tlib#balloon#Expr()|
+ tlib#balloon#Expand .................... |tlib#balloon#Expand()|
+ g:tlib#vcs#def ......................... |g:tlib#vcs#def|
+ g:tlib#vcs#executables ................. |g:tlib#vcs#executables|
+ g:tlib#vcs#check ....................... |g:tlib#vcs#check|
+ tlib#vcs#Executable .................... |tlib#vcs#Executable()|
+ tlib#vcs#FindVCS ....................... |tlib#vcs#FindVCS()|
+ tlib#vcs#Ls ............................ |tlib#vcs#Ls()|
+ tlib#vcs#Diff .......................... |tlib#vcs#Diff()|
+ tlib#vcs#GitLsPostprocess .............. |tlib#vcs#GitLsPostprocess()|
+ tlib#char#Get .......................... |tlib#char#Get()|
+ tlib#char#IsAvailable .................. |tlib#char#IsAvailable()|
+ tlib#char#GetWithTimeout ............... |tlib#char#GetWithTimeout()|
+ g:tlib#Filter_glob#seq ................. |g:tlib#Filter_glob#seq|
+ g:tlib#Filter_glob#char ................ |g:tlib#Filter_glob#char|
+ tlib#Filter_glob#New ................... |tlib#Filter_glob#New()|
+ g:tlib_scratch_pos ..................... |g:tlib_scratch_pos|
+ g:tlib#scratch#hidden .................. |g:tlib#scratch#hidden|
+ tlib#scratch#UseScratch ................ |tlib#scratch#UseScratch()|
+ tlib#scratch#CloseScratch .............. |tlib#scratch#CloseScratch()|
+ tlib#autocmdgroup#Init ................. |tlib#autocmdgroup#Init()|
+ g:tlib_cache ........................... |g:tlib_cache|
+ g:tlib#cache#purge_days ................ |g:tlib#cache#purge_days|
+ g:tlib#cache#purge_every_days .......... |g:tlib#cache#purge_every_days|
+ g:tlib#cache#script_encoding ........... |g:tlib#cache#script_encoding|
+ g:tlib#cache#run_script ................ |g:tlib#cache#run_script|
+ g:tlib#cache#verbosity ................. |g:tlib#cache#verbosity|
+ g:tlib#cache#dont_purge ................ |g:tlib#cache#dont_purge|
+ g:tlib#cache#max_filename .............. |g:tlib#cache#max_filename|
+ tlib#cache#Dir ......................... |tlib#cache#Dir()|
+ tlib#cache#Filename .................... |tlib#cache#Filename()|
+ tlib#cache#Save ........................ |tlib#cache#Save()|
+ tlib#cache#MTime ....................... |tlib#cache#MTime()|
+ tlib#cache#Get ......................... |tlib#cache#Get()|
+ tlib#cache#Value ....................... |tlib#cache#Value()|
+ tlib#cache#MaybePurge .................. |tlib#cache#MaybePurge()|
+ tlib#cache#Purge ....................... |tlib#cache#Purge()|
+ tlib#cache#ListFilesInCache ............ |tlib#cache#ListFilesInCache()|
+ tlib#normal#WithRegister ............... |tlib#normal#WithRegister()|
+ tlib#time#MSecs ........................ |tlib#time#MSecs()|
+ tlib#time#Now .......................... |tlib#time#Now()|
+ tlib#time#FormatNow .................... |tlib#time#FormatNow()|
+ tlib#time#Diff ......................... |tlib#time#Diff()|
+ tlib#time#DiffMSecs .................... |tlib#time#DiffMSecs()|
+ tlib#var#Let ........................... |tlib#var#Let()|
+ tlib#var#EGet .......................... |tlib#var#EGet()|
+ tlib#var#Get ........................... |tlib#var#Get()|
+ tlib#var#List .......................... |tlib#var#List()|
+ g:tlib_scroll_lines .................... |g:tlib_scroll_lines|
+ tlib#agent#Exit ........................ |tlib#agent#Exit()|
+ tlib#agent#CopyItems ................... |tlib#agent#CopyItems()|
+ tlib#agent#PageUp ...................... |tlib#agent#PageUp()|
+ tlib#agent#PageDown .................... |tlib#agent#PageDown()|
+ tlib#agent#Home ........................ |tlib#agent#Home()|
+ tlib#agent#End ......................... |tlib#agent#End()|
+ tlib#agent#Up .......................... |tlib#agent#Up()|
+ tlib#agent#Down ........................ |tlib#agent#Down()|
+ tlib#agent#UpN ......................... |tlib#agent#UpN()|
+ tlib#agent#DownN ....................... |tlib#agent#DownN()|
+ tlib#agent#ShiftLeft ................... |tlib#agent#ShiftLeft()|
+ tlib#agent#ShiftRight .................. |tlib#agent#ShiftRight()|
+ tlib#agent#Reset ....................... |tlib#agent#Reset()|
+ tlib#agent#ToggleRestrictView .......... |tlib#agent#ToggleRestrictView()|
+ tlib#agent#RestrictView ................ |tlib#agent#RestrictView()|
+ tlib#agent#UnrestrictView .............. |tlib#agent#UnrestrictView()|
+ tlib#agent#Input ....................... |tlib#agent#Input()|
+ tlib#agent#SuspendToParentWindow ....... |tlib#agent#SuspendToParentWindow()|
+ tlib#agent#Suspend ..................... |tlib#agent#Suspend()|
+ tlib#agent#Help ........................ |tlib#agent#Help()|
+ tlib#agent#OR .......................... |tlib#agent#OR()|
+ tlib#agent#AND ......................... |tlib#agent#AND()|
+ tlib#agent#ReduceFilter ................ |tlib#agent#ReduceFilter()|
+ tlib#agent#PopFilter ................... |tlib#agent#PopFilter()|
+ tlib#agent#Debug ....................... |tlib#agent#Debug()|
+ tlib#agent#Select ...................... |tlib#agent#Select()|
+ tlib#agent#SelectUp .................... |tlib#agent#SelectUp()|
+ tlib#agent#SelectDown .................. |tlib#agent#SelectDown()|
+ tlib#agent#SelectAll ................... |tlib#agent#SelectAll()|
+ tlib#agent#ToggleStickyList ............ |tlib#agent#ToggleStickyList()|
+ tlib#agent#EditItem .................... |tlib#agent#EditItem()|
+ tlib#agent#NewItem ..................... |tlib#agent#NewItem()|
+ tlib#agent#DeleteItems ................. |tlib#agent#DeleteItems()|
+ tlib#agent#Cut ......................... |tlib#agent#Cut()|
+ tlib#agent#Copy ........................ |tlib#agent#Copy()|
+ tlib#agent#Paste ....................... |tlib#agent#Paste()|
+ tlib#agent#EditReturnValue ............. |tlib#agent#EditReturnValue()|
+ tlib#agent#ViewFile .................... |tlib#agent#ViewFile()|
+ tlib#agent#EditFile .................... |tlib#agent#EditFile()|
+ tlib#agent#EditFileInSplit ............. |tlib#agent#EditFileInSplit()|
+ tlib#agent#EditFileInVSplit ............ |tlib#agent#EditFileInVSplit()|
+ tlib#agent#EditFileInTab ............... |tlib#agent#EditFileInTab()|
+ tlib#agent#ToggleScrollbind ............ |tlib#agent#ToggleScrollbind()|
+ tlib#agent#ShowInfo .................... |tlib#agent#ShowInfo()|
+ tlib#agent#PreviewLine ................. |tlib#agent#PreviewLine()|
+ tlib#agent#GotoLine .................... |tlib#agent#GotoLine()|
+ tlib#agent#DoAtLine .................... |tlib#agent#DoAtLine()|
+ tlib#agent#Wildcard .................... |tlib#agent#Wildcard()|
+ tlib#agent#Null ........................ |tlib#agent#Null()|
+ tlib#agent#ExecAgentByName ............. |tlib#agent#ExecAgentByName()|
+ tlib#agent#CompleteAgentNames .......... |tlib#agent#CompleteAgentNames()|
+ tlib#agent#Complete .................... |tlib#agent#Complete()|
+ tlib#bitwise#Num2Bits .................. |tlib#bitwise#Num2Bits()|
+ tlib#bitwise#Bits2Num .................. |tlib#bitwise#Bits2Num()|
+ tlib#bitwise#AND ....................... |tlib#bitwise#AND()|
+ tlib#bitwise#OR ........................ |tlib#bitwise#OR()|
+ tlib#bitwise#XOR ....................... |tlib#bitwise#XOR()|
+ tlib#bitwise#ShiftRight ................ |tlib#bitwise#ShiftRight()|
+ tlib#bitwise#ShiftLeft ................. |tlib#bitwise#ShiftLeft()|
+ tlib#bitwise#Add ....................... |tlib#bitwise#Add()|
+ tlib#bitwise#Sub ....................... |tlib#bitwise#Sub()|
+ tlib#url#Decode ........................ |tlib#url#Decode()|
+ tlib#url#DecodeChar .................... |tlib#url#DecodeChar()|
+ tlib#url#EncodeChar .................... |tlib#url#EncodeChar()|
+ tlib#url#Encode ........................ |tlib#url#Encode()|
+ tlib#signs#ClearAll .................... |tlib#signs#ClearAll()|
+ tlib#signs#ClearBuffer ................. |tlib#signs#ClearBuffer()|
+ tlib#signs#Mark ........................ |tlib#signs#Mark()|
+ tlib#rx#Escape ......................... |tlib#rx#Escape()|
+ tlib#rx#EscapeReplace .................. |tlib#rx#EscapeReplace()|
+ tlib#rx#Suffixes ....................... |tlib#rx#Suffixes()|
+ tlib#rx#LooksLikeRegexp ................ |tlib#rx#LooksLikeRegexp()|
+ g:tlib_tags_extra ...................... |g:tlib_tags_extra|
+ g:tlib_tag_substitute .................. |g:tlib_tag_substitute|
+ tlib#tag#Retrieve ...................... |tlib#tag#Retrieve()|
+ tlib#tag#Collect ....................... |tlib#tag#Collect()|
+ tlib#tag#Format ........................ |tlib#tag#Format()|
+ tlib#map#PumAccept ..................... |tlib#map#PumAccept()|
+ tlib#Filter_cnfd#New ................... |tlib#Filter_cnfd#New()|
+ g:tlib#input#sortprefs_threshold ....... |g:tlib#input#sortprefs_threshold|
+ g:tlib#input#livesearch_threshold ...... |g:tlib#input#livesearch_threshold|
+ g:tlib#input#filter_mode ............... |g:tlib#input#filter_mode|
+ g:tlib#input#higroup ................... |g:tlib#input#higroup|
+ g:tlib_pick_last_item .................. |g:tlib_pick_last_item|
+ g:tlib#input#and ....................... |g:tlib#input#and|
+ g:tlib#input#or ........................ |g:tlib#input#or|
+ g:tlib#input#not ....................... |g:tlib#input#not|
+ g:tlib#input#numeric_chars ............. |g:tlib#input#numeric_chars|
+ g:tlib#input#keyagents_InputList_s ..... |g:tlib#input#keyagents_InputList_s|
+ g:tlib#input#keyagents_InputList_m ..... |g:tlib#input#keyagents_InputList_m|
+ g:tlib#input#handlers_EditList ......... |g:tlib#input#handlers_EditList|
+ g:tlib#input#user_shortcuts ............ |g:tlib#input#user_shortcuts|
+ g:tlib#input#use_popup ................. |g:tlib#input#use_popup|
+ g:tlib#input#format_filename ........... |g:tlib#input#format_filename|
+ g:tlib#input#filename_padding_r ........ |g:tlib#input#filename_padding_r|
+ g:tlib#input#filename_max_width ........ |g:tlib#input#filename_max_width|
+ tlib#input#List ........................ |tlib#input#List()|
+ tlib#input#ListD ....................... |tlib#input#ListD()|
+ tlib#input#ListW ....................... |tlib#input#ListW()|
+ tlib#input#EditList .................... |tlib#input#EditList()|
+ tlib#input#Resume ...................... |tlib#input#Resume()|
+ tlib#input#CommandSelect ............... |tlib#input#CommandSelect()|
+ tlib#input#Edit ........................ |tlib#input#Edit()|
+ tlib#input#Dialog ...................... |tlib#input#Dialog()|
+ tlib#number#ConvertBase ................ |tlib#number#ConvertBase()|
+ g:tlib#file#drop ....................... |g:tlib#file#drop|
+ g:tlib#file#use_tabs ................... |g:tlib#file#use_tabs|
+ g:tlib#file#edit_cmds .................. |g:tlib#file#edit_cmds|
+ g:tlib#file#absolute_filename_rx ....... |g:tlib#file#absolute_filename_rx|
+ tlib#file#Split ........................ |tlib#file#Split()|
+ tlib#file#Join ......................... |tlib#file#Join()|
+ tlib#file#Relative ..................... |tlib#file#Relative()|
+ tlib#file#IsAbsolute ................... |tlib#file#IsAbsolute()|
+ tlib#file#Absolute ..................... |tlib#file#Absolute()|
+ tlib#file#Canonic ...................... |tlib#file#Canonic()|
+ tlib#file#With ......................... |tlib#file#With()|
+ tlib#file#Edit ......................... |tlib#file#Edit()|
+ tlib#file#Glob ......................... |tlib#file#Glob()|
+ tlib#file#Globpath ..................... |tlib#file#Globpath()|
+ g:tlib#sys#special_protocols ........... |g:tlib#sys#special_protocols|
+ g:tlib#sys#special_suffixes ............ |g:tlib#sys#special_suffixes|
+ g:tlib#sys#system_rx ................... |g:tlib#sys#system_rx|
+ g:tlib#sys#system_browser .............. |g:tlib#sys#system_browser|
+ g:tlib#sys#windows ..................... |g:tlib#sys#windows|
+ g:tlib#sys#null ........................ |g:tlib#sys#null|
+ tlib#sys#IsCygwinBin ................... |tlib#sys#IsCygwinBin()|
+ tlib#sys#IsExecutable .................. |tlib#sys#IsExecutable()|
+ g:tlib#sys#check_cygpath ............... |g:tlib#sys#check_cygpath|
+ g:tlib#sys#cygwin_path_rx .............. |g:tlib#sys#cygwin_path_rx|
+ g:tlib#sys#cygwin_expr ................. |g:tlib#sys#cygwin_expr|
+ tlib#sys#GetCmd ........................ |tlib#sys#GetCmd()|
+ tlib#sys#MaybeUseCygpath ............... |tlib#sys#MaybeUseCygpath()|
+ tlib#sys#ConvertPath ................... |tlib#sys#ConvertPath()|
+ tlib#sys#FileArgs ...................... |tlib#sys#FileArgs()|
+ tlib#sys#IsSpecial ..................... |tlib#sys#IsSpecial()|
+ tlib#sys#Open .......................... |tlib#sys#Open()|
+ tlib#sys#SystemInDir ................... |tlib#sys#SystemInDir()|
+ tlib#paragraph#GetMetric ............... |tlib#paragraph#GetMetric()|
+ tlib#paragraph#Move .................... |tlib#paragraph#Move()|
+ g:tlib_inputlist_pct ................... |g:tlib_inputlist_pct|
+ g:tlib_inputlist_width_filename ........ |g:tlib_inputlist_width_filename|
+ g:tlib_inputlist_filename_indicators ... |g:tlib_inputlist_filename_indicators|
+ g:tlib_inputlist_shortmessage .......... |g:tlib_inputlist_shortmessage|
+ tlib#World#New ......................... |tlib#World#New()|
+ prototype.PrintLines
+ prototype.Suspend
+ tlib#loclist#Browse .................... |tlib#loclist#Browse()|
+ tlib#tab#BufMap ........................ |tlib#tab#BufMap()|
+ tlib#tab#TabWinNr ...................... |tlib#tab#TabWinNr()|
+ tlib#tab#Set ........................... |tlib#tab#Set()|
+ tlib#date#IsDate ....................... |tlib#date#IsDate()|
+ tlib#date#Format ....................... |tlib#date#Format()|
+ tlib#date#DiffInDays ................... |tlib#date#DiffInDays()|
+ tlib#date#Parse ........................ |tlib#date#Parse()|
+ tlib#date#SecondsSince1970 ............. |tlib#date#SecondsSince1970()|
+ tlib#date#Shift ........................ |tlib#date#Shift()|
+ tlib#date#AddDays ...................... |tlib#date#AddDays()|
+ tlib#type#Enable ....................... |tlib#type#Enable()|
+ tlib#type#Disable ...................... |tlib#type#Disable()|
+ tlib#type#IsNumber ..................... |tlib#type#IsNumber()|
+ tlib#type#IsString ..................... |tlib#type#IsString()|
+ tlib#type#IsFuncref .................... |tlib#type#IsFuncref()|
+ tlib#type#IsList ....................... |tlib#type#IsList()|
+ tlib#type#IsDictionary ................. |tlib#type#IsDictionary()|
+ tlib#type#Is ........................... |tlib#type#Is()|
+ tlib#type#Are .......................... |tlib#type#Are()|
+ tlib#type#Define ....................... |tlib#type#Define()|
+ tlib#type#Has .......................... |tlib#type#Has()|
+ tlib#type#Have ......................... |tlib#type#Have()|
+ tlib#type#Check ........................ |tlib#type#Check()|
+ tlib#Filter_fuzzy#New .................. |tlib#Filter_fuzzy#New()|
+ tlib#assert#Enable ..................... |tlib#assert#Enable()|
+ tlib#assert#Disable .................... |tlib#assert#Disable()|
+ tlib#assert#Assert ..................... |tlib#assert#Assert()|
+ tlib#assert#Map ........................ |tlib#assert#Map()|
+ tlib#assert#All ........................ |tlib#assert#All()|
+ tlib#textobjects#StandardParagraph ..... |standard-paragraph|
+ tlib#textobjects#Init .................. |tlib#textobjects#Init()|
+ v_sp ................................... |v_sp|
+ o_sp ................................... |o_sp|
+ tlib#arg#Get ........................... |tlib#arg#Get()|
+ tlib#arg#Let ........................... |tlib#arg#Let()|
+ tlib#arg#StringAsKeyArgs ............... |tlib#arg#StringAsKeyArgs()|
+ tlib#arg#StringAsKeyArgsEqual .......... |tlib#arg#StringAsKeyArgsEqual()|
+ tlib#arg#GetOpts ....................... |tlib#arg#GetOpts()|
+ tlib#arg#Ex ............................ |tlib#arg#Ex()|
+ tlib#fixes#Winpos ...................... |tlib#fixes#Winpos()|
+ g:tlib#dir#sep ......................... |g:tlib#dir#sep|
+ tlib#dir#CanonicName ................... |tlib#dir#CanonicName()|
+ tlib#dir#NativeName .................... |tlib#dir#NativeName()|
+ tlib#dir#PlainName ..................... |tlib#dir#PlainName()|
+ tlib#dir#Ensure ........................ |tlib#dir#Ensure()|
+ tlib#dir#MyRuntime ..................... |tlib#dir#MyRuntime()|
+ tlib#dir#CD ............................ |tlib#dir#CD()|
+ tlib#dir#Push .......................... |tlib#dir#Push()|
+ tlib#dir#Pop ........................... |tlib#dir#Pop()|
+ g:tlib#hash#use_crc32 .................. |g:tlib#hash#use_crc32|
+ g:tlib#hash#use_adler32 ................ |g:tlib#hash#use_adler32|
+ tlib#hash#CRC32B ....................... |tlib#hash#CRC32B()|
+ tlib#hash#CRC32B_ruby .................. |tlib#hash#CRC32B_ruby()|
+ tlib#hash#CRC32B_vim ................... |tlib#hash#CRC32B_vim()|
+ tlib#hash#Adler32 ...................... |tlib#hash#Adler32()|
+ tlib#hash#Adler32_vim .................. |tlib#hash#Adler32_vim()|
+ tlib#hash#Adler32_tlib ................. |tlib#hash#Adler32_tlib()|
+ tlib#win#Set ........................... |tlib#win#Set()|
+ tlib#win#GetLayout ..................... |tlib#win#GetLayout()|
+ tlib#win#SetLayout ..................... |tlib#win#SetLayout()|
+ tlib#win#List .......................... |tlib#win#List()|
+ tlib#win#Width ......................... |tlib#win#Width()|
+ tlib#win#WinDo ......................... |tlib#win#WinDo()|
+ tlib#comments#Comments ................. |tlib#comments#Comments()|
+ tlib#grep#Do ........................... |tlib#grep#Do()|
+ tlib#grep#LocList ...................... |tlib#grep#LocList()|
+ tlib#grep#QuickFixList ................. |tlib#grep#QuickFixList()|
+ tlib#grep#List ......................... |tlib#grep#List()|
+ tlib#qfl#FormatQFLE .................... |tlib#qfl#FormatQFLE()|
+ tlib#qfl#QfeFilename ................... |tlib#qfl#QfeFilename()|
+ tlib#qfl#InitListBuffer ................ |tlib#qfl#InitListBuffer()|
+ tlib#qfl#SetSyntax ..................... |tlib#qfl#SetSyntax()|
+ tlib#qfl#Balloon ....................... |tlib#qfl#Balloon()|
+ tlib#qfl#AgentEditQFE .................. |tlib#qfl#AgentEditQFE()|
+ tlib#qfl#AgentPreviewQFE ............... |tlib#qfl#AgentPreviewQFE()|
+ tlib#qfl#AgentGotoQFE .................. |tlib#qfl#AgentGotoQFE()|
+ tlib#qfl#AgentWithSelected ............. |tlib#qfl#AgentWithSelected()|
+ tlib#qfl#RunCmdOnSelected .............. |tlib#qfl#RunCmdOnSelected()|
+ tlib#qfl#AgentSplitBuffer .............. |tlib#qfl#AgentSplitBuffer()|
+ tlib#qfl#AgentTabBuffer ................ |tlib#qfl#AgentTabBuffer()|
+ tlib#qfl#AgentVSplitBuffer ............. |tlib#qfl#AgentVSplitBuffer()|
+ tlib#qfl#AgentEditLine ................. |tlib#qfl#AgentEditLine()|
+ tlib#qfl#EditLine ...................... |tlib#qfl#EditLine()|
+ tlib#qfl#SetFollowCursor ............... |tlib#qfl#SetFollowCursor()|
+ tlib#qfl#QflList ....................... |tlib#qfl#QflList()|
+ tlib#qfl#Browse ........................ |tlib#qfl#Browse()|
+ tlib#Filter_cnf#New .................... |tlib#Filter_cnf#New()|
+ prototype.Pretty
+ tlib#Object#New ........................ |tlib#Object#New()|
+ prototype.New
+ prototype.Inherit
+ prototype.Extend
+ prototype.IsA
+ prototype.IsRelated
+ prototype.RespondTo
+ prototype.Super
+ tlib#Object#Methods .................... |tlib#Object#Methods()|
+ g:tlib_viewline_position ............... |g:tlib_viewline_position|
+ tlib#buffer#EnableMRU .................. |tlib#buffer#EnableMRU()|
+ tlib#buffer#DisableMRU ................. |tlib#buffer#DisableMRU()|
+ tlib#buffer#Set ........................ |tlib#buffer#Set()|
+ tlib#buffer#Eval ....................... |tlib#buffer#Eval()|
+ tlib#buffer#GetList .................... |tlib#buffer#GetList()|
+ tlib#buffer#ViewLine ................... |tlib#buffer#ViewLine()|
+ tlib#buffer#HighlightLine .............. |tlib#buffer#HighlightLine()|
+ tlib#buffer#DeleteRange ................ |tlib#buffer#DeleteRange()|
+ tlib#buffer#ReplaceRange ............... |tlib#buffer#ReplaceRange()|
+ tlib#buffer#ScratchStart ............... |tlib#buffer#ScratchStart()|
+ tlib#buffer#ScratchEnd ................. |tlib#buffer#ScratchEnd()|
+ tlib#buffer#BufDo ...................... |tlib#buffer#BufDo()|
+ tlib#buffer#InsertText ................. |tlib#buffer#InsertText()|
+ tlib#buffer#InsertText0 ................ |tlib#buffer#InsertText0()|
+ tlib#buffer#CurrentByte ................ |tlib#buffer#CurrentByte()|
+ tlib#buffer#KeepCursorPosition ......... |tlib#buffer#KeepCursorPosition()|
+ tlib#hook#Run .......................... |tlib#hook#Run()|
+ tlib#string#RemoveBackslashes .......... |tlib#string#RemoveBackslashes()|
+ tlib#string#Chomp ...................... |tlib#string#Chomp()|
+ tlib#string#Format ..................... |tlib#string#Format()|
+ tlib#string#Printf1 .................... |tlib#string#Printf1()|
+ tlib#string#TrimLeft ................... |tlib#string#TrimLeft()|
+ tlib#string#TrimRight .................. |tlib#string#TrimRight()|
+ tlib#string#Strip ...................... |tlib#string#Strip()|
+ tlib#string#Count ...................... |tlib#string#Count()|
+ tlib#string#SplitCommaList ............. |tlib#string#SplitCommaList()|
+ tlib#string#Input ...................... |tlib#string#Input()|
+
+
+========================================================================
+plugin/02tlib.vim~
+
+ *:TLet*
+:TLet VAR = VALUE
+ Set a variable only if it doesn't already exist.
+ EXAMPLES: >
+ TLet foo = 1
+ TLet foo = 2
+ echo foo
+ => 1
+<
+
+ *:TScratch*
+:TScratch
+ Open a scratch buffer (a buffer without a file).
+ TScratch ... use split window
+ TScratch! ... use the whole frame
+ This command takes an (inner) dictionary as optional argument.
+ EXAMPLES: >
+ TScratch 'scratch': '__FOO__'
+ => Open a scratch buffer named __FOO__
+<
+
+ *:TVarArg*
+:TVarArg VAR1, [VAR2, DEFAULT2] ...
+ A convenience wrapper for |tlib#arg#Let|.
+ EXAMPLES: >
+ function! Foo(...)
+ TVarArg ['a', 1], 'b'
+ echo 'a='. a
+ echo 'b='. b
+ endf
+<
+
+ *:TBrowseOutput*
+:TBrowseOutput COMMAND
+ Ever wondered how to efficiently browse the output of a command
+ without redirecting it to a file? This command takes a command as
+ argument and presents the output via |tlib#input#List()| so that you
+ can easily search for a keyword (e.g. the name of a variable or
+ function) and the like.
+
+ If you press enter, the selected line will be copied to the command
+ line. Press ESC to cancel browsing.
+
+ EXAMPLES: >
+ TBrowseOutput 20verb TeaseTheCulprit
+<
+
+ *:TBrowseScriptnames*
+:TBrowseScriptnames
+ List all sourced script names (the output of ':scriptnames').
+
+ When you press enter, the selected script will be opened in the current
+ window. Press ESC to cancel.
+
+ EXAMPLES: >
+ TBrowseScriptnames
+<
+
+ *:Tlibtrace*
+:Tlibtrace GUARD, VAR1, VAR2...
+ Do nothing unless |tlib#trace#Enable()| was called.
+
+ When |:Tlibtraceset| or |tlib#trace#Enable()| were called:
+
+ If GUARD is a number that evaluates to true or if it is a string that
+ matches a |regexp|, which was added using Tlibtrace! (with '!'),
+ display the values of VAR1, VAR2 ...
+
+ *:Tlibtraceset*
+:Tlibtraceset
+ :Tlibtraceset +RX1, -RX2...
+ If |tlib#trace#Enable()| was called: With the optional <bang>, users
+ can add and remove GUARDs (actually a |regexp|) that should be traced.
+
+ *:Tlibassert*
+:Tlibtrace ASSERTION
+
+ *:Tlibtype*
+:Tlibtype val, 'type', ...
+
+
+========================================================================
+test/tlib.vim~
+
+ *Add()*
+Add(a,b)
+ List
+
+ *TestGetArg()*
+TestGetArg(...)
+ Optional arguments
+
+ *TestGetArg1()*
+TestGetArg1(...)
+
+ *TestArgs()*
+TestArgs(...)
+
+ *TestArgs1()*
+TestArgs1(...)
+
+ *TestArgs2()*
+TestArgs2(...)
+
+ *TestArgs3()*
+TestArgs3(...)
+
+
+========================================================================
+autoload/tlib.vim~
+
+ *g:tlib#debug*
+g:tlib#debug
+
+
+========================================================================
+autoload/tlib/notify.vim~
+
+ *tlib#notify#Echo()*
+tlib#notify#Echo(text, ?style='')
+ Print text in the echo area. Temporarily disable 'ruler' and 'showcmd'
+ in order to prevent |press-enter| messages.
+
+ *tlib#notify#TrimMessage()*
+tlib#notify#TrimMessage(message)
+ Contributed by Erik Falor:
+ If the line containing the message is too long, echoing it will cause
+ a 'Hit ENTER' prompt to appear. This function cleans up the line so
+ that does not happen.
+ The echoed line is too long if it is wider than the width of the
+ window, minus cmdline space taken up by the ruler and showcmd
+ features.
+
+ *tlib#notify#PrintError()*
+tlib#notify#PrintError()
+
+
+========================================================================
+autoload/tlib/trace.vim~
+
+ *g:tlib#trace#backtrace*
+g:tlib#trace#backtrace (default: 2)
+ The length of the backtrace that should be included in
+ |tlib#trace#Print()|.
+
+ *g:tlib#trace#printer*
+g:tlib#trace#printer (default: 'echom')
+ Possible values:
+ - 'echom'
+ - ['file', FILENAME]
+
+ *g:tlib#trace#hl*
+g:tlib#trace#hl (default: {'error': 'ErrorMsg', 'fatal': 'ErrorMsg', 'warn': 'WarningMsg'})
+
+ *tlib#trace#Printer_echom()*
+tlib#trace#Printer_echom(type, text, args)
+ Print traces from |tlib#trace#Print()|.
+
+ *tlib#trace#Printer_file()*
+tlib#trace#Printer_file(type, text, args)
+
+ *tlib#trace#Set()*
+tlib#trace#Set(vars)
+ Set the tracing |regexp|. See |:Tlibtrace|.
+ This will also call |tlib#trace#Enable()|.
+
+ Examples:
+ call tlib#trace#Set(["+foo", "-bar"])
+ call tlib#trace#Set("+foo,-bar")
+
+ *tlib#trace#Backtrace()*
+tlib#trace#Backtrace(caller)
+
+ *tlib#trace#Print()*
+tlib#trace#Print(caller, vars, values)
+ Print the values of vars. The first value is a "guard" (see
+ |:Tlibtrace|).
+
+ *tlib#trace#Enable()*
+tlib#trace#Enable()
+ Enable tracing via |:Tlibtrace|.
+
+ *tlib#trace#Disable()*
+tlib#trace#Disable()
+ Disable tracing via |:Tlibtrace|.
+
+
+========================================================================
+autoload/tlib/dictionary.vim~
+
+ *tlib#dictionary#Rev()*
+tlib#dictionary#Rev(dict, ?opts = {}) abort "{{{3
+
+
+========================================================================
+autoload/tlib/persistent.vim~
+
+ *g:tlib_persistent*
+g:tlib_persistent (default: '')
+ The directory for persistent data files. If empty, use
+ |tlib#dir#MyRuntime|.'/share'.
+
+ *tlib#persistent#Dir()*
+tlib#persistent#Dir(?mode = 'bg')
+ Return the full directory name for persistent data files.
+
+ *tlib#persistent#Filename()*
+tlib#persistent#Filename(type, ?file=%, ?mkdir=0)
+
+ *tlib#persistent#Get()*
+tlib#persistent#Get(...)
+
+ *tlib#persistent#MTime()*
+tlib#persistent#MTime(cfile)
+
+ *tlib#persistent#Value()*
+tlib#persistent#Value(...)
+
+ *tlib#persistent#Save()*
+tlib#persistent#Save(cfile, dictionary)
+
+
+========================================================================
+autoload/tlib/vim.vim~
+
+ *g:tlib#vim#simalt_maximize*
+g:tlib#vim#simalt_maximize (default: 'x')
+ The alt-key for maximizing the window.
+ CAUTION: The value of this paramter depends on your locale and
+ maybe the windows version you are running.
+
+ *g:tlib#vim#simalt_restore*
+g:tlib#vim#simalt_restore (default: 'r')
+ The alt-key for restoring the window.
+ CAUTION: The value of this paramter depends on your locale and
+ maybe the windows version you are running.
+
+ *g:tlib#vim#use_vimtweak*
+g:tlib#vim#use_vimtweak (default: 0)
+ If true, use the vimtweak.dll for windows. This will enable
+ tlib to remove the caption for fullscreen windows.
+
+ *tlib#vim#Maximize()*
+tlib#vim#Maximize(fullscreen)
+ Maximize the window.
+ You might need to redefine |g:tlib#vim#simalt_maximize| if it doesn't
+ work for you.
+
+ *tlib#vim#RestoreWindow()*
+tlib#vim#RestoreWindow()
+ Restore the original vimsize after having called |tlib#vim#Maximize()|.
+
+ *g:tlib#vim#use_wmctrl*
+g:tlib#vim#use_wmctrl (default: executable('wmctrl'))
+ If true, use wmctrl for X windows to make a window
+ maximized/fullscreen.
+
+ This is the preferred method for maximizing windows under X
+ windows. Some window managers have problem coping with the
+ default method of setting 'lines' and 'columns' to a large
+ value.
+
+ *tlib#vim#CopyFunction()*
+tlib#vim##CopyFunction(old, new, overwrite=0)
+
+
+========================================================================
+autoload/tlib/progressbar.vim~
+
+ *tlib#progressbar#Init()*
+tlib#progressbar#Init(max, ...)
+ EXAMPLE: >
+ call tlib#progressbar#Init(20)
+ try
+ for i in range(20)
+ call tlib#progressbar#Display(i)
+ call DoSomethingThatTakesSomeTime(i)
+ endfor
+ finally
+ call tlib#progressbar#Restore()
+ endtry
+<
+
+ *tlib#progressbar#Display()*
+tlib#progressbar#Display(value, ...)
+
+ *tlib#progressbar#Restore()*
+tlib#progressbar#Restore()
+
+
+========================================================================
+autoload/tlib/selection.vim~
+
+ *tlib#selection#GetSelection()*
+tlib#selection#GetSelection(mode, ?mbeg="'<", ?mend="'>", ?opmode='selection')
+ mode can be one of: selection, lines, block
+
+
+========================================================================
+autoload/tlib/eval.vim~
+
+ *tlib#eval#FormatValue()*
+tlib#eval#FormatValue(value, ...)
+
+ *tlib#eval#Extend()*
+tlib#eval#Extend(a, b, ...)
+
+
+========================================================================
+autoload/tlib/list.vim~
+
+ *tlib#list#Inject()*
+tlib#list#Inject(list, initial_value, funcref)
+ EXAMPLES: >
+ echo tlib#list#Inject([1,2,3], 0, function('Add')
+ => 6
+<
+
+ *tlib#list#Compact()*
+tlib#list#Compact(list)
+ EXAMPLES: >
+ tlib#list#Compact([0,1,2,3,[], {}, ""])
+ => [1,2,3]
+<
+
+ *tlib#list#Flatten()*
+tlib#list#Flatten(list)
+ EXAMPLES: >
+ tlib#list#Flatten([0,[1,2,[3,""]]])
+ => [0,1,2,3,""]
+<
+
+ *tlib#list#FindAll()*
+tlib#list#FindAll(list, filter, ?process_expr="")
+ Basically the same as filter()
+
+ EXAMPLES: >
+ tlib#list#FindAll([1,2,3], 'v:val >= 2')
+ => [2, 3]
+<
+
+ *tlib#list#Find()*
+tlib#list#Find(list, filter, ?default="", ?process_expr="")
+
+ EXAMPLES: >
+ tlib#list#Find([1,2,3], 'v:val >= 2')
+ => 2
+<
+
+ *tlib#list#Any()*
+tlib#list#Any(list, expr)
+ EXAMPLES: >
+ tlib#list#Any([1,2,3], 'v:val >= 2')
+ => 1
+<
+
+ *tlib#list#All()*
+tlib#list#All(list, expr)
+ EXAMPLES: >
+ tlib#list#All([1,2,3], 'v:val >= 2')
+ => 0
+<
+
+ *tlib#list#Remove()*
+tlib#list#Remove(list, element)
+ EXAMPLES: >
+ tlib#list#Remove([1,2,1,2], 2)
+ => [1,1,2]
+<
+
+ *tlib#list#RemoveAll()*
+tlib#list#RemoveAll(list, element)
+ EXAMPLES: >
+ tlib#list#RemoveAll([1,2,1,2], 2)
+ => [1,1]
+<
+
+ *tlib#list#Zip()*
+tlib#list#Zip(lists, ?default='')
+ EXAMPLES: >
+ tlib#list#Zip([[1,2,3], [4,5,6]])
+ => [[1,4], [2,5], [3,6]]
+<
+
+ *tlib#list#Uniq()*
+tlib#list#Uniq(list, ...)
+
+ *tlib#list#ToDictionary()*
+tlib#list#ToDictionary(list, default, ...)
+
+
+========================================================================
+autoload/tlib/cmd.vim~
+
+ *tlib#cmd#OutputAsList()*
+tlib#cmd#OutputAsList(command)
+
+ *tlib#cmd#BrowseOutput()*
+tlib#cmd#BrowseOutput(command)
+ See |:TBrowseOutput|.
+
+ *tlib#cmd#BrowseOutputWithCallback()*
+tlib#cmd#BrowseOutputWithCallback(callback, command)
+ Execute COMMAND and present its output in a |tlib#input#List()|;
+ when a line is selected, execute the function named as the CALLBACK
+ and pass in that line as an argument.
+
+ The CALLBACK function gives you an opportunity to massage the COMMAND output
+ and possibly act on it in a meaningful way. For example, if COMMAND listed
+ all URIs found in the current buffer, CALLBACK could validate and then open
+ the selected URI in the system's default browser.
+
+ This function is meant to be a tool to help compose the implementations of
+ powerful commands that use |tlib#input#List()| as a common interface. See
+ |TBrowseScriptnames| as an example.
+
+ EXAMPLES: >
+ call tlib#cmd#BrowseOutputWithCallback('tlib#cmd#ParseScriptname', 'scriptnames')
+<
+
+ *tlib#cmd#DefaultBrowseOutput()*
+tlib#cmd#DefaultBrowseOutput(cmd)
+
+ *tlib#cmd#ParseScriptname()*
+tlib#cmd#ParseScriptname(line)
+
+ *tlib#cmd#TBrowseScriptnames()*
+tlib#cmd#TBrowseScriptnames()
+
+ *tlib#cmd#UseVertical()*
+tlib#cmd#UseVertical(?rx='')
+ Look at the history whether the command was called with vertical. If
+ an rx is provided check first if the last entry in the history matches
+ this rx.
+
+ *tlib#cmd#Time()*
+tlib#cmd#Time(cmd)
+ Print the time in seconds or milliseconds (if your version of VIM
+ has |+reltime|) a command takes.
+
+ *tlib#cmd#Capture()*
+tlib#cmd#Capture(cmd)
+
+
+========================================================================
+autoload/tlib/syntax.vim~
+
+ *tlib#syntax#Collect()*
+tlib#syntax#Collect()
+
+ *tlib#syntax#Names()*
+tlib#syntax#Names(?rx='')
+
+
+========================================================================
+autoload/tlib/balloon.vim~
+
+ *tlib#balloon#Register()*
+tlib#balloon#Register(expr)
+
+ *tlib#balloon#Remove()*
+tlib#balloon#Remove(expr)
+
+ *tlib#balloon#Expr()*
+tlib#balloon#Expr()
+
+ *tlib#balloon#Expand()*
+tlib#balloon#Expand(expr)
+
+
+========================================================================
+autoload/tlib/vcs.vim~
+
+ *g:tlib#vcs#def*
+g:tlib#vcs#def {...}
+ A dictionarie of supported VCS (currently: git, hg, svn, bzr).
+
+ *g:tlib#vcs#executables*
+g:tlib#vcs#executables {...}
+ A dictionary of custom executables for VCS commands. If the value is
+ empty, support for that VCS will be removed. If no key is present, it
+ is assumed that the VCS "type" is the name of the executable.
+
+ *g:tlib#vcs#check*
+g:tlib#vcs#check (default: has('win16') || has('win32') || has('win64') ? '%s.exe' : '%s')
+ If non-empty, use it as a format string to check whether a VCS is
+ installed on your computer.
+
+ *tlib#vcs#Executable()*
+tlib#vcs#Executable(type)
+
+ *tlib#vcs#FindVCS()*
+tlib#vcs#FindVCS(filename)
+
+ *tlib#vcs#Ls()*
+tlib#vcs#Ls(?filename=bufname('%'), ?vcs=[type, dir])
+ Return the files under VCS.
+
+ *tlib#vcs#Diff()*
+tlib#vcs#Diff(filename, ?vcs=[type, dir])
+ Return the diff for "filename"
+
+ *tlib#vcs#GitLsPostprocess()*
+tlib#vcs#GitLsPostprocess(filename)
+
+
+========================================================================
+autoload/tlib/char.vim~
+
+ *tlib#char#Get()*
+tlib#char#Get(?timeout=0)
+ Get a character.
+
+ EXAMPLES: >
+ echo tlib#char#Get()
+ echo tlib#char#Get(5)
+<
+
+ *tlib#char#IsAvailable()*
+tlib#char#IsAvailable()
+
+ *tlib#char#GetWithTimeout()*
+tlib#char#GetWithTimeout(timeout, ...)
+
+
+========================================================================
+autoload/tlib/Filter_glob.vim~
+
+ *g:tlib#Filter_glob#seq*
+g:tlib#Filter_glob#seq (default: '*')
+ A character that should be expanded to '\.\{-}'.
+
+ *g:tlib#Filter_glob#char*
+g:tlib#Filter_glob#char (default: '?')
+ A character that should be expanded to '\.\?'.
+
+ *tlib#Filter_glob#New()*
+tlib#Filter_glob#New(...)
+ The same as |tlib#Filter_cnf#New()| but a a customizable character
+ |see tlib#Filter_glob#seq| is expanded to '\.\{-}' and
+ |g:tlib#Filter_glob#char| is expanded to '\.'.
+ The pattern is a '/\V' very no-'/magic' regexp pattern.
+
+
+========================================================================
+autoload/tlib/scratch.vim~
+
+ *g:tlib_scratch_pos*
+g:tlib_scratch_pos (default: 'botright')
+ Scratch window position. By default the list window is opened on the
+ bottom. Set this variable to 'topleft' or '' to change this behaviour.
+ See |tlib#input#List()|.
+
+ *g:tlib#scratch#hidden*
+g:tlib#scratch#hidden (default: 'hide')
+ If you want the scratch buffer to be fully removed, you might want to
+ set this variable to 'wipe'.
+ See also https://github.com/tomtom/tlib_vim/pull/16
+
+ *tlib#scratch#UseScratch()*
+tlib#scratch#UseScratch(?keyargs={})
+ Display a scratch buffer (a buffer with no file). See :TScratch for an
+ example.
+ Return the scratch buffer's number.
+ Values for keyargs:
+ scratch_split ... 1: split, 0: window, -1: tab
+
+ *tlib#scratch#CloseScratch()*
+tlib#scratch#CloseScratch(keyargs, ...)
+ Close a scratch buffer as defined in keyargs (usually a World).
+ Return 1 if the scratch buffer is closed (or if it already was
+ closed).
+
+
+========================================================================
+autoload/tlib/autocmdgroup.vim~
+
+ *tlib#autocmdgroup#Init()*
+tlib#autocmdgroup#Init()
+
+
+========================================================================
+autoload/tlib/cache.vim~
+
+ *g:tlib_cache*
+g:tlib_cache (default: '')
+ The cache directory. If empty, use |tlib#dir#MyRuntime|.'/cache'.
+ You might want to delete old files from this directory from time to
+ time with a command like: >
+ find ~/vimfiles/cache/ -atime +31 -type f -print -delete
+<
+
+ *g:tlib#cache#purge_days*
+g:tlib#cache#purge_days (default: 31)
+ |tlib#cache#Purge()|: Remove cache files older than N days.
+
+ *g:tlib#cache#purge_every_days*
+g:tlib#cache#purge_every_days (default: 31)
+ Purge the cache every N days. Disable automatic purging by setting
+ this value to a negative value.
+
+ *g:tlib#cache#script_encoding*
+g:tlib#cache#script_encoding (default: &enc)
+ The encoding used for the purge-cache script.
+ Default: 'enc'
+
+ *g:tlib#cache#run_script*
+g:tlib#cache#run_script (default: 1)
+ Whether to run the directory removal script:
+ 0 ... No
+ 1 ... Query user
+ 2 ... Yes
+
+ *g:tlib#cache#verbosity*
+g:tlib#cache#verbosity (default: 1)
+ Verbosity level:
+ 0 ... Be quiet
+ 1 ... Display informative message
+ 2 ... Display detailed messages
+
+ *g:tlib#cache#dont_purge*
+g:tlib#cache#dont_purge (default: ['[\/]\.last_purge$'])
+ A list of regexps that are matched against partial filenames of the
+ cached files. If a regexp matches, the file won't be removed by
+ |tlib#cache#Purge()|.
+
+ *g:tlib#cache#max_filename*
+g:tlib#cache#max_filename (default: 200)
+ If the cache filename is longer than N characters, use
+ |pathshorten()|.
+
+ *tlib#cache#Dir()*
+tlib#cache#Dir(?mode = 'bg')
+ The default cache directory.
+
+ *tlib#cache#Filename()*
+tlib#cache#Filename(type, ?file=%, ?mkdir=0, ?dir='')
+
+ *tlib#cache#Save()*
+tlib#cache#Save(cfile, dictionary, ...)
+
+ *tlib#cache#MTime()*
+tlib#cache#MTime(cfile)
+
+ *tlib#cache#Get()*
+tlib#cache#Get(cfile, ...)
+
+ *tlib#cache#Value()*
+tlib#cache#Value(cfile, generator, ftime, ?generator_args=[], ?options={})
+ Get a cached value from cfile. If it is outdated (compared to ftime)
+ or does not exist, create it calling a generator function.
+
+ *tlib#cache#MaybePurge()*
+tlib#cache#MaybePurge()
+ Call |tlib#cache#Purge()| if the last purge was done before
+ |g:tlib#cache#purge_every_days|.
+
+ *tlib#cache#Purge()*
+tlib#cache#Purge()
+ Delete old files.
+
+ *tlib#cache#ListFilesInCache()*
+tlib#cache#ListFilesInCache(...)
+
+
+========================================================================
+autoload/tlib/normal.vim~
+
+ *tlib#normal#WithRegister()*
+tlib#normal#WithRegister(cmd, ?register='t', ?norm_cmd='norm!')
+ Execute a normal command while maintaining all registers.
+
+
+========================================================================
+autoload/tlib/time.vim~
+
+ *tlib#time#MSecs()*
+tlib#time#MSecs()
+
+ *tlib#time#Now()*
+tlib#time#Now()
+
+ *tlib#time#FormatNow()*
+tlib#time#FormatNow()
+
+ *tlib#time#Diff()*
+tlib#time#Diff(a, b, ...)
+
+ *tlib#time#DiffMSecs()*
+tlib#time#DiffMSecs(a, b, ...)
+
+
+========================================================================
+autoload/tlib/var.vim~
+
+ *tlib#var#Let()*
+tlib#var#Let(name, val)
+ Define a variable called NAME if yet undefined.
+ You can also use the :TLLet command.
+
+ EXAMPLES: >
+ exec tlib#var#Let('g:foo', 1)
+ TLet g:foo = 1
+<
+
+ *tlib#var#EGet()*
+tlib#var#EGet(var, namespace, ?default='')
+ Retrieve a variable by searching several namespaces.
+
+ EXAMPLES: >
+ let g:foo = 1
+ let b:foo = 2
+ let w:foo = 3
+ echo eval(tlib#var#EGet('foo', 'vg')) => 1
+ echo eval(tlib#var#EGet('foo', 'bg')) => 2
+ echo eval(tlib#var#EGet('foo', 'wbg')) => 3
+<
+
+ *tlib#var#Get()*
+tlib#var#Get(var, namespace, ?default='')
+ Retrieve a variable by searching several namespaces.
+
+ EXAMPLES: >
+ let g:foo = 1
+ let b:foo = 2
+ let w:foo = 3
+ echo tlib#var#Get('foo', 'bg') => 1
+ echo tlib#var#Get('foo', 'bg') => 2
+ echo tlib#var#Get('foo', 'wbg') => 3
+<
+
+ *tlib#var#List()*
+tlib#var#List(rx, ?prefix='')
+ Get a list of variables matching rx.
+ EXAMPLE:
+ echo tlib#var#List('tlib_', 'g:')
+
+
+========================================================================
+autoload/tlib/agent.vim~
+Various agents for use as key handlers in tlib#input#List()
+
+ *g:tlib_scroll_lines*
+g:tlib_scroll_lines (default: 10)
+ Number of items to move when pressing <c-up/down> in the input list window.
+
+ *tlib#agent#Exit()*
+tlib#agent#Exit(world, selected)
+
+ *tlib#agent#CopyItems()*
+tlib#agent#CopyItems(world, selected)
+
+ *tlib#agent#PageUp()*
+tlib#agent#PageUp(world, selected)
+
+ *tlib#agent#PageDown()*
+tlib#agent#PageDown(world, selected)
+
+ *tlib#agent#Home()*
+tlib#agent#Home(world, selected)
+
+ *tlib#agent#End()*
+tlib#agent#End(world, selected)
+
+ *tlib#agent#Up()*
+tlib#agent#Up(world, selected, ...)
+
+ *tlib#agent#Down()*
+tlib#agent#Down(world, selected, ...)
+
+ *tlib#agent#UpN()*
+tlib#agent#UpN(world, selected)
+
+ *tlib#agent#DownN()*
+tlib#agent#DownN(world, selected)
+
+ *tlib#agent#ShiftLeft()*
+tlib#agent#ShiftLeft(world, selected)
+
+ *tlib#agent#ShiftRight()*
+tlib#agent#ShiftRight(world, selected)
+
+ *tlib#agent#Reset()*
+tlib#agent#Reset(world, selected)
+
+ *tlib#agent#ToggleRestrictView()*
+tlib#agent#ToggleRestrictView(world, selected)
+
+ *tlib#agent#RestrictView()*
+tlib#agent#RestrictView(world, selected)
+
+ *tlib#agent#UnrestrictView()*
+tlib#agent#UnrestrictView(world, selected)
+
+ *tlib#agent#Input()*
+tlib#agent#Input(world, selected)
+
+ *tlib#agent#SuspendToParentWindow()*
+tlib#agent#SuspendToParentWindow(world, selected)
+ Suspend (see |tlib#agent#Suspend|) the input loop and jump back to the
+ original position in the parent window.
+
+ *tlib#agent#Suspend()*
+tlib#agent#Suspend(world, selected)
+ Suspend lets you temporarily leave the input loop of
+ |tlib#input#List|. You can resume editing the list by pressing <c-z>,
+ <m-z>. <space>, <c-LeftMouse> or <MiddleMouse> in the suspended window.
+ <cr> and <LeftMouse> will immediatly select the item under the cursor.
+ < will select the item but the window will remain opened.
+
+ *tlib#agent#Help()*
+tlib#agent#Help(world, selected)
+
+ *tlib#agent#OR()*
+tlib#agent#OR(world, selected)
+
+ *tlib#agent#AND()*
+tlib#agent#AND(world, selected)
+
+ *tlib#agent#ReduceFilter()*
+tlib#agent#ReduceFilter(world, selected)
+
+ *tlib#agent#PopFilter()*
+tlib#agent#PopFilter(world, selected)
+
+ *tlib#agent#Debug()*
+tlib#agent#Debug(world, selected)
+
+ *tlib#agent#Select()*
+tlib#agent#Select(world, selected)
+
+ *tlib#agent#SelectUp()*
+tlib#agent#SelectUp(world, selected)
+
+ *tlib#agent#SelectDown()*
+tlib#agent#SelectDown(world, selected)
+
+ *tlib#agent#SelectAll()*
+tlib#agent#SelectAll(world, selected)
+
+ *tlib#agent#ToggleStickyList()*
+tlib#agent#ToggleStickyList(world, selected)
+
+ *tlib#agent#EditItem()*
+tlib#agent#EditItem(world, selected)
+
+ *tlib#agent#NewItem()*
+tlib#agent#NewItem(world, selected)
+ Insert a new item below the current one.
+
+ *tlib#agent#DeleteItems()*
+tlib#agent#DeleteItems(world, selected)
+
+ *tlib#agent#Cut()*
+tlib#agent#Cut(world, selected)
+
+ *tlib#agent#Copy()*
+tlib#agent#Copy(world, selected)
+
+ *tlib#agent#Paste()*
+tlib#agent#Paste(world, selected)
+
+ *tlib#agent#EditReturnValue()*
+tlib#agent#EditReturnValue(world, rv)
+
+ *tlib#agent#ViewFile()*
+tlib#agent#ViewFile(world, selected)
+
+ *tlib#agent#EditFile()*
+tlib#agent#EditFile(world, selected)
+
+ *tlib#agent#EditFileInSplit()*
+tlib#agent#EditFileInSplit(world, selected)
+
+ *tlib#agent#EditFileInVSplit()*
+tlib#agent#EditFileInVSplit(world, selected)
+
+ *tlib#agent#EditFileInTab()*
+tlib#agent#EditFileInTab(world, selected)
+
+ *tlib#agent#ToggleScrollbind()*
+tlib#agent#ToggleScrollbind(world, selected)
+
+ *tlib#agent#ShowInfo()*
+tlib#agent#ShowInfo(world, selected)
+
+ *tlib#agent#PreviewLine()*
+tlib#agent#PreviewLine(world, selected)
+
+ *tlib#agent#GotoLine()*
+tlib#agent#GotoLine(world, selected)
+ If not called from the scratch, we assume/guess that we don't have to
+ suspend the input-evaluation loop.
+
+ *tlib#agent#DoAtLine()*
+tlib#agent#DoAtLine(world, selected)
+
+ *tlib#agent#Wildcard()*
+tlib#agent#Wildcard(world, selected)
+
+ *tlib#agent#Null()*
+tlib#agent#Null(world, selected)
+
+ *tlib#agent#ExecAgentByName()*
+tlib#agent#ExecAgentByName(world, selected)
+
+ *tlib#agent#CompleteAgentNames()*
+tlib#agent#CompleteAgentNames(ArgLead, CmdLine, CursorPos)
+
+ *tlib#agent#Complete()*
+tlib#agent#Complete(world, selected)
+
+
+========================================================================
+autoload/tlib/bitwise.vim~
+
+ *tlib#bitwise#Num2Bits()*
+tlib#bitwise#Num2Bits(num)
+
+ *tlib#bitwise#Bits2Num()*
+tlib#bitwise#Bits2Num(bits, ...)
+
+ *tlib#bitwise#AND()*
+tlib#bitwise#AND(num1, num2, ...)
+
+ *tlib#bitwise#OR()*
+tlib#bitwise#OR(num1, num2, ...)
+
+ *tlib#bitwise#XOR()*
+tlib#bitwise#XOR(num1, num2, ...)
+
+ *tlib#bitwise#ShiftRight()*
+tlib#bitwise#ShiftRight(bits, n)
+
+ *tlib#bitwise#ShiftLeft()*
+tlib#bitwise#ShiftLeft(bits, n)
+
+ *tlib#bitwise#Add()*
+tlib#bitwise#Add(num1, num2, ...)
+
+ *tlib#bitwise#Sub()*
+tlib#bitwise#Sub(num1, num2, ...)
+
+
+========================================================================
+autoload/tlib/url.vim~
+
+ *tlib#url#Decode()*
+tlib#url#Decode(url)
+ Decode an encoded URL.
+
+ *tlib#url#DecodeChar()*
+tlib#url#DecodeChar(char)
+ Decode a single character.
+
+ *tlib#url#EncodeChar()*
+tlib#url#EncodeChar(char)
+ Encode a single character.
+
+ *tlib#url#Encode()*
+tlib#url#Encode(url, ...)
+ Encode an URL.
+
+
+========================================================================
+autoload/tlib/signs.vim~
+
+ *tlib#signs#ClearAll()*
+tlib#signs#ClearAll(sign)
+ Clear all signs with name SIGN.
+
+ *tlib#signs#ClearBuffer()*
+tlib#signs#ClearBuffer(sign, bufnr)
+ Clear all signs with name SIGN in buffer BUFNR.
+
+ *tlib#signs#Mark()*
+tlib#signs#Mark(sign, list)
+ Add signs for all locations in LIST. LIST must adhere with the
+ quickfix list format (see |getqflist()|; only the fields lnum and
+ bufnr are required).
+
+ list:: a quickfix or location list
+ sign:: a sign defined with |:sign-define|
+
+
+========================================================================
+autoload/tlib/rx.vim~
+
+ *tlib#rx#Escape()*
+tlib#rx#Escape(text, ?magic='m')
+ magic can be one of: m, M, v, V
+ See :help 'magic'
+
+ *tlib#rx#EscapeReplace()*
+tlib#rx#EscapeReplace(text, ?magic='m')
+ Escape return |sub-replace-special|.
+
+ *tlib#rx#Suffixes()*
+tlib#rx#Suffixes(...)
+
+ *tlib#rx#LooksLikeRegexp()*
+tlib#rx#LooksLikeRegexp(text)
+
+
+========================================================================
+autoload/tlib/tag.vim~
+
+ *g:tlib_tags_extra*
+g:tlib_tags_extra (default: '')
+ Extra tags for |tlib#tag#Retrieve()| (see there). Can also be buffer-local.
+
+ *g:tlib_tag_substitute*
+g:tlib_tag_substitute
+ Filter the tag description through |substitute()| for these filetypes.
+ This applies only if the tag cmd field (see |taglist()|) is used.
+
+ *tlib#tag#Retrieve()*
+tlib#tag#Retrieve(rx, ?extra_tags=0)
+ Get all tags matching rx. Basically, this function simply calls
+ |taglist()|, but when extra_tags is true, the list of the tag files
+ (see 'tags') is temporarily expanded with |g:tlib_tags_extra|.
+
+ Example use:
+ If you want to include tags for, eg, JDK, normal tags use can become
+ slow. You could proceed as follows:
+ 1. Create a tags file for the JDK sources. When creating the tags
+ file, make sure to include inheritance information and the like
+ (command-line options like --fields=+iaSm --extra=+q should be ok).
+ In this example, we want tags only for public methods (there are
+ most likely better ways to do this): >
+ ctags -R --fields=+iaSm --extra=+q ${JAVA_HOME}/src
+ head -n 6 tags > tags0
+ grep access:public tags >> tags0
+< 2. Make 'tags' include project specific tags files. In
+ ~/vimfiles/after/ftplugin/java.vim insert: >
+ let b:tlib_tags_extra = $JAVA_HOME .'/tags0'
+< 3. When this function is invoked as >
+ echo tlib#tag#Retrieve('print')
+< it will return only project-local tags. If it is invoked as >
+ echo tlib#tag#Retrieve('print', 1)
+< tags from the JDK will be included.
+
+ *tlib#tag#Collect()*
+tlib#tag#Collect(constraints, ?use_extra=1, ?match_front=1)
+ Retrieve tags that meet the constraints (a dictionnary of fields and
+ regexp, with the exception of the kind field which is a list of chars).
+ For the use of the optional use_extra argument see
+ |tlib#tag#Retrieve()|.
+
+ *tlib#tag#Format()*
+tlib#tag#Format(tag)
+
+
+========================================================================
+autoload/tlib/map.vim~
+
+ *tlib#map#PumAccept()*
+tlib#map#PumAccept(key)
+ If |pumvisible()| is true, return "\<c-y>". Otherwise return a:key.
+ For use in maps like: >
+ imap <expr> <cr> tlib#map#PumAccept("\<cr>")
+<
+
+
+========================================================================
+autoload/tlib/Filter_cnfd.vim~
+
+ *tlib#Filter_cnfd#New()*
+tlib#Filter_cnfd#New(...)
+ The same as |tlib#Filter_cnf#New()| but a dot is expanded to '\.\{-}'.
+ As a consequence, patterns cannot match dots.
+ The pattern is a '/\V' very no-'/magic' regexp pattern.
+
+
+========================================================================
+autoload/tlib/input.vim~
+Input-related, select from a list etc.
+
+ *g:tlib#input#sortprefs_threshold*
+g:tlib#input#sortprefs_threshold (default: 200)
+ If a list is bigger than this value, don't try to be smart when
+ selecting an item. Be slightly faster instead.
+ See |tlib#input#List()|.
+
+ *g:tlib#input#livesearch_threshold*
+g:tlib#input#livesearch_threshold (default: 1000)
+ If a list contains more items, |tlib#input#List()| does not perform an
+ incremental "live search" but uses |input()| to query the user for a
+ filter. This is useful on slower machines or with very long lists.
+
+ *g:tlib#input#filter_mode*
+g:tlib#input#filter_mode (default: 'glob')
+ Determine how |tlib#input#List()| and related functions work.
+ Can be "glob", "cnf", "cnfd", "seq", or "fuzzy". See:
+ glob ... Like cnf but "*" and "?" (see |g:tlib#Filter_glob#seq|,
+ |g:tlib#Filter_glob#char|) are interpreted as glob-like
+ |wildcards| (this is the default method)
+ - Examples:
+ - "f*o" matches "fo", "fxo", and "fxxxoo", but doesn't match
+ "far".
+ - Otherwise it is a derivate of the cnf method (see below).
+ - See also |tlib#Filter_glob#New()|.
+ cnfd ... Like cnf but "." is interpreted as a wildcard, i.e. it is
+ expanded to "\.\{-}"
+ - A period character (".") acts as a wildcard as if ".\{-}" (see
+ |/\{-|) were entered.
+ - Examples:
+ - "f.o" matches "fo", "fxo", and "fxxxoo", but doesn't match
+ "far".
+ - Otherwise it is a derivate of the cnf method (see below).
+ - See also |tlib#Filter_cnfd#New()|.
+ cnf .... Match substrings
+ - A blank creates an AND conjunction, i.e. the next pattern has to
+ match too.
+ - A pipe character ("|") creates an OR conjunction, either this or
+ the next next pattern has to match.
+ - Patterns are very 'nomagic' |regexp| with a |\V| prefix.
+ - A pattern starting with "-" makes the filter exclude items
+ matching that pattern.
+ - Examples:
+ - "foo bar" matches items that contain the strings "foo" AND
+ "bar".
+ - "foo|bar boo|far" matches items that contain either ("foo" OR
+ "bar") AND ("boo" OR "far").
+ - See also |tlib#Filter_cnf#New()|.
+ seq .... Match sequences of characters
+ - |tlib#Filter_seq#New()|
+ fuzzy .. Match fuzzy character sequences
+ - |tlib#Filter_fuzzy#New()|
+
+ *g:tlib#input#higroup*
+g:tlib#input#higroup (default: 'IncSearch')
+ The highlight group to use for showing matches in the input list
+ window.
+ See |tlib#input#List()|.
+
+ *g:tlib_pick_last_item*
+g:tlib_pick_last_item (default: 1)
+ When 1, automatically select the last remaining item only if the list
+ had only one item to begin with.
+ When 2, automatically select a last remaining item after applying
+ any filters.
+ See |tlib#input#List()|.
+
+
+Keys for |tlib#input#List|~
+
+ *g:tlib#input#and*
+g:tlib#input#and (default: ' ')
+
+ *g:tlib#input#or*
+g:tlib#input#or (default: '|')
+
+ *g:tlib#input#not*
+g:tlib#input#not (default: '-')
+
+ *g:tlib#input#numeric_chars*
+g:tlib#input#numeric_chars
+ When editing a list with |tlib#input#List|, typing these numeric chars
+ (as returned by getchar()) will select an item based on its index, not
+ based on its name. I.e. in the default setting, typing a "4" will
+ select the fourth item, not the item called "4".
+ In order to make keys 0-9 filter the items in the list and make
+ <m-[0-9]> select an item by its index, remove the keys 48 to 57 from
+ this dictionary.
+ Format: [KEY] = BASE ... the number is calculated as KEY - BASE.
+
+ *g:tlib#input#keyagents_InputList_s*
+g:tlib#input#keyagents_InputList_s
+ The default key bindings for single-item-select list views.
+
+ This variable is best customized via the variable
+ g:tlib_extend_keyagents_InputList_s. If you want to use <c-j>, <c-k>
+ to move the cursor up and down, add these two lines to your |vimrc|
+ file:
+
+ let g:tlib_extend_keyagents_InputList_s = {
+ \ 10: 'tlib#agent#Down',
+ \ 11: 'tlib#agent#Up'
+ \ }
+
+ *g:tlib#input#keyagents_InputList_m*
+g:tlib#input#keyagents_InputList_m
+
+ *g:tlib#input#handlers_EditList*
+g:tlib#input#handlers_EditList
+
+ *g:tlib#input#user_shortcuts*
+g:tlib#input#user_shortcuts (default: {})
+ A dictionary KEY => {'agent': AGENT, 'key_name': KEY_NAME} to
+ customize keyboard shortcuts in the list view.
+
+ *g:tlib#input#use_popup*
+g:tlib#input#use_popup (default: has('menu') && (has('gui_gtk') || has('gui_gtk2') || has('gui_win32')))
+ If true, define a popup menu for |tlib#input#List()| and related
+ functions.
+
+ *g:tlib#input#format_filename*
+g:tlib#input#format_filename (default: 'l')
+ How to format filenames:
+ l ... Show basenames on the left side, separated from the
+ directory names
+ r ... Show basenames on the right side
+
+ *g:tlib#input#filename_padding_r*
+g:tlib#input#filename_padding_r (default: '&co / 10')
+ If g:tlib#input#format_filename == 'r', how much space should be kept
+ free on the right side.
+
+ *g:tlib#input#filename_max_width*
+g:tlib#input#filename_max_width (default: '&co / 2')
+ If g:tlib#input#format_filename == 'l', an expression that
+ |eval()|uates to the maximum display width of filenames.
+
+ *tlib#input#List()*
+tlib#input#List(type. ?query='', ?list=[], ?handlers=[], ?default="", ?timeout=0)
+ Select a single or multiple items from a list. Return either the list
+ of selected elements or its indexes.
+
+ By default, typing numbers will select an item by its index. See
+ |g:tlib#input#numeric_chars| to find out how to change this.
+
+ The item is automatically selected if the numbers typed equals the
+ number of digits of the list length. I.e. if a list contains 20 items,
+ typing 1 will first highlight item 1 but it won't select/use it
+ because 1 is an ambiguous input in this context. If you press enter,
+ the first item will be selected. If you press another digit (e.g. 0),
+ item 10 will be selected. Another way to select item 1 would be to
+ type 01. If the list contains only 9 items, typing 1 would select the
+ first item right away.
+
+ type can be:
+ s ... Return one selected element
+ si ... Return the index of the selected element
+ m ... Return a list of selected elements
+ mi ... Return a list of indexes
+
+ Several pattern matching styles are supported. See
+ |g:tlib#input#filter_mode|.
+
+ Users can type <Tab> to complete the current filter with the longest
+ match.
+
+ EXAMPLES: >
+ echo tlib#input#List('s', 'Select one item', [100,200,300])
+ echo tlib#input#List('si', 'Select one item', [100,200,300])
+ echo tlib#input#List('m', 'Select one or more item(s)', [100,200,300])
+ echo tlib#input#List('mi', 'Select one or more item(s)', [100,200,300])
+
+< See ../samples/tlib/input/tlib_input_list.vim (move the cursor over
+ the filename and press gf) for a more elaborated example.
+
+ *tlib#input#ListD()*
+tlib#input#ListD(dict)
+ A wrapper for |tlib#input#ListW()| that builds |tlib#World#New| from
+ dict.
+
+ *tlib#input#ListW()*
+tlib#input#ListW(world, ?command='')
+ The second argument (command) is meant for internal use only.
+ The same as |tlib#input#List| but the arguments are packed into world
+ (an instance of tlib#World as returned by |tlib#World#New|).
+
+ *tlib#input#EditList()*
+tlib#input#EditList(query, list, ?timeout=0)
+ Edit a list.
+
+ EXAMPLES: >
+ echo tlib#input#EditList('Edit:', [100,200,300])
+<
+
+ *tlib#input#Resume()*
+tlib#input#Resume(name, pick, bufnr)
+
+ *tlib#input#CommandSelect()*
+tlib#input#CommandSelect(command, ?keyargs={})
+ Take a command, view the output, and let the user select an item from
+ its output.
+
+ EXAMPLE: >
+ command! TMarks exec 'norm! `'. matchstr(tlib#input#CommandSelect('marks'), '^ \+\zs.')
+ command! TAbbrevs exec 'norm i'. matchstr(tlib#input#CommandSelect('abbrev'), '^\S\+\s\+\zs\S\+')
+<
+
+ *tlib#input#Edit()*
+tlib#input#Edit(name, value, callback, ?cb_args=[])
+
+ Edit a value (asynchronously) in a scratch buffer. Use name for
+ identification. Call callback when done (or on cancel).
+ In the scratch buffer:
+ Press <c-s> or <c-w><cr> to enter the new value, <c-w>c to cancel
+ editing.
+ EXAMPLES: >
+ fun! FooContinue(success, text)
+ if a:success
+ let b:var = a:text
+ endif
+ endf
+ call tlib#input#Edit('foo', b:var, 'FooContinue')
+<
+
+ *tlib#input#Dialog()*
+tlib#input#Dialog(text, options, default)
+
+
+========================================================================
+autoload/tlib/number.vim~
+
+ *tlib#number#ConvertBase()*
+tlib#number#ConvertBase(num, base, ...)
+
+
+========================================================================
+autoload/tlib/file.vim~
+
+ *g:tlib#file#drop*
+g:tlib#file#drop (default: has('gui'))
+ If true, use |:drop| to edit loaded buffers (only available with GUI).
+
+ *g:tlib#file#use_tabs*
+g:tlib#file#use_tabs (default: 0)
+
+ *g:tlib#file#edit_cmds*
+g:tlib#file#edit_cmds (default: g:tlib#file#use_tabs ? {'buffer': 'tab split | buffer', 'edit': 'tabedit'} : {})
+
+ *g:tlib#file#absolute_filename_rx*
+g:tlib#file#absolute_filename_rx (default: '^\~\?[\/]')
+
+ *tlib#file#Split()*
+tlib#file#Split(filename)
+ EXAMPLES: >
+ tlib#file#Split('foo/bar/filename.txt')
+ => ['foo', 'bar', 'filename.txt']
+<
+
+ *tlib#file#Join()*
+tlib#file#Join(filename_parts, ?strip_slashes=1, ?maybe_absolute=0)
+ EXAMPLES: >
+ tlib#file#Join(['foo', 'bar', 'filename.txt'])
+ => 'foo/bar/filename.txt'
+<
+
+ *tlib#file#Relative()*
+tlib#file#Relative(filename, basedir)
+ EXAMPLES: >
+ tlib#file#Relative('foo/bar/filename.txt', 'foo')
+ => 'bar/filename.txt'
+<
+
+ *tlib#file#IsAbsolute()*
+tlib#file#IsAbsolute(filename)
+
+ *tlib#file#Absolute()*
+tlib#file#Absolute(filename, ...)
+
+ *tlib#file#Canonic()*
+tlib#file#Canonic(filename, ...)
+
+ *tlib#file#With()*
+tlib#file#With(fcmd, bcmd, files, ?world={})
+
+ *tlib#file#Edit()*
+tlib#file#Edit(fileid)
+ Return 0 if the file isn't readable/doesn't exist.
+ Otherwise return 1.
+
+ *tlib#file#Glob()*
+tlib#file#Glob(pattern)
+
+ *tlib#file#Globpath()*
+tlib#file#Globpath(path, pattern)
+
+
+========================================================================
+autoload/tlib/sys.vim~
+
+ *g:tlib#sys#special_protocols*
+g:tlib#sys#special_protocols (default: ['https\?', 'nntp', 'mailto'])
+ A list of |regexp|s matching protocol names that should be handled
+ by |g:tlib#sys#system_browser|.
+ CAVEAT: Must be a |\V| |regexp|.
+
+ *g:tlib#sys#special_suffixes*
+g:tlib#sys#special_suffixes (default: ['xlsx\?', 'docx\?', 'pptx\?', 'accdb', 'mdb', 'sqlite', 'pdf', 'jpg', 'png', 'gif', 'od\[tspg]'])
+ A list of |regexp|s matching suffixes that should be handled by
+ |g:tlib#sys#system_browser|.
+ CAVEAT: Must be a |\V| |regexp|.
+
+ *g:tlib#sys#system_rx*
+g:tlib#sys#system_rx (default: printf('\V\%(\^\%(%s\):\|.\%(%s\)\$\)', join(g:tlib#sys#special_protocols, '\|'), join(g:tlib#sys#special_suffixes, '\|')))
+ Open links matching this |regexp| with |g:tlib#sys#system_browser|.
+ CAVEAT: Must be a |\V| |regexp|.
+
+ *g:tlib#sys#system_browser*
+g:tlib#sys#system_browser (default: ...)
+ Open files in the system browser.
+
+ *g:tlib#sys#windows*
+g:tlib#sys#windows (default: &shell !~ 'sh' && (has('win16') || has('win32') || has('win64')))
+
+ *g:tlib#sys#null*
+g:tlib#sys#null (default: g:tlib#sys#windows ? 'NUL' : (filereadable('/dev/null') ? '/dev/null' : ''))
+
+ *tlib#sys#IsCygwinBin()*
+tlib#sys#IsCygwinBin(cmd)
+
+ *tlib#sys#IsExecutable()*
+tlib#sys#IsExecutable(cmd, ...)
+
+ *g:tlib#sys#check_cygpath*
+g:tlib#sys#check_cygpath (default: g:tlib#sys#windows && tlib#sys#IsExecutable('cygpath', 1))
+ If true, check whether we have to convert a path via cyppath --
+ see |tlib#sys#MaybeUseCygpath|
+
+ *g:tlib#sys#cygwin_path_rx*
+g:tlib#sys#cygwin_path_rx (default: '/cygwin/')
+ If a full windows filename (with slashes instead of backslashes)
+ matches this |regexp|, it is assumed to be a cygwin executable.
+
+ *g:tlib#sys#cygwin_expr*
+g:tlib#sys#cygwin_expr (default: '"bash -c ''". escape(%s, "''\\") ."''"')
+ For cygwin binaries, convert command calls using this vim
+ expression.
+
+ *tlib#sys#GetCmd()*
+tlib#sys#GetCmd(cmd)
+
+ *tlib#sys#MaybeUseCygpath()*
+tlib#sys#MaybeUseCygpath(cmd)
+ If cmd seems to be a cygwin executable, use cygpath to convert
+ filenames. This assumes that cygwin's which command returns full
+ filenames for non-cygwin executables.
+
+ *tlib#sys#ConvertPath()*
+tlib#sys#ConvertPath(converter, filename)
+
+ *tlib#sys#FileArgs()*
+tlib#sys#FileArgs(cmd, files)
+
+ *tlib#sys#IsSpecial()*
+tlib#sys#IsSpecial(filename)
+ Check whether filename matches |g:tlib#sys#system_rx|, i.e. whether it
+ is a special file that should not be opened in vim.
+
+ *tlib#sys#Open()*
+tlib#sys#Open(filename)
+ Open filename with the default OS application (see
+ |g:tlib#sys#system_browser|), if |tlib#sys#IsSpecial()| return 1.
+ Returns 1 if successful or 0 otherwise.
+
+ *tlib#sys#SystemInDir()*
+tlib#sys#SystemInDir(dir, expr, ?input='')
+
+
+========================================================================
+autoload/tlib/paragraph.vim~
+
+ *tlib#paragraph#GetMetric()*
+tlib#paragraph#GetMetric()
+ Return an object describing a |paragraph|.
+
+ *tlib#paragraph#Move()*
+tlib#paragraph#Move(direction, count)
+ This function can be used with the tinymode plugin to move around
+ paragraphs.
+
+ Example configuration: >
+
+ call tinymode#EnterMap("para_move", "gp")
+ call tinymode#ModeMsg("para_move", "Move paragraph: j/k")
+ call tinymode#Map("para_move", "j", "silent call tlib#paragraph#Move('Down', '[N]')")
+ call tinymode#Map("para_move", "k", "silent call tlib#paragraph#Move('Up', '[N]')")
+ call tinymode#ModeArg("para_move", "owncount", 1)
+<
+
+
+========================================================================
+autoload/tlib/World.vim~
+A prototype used by |tlib#input#List|.
+Inherits from |tlib#Object#New|.
+
+ *g:tlib_inputlist_pct*
+g:tlib_inputlist_pct (default: 50)
+ Size of the input list window (in percent) from the main size (of &lines).
+ See |tlib#input#List()|.
+
+ *g:tlib_inputlist_width_filename*
+g:tlib_inputlist_width_filename (default: '&co / 3')
+ Size of filename columns when listing filenames.
+ See |tlib#input#List()|.
+
+ *g:tlib_inputlist_filename_indicators*
+g:tlib_inputlist_filename_indicators (default: 0)
+ If true, |tlib#input#List()| will show some indicators about the
+ status of a filename (e.g. buflisted(), bufloaded() etc.).
+ This is disabled by default because vim checks also for the file on
+ disk when doing this.
+
+ *g:tlib_inputlist_shortmessage*
+g:tlib_inputlist_shortmessage (default: 0)
+ If not null, display only a short info about the filter.
+
+ *tlib#World#New()*
+tlib#World#New(...)
+
+prototype.PrintLines
+
+prototype.Suspend
+
+
+========================================================================
+autoload/tlib/loclist.vim~
+
+ *tlib#loclist#Browse()*
+tlib#loclist#Browse(...)
+
+
+========================================================================
+autoload/tlib/tab.vim~
+
+ *tlib#tab#BufMap()*
+tlib#tab#BufMap()
+ Return a dictionary of bufnumbers => [[tabpage, winnr] ...]
+
+ *tlib#tab#TabWinNr()*
+tlib#tab#TabWinNr(buffer)
+ Find a buffer's window at some tab page.
+
+ *tlib#tab#Set()*
+tlib#tab#Set(tabnr)
+
+
+========================================================================
+autoload/tlib/date.vim~
+
+ *tlib#date#IsDate()*
+tlib#date#IsDate(text)
+
+ *tlib#date#Format()*
+tlib#date#Format(...)
+
+ *tlib#date#DiffInDays()*
+tlib#date#DiffInDays(date1, ?date2=localtime(), ?allow_zero=0)
+
+ *tlib#date#Parse()*
+tlib#date#Parse(date, ?allow_zero=0, ?silent=0) "{{{3
+
+ *tlib#date#SecondsSince1970()*
+tlib#date#SecondsSince1970(date, ...)
+ tlib#date#SecondsSince1970(date, ?daysshift=0, ?allow_zero=0)
+
+ *tlib#date#Shift()*
+tlib#date#Shift(date, shift)
+
+ *tlib#date#AddDays()*
+tlib#date#AddDays(date, n)
+
+
+========================================================================
+autoload/tlib/type.vim~
+
+ *tlib#type#Enable()*
+tlib#type#Enable()
+ Enable type assertiona via |:Tlibtype|.
+
+ *tlib#type#Disable()*
+tlib#type#Disable()
+ Disable type assertiona via |:Tlibtype|.
+
+ *tlib#type#IsNumber()*
+tlib#type#IsNumber(expr)
+
+ *tlib#type#IsString()*
+tlib#type#IsString(expr)
+
+ *tlib#type#IsFuncref()*
+tlib#type#IsFuncref(expr)
+
+ *tlib#type#IsList()*
+tlib#type#IsList(expr)
+
+ *tlib#type#IsDictionary()*
+tlib#type#IsDictionary(expr)
+
+ *tlib#type#Is()*
+tlib#type#Is(val, type)
+
+ *tlib#type#Are()*
+tlib#type#Are(vals, type)
+
+ *tlib#type#Define()*
+tlib#type#Define(name, schema)
+
+ *tlib#type#Has()*
+tlib#type#Has(val, schema)
+
+ *tlib#type#Have()*
+tlib#type#Have(vals, schema)
+
+ *tlib#type#Check()*
+tlib#type#Check(caller, names, vals)
+
+
+========================================================================
+autoload/tlib/Filter_fuzzy.vim~
+
+ *tlib#Filter_fuzzy#New()*
+tlib#Filter_fuzzy#New(...)
+ Support for "fuzzy" pattern matching in |tlib#input#List()|.
+ Patterns are interpreted as if characters were connected with '.\{-}'.
+
+ In "fuzzy" mode, the pretty printing of filenames is disabled.
+
+
+========================================================================
+autoload/tlib/assert.vim~
+
+ *tlib#assert#Enable()*
+tlib#assert#Enable()
+ Enable tracing via |:Tlibassert|.
+
+ *tlib#assert#Disable()*
+tlib#assert#Disable()
+ Disable tracing via |:Tlibassert|.
+
+ *tlib#assert#Assert()*
+tlib#assert#Assert(caller, check, vals)
+
+ *tlib#assert#Map()*
+tlib#assert#Map(vals, expr)
+
+ *tlib#assert#All()*
+tlib#assert#All(vals)
+
+
+========================================================================
+autoload/tlib/textobjects.vim~
+
+ *standard-paragraph*
+tlib#textobjects#StandardParagraph()
+ Select a "Standard Paragraph", i.e. a text block followed by blank
+ lines. Other than |ap|, the last paragraph in a document is handled
+ just the same.
+
+ The |text-object| can be accessed as "sp". Example: >
+
+ vsp ... select the current standard paragraph
+
+< Return 1, if the paragraph is the last one in the document.
+
+ *tlib#textobjects#Init()*
+tlib#textobjects#Init()
+
+ *v_sp*
+v_sp ... <Esc>:call tlib#textobjects#StandardParagraph()<CR>
+ sp ... Standard paragraph (for use as |text-objects|).
+
+ *o_sp*
+o_sp ... :<C-u>normal Vsp<CR>
+
+
+========================================================================
+autoload/tlib/arg.vim~
+
+ *tlib#arg#Get()*
+tlib#arg#Get(n, var, ?default="", ?test='')
+ Set a positional argument from a variable argument list.
+ See tlib#string#RemoveBackslashes() for an example.
+
+ *tlib#arg#Let()*
+tlib#arg#Let(list, ?default='')
+ Set a positional arguments from a variable argument list.
+ See tlib#input#List() for an example.
+
+ *tlib#arg#StringAsKeyArgs()*
+tlib#arg#StringAsKeyArgs(string, ?keys=[], ?evaluate=0, ?sep=':', ?booleans=0)
+
+ *tlib#arg#StringAsKeyArgsEqual()*
+tlib#arg#StringAsKeyArgsEqual(string)
+
+ *tlib#arg#GetOpts()*
+tlib#arg#GetOpts(args, ?def={})
+ Convert a list of strings of command-line arguments into a dictonary.
+
+ The main use case is to pass [<f-args>], i.e. the command-line
+ arguments of a command as list, from a command definition to this
+ function.
+
+ Example:
+ ['-h']
+ => If def contains a 'help' key, invoke |:help| on its value.
+
+ ['-ab', '--foo', '--bar=BAR', 'bla', bla']
+ => {'a': 1, 'b': 1, 'foo': 1, 'bar': 'BAR', '__rest__': ['bla', 'bla']}
+
+ ['-ab', '--', '--foo', '--bar=BAR']
+ => {'a': 1, 'b': 1, '__rest__': ['--foo', '--bar=BAR']}
+
+ *tlib#arg#Ex()*
+tlib#arg#Ex(arg, ?chars='%#! ')
+ Escape some characters in a string.
+
+ Use |fnamescape()| if available.
+
+ EXAMPLES: >
+ exec 'edit '. tlib#arg#Ex('foo%#bar.txt')
+<
+
+
+========================================================================
+autoload/tlib/fixes.vim~
+
+ *tlib#fixes#Winpos()*
+tlib#fixes#Winpos()
+
+
+========================================================================
+autoload/tlib/dir.vim~
+
+ *g:tlib#dir#sep*
+g:tlib#dir#sep (default: exists('+shellslash') && !&shellslash ? '\' : '/')
+ TLet g:tlib#dir#sep = '/'
+
+ *tlib#dir#CanonicName()*
+tlib#dir#CanonicName(dirname)
+ EXAMPLES: >
+ tlib#dir#CanonicName('foo/bar')
+ => 'foo/bar/'
+<
+
+ *tlib#dir#NativeName()*
+tlib#dir#NativeName(dirname)
+ EXAMPLES: >
+ tlib#dir#NativeName('foo/bar/')
+ On Windows:
+ => 'foo\bar\'
+ On Linux:
+ => 'foo/bar/'
+<
+
+ *tlib#dir#PlainName()*
+tlib#dir#PlainName(dirname)
+ EXAMPLES: >
+ tlib#dir#PlainName('foo/bar/')
+ => 'foo/bar'
+<
+
+ *tlib#dir#Ensure()*
+tlib#dir#Ensure(dir)
+ Create a directory if it doesn't already exist.
+
+ *tlib#dir#MyRuntime()*
+tlib#dir#MyRuntime()
+ Return the first directory in &rtp.
+
+ *tlib#dir#CD()*
+tlib#dir#CD(dir, ?locally=0)
+
+ *tlib#dir#Push()*
+tlib#dir#Push(dir, ?locally=0)
+
+ *tlib#dir#Pop()*
+tlib#dir#Pop()
+
+
+========================================================================
+autoload/tlib/hash.vim~
+
+ *g:tlib#hash#use_crc32*
+g:tlib#hash#use_crc32 (default: '')
+
+ *g:tlib#hash#use_adler32*
+g:tlib#hash#use_adler32 (default: '')
+
+ *tlib#hash#CRC32B()*
+tlib#hash#CRC32B(chars)
+
+ *tlib#hash#CRC32B_ruby()*
+tlib#hash#CRC32B_ruby(chars)
+
+ *tlib#hash#CRC32B_vim()*
+tlib#hash#CRC32B_vim(chars)
+
+ *tlib#hash#Adler32()*
+tlib#hash#Adler32(chars)
+
+ *tlib#hash#Adler32_vim()*
+tlib#hash#Adler32_vim(chars)
+
+ *tlib#hash#Adler32_tlib()*
+tlib#hash#Adler32_tlib(chars)
+
+
+========================================================================
+autoload/tlib/win.vim~
+
+ *tlib#win#Set()*
+tlib#win#Set(winnr)
+ Return vim code to jump back to the original window.
+
+ *tlib#win#GetLayout()*
+tlib#win#GetLayout(?save_view=0)
+
+ *tlib#win#SetLayout()*
+tlib#win#SetLayout(layout)
+
+ *tlib#win#List()*
+tlib#win#List()
+
+ *tlib#win#Width()*
+tlib#win#Width(wnr)
+
+ *tlib#win#WinDo()*
+tlib#win#WinDo(ex)
+
+
+========================================================================
+autoload/tlib/comments.vim~
+
+ *tlib#comments#Comments()*
+tlib#comments#Comments(...)
+ function! tlib#comments#Comments(?rx='')
+
+
+========================================================================
+autoload/tlib/grep.vim~
+
+ *tlib#grep#Do()*
+tlib#grep#Do(cmd, rx, files)
+
+ *tlib#grep#LocList()*
+tlib#grep#LocList(rx, files)
+
+ *tlib#grep#QuickFixList()*
+tlib#grep#QuickFixList(rx, files)
+
+ *tlib#grep#List()*
+tlib#grep#List(rx, files)
+
+
+========================================================================
+autoload/tlib/qfl.vim~
+
+ *tlib#qfl#FormatQFLE()*
+tlib#qfl#FormatQFLE(qfe)
+
+ *tlib#qfl#QfeFilename()*
+tlib#qfl#QfeFilename(qfe)
+
+ *tlib#qfl#InitListBuffer()*
+tlib#qfl#InitListBuffer(world)
+
+ *tlib#qfl#SetSyntax()*
+tlib#qfl#SetSyntax()
+
+ *tlib#qfl#Balloon()*
+tlib#qfl#Balloon()
+
+ *tlib#qfl#AgentEditQFE()*
+tlib#qfl#AgentEditQFE(world, selected, ...)
+
+ *tlib#qfl#AgentPreviewQFE()*
+tlib#qfl#AgentPreviewQFE(world, selected)
+
+ *tlib#qfl#AgentGotoQFE()*
+tlib#qfl#AgentGotoQFE(world, selected)
+
+ *tlib#qfl#AgentWithSelected()*
+tlib#qfl#AgentWithSelected(world, selected, ...)
+
+ *tlib#qfl#RunCmdOnSelected()*
+tlib#qfl#RunCmdOnSelected(world, selected, cmd, ...)
+
+ *tlib#qfl#AgentSplitBuffer()*
+tlib#qfl#AgentSplitBuffer(world, selected)
+
+ *tlib#qfl#AgentTabBuffer()*
+tlib#qfl#AgentTabBuffer(world, selected)
+
+ *tlib#qfl#AgentVSplitBuffer()*
+tlib#qfl#AgentVSplitBuffer(world, selected)
+
+ *tlib#qfl#AgentEditLine()*
+tlib#qfl#AgentEditLine(world, selected)
+
+ *tlib#qfl#EditLine()*
+tlib#qfl#EditLine(lnum)
+
+ *tlib#qfl#SetFollowCursor()*
+tlib#qfl#SetFollowCursor(world, selected)
+
+ *tlib#qfl#QflList()*
+tlib#qfl#QflList(list, ...)
+
+ *tlib#qfl#Browse()*
+tlib#qfl#Browse(...)
+
+
+========================================================================
+autoload/tlib/Filter_cnf.vim~
+
+ *tlib#Filter_cnf#New()*
+tlib#Filter_cnf#New(...)
+ The search pattern for |tlib#input#List()| is in conjunctive normal
+ form: (P1 OR P2 ...) AND (P3 OR P4 ...) ...
+ The pattern is a '/\V' very no-'/magic' regexp pattern.
+
+ Pressing <space> joins two patterns with AND.
+ Pressing | joins two patterns with OR.
+ I.e. In order to get "lala AND (foo OR bar)", you type
+ "lala foo|bar".
+
+ This is also the base class for other filters.
+
+prototype.Pretty
+
+
+========================================================================
+autoload/tlib/Object.vim~
+Provides a prototype plus some OO-like methods.
+
+ *tlib#Object#New()*
+tlib#Object#New(?fields={})
+ This function creates a prototype that provides some kind of
+ inheritance mechanism and a way to call parent/super methods.
+
+ The usage demonstrated in the following example works best when every
+ class/prototype is defined in a file of its own.
+
+ The reason for why there is a dedicated constructor function is that
+ this layout facilitates the use of templates and that methods are
+ hidden from the user. Other solutions are possible.
+
+ EXAMPLES: >
+ let s:prototype = tlib#Object#New({
+ \ '_class': ['FooBar'],
+ \ 'foo': 1,
+ \ 'bar': 2,
+ \ })
+ " Constructor
+ function! FooBar(...)
+ let object = s:prototype.New(a:0 >= 1 ? a:1 : {})
+ return object
+ endf
+ function! s:prototype.babble() {
+ echo "I think, therefore I am ". (self.foo * self.bar) ." months old."
+ }
+
+< This could now be used like this: >
+ let myfoo = FooBar({'foo': 3})
+ call myfoo.babble()
+ => I think, therefore I am 6 months old.
+ echo myfoo.IsA('FooBar')
+ => 1
+ echo myfoo.IsA('object')
+ => 1
+ echo myfoo.IsA('Foo')
+ => 0
+ echo myfoo.RespondTo('babble')
+ => 1
+ echo myfoo.RespondTo('speak')
+ => 0
+<
+
+prototype.New
+
+prototype.Inherit
+
+prototype.Extend
+
+prototype.IsA
+
+prototype.IsRelated
+
+prototype.RespondTo
+
+prototype.Super
+
+ *tlib#Object#Methods()*
+tlib#Object#Methods(object, ...)
+
+
+========================================================================
+autoload/tlib/buffer.vim~
+
+ *g:tlib_viewline_position*
+g:tlib_viewline_position (default: 'zz')
+ Where to display the line when using |tlib#buffer#ViewLine|.
+ For possible values for position see |scroll-cursor|.
+
+ *tlib#buffer#EnableMRU()*
+tlib#buffer#EnableMRU()
+
+ *tlib#buffer#DisableMRU()*
+tlib#buffer#DisableMRU()
+
+ *tlib#buffer#Set()*
+tlib#buffer#Set(buffer)
+ Set the buffer to buffer and return a command as string that can be
+ evaluated by |:execute| in order to restore the original view.
+
+ *tlib#buffer#Eval()*
+tlib#buffer#Eval(buffer, code)
+ Evaluate CODE in BUFFER.
+
+ EXAMPLES: >
+ call tlib#buffer#Eval('foo.txt', 'echo b:bar')
+<
+
+ *tlib#buffer#GetList()*
+tlib#buffer#GetList(?show_hidden=0, ?show_number=0, " ?order='bufnr')
+ Possible values for the "order" argument:
+ bufnr :: Default behaviour
+ mru :: Sort buffers according to most recent use
+ basename :: Sort by the file's basename (last component)
+
+ NOTE: MRU order works on second invocation only. If you want to always
+ use MRU order, call tlib#buffer#EnableMRU() in your ~/.vimrc file.
+
+ *tlib#buffer#ViewLine()*
+tlib#buffer#ViewLine(line, ?position='z')
+ line is either a number or a string that begins with a number.
+ For possible values for position see |scroll-cursor|.
+ See also |g:tlib_viewline_position|.
+
+ *tlib#buffer#HighlightLine()*
+tlib#buffer#HighlightLine(...)
+
+ *tlib#buffer#DeleteRange()*
+tlib#buffer#DeleteRange(line1, line2)
+ Delete the lines in the current buffer. Wrapper for |:delete|.
+
+ *tlib#buffer#ReplaceRange()*
+tlib#buffer#ReplaceRange(line1, line2, lines)
+ Replace a range of lines.
+
+ *tlib#buffer#ScratchStart()*
+tlib#buffer#ScratchStart()
+ Initialize some scratch area at the bottom of the current buffer.
+
+ *tlib#buffer#ScratchEnd()*
+tlib#buffer#ScratchEnd()
+ Remove the in-buffer scratch area.
+
+ *tlib#buffer#BufDo()*
+tlib#buffer#BufDo(exec)
+ Run exec on all buffers via bufdo and return to the original buffer.
+
+ *tlib#buffer#InsertText()*
+tlib#buffer#InsertText(text, keyargs)
+ Keyargs:
+ 'shift': 0|N
+ 'col': col('.')|N
+ 'lineno': line('.')|N
+ 'indent': 0|1
+ 'pos': 'e'|'s' ... Where to locate the cursor (somewhat like s and e in {offset})
+ Insert text (a string) in the buffer.
+
+ *tlib#buffer#InsertText0()*
+tlib#buffer#InsertText0(text, ...)
+
+ *tlib#buffer#CurrentByte()*
+tlib#buffer#CurrentByte()
+
+ *tlib#buffer#KeepCursorPosition()*
+tlib#buffer#KeepCursorPosition(cmd)
+ Evaluate cmd while maintaining the cursor position and jump registers.
+
+
+========================================================================
+autoload/tlib/hook.vim~
+
+ *tlib#hook#Run()*
+tlib#hook#Run(hook, ?dict={})
+ Execute dict[hook], w:{hook}, b:{hook}, or g:{hook} if existent.
+
+
+========================================================================
+autoload/tlib/string.vim~
+
+ *tlib#string#RemoveBackslashes()*
+tlib#string#RemoveBackslashes(text, ?chars=' ')
+ Remove backslashes from text (but only in front of the characters in
+ chars).
+
+ *tlib#string#Chomp()*
+tlib#string#Chomp(string, ?max=0)
+
+ *tlib#string#Format()*
+tlib#string#Format(template, dict)
+ Format a template string. Placeholders have the format "%{NAME}". A
+ "%" can be inserted as "%%".
+
+ Examples:
+ echo tlib#string#Format("foo %{bar} foo", {'bar': 123})
+ => foo 123 foo
+
+ *tlib#string#Printf1()*
+tlib#string#Printf1(format, string)
+ This function deviates from |printf()| in certain ways.
+ Additional items:
+ %{rx} ... insert escaped regexp
+ %{fuzzyrx} ... insert typo-tolerant regexp
+
+ *tlib#string#TrimLeft()*
+tlib#string#TrimLeft(string)
+
+ *tlib#string#TrimRight()*
+tlib#string#TrimRight(string)
+
+ *tlib#string#Strip()*
+tlib#string#Strip(string)
+
+ *tlib#string#Count()*
+tlib#string#Count(string, rx)
+
+ *tlib#string#SplitCommaList()*
+tlib#string#SplitCommaList(text, ...)
+
+ *tlib#string#Input()*
+tlib#string#Input(...)
+
+
+
+vim:tw=78:fo=w2croql:isk=!-~,^*,^|,^":ts=8:ft=help:norl:
diff --git a/vim/bundle/tlib_vim/etc/tpl_tlib.txt b/vim/bundle/tlib_vim/etc/tpl_tlib.txt
new file mode 100644
index 0000000..f805970
--- /dev/null
+++ b/vim/bundle/tlib_vim/etc/tpl_tlib.txt
@@ -0,0 +1,30 @@
+*tlib.txt* tlib -- A library of vim functions
+ Author: Tom Link, micathom at gmail com
+
+This library provides some utility functions. There isn't much need to
+install it unless another plugin requires you to do so.
+
+Most of the library is included in autoload files. No autocommands are
+created. With the exception of loading ../plugin/02tlib.vim at startup
+the library has no impact on startup time or anything else.
+
+The change-log is included at the bottom of ../plugin/02tlib.vim
+(move the cursor over the file name and type gfG)
+
+Demo of |tlib#input#List()|:
+http://vimsomnia.blogspot.com/2010/11/selecting-items-from-list-with-tlibs.html
+
+
+-----------------------------------------------------------------------
+Install~
+
+Edit the vba file and type: >
+
+ :so %
+
+See :help vimball for details. If you have difficulties, please make
+sure, you have the current version of vimball (vimscript #1502)
+installed.
+
+
+%s
diff --git a/vim/bundle/tlib_vim/macros/tlib.vim b/vim/bundle/tlib_vim/macros/tlib.vim
new file mode 100644
index 0000000..3e5a791
--- /dev/null
+++ b/vim/bundle/tlib_vim/macros/tlib.vim
@@ -0,0 +1,38 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @GIT: http://github.com/tomtom/tlib_vim/
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2015-11-09.
+" @Revision: 10
+
+if &cp || exists("loaded_tlib_macros")
+ finish
+endif
+let loaded_tlib_macros = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+" :display: :TRequire NAME [VERSION [FILE]]
+" Make a certain vim file is loaded.
+"
+" Conventions: If FILE isn't defined, plugin/NAME.vim is loaded. The
+" file must provide a variable loaded_{NAME} that represents the version
+" number.
+command! -nargs=+ TRequire let s:require = [<f-args>]
+ \ | if !exists('loaded_'. get(s:require, 0))
+ \ | exec 'runtime '. get(s:require, 2, 'plugin/'. get(s:require, 0) .'.vim')
+ \ | if !exists('loaded_'. get(s:require, 0)) || loaded_{get(s:require, 0)} < get(s:require, 1, loaded_{get(s:require, 0)})
+ \ | echoerr 'Require '. get(s:require, 0) .' >= '. get(s:require, 1, 'any version will do')
+ \ | finish
+ \ | endif
+ \ | endif | unlet s:require
+
+
+" :display: :Ttimecommand CMD
+" Time the execution time of CMD.
+command! -nargs=1 -complete=command Ttimecommand call tlib#cmd#Time(<q-args>)
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/plugin/02tlib.vim b/vim/bundle/tlib_vim/plugin/02tlib.vim
new file mode 100755
index 0000000..a5dd488
--- /dev/null
+++ b/vim/bundle/tlib_vim/plugin/02tlib.vim
@@ -0,0 +1,106 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Created: 2007-04-10.
+" @Last Change: 2016-03-22.
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 815
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" GetLatestVimScripts: 1863 1 tlib.vim
+" tlib.vim -- Some utility functions
+
+if &cp || exists("g:loaded_tlib")
+ finish
+endif
+if v:version < 700 "{{{2
+ echoerr "tlib requires Vim >= 7"
+ finish
+endif
+let g:loaded_tlib = 121
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+" :display: :TLet VAR = VALUE
+" Set a variable only if it doesn't already exist.
+" EXAMPLES: >
+" TLet foo = 1
+" TLet foo = 2
+" echo foo
+" => 1
+command! -nargs=+ TLet if !exists(matchstr(<q-args>, '^[^=[:space:]]\+')) | exec 'let '. <q-args> | endif
+
+
+" Open a scratch buffer (a buffer without a file).
+" TScratch ... use split window
+" TScratch! ... use the whole frame
+" This command takes an (inner) dictionary as optional argument.
+" EXAMPLES: >
+" TScratch 'scratch': '__FOO__'
+" => Open a scratch buffer named __FOO__
+command! -bar -nargs=* -bang TScratch call tlib#scratch#UseScratch({'scratch_split': empty('<bang>'), <args>})
+
+
+" :display: :TVarArg VAR1, [VAR2, DEFAULT2] ...
+" A convenience wrapper for |tlib#arg#Let|.
+" EXAMPLES: >
+" function! Foo(...)
+" TVarArg ['a', 1], 'b'
+" echo 'a='. a
+" echo 'b='. b
+" endf
+command! -nargs=+ TVarArg exec tlib#arg#Let([<args>])
+
+
+" :display: :TBrowseOutput COMMAND
+" Ever wondered how to efficiently browse the output of a command
+" without redirecting it to a file? This command takes a command as
+" argument and presents the output via |tlib#input#List()| so that you
+" can easily search for a keyword (e.g. the name of a variable or
+" function) and the like.
+"
+" If you press enter, the selected line will be copied to the command
+" line. Press ESC to cancel browsing.
+"
+" EXAMPLES: >
+" TBrowseOutput 20verb TeaseTheCulprit
+command! -nargs=1 -complete=command TBrowseOutput call tlib#cmd#BrowseOutput(<q-args>)
+
+
+" :display: :TBrowseScriptnames
+" List all sourced script names (the output of ':scriptnames').
+"
+" When you press enter, the selected script will be opened in the current
+" window. Press ESC to cancel.
+"
+" EXAMPLES: >
+" TBrowseScriptnames
+command! -nargs=0 -complete=command TBrowseScriptnames call tlib#cmd#TBrowseScriptnames()
+
+
+" :display: :Tlibtrace GUARD, VAR1, VAR2...
+" Do nothing unless |tlib#trace#Enable()| was called.
+"
+" When |:Tlibtraceset| or |tlib#trace#Enable()| were called:
+"
+" If GUARD is a number that evaluates to true or if it is a string that
+" matches a |regexp|, which was added using Tlibtrace! (with '!'),
+" display the values of VAR1, VAR2 ...
+command! -nargs=+ -bang Tlibtrace :
+
+
+" :Tlibtraceset +RX1, -RX2...
+" If |tlib#trace#Enable()| was called: With the optional <bang>, users
+" can add and remove GUARDs (actually a |regexp|) that should be traced.
+command! -nargs=+ -bang Tlibtraceset call tlib#trace#Set(<q-args>)
+
+
+" :display: :Tlibtrace ASSERTION
+command! -nargs=+ -bang Tlibassert :
+
+" :display: :Tlibtype val, 'type', ...
+command! -nargs=+ Tlibtype :
+
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/samples/tlib/input/tlib_input_list.vim b/vim/bundle/tlib_vim/samples/tlib/input/tlib_input_list.vim
new file mode 100644
index 0000000..4d668ff
--- /dev/null
+++ b/vim/bundle/tlib_vim/samples/tlib/input/tlib_input_list.vim
@@ -0,0 +1,50 @@
+" The following variable configures the way |tlib#input#ListD()| works.
+" In this example, we allow selection of multiple items (we could also
+" allow only a single choice and make |tlib#input#ListD()| work on the
+" indices, not the items).
+"
+" We also set a prompt that will be displayed in the command area.
+"
+" By default, |tlib#input#ListD()| will automatically select an item if
+" there is only one item left matching the filter. In this example, we
+" disable this feature.
+"
+" For demonstration purposes, we also define a key handler that prints
+" the selected items.
+let s:state = {
+ \ 'type': 'm',
+ \ 'query': 'Select lines for command output',
+ \ 'pick_last_item': 0,
+ \ 'key_handlers': [
+ \ {'key': 16, 'agent': 'PrintMe', 'key_name': '<c-p>', 'help': 'Print line'},
+ \ ],
+ \ }
+
+" A key handler takes two arguments: the current state of the list
+" display and a list of selected items/indices (depending on the type
+" parameter).
+function! PrintMe(state, items) "{{{3
+ echom "You selected:"
+ for i in a:items
+ echom i
+ endfor
+ call input("Press ENTER to continue")
+ let a:state.state = 'redisplay'
+ return a:state
+endf
+
+" In this example, we evaluate an ex-command with |:execute| and display
+" the command's output as list. The user can select certain lines by
+" typing some pattern or by pressing <a-NUMBER> to select an item by
+" number. The user can then press <c-p> to print the lines (see above)
+" or <cr> to pick the selected lines.
+function! SelectOutput(ex) "{{{3
+ redir => lines
+ silent exec a:ex
+ redir END
+ let state = copy(s:state)
+ let state.base = split(lines, '\n')
+ let picked = tlib#input#ListD(state)
+ echom "You picked: ". join(picked, ', ')
+endf
+
diff --git a/vim/bundle/tlib_vim/scripts/create_crc_table.rb b/vim/bundle/tlib_vim/scripts/create_crc_table.rb
new file mode 100644
index 0000000..149fe11
--- /dev/null
+++ b/vim/bundle/tlib_vim/scripts/create_crc_table.rb
@@ -0,0 +1,67 @@
+# @Author: Tom Link (micathom AT gmail com)
+# @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+# @Revision: 14
+
+
+def crc_vim_table
+ tbl = [0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
+ 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
+ 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,
+ 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
+ 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,
+ 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
+ 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,
+ 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
+ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,
+ 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,
+ 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,
+ 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,
+ 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
+ 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,
+ 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
+ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,
+ 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
+ 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,
+ 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
+ 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,
+ 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
+ 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,
+ 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,
+ 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,
+ 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,
+ 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
+ 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,
+ 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
+ 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,
+ 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
+ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,
+ 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,
+ 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,
+ 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,
+ 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
+ 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,
+ 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
+ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,
+ 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
+ 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,
+ 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
+ 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,
+ 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
+ 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,
+ 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,
+ 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,
+ 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,
+ 0x2d02ef8d]
+ tbl.map! do |num|
+ b = "%b" % num
+ bits = b.split(//)
+ bits.map! {|b| b.to_i}
+ bits.reverse
+ end
+ VIM::command("let @t = '#{tbl.inspect}'")
+end
+
diff --git a/vim/bundle/tlib_vim/spec/tlib/arg.vim b/vim/bundle/tlib_vim/spec/tlib/arg.vim
new file mode 100755
index 0000000..cf060a2
--- /dev/null
+++ b/vim/bundle/tlib_vim/spec/tlib/arg.vim
@@ -0,0 +1,66 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2010-04-03.
+" @Last Change: 2010-04-03.
+" @Revision: 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+
+SpecBegin 'title': 'tlib#arg'
+
+function! TestGetArg(...) "{{{3
+ exec tlib#arg#Get(1, 'foo', 1)
+ return foo
+endf
+
+function! TestGetArg1(...) "{{{3
+ exec tlib#arg#Get(1, 'foo', 1, '!= ""')
+ return foo
+endf
+
+Should be equal TestGetArg(), 1
+Should be equal TestGetArg(''), ''
+Should be equal TestGetArg(2), 2
+Should be equal TestGetArg1(), 1
+Should be equal TestGetArg1(''), 1
+Should be equal TestGetArg1(2), 2
+
+function! TestArgs(...) "{{{3
+ exec tlib#arg#Let([['foo', "o"], ['bar', 2]])
+ return repeat(foo, bar)
+endf
+Should be equal TestArgs(), 'oo'
+Should be equal TestArgs('a'), 'aa'
+Should be equal TestArgs('a', 3), 'aaa'
+
+function! TestArgs1(...) "{{{3
+ exec tlib#arg#Let(['foo', ['bar', 2]])
+ return repeat(foo, bar)
+endf
+Should be equal TestArgs1(), ''
+Should be equal TestArgs1('a'), 'aa'
+Should be equal TestArgs1('a', 3), 'aaa'
+
+function! TestArgs2(...) "{{{3
+ exec tlib#arg#Let(['foo', 'bar'], 1)
+ return repeat(foo, bar)
+endf
+Should be equal TestArgs2(), '1'
+Should be equal TestArgs2('a'), 'a'
+Should be equal TestArgs2('a', 3), 'aaa'
+
+function! TestArgs3(...)
+ TVarArg ['a', 1], 'b'
+ return a . b
+endf
+Should be equal TestArgs3(), '1'
+Should be equal TestArgs3('a'), 'a'
+Should be equal TestArgs3('a', 3), 'a3'
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/spec/tlib/date.vim b/vim/bundle/tlib_vim/spec/tlib/date.vim
new file mode 100644
index 0000000..42c336b
--- /dev/null
+++ b/vim/bundle/tlib_vim/spec/tlib/date.vim
@@ -0,0 +1,61 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @GIT: http://github.com/tomtom/vimtlib/
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2010-09-17.
+" @Last Change: 2016-03-16.
+" @Revision: 21
+
+SpecBegin 'title': 'tlib#date'
+
+Should be equal tlib#date#Parse('2000-1-0', 1), [2000, 1, 0]
+Should be equal tlib#date#Parse('2000-1-2'), [2000, 1, 2]
+Should be equal tlib#date#Parse('2000-01-02'), [2000, 1, 2]
+Should be equal tlib#date#Parse('2000-10-20'), [2000, 10, 20]
+
+Should be equal tlib#date#Parse('00-1-0', 1), [2000, 1, 0]
+Should be equal tlib#date#Parse('00-1-2'), [2000, 1, 2]
+Should be equal tlib#date#Parse('00-01-02'), [2000, 1, 2]
+Should be equal tlib#date#Parse('00-10-20'), [2000, 10, 20]
+
+Should be equal tlib#date#Parse('2000/2/1'), [2000, 1, 2]
+Should be equal tlib#date#Parse('2000/02/01'), [2000, 1, 2]
+Should be equal tlib#date#Parse('2000/20/10'), [2000, 10, 20]
+
+Should be equal tlib#date#Parse('00/2/1'), [2000, 1, 2]
+Should be equal tlib#date#Parse('00/02/01'), [2000, 1, 2]
+Should be equal tlib#date#Parse('00/20/10'), [2000, 10, 20]
+
+Should be equal tlib#date#Parse('2.1.2000'), [2000, 1, 2]
+Should be equal tlib#date#Parse('2. 1. 2000'), [2000, 1, 2]
+Should be equal tlib#date#Parse('02.01.2000'), [2000, 1, 2]
+Should be equal tlib#date#Parse('02. 01. 2000'), [2000, 1, 2]
+Should be equal tlib#date#Parse('20.10.2000'), [2000, 10, 20]
+Should be equal tlib#date#Parse('20. 10. 2000'), [2000, 10, 20]
+
+Should throw exception "tlib#date#Parse('2000-14-2')", 'TLib: Invalid date'
+Should throw exception "tlib#date#Parse('2000-011-02')", 'TLib: Invalid date'
+Should throw exception "tlib#date#Parse('2000-10-40')", 'TLib: Invalid date'
+Should throw exception "tlib#date#Parse('2000-10-0')", 'TLib: Invalid date'
+
+Should be equal tlib#date#Shift('2015-10-29', '1m'), '2015-11-29'
+Should be equal tlib#date#Shift('2015-11-29', '1m'), '2015-12-29'
+Should be equal tlib#date#Shift('2015-12-29', '1m'), '2016-01-29'
+Should be equal tlib#date#Shift('2016-01-29', '1m'), '2016-02-29'
+Should be equal tlib#date#Shift('2015-10-29', '2m'), '2015-12-29'
+Should be equal tlib#date#Shift('2015-10-29', '3m'), '2016-01-29'
+Should be equal tlib#date#Shift('2015-10-29', '4m'), '2016-02-29'
+Should be equal tlib#date#Shift('2015-12-30', '1d'), '2015-12-31'
+Should be equal tlib#date#Shift('2015-12-31', '1d'), '2016-01-01'
+Should be equal tlib#date#Shift('2015-12-30', '2d'), '2016-01-01'
+Should be equal tlib#date#Shift('2015-12-30', '3d'), '2016-01-02'
+
+Should be equal tlib#date#Shift('2016-03-16', '1b'), '2016-03-17'
+Should be equal tlib#date#Shift('2016-03-16', '2b'), '2016-03-18'
+Should be equal tlib#date#Shift('2016-03-16', '3b'), '2016-03-21'
+Should be equal tlib#date#Shift('2016-03-16', '4b'), '2016-03-22'
+Should be equal tlib#date#Shift('2016-03-16', '5b'), '2016-03-23'
+Should be equal tlib#date#Shift('2016-03-16', '6b'), '2016-03-24'
+Should be equal tlib#date#Shift('2016-03-16', '7b'), '2016-03-25'
+Should be equal tlib#date#Shift('2016-03-16', '8b'), '2016-03-28'
+
diff --git a/vim/bundle/tlib_vim/spec/tlib/dictionary.vim b/vim/bundle/tlib_vim/spec/tlib/dictionary.vim
new file mode 100644
index 0000000..52439e6
--- /dev/null
+++ b/vim/bundle/tlib_vim/spec/tlib/dictionary.vim
@@ -0,0 +1,28 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: https://github.com/tomtom
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2016-04-03.
+" @Last Change: 2016-04-03.
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+
+SpecBegin 'title': 'tlib#dictionary'
+
+
+It should handle basic test cases for tlib#dictionary#Rev properly.
+
+Should be equal tlib#dictionary#Rev({}), {}
+Should be equal tlib#dictionary#Rev({1: 2, 3: 4}), {'2': '1', '4': '3'}
+Should be equal tlib#dictionary#Rev({1: '', 3: 4}, {'empty': '*'}), {'*': '1', '4': '3'}
+Should be equal tlib#dictionary#Rev({1: '', 3: 4}, {'use_string': 1}), {'''''': '1', '4': '3'}
+Should be equal tlib#dictionary#Rev({1: '', 3: 4}, {'use_string': 1, 'use_eval': 1}), {'''''': 1, '4': 3}
+Should be equal tlib#dictionary#Rev(tlib#dictionary#Rev({1: '', 3: 4}, {'use_string': 1}), {'use_eval': 1}), {1: '', 3: 4}
+Should be equal tlib#dictionary#Rev({1: 4, 2: 4}, {'values_as_list': 1}), {'4': ['1', '2']}
+Should be equal tlib#dictionary#Rev({1: 4, 2: 4}, {'values_as_list': 1, 'use_eval': 1}), {'4': [1, 2]}
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/spec/tlib/eval.vim b/vim/bundle/tlib_vim/spec/tlib/eval.vim
new file mode 100644
index 0000000..40c5138
--- /dev/null
+++ b/vim/bundle/tlib_vim/spec/tlib/eval.vim
@@ -0,0 +1,27 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: https://github.com/tomtom
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2015-10-26.
+" @Last Change: 2015-10-26.
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+SpecBegin 'title': 'tlib#eval'
+
+
+let g:eval_a = {'foo': range(0, 5), 'd': {'a': range(0, 5)}}
+let g:eval_b = {'foo': range(6, 10), 'd': {'a': range(6, 10), 'b': 2}, 'bar': range(5)}
+let g:eval_a0 = deepcopy(g:eval_a)
+let g:eval_b0 = deepcopy(g:eval_b)
+let g:eval_c = {'foo': range(0, 10), 'd': {'a': range(0, 10), 'b': 2}, 'bar': range(5)}
+
+
+Should be equal tlib#eval#Extend(copy(g:eval_a), g:eval_b), g:eval_c
+Should be equal g:eval_a, g:eval_a0
+Should be equal g:eval_b, g:eval_b0
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/spec/tlib/file.vim b/vim/bundle/tlib_vim/spec/tlib/file.vim
new file mode 100755
index 0000000..f692abf
--- /dev/null
+++ b/vim/bundle/tlib_vim/spec/tlib/file.vim
@@ -0,0 +1,59 @@
+" @Author: Thomas Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @GIT: http://github.com/tomtom/vimtlib/
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2009-02-25.
+" @Last Change: 2010-04-03.
+" @Revision: 13
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+SpecBegin 'title': 'tlib/file',
+ \ 'sfile': 'autoload/tlib/file.vim'
+
+
+
+It should split filenames.
+Should be equal tlib#file#Split('foo/bar/filename.txt'), ['foo', 'bar', 'filename.txt']
+Should be equal tlib#file#Split('/foo/bar/filename.txt'), ['', 'foo', 'bar', 'filename.txt']
+Should be equal tlib#file#Split('ftp://foo/bar/filename.txt'), ['ftp:/', 'foo', 'bar', 'filename.txt']
+
+
+It should join filenames.
+Should be#Equal tlib#file#Join(['foo', 'bar']), 'foo/bar'
+Should be#Equal tlib#file#Join(['foo/', 'bar'], 1), 'foo/bar'
+Should be#Equal tlib#file#Join(['', 'bar']), '/bar'
+Should be#Equal tlib#file#Join(['/', 'bar'], 1), '/bar'
+Should be#Equal tlib#file#Join(['foo', 'bar', 'filename.txt']), 'foo/bar/filename.txt'
+Should be#Equal tlib#file#Join(['', 'foo', 'bar', 'filename.txt']), '/foo/bar/filename.txt'
+Should be#Equal tlib#file#Join(['ftp:/', 'foo', 'bar', 'filename.txt']), 'ftp://foo/bar/filename.txt'
+Should be#Equal tlib#file#Join(['ftp://', 'foo', 'bar', 'filename.txt'], 1), 'ftp://foo/bar/filename.txt'
+
+Should be equal tlib#file#Join(['foo', 'bar', 'filename.txt']), 'foo/bar/filename.txt'
+Should be equal tlib#file#Join(['', 'foo', 'bar', 'filename.txt']), '/foo/bar/filename.txt'
+Should be equal tlib#file#Join(['ftp:/', 'foo', 'bar', 'filename.txt']), 'ftp://foo/bar/filename.txt'
+
+
+It should construct relative path names.
+Should be#Equal tlib#file#Relative('foo/bar/filename.txt', 'foo'), 'bar/filename.txt'
+Should be#Equal tlib#file#Relative('foo/bar/filename.txt', 'foo/base'), '../bar/filename.txt'
+Should be#Equal tlib#file#Relative('filename.txt', 'foo/base'), '../../filename.txt'
+Should be#Equal tlib#file#Relative('/foo/bar/filename.txt', '/boo/base'), '../../foo/bar/filename.txt'
+Should be#Equal tlib#file#Relative('/bar/filename.txt', '/boo/base'), '../../bar/filename.txt'
+Should be#Equal tlib#file#Relative('/foo/bar/filename.txt', '/base'), '../foo/bar/filename.txt'
+Should be#Equal tlib#file#Relative('c:/bar/filename.txt', 'x:/boo/base'), 'c:/bar/filename.txt'
+
+
+Should be equal tlib#file#Relative('foo/bar/filename.txt', 'foo'), 'bar/filename.txt'
+Should be equal tlib#file#Relative('foo/bar/filename.txt', 'foo/base'), '../bar/filename.txt'
+Should be equal tlib#file#Relative('filename.txt', 'foo/base'), '../../filename.txt'
+Should be equal tlib#file#Relative('/foo/bar/filename.txt', '/boo/base'), '../../foo/bar/filename.txt'
+Should be equal tlib#file#Relative('/bar/filename.txt', '/boo/base'), '../../bar/filename.txt'
+Should be equal tlib#file#Relative('/foo/bar/filename.txt', '/base'), '../foo/bar/filename.txt'
+Should be equal tlib#file#Relative('c:/bar/filename.txt', 'x:/boo/base'), 'c:/bar/filename.txt'
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/spec/tlib/hash.vim b/vim/bundle/tlib_vim/spec/tlib/hash.vim
new file mode 100644
index 0000000..a2403a3
--- /dev/null
+++ b/vim/bundle/tlib_vim/spec/tlib/hash.vim
@@ -0,0 +1,58 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Revision: 31
+
+
+SpecBegin 'title': 'tlib#hash'
+
+
+It should calculate CRC32B checksums.
+
+let g:tlib_hash_use_crc32 = g:tlib#hash#use_crc32
+
+let g:tlib#hash#use_crc32 = 'ruby'
+Should be equal tlib#hash#CRC32B('The quick brown fox jumps over the lazy dog'), '414FA339'
+Should be equal tlib#hash#CRC32B('foo'), '8C736521'
+Should be equal tlib#hash#CRC32B('f'), '76D32BE0'
+
+let g:tlib#hash#use_crc32 = 'vim'
+Should be equal tlib#hash#CRC32B('The quick brown fox jumps over the lazy dog'), '414FA339'
+Should be equal tlib#hash#CRC32B('foo'), '8C736521'
+Should be equal tlib#hash#CRC32B('f'), '76D32BE0'
+
+
+function! s:CompareHash(text) "{{{3
+ if !empty(a:text)
+ exec 'It should calculate the crc32b checksum for:' a:text
+ let crc32ruby = tlib#hash#CRC32B_ruby(a:text)
+ let crc32vim = tlib#hash#CRC32B_vim(a:text)
+ exec 'Should be equal' string(crc32ruby) ',' string(crc32vim)
+ exec 'It should calculate the adler32 checksum for:' a:text
+ let adler32tlib = tlib#hash#Adler32_tlib(a:text)
+ let adler32vim = tlib#hash#Adler32_vim(a:text)
+ exec 'Should be equal' string(adler32tlib) ',' string(adler32vim)
+ endif
+endf
+
+redir => s:scriptnames
+silent scriptnames
+redir END
+for s:script in split(s:scriptnames, '\n')
+ let s:scriptfile = matchstr(s:script, '^\s*\d\+:\s\+\zs.*$')
+ call s:CompareHash(s:scriptfile)
+ try
+ let s:scriptlines = readfile(s:scriptfile)
+ call s:CompareHash(join(s:scriptlines, "\n"))
+ for s:scriptline in s:scriptlines
+ call s:CompareHash(s:scriptline)
+ endfor
+ catch /^Vim\%((\a\+)\)\=:E484/
+ endtry
+endfor
+unlet s:scriptnames, :script, s:scriptfile, s:scriptlines, s:scriptline
+delf s:CompareHash
+
+
+let g:tlib#hash#use_crc32 = g:tlib_hash_use_crc32
+
diff --git a/vim/bundle/tlib_vim/spec/tlib/input.vim b/vim/bundle/tlib_vim/spec/tlib/input.vim
new file mode 100755
index 0000000..f82aea6
--- /dev/null
+++ b/vim/bundle/tlib_vim/spec/tlib/input.vim
@@ -0,0 +1,127 @@
+" @Author: Tom Link (micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @GIT: http://github.com/tomtom/vimtlib/
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2009-02-28.
+" @Last Change: 2009-03-14.
+" @Revision: 73
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+SpecBegin 'title': 'tlib: Input', 'scratch': '%',
+ \ 'after': ':unlet! g:spec_lib_rv',
+ \ 'options': [
+ \ 'vim',
+ \ ]
+
+
+let g:spec_tlib_list = [10, 20, 30, 40, 'a50', 'aa60', 'b70', 'ba80', 90]
+
+
+
+It should return empty values when the user presses <escape>.
+Replay :let g:spec_lib_rv = tlib#input#List('s', '', g:spec_tlib_list)\<cr>
+ \ \<Down>\<Down>\<esc>
+Should be#Equal g:spec_lib_rv, ''
+
+Replay :let g:spec_lib_rv = tlib#input#List('m', '', g:spec_tlib_list)\<cr>
+ \ \<Down>\<Down>\<esc>
+Should be#Equal g:spec_lib_rv, []
+
+Replay :let g:spec_lib_rv = tlib#input#List('si', '', g:spec_tlib_list)\<cr>
+ \ \<Down>\<Down>\<esc>
+Should be#Equal g:spec_lib_rv, 0
+
+
+
+It should pick an item from s-type list.
+Replay :let g:spec_lib_rv = tlib#input#List('s', '', g:spec_tlib_list)\<cr>
+ \ \<Down>\<Down>\<cr>
+Should be#Equal g:spec_lib_rv, 30
+
+
+
+It should return an index from si-type list.
+Replay :let g:spec_lib_rv = tlib#input#List('si', '', g:spec_tlib_list)\<cr>
+ \ \<Down>\<Down>\<cr>
+Should be#Equal g:spec_lib_rv, 3
+
+
+
+It should return a list from a m-type list.
+Replay :let g:spec_lib_rv = tlib#input#List('m', '', g:spec_tlib_list)\<cr>
+ \ \<Down>#\<Down>\<Down>\<cr>
+Should be#Equal sort(g:spec_lib_rv), [20, 40]
+
+Replay :let g:spec_lib_rv = tlib#input#List('m', '', g:spec_tlib_list)\<cr>
+ \ \<Down>\<S-Down>\<cr>
+Should be#Equal sort(g:spec_lib_rv), [20, 30]
+
+Replay :let g:spec_lib_rv = tlib#input#List('m', '', g:spec_tlib_list)\<cr>
+ \ \<Down>\<Down>\<S-up>\<cr>
+Should be#Equal sort(g:spec_lib_rv), [20, 30]
+
+
+
+It should return a list of indices from a mi-type list.
+Replay :let g:spec_lib_rv = tlib#input#List('mi', '', g:spec_tlib_list)\<cr>
+ \ \<Down>#\<Down>\<Down>\<cr>
+Should be#Equal sort(g:spec_lib_rv), [2, 4]
+
+Replay :let g:spec_lib_rv = tlib#input#List('mi', '', g:spec_tlib_list)\<cr>
+ \ \<Down>\<S-Down>\<cr>
+Should be#Equal sort(g:spec_lib_rv), [2, 3]
+
+Replay :let g:spec_lib_rv = tlib#input#List('mi', '', g:spec_tlib_list)\<cr>
+ \ \<Down>\<Down>\<S-up>\<cr>
+Should be#Equal sort(g:spec_lib_rv), [2, 3]
+
+
+
+It should filter items from a s-type list.
+Replay :let g:spec_lib_rv = tlib#input#List('s', '', g:spec_tlib_list)\<cr>
+ \ \<Down>a\<Down>\<cr>
+Should be#Equal g:spec_lib_rv, 'aa60'
+
+
+
+It should filter items from a si-type list.
+Replay :let g:spec_lib_rv = tlib#input#List('si', '', g:spec_tlib_list)\<cr>
+ \ \<Down>a\<Down>\<cr>
+Should be#Equal g:spec_lib_rv, 6
+
+
+
+It should filter items from a m-type list.
+Replay :let g:spec_lib_rv = tlib#input#List('m', '', g:spec_tlib_list)\<cr>
+ \ a\<Down>#\<Down>\<cr>
+Should be#Equal sort(g:spec_lib_rv), ['aa60', 'ba80']
+
+Replay :let g:spec_lib_rv = tlib#input#List('m', '', g:spec_tlib_list)\<cr>
+ \ a\<Down>\<S-Down>\<cr>
+Should be#Equal sort(g:spec_lib_rv), ['aa60', 'ba80']
+
+Replay :let g:spec_lib_rv = tlib#input#List('m', '', g:spec_tlib_list)\<cr>
+ \ a\<Down>\<Down>\<S-up>\<cr>
+Should be#Equal sort(g:spec_lib_rv), ['aa60', 'ba80']
+
+
+
+It should filter items from a mi-type list.
+Replay :let g:spec_lib_rv = tlib#input#List('mi', '', g:spec_tlib_list)\<cr>
+ \ a\<Down>#\<Down>\<cr>
+Should be#Equal sort(g:spec_lib_rv), [6, 8]
+
+Replay :let g:spec_lib_rv = tlib#input#List('mi', '', g:spec_tlib_list)\<cr>
+ \ a\<Down>\<S-Down>\<cr>
+Should be#Equal sort(g:spec_lib_rv), [6, 8]
+
+Replay :let g:spec_lib_rv = tlib#input#List('mi', '', g:spec_tlib_list)\<cr>
+ \ a\<Down>\<Down>\<S-up>\<cr>
+Should be#Equal sort(g:spec_lib_rv), [6, 8]
+
+
+
+let &cpo = s:save_cpo
diff --git a/vim/bundle/tlib_vim/spec/tlib/list.vim b/vim/bundle/tlib_vim/spec/tlib/list.vim
new file mode 100755
index 0000000..d4aae54
--- /dev/null
+++ b/vim/bundle/tlib_vim/spec/tlib/list.vim
@@ -0,0 +1,67 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2010-04-03.
+" @Last Change: 2010-04-03.
+" @Revision: 4
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+
+SpecBegin 'title': 'tlib: List'
+ " \, 'options': [vim, <+SET+>]
+ " \, 'sfile': '<+SCRIPT CONTEXT+>'
+ " \, 'scratch': '<+SCRATCH FILE+>'
+ " \, 'before': '<+BEFORE EX COMMANDS+>'
+ " \, 'after': '<+AFTER EX COMMANDS+>'
+ " \, 'cleanup': ['<+FUNCTION+>()']
+
+
+" List {{{2
+fun! Add(a,b)
+ return a:a + a:b
+endf
+
+Should be equal tlib#list#Inject([], 0, function('Add')), 0
+Should be equal tlib#list#Inject([1,2,3], 0, function('Add')), 6
+
+Should be equal tlib#list#Compact([]), []
+Should be equal tlib#list#Compact([0,1,2,3,[], {}, ""]), [1,2,3]
+
+Should be equal tlib#list#Flatten([]), []
+Should be equal tlib#list#Flatten([1,2,3]), [1,2,3]
+Should be equal tlib#list#Flatten([1,2, [1,2,3], 3]), [1,2,1,2,3,3]
+Should be equal tlib#list#Flatten([0,[1,2,[3,""]]]), [0,1,2,3,""]
+
+Should be equal tlib#list#FindAll([1,2,3], 'v:val >= 2'), [2,3]
+Should be equal tlib#list#FindAll([1,2,3], 'v:val >= 2', 'v:val * 10'), [20,30]
+
+Should be equal tlib#list#Find([1,2,3], 'v:val >= 2'), 2
+Should be equal tlib#list#Find([1,2,3], 'v:val >= 2', 0, 'v:val * 10'), 20
+Should be equal tlib#list#Find([1,2,3], 'v:val >= 5', 10), 10
+
+Should be equal tlib#list#Any([1,2,3], 'v:val >= 2'), 1
+Should be equal tlib#list#Any([1,2,3], 'v:val >= 5'), 0
+
+Should be equal tlib#list#All([1,2,3], 'v:val < 5'), 1
+Should be equal tlib#list#All([1,2,3], 'v:val >= 2'), 0
+
+Should be equal tlib#list#Remove([1,2,1,2], 2), [1,1,2]
+Should be equal tlib#list#RemoveAll([1,2,1,2], 2), [1,1]
+
+Should be equal tlib#list#Zip([[1,2,3], [4,5,6]]), [[1,4], [2,5], [3,6]]
+Should be equal tlib#list#Zip([[1,2,3], [4,5,6,7]]), [[1,4], [2,5], [3,6], ['', 7]]
+Should be equal tlib#list#Zip([[1,2,3], [4,5,6,7]], -1), [[1,4], [2,5], [3,6], [-1,7]]
+Should be equal tlib#list#Zip([[1,2,3,7], [4,5,6]], -1), [[1,4], [2,5], [3,6], [7,-1]]
+
+
+Should be equal tlib#list#Uniq([]), []
+Should be equal tlib#list#Uniq([1,1]), [1]
+Should be equal tlib#list#Uniq([1,2,2,3,2,3,4,2,1,7,2,3,2,3,7]), [1,2,3,4,7]
+
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/spec/tlib/rx.vim b/vim/bundle/tlib_vim/spec/tlib/rx.vim
new file mode 100755
index 0000000..fc28103
--- /dev/null
+++ b/vim/bundle/tlib_vim/spec/tlib/rx.vim
@@ -0,0 +1,27 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2010-04-03.
+" @Last Change: 2010-04-03.
+" @Revision: 2
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+
+SpecBegin 'title': 'tlib#rx'
+
+
+for c in split('^$.*+\()|{}[]~', '\zs')
+ let s = printf('%sfoo%sbar%s', c, c, c)
+ Should be like s, '\m^'. tlib#rx#Escape(s, 'm') .'$'
+ Should be like s, '\M^'. tlib#rx#Escape(s, 'M') .'$'
+ Should be like s, '\v^'. tlib#rx#Escape(s, 'v') .'$'
+ Should be like s, '\V\^'. tlib#rx#Escape(s, 'V') .'\$'
+endfor
+
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/spec/tlib/string.vim b/vim/bundle/tlib_vim/spec/tlib/string.vim
new file mode 100755
index 0000000..4329d94
--- /dev/null
+++ b/vim/bundle/tlib_vim/spec/tlib/string.vim
@@ -0,0 +1,29 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2010-04-03.
+" @Last Change: 2010-04-03.
+" @Revision: 4
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+
+SpecBegin 'title': 'tlib#string'
+
+Should be equal tlib#string#RemoveBackslashes('foo bar'), 'foo bar'
+Should be equal tlib#string#RemoveBackslashes('foo\ bar'), 'foo bar'
+Should be equal tlib#string#RemoveBackslashes('foo\ \\bar'), 'foo \\bar'
+Should be equal tlib#string#RemoveBackslashes('foo\ \\bar', '\ '), 'foo \bar'
+
+
+Should be equal tlib#string#Count("fooo", "o"), 3
+Should be equal tlib#string#Count("***", "\\*"), 3
+Should be equal tlib#string#Count("***foo", "\\*"), 3
+Should be equal tlib#string#Count("foo***", "\\*"), 3
+
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/spec/tlib/url.vim b/vim/bundle/tlib_vim/spec/tlib/url.vim
new file mode 100755
index 0000000..80783e9
--- /dev/null
+++ b/vim/bundle/tlib_vim/spec/tlib/url.vim
@@ -0,0 +1,23 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2010-04-03.
+" @Last Change: 2010-04-03.
+" @Revision: 2
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+
+SpecBegin 'title': 'tlib#url'
+
+Should be equal tlib#url#Decode('http://example.com/foo+bar%25bar'), 'http://example.com/foo bar%bar'
+Should be equal tlib#url#Decode('Hello%20World.%20%20Good%2c%20bye.'), 'Hello World. Good, bye.'
+
+Should be equal tlib#url#Encode('foo bar%bar'), 'foo+bar%%bar'
+Should be equal tlib#url#Encode('Hello World. Good, bye.'), 'Hello+World.+Good%2c+bye.'
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/tlib_vim/spec/tlib/var.vim b/vim/bundle/tlib_vim/spec/tlib/var.vim
new file mode 100755
index 0000000..28e3fac
--- /dev/null
+++ b/vim/bundle/tlib_vim/spec/tlib/var.vim
@@ -0,0 +1,37 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2010-04-03.
+" @Last Change: 2010-04-03.
+" @Revision: 2
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+
+SpecBegin 'title': 'tlib#var'
+
+
+let g:foo = 1
+let g:bar = 2
+let b:bar = 3
+let s:bar = 4
+
+Should be equal tlib#var#Get('bar', 'bg'), 3
+Should be equal tlib#var#Get('bar', 'g'), 2
+Should be equal tlib#var#Get('foo', 'bg'), 1
+Should be equal tlib#var#Get('foo', 'g'), 1
+Should be equal tlib#var#Get('none', 'l'), ''
+
+Should be equal eval(tlib#var#EGet('bar', 'bg')), 3
+Should be equal eval(tlib#var#EGet('bar', 'g')), 2
+" Should be equal eval(tlib#var#EGet('bar', 'sg')), 4
+Should be equal eval(tlib#var#EGet('foo', 'bg')), 1
+Should be equal eval(tlib#var#EGet('foo', 'g')), 1
+Should be equal eval(tlib#var#EGet('none', 'l')), ''
+
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/vim/bundle/vim-addon-mw-utils/.gitignore b/vim/bundle/vim-addon-mw-utils/.gitignore
new file mode 100644
index 0000000..926ccaa
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/.gitignore
@@ -0,0 +1 @@
+doc/tags
diff --git a/vim/bundle/vim-addon-mw-utils/autoload/buf_utils.vim b/vim/bundle/vim-addon-mw-utils/autoload/buf_utils.vim
new file mode 100644
index 0000000..d14d404
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/autoload/buf_utils.vim
@@ -0,0 +1,24 @@
+" buf_identifier is either a buf_nr or a filename
+" If any window shows the buffer move to the buffer
+" If not show it in current window (by c-w s c^ you can always
+" reshow the last buffer
+"
+" Example: buf_utils#GotoBuf("/tmp/tfile.txt", {'create': 1})
+" returns: The command which was used to switch to the buffer
+fun! buf_utils#GotoBuf(buf_identifier, opts)
+ let buf_nr = bufnr(a:buf_identifier)
+ if buf_nr == -1 && ( get(a:opts, 'create', 0) || has_key(a:opts, 'create_cmd'))
+ exec get(a:opts,'create_cmd','e').' '.fnameescape(a:buf_identifier)
+ return "e"
+ else
+ let win_nr = bufwinnr(buf_nr)
+ if win_nr == -1
+ exec 'b '.buf_nr
+ return "b"
+ else
+ exec win_nr.'wincmd w'
+ return "w"
+ endif
+ wincmd w"
+ endif
+endf
diff --git a/vim/bundle/vim-addon-mw-utils/autoload/cached_file_contents.vim b/vim/bundle/vim-addon-mw-utils/autoload/cached_file_contents.vim
new file mode 100644
index 0000000..3fc3ce4
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/autoload/cached_file_contents.vim
@@ -0,0 +1,104 @@
+" cached_file_contents.vim
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2010-01-03.
+" @Revision: 0.3.0
+
+"exec vam#DefineAndBind('s:c','g:cache_dir_options','{}')
+if !exists('g:cache_dir_options') | let g:cache_dir_options = {} | endif | let s:c = g:cache_dir_options
+
+let s:c['cache_dir'] = get(s:c, 'cache_dir', expand('$HOME').'/.vim-cache')
+let s:c['scanned_files'] = get(s:c, 'scanned_files', {})
+let s:scanned_files = s:c['scanned_files']
+
+
+let s:define_cache_file = "let this_dir = s:c['cache_dir'].'/cached-file-contents' | let cache_file = expand(this_dir.'/'.substitute(string([func_as_string, a:file]),'[[\\]{}:/\\,''\"# ]\\+','_','g'))"
+
+" read a file, run function to extract contents and cache the result returned
+" by that function in memory. Optionally the result can be cached on disk as
+" because VimL can be slow!
+"
+" file : the file to be read
+" func: { 'func': function which will be called by funcref#Call
+" , 'version' : if this version changes cache will be invalidate automatically
+" , 'ftime_check': optional, default 1. if set to 0 cache isn't updated when file changes and file is in cache
+" }
+"
+" default: what to return if file doesn't exist
+" think twice about adding lines. This function is called many times.
+function! cached_file_contents#CachedFileContents(file, func, ...) abort
+ let ignore_ftime = a:0 > 0 ? a:1 : 0
+ " using string for default so that is evaluated when needed only
+ let use_file_cache = get(a:func, 'use_file_cache', 0)
+
+ " simple kind of normalization. necessary when using file caching
+ " this seems to be slower:
+ " let file = fnamemodify(a:file, ':p') " simple kind of normalization. necessary when using file caching
+ " / = assume its an absolute path
+ " let file = a:file[0] == '/' ? a:file : expand(a:file, ':p')
+ let file = a:file[0] == '/' ? a:file : fnamemodify(a:file, ':p') " simple kind of normalization. necessary when using file caching
+ let func_as_string = string(a:func['func'])
+
+ if (!has_key(s:scanned_files, func_as_string))
+ let s:scanned_files[func_as_string] = {}
+ endif
+ let dict = s:scanned_files[func_as_string]
+ if use_file_cache && !has_key(dict, a:file)
+ exec s:define_cache_file
+ if filereadable(cache_file)
+ let dict[file] = eval(readfile(cache_file,'b')[0])
+ endif
+ endif
+ if has_key(dict, a:file)
+ let d = dict[a:file]
+ if use_file_cache
+ \ && (ignore_ftime || getftime(a:file) <= d['ftime'])
+ \ && d['version'] == a:func['version']
+ return dict[a:file]['scan_result']
+ endif
+ endif
+ let scan_result = funcref#Call(a:func['func'], [a:file] )
+ let dict[a:file] = {"ftime": getftime(a:file), 'version': a:func['version'], "scan_result": scan_result }
+ if use_file_cache
+ if !exists('cache_file') | exec s:define_cache_file | endif
+ if !isdirectory(this_dir) | call mkdir(this_dir,'p',0700) | endif
+ call writefile([string(dict[a:file])], cache_file)
+ endif
+ return scan_result
+endfunction
+
+fun! cached_file_contents#ClearScanCache()
+ let s:c['scanned_files'] = {}
+
+ " Don't run rm -fr. Ask user to run it. It cache_dir may have been set to
+ " $HOME ! (should nevere be the case but who knows
+ echoe "run manually in your shell: rm -fr ".shellescape(s:c['cache_dir'])."/*"
+endf
+
+fun! cached_file_contents#Test()
+
+ " usually you use a global option so that the function can be reused
+ let my_interpreting_func = {'func' : funcref#Function('return len(readfile(ARGS[0]))'), 'version': 2, 'use_file_cache':1}
+ let my_interpreting_func2 = {'func' : funcref#Function('return ARGS[0]') , 'version': 2, 'use_file_cache':1}
+
+ let tmp = tempname()
+ call writefile(['some text','2nd line'], tmp)
+
+ let r = [ cached_file_contents#CachedFileContents(tmp, my_interpreting_func)
+ \ , cached_file_contents#CachedFileContents(tmp, my_interpreting_func2) ]
+ if r != [2, tmp]
+ throw "test failed 1, got ".string(r)
+ endif
+ unlet r
+
+ sleep 3
+
+ " now let's change contents
+ call writefile(['some text','2nd line','3rd line'], tmp)
+
+ let r = cached_file_contents#CachedFileContents(tmp, my_interpreting_func)
+ if 3 != r
+ throw "test failed 2, got ".string(r)
+ endif
+
+ echo "test passed"
+endf
diff --git a/vim/bundle/vim-addon-mw-utils/autoload/env_reload.vim b/vim/bundle/vim-addon-mw-utils/autoload/env_reload.vim
new file mode 100644
index 0000000..d8af33a
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/autoload/env_reload.vim
@@ -0,0 +1,12 @@
+" in sh/bash you can type export to get a list of environment variables
+" This function assigns those env vars to Vim.
+" Does not delete env vars yet
+" Example: env_reload#ReloadEnv(system("sh -c 'export'")
+fun! env_reload#ReloadEnv(bash_export_command_output)
+ for i in split(a:bash_export_command_output,"\n")
+ let m = matchlist(i, 'export \([^=]\+\)="\(.*\)"')
+ if empty(m) | continue | endif
+ " don't care about quoted values right now.
+ exec 'let $'.m[1].'='.string(m[2])
+ endfor
+endf
diff --git a/vim/bundle/vim-addon-mw-utils/autoload/funcref.vim b/vim/bundle/vim-addon-mw-utils/autoload/funcref.vim
new file mode 100644
index 0000000..20eec54
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/autoload/funcref.vim
@@ -0,0 +1,95 @@
+" funcref.vim
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Last Change: 2010-01-03.
+" @Revision: 0.1.0
+
+" documentation see doc/funcref.txt
+
+" usage:
+" funcref#Function("filename#Function")
+" optionally pass arguments:
+" funcref#Function("filename#Function",{'args': [2]})
+" optionally define self:
+" funcref#Function("filename#Function",{'self': object})
+function! funcref#Function(name,...)
+ let d = a:0 > 0 ? a:1 : {}
+ let d['faked_function_reference'] = a:name
+ return d
+endfunction
+
+" args : same as used for call(f,[args], self)
+" f must be either
+" - a string which can be evaled (use "return 'value'" to return a value)
+" - a Vim function reference created by function('..')
+" - a faked function reference created by funcref#Function(..)
+"
+" the last "self" argument can be overriden by the function reference
+" You can pass arguments in a closure like style
+function! funcref#Call(...)
+ let args = copy(a:000)
+
+ " add parameters:
+ if (len(args) < 2)
+ call add(args, [])
+ endif
+
+
+ let isDict = type(args[0]) == type({})
+
+ " prepend parameters which were passed by faked function reference:
+ if isDict && has_key(args[0], 'args')
+ let args[1] = args[0]['args']+args[1]
+ endif
+
+ " always pass self. this way you can call functions from dictionaries not
+ " refering to self
+ if (len(args) < 3)
+ call add(args, {})
+ endif
+
+ " the funcref overrides self:
+ if isDict && has_key(args[0], 'self')
+ let args[2] = args[0]['self']
+ endif
+
+ if type(a:1) == 2
+ " funcref: function must have been laoded
+ return call(function('call'), args)
+ elseif isDict && has_key(args[0], 'faked_function_reference')
+ let Fun = args[0]['faked_function_reference']
+ if type(Fun) == type('')
+ \ && (Fun[:len('return ')-1] == 'return '
+ \ || Fun[:len('call ')-1] == 'call '
+ \ || Fun[:len('if ')-1] == 'if '
+ \ || Fun[:len('let ')-1] == 'let '
+ \ || Fun[:len('echo ')-1] == 'echo '
+ \ || Fun[:len('exec ')-1] == 'exec '
+ \ || Fun[:len('debug ')-1] == 'debug ')
+ " it doesn't make sense to list all vim commands here
+ " So if you want to execute another action consider using
+ " funcref#Function('exec '.string('aw')) or such
+
+ " function is a String, call exec
+ let ARGS = args[1]
+ let SELF = args[2]
+ exec Fun
+ else
+ " pseudo function, let's load it..
+ if type(Fun) == 1
+ if !exists('*'.Fun)
+ " lazily load function
+ let file = substitute(substitute(Fun,'#[^#]*$','',''),'#','/','g')
+ exec 'runtime /autoload/'.file.'.vim'
+ endif
+ let Fun2 = function(Fun)
+ else
+ let Fun2 = Fun
+ endif
+ let args[0] = Fun
+ return call(function('call'), args)
+ endif
+ else
+ " no function, return the value
+ return args[0]
+ endif
+endfunction
diff --git a/vim/bundle/vim-addon-mw-utils/autoload/glob.vim b/vim/bundle/vim-addon-mw-utils/autoload/glob.vim
new file mode 100644
index 0000000..9a0f79a
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/autoload/glob.vim
@@ -0,0 +1,27 @@
+exec vam#DefineAndBind('s:c','g:glob_like', '{}')
+
+" ignore vcs stuff, Don't think you want those..
+let s:c['regex_ignore_directory'] = '\<\%([_.]darcs\|\.git\|.svn\|.hg\|.cvs\|.bzr\)\>'
+let s:c['glob_cache'] = get(s:c, 'glob_cache', {})
+let s:glob_cache = s:c['glob_cache']
+
+fun! glob#Glob(pattern, ...)
+ let pattern = a:pattern
+ if pattern[0] == '~'
+ let pattern = $HOME.pattern[1:]
+ endif
+ let opts = a:0 > 0 ? a:1 : {}
+ " never cache current directory. You're very likely to edit files in it.
+
+ let c = getcwd()
+ let cachable = get(opts, 'cachable', 0) && pattern[:len(c)-1] != c
+ if cachable && has_key(s:glob_cache, pattern)
+ return s:glob_cache[pattern]
+ endif
+
+ " FIXME: don't recurse into \.git directory (thus reimplement glob in vimL!)
+ let r = filter(split(glob(pattern),"\n"),'v:val !~ '.string(s:c['regex_ignore_directory']))
+ if cachable | let s:glob_cache[pattern] = r | endif
+ return r
+endf
+
diff --git a/vim/bundle/vim-addon-mw-utils/autoload/tiny_cmd.vim b/vim/bundle/vim-addon-mw-utils/autoload/tiny_cmd.vim
new file mode 100644
index 0000000..052bbe0
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/autoload/tiny_cmd.vim
@@ -0,0 +1,19 @@
+" vim suffers:
+
+exec vam#DefineAndBind('s:c','g:vim_tiny_cmd', '{}')
+
+fun! tiny_cmd#Put(a)
+ let new = get(s:c,'next',0) +1
+ let s:c['next'] = new
+ let s:c[new] = a:a
+ return new
+endf
+
+fun! tiny_cmd#Get(nr)
+ return s:c[a:nr]
+endf
+
+" Get and remove item
+fun! tiny_cmd#Pop(nr)
+ let r = s:c[a:nr] | unlet s:c[a:nr] | return r
+endf
diff --git a/vim/bundle/vim-addon-mw-utils/autoload/tovl/scratch_buffer.vim b/vim/bundle/vim-addon-mw-utils/autoload/tovl/scratch_buffer.vim
new file mode 100644
index 0000000..217dca1
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/autoload/tovl/scratch_buffer.vim
@@ -0,0 +1,103 @@
+" old code
+
+augroup TOVLWrite
+augroup end
+
+" =========== scratch buffer =========================================
+" a scratch buffer is a temporary buffer where the user can enter some text
+" It can be used to get commit messages, edit configuration options and so on
+
+function! tovl#scratch_buffer#KeepIntactLineNr()
+ let i = 0
+ while getline(i)!= b:keepIntact && i < line('$')
+ let i = i+1
+ endwhile
+ if i > line('$')
+ return -1
+ else
+ return i
+ endif
+endfunction
+
+" opens a buffer and runs an action when the buffer is written
+" keys:
+" name : the name of the buffer
+" onWrite : will be called on write
+" onWrite is responsible for setlocal nomodified to indicate that
+" saving has been successful
+" help : callback returning additional information lines
+" getContent : callback returning lines
+" cmds : extra commands to be run (optional)
+" (maybe you prefer adding them the default way afer the
+" ScratchBuffer call. They'll be rerun on GetContents
+" sp_cmd : the command to use to create the new buffer. Defaults to :e
+" buftype : ...
+" modifiable : 1 / 0 defaults to 1
+function! tovl#scratch_buffer#ScratchBuffer(opts)
+ let a:opts['name'] = get(a:opts,'name', 'strach_buffer_without_name')
+ exec get(a:opts, 'sp_cmd', 'e').' '.escape(a:opts['name'],' ')
+ let b:settings = a:opts
+ let b:settings['modifiable'] = get(a:opts,'modifiable', 1)
+ setlocal buftype=acwrite
+ command! -buffer -nargs=0 Help call tovl#scratch_buffer#Help()
+
+ " setup write notification
+ au TOVLWrite BufWriteCmd <buffer> call tovl#scratch_buffer#Write()
+
+ if has_key(a:opts,'getContent')
+ command! -buffer -nargs=0 GetContents call tovl#scratch_buffer#GetContents()
+ GetContents
+ if !b:settings['modifiable']
+ setlocal nomodifiable
+ endif
+ endif
+ "let u=&undolevels
+ "setlocal undolevels=-1
+ "exec 'setlocal undolevels='.u
+
+ " mark buffer as not modified
+ setlocal nomodified
+
+ au BufReadCmd <buffer> GetContents
+
+ " run addittional commands
+ for cmd in get(a:opts,'cmds',[])
+ exec cmd
+ endfor
+ silent echo get(a:opts,'echo_help', "type :Help for help")
+endfunction
+
+" =========== utility functions ======================================
+
+function! tovl#scratch_buffer#Write()
+ if has_key(b:settings, 'onWrite')
+ call funcref#Call(b:settings['onWrite'])
+ else
+ echo "don't know how to write. Option hasn't been passed"
+ endif
+endfunction
+
+function! tovl#scratch_buffer#GetContents()
+ setlocal modifiable
+ " empty buffer
+ %g!//d
+ call append(0, funcref#Call(b:settings['getContent']))
+ if !b:settings['modifiable']
+ setlocal nomodifiable
+ endif
+ for cmd in get(b:settings,'cmds',[])
+ exec cmd
+ endfor
+endfunction
+
+function! tovl#scratch_buffer#Help()
+ let help = ["use :e! to reload contents, ZZ or :w(q) to write and quit"
+ \ ,""
+ \ ,"Help for this scratch buffer:"
+ \ ,"=======================================================","",""]
+ \ + funcref#Call(get(b:settings, 'help', []))
+ call tovl#scratch_buffer#ScratchBuffer({
+ \ 'name' : "return Help of ".b:settings['name'],
+ \ 'getContent' : help
+ \ })
+endfunction
diff --git a/vim/bundle/vim-addon-mw-utils/autoload/tovl/ui/filter_list.vim b/vim/bundle/vim-addon-mw-utils/autoload/tovl/ui/filter_list.vim
new file mode 100644
index 0000000..74b2ab4
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/autoload/tovl/ui/filter_list.vim
@@ -0,0 +1,473 @@
+" OLD CODE !
+" I should contribute the multiple filter feature to tlib
+
+" filter list displays a list of items
+" you can white / black filter them by regular expressions (similar to the
+" tlib TToC command
+" However you can edit the filters afterwards and select the cols which should
+" be shown
+
+fun! tovl#ui#filter_list#ListTest()
+ call tovl#ui#filter_list#ListView({
+ \ 'aligned' : 1,
+ \ 'Continuation' : funcref#Function('echo string(ARGS[0])'),
+ \ 'items' : [ {"aa" : "a\nAAAAAAAAAAA", 'bb' : "bbbbbbbbbbbbb\nB" },
+ \ {"aa" : "2a\n2AAAAAAAAAAAA", "bb" : "2 bbbbbbbbbbbbb\n2B"},
+ \ {"aa" : "XXX", "bb" : "YY"} ],
+ \ })
+
+endfun
+
+fun! s:Intersection(a, b)
+ return filter(copy(a:a), 'index(a:b, v:val) >= 0')
+endf
+
+fun! tovl#ui#filter_list#ListTestGotoLineCurrentBuf()
+ let nr=1
+ let lines = []
+ for l in getline(0,line('$'))
+ call add(lines, {'nr': nr, 'line' :l})
+ let nr = nr +1
+ endfor
+ call tovl#ui#filter_list#ListView({
+ \ 'aligned' : 0,
+ \ 'keys' : ['nr','line'],
+ \ 'number' : 1,
+ \ 'selectByIdOrFilter' : 1,
+ \ 'Continuation' : funcref#Function('exec ARGS[0]["nr"]'),
+ \ 'items' : lines,
+ \ })
+endfun
+
+" opens a new filtered list
+" keys of opts parameters:
+" Continuation: This function will be called with the selected items
+" items: { key : (string or dict) }
+" items willl be modified. use copy(youritems) as argument to prevent
+" this. An item is either a string or a dict
+" (eg {'file' : .., 'line': ... , 'msg' : .. )
+" keys: list of keys to be shown (optional)
+" filter: list of inital filters which must be applied
+" contains [ { filter: .. , keep : .. }, ] see FilterItems() below
+" aligned: default 0
+" sp_cmd: the command to be used to create the new buffer (default ':e')
+" init : 0 / 1 (default 1): wether to show the view right now
+" number: 0 /1 (default 1): number items ?
+" selectByIdOrFilter: 1: start in getchar() loop so that the user can select
+" the item even faster
+" auto: only do this if all items fit on screen
+" (recommend)
+" cmds: extra cmds to be run
+" cursorAt : at which item to put the cursor?
+"
+" If you don't like the default view you can override UpdateDisplay
+"
+" Usage examples of this list control:
+" - db results
+" - replacement of the quickfix window
+" - select a buffer etc
+fun! tovl#ui#filter_list#ListView(opts)
+ " ActivateAddons theonevimlib
+ let d = {}
+ let d.items = a:opts.items
+ let d.cursorAt = get(a:opts, 'cursorAt', 0)
+ let d.aligned = get(a:opts, 'aligned', 0)
+ let d.sep = ' '
+ let d.filter = get(a:opts, 'filter', [])
+ " using sp because of bd! (FIXME)
+ let d.sp_cmd = get(a:opts, 'sp_cmd', 'sp')
+ let d.allKeys = {}
+ let d.closeOnContinuation = get(a:opts,'closeOnContinuation',1)
+ " don't recommend OnSingleMatch, use OnSingleMatchCR instead
+ let d.continueOnSingleMatch = get(a:opts, 'continueOnSingleMatch',0)
+ let d.continueOnSingleMatchCR = get(a:opts, 'continueOnSingleMatchCR',1)
+ let d.selectByIdOrFilter = get(a:opts, 'selectByIdOrFilter', 0)
+ let d.linesToItems = {}
+ let d.number = get(a:opts, 'number', 1)
+ let d.cmds = get(a:opts, 'cmds', [])
+ let d.syn_cmds = get(a:opts, 'syn_cmds', [])
+
+ if has_key(a:opts,'keys') | let d.keys = a:opts.keys | endif
+ if has_key(a:opts,'Continuation') | let d.Continuation = a:opts.Continuation | endif
+
+ " cache already filtered items in case we want to view really long results
+ " contains [ { filter : { regex: .. , keep : .. } , items : .. , cursorAt :},
+ " { filter : { ... } , items: .. , cursorAt : }
+ let d.cached = []
+ " id of buffer
+ let d.buffer = -1
+ let d.modeText = ''
+
+ fun d.HelpText()
+ return [ "you've entered the the help of the powerful filtered view buffer",
+ \ "",
+ \ "type f to start filtering items by regex",
+ \ "type F to start dropping items by regex",
+ \ "k / K will ask you for the key to apply the filter to first",
+ \ "apply the filter by <cr> and press <cr> again to select item",
+ \ "",
+ \ "use :ShowAppliedFilters to list active filters",
+ \ "use :ToggleAlignment to toggle alignment",
+ \ "",
+ \ "TODO: Implement sorting, implement interface to change keys (displayed columns)"
+ \ ]
+ endfun
+
+ " create new scratch buffer
+ " preprocess items calculating line count and maxwidth for all items
+ fun d.NewBufferAndInit()
+ let self.bufferId = bufnr(bufname('%'))
+ for idx in range(0,len(self.items)-1)
+ if type(self.items[idx]) != 4
+ " no dict yet, make it one
+ let self.items[idx] = {'string_line' : self.items[idx]}
+ endif
+ let new = {}
+ for [k,v] in items(self.items[idx])
+ let lines = split(v,"\n")
+ let self.items[idx][k] = { 'text' : v, 'rows' : len(lines), 'cols' : max(map(copy(lines),'len(v:val)')), 'lines' : lines }
+ let self.allKeys[k] = 1
+ unlet k v
+ endfor
+ endfor
+ call tovl#scratch_buffer#ScratchBuffer({
+ \ 'help' : funcref#Function(self.HelpText,{ 'self' : self }),
+ \ 'sp_cmd' : self.sp_cmd,
+ \ 'cmds' : self.cmds
+ \ })
+ " I assume we have some kind of formatting anyway. Thus breaking lines is bad!
+ set nowrap
+ setlocal cursorline
+ let b:filtered_view = self
+ command! -buffer -nargs=0 ToggleAlignment call b:filtered_view.ToggleAlignment()
+ command! -buffer -nargs=0 ShowAppliedFilters call b:filtered_view.ShowAppliedFilters()
+ command! -buffer -nargs=0 RemoveFilters call b:filtered_view.RemoveFilters()
+ noremap <buffer> f :call b:filtered_view.FilterFromKeyboard(1,'')<cr>
+ " noremap <buffer> f :call b:filtered_view.FilterFromKeyboard(1)<cr>
+ noremap <buffer> F :call b:filtered_view.FilterFromKeyboard(0,'')<cr>
+ if has_key(self,'Continuation')
+ nnoremap <buffer> <cr> :call b:filtered_view.Continue()<cr>
+ endif
+ "noremap <buffer> k
+ "noremap <buffer> K
+
+ let [items, cursorAt] = self.FilteredItems()
+ " len(items) is an approximation because one item can have multiple
+ " lines.. However adding the lines first to check takes too much time
+ if self.selectByIdOrFilter == 1 || (self.selectByIdOrFilter == 'auto' && winheight('%') > len(items) )
+ call self.SelectByIdOrFilter()
+ else
+ " user should choose how to proceed
+ call self.UpdateDisplay()
+ endif
+ endfun
+
+ " user interface
+ fun d.ToggleAlignment()
+ let self.aligned = !self.aligned
+ call self.UpdateDisplay()
+ endfun
+ fun d.ShowAppliedFilters()
+ for i in self.filter | echo string(i) | endfor
+ endfun
+ fun d.RemoveFilters()
+ let self.filter = []
+ call self.UpdateDisplay()
+ endfun
+ fun d.Continue()
+ let item = self.CurrentItem()
+ call self.DoContinue(item)
+ endfun
+ fun d.DoContinue(v)
+ if self.closeOnContinuation | bw! | endif
+ call funcref#Call(self.Continuation,[a:v])
+ endfun
+
+ fun d.MapToOriginal(v)
+ if has_key(a:v, 'string_line')
+ return a:v.string_line.text
+ else
+ let d = {}
+ for [k,v] in items(a:v)
+ let d[k] = v.text
+ unlet k v
+ endfor
+ return d
+ endif
+ endfun
+
+ fun d.CurrentItem()
+ let idx=line('.')-len(self.headerLines)
+ while idx >= 0
+ if has_key(self.linesToItems, idx)
+ return self.MapToOriginal(self.FilteredItems()[0][self.linesToItems[idx]])
+ else
+ let idx = idx -1
+ endif
+ endwhile
+ throw "internal error, couldn't determine selected item!"
+ endfun
+
+ " updates the filter cache and returns the final filtered items
+ fun d.FilteredItems()
+ " update cache
+ let idx = 0
+ let [items, cursorAt] = [self.items, self.cursorAt]
+ for idx in range(0, len(self.filter)-1)
+ if idx +1 > len(self.cached) || self.cached[idx]['filter'] != self.filter[idx]
+ let self.cached = self.cached[:idx-1]
+ let [items, cursorAt] = self.FilterItem(copy(items), self.filter[idx], cursorAt)
+ call add(self.cached, { 'cursorAt' : cursorAt, 'items' : items, 'filter' : self.filter[idx]})
+ else
+ let ci = self.cached[idx]
+ let [items, cursorAt] = [ci['items'], ci['cursorAt']]
+ endif
+ endfor
+ return [items, cursorAt]
+ endfun
+
+ " calling this will return a set of lines which are expected to be the new
+ " buffer contents. The self.linesToItems dict is updated
+ fun d.UpdateDisplay()
+
+ if empty(self.filter)
+ let self.statusline= 'no filter applied, :Help for help'
+ else
+ let self.statusline = len(self.filter).' '.string(self.filter[-1])
+ endif
+
+ let self.linesToItems = {}
+ let [items, cursorAt] = self.FilteredItems()
+ "let num_width = printf('%.0f', trunc(log10(len(items))+1))
+ let num_width = 4
+ if self.aligned
+ " get column width.. (probably will not work with unicde characters.. I
+ " don't have a better solution)
+ let maxlens={}
+ for i in items
+ for [k,v] in items(i)
+ if get(maxlens,k,0) < v.cols
+ let maxlens[k] = v.cols
+ endif
+ endfor
+ endfor
+ endif
+
+ " format lines
+ let self.headerLines = [self.modeText]
+ let lines = copy(self.headerLines)
+ let lines_count = 0
+ if self.number
+ let fmt_startA = '%'.num_width.'s)'
+ let fmt_startB = '%'.num_width.'s'
+ else
+ let fmt_startA = '' | let fmt_startB = ''
+ endif
+ let cursorAtLine = 1 " sane default
+ for idx in range(0,len(items)-1)
+ let self.linesToItems[lines_count + 1] = idx
+ let i = items[idx]
+ let keys = has_key(self,'keys')
+ \ ? s:Intersection(self.keys, keys(i))
+ \ : keys(i)
+ let fmt = ''
+ let args = [i]
+ let cols = []
+ for k in keys
+ let fmt .= self.sep.'%-'.(self.aligned ? maxlens[k] : i[k]['cols']).'s'
+ call add(cols, i[k])
+ endfor
+ for row in range(0, max([1] + map(copy(cols),'v:val["rows"]'))-1)
+ let fmt_args = row == 0 ? [fmt_startA.fmt] : [fmt_startB.fmt]
+ if self.number
+ call add(fmt_args, row == 0 ? idx : '')
+ endif
+ for c in cols
+ call add(fmt_args, c.rows <= row ? '' : c.lines[row])
+ endfor
+ call add(lines, call('printf', fmt_args))
+ let lines_count += 1
+ endfor
+ if idx == cursorAt
+ let cursorAtLine = lines_count
+ endif
+ endfor
+ " update stauts line to show last applied filter
+ " disabled cause it causes trouble on :wincmd w
+ " setlocal statusline=%!b:filtered_view.statusline
+
+ " syntax
+ syn clear
+ for s in self.syn_cmds | exec s | endfor
+ let id = 0
+ " highlight filter regex in buffer as well
+ let syn_ids = [ 'Underlined', 'Todo', 'Error', 'Type', 'Statement' ]
+ for f in self.filter
+ if !f.keep || !has_key(f, 'regex') | continue | endif
+ if f.regex != ''
+ try
+ exec 'syn match '.syn_ids[id % len(syn_ids)].' '.string(f.regex)
+ catch /.*/
+ " ignore errors such as \ without following characters. Thus just
+ " ignore and wait for the next character
+ endtry
+ endif
+ let id = id +1
+ endfor
+ if len(lines) > winheight('%')
+ call extend(lines, self.headerLines)
+ endif
+ normal ggdG
+ call append(0, lines)
+ " place cursor
+ exec (cursorAtLine+1)
+ " move cursor into the middle of the window
+ normal zz
+ endf
+
+ " filter = keys :
+ " filter = string to be executed containing Val
+ " keep = 1 keep on match
+ " = 0 drop on match
+ " key (optional)
+ " cursorAt: at which item to put the cursor
+ " if that item is deleted it will be placed at the item above
+ " optional: key of dict if dict
+ fun d.FilterItem(items, filter, cursorAt)
+ let filter = 'Val =~ '.string(a:filter.regex)
+ let keep = a:filter.keep
+ let cursorAt = a:cursorAt
+
+ for idx in reverse(range(0, len(a:items)-1))
+ let i = a:items[idx]
+ if has_key(a:filter,'key')
+ let key = a:filter.key
+ if has_key(i, key)
+ " key given, only filter by this column
+ let Val = i[key]['text']
+ exec 'let any = '.filter
+ else
+ let any = 0
+ endif
+ else
+ let any = 0
+ " no key given, try all
+ for x in values(i)
+ let Val = x['text']
+ exec 'let any = '.filter
+ if any | break | endif
+ endfor
+ endif
+ if any != keep
+ call remove(a:items, idx)
+ if idx <= cursorAt
+ let cursorAt = cursorAt -1
+ endif
+ endif
+ endfor
+ return [a:items, cursorAt]
+ endfun
+
+ " if the user enters a number select by index else start filtering..
+ fun d.SelectByIdOrFilter()
+ let idx=''
+ let items = self.FilteredItems()[0]
+ try
+ let self.modeText = '[0-9]* : select by index| <esc>: escape getchar() loop, any char: start filtering'
+ call self.UpdateDisplay() | redraw
+ while 1
+ let c=getchar()
+ if index([13,10],c) >= 0
+ return self.DoContinue(self.MapToOriginal(items[idx]))
+ elseif index([27], c) >=0
+ " esc, abort
+ return
+ else
+ if type(c) == 0
+ let c = nr2char(c)
+ endif
+ if c == "\<bs>" || index(map(range(0,10),'v:val.""'),c) >= 0
+ if c == "\<bs>"
+ let idx = idx[:-2]
+ else
+ let idx .= c
+ endif
+ if idx < len(items) && idx.'0' > len(items) || idx == 0 && len(items) < 10
+ " only match
+ return self.DoContinue(self.MapToOriginal(items[idx]))
+ endif
+ else
+ return self.FilterFromKeyboard(1,c)
+ endif
+ endif
+ endwhile
+ finally
+ let self.modeText = ''
+ endtry
+ endfun
+
+ " gets a regular expresion filter by keybaord and updates the display while
+ " you're typing. The regex ist shown in the statusline
+ fun d.FilterFromKeyboard(keep, start, ...)
+ let self.modeText = 'press ESC to exit getchar() loop'
+ call self.UpdateDisplay() | redraw
+
+ try
+ let key_text = a:0 > 0 ? 'key : '.a:1 : ''
+ let filter_bak = self.filter
+ let filter = copy(self.filter)
+ let start = a:start
+ let filter_new = ''
+ while 1
+ if start != ''
+ " use c= last char to force updating display etc
+ let filter_new = start[:-2]
+ let c = start[-1:]
+ let start = ''
+ else
+ let c=getchar()
+ endif
+ if index([13,10],c) >= 0
+ " c-j or return, accept new filter
+ let items = self.FilteredItems()
+ if len(items) == 1 && has_key(self, 'Continuation') && self.continueOnSingleMatchCR
+ call self.DoContinue(self.MapToOriginal(items[0]))
+ endif
+ return
+ elseif index([27], c) >=0
+ " esc, abort
+ let self.filter = filter_bak
+ call self.UpdateDisplay()
+ return
+ else
+ if type(c) == 0
+ let c = nr2char(c)
+ endif
+ if c == "\<bs>"
+ let filter_new = filter_new[:-2]
+ else
+ let filter_new .= c
+ endif
+ let d = {'keep' : a:keep, 'regex' : filter_new }
+ if a:0 > 0
+ let d['key'] = a:1
+ endif
+ let self.filter = copy(filter_bak)
+ call add(self.filter, d)
+ let items = self.FilteredItems()
+ if len(items) == 1 && has_key(self, 'Continuation') && self.continueOnSingleMatch
+ call self.DoContinue(self.MapToOriginal(items[0]))
+ return
+ endif
+ call self.UpdateDisplay() | redraw
+ endif
+ endwhile
+ finally
+ let self.modeText = ''
+ endtry
+ endfun
+
+ if get(a:opts,'init',1)
+ call d.NewBufferAndInit()
+ endif
+endfun
diff --git a/vim/bundle/vim-addon-mw-utils/doc/cached_file_contents.txt b/vim/bundle/vim-addon-mw-utils/doc/cached_file_contents.txt
new file mode 100644
index 0000000..a47a8cf
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/doc/cached_file_contents.txt
@@ -0,0 +1,7 @@
+*cached_file_contents* read contents of a file then cache extracted data
+ Author: Marc Weber, marco-oweber@gmx.de
+
+-----------------------------------------------------------------------
+HOWTO~
+
+ see cached_file_contents#Test()
diff --git a/vim/bundle/vim-addon-mw-utils/doc/funcref.txt b/vim/bundle/vim-addon-mw-utils/doc/funcref.txt
new file mode 100644
index 0000000..cb366d0
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/doc/funcref.txt
@@ -0,0 +1,35 @@
+*funcref* create lazier function references. Pass arguments to create closure
+ like function calls
+ Author: Marc Weber, marco-oweber@gmx.de
+
+-----------------------------------------------------------------------
+HOWTO~
+
+Use *funcref#Function* to create a special dict called
+*faked-function-reference* which can be called by *funcref#Call*
+>
+ { 'faked_function_reference': 'file#FuncName' }
+< passing some arguments and / or self: >
+ { 'faked_function_reference': 'MyFunc', 'args': [1,2], 'self' : { a object ] }
+< You can also create lambda like functions which will be evaled: >
+ { 'faked_function_reference': 'return ARGS[1]' }
+
+REASONS ~
+ Creating a Vim funcref pointing to an autoload function will make Vim source
+ that file. This is not lazy enough. (Seems to be no longer true? Has this changed?)
+
+ A Vim function reference neither allows attaching arguments nor self.
+
+ Don't care about case of variables. Normally when using Vim function
+ references you have to use variable names starting with an upper case letter
+ (E704)
+
+Example: ~
+>
+ let f = funcref#Function('return ARGS[0].ARGS[1].SELF["key"]',{'args':[3], 'self':{'key': 'value'} })
+ echo funcref#Call(f, [2])
+ " prints "32value"
+
+ echo funcref#Call('no value')
+<
+ echo funcref#Call(f, [2])
diff --git a/vim/bundle/vim-addon-mw-utils/doc/tiny_cmd.txt b/vim/bundle/vim-addon-mw-utils/doc/tiny_cmd.txt
new file mode 100644
index 0000000..bc6e002
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/doc/tiny_cmd.txt
@@ -0,0 +1,18 @@
+*tiny-cmd* make long commands short so that they hopefully no longer trigger "press Enter .. [ok]"
+ Author: Marc Weber, marco-oweber@gmx.de
+
+-----------------------------------------------------------------------
+HOWTO~
+
+Problem: >
+ exec 'map <F2> :silent! let g:g="'.repeat('foobar ',200).'"<cr>'
+Now run the mapping by pressing <F2> and you notice what I'm talking about
+
+Solution (Example):
+
+
+Example usage: >
+ let nr = tiny_cmd#Put('let g:g="'.repeat('foobar ',200).'"')
+ exec 'map <F2> :exec tiny_cmd#Get('.nr.')<cr>'
+<
+Use Pop instead of Get if you use this command once only
diff --git a/vim/bundle/vim-addon-mw-utils/vim-addon-mw-utils-addon-info.txt b/vim/bundle/vim-addon-mw-utils/vim-addon-mw-utils-addon-info.txt
new file mode 100644
index 0000000..0b20bb3
--- /dev/null
+++ b/vim/bundle/vim-addon-mw-utils/vim-addon-mw-utils-addon-info.txt
@@ -0,0 +1,9 @@
+{
+ "name" : "vim-addon-mw-utils",
+ "version" : "0.0",
+ "author" : "Marc Weber <marco-oweber@gmx.de>",
+ "maintainer" : "Marc Weber <marco-oweber@gmx.de>",
+ "repository" : {"type": "git", "url": "git://github.com/MarcWeber/vim-addon-manager-known-repositories.git"},
+ "dependencies" : {},
+ "description" : "various utils such as caching interpreted contents of files or advanced glob like things"
+}
diff --git a/vim/bundle/vim-fugitive/.gitignore b/vim/bundle/vim-fugitive/.gitignore
new file mode 100644
index 0000000..0a56e3f
--- /dev/null
+++ b/vim/bundle/vim-fugitive/.gitignore
@@ -0,0 +1 @@
+/doc/tags
diff --git a/vim/bundle/vim-fugitive/CONTRIBUTING.markdown b/vim/bundle/vim-fugitive/CONTRIBUTING.markdown
new file mode 100644
index 0000000..e651dca
--- /dev/null
+++ b/vim/bundle/vim-fugitive/CONTRIBUTING.markdown
@@ -0,0 +1,18 @@
+Before reporting a bug, you should try stripping down your Vim configuration
+and removing other plugins. The sad truth about VimScript is that it is
+fraught with incompatibilities waiting to happen. I'm happy to work around
+them where I can, but it's up to you to isolate the conflict.
+
+Fugitive is particularly prone to regressions due to Git version issues,
+platform issues, and interactions with other plugins. I end up bisecting a
+lot more than other projects, and thus I'm especially meticulous here about
+maintaining a clean, readable, history. Squash and force push any requested
+changes to a pull request. And if your [commit message
+sucks](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
+I'm not going to accept it. Period.
+
+Beyond that, don't be shy about asking before patching. What takes you hours
+might take me minutes simply because I have both domain knowledge and a
+perverse knowledge of VimScript so vast that many would consider it a symptom
+of mental illness. On the flip side, some ideas I'll reject no matter how
+good the implementation is. "Send a patch" is an edge case answer in my book.
diff --git a/vim/bundle/vim-fugitive/README.markdown b/vim/bundle/vim-fugitive/README.markdown
new file mode 100644
index 0000000..71b8bc4
--- /dev/null
+++ b/vim/bundle/vim-fugitive/README.markdown
@@ -0,0 +1,118 @@
+# fugitive.vim
+
+I'm not going to lie to you; fugitive.vim may very well be the best
+Git wrapper of all time. Check out these features:
+
+View any blob, tree, commit, or tag in the repository with `:Gedit` (and
+`:Gsplit`, `:Gvsplit`, `:Gtabedit`, ...). Edit a file in the index and
+write to it to stage the changes. Use `:Gdiff` to bring up the staged
+version of the file side by side with the working tree version and use
+Vim's diff handling capabilities to stage a subset of the file's
+changes.
+
+Bring up the output of `git status` with `:Gstatus`. Press `-` to
+`add`/`reset` a file's changes, or `p` to `add`/`reset` `--patch`. And guess
+what `:Gcommit` does!
+
+`:Gblame` brings up an interactive vertical split with `git blame`
+output. Press enter on a line to edit the commit where the line
+changed, or `o` to open it in a split. When you're done, use `:Gedit`
+in the historic buffer to go back to the work tree version.
+
+`:Gmove` does a `git mv` on a file and simultaneously renames the
+buffer. `:Gremove` does a `git rm` on a file and simultaneously deletes
+the buffer.
+
+Use `:Ggrep` to search the work tree (or any arbitrary commit) with
+`git grep`, skipping over that which is not tracked in the repository.
+`:Glog` loads all previous revisions of a file into the quickfix list so
+you can iterate over them and watch the file evolve!
+
+`:Gread` is a variant of `git checkout -- filename` that operates on the
+buffer rather than the filename. This means you can use `u` to undo it
+and you never get any warnings about the file changing outside Vim.
+`:Gwrite` writes to both the work tree and index versions of a file,
+making it like `git add` when called from a work tree file and like
+`git checkout` when called from the index or a blob in history.
+
+Use `:Gbrowse` to open the current file on GitHub, with optional line
+range (try it in visual mode!). If your current repository isn't on
+GitHub, `git instaweb` will be spun up instead.
+
+Add `%{fugitive#statusline()}` to `'statusline'` to get an indicator
+with the current branch in (surprise!) your statusline.
+
+Last but not least, there's `:Git` for running any arbitrary command,
+and `Git!` to open the output of a command in a temp file.
+
+## Screencasts
+
+* [A complement to command line git](http://vimcasts.org/e/31)
+* [Working with the git index](http://vimcasts.org/e/32)
+* [Resolving merge conflicts with vimdiff](http://vimcasts.org/e/33)
+* [Browsing the git object database](http://vimcasts.org/e/34)
+* [Exploring the history of a git repository](http://vimcasts.org/e/35)
+
+## Installation
+
+If you don't have a preferred installation method, one option is to install
+[pathogen.vim](https://github.com/tpope/vim-pathogen), and then copy
+and paste:
+
+ cd ~/.vim/bundle
+ git clone git://github.com/tpope/vim-fugitive.git
+ vim -u NONE -c "helptags vim-fugitive/doc" -c q
+
+If your Vim version is below 7.2, I recommend also installing
+[vim-git](https://github.com/tpope/vim-git) for syntax highlighting and
+other Git niceties.
+
+## FAQ
+
+> I installed the plugin and started Vim. Why don't any of the commands
+> exist?
+
+Fugitive cares about the current file, not the current working
+directory. Edit a file from the repository.
+
+> I opened a new tab. Why don't any of the commands exist?
+
+Fugitive cares about the current file, not the current working
+directory. Edit a file from the repository.
+
+> Why is `:Gbrowse` not using the right browser?
+
+`:Gbrowse` delegates to `git web--browse`, which is less than perfect
+when it comes to finding the right browser. You can tell it the correct
+browser to use with `git config --global web.browser ...`. On OS X, for
+example, you might want to set this to `open`. See `git web--browse --help`
+for details.
+
+> Here's a patch that automatically opens the quickfix window after
+> `:Ggrep`.
+
+This is a great example of why I recommend asking before patching.
+There are valid arguments to be made both for and against automatically
+opening the quickfix window. Whenever I have to make an arbitrary
+decision like this, I ask what Vim would do. And Vim does not open a
+quickfix window after `:grep`.
+
+Luckily, it's easy to implement the desired behavior without changing
+fugitive.vim. The following autocommand will cause the quickfix window
+to open after any grep invocation:
+
+ autocmd QuickFixCmdPost *grep* cwindow
+
+## Self-Promotion
+
+Like fugitive.vim? Follow the repository on
+[GitHub](https://github.com/tpope/vim-fugitive) and vote for it on
+[vim.org](http://www.vim.org/scripts/script.php?script_id=2975). And if
+you're feeling especially charitable, follow [tpope](http://tpo.pe/) on
+[Twitter](http://twitter.com/tpope) and
+[GitHub](https://github.com/tpope).
+
+## License
+
+Copyright (c) Tim Pope. Distributed under the same terms as Vim itself.
+See `:help license`.
diff --git a/vim/bundle/vim-fugitive/doc/fugitive.txt b/vim/bundle/vim-fugitive/doc/fugitive.txt
new file mode 100644
index 0000000..51fc591
--- /dev/null
+++ b/vim/bundle/vim-fugitive/doc/fugitive.txt
@@ -0,0 +1,357 @@
+*fugitive.txt* A Git wrapper so awesome, it should be illegal
+
+Author: Tim Pope <http://tpo.pe/>
+License: Same terms as Vim itself (see |license|)
+
+This plugin is only available if 'compatible' is not set.
+
+INTRODUCTION *fugitive*
+
+Whenever you edit a file from a Git repository, a set of commands is defined
+that serve as a gateway to Git.
+
+COMMANDS *fugitive-commands*
+
+These commands are local to the buffers in which they work (generally, buffers
+that are part of Git repositories).
+
+ *fugitive-:Git*
+:Git [args] Run an arbitrary git command. Similar to :!git [args]
+ but chdir to the repository tree first.
+
+ *fugitive-:Git!*
+:Git! [args] Like |:Git|, but capture the output into a temp file,
+ and edit that temp file.
+
+ *fugitive-:Gcd*
+:Gcd [directory] |:cd| relative to the repository.
+
+ *fugitive-:Glcd*
+:Glcd [directory] |:lcd| relative to the repository.
+
+ *fugitive-:Gstatus*
+:Gstatus Bring up the output of git-status in the preview
+ window. The following maps, which work on the cursor
+ line file where sensible, are provided:
+
+ g? show this help
+ <C-N> next file
+ <C-P> previous file
+ <CR> |:Gedit|
+ - |:Git| add
+ - |:Git| reset (staged files)
+ cA |:Gcommit| --amend --reuse-message=HEAD
+ ca |:Gcommit| --amend
+ cc |:Gcommit|
+ cva |:Gcommit| --amend --verbose
+ cvc |:Gcommit| --verbose
+ D |:Gdiff|
+ ds |:Gsdiff|
+ dp |:Git!| diff (p for patch; use :Gw to apply)
+ dp |:Git| add --intent-to-add (untracked files)
+ dv |:Gvdiff|
+ O |:Gtabedit|
+ o |:Gsplit|
+ p |:Git| add --patch
+ p |:Git| reset --patch (staged files)
+ q close status
+ r reload status
+ S |:Gvsplit|
+ U |:Git| checkout
+ U |:Git| checkout HEAD (staged files)
+ U |:Git| clean (untracked files)
+ U |:Git| rm (unmerged files)
+
+ *fugitive-:Gcommit*
+:Gcommit [args] A wrapper around git-commit. If there is nothing
+ to commit, |:Gstatus| is called instead. Unless the
+ arguments given would skip the invocation of an editor
+ (e.g., -m), a split window will be used to obtain a
+ commit message, or a new tab if -v is given. Write
+ and close that window (:wq or |:Gwrite|) to finish the
+ commit. Unlike when running the actual git-commit
+ command, it is possible (but unadvisable) to alter the
+ index with commands like git-add and git-reset while a
+ commit message is pending.
+
+ *fugitive-:Gmerge*
+:Gmerge [args] Calls git-merge and loads errors and conflicted files
+ into the quickfix list. Opens a |:Gcommit| style
+ split window for the commit message if the merge
+ succeeds. If called during a merge conflict, the
+ conflicted files from the current index are loaded
+ into the quickfix list.
+
+ *fugitive-:Gpull*
+:Gpull [args] Like |:Gmerge|, but for git-pull.
+
+ *fugitive-:Gpush*
+:Gpush [args] Invoke git-push, load the results into the quickfix
+ list, and invoke |:cwindow| to reveal any errors.
+ |:Dispatch| is used if available for asynchronous
+ invocation.
+
+ *fugitive-:Gfetch*
+:Gfetch [args] Like |:Gpush|, but for git-fetch.
+
+ *fugitive-:Ggrep*
+:Ggrep[!] [args] |:grep|[!] with git-grep as 'grepprg'.
+
+ *fugitive-:Glgrep*
+:Glgrep[!] [args] |:lgrep|[!] with git-grep as 'grepprg'.
+
+ *fugitive-:Glog*
+:Glog [args] Load all previous revisions of the current file into
+ the quickfix list. Additional git-log arguments can
+ be given (for example, --reverse). If "--" appears as
+ an argument, no file specific filtering is done, and
+ previous commits rather than previous file revisions
+ are loaded.
+
+:{range}Glog [args] Use git-log -L to load previous revisions of the given
+ range of the current file into the quickfix list. The
+ cursor is positioned on the first line of the first
+ diff hunk for each commit.
+
+ *fugitive-:Gllog*
+:Gllog [args] Like |:Glog|, but use the location list instead of the
+ quickfix list.
+
+ *fugitive-:Gedit* *fugitive-:Ge*
+:Gedit [revision] |:edit| a |fugitive-revision|.
+
+ *fugitive-:Gsplit*
+:Gsplit [revision] |:split| a |fugitive-revision|.
+
+ *fugitive-:Gvsplit*
+:Gvsplit [revision] |:vsplit| a |fugitive-revision|.
+
+ *fugitive-:Gtabedit*
+:Gtabedit [revision] |:tabedit| a |fugitive-revision|.
+
+ *fugitive-:Gpedit*
+:Gpedit [revision] |:pedit| a |fugitive-revision|.
+
+:Gsplit! [args] *fugitive-:Gsplit!* *fugitive-:Gvsplit!*
+:Gvsplit! [args] *fugitive-:Gtabedit!* *fugitive-:Gpedit!*
+:Gtabedit! [args] Like |:Git!|, but open the resulting temp file in a
+:Gpedit! [args] split, tab, or preview window.
+
+ *fugitive-:Gread*
+:Gread [revision] Empty the buffer and |:read| a |fugitive-revision|.
+ When the argument is omitted, this is similar to
+ git-checkout on a work tree file or git-add on a stage
+ file, but without writing anything to disk.
+
+:{range}Gread [revision]
+ |:read| in a |fugitive-revision| after {range}.
+
+ *fugitive-:Gread!*
+:Gread! [args] Empty the buffer and |:read| the output of a Git
+ command. For example, :Gread! show HEAD:%.
+
+:{range}Gread! [args] |:read| the output of a Git command after {range}.
+
+ *fugitive-:Gw* *fugitive-:Gwrite*
+:Gwrite Write to the current file's path and stage the results.
+ When run in a work tree file, it is effectively git
+ add. Elsewhere, it is effectively git-checkout. A
+ great deal of effort is expended to behave sensibly
+ when the work tree or index version of the file is
+ open in another buffer.
+
+:Gwrite {path} You can give |:Gwrite| an explicit path of where in
+ the work tree to write. You can also give a path like
+ :0:foo.txt or even :0 to write to just that stage in
+ the index.
+
+ *fugitive-:Gwq*
+:Gwq [path] Like |:Gwrite| followed by |:quit| if the write
+ succeeded.
+
+:Gwq! [path] Like |:Gwrite|! followed by |:quit|! if the write
+ succeeded.
+
+ *fugitive-:Gdiff*
+:Gdiff [revision] Perform a |vimdiff| against the current file in the
+ given revision. With no argument, the version in the
+ index is used (which means a three-way diff during a
+ merge conflict, making it a git-mergetool
+ alternative). The newer of the two files is placed
+ to the right or bottom, depending on 'diffopt' and
+ the width of the window relative to 'textwidth'. Use
+ |do| and |dp| and write to the index file to simulate
+ "git add --patch".
+
+ *fugitive-:Gsdiff*
+:Gsdiff [revision] Like |:Gdiff|, but always split horizontally.
+
+ *fugitive-:Gvdiff*
+:Gvdiff [revision] Like |:Gdiff|, but always split vertically.
+
+ *fugitive-:Gmove*
+:Gmove {destination} Wrapper around git-mv that renames the buffer
+ afterward. The destination is relative to the current
+ directory except when started with a /, in which case
+ it is relative to the work tree. Add a ! to pass -f.
+
+ *fugitive-:Gremove*
+:Gremove Wrapper around git-rm that deletes the buffer
+ afterward. When invoked in an index file, --cached is
+ passed. Add a ! to pass -f and forcefully discard the
+ buffer.
+
+ *fugitive-:Gblame*
+:Gblame [flags] Run git-blame on the file and open the results in a
+ scroll bound vertical split. You can give any of
+ ltfnsewMC as flags and they will be passed along to
+ git-blame. The following maps, which work on the
+ cursor line commit where sensible, are provided:
+
+ g? show this help
+ A resize to end of author column
+ C resize to end of commit column
+ D resize to end of date/time column
+ q close blame and return to blamed window
+ gq q, then |:Gedit| to return to work tree version
+ <CR> q, then open commit
+ o open commit in horizontal split
+ O open commit in new tab
+ - reblame at commit
+ ~ reblame at [count]th first grandparent
+ P reblame at [count]th parent (like HEAD^[count])
+
+:[range]Gblame [flags] Run git-blame on the given range.
+
+ *fugitive-:Gbrowse*
+:Gbrowse Open the current file, blob, tree, commit, or tag
+ in your browser at the upstream hosting provider.
+ If a range is given, it is appropriately appended to
+ the URL as an anchor.
+
+ Upstream providers can be added by installing an
+ appropriate Vim plugin. For example, GitHub can be
+ supported by installing rhubarb.vim, available at
+ <https://github.com/tpope/vim-rhubarb>. (Native
+ support for GitHub is currently included, but that is
+ slated to be removed.)
+
+ The hosting provider is determined by looking at the
+ remote for the current or specified branch and falls
+ back to "origin". In the special case of a "."
+ remote, a local instance of git-instaweb will be
+ started and used.
+
+:Gbrowse {revision} Like :Gbrowse, but for a given |fugitive-revision|. A
+ useful value here is -, which ties the URL to the
+ latest commit rather than a volatile branch.
+
+:Gbrowse [...]@{remote} Force using the given remote rather than the remote
+ for the current branch. The remote is used to
+ determine which GitHub repository to link to.
+
+:{range}Gbrowse [args] Appends an anchor to the URL that emphasizes the
+ selected lines. You almost certainly want to give a
+ "-" argument in this case to force the URL to include
+ an exact revision.
+
+:[range]Gbrowse! [args] Like :Gbrowse, but put the URL on the clipboard rather
+ than opening it.
+
+MAPPINGS *fugitive-mappings*
+
+These maps are available everywhere.
+
+ *fugitive-c_CTRL-R_CTRL-G*
+<C-R><C-G> On the command line, recall the path to the current
+ object (that is, a representation of the object
+ recognized by |:Gedit|).
+
+ *fugitive-y_CTRL-G*
+["x]y<C-G> Yank the commit SHA and path to the current object.
+
+These maps are available in Git objects.
+
+ *fugitive-<CR>*
+<CR> Jump to the revision under the cursor.
+
+ *fugitive-o*
+o Jump to the revision under the cursor in a new split.
+
+ *fugitive-S*
+S Jump to the revision under the cursor in a new
+ vertical split.
+
+ *fugitive-O*
+O Jump to the revision under the cursor in a new tab.
+
+ *fugitive--*
+- Go to the tree containing the current tree or blob.
+
+ *fugitive-~*
+~ Go to the current file in the [count]th first
+ ancestor.
+
+ *fugitive-P*
+P Go to the current file in the [count]th parent.
+
+ *fugitive-C*
+C Go to the commit containing the current file.
+
+ *fugitive-.*
+. Start a |:| command line with the current revision
+ prepopulated at the end of the line.
+
+ *fugitive-a*
+a Show the current tag, commit, or tree in an alternate
+ format.
+
+SPECIFYING REVISIONS *fugitive-revision*
+
+Fugitive revisions are similar to Git revisions as defined in the "SPECIFYING
+REVISIONS" section in the git-rev-parse man page. For commands that accept an
+optional revision, the default is the file in the index for work tree files
+and the work tree file for everything else. Example revisions follow.
+
+Revision Meaning ~
+HEAD .git/HEAD
+master .git/refs/heads/master
+HEAD^{} The commit referenced by HEAD
+HEAD^ The parent of the commit referenced by HEAD
+HEAD: The tree referenced by HEAD
+/HEAD The file named HEAD in the work tree
+Makefile The file named Makefile in the work tree
+HEAD^:Makefile The file named Makefile in the parent of HEAD
+:Makefile The file named Makefile in the index (writable)
+- The current file in HEAD
+^ The current file in the previous commit
+~3 The current file 3 commits ago
+: .git/index (Same as |:Gstatus|)
+:0 The current file in the index
+:1 The current file's common ancestor during a conflict
+:2 The current file in the target branch during a conflict
+:3 The current file in the merged branch during a conflict
+:/foo The most recent commit with "foo" in the message
+
+STATUSLINE *fugitive-statusline*
+
+ *fugitive#statusline()*
+Add %{fugitive#statusline()} to your statusline to get an indicator including
+the current branch and the currently edited file's commit. If you don't have
+a statusline, this one matches the default when 'ruler' is set:
+>
+ set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
+<
+ *fugitive#head(...)*
+Use fugitive#head() to return the name of the current branch. If the current
+HEAD is detached, fugitive#head() will return the empty string, unless the
+optional argument is given, in which case the hash of the current commit will
+be truncated to the given number of characters.
+
+ABOUT *fugitive-about*
+
+Grab the latest version or report a bug on GitHub:
+
+http://github.com/tpope/vim-fugitive
+
+ vim:tw=78:et:ft=help:norl:
diff --git a/vim/bundle/vim-fugitive/plugin/fugitive.vim b/vim/bundle/vim-fugitive/plugin/fugitive.vim
new file mode 100644
index 0000000..90f123f
--- /dev/null
+++ b/vim/bundle/vim-fugitive/plugin/fugitive.vim
@@ -0,0 +1,3096 @@
+" fugitive.vim - A Git wrapper so awesome, it should be illegal
+" Maintainer: Tim Pope <http://tpo.pe/>
+" Version: 2.2
+" GetLatestVimScripts: 2975 1 :AutoInstall: fugitive.vim
+
+if exists('g:loaded_fugitive') || &cp
+ finish
+endif
+let g:loaded_fugitive = 1
+
+if !exists('g:fugitive_git_executable')
+ let g:fugitive_git_executable = 'git'
+endif
+
+" Section: Utility
+
+function! s:function(name) abort
+ return function(substitute(a:name,'^s:',matchstr(expand('<sfile>'), '<SNR>\d\+_'),''))
+endfunction
+
+function! s:sub(str,pat,rep) abort
+ return substitute(a:str,'\v\C'.a:pat,a:rep,'')
+endfunction
+
+function! s:gsub(str,pat,rep) abort
+ return substitute(a:str,'\v\C'.a:pat,a:rep,'g')
+endfunction
+
+function! s:winshell() abort
+ return &shell =~? 'cmd' || exists('+shellslash') && !&shellslash
+endfunction
+
+function! s:shellesc(arg) abort
+ if a:arg =~ '^[A-Za-z0-9_/.-]\+$'
+ return a:arg
+ elseif s:winshell()
+ return '"'.s:gsub(s:gsub(a:arg, '"', '""'), '\%', '"%"').'"'
+ else
+ return shellescape(a:arg)
+ endif
+endfunction
+
+function! s:fnameescape(file) abort
+ if exists('*fnameescape')
+ return fnameescape(a:file)
+ else
+ return escape(a:file," \t\n*?[{`$\\%#'\"|!<")
+ endif
+endfunction
+
+function! s:throw(string) abort
+ let v:errmsg = 'fugitive: '.a:string
+ throw v:errmsg
+endfunction
+
+function! s:warn(str) abort
+ echohl WarningMsg
+ echomsg a:str
+ echohl None
+ let v:warningmsg = a:str
+endfunction
+
+function! s:shellslash(path) abort
+ if s:winshell()
+ return s:gsub(a:path,'\\','/')
+ else
+ return a:path
+ endif
+endfunction
+
+let s:git_versions = {}
+
+function! fugitive#git_version(...) abort
+ if !has_key(s:git_versions, g:fugitive_git_executable)
+ let s:git_versions[g:fugitive_git_executable] = matchstr(system(g:fugitive_git_executable.' --version'), "\\S\\+\n")
+ endif
+ return s:git_versions[g:fugitive_git_executable]
+endfunction
+
+function! s:recall() abort
+ let rev = s:sub(s:buffer().rev(), '^/', '')
+ if rev ==# ':'
+ return matchstr(getline('.'),'^#\t\%([[:alpha:] ]\+: *\)\=\zs.\{-\}\ze\%( ([^()[:digit:]]\+)\)\=$\|^\d\{6} \x\{40\} \d\t\zs.*')
+ elseif s:buffer().type('tree')
+ let file = matchstr(getline('.'), '\t\zs.*')
+ if empty(file) && line('.') > 2
+ let file = s:sub(getline('.'), '/$', '')
+ endif
+ if !empty(file) && rev !~# ':$'
+ return rev . '/' . file
+ else
+ return rev . file
+ endif
+ endif
+ return rev
+endfunction
+
+function! s:add_methods(namespace, method_names) abort
+ for name in a:method_names
+ let s:{a:namespace}_prototype[name] = s:function('s:'.a:namespace.'_'.name)
+ endfor
+endfunction
+
+let s:commands = []
+function! s:command(definition) abort
+ let s:commands += [a:definition]
+endfunction
+
+function! s:define_commands() abort
+ for command in s:commands
+ exe 'command! -buffer '.command
+ endfor
+endfunction
+
+let s:abstract_prototype = {}
+
+" Section: Initialization
+
+function! fugitive#is_git_dir(path) abort
+ let path = s:sub(a:path, '[\/]$', '') . '/'
+ return getfsize(path.'HEAD') > 10 && (
+ \ isdirectory(path.'objects') && isdirectory(path.'refs') ||
+ \ getftype(path.'commondir') ==# 'file')
+endfunction
+
+function! fugitive#extract_git_dir(path) abort
+ if s:shellslash(a:path) =~# '^fugitive://.*//'
+ return matchstr(s:shellslash(a:path), '\C^fugitive://\zs.\{-\}\ze//')
+ endif
+ let root = s:shellslash(simplify(fnamemodify(a:path, ':p:s?[\/]$??')))
+ let previous = ""
+ while root !=# previous
+ if root =~# '\v^//%([^/]+/?)?$'
+ " This is for accessing network shares from Cygwin Vim. There won't be
+ " any git directory called //.git or //serverName/.git so let's avoid
+ " checking for them since such checks are extremely slow.
+ break
+ endif
+ if index(split($GIT_CEILING_DIRECTORIES, ':'), root) >= 0
+ break
+ endif
+ if root ==# $GIT_WORK_TREE && fugitive#is_git_dir($GIT_DIR)
+ return simplify(fnamemodify(expand($GIT_DIR), ':p:s?[\/]$??'))
+ endif
+ if fugitive#is_git_dir($GIT_DIR)
+ " Ensure that we've cached the worktree
+ call s:configured_tree(simplify(fnamemodify(expand($GIT_DIR), ':p:s?[\/]$??')))
+ if has_key(s:dir_for_worktree, root)
+ return s:dir_for_worktree[root]
+ endif
+ endif
+ let dir = s:sub(root, '[\/]$', '') . '/.git'
+ let type = getftype(dir)
+ if type ==# 'dir' && fugitive#is_git_dir(dir)
+ return dir
+ elseif type ==# 'link' && fugitive#is_git_dir(dir)
+ return resolve(dir)
+ elseif type !=# '' && filereadable(dir)
+ let line = get(readfile(dir, '', 1), 0, '')
+ if line =~# '^gitdir: \.' && fugitive#is_git_dir(root.'/'.line[8:-1])
+ return simplify(root.'/'.line[8:-1])
+ elseif line =~# '^gitdir: ' && fugitive#is_git_dir(line[8:-1])
+ return line[8:-1]
+ endif
+ elseif fugitive#is_git_dir(root)
+ return root
+ endif
+ let previous = root
+ let root = fnamemodify(root, ':h')
+ endwhile
+ return ''
+endfunction
+
+function! fugitive#detect(path) abort
+ if exists('b:git_dir') && (b:git_dir ==# '' || b:git_dir =~# '/$')
+ unlet b:git_dir
+ endif
+ if !exists('b:git_dir')
+ let dir = fugitive#extract_git_dir(a:path)
+ if dir !=# ''
+ let b:git_dir = dir
+ endif
+ endif
+ if exists('b:git_dir')
+ if exists('#User#FugitiveBoot')
+ try
+ let [save_mls, &modelines] = [&mls, 0]
+ doautocmd User FugitiveBoot
+ finally
+ let &mls = save_mls
+ endtry
+ endif
+ if !exists('g:fugitive_no_maps')
+ cnoremap <buffer> <expr> <C-R><C-G> fnameescape(<SID>recall())
+ nnoremap <buffer> <silent> y<C-G> :call setreg(v:register, <SID>recall())<CR>
+ endif
+ let buffer = fugitive#buffer()
+ if expand('%:p') =~# '//'
+ call buffer.setvar('&path', s:sub(buffer.getvar('&path'), '^\.%(,|$)', ''))
+ endif
+ if stridx(buffer.getvar('&tags'), escape(b:git_dir, ', ')) == -1
+ if filereadable(b:git_dir.'/tags')
+ call buffer.setvar('&tags', escape(b:git_dir.'/tags', ', ').','.buffer.getvar('&tags'))
+ endif
+ if &filetype !=# '' && filereadable(b:git_dir.'/'.&filetype.'.tags')
+ call buffer.setvar('&tags', escape(b:git_dir.'/'.&filetype.'.tags', ', ').','.buffer.getvar('&tags'))
+ endif
+ endif
+ try
+ let [save_mls, &modelines] = [&mls, 0]
+ call s:define_commands()
+ doautocmd User Fugitive
+ finally
+ let &mls = save_mls
+ endtry
+ endif
+endfunction
+
+augroup fugitive
+ autocmd!
+ autocmd BufNewFile,BufReadPost * call fugitive#detect(expand('%:p'))
+ autocmd FileType netrw call fugitive#detect(expand('%:p'))
+ autocmd User NERDTreeInit,NERDTreeNewRoot call fugitive#detect(b:NERDTreeRoot.path.str())
+ autocmd VimEnter * if expand('<amatch>')==''|call fugitive#detect(getcwd())|endif
+ autocmd CmdWinEnter * call fugitive#detect(expand('#:p'))
+ autocmd BufWinLeave * execute getwinvar(+bufwinnr(+expand('<abuf>')), 'fugitive_leave')
+augroup END
+
+" Section: Repository
+
+let s:repo_prototype = {}
+let s:repos = {}
+let s:worktree_for_dir = {}
+let s:dir_for_worktree = {}
+
+function! s:repo(...) abort
+ let dir = a:0 ? a:1 : (exists('b:git_dir') && b:git_dir !=# '' ? b:git_dir : fugitive#extract_git_dir(expand('%:p')))
+ if dir !=# ''
+ if has_key(s:repos, dir)
+ let repo = get(s:repos, dir)
+ else
+ let repo = {'git_dir': dir}
+ let s:repos[dir] = repo
+ endif
+ return extend(extend(repo, s:repo_prototype, 'keep'), s:abstract_prototype, 'keep')
+ endif
+ call s:throw('not a git repository: '.expand('%:p'))
+endfunction
+
+function! fugitive#repo(...) abort
+ return call('s:repo', a:000)
+endfunction
+
+function! s:repo_dir(...) dict abort
+ return join([self.git_dir]+a:000,'/')
+endfunction
+
+function! s:configured_tree(git_dir) abort
+ if !has_key(s:worktree_for_dir, a:git_dir)
+ let s:worktree_for_dir[a:git_dir] = ''
+ let config_file = a:git_dir . '/config'
+ if filereadable(config_file)
+ let config = readfile(config_file,'',10)
+ call filter(config,'v:val =~# "^\\s*worktree *="')
+ if len(config) == 1
+ let worktree = matchstr(config[0], '= *\zs.*')
+ endif
+ elseif filereadable(a:git_dir . '/gitdir')
+ let worktree = fnamemodify(readfile(a:git_dir . '/gitdir')[0], ':h')
+ if worktree ==# '.'
+ unlet! worktree
+ endif
+ endif
+ if exists('worktree')
+ let s:worktree_for_dir[a:git_dir] = worktree
+ let s:dir_for_worktree[s:worktree_for_dir[a:git_dir]] = a:git_dir
+ endif
+ endif
+ if s:worktree_for_dir[a:git_dir] =~# '^\.'
+ return simplify(a:git_dir . '/' . s:worktree_for_dir[a:git_dir])
+ else
+ return s:worktree_for_dir[a:git_dir]
+ endif
+endfunction
+
+function! s:repo_tree(...) dict abort
+ if self.dir() =~# '/\.git$'
+ let dir = self.dir()[0:-6]
+ else
+ let dir = s:configured_tree(self.git_dir)
+ endif
+ if dir ==# ''
+ call s:throw('no work tree')
+ else
+ return join([dir]+a:000,'/')
+ endif
+endfunction
+
+function! s:repo_bare() dict abort
+ if self.dir() =~# '/\.git$'
+ return 0
+ else
+ return s:configured_tree(self.git_dir) ==# ''
+ endif
+endfunction
+
+function! s:repo_translate(spec) dict abort
+ let refs = self.dir('refs/')
+ if filereadable(self.dir('commondir'))
+ let refs = simplify(self.dir(get(readfile(self.dir('commondir'), 1), 0, ''))) . '/refs/'
+ endif
+ if a:spec ==# '.' || a:spec ==# '/.'
+ return self.bare() ? self.dir() : self.tree()
+ elseif a:spec =~# '^/\=\.git$' && self.bare()
+ return self.dir()
+ elseif a:spec =~# '^/\=\.git/'
+ return self.dir(s:sub(a:spec, '^/=\.git/', ''))
+ elseif a:spec =~# '^/'
+ return self.tree().a:spec
+ elseif a:spec =~# '^:[0-3]:'
+ return 'fugitive://'.self.dir().'//'.a:spec[1].'/'.a:spec[3:-1]
+ elseif a:spec ==# ':'
+ if $GIT_INDEX_FILE =~# '/[^/]*index[^/]*\.lock$' && fnamemodify($GIT_INDEX_FILE,':p')[0:strlen(self.dir())] ==# self.dir('') && filereadable($GIT_INDEX_FILE)
+ return fnamemodify($GIT_INDEX_FILE,':p')
+ else
+ return self.dir('index')
+ endif
+ elseif a:spec =~# '^:/'
+ let ref = self.rev_parse(matchstr(a:spec,'.[^:]*'))
+ return 'fugitive://'.self.dir().'//'.ref
+ elseif a:spec =~# '^:'
+ return 'fugitive://'.self.dir().'//0/'.a:spec[1:-1]
+ elseif a:spec ==# '@'
+ return self.dir('HEAD')
+ elseif a:spec =~# 'HEAD\|^refs/' && a:spec !~ ':' && filereadable(refs . '../' . a:spec)
+ return simplify(refs . '../' . a:spec)
+ elseif filereadable(refs.a:spec)
+ return refs.a:spec
+ elseif filereadable(refs.'tags/'.a:spec)
+ return refs.'tags/'.a:spec
+ elseif filereadable(refs.'heads/'.a:spec)
+ return refs.'heads/'.a:spec
+ elseif filereadable(refs.'remotes/'.a:spec)
+ return refs.'remotes/'.a:spec
+ elseif filereadable(refs.'remotes/'.a:spec.'/HEAD')
+ return refs.'remotes/'.a:spec.'/HEAD'
+ else
+ try
+ let ref = self.rev_parse(matchstr(a:spec,'[^:]*'))
+ let path = s:sub(matchstr(a:spec,':.*'),'^:','/')
+ return 'fugitive://'.self.dir().'//'.ref.path
+ catch /^fugitive:/
+ return self.tree(a:spec)
+ endtry
+ endif
+endfunction
+
+function! s:repo_head(...) dict abort
+ let head = s:repo().head_ref()
+
+ if head =~# '^ref: '
+ let branch = s:sub(head,'^ref: %(refs/%(heads/|remotes/|tags/)=)=','')
+ elseif head =~# '^\x\{40\}$'
+ " truncate hash to a:1 characters if we're in detached head mode
+ let len = a:0 ? a:1 : 0
+ let branch = len ? head[0:len-1] : ''
+ else
+ return ''
+ endif
+
+ return branch
+endfunction
+
+call s:add_methods('repo',['dir','tree','bare','translate','head'])
+
+function! s:repo_git_command(...) dict abort
+ let git = g:fugitive_git_executable . ' --git-dir='.s:shellesc(self.git_dir)
+ return git.join(map(copy(a:000),'" ".s:shellesc(v:val)'),'')
+endfunction
+
+function! s:repo_git_chomp(...) dict abort
+ return s:sub(system(call(self.git_command,a:000,self)),'\n$','')
+endfunction
+
+function! s:repo_git_chomp_in_tree(...) dict abort
+ let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+ let dir = getcwd()
+ try
+ execute cd.'`=s:repo().tree()`'
+ return call(s:repo().git_chomp, a:000, s:repo())
+ finally
+ execute cd.'`=dir`'
+ endtry
+endfunction
+
+function! s:repo_rev_parse(rev) dict abort
+ let hash = self.git_chomp('rev-parse','--verify',a:rev)
+ if hash =~ '\<\x\{40\}$'
+ return matchstr(hash,'\<\x\{40\}$')
+ endif
+ call s:throw('rev-parse '.a:rev.': '.hash)
+endfunction
+
+call s:add_methods('repo',['git_command','git_chomp','git_chomp_in_tree','rev_parse'])
+
+function! s:repo_dirglob(base) dict abort
+ let base = s:sub(a:base,'^/','')
+ let matches = split(glob(self.tree(s:gsub(base,'/','*&').'*/')),"\n")
+ call map(matches,'v:val[ strlen(self.tree())+(a:base !~ "^/") : -1 ]')
+ return matches
+endfunction
+
+function! s:repo_superglob(base) dict abort
+ if a:base =~# '^/' || a:base !~# ':'
+ let results = []
+ if a:base !~# '^/'
+ let heads = ["HEAD","ORIG_HEAD","FETCH_HEAD","MERGE_HEAD"]
+ let heads += sort(split(s:repo().git_chomp("rev-parse","--symbolic","--branches","--tags","--remotes"),"\n"))
+ " Add any stashes.
+ if filereadable(s:repo().dir('refs/stash'))
+ let heads += ["stash"]
+ let heads += sort(split(s:repo().git_chomp("stash","list","--pretty=format:%gd"),"\n"))
+ endif
+ call filter(heads,'v:val[ 0 : strlen(a:base)-1 ] ==# a:base')
+ let results += heads
+ endif
+ if !self.bare()
+ let base = s:sub(a:base,'^/','')
+ let matches = split(glob(self.tree(s:gsub(base,'/','*&').'*')),"\n")
+ call map(matches,'s:shellslash(v:val)')
+ call map(matches,'v:val !~ "/$" && isdirectory(v:val) ? v:val."/" : v:val')
+ call map(matches,'v:val[ strlen(self.tree())+(a:base !~ "^/") : -1 ]')
+ let results += matches
+ endif
+ return results
+
+ elseif a:base =~# '^:'
+ let entries = split(self.git_chomp('ls-files','--stage'),"\n")
+ call map(entries,'s:sub(v:val,".*(\\d)\\t(.*)",":\\1:\\2")')
+ if a:base !~# '^:[0-3]\%(:\|$\)'
+ call filter(entries,'v:val[1] == "0"')
+ call map(entries,'v:val[2:-1]')
+ endif
+ call filter(entries,'v:val[ 0 : strlen(a:base)-1 ] ==# a:base')
+ return entries
+
+ else
+ let tree = matchstr(a:base,'.*[:/]')
+ let entries = split(self.git_chomp('ls-tree',tree),"\n")
+ call map(entries,'s:sub(v:val,"^04.*\\zs$","/")')
+ call map(entries,'tree.s:sub(v:val,".*\t","")')
+ return filter(entries,'v:val[ 0 : strlen(a:base)-1 ] ==# a:base')
+ endif
+endfunction
+
+call s:add_methods('repo',['dirglob','superglob'])
+
+function! s:repo_config(conf) dict abort
+ return matchstr(system(s:repo().git_command('config').' '.a:conf),"[^\r\n]*")
+endfun
+
+function! s:repo_user() dict abort
+ let username = s:repo().config('user.name')
+ let useremail = s:repo().config('user.email')
+ return username.' <'.useremail.'>'
+endfun
+
+function! s:repo_aliases() dict abort
+ if !has_key(self,'_aliases')
+ let self._aliases = {}
+ for line in split(self.git_chomp('config','--get-regexp','^alias[.]'),"\n")
+ let self._aliases[matchstr(line,'\.\zs\S\+')] = matchstr(line,' \zs.*')
+ endfor
+ endif
+ return self._aliases
+endfunction
+
+call s:add_methods('repo',['config', 'user', 'aliases'])
+
+function! s:repo_keywordprg() dict abort
+ let args = ' --git-dir='.escape(self.dir(),"\\\"' ")
+ if has('gui_running') && !has('win32')
+ return g:fugitive_git_executable . ' --no-pager' . args . ' log -1'
+ else
+ return g:fugitive_git_executable . args . ' show'
+ endif
+endfunction
+
+call s:add_methods('repo',['keywordprg'])
+
+" Section: Buffer
+
+let s:buffer_prototype = {}
+
+function! s:buffer(...) abort
+ let buffer = {'#': bufnr(a:0 ? a:1 : '%')}
+ call extend(extend(buffer,s:buffer_prototype,'keep'),s:abstract_prototype,'keep')
+ if buffer.getvar('git_dir') !=# ''
+ return buffer
+ endif
+ call s:throw('not a git repository: '.expand('%:p'))
+endfunction
+
+function! fugitive#buffer(...) abort
+ return s:buffer(a:0 ? a:1 : '%')
+endfunction
+
+function! s:buffer_getvar(var) dict abort
+ return getbufvar(self['#'],a:var)
+endfunction
+
+function! s:buffer_setvar(var,value) dict abort
+ return setbufvar(self['#'],a:var,a:value)
+endfunction
+
+function! s:buffer_getline(lnum) dict abort
+ return get(getbufline(self['#'], a:lnum), 0, '')
+endfunction
+
+function! s:buffer_repo() dict abort
+ return s:repo(self.getvar('git_dir'))
+endfunction
+
+function! s:buffer_type(...) dict abort
+ if self.getvar('fugitive_type') != ''
+ let type = self.getvar('fugitive_type')
+ elseif fnamemodify(self.spec(),':p') =~# '.\git/refs/\|\.git/\w*HEAD$'
+ let type = 'head'
+ elseif self.getline(1) =~ '^tree \x\{40\}$' && self.getline(2) == ''
+ let type = 'tree'
+ elseif self.getline(1) =~ '^\d\{6\} \w\{4\} \x\{40\}\>\t'
+ let type = 'tree'
+ elseif self.getline(1) =~ '^\d\{6\} \x\{40\}\> \d\t'
+ let type = 'index'
+ elseif isdirectory(self.spec())
+ let type = 'directory'
+ elseif self.spec() == ''
+ let type = 'null'
+ else
+ let type = 'file'
+ endif
+ if a:0
+ return !empty(filter(copy(a:000),'v:val ==# type'))
+ else
+ return type
+ endif
+endfunction
+
+if has('win32')
+
+ function! s:buffer_spec() dict abort
+ let bufname = bufname(self['#'])
+ let retval = ''
+ for i in split(bufname,'[^:]\zs\\')
+ let retval = fnamemodify((retval==''?'':retval.'\').i,':.')
+ endfor
+ return s:shellslash(fnamemodify(retval,':p'))
+ endfunction
+
+else
+
+ function! s:buffer_spec() dict abort
+ let bufname = bufname(self['#'])
+ return s:shellslash(bufname == '' ? '' : fnamemodify(bufname,':p'))
+ endfunction
+
+endif
+
+function! s:buffer_name() dict abort
+ return self.spec()
+endfunction
+
+function! s:buffer_commit() dict abort
+ return matchstr(self.spec(),'^fugitive://.\{-\}//\zs\w*')
+endfunction
+
+function! s:cpath(path) abort
+ if exists('+fileignorecase') && &fileignorecase
+ return tolower(a:path)
+ else
+ return a:path
+ endif
+endfunction
+
+function! s:buffer_path(...) dict abort
+ let rev = matchstr(self.spec(),'^fugitive://.\{-\}//\zs.*')
+ if rev != ''
+ let rev = s:sub(rev,'\w*','')
+ elseif s:cpath(self.spec()[0 : len(self.repo().dir())]) ==#
+ \ s:cpath(self.repo().dir() . '/')
+ let rev = '/.git'.self.spec()[strlen(self.repo().dir()) : -1]
+ elseif !self.repo().bare() &&
+ \ s:cpath(self.spec()[0 : len(self.repo().tree())]) ==#
+ \ s:cpath(self.repo().tree() . '/')
+ let rev = self.spec()[strlen(self.repo().tree()) : -1]
+ endif
+ return s:sub(s:sub(rev,'.\zs/$',''),'^/',a:0 ? a:1 : '')
+endfunction
+
+function! s:buffer_rev() dict abort
+ let rev = matchstr(self.spec(),'^fugitive://.\{-\}//\zs.*')
+ if rev =~ '^\x/'
+ return ':'.rev[0].':'.rev[2:-1]
+ elseif rev =~ '.'
+ return s:sub(rev,'/',':')
+ elseif self.spec() =~ '\.git/index$'
+ return ':'
+ elseif self.spec() =~ '\.git/refs/\|\.git/.*HEAD$'
+ return self.spec()[strlen(self.repo().dir())+1 : -1]
+ else
+ return self.path('/')
+ endif
+endfunction
+
+function! s:buffer_sha1() dict abort
+ if self.spec() =~ '^fugitive://' || self.spec() =~ '\.git/refs/\|\.git/.*HEAD$'
+ return self.repo().rev_parse(self.rev())
+ else
+ return ''
+ endif
+endfunction
+
+function! s:buffer_expand(rev) dict abort
+ if a:rev =~# '^:[0-3]$'
+ let file = a:rev.self.path(':')
+ elseif a:rev =~# '^[-:]/$'
+ let file = '/'.self.path()
+ elseif a:rev =~# '^-'
+ let file = 'HEAD^{}'.a:rev[1:-1].self.path(':')
+ elseif a:rev =~# '^@{'
+ let file = 'HEAD'.a:rev.self.path(':')
+ elseif a:rev =~# '^[~^]'
+ let commit = s:sub(self.commit(),'^\d=$','HEAD')
+ let file = commit.a:rev.self.path(':')
+ else
+ let file = a:rev
+ endif
+ return s:sub(s:sub(file,'\%$',self.path()),'\.\@<=/$','')
+endfunction
+
+function! s:buffer_containing_commit() dict abort
+ if self.commit() =~# '^\d$'
+ return ':'
+ elseif self.commit() =~# '.'
+ return self.commit()
+ else
+ return 'HEAD'
+ endif
+endfunction
+
+function! s:buffer_up(...) dict abort
+ let rev = self.rev()
+ let c = a:0 ? a:1 : 1
+ while c
+ if rev =~# '^[/:]$'
+ let rev = 'HEAD'
+ elseif rev =~# '^:'
+ let rev = ':'
+ elseif rev =~# '^refs/[^^~:]*$\|^[^^~:]*HEAD$'
+ let rev .= '^{}'
+ elseif rev =~# '^/\|:.*/'
+ let rev = s:sub(rev, '.*\zs/.*', '')
+ elseif rev =~# ':.'
+ let rev = matchstr(rev, '^[^:]*:')
+ elseif rev =~# ':$'
+ let rev = rev[0:-2]
+ else
+ return rev.'~'.c
+ endif
+ let c -= 1
+ endwhile
+ return rev
+endfunction
+
+call s:add_methods('buffer',['getvar','setvar','getline','repo','type','spec','name','commit','path','rev','sha1','expand','containing_commit','up'])
+
+" Section: Git
+
+call s:command("-bang -nargs=? -complete=customlist,s:GitComplete Git :execute s:Git(<bang>0,<q-args>)")
+
+function! s:ExecuteInTree(cmd) abort
+ let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+ let dir = getcwd()
+ try
+ execute cd.'`=s:repo().tree()`'
+ execute a:cmd
+ finally
+ execute cd.'`=dir`'
+ endtry
+endfunction
+
+function! s:Git(bang, args) abort
+ if a:bang
+ return s:Edit('edit', 1, a:args)
+ endif
+ let git = g:fugitive_git_executable
+ if has('gui_running') && !has('win32')
+ let git .= ' --no-pager'
+ endif
+ let args = matchstr(a:args,'\v\C.{-}%($|\\@<!%(\\\\)*\|)@=')
+ if exists(':terminal')
+ let dir = s:repo().tree()
+ -tabedit %
+ execute 'lcd' fnameescape(dir)
+ execute 'terminal' git args
+ else
+ call s:ExecuteInTree('!'.git.' '.args)
+ if has('win32')
+ call fugitive#reload_status()
+ endif
+ endif
+ return matchstr(a:args, '\v\C\\@<!%(\\\\)*\|\zs.*')
+endfunction
+
+function! fugitive#git_commands() abort
+ if !exists('s:exec_path')
+ let s:exec_path = s:sub(system(g:fugitive_git_executable.' --exec-path'),'\n$','')
+ endif
+ return map(split(glob(s:exec_path.'/git-*'),"\n"),'s:sub(v:val[strlen(s:exec_path)+5 : -1],"\\.exe$","")')
+endfunction
+
+function! s:GitComplete(A, L, P) abort
+ if strpart(a:L, 0, a:P) !~# ' [[:alnum:]-]\+ '
+ let cmds = fugitive#git_commands()
+ return filter(sort(cmds+keys(s:repo().aliases())), 'strpart(v:val, 0, strlen(a:A)) ==# a:A')
+ else
+ return s:repo().superglob(a:A)
+ endif
+endfunction
+
+" Section: Gcd, Glcd
+
+function! s:DirComplete(A,L,P) abort
+ let matches = s:repo().dirglob(a:A)
+ return matches
+endfunction
+
+call s:command("-bar -bang -nargs=? -complete=customlist,s:DirComplete Gcd :cd<bang> `=s:repo().bare() ? s:repo().dir(<q-args>) : s:repo().tree(<q-args>)`")
+call s:command("-bar -bang -nargs=? -complete=customlist,s:DirComplete Glcd :lcd<bang> `=s:repo().bare() ? s:repo().dir(<q-args>) : s:repo().tree(<q-args>)`")
+
+" Section: Gstatus
+
+call s:command("-bar Gstatus :execute s:Status()")
+augroup fugitive_status
+ autocmd!
+ if !has('win32')
+ autocmd FocusGained,ShellCmdPost * call fugitive#reload_status()
+ autocmd BufDelete term://* call fugitive#reload_status()
+ endif
+augroup END
+
+function! s:Status() abort
+ try
+ Gpedit :
+ wincmd P
+ setlocal foldmethod=syntax foldlevel=1
+ nnoremap <buffer> <silent> q :<C-U>bdelete<CR>
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ endtry
+ return ''
+endfunction
+
+function! fugitive#reload_status() abort
+ if exists('s:reloading_status')
+ return
+ endif
+ try
+ let s:reloading_status = 1
+ let mytab = tabpagenr()
+ for tab in [mytab] + range(1,tabpagenr('$'))
+ for winnr in range(1,tabpagewinnr(tab,'$'))
+ if getbufvar(tabpagebuflist(tab)[winnr-1],'fugitive_type') ==# 'index'
+ execute 'tabnext '.tab
+ if winnr != winnr()
+ execute winnr.'wincmd w'
+ let restorewinnr = 1
+ endif
+ try
+ if !&modified
+ call s:BufReadIndex()
+ endif
+ finally
+ if exists('restorewinnr')
+ wincmd p
+ endif
+ execute 'tabnext '.mytab
+ endtry
+ endif
+ endfor
+ endfor
+ finally
+ unlet! s:reloading_status
+ endtry
+endfunction
+
+function! s:stage_info(lnum) abort
+ let filename = matchstr(getline(a:lnum),'^#\t\zs.\{-\}\ze\%( ([^()[:digit:]]\+)\)\=$')
+ let lnum = a:lnum
+ if has('multi_byte_encoding')
+ let colon = '\%(:\|\%uff1a\)'
+ else
+ let colon = ':'
+ endif
+ while lnum && getline(lnum) !~# colon.'$'
+ let lnum -= 1
+ endwhile
+ if !lnum
+ return ['', '']
+ elseif (getline(lnum+1) =~# '^# .*\<git \%(reset\|rm --cached\) ' && getline(lnum+2) ==# '#') || getline(lnum) ==# '# Changes to be committed:'
+ return [matchstr(filename, colon.' *\zs.*'), 'staged']
+ elseif (getline(lnum+1) =~# '^# .*\<git add ' && getline(lnum+2) ==# '#' && getline(lnum+3) !~# colon.' ') || getline(lnum) ==# '# Untracked files:'
+ return [filename, 'untracked']
+ elseif getline(lnum+2) =~# '^# .*\<git checkout ' || getline(lnum) ==# '# Changes not staged for commit:'
+ return [matchstr(filename, colon.' *\zs.*'), 'unstaged']
+ elseif getline(lnum+2) =~# '^# .*\<git \%(add\|rm\)' || getline(lnum) ==# '# Unmerged paths:'
+ return [matchstr(filename, colon.' *\zs.*'), 'unmerged']
+ else
+ return ['', 'unknown']
+ endif
+endfunction
+
+function! s:StageNext(count) abort
+ for i in range(a:count)
+ call search('^#\t.*','W')
+ endfor
+ return '.'
+endfunction
+
+function! s:StagePrevious(count) abort
+ if line('.') == 1 && exists(':CtrlP') && get(g:, 'ctrl_p_map') =~? '^<c-p>$'
+ return 'CtrlP '.fnameescape(s:repo().tree())
+ else
+ for i in range(a:count)
+ call search('^#\t.*','Wbe')
+ endfor
+ return '.'
+ endif
+endfunction
+
+function! s:StageReloadSeek(target,lnum1,lnum2) abort
+ let jump = a:target
+ let f = matchstr(getline(a:lnum1-1),'^#\t\%([[:alpha:] ]\+: *\|.*\%uff1a *\)\=\zs.*')
+ if f !=# '' | let jump = f | endif
+ let f = matchstr(getline(a:lnum2+1),'^#\t\%([[:alpha:] ]\+: *\|.*\%uff1a *\)\=\zs.*')
+ if f !=# '' | let jump = f | endif
+ silent! edit!
+ 1
+ redraw
+ call search('^#\t\%([[:alpha:] ]\+: *\|.*\%uff1a *\)\=\V'.jump.'\%( ([^()[:digit:]]\+)\)\=\$','W')
+endfunction
+
+function! s:StageUndo() abort
+ let [filename, section] = s:stage_info(line('.'))
+ if empty(filename)
+ return ''
+ endif
+ let repo = s:repo()
+ let hash = repo.git_chomp('hash-object', '-w', filename)
+ if !empty(hash)
+ if section ==# 'untracked'
+ call repo.git_chomp_in_tree('clean', '--', filename)
+ elseif section ==# 'unmerged'
+ call repo.git_chomp_in_tree('rm', '--', filename)
+ elseif section ==# 'unstaged'
+ call repo.git_chomp_in_tree('checkout', '--', filename)
+ else
+ call repo.git_chomp_in_tree('checkout', 'HEAD', '--', filename)
+ endif
+ call s:StageReloadSeek(filename, line('.'), line('.'))
+ let @" = hash
+ return 'checktime|redraw|echomsg ' .
+ \ string('To restore, :Git cat-file blob '.hash[0:6].' > '.filename)
+ endif
+endfunction
+
+function! s:StageDiff(diff) abort
+ let [filename, section] = s:stage_info(line('.'))
+ if filename ==# '' && section ==# 'staged'
+ return 'Git! diff --no-ext-diff --cached'
+ elseif filename ==# ''
+ return 'Git! diff --no-ext-diff'
+ elseif filename =~# ' -> '
+ let [old, new] = split(filename,' -> ')
+ execute 'Gedit '.s:fnameescape(':0:'.new)
+ return a:diff.' HEAD:'.s:fnameescape(old)
+ elseif section ==# 'staged'
+ execute 'Gedit '.s:fnameescape(':0:'.filename)
+ return a:diff.' -'
+ else
+ execute 'Gedit '.s:fnameescape('/'.filename)
+ return a:diff
+ endif
+endfunction
+
+function! s:StageDiffEdit() abort
+ let [filename, section] = s:stage_info(line('.'))
+ let arg = (filename ==# '' ? '.' : filename)
+ if section ==# 'staged'
+ return 'Git! diff --no-ext-diff --cached '.s:shellesc(arg)
+ elseif section ==# 'untracked'
+ let repo = s:repo()
+ call repo.git_chomp_in_tree('add','--intent-to-add',arg)
+ if arg ==# '.'
+ silent! edit!
+ 1
+ if !search('^# .*:\n#.*\n# .*"git checkout \|^# Changes not staged for commit:$','W')
+ call search('^# .*:$','W')
+ endif
+ else
+ call s:StageReloadSeek(arg,line('.'),line('.'))
+ endif
+ return ''
+ else
+ return 'Git! diff --no-ext-diff '.s:shellesc(arg)
+ endif
+endfunction
+
+function! s:StageToggle(lnum1,lnum2) abort
+ if a:lnum1 == 1 && a:lnum2 == 1
+ return 'Gedit /.git|call search("^index$", "wc")'
+ endif
+ try
+ let output = ''
+ for lnum in range(a:lnum1,a:lnum2)
+ let [filename, section] = s:stage_info(lnum)
+ let repo = s:repo()
+ if getline('.') =~# '^# .*:$'
+ if section ==# 'staged'
+ call repo.git_chomp_in_tree('reset','-q')
+ silent! edit!
+ 1
+ if !search('^# .*:\n# .*"git add .*\n#\n\|^# Untracked files:$','W')
+ call search('^# .*:$','W')
+ endif
+ return ''
+ elseif section ==# 'unstaged'
+ call repo.git_chomp_in_tree('add','-u')
+ silent! edit!
+ 1
+ if !search('^# .*:\n# .*"git add .*\n#\n\|^# Untracked files:$','W')
+ call search('^# .*:$','W')
+ endif
+ return ''
+ else
+ call repo.git_chomp_in_tree('add','.')
+ silent! edit!
+ 1
+ call search('^# .*:$','W')
+ return ''
+ endif
+ endif
+ if filename ==# ''
+ continue
+ endif
+ execute lnum
+ if filename =~ ' -> '
+ let cmd = ['mv','--'] + reverse(split(filename,' -> '))
+ let filename = cmd[-1]
+ elseif section ==# 'staged'
+ let cmd = ['reset','-q','--',filename]
+ elseif getline(lnum) =~# '^#\tdeleted:'
+ let cmd = ['rm','--',filename]
+ elseif getline(lnum) =~# '^#\tmodified:'
+ let cmd = ['add','--',filename]
+ else
+ let cmd = ['add','-A','--',filename]
+ endif
+ if !exists('first_filename')
+ let first_filename = filename
+ endif
+ let output .= call(repo.git_chomp_in_tree,cmd,s:repo())."\n"
+ endfor
+ if exists('first_filename')
+ call s:StageReloadSeek(first_filename,a:lnum1,a:lnum2)
+ endif
+ echo s:sub(s:gsub(output,'\n+','\n'),'\n$','')
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ endtry
+ return 'checktime'
+endfunction
+
+function! s:StagePatch(lnum1,lnum2) abort
+ let add = []
+ let reset = []
+
+ for lnum in range(a:lnum1,a:lnum2)
+ let [filename, section] = s:stage_info(lnum)
+ if getline('.') =~# '^# .*:$' && section ==# 'staged'
+ return 'Git reset --patch'
+ elseif getline('.') =~# '^# .*:$' && section ==# 'unstaged'
+ return 'Git add --patch'
+ elseif getline('.') =~# '^# .*:$' && section ==# 'untracked'
+ return 'Git add -N .'
+ elseif filename ==# ''
+ continue
+ endif
+ if !exists('first_filename')
+ let first_filename = filename
+ endif
+ execute lnum
+ if filename =~ ' -> '
+ let reset += [split(filename,' -> ')[1]]
+ elseif section ==# 'staged'
+ let reset += [filename]
+ elseif getline(lnum) !~# '^#\tdeleted:'
+ let add += [filename]
+ endif
+ endfor
+ try
+ if !empty(add)
+ execute "Git add --patch -- ".join(map(add,'s:shellesc(v:val)'))
+ endif
+ if !empty(reset)
+ execute "Git reset --patch -- ".join(map(reset,'s:shellesc(v:val)'))
+ endif
+ if exists('first_filename')
+ silent! edit!
+ 1
+ redraw
+ call search('^#\t\%([[:alpha:] ]\+: *\)\=\V'.first_filename.'\%( ([^()[:digit:]]\+)\)\=\$','W')
+ endif
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ endtry
+ return 'checktime'
+endfunction
+
+" Section: Gcommit
+
+call s:command("-nargs=? -complete=customlist,s:CommitComplete Gcommit :execute s:Commit(<q-args>)")
+
+function! s:Commit(args, ...) abort
+ let repo = a:0 ? a:1 : s:repo()
+ let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+ let dir = getcwd()
+ let msgfile = repo.dir('COMMIT_EDITMSG')
+ let outfile = tempname()
+ let errorfile = tempname()
+ try
+ try
+ execute cd.s:fnameescape(repo.tree())
+ if s:winshell()
+ let command = ''
+ let old_editor = $GIT_EDITOR
+ let $GIT_EDITOR = 'false'
+ else
+ let command = 'env GIT_EDITOR=false '
+ endif
+ let command .= repo.git_command('commit').' '.a:args
+ if &shell =~# 'csh'
+ noautocmd silent execute '!('.command.' > '.outfile.') >& '.errorfile
+ elseif a:args =~# '\%(^\| \)-\%(-interactive\|p\|-patch\)\>'
+ noautocmd execute '!'.command.' 2> '.errorfile
+ else
+ noautocmd silent execute '!'.command.' > '.outfile.' 2> '.errorfile
+ endif
+ finally
+ execute cd.'`=dir`'
+ endtry
+ if !has('gui_running')
+ redraw!
+ endif
+ if !v:shell_error
+ if filereadable(outfile)
+ for line in readfile(outfile)
+ echo line
+ endfor
+ endif
+ return ''
+ else
+ let errors = readfile(errorfile)
+ let error = get(errors,-2,get(errors,-1,'!'))
+ if error =~# 'false''\=\.$'
+ let args = a:args
+ let args = s:gsub(args,'%(%(^| )-- )@<!%(^| )@<=%(-[esp]|--edit|--interactive|--patch|--signoff)%($| )','')
+ let args = s:gsub(args,'%(%(^| )-- )@<!%(^| )@<=%(-c|--reedit-message|--reuse-message|-F|--file|-m|--message)%(\s+|\=)%(''[^'']*''|"%(\\.|[^"])*"|\\.|\S)*','')
+ let args = s:gsub(args,'%(^| )@<=[%#]%(:\w)*','\=expand(submatch(0))')
+ let args = s:sub(args, '\ze -- |$', ' --no-edit --no-interactive --no-signoff')
+ let args = '-F '.s:shellesc(msgfile).' '.args
+ if args !~# '\%(^\| \)--cleanup\>'
+ let args = '--cleanup=strip '.args
+ endif
+ if bufname('%') == '' && line('$') == 1 && getline(1) == '' && !&mod
+ execute 'keepalt edit '.s:fnameescape(msgfile)
+ elseif a:args =~# '\%(^\| \)-\%(-verbose\|\w*v\)\>'
+ execute 'keepalt -tabedit '.s:fnameescape(msgfile)
+ elseif s:buffer().type() ==# 'index'
+ execute 'keepalt edit '.s:fnameescape(msgfile)
+ execute (search('^#','n')+1).'wincmd+'
+ setlocal nopreviewwindow
+ else
+ execute 'keepalt split '.s:fnameescape(msgfile)
+ endif
+ let b:fugitive_commit_arguments = args
+ setlocal bufhidden=wipe filetype=gitcommit
+ return '1'
+ elseif error ==# '!'
+ return s:Status()
+ else
+ call s:throw(error)
+ endif
+ endif
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ finally
+ if exists('old_editor')
+ let $GIT_EDITOR = old_editor
+ endif
+ call delete(outfile)
+ call delete(errorfile)
+ call fugitive#reload_status()
+ endtry
+endfunction
+
+function! s:CommitComplete(A,L,P) abort
+ if a:A =~ '^-' || type(a:A) == type(0) " a:A is 0 on :Gcommit -<Tab>
+ let args = ['-C', '-F', '-a', '-c', '-e', '-i', '-m', '-n', '-o', '-q', '-s', '-t', '-u', '-v', '--all', '--allow-empty', '--amend', '--author=', '--cleanup=', '--dry-run', '--edit', '--file=', '--fixup=', '--include', '--interactive', '--message=', '--no-verify', '--only', '--quiet', '--reedit-message=', '--reuse-message=', '--signoff', '--squash=', '--template=', '--untracked-files', '--verbose']
+ return filter(args,'v:val[0 : strlen(a:A)-1] ==# a:A')
+ else
+ return s:repo().superglob(a:A)
+ endif
+endfunction
+
+function! s:FinishCommit() abort
+ let args = getbufvar(+expand('<abuf>'),'fugitive_commit_arguments')
+ if !empty(args)
+ call setbufvar(+expand('<abuf>'),'fugitive_commit_arguments','')
+ return s:Commit(args, s:repo(getbufvar(+expand('<abuf>'),'git_dir')))
+ endif
+ return ''
+endfunction
+
+" Section: Gmerge, Gpull
+
+call s:command("-nargs=? -bang -complete=custom,s:RevisionComplete Gmerge " .
+ \ "execute s:Merge('merge', <bang>0, <q-args>)")
+call s:command("-nargs=? -bang -complete=custom,s:RemoteComplete Gpull " .
+ \ "execute s:Merge('pull --progress', <bang>0, <q-args>)")
+
+function! s:RevisionComplete(A, L, P) abort
+ return s:repo().git_chomp('rev-parse', '--symbolic', '--branches', '--tags', '--remotes')
+ \ . "\nHEAD\nFETCH_HEAD\nORIG_HEAD"
+endfunction
+
+function! s:RemoteComplete(A, L, P) abort
+ let remote = matchstr(a:L, ' \zs\S\+\ze ')
+ if !empty(remote)
+ let matches = split(s:repo().git_chomp('ls-remote', remote), "\n")
+ call filter(matches, 'v:val =~# "\t" && v:val !~# "{"')
+ call map(matches, 's:sub(v:val, "^.*\t%(refs/%(heads/|tags/)=)=", "")')
+ else
+ let matches = split(s:repo().git_chomp('remote'), "\n")
+ endif
+ return join(matches, "\n")
+endfunction
+
+function! fugitive#cwindow() abort
+ if &buftype == 'quickfix'
+ cwindow
+ else
+ botright cwindow
+ if &buftype == 'quickfix'
+ wincmd p
+ endif
+ endif
+endfunction
+
+let s:common_efm = ''
+ \ . '%+Egit:%.%#,'
+ \ . '%+Eusage:%.%#,'
+ \ . '%+Eerror:%.%#,'
+ \ . '%+Efatal:%.%#,'
+ \ . '%-G%.%#%\e[K%.%#,'
+ \ . '%-G%.%#%\r%.%\+'
+
+function! s:Merge(cmd, bang, args) abort
+ let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd'
+ let cwd = getcwd()
+ let [mp, efm] = [&l:mp, &l:efm]
+ let had_merge_msg = filereadable(s:repo().dir('MERGE_MSG'))
+ try
+ let &l:errorformat = ''
+ \ . '%-Gerror:%.%#false''.,'
+ \ . '%-G%.%# ''git commit'' %.%#,'
+ \ . '%+Emerge:%.%#,'
+ \ . s:common_efm . ','
+ \ . '%+ECannot %.%#: You have unstaged changes.,'
+ \ . '%+ECannot %.%#: Your index contains uncommitted changes.,'
+ \ . '%+EThere is no tracking information for the current branch.,'
+ \ . '%+EYou are not currently on a branch. Please specify which,'
+ \ . 'CONFLICT (%m): %f deleted in %.%#,'
+ \ . 'CONFLICT (%m): Merge conflict in %f,'
+ \ . 'CONFLICT (%m): Rename \"%f\"->%.%#,'
+ \ . 'CONFLICT (%m): Rename %.%#->%f %.%#,'
+ \ . 'CONFLICT (%m): There is a directory with name %f in %.%#,'
+ \ . '%+ECONFLICT %.%#,'
+ \ . '%+EKONFLIKT %.%#,'
+ \ . '%+ECONFLIT %.%#,'
+ \ . "%+EXUNG \u0110\u1ed8T %.%#,"
+ \ . "%+E\u51b2\u7a81 %.%#,"
+ \ . 'U%\t%f'
+ if a:cmd =~# '^merge' && empty(a:args) &&
+ \ (had_merge_msg || isdirectory(s:repo().dir('rebase-apply')) ||
+ \ !empty(s:repo().git_chomp('diff-files', '--diff-filter=U')))
+ let &l:makeprg = g:fugitive_git_executable.' diff-files --name-status --diff-filter=U'
+ else
+ let &l:makeprg = s:sub(g:fugitive_git_executable . ' ' . a:cmd .
+ \ (a:args =~# ' \%(--no-edit\|--abort\|-m\)\>' ? '' : ' --edit') .
+ \ ' ' . a:args, ' *$', '')
+ endif
+ if !empty($GIT_EDITOR) || has('win32')
+ let old_editor = $GIT_EDITOR
+ let $GIT_EDITOR = 'false'
+ else
+ let &l:makeprg = 'env GIT_EDITOR=false ' . &l:makeprg
+ endif
+ execute cd fnameescape(s:repo().tree())
+ silent noautocmd make!
+ catch /^Vim\%((\a\+)\)\=:E211/
+ let err = v:exception
+ finally
+ redraw!
+ let [&l:mp, &l:efm] = [mp, efm]
+ if exists('old_editor')
+ let $GIT_EDITOR = old_editor
+ endif
+ execute cd fnameescape(cwd)
+ endtry
+ call fugitive#reload_status()
+ if empty(filter(getqflist(),'v:val.valid'))
+ if !had_merge_msg && filereadable(s:repo().dir('MERGE_MSG'))
+ cclose
+ return 'Gcommit --no-status -n -t '.s:shellesc(s:repo().dir('MERGE_MSG'))
+ endif
+ endif
+ let qflist = getqflist()
+ let found = 0
+ for e in qflist
+ if !empty(e.bufnr)
+ let found = 1
+ let e.pattern = '^<<<<<<<'
+ endif
+ endfor
+ call fugitive#cwindow()
+ if found
+ call setqflist(qflist, 'r')
+ if !a:bang
+ return 'cfirst'
+ endif
+ endif
+ return exists('err') ? 'echoerr '.string(err) : ''
+endfunction
+
+" Section: Ggrep, Glog
+
+if !exists('g:fugitive_summary_format')
+ let g:fugitive_summary_format = '%s'
+endif
+
+call s:command("-bang -nargs=? -complete=customlist,s:EditComplete Ggrep :execute s:Grep('grep',<bang>0,<q-args>)")
+call s:command("-bang -nargs=? -complete=customlist,s:EditComplete Glgrep :execute s:Grep('lgrep',<bang>0,<q-args>)")
+call s:command("-bar -bang -nargs=* -range=0 -complete=customlist,s:EditComplete Glog :call s:Log('grep<bang>',<line1>,<count>,<f-args>)")
+call s:command("-bar -bang -nargs=* -range=0 -complete=customlist,s:EditComplete Gllog :call s:Log('lgrep<bang>',<line1>,<count>,<f-args>)")
+
+function! s:Grep(cmd,bang,arg) abort
+ let grepprg = &grepprg
+ let grepformat = &grepformat
+ let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+ let dir = getcwd()
+ try
+ execute cd.'`=s:repo().tree()`'
+ let &grepprg = s:repo().git_command('--no-pager', 'grep', '-n', '--no-color')
+ let &grepformat = '%f:%l:%m,%m %f match%ts,%f'
+ exe a:cmd.'! '.escape(matchstr(a:arg,'\v\C.{-}%($|[''" ]\@=\|)@='),'|')
+ let list = a:cmd =~# '^l' ? getloclist(0) : getqflist()
+ for entry in list
+ if bufname(entry.bufnr) =~ ':'
+ let entry.filename = s:repo().translate(bufname(entry.bufnr))
+ unlet! entry.bufnr
+ let changed = 1
+ elseif a:arg =~# '\%(^\| \)--cached\>'
+ let entry.filename = s:repo().translate(':0:'.bufname(entry.bufnr))
+ unlet! entry.bufnr
+ let changed = 1
+ endif
+ endfor
+ if a:cmd =~# '^l' && exists('changed')
+ call setloclist(0, list, 'r')
+ elseif exists('changed')
+ call setqflist(list, 'r')
+ endif
+ if !a:bang && !empty(list)
+ return (a:cmd =~# '^l' ? 'l' : 'c').'first'.matchstr(a:arg,'\v\C[''" ]\zs\|.*')
+ else
+ return matchstr(a:arg,'\v\C[''" ]\|\zs.*')
+ endif
+ finally
+ let &grepprg = grepprg
+ let &grepformat = grepformat
+ execute cd.'`=dir`'
+ endtry
+endfunction
+
+function! s:Log(cmd, line1, line2, ...) abort
+ let path = s:buffer().path('/')
+ if path =~# '^/\.git\%(/\|$\)' || index(a:000,'--') != -1
+ let path = ''
+ endif
+ let cmd = ['--no-pager', 'log', '--no-color']
+ let cmd += ['--pretty=format:fugitive://'.s:repo().dir().'//%H'.path.'::'.g:fugitive_summary_format]
+ if empty(filter(a:000[0 : index(a:000,'--')],'v:val !~# "^-"'))
+ if s:buffer().commit() =~# '\x\{40\}'
+ let cmd += [s:buffer().commit()]
+ elseif s:buffer().path() =~# '^\.git/refs/\|^\.git/.*HEAD$'
+ let cmd += [s:buffer().path()[5:-1]]
+ endif
+ end
+ let cmd += map(copy(a:000),'s:sub(v:val,"^\\%(%(:\\w)*)","\\=fnamemodify(s:buffer().path(),submatch(1))")')
+ if path =~# '/.'
+ if a:line2
+ let cmd += ['-L', a:line1 . ',' . a:line2 . ':' . path[1:-1]]
+ else
+ let cmd += ['--', path[1:-1]]
+ endif
+ endif
+ let grepformat = &grepformat
+ let grepprg = &grepprg
+ let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+ let dir = getcwd()
+ try
+ execute cd.'`=s:repo().tree()`'
+ let &grepprg = escape(call(s:repo().git_command,cmd,s:repo()),'%#')
+ let &grepformat = '%Cdiff %.%#,%C--- %.%#,%C+++ %.%#,%Z@@ -%\d%\+\,%\d%\+ +%l\,%\d%\+ @@,%-G-%.%#,%-G+%.%#,%-G %.%#,%A%f::%m,%-G%.%#'
+ exe a:cmd
+ finally
+ let &grepformat = grepformat
+ let &grepprg = grepprg
+ execute cd.'`=dir`'
+ endtry
+endfunction
+
+" Section: Gedit, Gpedit, Gsplit, Gvsplit, Gtabedit, Gread
+
+function! s:Edit(cmd,bang,...) abort
+ let buffer = s:buffer()
+ if a:cmd !~# 'read'
+ if &previewwindow && getbufvar('','fugitive_type') ==# 'index'
+ if winnr('$') == 1
+ let tabs = (&go =~# 'e' || !has('gui_running')) && &stal && (tabpagenr('$') >= &stal)
+ execute 'rightbelow' (&lines - &previewheight - &cmdheight - tabs - 1 - !!&laststatus).'new'
+ elseif winnr('#')
+ wincmd p
+ else
+ wincmd w
+ endif
+ if &diff
+ let mywinnr = winnr()
+ for winnr in range(winnr('$'),1,-1)
+ if winnr != mywinnr && getwinvar(winnr,'&diff')
+ execute winnr.'wincmd w'
+ close
+ if winnr('$') > 1
+ wincmd p
+ endif
+ endif
+ endfor
+ endif
+ endif
+ endif
+
+ if a:bang
+ let arglist = map(copy(a:000), 's:gsub(v:val, ''\\@<!%(\\\\)*\zs[%#]'', ''\=s:buffer().expand(submatch(0))'')')
+ let args = join(arglist, ' ')
+ if a:cmd =~# 'read'
+ let git = buffer.repo().git_command()
+ let last = line('$')
+ silent call s:ExecuteInTree((a:cmd ==# 'read' ? '$read' : a:cmd).'!'.git.' --no-pager '.args)
+ if a:cmd ==# 'read'
+ silent execute '1,'.last.'delete_'
+ endif
+ call fugitive#reload_status()
+ diffupdate
+ return 'redraw|echo '.string(':!'.git.' '.args)
+ else
+ let temp = resolve(tempname())
+ let s:temp_files[s:cpath(temp)] = { 'dir': buffer.repo().dir(), 'args': arglist }
+ silent execute a:cmd.' '.temp
+ if a:cmd =~# 'pedit'
+ wincmd P
+ endif
+ let echo = s:Edit('read',1,args)
+ silent write!
+ setlocal buftype=nowrite nomodified filetype=git foldmarker=<<<<<<<,>>>>>>>
+ if getline(1) !~# '^diff '
+ setlocal readonly nomodifiable
+ endif
+ if a:cmd =~# 'pedit'
+ wincmd p
+ endif
+ return echo
+ endif
+ return ''
+ endif
+
+ if a:0 && a:1 == ''
+ return ''
+ elseif a:0
+ let file = buffer.expand(join(a:000, ' '))
+ elseif expand('%') ==# ''
+ let file = ':'
+ elseif buffer.commit() ==# '' && buffer.path('/') !~# '^/.git\>'
+ let file = buffer.path(':')
+ else
+ let file = buffer.path('/')
+ endif
+ try
+ let file = buffer.repo().translate(file)
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ endtry
+ if file !~# '^fugitive:'
+ let file = s:sub(file, '/$', '')
+ endif
+ if a:cmd ==# 'read'
+ return 'silent %delete_|read '.s:fnameescape(file).'|silent 1delete_|diffupdate|'.line('.')
+ else
+ return a:cmd.' '.s:fnameescape(file)
+ endif
+endfunction
+
+function! s:EditComplete(A,L,P) abort
+ return map(s:repo().superglob(a:A), 'fnameescape(v:val)')
+endfunction
+
+function! s:EditRunComplete(A,L,P) abort
+ if a:L =~# '^\w\+!'
+ return s:GitComplete(a:A,a:L,a:P)
+ else
+ return s:repo().superglob(a:A)
+ endif
+endfunction
+
+call s:command("-bar -bang -nargs=* -complete=customlist,s:EditComplete Ge :execute s:Edit('edit<bang>',0,<f-args>)")
+call s:command("-bar -bang -nargs=* -complete=customlist,s:EditComplete Gedit :execute s:Edit('edit<bang>',0,<f-args>)")
+call s:command("-bar -bang -nargs=* -complete=customlist,s:EditRunComplete Gpedit :execute s:Edit('pedit',<bang>0,<f-args>)")
+call s:command("-bar -bang -nargs=* -complete=customlist,s:EditRunComplete Gsplit :execute s:Edit('split',<bang>0,<f-args>)")
+call s:command("-bar -bang -nargs=* -complete=customlist,s:EditRunComplete Gvsplit :execute s:Edit('vsplit',<bang>0,<f-args>)")
+call s:command("-bar -bang -nargs=* -complete=customlist,s:EditRunComplete Gtabedit :execute s:Edit('tabedit',<bang>0,<f-args>)")
+call s:command("-bar -bang -nargs=* -count -complete=customlist,s:EditRunComplete Gread :execute s:Edit((!<count> && <line1> ? '' : <count>).'read',<bang>0,<f-args>)")
+
+" Section: Gwrite, Gwq
+
+call s:command("-bar -bang -nargs=* -complete=customlist,s:EditComplete Gwrite :execute s:Write(<bang>0,<f-args>)")
+call s:command("-bar -bang -nargs=* -complete=customlist,s:EditComplete Gw :execute s:Write(<bang>0,<f-args>)")
+call s:command("-bar -bang -nargs=* -complete=customlist,s:EditComplete Gwq :execute s:Wq(<bang>0,<f-args>)")
+
+function! s:Write(force,...) abort
+ if exists('b:fugitive_commit_arguments')
+ return 'write|bdelete'
+ elseif expand('%:t') == 'COMMIT_EDITMSG' && $GIT_INDEX_FILE != ''
+ return 'wq'
+ elseif s:buffer().type() == 'index'
+ return 'Gcommit'
+ elseif s:buffer().path() ==# '' && getline(4) =~# '^+++ '
+ let filename = getline(4)[6:-1]
+ setlocal buftype=
+ silent write
+ setlocal buftype=nowrite
+ if matchstr(getline(2),'index [[:xdigit:]]\+\.\.\zs[[:xdigit:]]\{7\}') ==# s:repo().rev_parse(':0:'.filename)[0:6]
+ let err = s:repo().git_chomp('apply','--cached','--reverse',s:buffer().spec())
+ else
+ let err = s:repo().git_chomp('apply','--cached',s:buffer().spec())
+ endif
+ if err !=# ''
+ let v:errmsg = split(err,"\n")[0]
+ return 'echoerr v:errmsg'
+ elseif a:force
+ return 'bdelete'
+ else
+ return 'Gedit '.fnameescape(filename)
+ endif
+ endif
+ let mytab = tabpagenr()
+ let mybufnr = bufnr('')
+ let path = a:0 ? join(a:000, ' ') : s:buffer().path()
+ if empty(path)
+ return 'echoerr '.string('fugitive: cannot determine file path')
+ endif
+ if path =~# '^:\d\>'
+ return 'write'.(a:force ? '! ' : ' ').s:fnameescape(s:repo().translate(s:buffer().expand(path)))
+ endif
+ let always_permitted = (s:buffer().path() ==# path && s:buffer().commit() =~# '^0\=$')
+ if !always_permitted && !a:force && s:repo().git_chomp_in_tree('diff','--name-status','HEAD','--',path) . s:repo().git_chomp_in_tree('ls-files','--others','--',path) !=# ''
+ let v:errmsg = 'fugitive: file has uncommitted changes (use ! to override)'
+ return 'echoerr v:errmsg'
+ endif
+ let file = s:repo().translate(path)
+ let treebufnr = 0
+ for nr in range(1,bufnr('$'))
+ if fnamemodify(bufname(nr),':p') ==# file
+ let treebufnr = nr
+ endif
+ endfor
+
+ if treebufnr > 0 && treebufnr != bufnr('')
+ let temp = tempname()
+ silent execute '%write '.temp
+ for tab in [mytab] + range(1,tabpagenr('$'))
+ for winnr in range(1,tabpagewinnr(tab,'$'))
+ if tabpagebuflist(tab)[winnr-1] == treebufnr
+ execute 'tabnext '.tab
+ if winnr != winnr()
+ execute winnr.'wincmd w'
+ let restorewinnr = 1
+ endif
+ try
+ let lnum = line('.')
+ let last = line('$')
+ silent execute '$read '.temp
+ silent execute '1,'.last.'delete_'
+ silent write!
+ silent execute lnum
+ let did = 1
+ finally
+ if exists('restorewinnr')
+ wincmd p
+ endif
+ execute 'tabnext '.mytab
+ endtry
+ endif
+ endfor
+ endfor
+ if !exists('did')
+ call writefile(readfile(temp,'b'),file,'b')
+ endif
+ else
+ execute 'write! '.s:fnameescape(s:repo().translate(path))
+ endif
+
+ if a:force
+ let error = s:repo().git_chomp_in_tree('add', '--force', '--', path)
+ else
+ let error = s:repo().git_chomp_in_tree('add', '--', path)
+ endif
+ if v:shell_error
+ let v:errmsg = 'fugitive: '.error
+ return 'echoerr v:errmsg'
+ endif
+ if s:buffer().path() ==# path && s:buffer().commit() =~# '^\d$'
+ set nomodified
+ endif
+
+ let one = s:repo().translate(':1:'.path)
+ let two = s:repo().translate(':2:'.path)
+ let three = s:repo().translate(':3:'.path)
+ for nr in range(1,bufnr('$'))
+ let name = fnamemodify(bufname(nr), ':p')
+ if bufloaded(nr) && !getbufvar(nr,'&modified') && (name ==# one || name ==# two || name ==# three)
+ execute nr.'bdelete'
+ endif
+ endfor
+
+ unlet! restorewinnr
+ let zero = s:repo().translate(':0:'.path)
+ silent execute 'doautocmd BufWritePost' s:fnameescape(zero)
+ for tab in range(1,tabpagenr('$'))
+ for winnr in range(1,tabpagewinnr(tab,'$'))
+ let bufnr = tabpagebuflist(tab)[winnr-1]
+ let bufname = fnamemodify(bufname(bufnr), ':p')
+ if bufname ==# zero && bufnr != mybufnr
+ execute 'tabnext '.tab
+ if winnr != winnr()
+ execute winnr.'wincmd w'
+ let restorewinnr = 1
+ endif
+ try
+ let lnum = line('.')
+ let last = line('$')
+ silent execute '$read '.s:fnameescape(file)
+ silent execute '1,'.last.'delete_'
+ silent execute lnum
+ set nomodified
+ diffupdate
+ finally
+ if exists('restorewinnr')
+ wincmd p
+ endif
+ execute 'tabnext '.mytab
+ endtry
+ break
+ endif
+ endfor
+ endfor
+ call fugitive#reload_status()
+ return 'checktime'
+endfunction
+
+function! s:Wq(force,...) abort
+ let bang = a:force ? '!' : ''
+ if exists('b:fugitive_commit_arguments')
+ return 'wq'.bang
+ endif
+ let result = call(s:function('s:Write'),[a:force]+a:000)
+ if result =~# '^\%(write\|wq\|echoerr\)'
+ return s:sub(result,'^write','wq')
+ else
+ return result.'|quit'.bang
+ endif
+endfunction
+
+augroup fugitive_commit
+ autocmd!
+ autocmd VimLeavePre,BufDelete COMMIT_EDITMSG execute s:sub(s:FinishCommit(), '^echoerr (.*)', 'echohl ErrorMsg|echo \1|echohl NONE')
+augroup END
+
+" Section: Gpush, Gfetch
+
+call s:command("-nargs=? -bang -complete=custom,s:RemoteComplete Gpush execute s:Dispatch('<bang>', 'push '.<q-args>)")
+call s:command("-nargs=? -bang -complete=custom,s:RemoteComplete Gfetch execute s:Dispatch('<bang>', 'fetch '.<q-args>)")
+
+function! s:Dispatch(bang, args)
+ let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd' : 'cd'
+ let cwd = getcwd()
+ let [mp, efm, cc] = [&l:mp, &l:efm, get(b:, 'current_compiler', '')]
+ try
+ let b:current_compiler = 'git'
+ let &l:errorformat = s:common_efm
+ let &l:makeprg = g:fugitive_git_executable . ' ' . a:args
+ execute cd fnameescape(s:repo().tree())
+ if exists(':Make') == 2
+ noautocmd Make
+ else
+ silent noautocmd make!
+ redraw!
+ return 'call fugitive#cwindow()'
+ endif
+ return ''
+ finally
+ let [&l:mp, &l:efm, b:current_compiler] = [mp, efm, cc]
+ if empty(cc) | unlet! b:current_compiler | endif
+ execute cd fnameescape(cwd)
+ endtry
+endfunction
+
+" Section: Gdiff
+
+call s:command("-bang -bar -nargs=* -complete=customlist,s:EditComplete Gdiff :execute s:Diff('',<bang>0,<f-args>)")
+call s:command("-bang -bar -nargs=* -complete=customlist,s:EditComplete Gvdiff :execute s:Diff('keepalt vert ',<bang>0,<f-args>)")
+call s:command("-bang -bar -nargs=* -complete=customlist,s:EditComplete Gsdiff :execute s:Diff('keepalt ',<bang>0,<f-args>)")
+
+augroup fugitive_diff
+ autocmd!
+ autocmd BufWinLeave *
+ \ if s:can_diffoff(+expand('<abuf>')) && s:diff_window_count() == 2 |
+ \ call s:diffoff_all(getbufvar(+expand('<abuf>'), 'git_dir')) |
+ \ endif
+ autocmd BufWinEnter *
+ \ if s:can_diffoff(+expand('<abuf>')) && s:diff_window_count() == 1 |
+ \ call s:diffoff() |
+ \ endif
+augroup END
+
+function! s:can_diffoff(buf) abort
+ return getwinvar(bufwinnr(a:buf), '&diff') &&
+ \ !empty(getbufvar(a:buf, 'git_dir')) &&
+ \ !empty(getwinvar(bufwinnr(a:buf), 'fugitive_diff_restore'))
+endfunction
+
+function! fugitive#can_diffoff(buf) abort
+ return s:can_diffoff(a:buf)
+endfunction
+
+function! s:diff_modifier(count) abort
+ let fdc = matchstr(&diffopt, 'foldcolumn:\zs\d\+')
+ if &diffopt =~# 'horizontal' && &diffopt !~# 'vertical'
+ return 'keepalt '
+ elseif &diffopt =~# 'vertical'
+ return 'keepalt vert '
+ elseif winwidth(0) <= a:count * ((&tw ? &tw : 80) + (empty(fdc) ? 2 : fdc))
+ return 'keepalt '
+ else
+ return 'keepalt vert '
+ endif
+endfunction
+
+function! s:diff_window_count() abort
+ let c = 0
+ for nr in range(1,winnr('$'))
+ let c += getwinvar(nr,'&diff')
+ endfor
+ return c
+endfunction
+
+function! s:diff_restore() abort
+ let restore = 'setlocal nodiff noscrollbind'
+ \ . ' scrollopt=' . &l:scrollopt
+ \ . (&l:wrap ? ' wrap' : ' nowrap')
+ \ . ' foldlevel=999'
+ \ . ' foldmethod=' . &l:foldmethod
+ \ . ' foldcolumn=' . &l:foldcolumn
+ \ . ' foldlevel=' . &l:foldlevel
+ \ . (&l:foldenable ? ' foldenable' : ' nofoldenable')
+ if has('cursorbind')
+ let restore .= (&l:cursorbind ? ' ' : ' no') . 'cursorbind'
+ endif
+ return restore
+endfunction
+
+function! s:diffthis() abort
+ if !&diff
+ let w:fugitive_diff_restore = s:diff_restore()
+ diffthis
+ endif
+endfunction
+
+function! s:diffoff() abort
+ if exists('w:fugitive_diff_restore')
+ execute w:fugitive_diff_restore
+ unlet w:fugitive_diff_restore
+ else
+ diffoff
+ endif
+endfunction
+
+function! s:diffoff_all(dir) abort
+ let curwin = winnr()
+ for nr in range(1,winnr('$'))
+ if getwinvar(nr,'&diff')
+ if nr != winnr()
+ execute nr.'wincmd w'
+ let restorewinnr = 1
+ endif
+ if exists('b:git_dir') && b:git_dir ==# a:dir
+ call s:diffoff()
+ endif
+ endif
+ endfor
+ execute curwin.'wincmd w'
+endfunction
+
+function! s:buffer_compare_age(commit) dict abort
+ let scores = {':0': 1, ':1': 2, ':2': 3, ':': 4, ':3': 5}
+ let my_score = get(scores,':'.self.commit(),0)
+ let their_score = get(scores,':'.a:commit,0)
+ if my_score || their_score
+ return my_score < their_score ? -1 : my_score != their_score
+ elseif self.commit() ==# a:commit
+ return 0
+ endif
+ let base = self.repo().git_chomp('merge-base',self.commit(),a:commit)
+ if base ==# self.commit()
+ return -1
+ elseif base ==# a:commit
+ return 1
+ endif
+ let my_time = +self.repo().git_chomp('log','--max-count=1','--pretty=format:%at',self.commit())
+ let their_time = +self.repo().git_chomp('log','--max-count=1','--pretty=format:%at',a:commit)
+ return my_time < their_time ? -1 : my_time != their_time
+endfunction
+
+call s:add_methods('buffer',['compare_age'])
+
+function! s:Diff(vert,keepfocus,...) abort
+ let args = copy(a:000)
+ let post = ''
+ if get(args, 0) =~# '^+'
+ let post = remove(args, 0)[1:-1]
+ endif
+ let vert = empty(a:vert) ? s:diff_modifier(2) : a:vert
+ if exists(':DiffGitCached')
+ return 'DiffGitCached'
+ elseif (empty(args) || args[0] == ':') && s:buffer().commit() =~# '^[0-1]\=$' && s:repo().git_chomp_in_tree('ls-files', '--unmerged', '--', s:buffer().path()) !=# ''
+ let vert = empty(a:vert) ? s:diff_modifier(3) : a:vert
+ let nr = bufnr('')
+ execute 'leftabove '.vert.'split `=fugitive#buffer().repo().translate(s:buffer().expand('':2''))`'
+ execute 'nnoremap <buffer> <silent> dp :diffput '.nr.'<Bar>diffupdate<CR>'
+ call s:diffthis()
+ wincmd p
+ execute 'rightbelow '.vert.'split `=fugitive#buffer().repo().translate(s:buffer().expand('':3''))`'
+ execute 'nnoremap <buffer> <silent> dp :diffput '.nr.'<Bar>diffupdate<CR>'
+ call s:diffthis()
+ wincmd p
+ call s:diffthis()
+ return post
+ elseif len(args)
+ let arg = join(args, ' ')
+ if arg ==# ''
+ return post
+ elseif arg ==# '/'
+ let file = s:buffer().path('/')
+ elseif arg ==# ':'
+ let file = s:buffer().path(':0:')
+ elseif arg =~# '^:/.'
+ try
+ let file = s:repo().rev_parse(arg).s:buffer().path(':')
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ endtry
+ else
+ let file = s:buffer().expand(arg)
+ endif
+ if file !~# ':' && file !~# '^/' && s:repo().git_chomp('cat-file','-t',file) =~# '^\%(tag\|commit\)$'
+ let file = file.s:buffer().path(':')
+ endif
+ else
+ let file = s:buffer().path(s:buffer().commit() == '' ? ':0:' : '/')
+ endif
+ try
+ let spec = s:repo().translate(file)
+ let commit = matchstr(spec,'\C[^:/]//\zs\x\+')
+ let restore = s:diff_restore()
+ if exists('+cursorbind')
+ setlocal cursorbind
+ endif
+ let w:fugitive_diff_restore = restore
+ if s:buffer().compare_age(commit) < 0
+ execute 'rightbelow '.vert.'diffsplit '.s:fnameescape(spec)
+ else
+ execute 'leftabove '.vert.'diffsplit '.s:fnameescape(spec)
+ endif
+ let &l:readonly = &l:readonly
+ redraw
+ let w:fugitive_diff_restore = restore
+ let winnr = winnr()
+ if getwinvar('#', '&diff')
+ wincmd p
+ if !a:keepfocus
+ call feedkeys(winnr."\<C-W>w", 'n')
+ endif
+ endif
+ return post
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ endtry
+endfunction
+
+" Section: Gmove, Gremove
+
+function! s:Move(force,destination) abort
+ if a:destination =~# '^/'
+ let destination = a:destination[1:-1]
+ else
+ let destination = s:shellslash(fnamemodify(s:sub(a:destination,'[%#]%(:\w)*','\=expand(submatch(0))'),':p'))
+ if destination[0:strlen(s:repo().tree())] ==# s:repo().tree('')
+ let destination = destination[strlen(s:repo().tree('')):-1]
+ endif
+ endif
+ if isdirectory(s:buffer().spec())
+ " Work around Vim parser idiosyncrasy
+ let discarded = s:buffer().setvar('&swapfile',0)
+ endif
+ let message = call(s:repo().git_chomp_in_tree,['mv']+(a:force ? ['-f'] : [])+['--', s:buffer().path(), destination], s:repo())
+ if v:shell_error
+ let v:errmsg = 'fugitive: '.message
+ return 'echoerr v:errmsg'
+ endif
+ let destination = s:repo().tree(destination)
+ if isdirectory(destination)
+ let destination = fnamemodify(s:sub(destination,'/$','').'/'.expand('%:t'),':.')
+ endif
+ call fugitive#reload_status()
+ if s:buffer().commit() == ''
+ if isdirectory(destination)
+ return 'keepalt edit '.s:fnameescape(destination)
+ else
+ return 'keepalt saveas! '.s:fnameescape(destination)
+ endif
+ else
+ return 'file '.s:fnameescape(s:repo().translate(':0:'.destination))
+ endif
+endfunction
+
+function! s:MoveComplete(A,L,P) abort
+ if a:A =~ '^/'
+ return s:repo().superglob(a:A)
+ else
+ let matches = split(glob(a:A.'*'),"\n")
+ call map(matches,'v:val !~ "/$" && isdirectory(v:val) ? v:val."/" : v:val')
+ return matches
+ endif
+endfunction
+
+function! s:Remove(force) abort
+ if s:buffer().commit() ==# ''
+ let cmd = ['rm']
+ elseif s:buffer().commit() ==# '0'
+ let cmd = ['rm','--cached']
+ else
+ let v:errmsg = 'fugitive: rm not supported here'
+ return 'echoerr v:errmsg'
+ endif
+ if a:force
+ let cmd += ['--force']
+ endif
+ let message = call(s:repo().git_chomp_in_tree,cmd+['--',s:buffer().path()],s:repo())
+ if v:shell_error
+ let v:errmsg = 'fugitive: '.s:sub(message,'error:.*\zs\n\(.*-f.*',' (add ! to force)')
+ return 'echoerr '.string(v:errmsg)
+ else
+ call fugitive#reload_status()
+ return 'edit'.(a:force ? '!' : '')
+ endif
+endfunction
+
+augroup fugitive_remove
+ autocmd!
+ autocmd User Fugitive if s:buffer().commit() =~# '^0\=$' |
+ \ exe "command! -buffer -bar -bang -nargs=1 -complete=customlist,s:MoveComplete Gmove :execute s:Move(<bang>0,<q-args>)" |
+ \ exe "command! -buffer -bar -bang Gremove :execute s:Remove(<bang>0)" |
+ \ endif
+augroup END
+
+" Section: Gblame
+
+augroup fugitive_blame
+ autocmd!
+ autocmd BufReadPost *.fugitiveblame setfiletype fugitiveblame
+ autocmd FileType fugitiveblame setlocal nomodeline | if exists('b:git_dir') | let &l:keywordprg = s:repo().keywordprg() | endif
+ autocmd Syntax fugitiveblame call s:BlameSyntax()
+ autocmd User Fugitive if s:buffer().type('file', 'blob') | exe "command! -buffer -bar -bang -range=0 -nargs=* Gblame :execute s:Blame(<bang>0,<line1>,<line2>,<count>,[<f-args>])" | endif
+ autocmd ColorScheme,GUIEnter * call s:RehighlightBlame()
+augroup END
+
+function! s:linechars(pattern) abort
+ let chars = strlen(s:gsub(matchstr(getline('.'), a:pattern), '.', '.'))
+ if exists('*synconcealed') && &conceallevel > 1
+ for col in range(1, chars)
+ let chars -= synconcealed(line('.'), col)[0]
+ endfor
+ endif
+ return chars
+endfunction
+
+function! s:Blame(bang,line1,line2,count,args) abort
+ if exists('b:fugitive_blamed_bufnr')
+ return 'bdelete'
+ endif
+ try
+ if s:buffer().path() == ''
+ call s:throw('file or blob required')
+ endif
+ if filter(copy(a:args),'v:val !~# "^\\%(--root\|--show-name\\|-\\=\\%([ltfnsew]\\|[MC]\\d*\\)\\+\\)$"') != []
+ call s:throw('unsupported option')
+ endif
+ call map(a:args,'s:sub(v:val,"^\\ze[^-]","-")')
+ let cmd = ['--no-pager', 'blame', '--show-number'] + a:args
+ if s:buffer().commit() =~# '\D\|..'
+ let cmd += [s:buffer().commit()]
+ else
+ let cmd += ['--contents', '-']
+ endif
+ let cmd += ['--', s:buffer().path()]
+ let basecmd = escape(call(s:repo().git_command,cmd,s:repo()),'!')
+ try
+ let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+ if !s:repo().bare()
+ let dir = getcwd()
+ execute cd.'`=s:repo().tree()`'
+ endif
+ if a:count
+ execute 'write !'.substitute(basecmd,' blame ',' blame -L '.a:line1.','.a:line2.' ','g')
+ else
+ let error = resolve(tempname())
+ let temp = error.'.fugitiveblame'
+ if &shell =~# 'csh'
+ silent! execute '%write !('.basecmd.' > '.temp.') >& '.error
+ else
+ silent! execute '%write !'.basecmd.' > '.temp.' 2> '.error
+ endif
+ if exists('l:dir')
+ execute cd.'`=dir`'
+ unlet dir
+ endif
+ if v:shell_error
+ call s:throw(join(readfile(error),"\n"))
+ endif
+ for winnr in range(winnr('$'),1,-1)
+ call setwinvar(winnr, '&scrollbind', 0)
+ if exists('+cursorbind')
+ call setwinvar(winnr, '&cursorbind', 0)
+ endif
+ if getbufvar(winbufnr(winnr), 'fugitive_blamed_bufnr')
+ execute winbufnr(winnr).'bdelete'
+ endif
+ endfor
+ let bufnr = bufnr('')
+ let restore = 'call setwinvar(bufwinnr('.bufnr.'),"&scrollbind",0)'
+ if exists('+cursorbind')
+ let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&cursorbind",0)'
+ endif
+ if &l:wrap
+ let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&wrap",1)'
+ endif
+ if &l:foldenable
+ let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&foldenable",1)'
+ endif
+ setlocal scrollbind nowrap nofoldenable
+ if exists('+cursorbind')
+ setlocal cursorbind
+ endif
+ let top = line('w0') + &scrolloff
+ let current = line('.')
+ let s:temp_files[s:cpath(temp)] = { 'dir': s:repo().dir(), 'args': cmd }
+ exe 'keepalt leftabove vsplit '.temp
+ let b:fugitive_blamed_bufnr = bufnr
+ let w:fugitive_leave = restore
+ let b:fugitive_blame_arguments = join(a:args,' ')
+ execute top
+ normal! zt
+ execute current
+ if exists('+cursorbind')
+ setlocal cursorbind
+ endif
+ setlocal nomodified nomodifiable nonumber scrollbind nowrap foldcolumn=0 nofoldenable winfixwidth filetype=fugitiveblame
+ if exists('+concealcursor')
+ setlocal concealcursor=nc conceallevel=2
+ endif
+ if exists('+relativenumber')
+ setlocal norelativenumber
+ endif
+ execute "vertical resize ".(s:linechars('.\{-\}\ze\s\+\d\+)')+1)
+ nnoremap <buffer> <silent> <F1> :help fugitive-:Gblame<CR>
+ nnoremap <buffer> <silent> g? :help fugitive-:Gblame<CR>
+ nnoremap <buffer> <silent> q :exe substitute(bufwinnr(b:fugitive_blamed_bufnr).' wincmd w<Bar>'.bufnr('').'bdelete','^-1','','')<CR>
+ nnoremap <buffer> <silent> gq :exe substitute(bufwinnr(b:fugitive_blamed_bufnr).' wincmd w<Bar>'.bufnr('').'bdelete<Bar>if expand("%:p") =~# "^fugitive:[\\/][\\/]"<Bar>Gedit<Bar>endif','^-1','','')<CR>
+ nnoremap <buffer> <silent> <CR> :<C-U>exe <SID>BlameCommit("exe 'norm q'<Bar>edit")<CR>
+ nnoremap <buffer> <silent> - :<C-U>exe <SID>BlameJump('')<CR>
+ nnoremap <buffer> <silent> P :<C-U>exe <SID>BlameJump('^'.v:count1)<CR>
+ nnoremap <buffer> <silent> ~ :<C-U>exe <SID>BlameJump('~'.v:count1)<CR>
+ nnoremap <buffer> <silent> i :<C-U>exe <SID>BlameCommit("exe 'norm q'<Bar>edit")<CR>
+ nnoremap <buffer> <silent> o :<C-U>exe <SID>BlameCommit((&splitbelow ? "botright" : "topleft")." split")<CR>
+ nnoremap <buffer> <silent> O :<C-U>exe <SID>BlameCommit("tabedit")<CR>
+ nnoremap <buffer> <silent> A :<C-u>exe "vertical resize ".(<SID>linechars('.\{-\}\ze [0-9:/+-][0-9:/+ -]* \d\+)')+1+v:count)<CR>
+ nnoremap <buffer> <silent> C :<C-u>exe "vertical resize ".(<SID>linechars('^\S\+')+1+v:count)<CR>
+ nnoremap <buffer> <silent> D :<C-u>exe "vertical resize ".(<SID>linechars('.\{-\}\ze\d\ze\s\+\d\+)')+1-v:count)<CR>
+ redraw
+ syncbind
+ endif
+ finally
+ if exists('l:dir')
+ execute cd.'`=dir`'
+ endif
+ endtry
+ return ''
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ endtry
+endfunction
+
+function! s:BlameCommit(cmd) abort
+ let cmd = s:Edit(a:cmd, 0, matchstr(getline('.'),'\x\+'))
+ if cmd =~# '^echoerr'
+ return cmd
+ endif
+ let lnum = matchstr(getline('.'),' \zs\d\+\ze\s\+[([:digit:]]')
+ let path = matchstr(getline('.'),'^\^\=\x\+\s\+\zs.\{-\}\ze\s*\d\+ ')
+ if path ==# ''
+ let path = s:buffer(b:fugitive_blamed_bufnr).path()
+ endif
+ execute cmd
+ if search('^diff .* b/\M'.escape(path,'\').'$','W')
+ call search('^+++')
+ let head = line('.')
+ while search('^@@ \|^diff ') && getline('.') =~# '^@@ '
+ let top = +matchstr(getline('.'),' +\zs\d\+')
+ let len = +matchstr(getline('.'),' +\d\+,\zs\d\+')
+ if lnum >= top && lnum <= top + len
+ let offset = lnum - top
+ if &scrolloff
+ +
+ normal! zt
+ else
+ normal! zt
+ +
+ endif
+ while offset > 0 && line('.') < line('$')
+ +
+ if getline('.') =~# '^[ +]'
+ let offset -= 1
+ endif
+ endwhile
+ return 'normal! zv'
+ endif
+ endwhile
+ execute head
+ normal! zt
+ endif
+ return ''
+endfunction
+
+function! s:BlameJump(suffix) abort
+ let commit = matchstr(getline('.'),'^\^\=\zs\x\+')
+ if commit =~# '^0\+$'
+ let commit = ':0'
+ endif
+ let lnum = matchstr(getline('.'),' \zs\d\+\ze\s\+[([:digit:]]')
+ let path = matchstr(getline('.'),'^\^\=\x\+\s\+\zs.\{-\}\ze\s*\d\+ ')
+ if path ==# ''
+ let path = s:buffer(b:fugitive_blamed_bufnr).path()
+ endif
+ let args = b:fugitive_blame_arguments
+ let offset = line('.') - line('w0')
+ let bufnr = bufnr('%')
+ let winnr = bufwinnr(b:fugitive_blamed_bufnr)
+ if winnr > 0
+ exe winnr.'wincmd w'
+ endif
+ execute s:Edit('edit', 0, commit.a:suffix.':'.path)
+ execute lnum
+ if winnr > 0
+ exe bufnr.'bdelete'
+ endif
+ if exists(':Gblame')
+ execute 'Gblame '.args
+ execute lnum
+ let delta = line('.') - line('w0') - offset
+ if delta > 0
+ execute 'normal! '.delta."\<C-E>"
+ elseif delta < 0
+ execute 'normal! '.(-delta)."\<C-Y>"
+ endif
+ syncbind
+ endif
+ return ''
+endfunction
+
+let s:hash_colors = {}
+
+function! s:BlameSyntax() abort
+ let b:current_syntax = 'fugitiveblame'
+ let conceal = has('conceal') ? ' conceal' : ''
+ let arg = exists('b:fugitive_blame_arguments') ? b:fugitive_blame_arguments : ''
+ syn match FugitiveblameBoundary "^\^"
+ syn match FugitiveblameBlank "^\s\+\s\@=" nextgroup=FugitiveblameAnnotation,fugitiveblameOriginalFile,FugitiveblameOriginalLineNumber skipwhite
+ syn match FugitiveblameHash "\%(^\^\=\)\@<=\x\{7,40\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameOriginalLineNumber,fugitiveblameOriginalFile skipwhite
+ syn match FugitiveblameUncommitted "\%(^\^\=\)\@<=0\{7,40\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameOriginalLineNumber,fugitiveblameOriginalFile skipwhite
+ syn region FugitiveblameAnnotation matchgroup=FugitiveblameDelimiter start="(" end="\%( \d\+\)\@<=)" contained keepend oneline
+ syn match FugitiveblameTime "[0-9:/+-][0-9:/+ -]*[0-9:/+-]\%( \+\d\+)\)\@=" contained containedin=FugitiveblameAnnotation
+ exec 'syn match FugitiveblameLineNumber " *\d\+)\@=" contained containedin=FugitiveblameAnnotation'.conceal
+ exec 'syn match FugitiveblameOriginalFile " \%(\f\+\D\@<=\|\D\@=\f\+\)\%(\%(\s\+\d\+\)\=\s\%((\|\s*\d\+)\)\)\@=" contained nextgroup=FugitiveblameOriginalLineNumber,FugitiveblameAnnotation skipwhite'.(arg =~# 'f' ? '' : conceal)
+ exec 'syn match FugitiveblameOriginalLineNumber " *\d\+\%(\s(\)\@=" contained nextgroup=FugitiveblameAnnotation skipwhite'.(arg =~# 'n' ? '' : conceal)
+ exec 'syn match FugitiveblameOriginalLineNumber " *\d\+\%(\s\+\d\+)\)\@=" contained nextgroup=FugitiveblameShort skipwhite'.(arg =~# 'n' ? '' : conceal)
+ syn match FugitiveblameShort " \d\+)" contained contains=FugitiveblameLineNumber
+ syn match FugitiveblameNotCommittedYet "(\@<=Not Committed Yet\>" contained containedin=FugitiveblameAnnotation
+ hi def link FugitiveblameBoundary Keyword
+ hi def link FugitiveblameHash Identifier
+ hi def link FugitiveblameUncommitted Ignore
+ hi def link FugitiveblameTime PreProc
+ hi def link FugitiveblameLineNumber Number
+ hi def link FugitiveblameOriginalFile String
+ hi def link FugitiveblameOriginalLineNumber Float
+ hi def link FugitiveblameShort FugitiveblameDelimiter
+ hi def link FugitiveblameDelimiter Delimiter
+ hi def link FugitiveblameNotCommittedYet Comment
+ let seen = {}
+ for lnum in range(1, line('$'))
+ let hash = matchstr(getline(lnum), '^\^\=\zs\x\{6\}')
+ if hash ==# '' || hash ==# '000000' || has_key(seen, hash)
+ continue
+ endif
+ let seen[hash] = 1
+ if &t_Co > 16 && exists('g:CSApprox_loaded')
+ \ && empty(get(s:hash_colors, hash))
+ let [s, r, g, b; __] = map(matchlist(hash, '\(\x\x\)\(\x\x\)\(\x\x\)'), 'str2nr(v:val,16)')
+ let color = csapprox#per_component#Approximate(r, g, b)
+ if color == 16 && &background ==# 'dark'
+ let color = 8
+ endif
+ let s:hash_colors[hash] = ' ctermfg='.color
+ else
+ let s:hash_colors[hash] = ''
+ endif
+ exe 'syn match FugitiveblameHash'.hash.' "\%(^\^\=\)\@<='.hash.'\x\{1,34\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameOriginalLineNumber,fugitiveblameOriginalFile skipwhite'
+ endfor
+ call s:RehighlightBlame()
+endfunction
+
+function! s:RehighlightBlame() abort
+ for [hash, cterm] in items(s:hash_colors)
+ if !empty(cterm) || has('gui_running')
+ exe 'hi FugitiveblameHash'.hash.' guifg=#'.hash.get(s:hash_colors, hash, '')
+ else
+ exe 'hi link FugitiveblameHash'.hash.' Identifier'
+ endif
+ endfor
+endfunction
+
+" Section: Gbrowse
+
+call s:command("-bar -bang -range=0 -nargs=* -complete=customlist,s:EditComplete Gbrowse :execute s:Browse(<bang>0,<line1>,<count>,<f-args>)")
+
+function! s:Browse(bang,line1,count,...) abort
+ try
+ let validremote = '\.\|\.\=/.*\|[[:alnum:]_-]\+\%(://.\{-\}\)\='
+ if a:0
+ let remote = matchstr(join(a:000, ' '),'@\zs\%('.validremote.'\)$')
+ let rev = substitute(join(a:000, ' '),'@\%('.validremote.'\)$','','')
+ else
+ let remote = ''
+ let rev = ''
+ endif
+ if rev ==# ''
+ let expanded = s:buffer().rev()
+ elseif rev ==# ':'
+ let expanded = s:buffer().path('/')
+ else
+ let expanded = s:buffer().expand(rev)
+ endif
+ let full = s:repo().translate(expanded)
+ let commit = ''
+ if full =~# '^fugitive://'
+ let commit = matchstr(full,'://.*//\zs\w\w\+')
+ let path = matchstr(full,'://.*//\w\+\zs/.*')
+ if commit =~ '..'
+ let type = s:repo().git_chomp('cat-file','-t',commit.s:sub(path,'^/',':'))
+ let branch = matchstr(expanded, '^[^:]*')
+ else
+ let type = 'blob'
+ endif
+ let path = path[1:-1]
+ elseif s:repo().bare()
+ let path = '.git/' . full[strlen(s:repo().dir())+1:-1]
+ let type = ''
+ else
+ let path = full[strlen(s:repo().tree())+1:-1]
+ if path =~# '^\.git/'
+ let type = ''
+ elseif isdirectory(full)
+ let type = 'tree'
+ else
+ let type = 'blob'
+ endif
+ endif
+ if type ==# 'tree' && !empty(path)
+ let path = s:sub(path, '/\=$', '/')
+ endif
+ if path =~# '^\.git/.*HEAD' && filereadable(s:repo().dir(path[5:-1]))
+ let body = readfile(s:repo().dir(path[5:-1]))[0]
+ if body =~# '^\x\{40\}$'
+ let commit = body
+ let type = 'commit'
+ let path = ''
+ elseif body =~# '^ref: refs/'
+ let path = '.git/' . matchstr(body,'ref: \zs.*')
+ endif
+ endif
+
+ let merge = ''
+ if path =~# '^\.git/refs/remotes/.'
+ if empty(remote)
+ let remote = matchstr(path, '^\.git/refs/remotes/\zs[^/]\+')
+ endif
+ let merge = matchstr(path, '^\.git/refs/remotes/[^/]\+/\zs.\+')
+ let branch = ''
+ let path = '.git/refs/heads/'.merge
+ elseif path =~# '^\.git/refs/heads/.'
+ let branch = path[16:-1]
+ elseif !exists('branch')
+ let branch = s:repo().head()
+ endif
+ if !empty(branch)
+ let r = s:repo().git_chomp('config','branch.'.branch.'.remote')
+ let m = s:repo().git_chomp('config','branch.'.branch.'.merge')[11:-1]
+ if r ==# '.' && !empty(m)
+ let r2 = s:repo().git_chomp('config','branch.'.m.'.remote')
+ if r2 !~# '^\.\=$'
+ let r = r2
+ let m = s:repo().git_chomp('config','branch.'.m.'.merge')[11:-1]
+ endif
+ endif
+ if empty(remote)
+ let remote = r
+ endif
+ if r ==# '.' || r ==# remote
+ let merge = m
+ if path =~# '^\.git/refs/heads/.'
+ let path = '.git/refs/heads/'.merge
+ endif
+ endif
+ endif
+
+ if empty(commit) && path !~# '^\.git/'
+ if a:line1 && !a:count && !empty(merge)
+ let commit = merge
+ else
+ let commit = s:repo().rev_parse('HEAD')
+ endif
+ endif
+
+ if empty(remote)
+ let remote = '.'
+ let raw = s:repo().git_chomp('config','remote.origin.url')
+ else
+ let raw = s:repo().git_chomp('config','remote.'.remote.'.url')
+ endif
+ if raw ==# ''
+ let raw = remote
+ endif
+
+ for Handler in g:fugitive_browse_handlers
+ let url = call(Handler, [{
+ \ 'repo': s:repo(),
+ \ 'remote': raw,
+ \ 'revision': 'No longer provided',
+ \ 'commit': commit,
+ \ 'path': path,
+ \ 'type': type,
+ \ 'line1': a:count > 0 ? a:line1 : 0,
+ \ 'line2': a:count > 0 ? a:count : 0}])
+ if !empty(url)
+ break
+ endif
+ endfor
+
+ if empty(url) && raw ==# '.'
+ call s:throw("Instaweb failed to start")
+ elseif empty(url)
+ call s:throw('"'.remote."' is not a supported remote")
+ endif
+
+ let url = s:gsub(url, '[ <>]', '\="%".printf("%02X",char2nr(submatch(0)))')
+ if a:bang
+ if has('clipboard')
+ let @+ = url
+ endif
+ return 'echomsg '.string(url)
+ elseif exists(':Browse') == 2
+ return 'echomsg '.string(url).'|Browse '.url
+ else
+ if !exists('g:loaded_netrw')
+ runtime! autoload/netrw.vim
+ endif
+ if exists('*netrw#BrowseX')
+ return 'echomsg '.string(url).'|call netrw#BrowseX('.string(url).', 0)'
+ else
+ return 'echomsg '.string(url).'|call netrw#NetrwBrowseX('.string(url).', 0)'
+ endif
+ endif
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ endtry
+endfunction
+
+function! s:github_url(opts, ...) abort
+ if a:0 || type(a:opts) != type({})
+ return ''
+ endif
+ let domain_pattern = 'github\.com'
+ let domains = exists('g:fugitive_github_domains') ? g:fugitive_github_domains : []
+ for domain in domains
+ let domain_pattern .= '\|' . escape(split(domain, '://')[-1], '.')
+ endfor
+ let repo = matchstr(get(a:opts, 'remote'), '^\%(https\=://\|git://\|git@\)\=\zs\('.domain_pattern.'\)[/:].\{-\}\ze\%(\.git\)\=$')
+ if repo ==# ''
+ return ''
+ endif
+ let path = substitute(a:opts.path, '^/', '', '')
+ if index(domains, 'http://' . matchstr(repo, '^[^:/]*')) >= 0
+ let root = 'http://' . s:sub(repo,':','/')
+ else
+ let root = 'https://' . s:sub(repo,':','/')
+ endif
+ if path =~# '^\.git/refs/heads/'
+ let branch = a:opts.repo.git_chomp('config','branch.'.path[16:-1].'.merge')[11:-1]
+ if branch ==# ''
+ return root . '/commits/' . path[16:-1]
+ else
+ return root . '/commits/' . branch
+ endif
+ elseif path =~# '^\.git/refs/tags/'
+ return root . '/releases/tag/' . path[15:-1]
+ elseif path =~# '^\.git/refs/remotes/[^/]\+/.'
+ return root . '/commits/' . matchstr(path,'remotes/[^/]\+/\zs.*')
+ elseif path =~# '.git/\%(config$\|hooks\>\)'
+ return root . '/admin'
+ elseif path =~# '^\.git\>'
+ return root
+ endif
+ if a:opts.commit =~# '^\d\=$'
+ let commit = a:opts.repo.rev_parse('HEAD')
+ else
+ let commit = a:opts.commit
+ endif
+ if get(a:opts, 'type', '') ==# 'tree' || a:opts.path =~# '/$'
+ let url = substitute(root . '/tree/' . commit . '/' . path, '/$', '', 'g')
+ elseif get(a:opts, 'type', '') ==# 'blob' || a:opts.path =~# '[^/]$'
+ let url = root . '/blob/' . commit . '/' . path
+ if get(a:opts, 'line2') && a:opts.line1 == a:opts.line2
+ let url .= '#L' . a:opts.line1
+ elseif get(a:opts, 'line2')
+ let url .= '#L' . a:opts.line1 . '-L' . a:opts.line2
+ endif
+ else
+ let url = root . '/commit/' . commit
+ endif
+ return url
+endfunction
+
+function! s:instaweb_url(opts) abort
+ if a:opts.remote !=# '.'
+ return ''
+ endif
+ let output = a:opts.repo.git_chomp('instaweb','-b','unknown')
+ if output =~# 'http://'
+ let root = matchstr(output,'http://.*').'/?p='.fnamemodify(a:opts.repo.dir(),':t')
+ else
+ return ''
+ endif
+ if a:opts.path =~# '^\.git/refs/.'
+ return root . ';a=shortlog;h=' . matchstr(a:opts.path,'^\.git/\zs.*')
+ elseif a:opts.path =~# '^\.git\>'
+ return root
+ endif
+ let url = root
+ if a:opts.commit =~# '^\x\{40\}$'
+ if a:opts.type ==# 'commit'
+ let url .= ';a=commit'
+ endif
+ let url .= ';h=' . a:opts.repo.rev_parse(a:opts.commit . (a:opts.path == '' ? '' : ':' . a:opts.path))
+ else
+ if a:opts.type ==# 'blob' && empty(a:opts.commit)
+ let url .= ';h='.a:opts.repo.git_chomp('hash-object', '-w', a:opts.path)
+ else
+ try
+ let url .= ';h=' . a:opts.repo.rev_parse((a:opts.commit == '' ? 'HEAD' : ':' . a:opts.commit) . ':' . a:opts.path)
+ catch /^fugitive:/
+ call s:throw('fugitive: cannot browse uncommitted file')
+ endtry
+ endif
+ let root .= ';hb=' . matchstr(a:opts.repo.head_ref(),'[^ ]\+$')
+ endif
+ if a:opts.path !=# ''
+ let url .= ';f=' . a:opts.path
+ endif
+ if get(a:opts, 'line1')
+ let url .= '#l' . a:opts.line1
+ endif
+ return url
+endfunction
+
+if !exists('g:fugitive_browse_handlers')
+ let g:fugitive_browse_handlers = []
+endif
+
+call extend(g:fugitive_browse_handlers,
+ \ [s:function('s:github_url'), s:function('s:instaweb_url')])
+
+" Section: File access
+
+function! s:ReplaceCmd(cmd,...) abort
+ let fn = expand('%:p')
+ let tmp = tempname()
+ let prefix = ''
+ try
+ if a:0 && a:1 != ''
+ if s:winshell()
+ let old_index = $GIT_INDEX_FILE
+ let $GIT_INDEX_FILE = a:1
+ else
+ let prefix = 'env GIT_INDEX_FILE='.s:shellesc(a:1).' '
+ endif
+ endif
+ let redir = ' > '.tmp
+ if &shellpipe =~ '2>&1'
+ let redir .= ' 2>&1'
+ endif
+ if s:winshell()
+ let cmd_escape_char = &shellxquote == '(' ? '^' : '^^^'
+ call system('cmd /c "'.prefix.s:gsub(a:cmd,'[<>]', cmd_escape_char.'&').redir.'"')
+ elseif &shell =~# 'fish'
+ call system(' begin;'.prefix.a:cmd.redir.';end ')
+ else
+ call system(' ('.prefix.a:cmd.redir.') ')
+ endif
+ finally
+ if exists('old_index')
+ let $GIT_INDEX_FILE = old_index
+ endif
+ endtry
+ silent exe 'keepalt file '.tmp
+ try
+ silent edit!
+ finally
+ try
+ silent exe 'keepalt file '.s:fnameescape(fn)
+ catch /^Vim\%((\a\+)\)\=:E302/
+ endtry
+ call delete(tmp)
+ if fnamemodify(bufname('$'), ':p') ==# tmp
+ silent execute 'bwipeout '.bufnr('$')
+ endif
+ silent exe 'doau BufReadPost '.s:fnameescape(fn)
+ endtry
+endfunction
+
+function! s:BufReadIndex() abort
+ if !exists('b:fugitive_display_format')
+ let b:fugitive_display_format = filereadable(expand('%').'.lock')
+ endif
+ let b:fugitive_display_format = b:fugitive_display_format % 2
+ let b:fugitive_type = 'index'
+ try
+ let b:git_dir = s:repo().dir()
+ setlocal noro ma nomodeline
+ if fnamemodify($GIT_INDEX_FILE !=# '' ? $GIT_INDEX_FILE : b:git_dir . '/index', ':p') ==# expand('%:p')
+ let index = ''
+ else
+ let index = expand('%:p')
+ endif
+ if b:fugitive_display_format
+ call s:ReplaceCmd(s:repo().git_command('ls-files','--stage'),index)
+ set ft=git nospell
+ else
+ let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd '
+ let dir = getcwd()
+ if fugitive#git_version() =~# '^0\|^1\.[1-7]\.'
+ let cmd = s:repo().git_command('status')
+ else
+ let cmd = s:repo().git_command(
+ \ '-c', 'status.displayCommentPrefix=true',
+ \ '-c', 'color.status=false',
+ \ '-c', 'status.short=false',
+ \ 'status')
+ endif
+ try
+ execute cd.'`=s:repo().tree()`'
+ call s:ReplaceCmd(cmd, index)
+ finally
+ execute cd.'`=dir`'
+ endtry
+ set ft=gitcommit
+ set foldtext=fugitive#foldtext()
+ endif
+ setlocal ro noma nomod noswapfile
+ if &bufhidden ==# ''
+ setlocal bufhidden=delete
+ endif
+ call s:JumpInit()
+ nunmap <buffer> P
+ nunmap <buffer> ~
+ nnoremap <buffer> <silent> <C-N> :<C-U>execute <SID>StageNext(v:count1)<CR>
+ nnoremap <buffer> <silent> <C-P> :<C-U>execute <SID>StagePrevious(v:count1)<CR>
+ nnoremap <buffer> <silent> - :<C-U>silent execute <SID>StageToggle(line('.'),line('.')+v:count1-1)<CR>
+ xnoremap <buffer> <silent> - :<C-U>silent execute <SID>StageToggle(line("'<"),line("'>"))<CR>
+ nnoremap <buffer> <silent> a :<C-U>let b:fugitive_display_format += 1<Bar>exe <SID>BufReadIndex()<CR>
+ nnoremap <buffer> <silent> i :<C-U>let b:fugitive_display_format -= 1<Bar>exe <SID>BufReadIndex()<CR>
+ nnoremap <buffer> <silent> C :<C-U>Gcommit<CR>
+ nnoremap <buffer> <silent> cA :<C-U>Gcommit --amend --reuse-message=HEAD<CR>
+ nnoremap <buffer> <silent> ca :<C-U>Gcommit --amend<CR>
+ nnoremap <buffer> <silent> cc :<C-U>Gcommit<CR>
+ nnoremap <buffer> <silent> cva :<C-U>Gcommit --amend --verbose<CR>
+ nnoremap <buffer> <silent> cvc :<C-U>Gcommit --verbose<CR>
+ nnoremap <buffer> <silent> D :<C-U>execute <SID>StageDiff('Gdiff')<CR>
+ nnoremap <buffer> <silent> dd :<C-U>execute <SID>StageDiff('Gdiff')<CR>
+ nnoremap <buffer> <silent> dh :<C-U>execute <SID>StageDiff('Gsdiff')<CR>
+ nnoremap <buffer> <silent> ds :<C-U>execute <SID>StageDiff('Gsdiff')<CR>
+ nnoremap <buffer> <silent> dp :<C-U>execute <SID>StageDiffEdit()<CR>
+ nnoremap <buffer> <silent> dv :<C-U>execute <SID>StageDiff('Gvdiff')<CR>
+ nnoremap <buffer> <silent> p :<C-U>execute <SID>StagePatch(line('.'),line('.')+v:count1-1)<CR>
+ xnoremap <buffer> <silent> p :<C-U>execute <SID>StagePatch(line("'<"),line("'>"))<CR>
+ nnoremap <buffer> <silent> P :<C-U>execute <SID>StagePatch(line('.'),line('.')+v:count1-1)<CR>
+ xnoremap <buffer> <silent> P :<C-U>execute <SID>StagePatch(line("'<"),line("'>"))<CR>
+ nnoremap <buffer> <silent> q :<C-U>if bufnr('$') == 1<Bar>quit<Bar>else<Bar>bdelete<Bar>endif<CR>
+ nnoremap <buffer> <silent> r :<C-U>edit<CR>
+ nnoremap <buffer> <silent> R :<C-U>edit<CR>
+ nnoremap <buffer> <silent> U :<C-U>execute <SID>StageUndo()<CR>
+ nnoremap <buffer> <silent> g? :help fugitive-:Gstatus<CR>
+ nnoremap <buffer> <silent> <F1> :help fugitive-:Gstatus<CR>
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ endtry
+endfunction
+
+function! s:FileRead() abort
+ try
+ let repo = s:repo(fugitive#extract_git_dir(expand('<amatch>')))
+ let path = s:sub(s:sub(matchstr(expand('<amatch>'),'fugitive://.\{-\}//\zs.*'),'/',':'),'^\d:',':&')
+ let hash = repo.rev_parse(path)
+ if path =~ '^:'
+ let type = 'blob'
+ else
+ let type = repo.git_chomp('cat-file','-t',hash)
+ endif
+ " TODO: use count, if possible
+ return "read !".escape(repo.git_command('cat-file',type,hash),'%#\')
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ endtry
+endfunction
+
+function! s:BufReadIndexFile() abort
+ try
+ let b:fugitive_type = 'blob'
+ let b:git_dir = s:repo().dir()
+ try
+ call s:ReplaceCmd(s:repo().git_command('cat-file','blob',s:buffer().sha1()))
+ finally
+ if &bufhidden ==# ''
+ setlocal bufhidden=delete
+ endif
+ setlocal noswapfile
+ endtry
+ return ''
+ catch /^fugitive: rev-parse/
+ silent exe 'doau BufNewFile '.s:fnameescape(expand('%:p'))
+ return ''
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ endtry
+endfunction
+
+function! s:BufWriteIndexFile() abort
+ let tmp = tempname()
+ try
+ let path = matchstr(expand('<amatch>'),'//\d/\zs.*')
+ let stage = matchstr(expand('<amatch>'),'//\zs\d')
+ silent execute 'write !'.s:repo().git_command('hash-object','-w','--stdin').' > '.tmp
+ let sha1 = readfile(tmp)[0]
+ let old_mode = matchstr(s:repo().git_chomp('ls-files','--stage',path),'^\d\+')
+ if old_mode == ''
+ let old_mode = executable(s:repo().tree(path)) ? '100755' : '100644'
+ endif
+ let info = old_mode.' '.sha1.' '.stage."\t".path
+ call writefile([info],tmp)
+ if s:winshell()
+ let error = system('type '.s:gsub(tmp,'/','\\').'|'.s:repo().git_command('update-index','--index-info'))
+ else
+ let error = system(s:repo().git_command('update-index','--index-info').' < '.tmp)
+ endif
+ if v:shell_error == 0
+ setlocal nomodified
+ if exists('#BufWritePost')
+ execute 'doautocmd BufWritePost '.s:fnameescape(expand('%:p'))
+ endif
+ call fugitive#reload_status()
+ return ''
+ else
+ return 'echoerr '.string('fugitive: '.error)
+ endif
+ finally
+ call delete(tmp)
+ endtry
+endfunction
+
+function! s:BufReadObject() abort
+ try
+ setlocal noro ma
+ let b:git_dir = s:repo().dir()
+ let hash = s:buffer().sha1()
+ if !exists("b:fugitive_type")
+ let b:fugitive_type = s:repo().git_chomp('cat-file','-t',hash)
+ endif
+ if b:fugitive_type !~# '^\%(tag\|commit\|tree\|blob\)$'
+ return "echoerr 'fugitive: unrecognized git type'"
+ endif
+ let firstline = getline('.')
+ if !exists('b:fugitive_display_format') && b:fugitive_type != 'blob'
+ let b:fugitive_display_format = +getbufvar('#','fugitive_display_format')
+ endif
+
+ if b:fugitive_type !=# 'blob'
+ setlocal nomodeline
+ endif
+
+ let pos = getpos('.')
+ silent keepjumps %delete_
+ setlocal endofline
+
+ try
+ if b:fugitive_type ==# 'tree'
+ let b:fugitive_display_format = b:fugitive_display_format % 2
+ if b:fugitive_display_format
+ call s:ReplaceCmd(s:repo().git_command('ls-tree',hash))
+ else
+ call s:ReplaceCmd(s:repo().git_command('show','--no-color',hash))
+ endif
+ elseif b:fugitive_type ==# 'tag'
+ let b:fugitive_display_format = b:fugitive_display_format % 2
+ if b:fugitive_display_format
+ call s:ReplaceCmd(s:repo().git_command('cat-file',b:fugitive_type,hash))
+ else
+ call s:ReplaceCmd(s:repo().git_command('cat-file','-p',hash))
+ endif
+ elseif b:fugitive_type ==# 'commit'
+ let b:fugitive_display_format = b:fugitive_display_format % 2
+ if b:fugitive_display_format
+ call s:ReplaceCmd(s:repo().git_command('cat-file',b:fugitive_type,hash))
+ else
+ call s:ReplaceCmd(s:repo().git_command('show','--no-color','--pretty=format:tree%x20%T%nparent%x20%P%nauthor%x20%an%x20<%ae>%x20%ad%ncommitter%x20%cn%x20<%ce>%x20%cd%nencoding%x20%e%n%n%s%n%n%b',hash))
+ keepjumps call search('^parent ')
+ if getline('.') ==# 'parent '
+ silent keepjumps delete_
+ else
+ silent keepjumps s/\%(^parent\)\@<! /\rparent /ge
+ endif
+ keepjumps let lnum = search('^encoding \%(<unknown>\)\=$','W',line('.')+3)
+ if lnum
+ silent keepjumps delete_
+ end
+ keepjumps 1
+ endif
+ elseif b:fugitive_type ==# 'blob'
+ call s:ReplaceCmd(s:repo().git_command('cat-file',b:fugitive_type,hash))
+ setlocal nomodeline
+ endif
+ finally
+ keepjumps call setpos('.',pos)
+ setlocal ro noma nomod noswapfile
+ if &bufhidden ==# ''
+ setlocal bufhidden=delete
+ endif
+ if b:fugitive_type !=# 'blob'
+ setlocal filetype=git foldmethod=syntax
+ nnoremap <buffer> <silent> a :<C-U>let b:fugitive_display_format += v:count1<Bar>exe <SID>BufReadObject()<CR>
+ nnoremap <buffer> <silent> i :<C-U>let b:fugitive_display_format -= v:count1<Bar>exe <SID>BufReadObject()<CR>
+ else
+ call s:JumpInit()
+ endif
+ endtry
+
+ return ''
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ endtry
+endfunction
+
+augroup fugitive_files
+ autocmd!
+ autocmd BufReadCmd index{,.lock}
+ \ if fugitive#is_git_dir(expand('<amatch>:p:h')) |
+ \ exe s:BufReadIndex() |
+ \ elseif filereadable(expand('<amatch>')) |
+ \ read <amatch> |
+ \ 1delete |
+ \ endif
+ autocmd FileReadCmd fugitive://**//[0-3]/** exe s:FileRead()
+ autocmd BufReadCmd fugitive://**//[0-3]/** exe s:BufReadIndexFile()
+ autocmd BufWriteCmd fugitive://**//[0-3]/** exe s:BufWriteIndexFile()
+ autocmd BufReadCmd fugitive://**//[0-9a-f][0-9a-f]* exe s:BufReadObject()
+ autocmd FileReadCmd fugitive://**//[0-9a-f][0-9a-f]* exe s:FileRead()
+ autocmd FileType git
+ \ if exists('b:git_dir') |
+ \ call s:JumpInit() |
+ \ endif
+ autocmd FileType git,gitcommit,gitrebase
+ \ if exists('b:git_dir') |
+ \ call s:GFInit() |
+ \ endif
+augroup END
+
+" Section: Temp files
+
+if !exists('s:temp_files')
+ let s:temp_files = {}
+endif
+
+augroup fugitive_temp
+ autocmd!
+ autocmd BufNewFile,BufReadPost *
+ \ if has_key(s:temp_files,s:cpath(expand('<afile>:p'))) |
+ \ let b:git_dir = s:temp_files[s:cpath(expand('<afile>:p'))].dir |
+ \ let b:git_type = 'temp' |
+ \ let b:git_args = s:temp_files[s:cpath(expand('<afile>:p'))].args |
+ \ call fugitive#detect(expand('<afile>:p')) |
+ \ setlocal bufhidden=delete nobuflisted |
+ \ nnoremap <buffer> <silent> q :<C-U>bdelete<CR>|
+ \ endif
+augroup END
+
+" Section: Go to file
+
+nnoremap <SID>: :<C-U><C-R>=v:count ? v:count : ''<CR>
+function! s:GFInit(...) abort
+ cnoremap <buffer> <expr> <Plug><cfile> fugitive#cfile()
+ if !exists('g:fugitive_no_maps') && empty(mapcheck('gf', 'n'))
+ nmap <buffer> <silent> gf <SID>:find <Plug><cfile><CR>
+ nmap <buffer> <silent> <C-W>f <SID>:sfind <Plug><cfile><CR>
+ nmap <buffer> <silent> <C-W><C-F> <SID>:sfind <Plug><cfile><CR>
+ nmap <buffer> <silent> <C-W>gf <SID>:tabfind <Plug><cfile><CR>
+ endif
+endfunction
+
+function! s:JumpInit(...) abort
+ nnoremap <buffer> <silent> <CR> :<C-U>exe <SID>GF("edit")<CR>
+ if !&modifiable
+ nnoremap <buffer> <silent> o :<C-U>exe <SID>GF("split")<CR>
+ nnoremap <buffer> <silent> S :<C-U>exe <SID>GF("vsplit")<CR>
+ nnoremap <buffer> <silent> O :<C-U>exe <SID>GF("tabedit")<CR>
+ nnoremap <buffer> <silent> - :<C-U>exe <SID>Edit('edit',0,<SID>buffer().up(v:count1))<Bar> if fugitive#buffer().type('tree')<Bar>call search('^'.escape(expand('#:t'),'.*[]~\').'/\=$','wc')<Bar>endif<CR>
+ nnoremap <buffer> <silent> P :<C-U>exe <SID>Edit('edit',0,<SID>buffer().commit().'^'.v:count1.<SID>buffer().path(':'))<CR>
+ nnoremap <buffer> <silent> ~ :<C-U>exe <SID>Edit('edit',0,<SID>buffer().commit().'~'.v:count1.<SID>buffer().path(':'))<CR>
+ nnoremap <buffer> <silent> C :<C-U>exe <SID>Edit('edit',0,<SID>buffer().containing_commit())<CR>
+ nnoremap <buffer> <silent> cc :<C-U>exe <SID>Edit('edit',0,<SID>buffer().containing_commit())<CR>
+ nnoremap <buffer> <silent> co :<C-U>exe <SID>Edit('split',0,<SID>buffer().containing_commit())<CR>
+ nnoremap <buffer> <silent> cS :<C-U>exe <SID>Edit('vsplit',0,<SID>buffer().containing_commit())<CR>
+ nnoremap <buffer> <silent> cO :<C-U>exe <SID>Edit('tabedit',0,<SID>buffer().containing_commit())<CR>
+ nnoremap <buffer> <silent> cP :<C-U>exe <SID>Edit('pedit',0,<SID>buffer().containing_commit())<CR>
+ nnoremap <buffer> . : <C-R>=fnameescape(<SID>recall())<CR><Home>
+ endif
+endfunction
+
+function! s:cfile() abort
+ try
+ let buffer = s:buffer()
+ let myhash = buffer.sha1()
+ if myhash ==# '' && getline(1) =~# '^\%(commit\|tag\) \w'
+ let myhash = matchstr(getline(1),'^\w\+ \zs\S\+')
+ endif
+
+ if buffer.type('tree')
+ let showtree = (getline(1) =~# '^tree ' && getline(2) == "")
+ if showtree && line('.') > 2
+ return [buffer.commit().':'.s:buffer().path().(buffer.path() =~# '^$\|/$' ? '' : '/').s:sub(getline('.'),'/$','')]
+ elseif getline('.') =~# '^\d\{6\} \l\{3,8\} \x\{40\}\t'
+ return [buffer.commit().':'.s:buffer().path().(buffer.path() =~# '^$\|/$' ? '' : '/').s:sub(matchstr(getline('.'),'\t\zs.*'),'/$','')]
+ endif
+
+ elseif buffer.type('blob')
+ let ref = expand("<cfile>")
+ try
+ let sha1 = buffer.repo().rev_parse(ref)
+ catch /^fugitive:/
+ endtry
+ if exists('sha1')
+ return [ref]
+ endif
+
+ else
+
+ let dcmds = []
+
+ " Index
+ if getline('.') =~# '^\d\{6\} \x\{40\} \d\t'
+ let ref = matchstr(getline('.'),'\x\{40\}')
+ let file = ':'.s:sub(matchstr(getline('.'),'\d\t.*'),'\t',':')
+ return [file]
+
+ elseif getline('.') =~# '^#\trenamed:.* -> '
+ let file = '/'.matchstr(getline('.'),' -> \zs.*')
+ return [file]
+ elseif getline('.') =~# '^#\t\(\k\| \)\+: *.'
+ let file = '/'.matchstr(getline('.'),': *\zs.\{-\}\ze\%( ([^()[:digit:]]\+)\)\=$')
+ return [file]
+ elseif getline('.') =~# '^#\t.'
+ let file = '/'.matchstr(getline('.'),'#\t\zs.*')
+ return [file]
+ elseif getline('.') =~# ': needs merge$'
+ let file = '/'.matchstr(getline('.'),'.*\ze: needs merge$')
+ return [file, 'Gdiff!']
+
+ elseif getline('.') ==# '# Not currently on any branch.'
+ return ['HEAD']
+ elseif getline('.') =~# '^# On branch '
+ let file = 'refs/heads/'.getline('.')[12:]
+ return [file]
+ elseif getline('.') =~# "^# Your branch .*'"
+ let file = matchstr(getline('.'),"'\\zs\\S\\+\\ze'")
+ return [file]
+ endif
+
+ let showtree = (getline(1) =~# '^tree ' && getline(2) == "")
+
+ if getline('.') =~# '^ref: '
+ let ref = strpart(getline('.'),5)
+
+ elseif getline('.') =~# '^commit \x\{40\}\>'
+ let ref = matchstr(getline('.'),'\x\{40\}')
+ return [ref]
+
+ elseif getline('.') =~# '^parent \x\{40\}\>'
+ let ref = matchstr(getline('.'),'\x\{40\}')
+ let line = line('.')
+ let parent = 0
+ while getline(line) =~# '^parent '
+ let parent += 1
+ let line -= 1
+ endwhile
+ return [ref]
+
+ elseif getline('.') =~ '^tree \x\{40\}$'
+ let ref = matchstr(getline('.'),'\x\{40\}')
+ if s:repo().rev_parse(myhash.':') == ref
+ let ref = myhash.':'
+ endif
+ return [ref]
+
+ elseif getline('.') =~# '^object \x\{40\}$' && getline(line('.')+1) =~ '^type \%(commit\|tree\|blob\)$'
+ let ref = matchstr(getline('.'),'\x\{40\}')
+ let type = matchstr(getline(line('.')+1),'type \zs.*')
+
+ elseif getline('.') =~# '^\l\{3,8\} '.myhash.'$'
+ let ref = buffer.rev()
+
+ elseif getline('.') =~# '^\l\{3,8\} \x\{40\}\>'
+ let ref = matchstr(getline('.'),'\x\{40\}')
+ echoerr "warning: unknown context ".matchstr(getline('.'),'^\l*')
+
+ elseif getline('.') =~# '^[+-]\{3\} [ab/]'
+ let ref = getline('.')[4:]
+
+ elseif getline('.') =~# '^[+-]' && search('^@@ -\d\+,\d\+ +\d\+,','bnW')
+ let type = getline('.')[0]
+ let lnum = line('.') - 1
+ let offset = 0
+ while getline(lnum) !~# '^@@ -\d\+,\d\+ +\d\+,'
+ if getline(lnum) =~# '^[ '.type.']'
+ let offset += 1
+ endif
+ let lnum -= 1
+ endwhile
+ let offset += matchstr(getline(lnum), type.'\zs\d\+')
+ let ref = getline(search('^'.type.'\{3\} [ab]/','bnW'))[4:-1]
+ let dcmds = [offset, 'normal!zv']
+
+ elseif getline('.') =~# '^rename from '
+ let ref = 'a/'.getline('.')[12:]
+ elseif getline('.') =~# '^rename to '
+ let ref = 'b/'.getline('.')[10:]
+
+ elseif getline('.') =~# '^@@ -\d\+,\d\+ +\d\+,'
+ let diff = getline(search('^diff --git \%(a/.*\|/dev/null\) \%(b/.*\|/dev/null\)', 'bcnW'))
+ let offset = matchstr(getline('.'), '+\zs\d\+')
+
+ let dref = matchstr(diff, '\Cdiff --git \zs\%(a/.*\|/dev/null\)\ze \%(b/.*\|/dev/null\)')
+ let ref = matchstr(diff, '\Cdiff --git \%(a/.*\|/dev/null\) \zs\%(b/.*\|/dev/null\)')
+ let dcmd = 'Gdiff! +'.offset
+
+ elseif getline('.') =~# '^diff --git \%(a/.*\|/dev/null\) \%(b/.*\|/dev/null\)'
+ let dref = matchstr(getline('.'),'\Cdiff --git \zs\%(a/.*\|/dev/null\)\ze \%(b/.*\|/dev/null\)')
+ let ref = matchstr(getline('.'),'\Cdiff --git \%(a/.*\|/dev/null\) \zs\%(b/.*\|/dev/null\)')
+ let dcmd = 'Gdiff!'
+
+ elseif getline('.') =~# '^index ' && getline(line('.')-1) =~# '^diff --git \%(a/.*\|/dev/null\) \%(b/.*\|/dev/null\)'
+ let line = getline(line('.')-1)
+ let dref = matchstr(line,'\Cdiff --git \zs\%(a/.*\|/dev/null\)\ze \%(b/.*\|/dev/null\)')
+ let ref = matchstr(line,'\Cdiff --git \%(a/.*\|/dev/null\) \zs\%(b/.*\|/dev/null\)')
+ let dcmd = 'Gdiff!'
+
+ elseif line('$') == 1 && getline('.') =~ '^\x\{40\}$'
+ let ref = getline('.')
+
+ elseif expand('<cword>') =~# '^\x\{7,40\}\>'
+ return [expand('<cword>')]
+
+ else
+ let ref = ''
+ endif
+
+ if myhash ==# ''
+ let ref = s:sub(ref,'^a/','HEAD:')
+ let ref = s:sub(ref,'^b/',':0:')
+ if exists('dref')
+ let dref = s:sub(dref,'^a/','HEAD:')
+ endif
+ else
+ let ref = s:sub(ref,'^a/',myhash.'^:')
+ let ref = s:sub(ref,'^b/',myhash.':')
+ if exists('dref')
+ let dref = s:sub(dref,'^a/',myhash.'^:')
+ endif
+ endif
+
+ if ref ==# '/dev/null'
+ " Empty blob
+ let ref = 'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
+ endif
+
+ if exists('dref')
+ return [ref, dcmd . ' ' . s:fnameescape(dref)] + dcmds
+ elseif ref != ""
+ return [ref] + dcmds
+ endif
+
+ endif
+ return []
+ endtry
+endfunction
+
+function! s:GF(mode) abort
+ try
+ let results = s:cfile()
+ catch /^fugitive:/
+ return 'echoerr v:errmsg'
+ endtry
+ if len(results)
+ return s:Edit(a:mode, 0, results[0]).join(map(results[1:-1], '"|".v:val'), '')
+ else
+ return ''
+ endif
+endfunction
+
+function! fugitive#cfile() abort
+ let pre = ''
+ let results = s:cfile()
+ if empty(results)
+ let cfile = expand('<cfile>')
+ if &includeexpr =~# '\<v:fname\>'
+ sandbox let cfile = eval(substitute(&includeexpr, '\C\<v:fname\>', '\=string(cfile)', 'g'))
+ endif
+ return cfile
+ elseif len(results) > 1
+ let pre = '+' . join(map(results[1:-1], 'escape(v:val, " ")'), '\|') . ' '
+ endif
+ return pre . s:fnameescape(fugitive#repo().translate(results[0]))
+endfunction
+
+" Section: Statusline
+
+function! s:repo_head_ref() dict abort
+ if !filereadable(self.dir('HEAD'))
+ return ''
+ endif
+ return readfile(self.dir('HEAD'))[0]
+endfunction
+
+call s:add_methods('repo',['head_ref'])
+
+function! fugitive#statusline(...) abort
+ if !exists('b:git_dir')
+ return ''
+ endif
+ let status = ''
+ if s:buffer().commit() != ''
+ let status .= ':' . s:buffer().commit()[0:7]
+ endif
+ let status .= '('.fugitive#head(7).')'
+ if &statusline =~# '%[MRHWY]' && &statusline !~# '%[mrhwy]'
+ return ',GIT'.status
+ else
+ return '[Git'.status.']'
+ endif
+endfunction
+
+function! fugitive#head(...) abort
+ if !exists('b:git_dir')
+ return ''
+ endif
+
+ return s:repo().head(a:0 ? a:1 : 0)
+endfunction
+
+augroup fugitive_statusline
+ autocmd!
+ autocmd User Flags call Hoist('buffer', function('fugitive#statusline'))
+augroup END
+
+" Section: Folding
+
+function! fugitive#foldtext() abort
+ if &foldmethod !=# 'syntax'
+ return foldtext()
+ elseif getline(v:foldstart) =~# '^diff '
+ let [add, remove] = [-1, -1]
+ let filename = ''
+ for lnum in range(v:foldstart, v:foldend)
+ if filename ==# '' && getline(lnum) =~# '^[+-]\{3\} [abciow12]/'
+ let filename = getline(lnum)[6:-1]
+ endif
+ if getline(lnum) =~# '^+'
+ let add += 1
+ elseif getline(lnum) =~# '^-'
+ let remove += 1
+ elseif getline(lnum) =~# '^Binary '
+ let binary = 1
+ endif
+ endfor
+ if filename ==# ''
+ let filename = matchstr(getline(v:foldstart), '^diff .\{-\} a/\zs.*\ze b/')
+ endif
+ if filename ==# ''
+ let filename = getline(v:foldstart)[5:-1]
+ endif
+ if exists('binary')
+ return 'Binary: '.filename
+ else
+ return (add<10&&remove<100?' ':'') . add . '+ ' . (remove<10&&add<100?' ':'') . remove . '- ' . filename
+ endif
+ elseif getline(v:foldstart) =~# '^# .*:$'
+ let lines = getline(v:foldstart, v:foldend)
+ call filter(lines, 'v:val =~# "^#\t"')
+ cal map(lines,'s:sub(v:val, "^#\t%(modified: +|renamed: +)=", "")')
+ cal map(lines,'s:sub(v:val, "^([[:alpha:] ]+): +(.*)", "\\2 (\\1)")')
+ return getline(v:foldstart).' '.join(lines, ', ')
+ endif
+ return foldtext()
+endfunction
+
+augroup fugitive_foldtext
+ autocmd!
+ autocmd User Fugitive
+ \ if &filetype =~# '^git\%(commit\)\=$' && &foldtext ==# 'foldtext()' |
+ \ set foldtext=fugitive#foldtext() |
+ \ endif
+augroup END
diff --git a/vim/bundle/vim-gitgutter/.gitignore b/vim/bundle/vim-gitgutter/.gitignore
new file mode 100644
index 0000000..82fb253
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/.gitignore
@@ -0,0 +1,5 @@
+/doc/tags
+/misc
+/test/*.actual
+*.log
+
diff --git a/vim/bundle/vim-gitgutter/README.mkd b/vim/bundle/vim-gitgutter/README.mkd
new file mode 100644
index 0000000..6fc92ae
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/README.mkd
@@ -0,0 +1,499 @@
+## vim-gitgutter
+
+A Vim plugin which shows a git diff in the 'gutter' (sign column). It shows whether each line has been added, modified, and where lines have been removed. You can also stage and undo individual hunks.
+
+Features:
+
+* Shows signs for added, modified, and removed lines.
+* Runs the diffs asynchronously in terminal Vim/MacVim (7.4.1826+), gVim (7.4.1850+), MacVim GUI (7.4.1832+), and NeoVim.
+* Ensures signs are always as up to date as possible (but without running more than necessary).
+* Quick jumping between blocks of changed lines ("hunks").
+* Stage/undo/preview individual hunks.
+* Provides a hunk text object.
+* Diffs against index (default) or any commit.
+* Handles line endings correctly, even with repos that do CRLF conversion.
+* Optional line highlighting.
+* Fully customisable (signs, sign column, line highlights, mappings, extra git-diff arguments, etc).
+* Can be toggled on/off.
+* Preserves signs from other plugins.
+* Easy to integrate diff stats into status line; built-in integration with [vim-airline](https://github.com/bling/vim-airline/).
+* Works with fish shell (in addition to the usual shells).
+
+Constraints:
+
+* Supports git only.
+
+If you work with other version control systems, I recommend [vim-signify](https://github.com/mhinz/vim-signify).
+
+
+### Screenshot
+
+![screenshot](https://raw.github.com/airblade/vim-gitgutter/master/screenshot.png)
+
+In the screenshot above you can see:
+
+* Line 15 has been modified.
+* Lines 21-24 are new.
+* A line or lines were removed between lines 25 and 26.
+
+
+### Installation
+
+Before installation, please check your Vim supports signs by running `:echo has('signs')`. `1` means you're all set; `0` means you need to install a Vim with signs support. If you're compiling Vim yourself you need the 'big' or 'huge' feature set. [MacVim][] supports signs.
+
+You install vim-gitgutter like any other vim plugin.
+
+##### Pathogen
+
+```
+cd ~/.vim/bundle
+git clone git://github.com/airblade/vim-gitgutter.git
+```
+
+##### Voom
+
+Edit your plugin manifest (`voom edit`) and add:
+
+```
+airblade/vim-gitgutter
+```
+
+##### VimPlug
+
+Place this in your .vimrc:
+
+```viml
+Plug 'airblade/vim-gitgutter'
+```
+
+Then run the following in Vim:
+
+```
+:source %
+:PlugInstall
+```
+
+##### NeoBundle
+
+Place this in your .vimrc:
+
+```viml
+NeoBundle 'airblade/vim-gitgutter'
+```
+
+Then run the following in Vim:
+
+```
+:source %
+:NeoBundleInstall
+```
+
+##### No plugin manager
+
+Copy vim-gitgutter's subdirectories into your vim configuration directory:
+
+```
+cd /tmp && git clone git://github.com/airblade/vim-gitgutter.git
+cp -r vim-gitgutter/* ~/.vim/
+```
+
+See `:help add-global-plugin`.
+
+
+If you are on Windows you may find the command prompt pops up briefly every time vim-gitgutter runs. You can avoid this by installing both [vim-misc](https://github.com/xolox/vim-misc) and [vim-shell](https://github.com/xolox/vim-shell). If you have those two plugins but don't want vim-gitgutter to use them, you can opt out with `let g:gitgutter_avoid_cmd_prompt_on_windows = 0` in your `~/.vimrc`.
+
+
+### Getting started
+
+When you make a change to a file tracked by git, the diff markers should appear automatically. The delay is governed by vim's `updatetime` option; the default value is 4 seconds but I suggest reducing it to around 250ms (add `set updatetime=250` to your vimrc).
+
+You can jump between hunks with `[c` and `]c`. You can preview, stage, and undo hunks with `<leader>hp`, `<leader>hs`, and `<leader>hu` respectively.
+
+You cannot currently unstage a staged hunk.
+
+
+#### Activation
+
+You can explicitly turn vim-gitgutter off and on (defaults to on):
+
+* turn off with `:GitGutterDisable`
+* turn on with `:GitGutterEnable`
+* toggle with `:GitGutterToggle`.
+
+You can turn the signs on and off (defaults to on):
+
+* turn on with `:GitGutterSignsEnable`
+* turn off with `:GitGutterSignsDisable`
+* toggle with `:GitGutterSignsToggle`.
+
+And you can turn line highlighting on and off (defaults to off):
+
+* turn on with `:GitGutterLineHighlightsEnable`
+* turn off with `:GitGutterLineHighlightsDisable`
+* toggle with `:GitGutterLineHighlightsToggle`.
+
+Note that if you have line highlighting on and signs off, you will have an empty sign column – more accurately, a sign column with invisible signs. This is because line highlighting requires signs and Vim always shows the sign column even if the signs are invisible.
+
+If you switch off both line highlighting and signs, you won't see the sign column. That is unless you have set `let g:gitgutter_sign_column_always = 1` so it's always there.
+
+To keep your Vim snappy, vim-gitgutter will suppress itself when a file has more than 500 changes. As soon as the number of changes falls below the limit vim-gitgutter will show the signs again. You can configure the threshold with:
+
+```viml
+let g:gitgutter_max_signs = 500 " default value
+```
+
+#### Hunks
+
+You can jump between hunks:
+
+* jump to next hunk (change): `]c`
+* jump to previous hunk (change): `[c`.
+
+Both of those take a preceding count.
+
+To set your own mappings for these, for example `]h` and `[h`:
+
+```viml
+nmap ]h <Plug>GitGutterNextHunk
+nmap [h <Plug>GitGutterPrevHunk
+```
+
+You can stage or undo an individual hunk when your cursor is in it:
+
+* stage the hunk with `<Leader>hs` or
+* undo it with `<Leader>hu`.
+
+See the FAQ if you want to unstage staged changes.
+
+The `.` command will work with both these if you install [repeat.vim](https://github.com/tpope/vim-repeat).
+
+To set your own mappings for these, for example if you prefer the mnemonics hunk-add and hunk-revert:
+
+```viml
+nmap <Leader>ha <Plug>GitGutterStageHunk
+nmap <Leader>hr <Plug>GitGutterUndoHunk
+```
+
+And you can preview a hunk's changes with `<Leader>hp`. You can of course change this mapping, e.g:
+
+```viml
+nmap <Leader>hv <Plug>GitGutterPreviewHunk
+```
+
+A hunk text object is provided which works in visual and operator-pending modes.
+
+- `ic` operates on all lines in the current hunk.
+- `ac` operates on all lines in the current hunk and any trailing empty lines.
+
+To re-map these, for example to `ih` and `ah`:
+
+```viml
+omap ih <Plug>GitGutterTextObjectInnerPending
+omap ah <Plug>GitGutterTextObjectOuterPending
+xmap ih <Plug>GitGutterTextObjectInnerVisual
+xmap ah <Plug>GitGutterTextObjectOuterVisual
+```
+
+If you don't want vim-gitgutter to set up any mappings at all, use this:
+
+```viml
+let g:gitgutter_map_keys = 0
+```
+
+Finally, you can force vim-gitgutter to update its signs across all visible buffers with `:GitGutterAll`.
+
+See the customisation section below for how to change the defaults.
+
+
+### When are the signs updated?
+
+By default the signs are updated as follows:
+
+| Event | Reason for update | Configuration |
+|---------------------------|--------------------------------------|------------------------|
+| Stop typing | So the signs are real time | `g:gitgutter_realtime` |
+| Switch buffer | To notice change to git index | `g:gitgutter_eager` |
+| Switch tab | To notice change to git index | `g:gitgutter_eager` |
+| Focus the GUI | To notice change to git index | `g:gitgutter_eager` (not gVim on Windows) |
+| Read a file into a buffer | To display initial signs | [always] |
+| Save a buffer | So non-realtime signs are up to date | [always] |
+| Change a file outside Vim | To notice `git stash` | [always] |
+
+The length of time Vim waits after you stop typing before it triggers the plugin is governed by the setting `updatetime`. This defaults to `4000` milliseconds which is rather too long. I recommend around `250` milliseconds but it depends on your system and your preferences. Note that in terminal Vim pre-7.4.427 an `updatetime` of less than approximately `1000` milliseconds can lead to random highlighting glitches; the lower the `updatetime`, the more glitches.
+
+If you experience a lag, you can trade speed for accuracy:
+
+```viml
+let g:gitgutter_realtime = 0
+let g:gitgutter_eager = 0
+```
+
+Note the realtime updating requires Vim 7.3.105 or higher.
+
+
+### Customisation
+
+You can customise:
+
+* The sign column's colours
+* Whether or not the sign column is shown when there aren't any signs (defaults to no)
+* The signs' colours and symbols
+* Line highlights
+* The base of the diff
+* Extra arguments for `git diff`
+* Key mappings
+* Whether or not vim-gitgutter is on initially (defaults to on)
+* Whether or not signs are shown (defaults to yes)
+* Whether or not line highlighting is on initially (defaults to off)
+* Whether or not vim-gitgutter runs in "realtime" (defaults to yes)
+* Whether or not vim-gitgutter runs eagerly (defaults to yes)
+* Whether or not vim-gitgutter runs asynchronously (defaults to yes)
+
+Please note that vim-gitgutter won't override any colours or highlights you've set in your colorscheme.
+
+
+#### Sign column
+
+By default vim-gitgutter will make the sign column look like the line number column.
+
+To customise your sign column's background color, first tell vim-gitgutter to leave it alone:
+
+```viml
+let g:gitgutter_override_sign_column_highlight = 0
+```
+
+And then either update your colorscheme's `SignColumn` highlight group or set it in your vimrc:
+
+```viml
+highlight SignColumn ctermbg=whatever " terminal Vim
+highlight SignColumn guibg=whatever " gVim/MacVim
+```
+
+By default the sign column will appear when there are signs to show and disappear when there aren't. If you would always like the sign column to be there, add `let g:gitgutter_sign_column_always = 1` to your `~/.vimrc`.
+
+
+#### Signs' colours and symbols
+
+To customise the colours, set up the following highlight groups in your colorscheme or `~/.vimrc`:
+
+```viml
+GitGutterAdd " an added line
+GitGutterChange " a changed line
+GitGutterDelete " at least one removed line
+GitGutterChangeDelete " a changed line followed by at least one removed line
+```
+
+You can either set these with `highlight GitGutterAdd {key}={arg}...` or link them to existing highlight groups with, say, `highlight link GitGutterAdd DiffAdd`.
+
+To customise the symbols, add the following to your `~/.vimrc`:
+
+```viml
+let g:gitgutter_sign_added = 'xx'
+let g:gitgutter_sign_modified = 'yy'
+let g:gitgutter_sign_removed = 'zz'
+let g:gitgutter_sign_removed_first_line = '^^'
+let g:gitgutter_sign_modified_removed = 'ww'
+```
+
+
+#### Line highlights
+
+Similarly to the signs' colours, set up the following highlight groups in your colorscheme or `~/.vimrc`:
+
+```viml
+GitGutterAddLine " default: links to DiffAdd
+GitGutterChangeLine " default: links to DiffChange
+GitGutterDeleteLine " default: links to DiffDelete
+GitGutterChangeDeleteLine " default: links to GitGutterChangeLineDefault, i.e. DiffChange
+```
+
+
+#### The base of the diff
+
+By default buffers are diffed against the index. However you can diff against any commit by setting:
+
+```viml
+let g:gitgutter_diff_base = '<commit SHA>'
+```
+
+
+#### Extra arguments for `git diff`
+
+If you want to pass extra arguments to `git diff`, for example to ignore whitespace, do so like this:
+
+```viml
+let g:gitgutter_diff_args = '-w'
+```
+
+#### Key mappings
+
+To disable all key mappings:
+
+```viml
+let g:gitgutter_map_keys = 0
+```
+
+See above for configuring maps for hunk-jumping and staging/undoing.
+
+
+#### Use a custom `grep` command
+
+If you use an alternative to grep, or your grep does not support the `color` flag, you can tell vim-gitgutter to use it here. It only needs to support extended POSIX regex.
+
+```viml
+" Default:
+let g:gitgutter_grep_command = 'grep --color=never -e'
+```
+
+#### To turn off vim-gitgutter by default
+
+Add `let g:gitgutter_enabled = 0` to your `~/.vimrc`.
+
+
+#### To turn off signs by default
+
+Add `let g:gitgutter_signs = 0` to your `~/.vimrc`.
+
+
+#### To turn on line highlighting by default
+
+Add `let g:gitgutter_highlight_lines = 1` to your `~/.vimrc`.
+
+
+#### To turn off asynchronous updates
+
+By default diffs are run asynchronously. To run diffs synchronously instead:
+
+```viml
+let g:gitgutter_async = 0
+```
+
+
+### Extensions
+
+#### Operate on every line in a hunk
+
+You can map an operator to do whatever you want to every line in a hunk.
+
+Let's say, for example, you want to remove trailing whitespace.
+
+```viml
+function! CleanUp(...)
+ if a:0 " opfunc
+ let [first, last] = [line("'["), line("']")]
+ else
+ let [first, last] = [line("'<"), line("'>")]
+ endif
+ for lnum in range(first, last)
+ let line = getline(lnum)
+
+ " clean up the text, e.g.:
+ let line = substitute(line, '\s\+$', '', '')
+
+ call setline(lnum, line)
+ endfor
+endfunction
+
+nmap <silent> <Leader>x :set opfunc=CleanUp<CR>g@
+```
+
+Then place your cursor in a hunk and type `\xic` (assuming a leader of `\`).
+
+Alternatively you could place your cursor in a hunk, type `vic` to select it, then `:call CleanUp()`.
+
+
+#### Operate on every changed line in a file
+
+You can write a command to do whatever you want to every changed line in a file.
+
+```viml
+function! GlobalChangedLines(ex_cmd)
+ for hunk in GitGutterGetHunks()
+ for lnum in range(hunk[2], hunk[2]+hunk[3]-1)
+ let cursor = getcurpos()
+ silent! execute lnum.a:ex_cmd
+ call setpos('.', cursor)
+ endfor
+ endfor
+endfunction
+
+command -nargs=1 Glines call GlobalChangedLines(<q-args>)
+```
+
+Let's say, for example, you want to remove trailing whitespace from all changed lines:
+
+```viml
+:Glines s/\s\+$//
+```
+
+
+### FAQ
+
+> Why can't I unstage staged changes?
+
+Unstaging staged hunks is feasible but not quite as easy as it sounds. There are three relevant versions of a file at any one time:
+
+1. The version at HEAD in the repo.
+2. The version staged in the index.
+3. The version in the working tree, in your vim buffer.
+
+`git-diff` without arguments shows you how 3 and 2 differ; this is what vim-gitgutter shows too.
+
+`git-diff --staged` shows you how 2 and 1 differ.
+
+Let's say your are looking at a file in vim which has some unstaged changes. Now you stage a hunk, either via vim-gitgutter or another means. The hunk is no longer marked in vim-gitgutter because it is the same in 3 and 2.
+
+Now you want to unstage that hunk. To see it, you need the difference between 2 and 1. For vim-gitgutter to shows those differences, it would need to show you 2 instead of 3 in your vim buffer. But 2 is virtual so vim-gitgutter would need to handle it without touching 3.
+
+I intend to implement this but I can't commit to any deadline.
+
+> Why are the colours in the sign column weird?
+
+Your colorscheme is configuring the `SignColumn` highlight group weirdly. Please see the section above on customising the sign column.
+
+> There's a noticeable lag when vim-gitter runs; how can I avoid it?
+
+By default vim-gitgutter runs often so the signs are as accurate as possible. The delay is governed by `updatetime`; see [above](#when-are-the-signs-updated) for more information.
+
+If you don't want realtime updates and would like to trade a little accuracy for speed, add this to your `~/.vimrc`:
+
+```viml
+let g:gitgutter_realtime = 0
+let g:gitgutter_eager = 0
+```
+
+> What happens if I also use another plugin which uses signs (e.g. Syntastic)?
+
+Vim only allows one sign per line. Before adding a sign to a line, vim-gitgutter checks whether a sign has already been added by somebody else. If so it doesn't do anything. In other words vim-gitgutter won't overwrite another plugin's signs. It also won't remove another plugin's signs.
+
+> Why aren't any signs showing at all?
+
+Here are some things you can check:
+
+* `:echo system("git --version")` succeeds.
+* Your git config is compatible with the version of git returned by the command above.
+* Your Vim supports signs (`:echo has('signs')` should give `1`).
+* Your file is being tracked by git and has unstaged changes.
+* If your grep does not support the `color` flag, add `let g:gitgutter_grep_command = 'grep -e'` to your `~/.vimrc`.
+
+
+### Shameless Plug
+
+If this plugin has helped you, or you'd like to learn more about Vim, why not check out this screencast I wrote for PeepCode:
+
+* [Smash Into Vim][siv]
+
+This was one of PeepCode's all-time top three bestsellers and is now available at Pluralsight.
+
+You can read reviews on my [website][airblade].
+
+
+### Intellectual Property
+
+Copyright Andrew Stewart, AirBlade Software Ltd. Released under the MIT licence.
+
+
+ [pathogen]: https://github.com/tpope/vim-pathogen
+ [siv]: http://pluralsight.com/training/Courses/TableOfContents/smash-into-vim
+ [airblade]: http://airbladesoftware.com/peepcode-vim
+ [macvim]: http://code.google.com/p/macvim/
diff --git a/vim/bundle/vim-gitgutter/autoload/gitgutter.vim b/vim/bundle/vim-gitgutter/autoload/gitgutter.vim
new file mode 100644
index 0000000..3b1770a
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/autoload/gitgutter.vim
@@ -0,0 +1,253 @@
+let s:nomodeline = (v:version > 703 || (v:version == 703 && has('patch442'))) ? '<nomodeline>' : ''
+
+" Primary functions {{{
+
+function! gitgutter#all() abort
+ for buffer_id in tabpagebuflist()
+ let file = expand('#' . buffer_id . ':p')
+ if !empty(file)
+ call gitgutter#process_buffer(buffer_id, 0)
+ endif
+ endfor
+endfunction
+
+" bufnr: (integer) the buffer to process.
+" realtime: (boolean) when truthy, do a realtime diff; otherwise do a disk-based diff.
+function! gitgutter#process_buffer(bufnr, realtime) abort
+ call gitgutter#utility#use_known_shell()
+
+ call gitgutter#utility#set_buffer(a:bufnr)
+ if gitgutter#utility#is_active()
+ if g:gitgutter_sign_column_always
+ call gitgutter#sign#add_dummy_sign()
+ endif
+ try
+ if !a:realtime || gitgutter#utility#has_fresh_changes()
+ let diff = gitgutter#diff#run_diff(a:realtime || gitgutter#utility#has_unsaved_changes(), 0)
+ if diff != 'async'
+ call gitgutter#handle_diff(diff)
+ endif
+ endif
+ catch /diff failed/
+ call gitgutter#debug#log('diff failed')
+ call gitgutter#hunk#reset()
+ endtry
+ execute "silent doautocmd" s:nomodeline "User GitGutter"
+ else
+ call gitgutter#hunk#reset()
+ endif
+
+ call gitgutter#utility#restore_shell()
+endfunction
+
+
+function! gitgutter#handle_diff(diff) abort
+ call gitgutter#debug#log(a:diff)
+
+ call setbufvar(gitgutter#utility#bufnr(), 'gitgutter_tracked', 1)
+
+ call gitgutter#hunk#set_hunks(gitgutter#diff#parse_diff(a:diff))
+ let modified_lines = gitgutter#diff#process_hunks(gitgutter#hunk#hunks())
+
+ if len(modified_lines) > g:gitgutter_max_signs
+ call gitgutter#utility#warn_once('exceeded maximum number of signs (configured by g:gitgutter_max_signs).', 'max_signs')
+ call gitgutter#sign#clear_signs()
+ return
+ endif
+
+ if g:gitgutter_signs || g:gitgutter_highlight_lines
+ call gitgutter#sign#update_signs(modified_lines)
+ endif
+
+ call gitgutter#utility#save_last_seen_change()
+endfunction
+
+function! gitgutter#disable() abort
+ " get list of all buffers (across all tabs)
+ let buflist = []
+ for i in range(tabpagenr('$'))
+ call extend(buflist, tabpagebuflist(i + 1))
+ endfor
+
+ for buffer_id in buflist
+ let file = expand('#' . buffer_id . ':p')
+ if !empty(file)
+ call gitgutter#utility#set_buffer(buffer_id)
+ call gitgutter#sign#clear_signs()
+ call gitgutter#sign#remove_dummy_sign(1)
+ call gitgutter#hunk#reset()
+ endif
+ endfor
+
+ let g:gitgutter_enabled = 0
+endfunction
+
+function! gitgutter#enable() abort
+ let g:gitgutter_enabled = 1
+ call gitgutter#all()
+endfunction
+
+function! gitgutter#toggle() abort
+ if g:gitgutter_enabled
+ call gitgutter#disable()
+ else
+ call gitgutter#enable()
+ endif
+endfunction
+
+" }}}
+
+" Line highlights {{{
+
+function! gitgutter#line_highlights_disable() abort
+ let g:gitgutter_highlight_lines = 0
+ call gitgutter#highlight#define_sign_line_highlights()
+
+ if !g:gitgutter_signs
+ call gitgutter#sign#clear_signs()
+ call gitgutter#sign#remove_dummy_sign(0)
+ endif
+
+ redraw!
+endfunction
+
+function! gitgutter#line_highlights_enable() abort
+ let old_highlight_lines = g:gitgutter_highlight_lines
+
+ let g:gitgutter_highlight_lines = 1
+ call gitgutter#highlight#define_sign_line_highlights()
+
+ if !old_highlight_lines && !g:gitgutter_signs
+ call gitgutter#all()
+ endif
+
+ redraw!
+endfunction
+
+function! gitgutter#line_highlights_toggle() abort
+ if g:gitgutter_highlight_lines
+ call gitgutter#line_highlights_disable()
+ else
+ call gitgutter#line_highlights_enable()
+ endif
+endfunction
+
+" }}}
+
+" Signs {{{
+
+function! gitgutter#signs_enable() abort
+ let old_signs = g:gitgutter_signs
+
+ let g:gitgutter_signs = 1
+ call gitgutter#highlight#define_sign_text_highlights()
+
+ if !old_signs && !g:gitgutter_highlight_lines
+ call gitgutter#all()
+ endif
+endfunction
+
+function! gitgutter#signs_disable() abort
+ let g:gitgutter_signs = 0
+ call gitgutter#highlight#define_sign_text_highlights()
+
+ if !g:gitgutter_highlight_lines
+ call gitgutter#sign#clear_signs()
+ call gitgutter#sign#remove_dummy_sign(0)
+ endif
+endfunction
+
+function! gitgutter#signs_toggle() abort
+ if g:gitgutter_signs
+ call gitgutter#signs_disable()
+ else
+ call gitgutter#signs_enable()
+ endif
+endfunction
+
+" }}}
+
+" Hunks {{{
+
+function! gitgutter#stage_hunk() abort
+ call gitgutter#utility#use_known_shell()
+ if gitgutter#utility#is_active()
+ " Ensure the working copy of the file is up to date.
+ " It doesn't make sense to stage a hunk otherwise.
+ noautocmd silent write
+ let diff = gitgutter#diff#run_diff(0, 1)
+ call gitgutter#handle_diff(diff)
+
+ if empty(gitgutter#hunk#current_hunk())
+ call gitgutter#utility#warn('cursor is not in a hunk')
+ else
+ let diff_for_hunk = gitgutter#diff#generate_diff_for_hunk(diff, 'stage')
+ call gitgutter#utility#system(gitgutter#utility#command_in_directory_of_file(g:gitgutter_git_executable.' apply --cached --unidiff-zero - '), diff_for_hunk)
+
+ " refresh gitgutter's view of buffer
+ silent execute "GitGutter"
+ endif
+
+ silent! call repeat#set("\<Plug>GitGutterStageHunk", -1)<CR>
+ endif
+ call gitgutter#utility#restore_shell()
+endfunction
+
+function! gitgutter#undo_hunk() abort
+ call gitgutter#utility#use_known_shell()
+ if gitgutter#utility#is_active()
+ " Ensure the working copy of the file is up to date.
+ " It doesn't make sense to stage a hunk otherwise.
+ noautocmd silent write
+ let diff = gitgutter#diff#run_diff(0, 1)
+ call gitgutter#handle_diff(diff)
+
+ if empty(gitgutter#hunk#current_hunk())
+ call gitgutter#utility#warn('cursor is not in a hunk')
+ else
+ let diff_for_hunk = gitgutter#diff#generate_diff_for_hunk(diff, 'undo')
+ call gitgutter#utility#system(gitgutter#utility#command_in_directory_of_file(g:gitgutter_git_executable.' apply --reverse --unidiff-zero - '), diff_for_hunk)
+
+ " reload file preserving screen line position
+ let wl = winline()
+ silent edit
+ let offset = wl - winline()
+ execute "normal ".offset."\<C-Y>"
+ endif
+
+ silent! call repeat#set("\<Plug>GitGutterUndoHunk", -1)<CR>
+ endif
+ call gitgutter#utility#restore_shell()
+endfunction
+
+function! gitgutter#preview_hunk() abort
+ call gitgutter#utility#use_known_shell()
+ if gitgutter#utility#is_active()
+ " Ensure the working copy of the file is up to date.
+ " It doesn't make sense to stage a hunk otherwise.
+ noautocmd silent write
+ let diff = gitgutter#diff#run_diff(0, 1)
+ call gitgutter#handle_diff(diff)
+
+ if empty(gitgutter#hunk#current_hunk())
+ call gitgutter#utility#warn('cursor is not in a hunk')
+ else
+ let diff_for_hunk = gitgutter#diff#generate_diff_for_hunk(diff, 'preview')
+
+ silent! wincmd P
+ if !&previewwindow
+ execute 'bo ' . &previewheight . ' new'
+ set previewwindow
+ endif
+
+ setlocal noro modifiable filetype=diff buftype=nofile bufhidden=delete noswapfile
+ execute "%delete_"
+ call append(0, split(diff_for_hunk, "\n"))
+
+ wincmd p
+ endif
+ endif
+ call gitgutter#utility#restore_shell()
+endfunction
+
+" }}}
diff --git a/vim/bundle/vim-gitgutter/autoload/gitgutter/async.vim b/vim/bundle/vim-gitgutter/autoload/gitgutter/async.vim
new file mode 100644
index 0000000..78e725f
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/autoload/gitgutter/async.vim
@@ -0,0 +1,196 @@
+let s:jobs = {}
+
+" Nvim has always supported async commands.
+"
+" Vim introduced async in 7.4.1826.
+"
+" gVim didn't support aync until 7.4.1850 (though I haven't been able to
+" verify this myself).
+"
+" MacVim-GUI didn't support async until 7.4.1832 (actually commit
+" 88f4fe0 but 7.4.1832 was the first subsequent patch release).
+let s:available = has('nvim') || (
+ \ (has('patch-7-4-1826') && !has('gui_running')) ||
+ \ (has('patch-7-4-1850') && has('gui_running')) ||
+ \ (has('patch-7-4-1832') && has('gui_macvim'))
+ \ )
+
+function! gitgutter#async#available()
+ return s:available
+endfunction
+
+function! gitgutter#async#execute(cmd) abort
+ let bufnr = gitgutter#utility#bufnr()
+
+ if has('nvim')
+ if has('unix')
+ let command = ["/bin/sh", "-c", a:cmd]
+ elseif has('win32')
+ let command = ["cmd.exe", "/c", a:cmd]
+ else
+ throw 'unknown os'
+ endif
+ " Make the job use a shell while avoiding (un)quoting problems.
+ let job_id = jobstart(command, {
+ \ 'buffer': bufnr,
+ \ 'on_stdout': function('gitgutter#async#handle_diff_job_nvim'),
+ \ 'on_stderr': function('gitgutter#async#handle_diff_job_nvim'),
+ \ 'on_exit': function('gitgutter#async#handle_diff_job_nvim')
+ \ })
+ call gitgutter#debug#log('[nvim job: '.job_id.', buffer: '.bufnr.'] '.a:cmd)
+ if job_id < 1
+ throw 'diff failed'
+ endif
+
+ " Note that when `cmd` doesn't produce any output, i.e. the diff is empty,
+ " the `stdout` event is not fired on the job handler. Therefore we keep
+ " track of the jobs ourselves so we can spot empty diffs.
+ call s:job_started(job_id)
+
+ else
+ " Make the job use a shell.
+ "
+ " Pass a handler for stdout but not for stderr so that errors are
+ " ignored (and thus signs are not updated; this assumes that an error
+ " only occurs when a file is not tracked by git).
+
+ if has('unix')
+ let command = ["/bin/sh", "-c", a:cmd]
+ elseif has('win32')
+ " Help docs recommend {command} be a string on Windows. But I think
+ " they also say that will run the command directly, which I believe would
+ " mean the redirection and pipe stuff wouldn't work.
+ " let command = "cmd.exe /c ".a:cmd
+ let command = ["cmd.exe", "/c", a:cmd]
+ else
+ throw 'unknown os'
+ endif
+
+ let job = job_start(command, {
+ \ 'out_cb': 'gitgutter#async#handle_diff_job_vim',
+ \ 'close_cb': 'gitgutter#async#handle_diff_job_vim_close'
+ \ })
+ call gitgutter#debug#log('[vim job: '.string(job_info(job)).', buffer: '.bufnr.'] '.a:cmd)
+
+ call s:job_started(s:channel_id(job_getchannel(job)), bufnr)
+ endif
+endfunction
+
+
+function! gitgutter#async#handle_diff_job_nvim(job_id, data, event) abort
+ call gitgutter#debug#log('job_id: '.a:job_id.', event: '.a:event.', buffer: '.self.buffer)
+
+ let current_buffer = gitgutter#utility#bufnr()
+ call gitgutter#utility#set_buffer(self.buffer)
+
+ if a:event == 'stdout'
+ " a:data is a list
+ call s:job_finished(a:job_id)
+ call gitgutter#handle_diff(gitgutter#utility#stringify(a:data))
+
+ elseif a:event == 'exit'
+ " If the exit event is triggered without a preceding stdout event,
+ " the diff was empty.
+ if s:is_job_started(a:job_id)
+ call gitgutter#handle_diff("")
+ call s:job_finished(a:job_id)
+ endif
+
+ else " a:event is stderr
+ call gitgutter#hunk#reset()
+ call s:job_finished(a:job_id)
+
+ endif
+
+ call gitgutter#utility#set_buffer(current_buffer)
+endfunction
+
+
+" Channel is in NL mode.
+function! gitgutter#async#handle_diff_job_vim(channel, line) abort
+ call gitgutter#debug#log('channel: '.a:channel.', line: '.a:line)
+
+ call s:accumulate_job_output(s:channel_id(a:channel), a:line)
+endfunction
+
+function! gitgutter#async#handle_diff_job_vim_close(channel) abort
+ call gitgutter#debug#log('channel: '.a:channel)
+
+ let channel_id = s:channel_id(a:channel)
+
+ let current_buffer = gitgutter#utility#bufnr()
+ call gitgutter#utility#set_buffer(s:job_buffer(channel_id))
+
+ call gitgutter#handle_diff(s:job_output(channel_id))
+ call s:job_finished(channel_id)
+
+ call gitgutter#utility#set_buffer(current_buffer)
+endfunction
+
+
+function! s:channel_id(channel) abort
+ " This seems to be the only way to get info about the channel once closed.
+ return matchstr(a:channel, '\d\+')
+endfunction
+
+
+"
+" Keep track of jobs.
+"
+" nvim: receives all the job's output at once so we don't need to accumulate
+" it ourselves. We can pass the buffer number into the job so we don't need
+" to track that either.
+"
+" s:jobs {} -> key: job's id, value: anything truthy
+"
+" vim: receives the job's output line by line so we need to accumulate it.
+" We also need to keep track of the buffer the job is running for.
+" Vim job's don't have an id. Instead we could use the external process's id
+" or the channel's id (there seems to be 1 channel per job). Arbitrarily
+" choose the channel's id.
+"
+" s:jobs {} -> key: channel's id, value: {} key: output, value: [] job's output
+" key: buffer: value: buffer number
+
+
+" nvim:
+" id: job's id
+"
+" vim:
+" id: channel's id
+" arg: buffer number
+function! s:job_started(id, ...) abort
+ if a:0 " vim
+ let s:jobs[a:id] = {'output': [], 'buffer': a:1}
+ else " nvim
+ let s:jobs[a:id] = 1
+ endif
+endfunction
+
+function! s:is_job_started(id) abort
+ return has_key(s:jobs, a:id)
+endfunction
+
+function! s:accumulate_job_output(id, line) abort
+ call add(s:jobs[a:id].output, a:line)
+endfunction
+
+" Returns a string
+function! s:job_output(id) abort
+ if has_key(s:jobs, a:id)
+ return gitgutter#utility#stringify(s:jobs[a:id].output)
+ else
+ return ""
+ endif
+endfunction
+
+function! s:job_buffer(id) abort
+ return s:jobs[a:id].buffer
+endfunction
+
+function! s:job_finished(id) abort
+ if has_key(s:jobs, a:id)
+ unlet s:jobs[a:id]
+ endif
+endfunction
+
diff --git a/vim/bundle/vim-gitgutter/autoload/gitgutter/debug.vim b/vim/bundle/vim-gitgutter/autoload/gitgutter/debug.vim
new file mode 100644
index 0000000..594f044
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/autoload/gitgutter/debug.vim
@@ -0,0 +1,119 @@
+let s:plugin_dir = expand('<sfile>:p:h:h:h').'/'
+let s:log_file = s:plugin_dir.'gitgutter.log'
+let s:channel_log = s:plugin_dir.'channel.log'
+let s:new_log_session = 1
+
+
+function! gitgutter#debug#debug()
+ " Open a scratch buffer
+ vsplit __GitGutter_Debug__
+ normal! ggdG
+ setlocal buftype=nofile
+ setlocal bufhidden=delete
+ setlocal noswapfile
+
+ call gitgutter#debug#vim_version()
+ call gitgutter#debug#separator()
+
+ call gitgutter#debug#git_version()
+ call gitgutter#debug#separator()
+
+ call gitgutter#debug#grep_version()
+ call gitgutter#debug#separator()
+
+ call gitgutter#debug#option('updatetime')
+ call gitgutter#debug#option('shell')
+ call gitgutter#debug#option('shellcmdflag')
+ call gitgutter#debug#option('shellpipe')
+ call gitgutter#debug#option('shellquote')
+ call gitgutter#debug#option('shellredir')
+ call gitgutter#debug#option('shellslash')
+ call gitgutter#debug#option('shelltemp')
+ call gitgutter#debug#option('shelltype')
+ call gitgutter#debug#option('shellxescape')
+ call gitgutter#debug#option('shellxquote')
+endfunction
+
+
+function! gitgutter#debug#separator()
+ call gitgutter#debug#output('')
+endfunction
+
+function! gitgutter#debug#vim_version()
+ redir => version_info
+ silent execute 'version'
+ redir END
+ call gitgutter#debug#output(split(version_info, '\n')[0:2])
+endfunction
+
+function! gitgutter#debug#git_version()
+ let v = system(g:gitgutter_git_executable.' --version')
+ call gitgutter#debug#output( substitute(v, '\n$', '', '') )
+endfunction
+
+function! gitgutter#debug#grep_version()
+ let v = system('grep --version')
+ call gitgutter#debug#output( substitute(v, '\n$', '', '') )
+
+ let v = system('grep --help')
+ call gitgutter#debug#output( substitute(v, '\%x00', '', 'g') )
+endfunction
+
+function! gitgutter#debug#option(name)
+ if exists('+' . a:name)
+ let v = eval('&' . a:name)
+ call gitgutter#debug#output(a:name . '=' . v)
+ " redir => output
+ " silent execute "verbose set " . a:name . "?"
+ " redir END
+ " call gitgutter#debug#output(a:name . '=' . output)
+ else
+ call gitgutter#debug#output(a:name . ' [n/a]')
+ end
+endfunction
+
+function! gitgutter#debug#output(text)
+ call append(line('$'), a:text)
+endfunction
+
+" assumes optional args are calling function's optional args
+function! gitgutter#debug#log(message, ...) abort
+ if g:gitgutter_log
+ if s:new_log_session && gitgutter#async#available()
+ if exists('*ch_logfile')
+ call ch_logfile(s:channel_log, 'w')
+ endif
+ endif
+
+ execute 'redir >> '.s:log_file
+ if s:new_log_session
+ let s:start = reltime()
+ silent echo "\n==== start log session ===="
+ endif
+
+ let elapsed = reltimestr(reltime(s:start)).' '
+ silent echo ''
+ " callers excluding this function
+ silent echo elapsed.expand('<sfile>')[:-22].':'
+ silent echo elapsed.s:format_for_log(a:message)
+ if a:0 && !empty(a:1)
+ for msg in a:000
+ silent echo elapsed.s:format_for_log(msg)
+ endfor
+ endif
+ redir END
+
+ let s:new_log_session = 0
+ endif
+endfunction
+
+function! s:format_for_log(data) abort
+ if type(a:data) == 1
+ return join(split(a:data,'\n'),"\n")
+ elseif type(a:data) == 3
+ return '['.join(a:data,"\n").']'
+ else
+ return a:data
+ endif
+endfunction
+
diff --git a/vim/bundle/vim-gitgutter/autoload/gitgutter/diff.vim b/vim/bundle/vim-gitgutter/autoload/gitgutter/diff.vim
new file mode 100644
index 0000000..170193b
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/autoload/gitgutter/diff.vim
@@ -0,0 +1,342 @@
+if exists('g:gitgutter_grep_command')
+ let s:grep_available = 1
+ let s:grep_command = g:gitgutter_grep_command
+else
+ let s:grep_available = executable('grep')
+ if s:grep_available
+ let s:grep_command = 'grep --color=never -e'
+ endif
+endif
+let s:hunk_re = '^@@ -\(\d\+\),\?\(\d*\) +\(\d\+\),\?\(\d*\) @@'
+
+let s:c_flag = gitgutter#utility#git_supports_command_line_config_override()
+
+let s:temp_index = tempname()
+let s:temp_buffer = tempname()
+
+" Returns a diff of the buffer.
+"
+" The way to get the diff depends on whether the buffer is saved or unsaved.
+"
+" * Saved: the buffer contents is the same as the file on disk in the working
+" tree so we simply do:
+"
+" git diff myfile
+"
+" * Unsaved: the buffer contents is not the same as the file on disk so we
+" need to pass two instances of the file to git-diff:
+"
+" git diff myfileA myfileB
+"
+" The first instance is the file in the index which we obtain with:
+"
+" git show :myfile > myfileA
+"
+" The second instance is the buffer contents. Ideally we would pass this to
+" git-diff on stdin via the second argument to vim's system() function.
+" Unfortunately git-diff does not do CRLF conversion for input received on
+" stdin, and git-show never performs CRLF conversion, so repos with CRLF
+" conversion report that every line is modified due to mismatching EOLs.
+"
+" Instead, we write the buffer contents to a temporary file - myfileB in this
+" example. Note the file extension must be preserved for the CRLF
+" conversion to work.
+"
+" Before diffing a buffer for the first time, we check whether git knows about
+" the file:
+"
+" git ls-files --error-unmatch myfile
+"
+" After running the diff we pass it through grep where available to reduce
+" subsequent processing by the plugin. If grep is not available the plugin
+" does the filtering instead.
+function! gitgutter#diff#run_diff(realtime, preserve_full_diff) abort
+ " Wrap compound commands in parentheses to make Windows happy.
+ " bash doesn't mind the parentheses.
+ let cmd = '('
+
+ let bufnr = gitgutter#utility#bufnr()
+ let tracked = getbufvar(bufnr, 'gitgutter_tracked') " i.e. tracked by git
+ if !tracked
+ " Don't bother trying to realtime-diff an untracked file.
+ " NOTE: perhaps we should pull this guard up to the caller?
+ if a:realtime
+ throw 'diff failed'
+ else
+ let cmd .= g:gitgutter_git_executable.' ls-files --error-unmatch '.gitgutter#utility#shellescape(gitgutter#utility#filename()).' && ('
+ endif
+ endif
+
+ if a:realtime
+ let blob_name = g:gitgutter_diff_base.':'.gitgutter#utility#shellescape(gitgutter#utility#file_relative_to_repo_root())
+ let blob_file = s:temp_index
+ let buff_file = s:temp_buffer
+ let extension = gitgutter#utility#extension()
+ if !empty(extension)
+ let blob_file .= '.'.extension
+ let buff_file .= '.'.extension
+ endif
+ let cmd .= g:gitgutter_git_executable.' show '.blob_name.' > '.blob_file.' && '
+
+ " Writing the whole buffer resets the '[ and '] marks and also the
+ " 'modified' flag (if &cpoptions includes '+'). These are unwanted
+ " side-effects so we save and restore the values ourselves.
+ let modified = getbufvar(bufnr, "&mod")
+ let op_mark_start = getpos("'[")
+ let op_mark_end = getpos("']")
+
+ execute 'keepalt noautocmd silent write!' buff_file
+
+ call setbufvar(bufnr, "&mod", modified)
+ call setpos("'[", op_mark_start)
+ call setpos("']", op_mark_end)
+ endif
+
+ let cmd .= g:gitgutter_git_executable
+ if s:c_flag
+ let cmd .= ' -c "diff.autorefreshindex=0"'
+ endif
+ let cmd .= ' diff --no-ext-diff --no-color -U0 '.g:gitgutter_diff_args.' '
+
+ if a:realtime
+ let cmd .= ' -- '.blob_file.' '.buff_file
+ else
+ let cmd .= g:gitgutter_diff_base.' -- '.gitgutter#utility#shellescape(gitgutter#utility#filename())
+ endif
+
+ if !a:preserve_full_diff && s:grep_available
+ let cmd .= ' | '.s:grep_command.' '.gitgutter#utility#shellescape('^@@ ')
+ endif
+
+ if (!a:preserve_full_diff && s:grep_available) || a:realtime
+ " grep exits with 1 when no matches are found; diff exits with 1 when
+ " differences are found. However we want to treat non-matches and
+ " differences as non-erroneous behaviour; so we OR the command with one
+ " which always exits with success (0).
+ let cmd .= ' || exit 0'
+ endif
+
+ let cmd .= ')'
+
+ if !tracked
+ let cmd .= ')'
+ endif
+
+ let cmd = gitgutter#utility#command_in_directory_of_file(cmd)
+
+ if g:gitgutter_async && gitgutter#async#available() && !a:preserve_full_diff
+ call gitgutter#async#execute(cmd)
+ return 'async'
+
+ else
+ let diff = gitgutter#utility#system(cmd)
+
+ if gitgutter#utility#shell_error()
+ " A shell error indicates the file is not tracked by git (unless something bizarre is going on).
+ throw 'diff failed'
+ endif
+
+ return diff
+ endif
+endfunction
+
+function! gitgutter#diff#parse_diff(diff) abort
+ let hunks = []
+ for line in split(a:diff, '\n')
+ let hunk_info = gitgutter#diff#parse_hunk(line)
+ if len(hunk_info) == 4
+ call add(hunks, hunk_info)
+ endif
+ endfor
+ return hunks
+endfunction
+
+function! gitgutter#diff#parse_hunk(line) abort
+ let matches = matchlist(a:line, s:hunk_re)
+ if len(matches) > 0
+ let from_line = str2nr(matches[1])
+ let from_count = (matches[2] == '') ? 1 : str2nr(matches[2])
+ let to_line = str2nr(matches[3])
+ let to_count = (matches[4] == '') ? 1 : str2nr(matches[4])
+ return [from_line, from_count, to_line, to_count]
+ else
+ return []
+ end
+endfunction
+
+function! gitgutter#diff#process_hunks(hunks) abort
+ call gitgutter#hunk#reset()
+ let modified_lines = []
+ for hunk in a:hunks
+ call extend(modified_lines, gitgutter#diff#process_hunk(hunk))
+ endfor
+ return modified_lines
+endfunction
+
+" Returns [ [<line_number (number)>, <name (string)>], ...]
+function! gitgutter#diff#process_hunk(hunk) abort
+ let modifications = []
+ let from_line = a:hunk[0]
+ let from_count = a:hunk[1]
+ let to_line = a:hunk[2]
+ let to_count = a:hunk[3]
+
+ if gitgutter#diff#is_added(from_count, to_count)
+ call gitgutter#diff#process_added(modifications, from_count, to_count, to_line)
+ call gitgutter#hunk#increment_lines_added(to_count)
+
+ elseif gitgutter#diff#is_removed(from_count, to_count)
+ call gitgutter#diff#process_removed(modifications, from_count, to_count, to_line)
+ call gitgutter#hunk#increment_lines_removed(from_count)
+
+ elseif gitgutter#diff#is_modified(from_count, to_count)
+ call gitgutter#diff#process_modified(modifications, from_count, to_count, to_line)
+ call gitgutter#hunk#increment_lines_modified(to_count)
+
+ elseif gitgutter#diff#is_modified_and_added(from_count, to_count)
+ call gitgutter#diff#process_modified_and_added(modifications, from_count, to_count, to_line)
+ call gitgutter#hunk#increment_lines_added(to_count - from_count)
+ call gitgutter#hunk#increment_lines_modified(from_count)
+
+ elseif gitgutter#diff#is_modified_and_removed(from_count, to_count)
+ call gitgutter#diff#process_modified_and_removed(modifications, from_count, to_count, to_line)
+ call gitgutter#hunk#increment_lines_modified(to_count)
+ call gitgutter#hunk#increment_lines_removed(from_count - to_count)
+
+ endif
+ return modifications
+endfunction
+
+function! gitgutter#diff#is_added(from_count, to_count) abort
+ return a:from_count == 0 && a:to_count > 0
+endfunction
+
+function! gitgutter#diff#is_removed(from_count, to_count) abort
+ return a:from_count > 0 && a:to_count == 0
+endfunction
+
+function! gitgutter#diff#is_modified(from_count, to_count) abort
+ return a:from_count > 0 && a:to_count > 0 && a:from_count == a:to_count
+endfunction
+
+function! gitgutter#diff#is_modified_and_added(from_count, to_count) abort
+ return a:from_count > 0 && a:to_count > 0 && a:from_count < a:to_count
+endfunction
+
+function! gitgutter#diff#is_modified_and_removed(from_count, to_count) abort
+ return a:from_count > 0 && a:to_count > 0 && a:from_count > a:to_count
+endfunction
+
+function! gitgutter#diff#process_added(modifications, from_count, to_count, to_line) abort
+ let offset = 0
+ while offset < a:to_count
+ let line_number = a:to_line + offset
+ call add(a:modifications, [line_number, 'added'])
+ let offset += 1
+ endwhile
+endfunction
+
+function! gitgutter#diff#process_removed(modifications, from_count, to_count, to_line) abort
+ if a:to_line == 0
+ call add(a:modifications, [1, 'removed_first_line'])
+ else
+ call add(a:modifications, [a:to_line, 'removed'])
+ endif
+endfunction
+
+function! gitgutter#diff#process_modified(modifications, from_count, to_count, to_line) abort
+ let offset = 0
+ while offset < a:to_count
+ let line_number = a:to_line + offset
+ call add(a:modifications, [line_number, 'modified'])
+ let offset += 1
+ endwhile
+endfunction
+
+function! gitgutter#diff#process_modified_and_added(modifications, from_count, to_count, to_line) abort
+ let offset = 0
+ while offset < a:from_count
+ let line_number = a:to_line + offset
+ call add(a:modifications, [line_number, 'modified'])
+ let offset += 1
+ endwhile
+ while offset < a:to_count
+ let line_number = a:to_line + offset
+ call add(a:modifications, [line_number, 'added'])
+ let offset += 1
+ endwhile
+endfunction
+
+function! gitgutter#diff#process_modified_and_removed(modifications, from_count, to_count, to_line) abort
+ let offset = 0
+ while offset < a:to_count
+ let line_number = a:to_line + offset
+ call add(a:modifications, [line_number, 'modified'])
+ let offset += 1
+ endwhile
+ let a:modifications[-1] = [a:to_line + offset - 1, 'modified_removed']
+endfunction
+
+" Generates a zero-context diff for the current hunk.
+"
+" diff - the full diff for the buffer
+" type - stage | undo | preview
+function! gitgutter#diff#generate_diff_for_hunk(diff, type) abort
+ let diff_for_hunk = gitgutter#diff#discard_hunks(a:diff, a:type == 'stage' || a:type == 'undo')
+
+ if a:type == 'stage' || a:type == 'undo'
+ let diff_for_hunk = gitgutter#diff#adjust_hunk_summary(diff_for_hunk, a:type == 'stage')
+ endif
+
+ return diff_for_hunk
+endfunction
+
+" Returns the diff with all hunks discarded except the current.
+"
+" diff - the diff to process
+" keep_header - truthy to keep the diff header and hunk summary, falsy to discard it
+function! gitgutter#diff#discard_hunks(diff, keep_header) abort
+ let modified_diff = []
+ let keep_line = a:keep_header
+ for line in split(a:diff, '\n')
+ let hunk_info = gitgutter#diff#parse_hunk(line)
+ if len(hunk_info) == 4 " start of new hunk
+ let keep_line = gitgutter#hunk#cursor_in_hunk(hunk_info)
+ endif
+ if keep_line
+ call add(modified_diff, line)
+ endif
+ endfor
+
+ if a:keep_header
+ return gitgutter#utility#stringify(modified_diff)
+ else
+ " Discard hunk summary too.
+ return gitgutter#utility#stringify(modified_diff[1:])
+ endif
+endfunction
+
+" Adjust hunk summary (from's / to's line number) to ignore changes above/before this one.
+"
+" diff_for_hunk - a diff containing only the hunk of interest
+" staging - truthy if the hunk is to be staged, falsy if it is to be undone
+"
+" TODO: push this down to #discard_hunks?
+function! gitgutter#diff#adjust_hunk_summary(diff_for_hunk, staging) abort
+ let line_adjustment = gitgutter#hunk#line_adjustment_for_current_hunk()
+ let adj_diff = []
+ for line in split(a:diff_for_hunk, '\n')
+ if match(line, s:hunk_re) != -1
+ if a:staging
+ " increment 'to' line number
+ let line = substitute(line, '+\@<=\(\d\+\)', '\=submatch(1)+line_adjustment', '')
+ else
+ " decrement 'from' line number
+ let line = substitute(line, '-\@<=\(\d\+\)', '\=submatch(1)-line_adjustment', '')
+ endif
+ endif
+ call add(adj_diff, line)
+ endfor
+ return gitgutter#utility#stringify(adj_diff)
+endfunction
+
diff --git a/vim/bundle/vim-gitgutter/autoload/gitgutter/highlight.vim b/vim/bundle/vim-gitgutter/autoload/gitgutter/highlight.vim
new file mode 100644
index 0000000..e3b774b
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/autoload/gitgutter/highlight.vim
@@ -0,0 +1,115 @@
+function! gitgutter#highlight#define_sign_column_highlight() abort
+ if g:gitgutter_override_sign_column_highlight
+ highlight! link SignColumn LineNr
+ else
+ highlight default link SignColumn LineNr
+ endif
+endfunction
+
+function! gitgutter#highlight#define_highlights() abort
+ let [guibg, ctermbg] = gitgutter#highlight#get_background_colors('SignColumn')
+
+ " Highlights used by the signs.
+
+ execute "highlight GitGutterAddDefault guifg=#009900 guibg=" . guibg . " ctermfg=2 ctermbg=" . ctermbg
+ execute "highlight GitGutterChangeDefault guifg=#bbbb00 guibg=" . guibg . " ctermfg=3 ctermbg=" . ctermbg
+ execute "highlight GitGutterDeleteDefault guifg=#ff2222 guibg=" . guibg . " ctermfg=1 ctermbg=" . ctermbg
+ highlight default link GitGutterChangeDeleteDefault GitGutterChangeDefault
+
+ execute "highlight GitGutterAddInvisible guifg=bg guibg=" . guibg . " ctermfg=" . ctermbg . " ctermbg=" . ctermbg
+ execute "highlight GitGutterChangeInvisible guifg=bg guibg=" . guibg . " ctermfg=" . ctermbg . " ctermbg=" . ctermbg
+ execute "highlight GitGutterDeleteInvisible guifg=bg guibg=" . guibg . " ctermfg=" . ctermbg . " ctermbg=" . ctermbg
+ highlight default link GitGutterChangeDeleteInvisible GitGutterChangeInvisble
+
+ highlight default link GitGutterAdd GitGutterAddDefault
+ highlight default link GitGutterChange GitGutterChangeDefault
+ highlight default link GitGutterDelete GitGutterDeleteDefault
+ highlight default link GitGutterChangeDelete GitGutterChangeDeleteDefault
+
+ " Highlights used for the whole line.
+
+ highlight default link GitGutterAddLine DiffAdd
+ highlight default link GitGutterChangeLine DiffChange
+ highlight default link GitGutterDeleteLine DiffDelete
+ highlight default link GitGutterChangeDeleteLine GitGutterChangeLine
+endfunction
+
+function! gitgutter#highlight#define_signs() abort
+ sign define GitGutterLineAdded
+ sign define GitGutterLineModified
+ sign define GitGutterLineRemoved
+ sign define GitGutterLineRemovedFirstLine
+ sign define GitGutterLineModifiedRemoved
+ sign define GitGutterDummy
+
+ call gitgutter#highlight#define_sign_text()
+ call gitgutter#highlight#define_sign_text_highlights()
+ call gitgutter#highlight#define_sign_line_highlights()
+endfunction
+
+function! gitgutter#highlight#define_sign_text() abort
+ execute "sign define GitGutterLineAdded text=" . g:gitgutter_sign_added
+ execute "sign define GitGutterLineModified text=" . g:gitgutter_sign_modified
+ execute "sign define GitGutterLineRemoved text=" . g:gitgutter_sign_removed
+ execute "sign define GitGutterLineRemovedFirstLine text=" . g:gitgutter_sign_removed_first_line
+ execute "sign define GitGutterLineModifiedRemoved text=" . g:gitgutter_sign_modified_removed
+endfunction
+
+function! gitgutter#highlight#define_sign_text_highlights() abort
+ " Once a sign's text attribute has been defined, it cannot be undefined or
+ " set to an empty value. So to make signs' text disappear (when toggling
+ " off or disabling) we make them invisible by setting their foreground colours
+ " to the background's.
+ if g:gitgutter_signs
+ sign define GitGutterLineAdded texthl=GitGutterAdd
+ sign define GitGutterLineModified texthl=GitGutterChange
+ sign define GitGutterLineRemoved texthl=GitGutterDelete
+ sign define GitGutterLineRemovedFirstLine texthl=GitGutterDelete
+ sign define GitGutterLineModifiedRemoved texthl=GitGutterChangeDelete
+ else
+ sign define GitGutterLineAdded texthl=GitGutterAddInvisible
+ sign define GitGutterLineModified texthl=GitGutterChangeInvisible
+ sign define GitGutterLineRemoved texthl=GitGutterDeleteInvisible
+ sign define GitGutterLineRemovedFirstLine texthl=GitGutterDeleteInvisible
+ sign define GitGutterLineModifiedRemoved texthl=GitGutterChangeDeleteInvisible
+ endif
+endfunction
+
+function! gitgutter#highlight#define_sign_line_highlights() abort
+ if g:gitgutter_highlight_lines
+ sign define GitGutterLineAdded linehl=GitGutterAddLine
+ sign define GitGutterLineModified linehl=GitGutterChangeLine
+ sign define GitGutterLineRemoved linehl=GitGutterDeleteLine
+ sign define GitGutterLineRemovedFirstLine linehl=GitGutterDeleteLine
+ sign define GitGutterLineModifiedRemoved linehl=GitGutterChangeDeleteLine
+ else
+ sign define GitGutterLineAdded linehl=
+ sign define GitGutterLineModified linehl=
+ sign define GitGutterLineRemoved linehl=
+ sign define GitGutterLineRemovedFirstLine linehl=
+ sign define GitGutterLineModifiedRemoved linehl=
+ endif
+endfunction
+
+function! gitgutter#highlight#get_background_colors(group) abort
+ redir => highlight
+ silent execute 'silent highlight ' . a:group
+ redir END
+
+ let link_matches = matchlist(highlight, 'links to \(\S\+\)')
+ if len(link_matches) > 0 " follow the link
+ return gitgutter#highlight#get_background_colors(link_matches[1])
+ endif
+
+ let ctermbg = gitgutter#highlight#match_highlight(highlight, 'ctermbg=\([0-9A-Za-z]\+\)')
+ let guibg = gitgutter#highlight#match_highlight(highlight, 'guibg=\([#0-9A-Za-z]\+\)')
+ return [guibg, ctermbg]
+endfunction
+
+function! gitgutter#highlight#match_highlight(highlight, pattern) abort
+ let matches = matchlist(a:highlight, a:pattern)
+ if len(matches) == 0
+ return 'NONE'
+ endif
+ return matches[1]
+endfunction
diff --git a/vim/bundle/vim-gitgutter/autoload/gitgutter/hunk.vim b/vim/bundle/vim-gitgutter/autoload/gitgutter/hunk.vim
new file mode 100644
index 0000000..0fd0246
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/autoload/gitgutter/hunk.vim
@@ -0,0 +1,137 @@
+let s:hunks = []
+
+function! gitgutter#hunk#set_hunks(hunks) abort
+ let s:hunks = a:hunks
+endfunction
+
+function! gitgutter#hunk#hunks() abort
+ return s:hunks
+endfunction
+
+function! gitgutter#hunk#summary(bufnr) abort
+ return get(getbufvar(a:bufnr,''), 'gitgutter_summary', [0,0,0])
+endfunction
+
+function! gitgutter#hunk#reset() abort
+ call setbufvar(gitgutter#utility#bufnr(), 'gitgutter_summary', [0,0,0])
+endfunction
+
+function! gitgutter#hunk#increment_lines_added(count) abort
+ let bufnr = gitgutter#utility#bufnr()
+ let summary = gitgutter#hunk#summary(bufnr)
+ let summary[0] += a:count
+ call setbufvar(bufnr, 'gitgutter_summary', summary)
+endfunction
+
+function! gitgutter#hunk#increment_lines_modified(count) abort
+ let bufnr = gitgutter#utility#bufnr()
+ let summary = gitgutter#hunk#summary(bufnr)
+ let summary[1] += a:count
+ call setbufvar(bufnr, 'gitgutter_summary', summary)
+endfunction
+
+function! gitgutter#hunk#increment_lines_removed(count) abort
+ let bufnr = gitgutter#utility#bufnr()
+ let summary = gitgutter#hunk#summary(bufnr)
+ let summary[2] += a:count
+ call setbufvar(bufnr, 'gitgutter_summary', summary)
+endfunction
+
+function! gitgutter#hunk#next_hunk(count) abort
+ if gitgutter#utility#is_active()
+ let current_line = line('.')
+ let hunk_count = 0
+ for hunk in s:hunks
+ if hunk[2] > current_line
+ let hunk_count += 1
+ if hunk_count == a:count
+ execute 'normal!' hunk[2] . 'G'
+ return
+ endif
+ endif
+ endfor
+ call gitgutter#utility#warn('No more hunks')
+ endif
+endfunction
+
+function! gitgutter#hunk#prev_hunk(count) abort
+ if gitgutter#utility#is_active()
+ let current_line = line('.')
+ let hunk_count = 0
+ for hunk in reverse(copy(s:hunks))
+ if hunk[2] < current_line
+ let hunk_count += 1
+ if hunk_count == a:count
+ let target = hunk[2] == 0 ? 1 : hunk[2]
+ execute 'normal!' target . 'G'
+ return
+ endif
+ endif
+ endfor
+ call gitgutter#utility#warn('No previous hunks')
+ endif
+endfunction
+
+" Returns the hunk the cursor is currently in or an empty list if the cursor
+" isn't in a hunk.
+function! gitgutter#hunk#current_hunk() abort
+ let current_hunk = []
+
+ for hunk in s:hunks
+ if gitgutter#hunk#cursor_in_hunk(hunk)
+ let current_hunk = hunk
+ break
+ endif
+ endfor
+
+ return current_hunk
+endfunction
+
+function! gitgutter#hunk#cursor_in_hunk(hunk) abort
+ let current_line = line('.')
+
+ if current_line == 1 && a:hunk[2] == 0
+ return 1
+ endif
+
+ if current_line >= a:hunk[2] && current_line < a:hunk[2] + (a:hunk[3] == 0 ? 1 : a:hunk[3])
+ return 1
+ endif
+
+ return 0
+endfunction
+
+" Returns the number of lines the current hunk is offset from where it would
+" be if any changes above it in the file didn't exist.
+function! gitgutter#hunk#line_adjustment_for_current_hunk() abort
+ let adj = 0
+ for hunk in s:hunks
+ if gitgutter#hunk#cursor_in_hunk(hunk)
+ break
+ else
+ let adj += hunk[1] - hunk[3]
+ endif
+ endfor
+ return adj
+endfunction
+
+function! gitgutter#hunk#text_object(inner) abort
+ let hunk = gitgutter#hunk#current_hunk()
+
+ if empty(hunk)
+ return
+ endif
+
+ let [first_line, last_line] = [hunk[2], hunk[2] + hunk[3] - 1]
+
+ if ! a:inner
+ let lnum = last_line
+ let eof = line('$')
+ while lnum < eof && empty(getline(lnum + 1))
+ let lnum +=1
+ endwhile
+ let last_line = lnum
+ endif
+
+ execute 'normal! 'first_line.'GV'.last_line.'G'
+endfunction
diff --git a/vim/bundle/vim-gitgutter/autoload/gitgutter/sign.vim b/vim/bundle/vim-gitgutter/autoload/gitgutter/sign.vim
new file mode 100644
index 0000000..6bd5efa
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/autoload/gitgutter/sign.vim
@@ -0,0 +1,173 @@
+" Vim doesn't namespace sign ids so every plugin shares the same
+" namespace. Sign ids are simply integers so to avoid clashes with other
+" signs we guess at a clear run.
+"
+" Note also we currently never reset s:next_sign_id.
+let s:first_sign_id = 3000
+let s:next_sign_id = s:first_sign_id
+let s:dummy_sign_id = s:first_sign_id - 1
+" Remove-all-signs optimisation requires Vim 7.3.596+.
+let s:supports_star = v:version > 703 || (v:version == 703 && has("patch596"))
+
+
+" Removes gitgutter's signs (excluding dummy sign) from the buffer being processed.
+function! gitgutter#sign#clear_signs() abort
+ let bufnr = gitgutter#utility#bufnr()
+ call gitgutter#sign#find_current_signs()
+
+ let sign_ids = map(values(getbufvar(bufnr, 'gitgutter_gitgutter_signs')), 'v:val.id')
+ call gitgutter#sign#remove_signs(sign_ids, 1)
+ call setbufvar(bufnr, 'gitgutter_gitgutter_signs', {})
+endfunction
+
+
+" Updates gitgutter's signs in the buffer being processed.
+"
+" modified_lines: list of [<line_number (number)>, <name (string)>]
+" where name = 'added|removed|modified|modified_removed'
+function! gitgutter#sign#update_signs(modified_lines) abort
+ call gitgutter#sign#find_current_signs()
+
+ let new_gitgutter_signs_line_numbers = map(copy(a:modified_lines), 'v:val[0]')
+ let obsolete_signs = gitgutter#sign#obsolete_gitgutter_signs_to_remove(new_gitgutter_signs_line_numbers)
+
+ let flicker_possible = s:remove_all_old_signs && !empty(a:modified_lines)
+ if flicker_possible
+ call gitgutter#sign#add_dummy_sign()
+ endif
+
+ call gitgutter#sign#remove_signs(obsolete_signs, s:remove_all_old_signs)
+ call gitgutter#sign#upsert_new_gitgutter_signs(a:modified_lines)
+
+ if flicker_possible
+ call gitgutter#sign#remove_dummy_sign(0)
+ endif
+endfunction
+
+
+function! gitgutter#sign#add_dummy_sign() abort
+ let bufnr = gitgutter#utility#bufnr()
+ if !getbufvar(bufnr, 'gitgutter_dummy_sign')
+ execute "sign place" s:dummy_sign_id "line=" . 9999 "name=GitGutterDummy buffer=" . bufnr
+ call setbufvar(bufnr, 'gitgutter_dummy_sign', 1)
+ endif
+endfunction
+
+function! gitgutter#sign#remove_dummy_sign(force) abort
+ let bufnr = gitgutter#utility#bufnr()
+ if getbufvar(bufnr, 'gitgutter_dummy_sign') && (a:force || !g:gitgutter_sign_column_always)
+ execute "sign unplace" s:dummy_sign_id "buffer=" . bufnr
+ call setbufvar(bufnr, 'gitgutter_dummy_sign', 0)
+ endif
+endfunction
+
+
+"
+" Internal functions
+"
+
+
+function! gitgutter#sign#find_current_signs() abort
+ let bufnr = gitgutter#utility#bufnr()
+ let gitgutter_signs = {} " <line_number (string)>: {'id': <id (number)>, 'name': <name (string)>}
+ let other_signs = [] " [<line_number (number),...]
+ let dummy_sign_placed = 0
+
+ redir => signs
+ silent execute "sign place buffer=" . bufnr
+ redir END
+
+ for sign_line in filter(split(signs, '\n')[2:], 'v:val =~# "="')
+ " Typical sign line: line=88 id=1234 name=GitGutterLineAdded
+ " We assume splitting is faster than a regexp.
+ let components = split(sign_line)
+ let name = split(components[2], '=')[1]
+ if name =~# 'GitGutterDummy'
+ let dummy_sign_placed = 1
+ else
+ let line_number = str2nr(split(components[0], '=')[1])
+ if name =~# 'GitGutter'
+ let id = str2nr(split(components[1], '=')[1])
+ " Remove orphaned signs (signs placed on lines which have been deleted).
+ " (When a line is deleted its sign lingers. Subsequent lines' signs'
+ " line numbers are decremented appropriately.)
+ if has_key(gitgutter_signs, line_number)
+ execute "sign unplace" gitgutter_signs[line_number].id
+ endif
+ let gitgutter_signs[line_number] = {'id': id, 'name': name}
+ else
+ call add(other_signs, line_number)
+ endif
+ end
+ endfor
+
+ call setbufvar(bufnr, 'gitgutter_dummy_sign', dummy_sign_placed)
+ call setbufvar(bufnr, 'gitgutter_gitgutter_signs', gitgutter_signs)
+ call setbufvar(bufnr, 'gitgutter_other_signs', other_signs)
+endfunction
+
+
+" Returns a list of [<id (number)>, ...]
+" Sets `s:remove_all_old_signs` as a side-effect.
+function! gitgutter#sign#obsolete_gitgutter_signs_to_remove(new_gitgutter_signs_line_numbers) abort
+ let bufnr = gitgutter#utility#bufnr()
+ let signs_to_remove = [] " list of [<id (number)>, ...]
+ let remove_all_signs = 1
+ let old_gitgutter_signs = getbufvar(bufnr, 'gitgutter_gitgutter_signs')
+ for line_number in keys(old_gitgutter_signs)
+ if index(a:new_gitgutter_signs_line_numbers, str2nr(line_number)) == -1
+ call add(signs_to_remove, old_gitgutter_signs[line_number].id)
+ else
+ let remove_all_signs = 0
+ endif
+ endfor
+ let s:remove_all_old_signs = remove_all_signs
+ return signs_to_remove
+endfunction
+
+
+function! gitgutter#sign#remove_signs(sign_ids, all_signs) abort
+ let bufnr = gitgutter#utility#bufnr()
+ if a:all_signs && s:supports_star && empty(getbufvar(bufnr, 'gitgutter_other_signs'))
+ let dummy_sign_present = getbufvar(bufnr, 'gitgutter_dummy_sign')
+ execute "sign unplace * buffer=" . bufnr
+ if dummy_sign_present
+ execute "sign place" s:dummy_sign_id "line=" . 9999 "name=GitGutterDummy buffer=" . bufnr
+ endif
+ else
+ for id in a:sign_ids
+ execute "sign unplace" id
+ endfor
+ endif
+endfunction
+
+
+function! gitgutter#sign#upsert_new_gitgutter_signs(modified_lines) abort
+ let bufnr = gitgutter#utility#bufnr()
+ let other_signs = getbufvar(bufnr, 'gitgutter_other_signs')
+ let old_gitgutter_signs = getbufvar(bufnr, 'gitgutter_gitgutter_signs')
+
+ for line in a:modified_lines
+ let line_number = line[0] " <number>
+ if index(other_signs, line_number) == -1 " don't clobber others' signs
+ let name = gitgutter#utility#highlight_name_for_change(line[1])
+ if !has_key(old_gitgutter_signs, line_number) " insert
+ let id = gitgutter#sign#next_sign_id()
+ execute "sign place" id "line=" . line_number "name=" . name "buffer=" . bufnr
+ else " update if sign has changed
+ let old_sign = old_gitgutter_signs[line_number]
+ if old_sign.name !=# name
+ execute "sign place" old_sign.id "name=" . name "buffer=" . bufnr
+ end
+ endif
+ endif
+ endfor
+ " At this point b:gitgutter_gitgutter_signs is out of date.
+endfunction
+
+
+function! gitgutter#sign#next_sign_id() abort
+ let next_id = s:next_sign_id
+ let s:next_sign_id += 1
+ return next_id
+endfunction
diff --git a/vim/bundle/vim-gitgutter/autoload/gitgutter/utility.vim b/vim/bundle/vim-gitgutter/autoload/gitgutter/utility.vim
new file mode 100644
index 0000000..3135453
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/autoload/gitgutter/utility.vim
@@ -0,0 +1,199 @@
+let s:file = ''
+let s:using_xolox_shell = -1
+let s:exit_code = 0
+
+function! gitgutter#utility#warn(message) abort
+ echohl WarningMsg
+ echo 'vim-gitgutter: ' . a:message
+ echohl None
+ let v:warningmsg = a:message
+endfunction
+
+function! gitgutter#utility#warn_once(message, key) abort
+ if empty(getbufvar(s:bufnr, a:key))
+ call setbufvar(s:bufnr, a:key, '1')
+ echohl WarningMsg
+ redraw | echo 'vim-gitgutter: ' . a:message
+ echohl None
+ let v:warningmsg = a:message
+ endif
+endfunction
+
+" Returns truthy when the buffer's file should be processed; and falsey when it shouldn't.
+" This function does not and should not make any system calls.
+function! gitgutter#utility#is_active() abort
+ return g:gitgutter_enabled &&
+ \ !pumvisible() &&
+ \ gitgutter#utility#is_file_buffer() &&
+ \ gitgutter#utility#exists_file() &&
+ \ gitgutter#utility#not_git_dir()
+endfunction
+
+function! gitgutter#utility#not_git_dir() abort
+ return gitgutter#utility#full_path_to_directory_of_file() !~ '[/\\]\.git\($\|[/\\]\)'
+endfunction
+
+function! gitgutter#utility#is_file_buffer() abort
+ return empty(getbufvar(s:bufnr, '&buftype'))
+endfunction
+
+" A replacement for the built-in `shellescape(arg)`.
+"
+" Recent versions of Vim handle shell escaping pretty well. However older
+" versions aren't as good. This attempts to do the right thing.
+"
+" See:
+" https://github.com/tpope/vim-fugitive/blob/8f0b8edfbd246c0026b7a2388e1d883d579ac7f6/plugin/fugitive.vim#L29-L37
+function! gitgutter#utility#shellescape(arg) abort
+ if a:arg =~ '^[A-Za-z0-9_/.-]\+$'
+ return a:arg
+ elseif &shell =~# 'cmd' || gitgutter#utility#using_xolox_shell()
+ return '"' . substitute(substitute(a:arg, '"', '""', 'g'), '%', '"%"', 'g') . '"'
+ else
+ return shellescape(a:arg)
+ endif
+endfunction
+
+function! gitgutter#utility#set_buffer(bufnr) abort
+ let s:bufnr = a:bufnr
+ let s:file = resolve(bufname(a:bufnr))
+endfunction
+
+function! gitgutter#utility#bufnr()
+ return s:bufnr
+endfunction
+
+function! gitgutter#utility#file()
+ return s:file
+endfunction
+
+function! gitgutter#utility#filename() abort
+ return fnamemodify(s:file, ':t')
+endfunction
+
+function! gitgutter#utility#extension() abort
+ return fnamemodify(s:file, ':e')
+endfunction
+
+function! gitgutter#utility#full_path_to_directory_of_file() abort
+ return fnamemodify(s:file, ':p:h')
+endfunction
+
+function! gitgutter#utility#directory_of_file() abort
+ return fnamemodify(s:file, ':h')
+endfunction
+
+function! gitgutter#utility#exists_file() abort
+ return filereadable(s:file)
+endfunction
+
+function! gitgutter#utility#has_unsaved_changes() abort
+ return getbufvar(s:bufnr, "&mod")
+endfunction
+
+function! gitgutter#utility#has_fresh_changes() abort
+ return getbufvar(s:bufnr, 'changedtick') != getbufvar(s:bufnr, 'gitgutter_last_tick')
+endfunction
+
+function! gitgutter#utility#save_last_seen_change() abort
+ call setbufvar(s:bufnr, 'gitgutter_last_tick', getbufvar(s:bufnr, 'changedtick'))
+endfunction
+
+function! gitgutter#utility#shell_error() abort
+ return gitgutter#utility#using_xolox_shell() ? s:exit_code : v:shell_error
+endfunction
+
+function! gitgutter#utility#using_xolox_shell() abort
+ if s:using_xolox_shell == -1
+ if !g:gitgutter_avoid_cmd_prompt_on_windows
+ let s:using_xolox_shell = 0
+ " Although xolox/vim-shell works on both windows and unix we only want to use
+ " it on windows.
+ elseif has('win32') || has('win64') || has('win32unix')
+ let s:using_xolox_shell = exists('g:xolox#misc#version') && exists('g:xolox#shell#version')
+ else
+ let s:using_xolox_shell = 0
+ endif
+ endif
+ return s:using_xolox_shell
+endfunction
+
+function! gitgutter#utility#system(cmd, ...) abort
+ call gitgutter#debug#log(a:cmd, a:000)
+
+ if gitgutter#utility#using_xolox_shell()
+ let options = {'command': a:cmd, 'check': 0}
+ if a:0 > 0
+ let options['stdin'] = a:1
+ endif
+ let ret = xolox#misc#os#exec(options)
+ let output = join(ret.stdout, "\n")
+ let s:exit_code = ret.exit_code
+ else
+ silent let output = (a:0 == 0) ? system(a:cmd) : system(a:cmd, a:1)
+ endif
+ return output
+endfunction
+
+function! gitgutter#utility#file_relative_to_repo_root() abort
+ let file_path_relative_to_repo_root = getbufvar(s:bufnr, 'gitgutter_repo_relative_path')
+ if empty(file_path_relative_to_repo_root)
+ let dir_path_relative_to_repo_root = gitgutter#utility#system(gitgutter#utility#command_in_directory_of_file(g:gitgutter_git_executable.' rev-parse --show-prefix'))
+ let dir_path_relative_to_repo_root = gitgutter#utility#strip_trailing_new_line(dir_path_relative_to_repo_root)
+ let file_path_relative_to_repo_root = dir_path_relative_to_repo_root . gitgutter#utility#filename()
+ call setbufvar(s:bufnr, 'gitgutter_repo_relative_path', file_path_relative_to_repo_root)
+ endif
+ return file_path_relative_to_repo_root
+endfunction
+
+function! gitgutter#utility#command_in_directory_of_file(cmd) abort
+ return 'cd '.gitgutter#utility#shellescape(gitgutter#utility#directory_of_file()).' && '.a:cmd
+endfunction
+
+function! gitgutter#utility#highlight_name_for_change(text) abort
+ if a:text ==# 'added'
+ return 'GitGutterLineAdded'
+ elseif a:text ==# 'removed'
+ return 'GitGutterLineRemoved'
+ elseif a:text ==# 'removed_first_line'
+ return 'GitGutterLineRemovedFirstLine'
+ elseif a:text ==# 'modified'
+ return 'GitGutterLineModified'
+ elseif a:text ==# 'modified_removed'
+ return 'GitGutterLineModifiedRemoved'
+ endif
+endfunction
+
+function! gitgutter#utility#strip_trailing_new_line(line) abort
+ return substitute(a:line, '\n$', '', '')
+endfunction
+
+function! gitgutter#utility#git_version() abort
+ return matchstr(system(g:gitgutter_git_executable.' --version'), '[0-9.]\+')
+endfunction
+
+" True for git v1.7.2+.
+function! gitgutter#utility#git_supports_command_line_config_override() abort
+ let [major, minor, patch; _] = split(gitgutter#utility#git_version(), '\.')
+ return major > 1 || (major == 1 && minor > 7) || (minor == 7 && patch > 1)
+endfunction
+
+function! gitgutter#utility#stringify(list) abort
+ return join(a:list, "\n")."\n"
+endfunction
+
+function! gitgutter#utility#use_known_shell() abort
+ if has('unix')
+ let s:shell = &shell
+ let s:shellcmdflag = &shellcmdflag
+ set shell=/bin/sh
+ set shellcmdflag=-c
+ endif
+endfunction
+
+function! gitgutter#utility#restore_shell() abort
+ if has('unix')
+ let &shell = s:shell
+ let &shellcmdflag = s:shellcmdflag
+ endif
+endfunction
diff --git a/vim/bundle/vim-gitgutter/doc/gitgutter.txt b/vim/bundle/vim-gitgutter/doc/gitgutter.txt
new file mode 100644
index 0000000..d4bb774
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/doc/gitgutter.txt
@@ -0,0 +1,340 @@
+*gitgutter.txt* A Vim plugin which shows a git diff in the gutter.
+
+
+ Vim Git Gutter
+
+
+Author: Andy Stewart <http://airbladesoftware.com/>
+Plugin Homepage: <https://github.com/airblade/vim-gitgutter>
+
+===============================================================================
+CONTENTS *GitGutterContents*
+
+ 1. Introduction ................. |GitGutterIntroduction|
+ 2. Installation ................. |GitGutterInstallation|
+ 3. Usage ........................ |GitGutterUsage|
+ 4. Commands ..................... |GitGutterCommands|
+ 5. Autocommand .................. |GitGutterAutocmd|
+ 6. CUSTOMISATION................. |GitGutterCustomisation|
+ 7. FAQ .......................... |GitGutterFAQ|
+
+===============================================================================
+1. INTRODUCTION *GitGutterIntroduction*
+ *GitGutter*
+
+Vim Git Gutter is a Vim plugin which shows a git diff in the 'gutter' (sign
+column). It shows whether each line has been added, modified, and where lines
+have been removed.
+
+This is a port of the Git Gutter plugin for Sublime Text 2.
+
+===============================================================================
+2. INSTALLATION *GitGutterInstallation*
+
+* Pathogen:
+>
+ cd ~/.vim/bundle
+ git clone git://github.com/airblade/vim-gitgutter.git
+<
+* Voom:
+
+Edit your plugin manifest (`voom edit`) and add:
+>
+ airblade/vim-gitgutter
+<
+* VimPlug:
+
+Place this in your .vimrc:
+>
+ Plug 'airblade/vim-gitgutter'
+<
+Then run the following in Vim:
+>
+ :source %
+ :PlugInstall
+<
+* NeoBundle:
+
+Place this in your .vimrc:
+>
+ NeoBundle 'airblade/vim-gitgutter'
+<
+Then run the following in Vim:
+>
+ :source %
+ :NeoBundleInstall
+<
+* No plugin manager:
+
+Copy vim-gitgutter's subdirectories into your vim configuration directory:
+>
+ cd tmp && git clone git://github.com/airblade/vim-gitgutter.git
+ cp vim-gitgutter/* ~/.vim/
+<
+See |add-global-plugin|.
+
+===============================================================================
+3. USAGE *GitGutterUsage*
+
+You don't have to do anything: it just works.
+
+===============================================================================
+4. COMMANDS *GitGutterCommands*
+
+Commands for turning Git Gutter on and off:
+
+ :GitGutterDisable *:GitGutterDisable*
+ Explicitly turn Git Gutter off.
+
+ :GitGutterEnable *:GitGutterEnable*
+ Explicitly turn Git Gutter on.
+
+ :GitGutterToggle *:GitGutterToggle*
+ Explicitly turn Git Gutter on if it was off and vice versa.
+
+ :GitGutter *:GitGutter*
+ Update signs for the current buffer.
+
+ :GitGutterAll *:GitGutterAll*
+ Update signs across all buffers.
+
+Commands for turning signs on and off (defaults to on):
+
+ :GitGutterSignsEnable *:GitGutterSignsEnable*
+ Explicitly turn line signs on.
+
+ :GitGutterSignsDisable *:GitGutterSignsDisable*
+ Explicitly turn line signs off.
+
+ :GitGutterSignsToggle *:GitGutterSignsToggle*
+ Explicitly turn line signs on if it was off and vice versa.
+
+Commands for turning line highlighting on and off (defaults to off):
+
+ :GitGutterLineHighlightsEnable *:GitGutterLineHighlightsEnable*
+ Explicitly turn line highlighting on.
+
+ :GitGutterLineHighlightsDisable *:GitGutterLineHighlightsDisable*
+ Explicitly turn line highlighting off.
+
+ :GitGutterLineHighlightsToggle *:GitGutterLineHighlightsToggle*
+ Explicitly turn line highlighting on if it was off and vice versa.
+
+Commands for jumping between marked hunks:
+
+ :GitGutterNextHunk *:GitGutterNextHunk*
+ Jump to the next marked hunk. Takes a count.
+
+ :GitGutterPrevHunk *:GitGutterPrevHunk*
+ Jump to the previous marked hunk. Takes a count.
+
+Commands for staging or undoing individual hunks:
+
+ :GitGutterStageHunk *:GitGutterStageHunk*
+ Stage the hunk the cursor is in.
+
+ :GitGutterUndoHunk *:GitGutterUndoHunk*
+ Undo the hunk the cursor is in.
+
+ :GitGutterPreviewHunk *:GitGutterPreviewHunk*
+ Preview the hunk the cursor is in.
+
+===============================================================================
+5. AUTOCOMMAND *GitGutterAutocmd*
+
+After updating a buffer's signs vim-gitgutter fires a |User| |autocmd| with the
+event GitGutter. You can listen for this event, for example:
+>
+ autocmd User GitGutter call updateMyStatusLine()
+<
+
+===============================================================================
+6. CUSTOMISATION *GitGutterCustomisation*
+
+You can customise:
+
+- The sign column's colours
+- The signs' colours and symbols
+- Line highlights
+- The base of the diff
+- Extra arguments for git-diff
+- Key mappings
+- The grep executable used
+- Whether or not vim-gitgutter is on initially (defaults to on)
+- Whether or not signs are shown (defaults to yes)
+- Whether or not line highlighting is on initially (defaults to off)
+- Whether or not vim-gitgutter runs in realtime (defaults to yes)
+- Whether or not vim-gitgutter runs eagerly (defaults to yes)
+- Whether or not vim-gitgutter runs asynchronously (defaults to yes)
+
+Please note that vim-gitgutter won't override any colours or highlights you've
+set in your colorscheme.
+
+SIGN COLUMN
+
+By default vim-gitgutter will make the sign column look like the line number
+column (i.e. the |hl-LineNr| highlight group).
+
+To customise your sign column's background color, first tell vim-gitgutter to
+leave it alone:
+>
+ let g:gitgutter_override_sign_column_highlight = 0
+<
+
+And then either update your colorscheme's |hlSignColumn| highlight group or set
+it in your |vimrc|:
+
+ Desired appearance Command ~
+ Same as line number column highlight clear SignColumn
+ User-defined (terminal Vim) highlight SignColumn ctermbg={whatever}
+ User-defined (graphical Vim) highlight SignColumn guibg={whatever}
+
+SIGNS' COLOURS AND SYMBOLS
+
+To customise the colours, set up the following highlight groups in your
+colorscheme or |vimrc|:
+
+>
+ GitGutterAdd " an added line
+ GitGutterChange " a changed line
+ GitGutterDelete " at least one removed line
+ GitGutterChangeDelete " a changed line followed by at least one removed line
+<
+
+You can either set these with `highlight GitGutterAdd {key}={arg}...` or link
+them to existing highlight groups with, say:
+>
+ highlight link GitGutterAdd DiffAdd
+<
+
+To customise the symbols, add the following to your |vimrc|:
+>
+ let g:gitgutter_sign_added = 'xx'
+ let g:gitgutter_sign_modified = 'yy'
+ let g:gitgutter_sign_removed = 'zz'
+ let g:gitgutter_sign_modified_removed = 'ww'
+<
+
+LINE HIGHLIGHTS
+
+Similarly to the signs' colours, set up the following highlight groups in your
+colorscheme or |vimrc|:
+>
+ GitGutterAddLine " default: links to DiffAdd
+ GitGutterChangeLine " default: links to DiffChange
+ GitGutterDeleteLine " default: links to DiffDelete
+ GitGutterChangeDeleteLine " default: links to GitGutterChangeLineDefault
+<
+
+THE BASE OF THE DIFF
+
+By default buffers are diffed against the index. To diff against a commit
+instead:
+>
+ let g:gitgutter_diff_base = '<commit SHA>'
+<
+
+EXTRA ARGUMENTS FOR GIT-DIFF
+
+To pass extra arguments to git-diff, add this to your |vimrc|:
+>
+ let g:gitgutter_diff_args = '-w'
+<
+
+KEY MAPPINGS
+
+To disable all key maps:
+>
+ let g:gitgutter_map_keys = 0
+<
+
+To change the hunk-jumping maps (defaults shown):
+>
+ nmap [c <Plug>GitGutterPrevHunk
+ nmap ]c <Plug>GitGutterNextHunk
+<
+
+To change the hunk-staging/undoing/previewing maps (defaults shown):
+>
+ nmap <Leader>hs <Plug>GitGutterStageHunk
+ nmap <Leader>hu <Plug>GitGutterUndoHunk
+ nmap <Leader>hp <Plug>GitGutterPreviewHunk
+<
+
+To change the hunk text object maps (defaults shown):
+>
+ omap ic <Plug>GitGutterTextObjectInnerPending
+ omap ac <Plug>GitGutterTextObjectOuterPending
+ xmap ic <Plug>GitGutterTextObjectInnerVisual
+ xmap ac <Plug>GitGutterTextObjectOuterVisual
+<
+
+TO USE A CUSTOM GREP COMMAND
+
+To use a custom invocation for grep, use this:
+>
+ let g:gitgutter_grep_command = 'grep --color=never -e'
+<
+
+TO TURN OFF VIM-GITGUTTER BY DEFAULT
+
+Add to your |vimrc|
+>
+ let g:gitgutter_enabled = 0
+<
+
+TO TURN OFF SIGNS BY DEFAULT
+
+Add to your |vimrc|
+>
+ let g:gitgutter_signs = 0
+<
+
+Note that the sign column will still be present if you have line highlighting
+switched on.
+
+TO TURN ON LINE HIGHLIGHTING BY DEFAULT
+
+Add to your |vimrc|
+>
+ let g:gitgutter_highlight_lines = 1
+<
+
+TO STOP VIM-GITGUTTER RUNNING IN REALTIME
+
+Add to your |vimrc|
+>
+ let g:gitgutter_realtime = 0
+<
+
+TO STOP VIM-GITGUTTER RUNNING EAGERLY
+
+Add to your |vimrc|
+>
+ let g:gitgutter_eager = 0
+<
+
+TO TURN OFF ASYNCHRONOUS UPDATES
+
+By default diffs are run asynchronously. To run diffs synchronously
+instead:
+
+Add to your |vimrc|
+>
+let g:gitgutter_async = 0
+<
+
+===============================================================================
+7. FAQ *GitGutterFAQ*
+
+a. Why are the colours in the sign column weird?
+
+ Your colorscheme is configuring the |hl-SignColumn| highlight group weirdly.
+ Please see |GitGutterCustomisation| on customising the sign column.
+
+b. What happens if I also use another plugin which uses signs (e.g. Syntastic)?
+
+ Vim only allows one sign per line. Before adding a sign to a line,
+ vim-gitgutter checks whether a sign has already been added by somebody else.
+ If so it doesn't do anything. In other words vim-gitgutter won't overwrite
+ another plugin's signs. It also won't remove another plugin's signs.
diff --git a/vim/bundle/vim-gitgutter/plugin/gitgutter.vim b/vim/bundle/vim-gitgutter/plugin/gitgutter.vim
new file mode 100644
index 0000000..ff87a0a
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/plugin/gitgutter.vim
@@ -0,0 +1,224 @@
+scriptencoding utf-8
+
+if exists('g:loaded_gitgutter') || !has('signs') || &cp
+ finish
+endif
+let g:loaded_gitgutter = 1
+
+" Initialisation {{{
+
+" Realtime sign updates require Vim 7.3.105+.
+if v:version < 703 || (v:version == 703 && !has("patch105"))
+ let g:gitgutter_realtime = 0
+endif
+
+" Eager updates require gettabvar()/settabvar().
+if !exists("*gettabvar")
+ let g:gitgutter_eager = 0
+endif
+
+function! s:set(var, default) abort
+ if !exists(a:var)
+ if type(a:default)
+ execute 'let' a:var '=' string(a:default)
+ else
+ execute 'let' a:var '=' a:default
+ endif
+ endif
+endfunction
+
+call s:set('g:gitgutter_enabled', 1)
+call s:set('g:gitgutter_max_signs', 500)
+call s:set('g:gitgutter_signs', 1)
+call s:set('g:gitgutter_highlight_lines', 0)
+call s:set('g:gitgutter_sign_column_always', 0)
+call s:set('g:gitgutter_override_sign_column_highlight', 1)
+call s:set('g:gitgutter_realtime', 1)
+call s:set('g:gitgutter_eager', 1)
+call s:set('g:gitgutter_sign_added', '+')
+call s:set('g:gitgutter_sign_modified', '~')
+call s:set('g:gitgutter_sign_removed', '_')
+try
+ call s:set('g:gitgutter_sign_removed_first_line', '‾')
+catch /E239/
+ let g:gitgutter_sign_removed_first_line = '_^'
+endtry
+
+call s:set('g:gitgutter_sign_modified_removed', '~_')
+call s:set('g:gitgutter_diff_args', '')
+call s:set('g:gitgutter_diff_base', '')
+call s:set('g:gitgutter_map_keys', 1)
+call s:set('g:gitgutter_avoid_cmd_prompt_on_windows', 1)
+call s:set('g:gitgutter_async', 1)
+call s:set('g:gitgutter_log', 0)
+call s:set('g:gitgutter_git_executable', 'git')
+
+if !executable(g:gitgutter_git_executable)
+ call gitgutter#utility#warn('cannot find git. Please set g:gitgutter_git_executable.')
+endif
+
+call gitgutter#highlight#define_sign_column_highlight()
+call gitgutter#highlight#define_highlights()
+call gitgutter#highlight#define_signs()
+
+" }}}
+
+" Primary functions {{{
+
+command -bar GitGutterAll call gitgutter#all()
+command -bar GitGutter call gitgutter#process_buffer(bufnr(''), 0)
+
+command -bar GitGutterDisable call gitgutter#disable()
+command -bar GitGutterEnable call gitgutter#enable()
+command -bar GitGutterToggle call gitgutter#toggle()
+
+" }}}
+
+" Line highlights {{{
+
+command -bar GitGutterLineHighlightsDisable call gitgutter#line_highlights_disable()
+command -bar GitGutterLineHighlightsEnable call gitgutter#line_highlights_enable()
+command -bar GitGutterLineHighlightsToggle call gitgutter#line_highlights_toggle()
+
+" }}}
+
+" Signs {{{
+
+command -bar GitGutterSignsEnable call gitgutter#signs_enable()
+command -bar GitGutterSignsDisable call gitgutter#signs_disable()
+command -bar GitGutterSignsToggle call gitgutter#signs_toggle()
+
+" }}}
+
+" Hunks {{{
+
+command -bar -count=1 GitGutterNextHunk call gitgutter#hunk#next_hunk(<count>)
+command -bar -count=1 GitGutterPrevHunk call gitgutter#hunk#prev_hunk(<count>)
+
+command -bar GitGutterStageHunk call gitgutter#stage_hunk()
+command -bar GitGutterUndoHunk call gitgutter#undo_hunk()
+command -bar GitGutterRevertHunk echomsg 'GitGutterRevertHunk is deprecated. Use GitGutterUndoHunk'<Bar>call gitgutter#undo_hunk()
+command -bar GitGutterPreviewHunk call gitgutter#preview_hunk()
+
+" Hunk text object
+onoremap <silent> <Plug>GitGutterTextObjectInnerPending :<C-U>call gitgutter#hunk#text_object(1)<CR>
+onoremap <silent> <Plug>GitGutterTextObjectOuterPending :<C-U>call gitgutter#hunk#text_object(0)<CR>
+xnoremap <silent> <Plug>GitGutterTextObjectInnerVisual :<C-U>call gitgutter#hunk#text_object(1)<CR>
+xnoremap <silent> <Plug>GitGutterTextObjectOuterVisual :<C-U>call gitgutter#hunk#text_object(0)<CR>
+
+
+" Returns the git-diff hunks for the file or an empty list if there
+" aren't any hunks.
+"
+" The return value is a list of lists. There is one inner list per hunk.
+"
+" [
+" [from_line, from_count, to_line, to_count],
+" [from_line, from_count, to_line, to_count],
+" ...
+" ]
+"
+" where:
+"
+" `from` - refers to the staged file
+" `to` - refers to the working tree's file
+" `line` - refers to the line number where the change starts
+" `count` - refers to the number of lines the change covers
+function! GitGutterGetHunks()
+ return gitgutter#utility#is_active() ? gitgutter#hunk#hunks() : []
+endfunction
+
+" Returns an array that contains a summary of the hunk status for the current
+" window. The format is [ added, modified, removed ], where each value
+" represents the number of lines added/modified/removed respectively.
+function! GitGutterGetHunkSummary()
+ return gitgutter#hunk#summary(winbufnr(0))
+endfunction
+
+" }}}
+
+command -bar GitGutterDebug call gitgutter#debug#debug()
+
+" Maps {{{
+
+nnoremap <silent> <expr> <Plug>GitGutterNextHunk &diff ? ']c' : ":\<C-U>execute v:count1 . 'GitGutterNextHunk'\<CR>"
+nnoremap <silent> <expr> <Plug>GitGutterPrevHunk &diff ? '[c' : ":\<C-U>execute v:count1 . 'GitGutterPrevHunk'\<CR>"
+
+if g:gitgutter_map_keys
+ if !hasmapto('<Plug>GitGutterPrevHunk') && maparg('[c', 'n') ==# ''
+ nmap [c <Plug>GitGutterPrevHunk
+ endif
+ if !hasmapto('<Plug>GitGutterNextHunk') && maparg(']c', 'n') ==# ''
+ nmap ]c <Plug>GitGutterNextHunk
+ endif
+endif
+
+
+nnoremap <silent> <Plug>GitGutterStageHunk :GitGutterStageHunk<CR>
+nnoremap <silent> <Plug>GitGutterUndoHunk :GitGutterUndoHunk<CR>
+nnoremap <silent> <Plug>GitGutterPreviewHunk :GitGutterPreviewHunk<CR>
+
+if g:gitgutter_map_keys
+ if !hasmapto('<Plug>GitGutterStageHunk') && maparg('<Leader>hs', 'n') ==# ''
+ nmap <Leader>hs <Plug>GitGutterStageHunk
+ endif
+ if !hasmapto('<Plug>GitGutterUndoHunk') && maparg('<Leader>hu', 'n') ==# ''
+ nmap <Leader>hu <Plug>GitGutterUndoHunk
+ nmap <Leader>hr <Plug>GitGutterUndoHunk:echomsg '<Leader>hr is deprecated. Use <Leader>hu'<CR>
+ endif
+ if !hasmapto('<Plug>GitGutterPreviewHunk') && maparg('<Leader>hp', 'n') ==# ''
+ nmap <Leader>hp <Plug>GitGutterPreviewHunk
+ endif
+
+ if !hasmapto('<Plug>GitGutterTextObjectInnerPending') && maparg('ic', 'o') ==# ''
+ omap ic <Plug>GitGutterTextObjectInnerPending
+ endif
+ if !hasmapto('<Plug>GitGutterTextObjectOuterPending') && maparg('ac', 'o') ==# ''
+ omap ac <Plug>GitGutterTextObjectOuterPending
+ endif
+ if !hasmapto('<Plug>GitGutterTextObjectInnerVisual') && maparg('ic', 'x') ==# ''
+ xmap ic <Plug>GitGutterTextObjectInnerVisual
+ endif
+ if !hasmapto('<Plug>GitGutterTextObjectOuterVisual') && maparg('ac', 'x') ==# ''
+ xmap ac <Plug>GitGutterTextObjectOuterVisual
+ endif
+endif
+
+" }}}
+
+" Autocommands {{{
+
+augroup gitgutter
+ autocmd!
+
+ if g:gitgutter_realtime
+ autocmd CursorHold,CursorHoldI * call gitgutter#process_buffer(bufnr(''), 1)
+ endif
+
+ if g:gitgutter_eager
+ autocmd BufEnter,BufWritePost,FileChangedShellPost *
+ \ if gettabvar(tabpagenr(), 'gitgutter_didtabenter') |
+ \ call settabvar(tabpagenr(), 'gitgutter_didtabenter', 0) |
+ \ else |
+ \ call gitgutter#process_buffer(bufnr(''), 0) |
+ \ endif
+ autocmd TabEnter *
+ \ call settabvar(tabpagenr(), 'gitgutter_didtabenter', 1) |
+ \ call gitgutter#all()
+ if !has('gui_win32')
+ autocmd FocusGained * call gitgutter#all()
+ endif
+ else
+ autocmd BufRead,BufWritePost,FileChangedShellPost * call gitgutter#process_buffer(bufnr(''), 0)
+ endif
+
+ autocmd ColorScheme * call gitgutter#highlight#define_sign_column_highlight() | call gitgutter#highlight#define_highlights()
+
+ " Disable during :vimgrep
+ autocmd QuickFixCmdPre *vimgrep* let g:gitgutter_enabled = 0
+ autocmd QuickFixCmdPost *vimgrep* let g:gitgutter_enabled = 1
+augroup END
+
+" }}}
+
+" vim:set et sw=2 fdm=marker:
diff --git a/vim/bundle/vim-gitgutter/screenshot.png b/vim/bundle/vim-gitgutter/screenshot.png
new file mode 100644
index 0000000..6b50f83
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/screenshot.png
Binary files differ
diff --git a/vim/bundle/vim-gitgutter/test/=fixture=.txt b/vim/bundle/vim-gitgutter/test/=fixture=.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/=fixture=.txt
diff --git a/vim/bundle/vim-gitgutter/test/README.markdown b/vim/bundle/vim-gitgutter/test/README.markdown
new file mode 100644
index 0000000..2be0c37
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/README.markdown
@@ -0,0 +1,30 @@
+## Testing vim-gitgutter
+
+### Run the tests
+
+```sh
+$ cd test
+$ ./test
+```
+
+### Add a new test
+
+- Add a test file named like `testFoo.vim`. It should have this structure:
+
+```viml
+source helper.vim
+call Setup()
+
+" test code here
+```
+
+- Run the tests.
+- Inspect output (in `foo.actual`) from the new test. If good, copy it to `foo.expected`.
+- Run the tests to ensure new test's output is verified.
+- Commit changes.
+
+### Limitations
+
+- Currently tests are done by writing out a file and comparing it to a known good one.
+- There's no support for assertions within the testcase code.
+
diff --git a/vim/bundle/vim-gitgutter/test/addLines.expected b/vim/bundle/vim-gitgutter/test/addLines.expected
new file mode 100644
index 0000000..8e2c2ec
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/addLines.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=2 id=3000 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/addLinesFish.expected b/vim/bundle/vim-gitgutter/test/addLinesFish.expected
new file mode 100644
index 0000000..8e2c2ec
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/addLinesFish.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=2 id=3000 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/ambiguousFile.expected b/vim/bundle/vim-gitgutter/test/ambiguousFile.expected
new file mode 100644
index 0000000..1cd4e89
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/ambiguousFile.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=5 id=3000 name=GitGutterLineModified
diff --git a/vim/bundle/vim-gitgutter/test/fileAddedToGit.expected b/vim/bundle/vim-gitgutter/test/fileAddedToGit.expected
new file mode 100644
index 0000000..bfd8eeb
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/fileAddedToGit.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fileAddedToGit.tmp:
+ line=1 id=3000 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/filenameWithEquals.expected b/vim/bundle/vim-gitgutter/test/filenameWithEquals.expected
new file mode 100644
index 0000000..a78b977
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/filenameWithEquals.expected
@@ -0,0 +1,5 @@
+
+--- Signs ---
+Signs for =fixture=.txt:
+ line=1 id=3000 name=GitGutterLineAdded
+ line=2 id=3001 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/filenameWithSquareBrackets.expected b/vim/bundle/vim-gitgutter/test/filenameWithSquareBrackets.expected
new file mode 100644
index 0000000..18f3022
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/filenameWithSquareBrackets.expected
@@ -0,0 +1,5 @@
+
+--- Signs ---
+Signs for fix[tu]re.txt:
+ line=1 id=3000 name=GitGutterLineAdded
+ line=2 id=3001 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/fix[tu]re.txt b/vim/bundle/vim-gitgutter/test/fix[tu]re.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/fix[tu]re.txt
diff --git a/vim/bundle/vim-gitgutter/test/fixture.txt b/vim/bundle/vim-gitgutter/test/fixture.txt
new file mode 100644
index 0000000..f5c6aff
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/fixture.txt
@@ -0,0 +1,11 @@
+a
+b
+c
+d
+e
+f
+g
+h
+i
+j
+
diff --git a/vim/bundle/vim-gitgutter/test/followSymlink.expected b/vim/bundle/vim-gitgutter/test/followSymlink.expected
new file mode 100644
index 0000000..8f8fb4a
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/followSymlink.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for symlink:
+ line=5 id=3000 name=GitGutterLineRemoved
diff --git a/vim/bundle/vim-gitgutter/test/helper.vim b/vim/bundle/vim-gitgutter/test/helper.vim
new file mode 100644
index 0000000..aaccf39
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/helper.vim
@@ -0,0 +1,27 @@
+set runtimepath+=../
+source ../plugin/gitgutter.vim
+
+function! Setup()
+ edit! fixture.txt
+ sign unplace *
+endfunction
+
+function! DumpSigns(filename)
+ execute 'redir! > ' a:filename.'.actual'
+ silent execute 'sign place'
+ redir END
+endfunction
+
+function! DumpGitDiff(filename)
+ call system('git diff fixture.txt > '.a:filename.'.actual')
+endfunction
+
+function! DumpGitDiffStaged(filename)
+ call system('git diff --staged fixture.txt > '.a:filename.'.actual')
+endfunction
+
+function! Dump(text, filename)
+ let msg = type(a:text) == 1 ? split(a:text, '\n') : a:text
+ call writefile(msg, a:filename.'.actual', 'a')
+endfunction
+
diff --git a/vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopStageGitDiffStaged.expected b/vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopStageGitDiffStaged.expected
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopStageGitDiffStaged.expected
diff --git a/vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopUndoGitDiffStaged.expected b/vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopUndoGitDiffStaged.expected
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkHunkOutsideNoopUndoGitDiffStaged.expected
diff --git a/vim/bundle/vim-gitgutter/test/hunkOutsideNoopStageSigns.expected b/vim/bundle/vim-gitgutter/test/hunkOutsideNoopStageSigns.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkOutsideNoopStageSigns.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/hunkOutsideNoopUndoSigns.expected b/vim/bundle/vim-gitgutter/test/hunkOutsideNoopUndoSigns.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkOutsideNoopUndoSigns.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/hunkStageGitDiff.expected b/vim/bundle/vim-gitgutter/test/hunkStageGitDiff.expected
new file mode 100644
index 0000000..6f6a7fa
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkStageGitDiff.expected
@@ -0,0 +1,13 @@
+diff --git a/test/fixture.txt b/test/fixture.txt
+index f5c6aff..ae8e546 100644
+--- a/test/fixture.txt
++++ b/test/fixture.txt
+@@ -2,7 +2,7 @@ a
+ b
+ c
+ d
+-e
++*e
+ f
+ g
+ h
diff --git a/vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiff.expected b/vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiff.expected
new file mode 100644
index 0000000..6a0b7f0
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiff.expected
@@ -0,0 +1,13 @@
+diff --git a/test/fixture.txt b/test/fixture.txt
+index 53b13df..8fdfda7 100644
+--- a/test/fixture.txt
++++ b/test/fixture.txt
+@@ -1,5 +1,8 @@
+ a
+ b
++x
++y
++z
+ c
+ e
+ f
diff --git a/vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiffStaged.expected b/vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiffStaged.expected
new file mode 100644
index 0000000..8806576
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkStageNearbyGitDiffStaged.expected
@@ -0,0 +1,12 @@
+diff --git a/test/fixture.txt b/test/fixture.txt
+index f5c6aff..53b13df 100644
+--- a/test/fixture.txt
++++ b/test/fixture.txt
+@@ -1,7 +1,6 @@
+ a
+ b
+ c
+-d
+ e
+ f
+ g
diff --git a/vim/bundle/vim-gitgutter/test/hunkStageNearbySigns.expected b/vim/bundle/vim-gitgutter/test/hunkStageNearbySigns.expected
new file mode 100644
index 0000000..edfebd2
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkStageNearbySigns.expected
@@ -0,0 +1,6 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=3 id=3000 name=GitGutterLineAdded
+ line=4 id=3001 name=GitGutterLineAdded
+ line=5 id=3002 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/hunkStageSigns.expected b/vim/bundle/vim-gitgutter/test/hunkStageSigns.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkStageSigns.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/hunkUndoGitDiff.expected b/vim/bundle/vim-gitgutter/test/hunkUndoGitDiff.expected
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkUndoGitDiff.expected
diff --git a/vim/bundle/vim-gitgutter/test/hunkUndoNearbyGitDiff.expected b/vim/bundle/vim-gitgutter/test/hunkUndoNearbyGitDiff.expected
new file mode 100644
index 0000000..d480c7b
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkUndoNearbyGitDiff.expected
@@ -0,0 +1,13 @@
+diff --git a/test/fixture.txt b/test/fixture.txt
+index f5c6aff..3fbde56 100644
+--- a/test/fixture.txt
++++ b/test/fixture.txt
+@@ -1,5 +1,8 @@
+ a
+ b
++x
++y
++z
+ c
+ d
+ e
diff --git a/vim/bundle/vim-gitgutter/test/hunkUndoNearbySigns.expected b/vim/bundle/vim-gitgutter/test/hunkUndoNearbySigns.expected
new file mode 100644
index 0000000..edfebd2
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkUndoNearbySigns.expected
@@ -0,0 +1,6 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=3 id=3000 name=GitGutterLineAdded
+ line=4 id=3001 name=GitGutterLineAdded
+ line=5 id=3002 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/hunkUndoSigns.expected b/vim/bundle/vim-gitgutter/test/hunkUndoSigns.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/hunkUndoSigns.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/keepAlt.expected b/vim/bundle/vim-gitgutter/test/keepAlt.expected
new file mode 100644
index 0000000..feee7b5
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/keepAlt.expected
@@ -0,0 +1,3 @@
+buffer: fixture.txt
+altbuffer:
+altbuffer:
diff --git a/vim/bundle/vim-gitgutter/test/keepModified.expected b/vim/bundle/vim-gitgutter/test/keepModified.expected
new file mode 100644
index 0000000..57a1bbf
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/keepModified.expected
@@ -0,0 +1,2 @@
+modified: 1
+modified: 1
diff --git a/vim/bundle/vim-gitgutter/test/keepOpMarks.expected b/vim/bundle/vim-gitgutter/test/keepOpMarks.expected
new file mode 100644
index 0000000..ed6b8c3
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/keepOpMarks.expected
@@ -0,0 +1,4 @@
+'[ mark: 0,6,1,0
+'] mark: 0,6,2,0
+'[ mark: 0,6,1,0
+'] mark: 0,6,2,0
diff --git a/vim/bundle/vim-gitgutter/test/modifyLines.expected b/vim/bundle/vim-gitgutter/test/modifyLines.expected
new file mode 100644
index 0000000..91ad42c
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/modifyLines.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=1 id=3000 name=GitGutterLineModified
diff --git a/vim/bundle/vim-gitgutter/test/noModifications.expected b/vim/bundle/vim-gitgutter/test/noModifications.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/noModifications.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/orphanedSigns.expected b/vim/bundle/vim-gitgutter/test/orphanedSigns.expected
new file mode 100644
index 0000000..1beeb65
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/orphanedSigns.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=6 id=3001 name=GitGutterLineAdded
diff --git a/vim/bundle/vim-gitgutter/test/removeFirstLines.expected b/vim/bundle/vim-gitgutter/test/removeFirstLines.expected
new file mode 100644
index 0000000..1cbfd76
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/removeFirstLines.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=1 id=3000 name=GitGutterLineRemovedFirstLine
diff --git a/vim/bundle/vim-gitgutter/test/removeLines.expected b/vim/bundle/vim-gitgutter/test/removeLines.expected
new file mode 100644
index 0000000..94d8ee4
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/removeLines.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=4 id=3000 name=GitGutterLineRemoved
diff --git a/vim/bundle/vim-gitgutter/test/signColumnAlways.expected b/vim/bundle/vim-gitgutter/test/signColumnAlways.expected
new file mode 100644
index 0000000..aeda456
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/signColumnAlways.expected
@@ -0,0 +1,4 @@
+
+--- Signs ---
+Signs for fixture.txt:
+ line=9999 id=2999 name=GitGutterDummy
diff --git a/vim/bundle/vim-gitgutter/test/test b/vim/bundle/vim-gitgutter/test/test
new file mode 100755
index 0000000..5c2d877
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/test
@@ -0,0 +1,50 @@
+#!/usr/bin/env bash
+
+VIM="/Applications/MacVim.app/Contents/MacOS/Vim -v"
+
+status=0
+
+# Execute the tests.
+for editor in "$VIM" nvim; do
+
+ for testcase in test*.vim; do
+ $editor -N -u NONE --cmd 'let g:gitgutter_async=0' -S $testcase -c 'quit!'
+
+ git reset HEAD fixture.txt > /dev/null
+ git checkout fixture.txt
+ done
+
+ # Verify the results.
+ echo "$editor:"
+ echo
+
+ count_ok=0
+ count_fail=0
+
+ for expected in *.expected; do
+ name=${expected%.*}
+ actual=$name.actual
+
+ if diff $expected $actual; then
+ count_ok=$((count_ok + 1))
+ echo "$name ok"
+ rm $actual
+ else
+ count_fail=$((count_fail + 1))
+ echo "$name failed"
+ fi
+ done
+
+ # Print results.
+ echo
+ echo "$((count_ok + count_fail)) tests"
+ echo "$count_ok ok"
+ echo "$count_fail failed"
+ echo
+
+ status=$(($status + $count_fail))
+
+done
+
+exit $status
+
diff --git a/vim/bundle/vim-gitgutter/test/testAddLines.vim b/vim/bundle/vim-gitgutter/test/testAddLines.vim
new file mode 100644
index 0000000..6b0ec4a
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testAddLines.vim
@@ -0,0 +1,6 @@
+source helper.vim
+call Setup()
+
+normal ggo*
+write
+call DumpSigns('addLines')
diff --git a/vim/bundle/vim-gitgutter/test/testAddLinesFish.vim b/vim/bundle/vim-gitgutter/test/testAddLinesFish.vim
new file mode 100644
index 0000000..f1c6bab
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testAddLinesFish.vim
@@ -0,0 +1,7 @@
+set shell=/usr/local/bin/fish
+source helper.vim
+call Setup()
+
+normal ggo*
+write
+call DumpSigns('addLinesFish')
diff --git a/vim/bundle/vim-gitgutter/test/testEditAmbiguousFile.vim b/vim/bundle/vim-gitgutter/test/testEditAmbiguousFile.vim
new file mode 100644
index 0000000..693ecf7
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testEditAmbiguousFile.vim
@@ -0,0 +1,9 @@
+source helper.vim
+call Setup()
+
+normal 5Gi*
+call system('git checkout -b fixture.txt')
+write
+call DumpSigns('ambiguousFile')
+
+call system('git checkout - && git branch -d fixture.txt')
diff --git a/vim/bundle/vim-gitgutter/test/testFileAddedToGit.vim b/vim/bundle/vim-gitgutter/test/testFileAddedToGit.vim
new file mode 100644
index 0000000..91a2c14
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testFileAddedToGit.vim
@@ -0,0 +1,12 @@
+source helper.vim
+
+let tmpfile = 'fileAddedToGit.tmp'
+call system('touch '.tmpfile)
+call system('git add '.tmpfile)
+execute 'edit '.tmpfile
+normal ihello
+write
+call DumpSigns('fileAddedToGit')
+
+call system('git reset HEAD '.tmpfile)
+call system('rm '.tmpfile)
diff --git a/vim/bundle/vim-gitgutter/test/testFilenameWithEquals.vim b/vim/bundle/vim-gitgutter/test/testFilenameWithEquals.vim
new file mode 100644
index 0000000..082ff02
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testFilenameWithEquals.vim
@@ -0,0 +1,12 @@
+source helper.vim
+
+edit =fixture=.txt
+normal ggo*
+try
+ write
+ write
+ call DumpSigns('filenameWithEquals')
+finally
+ call system('git reset HEAD =fixture=.txt')
+ call system('git checkout =fixture=.txt')
+endtry
diff --git a/vim/bundle/vim-gitgutter/test/testFilenameWithSquareBrackets.vim b/vim/bundle/vim-gitgutter/test/testFilenameWithSquareBrackets.vim
new file mode 100644
index 0000000..85ae889
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testFilenameWithSquareBrackets.vim
@@ -0,0 +1,9 @@
+source helper.vim
+
+edit fix[tu]re.txt
+normal ggo*
+write
+call DumpSigns('filenameWithSquareBrackets')
+
+call system('git reset HEAD fix[tu]re.txt')
+call system('git checkout fix[tu]re.txt')
diff --git a/vim/bundle/vim-gitgutter/test/testFollowSymlink.vim b/vim/bundle/vim-gitgutter/test/testFollowSymlink.vim
new file mode 100644
index 0000000..fda33ec
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testFollowSymlink.vim
@@ -0,0 +1,10 @@
+source helper.vim
+
+let tmpfile = 'symlink'
+call system('ln -nfs fixture.txt '.tmpfile)
+execute 'edit '.tmpfile
+execute '6d'
+write
+call DumpSigns('followSymlink')
+
+call system('rm '.tmpfile)
diff --git a/vim/bundle/vim-gitgutter/test/testHunkOutsideNoop.vim b/vim/bundle/vim-gitgutter/test/testHunkOutsideNoop.vim
new file mode 100644
index 0000000..6601e6d
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testHunkOutsideNoop.vim
@@ -0,0 +1,13 @@
+source helper.vim
+call Setup()
+
+normal 5G
+
+execute 'GitGutterStageHunk'
+call DumpSigns('hunkOutsideNoopStageSigns')
+call DumpGitDiffStaged('hunkHunkOutsideNoopStageGitDiffStaged')
+
+execute 'GitGutterUndoHunk'
+call DumpSigns('hunkOutsideNoopUndoSigns')
+call DumpGitDiffStaged('hunkHunkOutsideNoopUndoGitDiffStaged')
+
diff --git a/vim/bundle/vim-gitgutter/test/testHunkStage.vim b/vim/bundle/vim-gitgutter/test/testHunkStage.vim
new file mode 100644
index 0000000..6f818fb
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testHunkStage.vim
@@ -0,0 +1,7 @@
+source helper.vim
+call Setup()
+
+normal 5Gi*
+execute 'GitGutterStageHunk'
+call DumpSigns('hunkStageSigns')
+call DumpGitDiffStaged('hunkStageGitDiff')
diff --git a/vim/bundle/vim-gitgutter/test/testHunkStageNearbyHunk.vim b/vim/bundle/vim-gitgutter/test/testHunkStageNearbyHunk.vim
new file mode 100644
index 0000000..9939103
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testHunkStageNearbyHunk.vim
@@ -0,0 +1,10 @@
+source helper.vim
+call Setup()
+
+execute "normal! 2Gox\<CR>y\<CR>z"
+normal 2jdd
+normal k
+execute 'GitGutterStageHunk'
+call DumpSigns('hunkStageNearbySigns')
+call DumpGitDiff('hunkStageNearbyGitDiff')
+call DumpGitDiffStaged('hunkStageNearbyGitDiffStaged')
diff --git a/vim/bundle/vim-gitgutter/test/testHunkUndo.vim b/vim/bundle/vim-gitgutter/test/testHunkUndo.vim
new file mode 100644
index 0000000..9d187a7
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testHunkUndo.vim
@@ -0,0 +1,7 @@
+source helper.vim
+call Setup()
+
+normal 5Gi*
+execute 'GitGutterUndoHunk'
+call DumpSigns('hunkUndoSigns')
+call DumpGitDiffStaged('hunkUndoGitDiff')
diff --git a/vim/bundle/vim-gitgutter/test/testHunkUndoNearbyHunk.vim b/vim/bundle/vim-gitgutter/test/testHunkUndoNearbyHunk.vim
new file mode 100644
index 0000000..5721f2d
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testHunkUndoNearbyHunk.vim
@@ -0,0 +1,9 @@
+source helper.vim
+call Setup()
+
+execute "normal! 2Gox\<CR>y\<CR>z"
+normal 2jdd
+normal k
+execute 'GitGutterUndoHunk'
+call DumpSigns('hunkUndoNearbySigns')
+call DumpGitDiff('hunkUndoNearbyGitDiff')
diff --git a/vim/bundle/vim-gitgutter/test/testKeepAlt.vim b/vim/bundle/vim-gitgutter/test/testKeepAlt.vim
new file mode 100644
index 0000000..303ff0f
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testKeepAlt.vim
@@ -0,0 +1,12 @@
+source helper.vim
+call Setup()
+
+enew
+execute "normal! \<C-^>"
+call Dump('buffer: '.bufname(''), 'keepAlt')
+call Dump('altbuffer: '.bufname('#'), 'keepAlt')
+
+normal ggx
+doautocmd CursorHold
+call Dump('altbuffer: '.bufname('#'), 'keepAlt')
+
diff --git a/vim/bundle/vim-gitgutter/test/testKeepModified.vim b/vim/bundle/vim-gitgutter/test/testKeepModified.vim
new file mode 100644
index 0000000..acb687f
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testKeepModified.vim
@@ -0,0 +1,8 @@
+source helper.vim
+call Setup()
+
+normal 5Go*
+call Dump("modified: ".getbufvar('', '&modified'), 'keepModified')
+doautocmd CursorHold
+call Dump("modified: ".getbufvar('', '&modified'), 'keepModified')
+
diff --git a/vim/bundle/vim-gitgutter/test/testKeepOpMarks.vim b/vim/bundle/vim-gitgutter/test/testKeepOpMarks.vim
new file mode 100644
index 0000000..1175c80
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testKeepOpMarks.vim
@@ -0,0 +1,10 @@
+source helper.vim
+call Setup()
+
+normal 5Go*
+call Dump("'[ mark: ".join(getpos("'["), ','), 'keepOpMarks')
+call Dump("'] mark: ".join(getpos("']"), ','), 'keepOpMarks')
+doautocmd CursorHold
+call Dump("'[ mark: ".join(getpos("'["), ','), 'keepOpMarks')
+call Dump("'] mark: ".join(getpos("']"), ','), 'keepOpMarks')
+
diff --git a/vim/bundle/vim-gitgutter/test/testModifyLines.vim b/vim/bundle/vim-gitgutter/test/testModifyLines.vim
new file mode 100644
index 0000000..d4a3d01
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testModifyLines.vim
@@ -0,0 +1,6 @@
+source helper.vim
+call Setup()
+
+normal ggi*
+write
+call DumpSigns('modifyLines')
diff --git a/vim/bundle/vim-gitgutter/test/testNoModifications.vim b/vim/bundle/vim-gitgutter/test/testNoModifications.vim
new file mode 100644
index 0000000..909639f
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testNoModifications.vim
@@ -0,0 +1,4 @@
+source helper.vim
+call Setup()
+
+call DumpSigns('noModifications')
diff --git a/vim/bundle/vim-gitgutter/test/testOrphanedSigns.vim b/vim/bundle/vim-gitgutter/test/testOrphanedSigns.vim
new file mode 100644
index 0000000..35992d2
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testOrphanedSigns.vim
@@ -0,0 +1,8 @@
+source helper.vim
+call Setup()
+
+execute "normal 5GoX\<CR>Y"
+write
+execute '6d'
+write
+call DumpSigns('orphanedSigns')
diff --git a/vim/bundle/vim-gitgutter/test/testRemoveFirstLines.vim b/vim/bundle/vim-gitgutter/test/testRemoveFirstLines.vim
new file mode 100644
index 0000000..4a29a73
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testRemoveFirstLines.vim
@@ -0,0 +1,6 @@
+source helper.vim
+call Setup()
+
+execute '1d'
+write
+call DumpSigns('removeFirstLines')
diff --git a/vim/bundle/vim-gitgutter/test/testRemoveLines.vim b/vim/bundle/vim-gitgutter/test/testRemoveLines.vim
new file mode 100644
index 0000000..23d672b
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testRemoveLines.vim
@@ -0,0 +1,6 @@
+source helper.vim
+call Setup()
+
+execute '5d'
+write
+call DumpSigns('removeLines')
diff --git a/vim/bundle/vim-gitgutter/test/testSignColumnAlways.vim b/vim/bundle/vim-gitgutter/test/testSignColumnAlways.vim
new file mode 100644
index 0000000..ff3eb94
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testSignColumnAlways.vim
@@ -0,0 +1,7 @@
+source helper.vim
+call Setup()
+
+let g:gitgutter_sign_column_always=1
+write
+
+call DumpSigns('signColumnAlways')
diff --git a/vim/bundle/vim-gitgutter/test/testUntrackedFileOutsideRepo.vim b/vim/bundle/vim-gitgutter/test/testUntrackedFileOutsideRepo.vim
new file mode 100644
index 0000000..f473d35
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testUntrackedFileOutsideRepo.vim
@@ -0,0 +1,6 @@
+source helper.vim
+
+let tmpfile = tempname()
+call system('touch '.tmpfile)
+execute 'edit '.tmpfile
+call DumpSigns('untrackedFileOutsideRepo')
diff --git a/vim/bundle/vim-gitgutter/test/testUntrackedFileSquareBracketsWithinRepo.vim b/vim/bundle/vim-gitgutter/test/testUntrackedFileSquareBracketsWithinRepo.vim
new file mode 100644
index 0000000..b1fd48a
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testUntrackedFileSquareBracketsWithinRepo.vim
@@ -0,0 +1,10 @@
+source helper.vim
+
+let tmpfile = '[un]trackedFileWithinRepo.tmp'
+call system('touch '.tmpfile)
+execute 'edit '.tmpfile
+normal ggo*
+doautocmd CursorHold
+call DumpSigns('untrackedFileSquareBracketsWithinRepo')
+
+call system('rm '.tmpfile)
diff --git a/vim/bundle/vim-gitgutter/test/testUntrackedFileWithinRepo.vim b/vim/bundle/vim-gitgutter/test/testUntrackedFileWithinRepo.vim
new file mode 100644
index 0000000..4fdd48e
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/testUntrackedFileWithinRepo.vim
@@ -0,0 +1,10 @@
+source helper.vim
+
+let tmpfile = 'untrackedFileWithinRepo.tmp'
+call system('touch '.tmpfile)
+execute 'edit '.tmpfile
+normal ggo*
+doautocmd CursorHold
+call DumpSigns('untrackedFileWithinRepo')
+
+call system('rm '.tmpfile)
diff --git a/vim/bundle/vim-gitgutter/test/untrackedFileOutsideRepo.expected b/vim/bundle/vim-gitgutter/test/untrackedFileOutsideRepo.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/untrackedFileOutsideRepo.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/untrackedFileSquareBracketsWithinRepo.expected b/vim/bundle/vim-gitgutter/test/untrackedFileSquareBracketsWithinRepo.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/untrackedFileSquareBracketsWithinRepo.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-gitgutter/test/untrackedFileWithinRepo.expected b/vim/bundle/vim-gitgutter/test/untrackedFileWithinRepo.expected
new file mode 100644
index 0000000..aa8cd86
--- /dev/null
+++ b/vim/bundle/vim-gitgutter/test/untrackedFileWithinRepo.expected
@@ -0,0 +1,2 @@
+
+--- Signs ---
diff --git a/vim/bundle/vim-snipmate/.gitignore b/vim/bundle/vim-snipmate/.gitignore
new file mode 100644
index 0000000..9140e6a
--- /dev/null
+++ b/vim/bundle/vim-snipmate/.gitignore
@@ -0,0 +1,3 @@
+doc/tags
+*.swp
+.DS_Store
diff --git a/vim/bundle/vim-snipmate/Contributors.md b/vim/bundle/vim-snipmate/Contributors.md
new file mode 100644
index 0000000..4206472
--- /dev/null
+++ b/vim/bundle/vim-snipmate/Contributors.md
@@ -0,0 +1,52 @@
+# Contributors #
+
+SnipMate was originally authored by Michael Sanders
+([Vim](http://www.vim.org/account/profile.php?user_id=16544),
+[GitHub](https://github.com/msanders)).
+
+It is currently maintained by [Rok Garbas](rok@garbas.si), [Marc
+Weber](marco-oweber@gmx.de), and [Adnan Zafar](https://github.com/ajzafar) with
+additional contributions from:
+
+* [907th](https://github.com/907th)
+* [adkron](https://github.com/adkron)
+* [alderz](https://github.com/alderz)
+* [asymmetric](https://github.com/asymmetric)
+* [bpugh](https://github.com/bpugh)
+* [bruno-](https://github.com/bruno-)
+* [CharlesGueunet](https://github.com/CharlesGueunet)
+* [darkwise](https://github.com/darkwise)
+* [dreviejo](https://github.com/dreviejo)
+* [fish-face](https://github.com/fish-face)
+* [henrik](https://github.com/henrik)
+* [holizz](https://github.com/holizz)
+* [honza](https://github.com/honza)
+* [hpesoj](https://github.com/hpesoj)
+* [ironcamel](https://github.com/ironcamel)
+* [jb55](https://github.com/jb55)
+* [jbernard](https://github.com/jbernard)
+* [jherdman](https://github.com/jherdman)
+* [kozo2](https://github.com/kozo2)
+* [lilydjwg](https://github.com/lilydjwg)
+* [lpil](https://github.com/lpil)
+* [marutanm](https://github.com/marutanm)
+* [MicahElliott](https://github.com/MicahElliott)
+* [mikeastock](https://github.com/mikeastock)
+* [muffinresearch](https://github.com/muffinresearch)
+* [munyari](https://github.com/munyari)
+* [pielgrzym](https://github.com/pielgrzym)
+* [pose](https://github.com/pose)
+* [r00k](https://github.com/r00k)
+* [radicalbit](https://github.com/radicalbit)
+* [redpill](https://github.com/redpill)
+* [rglassett](http://github.com/rglassett)
+* [robhudson](https://github.com/robhudson)
+* [shinymayhem](https://github.com/shinymayhem)
+* [Shraymonks](https://github.com/shraymonks)
+* [sickill](https://github.com/sickill)
+* [statik](https://github.com/statik)
+* [steveno](https://github.com/steveno)
+* [taq](https://github.com/taq)
+* [thisgeek](https://github.com/thisgeek)
+* [trusktr](https://github.com/trusktr)
+* [Xandaros](https://github.com/Xandaros)
diff --git a/vim/bundle/vim-snipmate/README.md b/vim/bundle/vim-snipmate/README.md
new file mode 100644
index 0000000..b47b56d
--- /dev/null
+++ b/vim/bundle/vim-snipmate/README.md
@@ -0,0 +1,169 @@
+# SnipMate #
+
+SnipMate aims to provide support for textual snippets, similar to TextMate or
+other Vim plugins like [UltiSnips][ultisnips]. For
+example, in C, typing `for<tab>` could be expanded to
+
+ for (i = 0; i < count; i++) {
+ /* code */
+ }
+
+with successive presses of tab jumping around the snippet.
+
+Originally authored by [Michael Sanders][msanders], SnipMate was forked in 2011
+after a stagnation in development. This fork is currently maintained by [Rok
+Garbas][garbas], [Marc Weber][marcweber], and [Adnan Zafar][ajzafar].
+
+
+## Installing SnipMate ##
+
+We recommend one of the following methods for installing SnipMate and its
+dependencies. SnipMate depends on [vim-addon-mw-utils][mw-utils] and
+[tlib][tlib].
+
+> **NOTE:** SnipMate does not ship with any snippets out of the box. We suggest
+looking at the [vim-snippets][vim-snippets] repository.
+
+* Using [VAM][vam], add `vim-snippets` to the list of packages to be installed.
+
+* Using [Pathogen][pathogen], run the following commands:
+
+ % cd ~/.vim/bundle
+ % git clone https://github.com/tomtom/tlib_vim.git
+ % git clone https://github.com/MarcWeber/vim-addon-mw-utils.git
+ % git clone https://github.com/garbas/vim-snipmate.git
+
+ # Optional:
+ % git clone https://github.com/honza/vim-snippets.git
+
+* Using [Vundle][vundle], add the following to your `vimrc` then run
+ `:PluginInstall`
+
+ Plugin 'MarcWeber/vim-addon-mw-utils'
+ Plugin 'tomtom/tlib_vim'
+ Plugin 'garbas/vim-snipmate'
+
+ " Optional:
+ Plugin 'honza/vim-snippets'
+
+## FAQ ##
+
+> SnipMate doesn't work / My snippets aren't triggering
+
+Try all of the following:
+
+* Check that SnipMate is loaded. This can be done by looking for
+ `<Plug>snipMateTrigger` and similar maps in the output of `:imap`.
+ Additionally make sure either `<Plug>snipMateTrigger` or
+ `<Plug>snipMateNextOrTrigger` is mapped to the key you expect.
+
+* Check that the snippets file you mean to use exists, and that it contains the
+ snippet you're trying to expand.
+
+* Check that your snippets file is located inside a `foo/snippets` directory,
+ where `foo` is a path listed in your `runtimepath`.
+
+* Check that your snippets file is in scope by either the filetype matching the
+ path of the snippet file or the scope explicitly loaded.
+
+* Check if any snippets from your snippets file are available. This can be done
+ with the "show available snips" map, by default bound to `<C-R><Tab>` in
+ insert mode.
+
+If all of the above check out, please open an issue stating your Vim version,
+a sample snippet, and a description of exactly what happens when you try to
+trigger a snippet.
+
+> How does SnipMate determine which snippets to load? How can I separate, for
+> example, my Rails snippets from my Ruby snippets?
+
+Primarily SnipMate looks at the `'filetype'` and `'syntax'` settings. Taking
+"scopes" from these options, it looks in each `snippets/` directory in
+`'runtimepath'` for files named `scope.snippets`, `scope/*.snippets`, or
+`scope_*.snippets`.
+
+However we understand this may not allow for the flexibility desired by some
+languages. For this we provide two options: scope aliases and the
+`:SnipMateLoadScope` command. Scope aliases simply say "whenever this scope is
+loaded, also load this other scope:
+
+ let g:snipMate = get(g:, 'snipMate', {}) " Allow for vimrc re-sourcing
+ let g:snipMate.scope_aliases = {}
+ let g:snipMate.scope_aliases['ruby'] = 'ruby,rails'
+
+will load the `ruby-rails` scope whenever the `ruby` scope is active. The
+`:SnipMateLoadScope foo` command will always load the foo scope in the current
+buffer. The [vim-rails](https://github.com/tpope/vim-rails) plugin automatically
+does `:SnipMateLoadScope rails` when editing a Rails project for example.
+
+## Release Notes ##
+
+### 0.89 - 2016-05-29 ###
+
+* Various regex updates to legacy parser
+* Addition of double bang syntax to completely remove a snippet from lookup
+* Group various SnipMate autocommands
+* Support setting 'shiftwidth' to 0
+* Parser now operates linewise, adding some flexibility
+* Mirror substitutions are more literal
+* Mirror length is calculated correctly when substitutions occur
+
+### 0.88 - 2015-04-04 ###
+
+* Implement simple caching
+* Remove expansion guards
+* Add `:SnipMateLoadScope` command and buffer-local scope aliases
+* Load `<scope>_*.snippets` files
+* Use CursorMoved autocmd events entirely
+
+* The nested branch has been merged
+ * A new snippet parser has been added. The g:snipmate.version as well as
+ version lines in snippet files determines which is used
+ * The new parser supports tab stops placed within placeholders,
+ substitutions, non-consecutive stop numbers, and fewer ambiguities
+ * The stop jumping code has been updated
+ * Tests have been added for the jumping code and the new parser
+
+* The override branch has been merged
+ * The g:snipMate.override option is added. When enabled, if two snippets
+ share the same name, the later-loaded one is kept and the other discarded
+ * Override behavior can be enabled on a per-snippet basis with a bang (!) in
+ the snippet file
+ * Otherwise, SnipMate tries to preserve all snippets loaded
+
+* Fix bug with mirrors in the first column
+* Fix bug with tabs in indents ([#143][143])
+* Fix bug with mirrors in placeholders
+* Fix reading single snippet files
+* Fix the use of the visual map at the end of a line
+* Fix expansion of stops containing only the zero tab stop
+* Remove select mode mappings
+* Indent visual placeholder expansions and remove extraneous lines ([#177][177]
+ and [#178][178])
+
+### 0.87 - 2014-01-04 ###
+
+* Stop indenting empty lines when expanding snippets
+* Support extends keyword in .snippets files
+* Fix visual placeholder support
+* Add zero tabstop support
+* Support negative 'softtabstop'
+* Add g:snipMate_no_default_aliases option
+* Add <Plug>snipMateTrigger for triggering an expansion inside a snippet
+* Add snipMate#CanBeTriggered() function
+
+[ultisnips]: https://github.com/sirver/ultisnips
+[msanders]: https://github.com/msanders
+[garbas]: https://github.com/garbas
+[marcweber]: https://github.com/marcweber
+[ajzafar]: https://github.com/ajzafar
+[mw-utils]: https://github.com/marcweber/vim-addon-mw-utils
+[tlib]: https://github.com/tomtom/tlib_vim
+[vim-snippets]: https://github.com/honza/vim-snippets
+[vam]: https://github.com/marcweber/vim-addon-manager
+[pathogen]: https://github.com/tpope/vim-pathogen
+[vundle]: https://github.com/gmarik/vundle
+
+[143]: https://github.com/garbas/vim-snipmate/issues/143
+[177]: https://github.com/garbas/vim-snipmate/issues/177
+[178]: https://github.com/garbas/vim-snipmate/issues/178
diff --git a/vim/bundle/vim-snipmate/addon-info.json b/vim/bundle/vim-snipmate/addon-info.json
new file mode 100644
index 0000000..8d9930f
--- /dev/null
+++ b/vim/bundle/vim-snipmate/addon-info.json
@@ -0,0 +1,12 @@
+{
+ "name" : "snipMate",
+ "version" : "dev",
+ "author" : "Michael Sanders -> original project http://github.com/msanders/snipmate.vim",
+ "maintainer" : "Rok Garbas / Marc Weber",
+ "repository" : {"type": "git", "url": "git://github.com/garbas/vim-snipmate.git"},
+ "dependencies" : {
+ "vim-addon-mw-utils": {},
+ "tlib": {}
+ },
+ "description" : "snipMate.vim aims to be a concise vim script that implements some of TextMate's snippets features in Vim. See README.md to learn about the features this fork adds"
+}
diff --git a/vim/bundle/vim-snipmate/after/plugin/snipMate.vim b/vim/bundle/vim-snipmate/after/plugin/snipMate.vim
new file mode 100644
index 0000000..3d6bac7
--- /dev/null
+++ b/vim/bundle/vim-snipmate/after/plugin/snipMate.vim
@@ -0,0 +1,46 @@
+" snipMate maps
+" These maps are created here in order to make sure we can reliably create maps
+" after SuperTab.
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! s:map_if_not_mapped(lhs, rhs, mode) abort
+ let l:unique = s:overwrite ? '' : ' <unique>'
+ if !hasmapto(a:rhs, a:mode)
+ silent! exe a:mode . 'map' . l:unique a:lhs a:rhs
+ endif
+endfunction
+
+if !exists('g:snips_no_mappings') || !g:snips_no_mappings
+ if exists('g:snips_trigger_key')
+ echom 'g:snips_trigger_key is deprecated. See :h snipMate-mappings'
+ exec 'imap <unique>' g:snips_trigger_key '<Plug>snipMateTrigger'
+ exec 'smap <unique>' g:snips_trigger_key '<Plug>snipMateSNext'
+ exec 'xmap <unique>' g:snips_trigger_key '<Plug>snipMateVisual'
+ else
+ " Remove SuperTab map if it exists
+ let s:overwrite = maparg('<Tab>', 'i') ==? '<Plug>SuperTabForward'
+ call s:map_if_not_mapped('<Tab>', '<Plug>snipMateNextOrTrigger', 'i')
+ call s:map_if_not_mapped('<Tab>', '<Plug>snipMateNextOrTrigger', 's')
+ let s:overwrite = 0
+ call s:map_if_not_mapped('<Tab>', '<Plug>snipMateVisual', 'x')
+ endif
+
+ if exists('g:snips_trigger_key_backwards')
+ echom 'g:snips_trigger_key_backwards is deprecated. See :h snipMate-mappings'
+ exec 'imap <unique>' g:snips_trigger_key_backwards '<Plug>snipMateIBack'
+ exec 'smap <unique>' g:snips_trigger_key_backwards '<Plug>snipMateSBack'
+ else
+ let s:overwrite = maparg('<S-Tab>', 'i') ==? '<Plug>SuperTabBackward'
+ call s:map_if_not_mapped('<S-Tab>', '<Plug>snipMateBack', 'i')
+ call s:map_if_not_mapped('<S-Tab>', '<Plug>snipMateBack', 's')
+ let s:overwrite = 0
+ endif
+
+ call s:map_if_not_mapped('<C-R><Tab>', '<Plug>snipMateShow', 'i')
+endif
+
+let &cpo = s:save_cpo
+
+" vim:noet:
diff --git a/vim/bundle/vim-snipmate/autoload/snipMate.vim b/vim/bundle/vim-snipmate/autoload/snipMate.vim
new file mode 100644
index 0000000..74366fa
--- /dev/null
+++ b/vim/bundle/vim-snipmate/autoload/snipMate.vim
@@ -0,0 +1,603 @@
+" config which can be overridden (shared lines)
+if !exists('g:snipMate')
+ let g:snipMate = {}
+endif
+
+try
+ call tlib#input#List('mi', '', [])
+catch /.*/
+ echoe "you're missing tlib. See install instructions at ".expand('<sfile>:h:h').'/README.md'
+endtry
+
+fun! Filename(...) abort
+ let filename = expand('%:t:r')
+ if filename == '' | return a:0 == 2 ? a:2 : '' | endif
+ return !a:0 || a:1 == '' ? filename : substitute(a:1, '$1', filename, 'g')
+endf
+
+let s:cache = {}
+
+function! snipMate#expandSnip(snip, version, col) abort
+ let lnum = line('.')
+ let col = a:col
+ let line = getline(lnum)
+ let indent = match(line, '\S\|$') + 1
+ let b:snip_state = snipmate#jumping#state()
+
+ if a:version == 1
+ let [snippet, b:snip_state.stops] = snipmate#parse#snippet(a:snip)
+ " Build stop/mirror info
+ let b:snip_state.stop_count = s:build_stops(snippet, b:snip_state.stops, lnum, col, indent)
+ let snipLines = map(copy(snippet),
+ \ 'snipMate#sniplist_str(v:val, b:snip_state.stops)')
+ else
+ let snippet = snipmate#legacy#process_snippet(a:snip)
+ let [b:snip_state.stops, b:snip_state.stop_count] = snipmate#legacy#build_stops(snippet, lnum, col - indent, indent)
+ let snipLines = split(substitute(snippet, printf('%s\d\+\|%s{\d\+.\{-}}',
+ \ g:snipmate#legacy#sigil, g:snipmate#legacy#sigil), '', 'g'), "\n", 1)
+ endif
+
+ " Abort if the snippet is empty
+ if empty(snippet)
+ return ''
+ endif
+
+ " Expand snippet onto current position
+ let afterCursor = strpart(line, col - 1)
+ " Keep text after the cursor
+ if afterCursor != "\t" && afterCursor != ' '
+ let line = strpart(line, 0, col - 1)
+ let snipLines[-1] .= afterCursor
+ else
+ let afterCursor = ''
+ " For some reason the cursor needs to move one right after this
+ if line != '' && col == 1 && &ve != 'all' && &ve != 'onemore'
+ let col += 1
+ endif
+ endif
+
+ " Insert snippet with proper indentation
+ call setline(lnum, line . snipLines[0])
+ call append(lnum, map(snipLines[1:], "empty(v:val) ? v:val : '" . strpart(line, 0, indent - 1) . "' . v:val"))
+
+ " Open any folds snippet expands into
+ if &foldenable
+ silent! exec lnum . ',' . (lnum + len(snipLines) - 1) . 'foldopen'
+ endif
+
+ aug snipmate_changes
+ au CursorMoved,CursorMovedI <buffer> if exists('b:snip_state') |
+ \ call b:snip_state.update_changes() |
+ \ else |
+ \ silent! au! snipmate_changes * <buffer> |
+ \ endif
+ aug END
+
+ let b:snip_state.stop_no = 0
+ return b:snip_state.set_stop(0)
+endfunction
+
+function! snipMate#placeholder_str(num, stops) abort
+ return snipMate#sniplist_str(a:stops[a:num].placeholder, a:stops)
+endfunction
+
+function! snipMate#sniplist_str(snippet, stops) abort
+ let str = ''
+ let pos = 0
+ let add_to = 1
+ let seen_stops = []
+
+ while pos < len(a:snippet)
+ let item = a:snippet[pos]
+
+ if type(item) == type('')
+ let str .= item
+ elseif type(item) == type([])
+ let str .= snipMate#placeholder_str(item[0], a:stops)
+ endif
+
+ let pos += 1
+ unlet item " avoid E706
+ endwhile
+
+ return str
+endfunction
+
+function! s:build_stops(snippet, stops, lnum, col, indent) abort
+ let stops = a:stops
+ let lnum = a:lnum
+ let col = a:col
+
+ for line in a:snippet
+ let col = s:build_loc_info(line, stops, lnum, col, [])
+ if line isnot a:snippet[-1]
+ let lnum += 1
+ let col = a:indent
+ endif
+ endfor
+
+ " add zero tabstop if it doesn't exist and then link it to the highest stop
+ " number
+ let stops[0] = get(stops, 0,
+ \ { 'placeholder' : [], 'line' : lnum, 'col' : col })
+ let stop_count = max(keys(stops)) + 2
+ let stops[stop_count - 1] = stops[0]
+
+ return stop_count
+endfunction
+
+function! s:build_loc_info(snippet, stops, lnum, col, seen_items) abort
+ let stops = a:stops
+ let lnum = a:lnum
+ let col = a:col
+ let pos = 0
+ let in_text = 0
+ let seen_items = a:seen_items
+
+ for item in a:snippet
+ if type(item) == type('')
+ let col += len(item)
+ elseif type(item) == type([])
+ let id = item[0]
+ let stub = item[-1]
+ let stub.line = lnum
+ let stub.col = col
+ call s:add_update_objects(stub, seen_items)
+
+ if len(item) > 2 && type(item[1]) != type({})
+ let col = s:build_loc_info(item[1:-2], stops, lnum, col, seen_items)
+ else
+ let col += len(snipMate#placeholder_str(id, stops))
+ endif
+
+ let in_text = 0
+ endif
+ unlet item " avoid E706
+ endfor
+
+ return col
+endfunction
+
+function! s:add_update_objects(object, targets) abort
+ let targets = a:targets
+
+ for item in targets
+ let item.update_objects = get(item, 'update_objects', [])
+ call add(item.update_objects, a:object)
+ endfor
+
+ call add(targets, a:object)
+endfunction
+
+" reads a .snippets file
+" returns list of
+" ['triggername', 'name', 'contents']
+" if triggername is not set 'default' is assumed
+" TODO: better error checking
+fun! snipMate#ReadSnippetsFile(file) abort
+ let result = []
+ let new_scopes = []
+ if !filereadable(a:file) | return [result, new_scopes] | endif
+ let inSnip = 0
+ let line_no = 0
+ let snipversion = get(g:snipMate, 'snippet_version', 0)
+ for line in readfile(a:file) + ["\n"]
+ let line_no += 1
+
+ if inSnip && (line[0] == "\t" || line == '')
+ let content .= strpart(line, 1)."\n"
+ continue
+ elseif inSnip
+ call add(result, [trigger, name,
+ \ content[:-2], bang, snipversion])
+ let inSnip = 0
+ endif
+
+ if line[:6] == 'snippet'
+ let inSnip = 1
+ let bang = (line[7] == '!')
+ if bang
+ let bang += line[8] == '!'
+ endif
+ let trigger = strpart(line, 8 + bang)
+ let name = ''
+ let space = stridx(trigger, ' ') + 1
+ if space " Process multi snip
+ let name = strpart(trigger, space)
+ let trigger = strpart(trigger, 0, space - 1)
+ endif
+ let content = ''
+ if trigger =~ '^\s*$' " discard snippets with empty triggers
+ echom 'Invalid snippet in' a:file 'near line' line_no
+ let inSnip = 0
+ endif
+ elseif line[:6] == 'extends'
+ call extend(new_scopes, map(split(strpart(line, 8)),
+ \ "substitute(v:val, ',*$', '', '')"))
+ elseif line[:6] == 'version'
+ let snipversion = +strpart(line, 8)
+ endif
+ endfor
+ return [result, new_scopes]
+endf
+
+function! s:GetScopes() abort
+ let ret = exists('b:snipMate.scope_aliases') ? copy(b:snipMate.scope_aliases) : {}
+ let global = get(g:snipMate, 'scope_aliases', {})
+ for alias in keys(global)
+ if has_key(ret, alias)
+ let ret[alias] = join(split(ret[alias], ',')
+ \ + split(global[alias], ','), ',')
+ else
+ let ret[alias] = global[alias]
+ endif
+ endfor
+ return ret
+endfunction
+
+" adds scope aliases to list.
+" returns new list
+" the aliases of aliases are added recursively
+fun! s:AddScopeAliases(list) abort
+ let did = {}
+ let scope_aliases = s:GetScopes()
+ let new = a:list
+ let new2 = []
+ while !empty(new)
+ for i in new
+ if !has_key(did, i)
+ let did[i] = 1
+ call extend(new2, split(get(scope_aliases,i,''),','))
+ endif
+ endfor
+ let new = new2
+ let new2 = []
+ endwhile
+ return keys(did)
+endf
+
+augroup SnipMateSource
+ au SourceCmd *.snippet,*.snippets call s:source_snippet()
+augroup END
+
+function! s:info_from_filename(file) abort
+ let parts = split(fnamemodify(a:file, ':r'), '/')
+ let snipidx = len(parts) - index(reverse(copy(parts)), 'snippets') - 1
+ let rtp_prefix = join(parts[(snipidx -
+ \ (parts[snipidx - 1] == 'after' ? 3 : 2)):snipidx - 1], '/')
+ let trigger = get(parts, snipidx + 2, '')
+ let desc = get(parts, snipidx + 3, get(g:snipMate, 'override', 0) ?
+ \ '' : fnamemodify(a:file, ':t'))
+ return [rtp_prefix, trigger, desc]
+endfunction
+
+function! s:source_snippet() abort
+ let file = expand('<afile>:p')
+ let [rtp_prefix, trigger, desc] = s:info_from_filename(file)
+ let new_snips = []
+ if fnamemodify(file, ':e') == 'snippet'
+ call add(new_snips, [trigger, desc, join(readfile(file), "\n"), 0,
+ \ get(g:snipMate, 'snippet_version', 0)])
+ else
+ let [snippets, extends] = s:CachedSnips(file)
+ let new_snips = deepcopy(snippets)
+ call extend(s:lookup_state.extends, extends)
+ endif
+ for snip in new_snips
+ if get(g:snipMate, 'override', 0)
+ let snip[1] = join([s:lookup_state.scope, snip[1]])
+ else
+ let snip[1] = join([s:lookup_state.scope, rtp_prefix,
+ \ empty(snip[1]) ? desc : snip[1]])
+ endif
+ endfor
+ call extend(s:lookup_state.snips, new_snips)
+endfunction
+
+function! s:CachedSnips(file) abort
+ let mtime = getftime(a:file)
+ if has_key(s:cache, a:file) && s:cache[a:file].mtime >= mtime
+ return s:cache[a:file].contents
+ endif
+ let s:cache[a:file] = {}
+ let s:cache[a:file].mtime = mtime
+ let s:cache[a:file].contents = snipMate#ReadSnippetsFile(a:file)
+ return s:cache[a:file].contents
+endfunction
+
+function! s:snippet_filenames(scope, trigger) abort
+ let mid = ['', '_*', '/*']
+ let mid += map(copy(mid), "'/' . a:trigger . '*' . v:val")
+ call map(mid, "'snippets/' . a:scope . v:val . '.snippet'")
+ return map(mid[:2], 'v:val . "s"') + mid[3:]
+endfunction
+
+function! snipMate#SetByPath(dict, trigger, path, snippet, bang, snipversion) abort
+ let d = a:dict
+ if a:bang == 2
+ unlet! d[a:trigger]
+ return
+ elseif !has_key(d, a:trigger) || a:bang == 1
+ let d[a:trigger] = {}
+ endif
+ let d[a:trigger][a:path] = [a:snippet, a:snipversion]
+endfunction
+
+if v:version < 704 || has('win32')
+ function! s:Glob(path, expr)
+ let res = []
+ for p in split(a:path, ',')
+ let h = split(fnamemodify(a:expr, ':h'), '/')[0]
+ if isdirectory(p . '/' . h)
+ call extend(res, split(glob(p . '/' . a:expr), "\n"))
+ endif
+ endfor
+ return filter(res, 'filereadable(v:val)')
+ endfunction
+else
+ function! s:Glob(path, expr)
+ return split(globpath(a:path, a:expr), "\n")
+ endfunction
+endif
+
+" default triggers based on paths
+function! snipMate#DefaultPool(scopes, trigger, result) abort
+ let scopes = s:AddScopeAliases(a:scopes)
+ let scopes_done = []
+ let s:lookup_state = {}
+ let s:lookup_state.snips = []
+
+ while !empty(scopes)
+ let scope = remove(scopes, 0)
+ let s:lookup_state.scope = scope
+ let s:lookup_state.extends = []
+
+ for expr in s:snippet_filenames(scope, escape(a:trigger, "*[]?{}`'$|#%"))
+ for path in g:snipMate.snippet_dirs
+ for file in s:Glob(path, expr)
+ source `=file`
+ endfor
+ endfor
+ endfor
+
+ call add(scopes_done, scope)
+ call extend(scopes, s:lookup_state.extends)
+ call filter(scopes, 'index(scopes_done, v:val) == -1')
+ endwhile
+
+ for [trigger, desc, contents, bang, snipversion] in s:lookup_state.snips
+ if trigger =~ '\V\^' . escape(a:trigger, '\')
+ call snipMate#SetByPath(a:result, trigger, desc, contents, bang, snipversion)
+ endif
+ endfor
+endfunction
+
+" return a dict of snippets found in runtimepath matching trigger
+" scopes: list of scopes. usually this is the filetype. eg ['c','cpp']
+" trigger may contain glob patterns. Thus use '*' to get all triggers
+"
+fun! snipMate#GetSnippets(scopes, trigger) abort
+ let result = {}
+
+ for F in values(g:snipMateSources)
+ call funcref#Call(F, [a:scopes, a:trigger, result])
+ endfor
+ return result
+endf
+
+function! snipMate#OpenSnippetFiles() abort
+ let files = []
+ let scopes_done = []
+ let exists = []
+ let notexists = []
+ for scope in s:AddScopeAliases(snipMate#ScopesByFile())
+ let files += s:snippet_filenames(scope, '')
+ endfor
+ call filter(files, "v:val !~# '\\*'")
+ for path in g:snipMate.snippet_dirs
+ let fullpaths = map(copy(files), 'printf("%s/%s", path, v:val)')
+ let exists += filter(copy(fullpaths), 'filereadable(v:val)')
+ let notexists += map(filter(copy(fullpaths),
+ \ 'v:val =~# "\.snippets" && !filereadable(v:val)'),
+ \ '"does not exist: " . v:val')
+ endfor
+ let all = exists + notexists
+ let select = tlib#input#List('mi', 'select files to be opened in splits', all)
+ for idx in select
+ exec 'sp' all[idx - 1]
+ endfor
+endfunction
+
+fun! snipMate#ScopesByFile() abort
+ " duplicates are removed in AddScopeAliases
+ return filter(funcref#Call(g:snipMate.get_scopes), "v:val != ''")
+endf
+
+" used by both: completion and insert snippet
+fun! snipMate#GetSnippetsForWordBelowCursor(word, exact) abort
+ " Split non-word characters into their own piece
+ " so 'foo.bar..baz' becomes ['foo', '.', 'bar', '.', '.', 'baz']
+ " First split just after a \W and then split each resultant string just
+ " before a \W
+ let parts = filter(tlib#list#Flatten(
+ \ map(split(a:word, '\W\zs'), 'split(v:val, "\\ze\\W")')),
+ \ '!empty(v:val)')
+ " Only look at the last few possibilities. Too many can be slow.
+ if len(parts) > 5
+ let parts = parts[-5:]
+ endif
+ let lookups = [a:word]
+ let lookup = ''
+ for w in reverse(parts)
+ let lookup = w . lookup
+ if index(lookups, lookup) == -1
+ call add(lookups, lookup)
+ endif
+ endfor
+
+ " Remove empty lookup entries, but only if there are other nonempty lookups
+ if len(lookups) > 1
+ call filter(lookups, 'v:val != ""')
+ endif
+
+ let matching_snippets = []
+ let snippet = ''
+ " prefer longest word
+ for word in lookups
+ let g:snipMate.word = word
+ for [k,snippetD] in items(funcref#Call(g:snipMate['get_snippets'], [snipMate#ScopesByFile(), word]))
+ " hack: require exact match
+ if a:exact && k !=# word
+ continue
+ endif
+ call add(matching_snippets, [k, snippetD])
+ if a:exact
+ break
+ endif
+ endfor
+ endfor
+ return matching_snippets
+endf
+
+" snippets: dict containing snippets by name
+" usually this is just {'default' : snippet_contents }
+fun! s:ChooseSnippet(snippets) abort
+ let snippet = []
+ let keys = keys(a:snippets)
+ let i = 1
+ for snip in keys
+ let snippet += [i.'. '.snip]
+ let i += 1
+ endfor
+ if len(snippet) == 1
+ " there's only a single snippet, choose it
+ let idx = 0
+ else
+ let idx = tlib#input#List('si','select snippet by name',snippet) -1
+ if idx == -1
+ return ''
+ endif
+ endif
+ " if a:snippets[..] is a String Call returns it
+ " If it's a function or a function string the result is returned
+ return funcref#Call(a:snippets[keys(a:snippets)[idx]])
+endf
+
+fun! snipMate#WordBelowCursor() abort
+ return matchstr(getline('.'), '\S\+\%' . col('.') . 'c')
+endf
+
+fun! snipMate#GetSnippetsForWordBelowCursorForComplete(word) abort
+ let snippets = map(snipMate#GetSnippetsForWordBelowCursor(a:word, 0), 'v:val[0]')
+ return filter(snippets, 'v:val =~# "\\V\\^' . escape(a:word, '"\') . '"')
+endf
+
+fun! snipMate#CanBeTriggered() abort
+ let word = snipMate#WordBelowCursor()
+ let matches = snipMate#GetSnippetsForWordBelowCursorForComplete(word)
+ return len(matches) > 0
+endf
+
+fun! snipMate#ShowAvailableSnips() abort
+ let col = col('.')
+ let word = snipMate#WordBelowCursor()
+ let matches = snipMate#GetSnippetsForWordBelowCursorForComplete(word)
+
+ " Pretty hacky, but really can't have the tab swallowed!
+ if len(matches) == 0
+ call feedkeys(g:snipMate['no_match_completion_feedkeys_chars'], 'n')
+ return ""
+ endif
+
+ call complete(col - len(word), sort(matches))
+ return ''
+endf
+
+" Pass an argument to force snippet expansion instead of triggering or jumping
+function! snipMate#TriggerSnippet(...) abort
+ if exists('g:SuperTabMappingForward')
+ if g:SuperTabMappingForward == "<tab>"
+ let SuperTabPlug = maparg('<Plug>SuperTabForward', 'i')
+ if SuperTabPlug == ""
+ let SuperTabKey = "\<c-n>"
+ else
+ exec "let SuperTabKey = \"" . escape(SuperTabPlug, '<') . "\""
+ endif
+ elseif g:SuperTabMappingBackward == "<tab>"
+ let SuperTabPlug = maparg('<Plug>SuperTabBackward', 'i')
+ if SuperTabPlug == ""
+ let SuperTabKey = "\<c-p>"
+ else
+ exec "let SuperTabKey = \"" . escape(SuperTabPlug, '<') . "\""
+ endif
+ endif
+ endif
+
+ if pumvisible() " Update snippet if completion is used, or deal with supertab
+ if exists('SuperTabKey')
+ call feedkeys(SuperTabKey) | return ''
+ endif
+ call feedkeys("\<esc>a", 'n') " Close completion menu
+ call feedkeys("\<tab>") | return ''
+ endif
+
+ if exists('b:snip_state') && a:0 == 0 " Jump only if no arguments
+ let jump = b:snip_state.jump_stop(0)
+ if type(jump) == 1 " returned a string
+ return jump
+ endif
+ endif
+
+ let word = matchstr(getline('.'), '\S\+\%'.col('.').'c')
+ let list = snipMate#GetSnippetsForWordBelowCursor(word, 1)
+ if empty(list)
+ let snippet = ''
+ else
+ let [trigger, snippetD] = list[0]
+ let snippet = s:ChooseSnippet(snippetD)
+ " Before expanding snippet, create new undo point |i_CTRL-G|
+ let &undolevels = &undolevels
+ let col = col('.') - len(trigger)
+ sil exe 's/\V'.escape(trigger, '/\.').'\%#//'
+ return snipMate#expandSnip(snippet[0], snippet[1], col)
+ endif
+
+ " should allow other plugins to register hooks instead (duplicate code)
+ if exists('SuperTabKey')
+ call feedkeys(SuperTabKey)
+ return ''
+ endif
+ return word == ''
+ \ ? "\<tab>"
+ \ : "\<c-r>=snipMate#ShowAvailableSnips()\<cr>"
+endfunction
+
+fun! snipMate#BackwardsSnippet() abort
+ if exists('b:snip_state') | return b:snip_state.jump_stop(1) | endif
+
+ if exists('g:SuperTabMappingForward')
+ if g:SuperTabMappingForward == "<s-tab>"
+ let SuperTabPlug = maparg('<Plug>SuperTabForward', 'i')
+ if SuperTabPlug == ""
+ let SuperTabKey = "\<c-n>"
+ else
+ exec "let SuperTabKey = \"" . escape(SuperTabPlug, '<') . "\""
+ endif
+ elseif g:SuperTabMappingBackward == "<s-tab>"
+ let SuperTabPlug = maparg('<Plug>SuperTabBackward', 'i')
+ if SuperTabPlug == ""
+ let SuperTabKey = "\<c-p>"
+ else
+ exec "let SuperTabKey = \"" . escape(SuperTabPlug, '<') . "\""
+ endif
+ endif
+ endif
+ " should allow other plugins to register hooks instead (duplicate code)
+ if exists('SuperTabKey')
+ call feedkeys(SuperTabKey)
+ return ''
+ endif
+ return "\<s-tab>"
+endf
+
+" vim:noet:sw=4:ts=4:ft=vim
diff --git a/vim/bundle/vim-snipmate/autoload/snipMate_python_demo.vim b/vim/bundle/vim-snipmate/autoload/snipMate_python_demo.vim
new file mode 100644
index 0000000..de495d2
--- /dev/null
+++ b/vim/bundle/vim-snipmate/autoload/snipMate_python_demo.vim
@@ -0,0 +1,47 @@
+" This file demonstrates
+" - how to register your own snippet sources (call snipMate_python_demo#Activate() in ftplugin/python.vim)
+" - implents a source which creates snippets based on python function
+" definitions found in the current file
+"
+" Example:
+"
+" def abc(a,b,c=None)
+" will create a snippet on the fly which looks like this:
+" abc(${1:a}, ${2:b}, ${3:c=None})
+
+fun! snipMate_python_demo#Activate() abort
+ if !exists('g:snipMateSources')
+ let g:snipMateSources = {}
+ endif
+
+ let g:snipMateSources['python'] = funcref#Function('snipMate_python_demo#FunctionsFromCurrentFileAndTags')
+endf
+
+fun! s:Add(dict, line, source, trigger) abort
+ let matched = matchlist(a:line,'def\s\+\([^( \t]\+\)[ \t]*(\([^)]*\)')
+ if len(matched) > 2
+ let name = matched[1]
+ " TODO: is this a glob?
+ if name !~ a:trigger | return | endif
+ let a:dict[name] = get(a:dict, name, {})
+ let sd = a:dict[name]
+ let args = []
+ let nr=1
+ for arg in split(matched[2], '\s*,\s*')
+ call add(args, '${'.nr.':'.arg.'}')
+ let nr+=1
+ endfor
+ let sd[a:source] = name.'('.join(args,', ').')'
+ endif
+endf
+fun! snipMate_python_demo#FunctionsFromCurrentFileAndTags(scopes, trigger, result) abort
+ " getting all might be too much
+ if a:trigger == '*' | return | endif
+ if index(a:scopes, 'python') < 0 | return | endif
+ for t in taglist('^'.a:trigger)
+ call s:Add(a:result, t.cmd, 'tags-' . t.filename, a:trigger)
+ endfor
+ for l in getline(0, line('$'))
+ call s:Add(a:result, l, 'current-file', a:trigger)
+ endfor
+endf
diff --git a/vim/bundle/vim-snipmate/autoload/snipmate/jumping.vim b/vim/bundle/vim-snipmate/autoload/snipmate/jumping.vim
new file mode 100644
index 0000000..aaf65ab
--- /dev/null
+++ b/vim/bundle/vim-snipmate/autoload/snipmate/jumping.vim
@@ -0,0 +1,228 @@
+function! s:sfile() abort
+ return expand('<sfile>')
+endfunction
+
+let s:state_proto = {}
+
+function! snipmate#jumping#state() abort
+ return copy(s:state_proto)
+endfunction
+
+function! s:listize_mirror(mirrors) abort
+ return map(copy(a:mirrors), '[v:val.line, v:val.col]')
+endfunction
+
+" Removes snippet state info
+function! s:state_remove() dict abort
+ " Remove all autocmds in group snipmate_changes in the current buffer
+ unlet! b:snip_state
+ silent! au! snipmate_changes * <buffer>
+endfunction
+
+function! s:state_find_next_stop(backwards) dict abort
+ let self.stop_no += a:backwards? -1 : 1
+ while !has_key(self.stops, self.stop_no)
+ if self.stop_no == self.stop_count
+ let self.stop_no = 0
+ endif
+ if self.stop_no <= 0 && a:backwards
+ let self.stop_no = self.stop_count - 1
+ endif
+ let self.stop_no += a:backwards? -1 : 1
+ endwhile
+endfunction
+
+" Update state information to correspond to the given tab stop
+function! s:state_set_stop(backwards) dict abort
+ call self.find_next_stop(a:backwards)
+ let self.cur_stop = self.stops[self.stop_no]
+ let self.stop_len = (type(self.cur_stop.placeholder) == type(0))
+ \ ? self.cur_stop.placeholder
+ \ : len(snipMate#placeholder_str(self.stop_no, self.stops))
+ let self.start_col = self.cur_stop.col
+ let self.end_col = self.start_col + self.stop_len
+ let self.mirrors = get(self.cur_stop, 'mirrors', [])
+ let self.old_mirrors = deepcopy(self.mirrors)
+ call cursor(self.cur_stop.line, self.cur_stop.col)
+ let self.prev_len = col('$')
+ let self.changed = 0
+ let ret = self.select_word()
+ if (self.stop_no == 0 || self.stop_no == self.stop_count - 1) && !a:backwards
+ call self.remove()
+ endif
+ return ret
+endfunction
+
+" Jump to the next/previous tab stop
+function! s:state_jump_stop(backwards) dict abort
+ " Update changes just in case
+ " This seems to be only needed because insert completion does not trigger
+ " the CursorMovedI event
+ call self.update_changes()
+
+ " Store placeholder/location changes
+ let self.cur_stop.col = self.start_col
+ if self.changed
+ call self.remove_nested()
+ unlet! self.cur_stop.placeholder " avoid type error for old parsing version
+ let self.cur_stop.placeholder = [strpart(getline('.'),
+ \ self.start_col - 1, self.end_col - self.start_col)]
+ endif
+
+ return self.set_stop(a:backwards)
+endfunction
+
+function! s:state_remove_nested(...) dict abort
+ let id = a:0 ? a:1 : self.stop_no
+ if type(self.stops[id].placeholder) == type([])
+ for i in self.stops[id].placeholder
+ if type(i) == type([])
+ if type(i[1]) != type({})
+ call self.remove_nested(i[0])
+ call remove(self.stops, i[0])
+ else
+ call filter(self.stops[i[0]].mirrors, 'v:val isnot i[1]')
+ endif
+ endif
+ unlet i " Avoid E706
+ endfor
+ endif
+endfunction
+
+" Select the placeholder for the current tab stop
+function! s:state_select_word() dict abort
+ let len = self.stop_len
+ if !len | return '' | endif
+ let l = col('.') != 1 ? 'l' : ''
+ if &sel == 'exclusive'
+ return "\<esc>".l.'v'.len."l\<c-g>"
+ endif
+ return len == 1 ? "\<esc>".l.'gh' : "\<esc>".l.'v'.(len - 1)."l\<c-g>"
+endfunction
+
+" Update the snippet as text is typed. The self.update_mirrors() function does
+" the actual work.
+" If the cursor moves outside of a placeholder, call self.remove()
+function! s:state_update_changes() dict abort
+ let change_len = col('$') - self.prev_len
+ let self.changed = self.changed || change_len != 0
+ let self.end_col += change_len
+ let col = col('.')
+
+ if line('.') != self.cur_stop.line || col < self.start_col || col > self.end_col
+ return self.remove()
+ endif
+
+ call self.update(self.cur_stop, change_len, change_len)
+ if !empty(self.mirrors)
+ call self.update_mirrors(change_len)
+ endif
+
+ let self.prev_len = col('$')
+endfunction
+
+" Actually update the mirrors for any changed text
+function! s:state_update_mirrors(change) dict abort
+ let newWordLen = self.end_col - self.start_col
+ let newWord = strpart(getline('.'), self.start_col - 1, newWordLen)
+ let changeLen = a:change
+ let curLine = line('.')
+ let curCol = col('.')
+ let oldStartSnip = self.start_col
+ let i = 0
+
+ for mirror in self.mirrors
+ for stop in values(filter(copy(self.stops), 'v:key != 0'))
+ if type(stop.placeholder) == type(0)
+ if mirror.line == stop.line && mirror.col > stop.col
+ \ && mirror.col < stop.col + stop.placeholder
+ let stop.placeholder += changeLen
+ endif
+ endif
+ endfor
+
+ if has_key(mirror, 'oldSize')
+ " recover the old size deduce the endline
+ let oldSize = mirror.oldSize
+ else
+ " first time, we use the intitial size
+ let oldSize = strlen(newWord)
+ endif
+
+ " Split the line into three parts: the mirror, what's before it, and
+ " what's after it. Then combine them using the new mirror string.
+ " Subtract one to go from column index to byte index
+
+ let theline = getline(mirror.line)
+
+ " part before the current mirror
+ let beginline = strpart(theline, 0, mirror.col - 1)
+
+ " current mirror transformation, and save size
+ let wordMirror= substitute(newWord, get(mirror, 'pat', ''), get(mirror, 'sub', ''), get(mirror, 'flags', ''))
+ let mirror.oldSize = strlen(wordMirror)
+
+ " end of the line, use the oldSize because with the transformation,
+ " the size of the mirror can be different from those of the snippet
+ let endline = strpart(theline, mirror.col + oldSize -1)
+
+ " Update other object on the line
+ call self.update(mirror, changeLen, mirror.oldSize - oldSize)
+
+ " reconstruct the line
+ let update = beginline.wordMirror.endline
+
+ call setline(mirror.line, update)
+ endfor
+
+ " Reposition the cursor in case a var updates on the same line but before
+ " the current tabstop
+ if oldStartSnip != self.start_col || mode() == 'i'
+ call cursor(0, curCol + self.start_col - oldStartSnip)
+ endif
+endfunction
+
+function! s:state_find_update_objects(item) dict abort
+ let item = a:item
+ let item.update_objects = []
+
+ " Filter the zeroth stop because it's duplicated as the last
+ for stop in values(filter(copy(self.stops), 'v:key != 0'))
+ if stop.line == item.line && stop.col > item.col
+ call add(item.update_objects, stop)
+ endif
+
+ for mirror in get(stop, 'mirrors', [])
+ if mirror.line == item.line && mirror.col > item.col
+ call add(item.update_objects, mirror)
+ endif
+ endfor
+ endfor
+
+ return item.update_objects
+endfunction
+
+function! s:state_update(item, change_len, mirror_change) dict abort
+ let item = a:item
+ if !exists('item.update_objects')
+ let item.update_objects = self.find_update_objects(a:item)
+ endif
+ let to_update = item.update_objects
+
+ for obj in to_update
+ " object does not necessarly have the same decalage
+ " than mirrors if mirrors use regexp
+ let obj.col += a:mirror_change
+ if obj is self.cur_stop
+ let self.start_col += a:change_len
+ let self.end_col += a:change_len
+ endif
+ endfor
+endfunction
+
+call extend(s:state_proto, snipmate#util#add_methods(s:sfile(), 'state',
+ \ [ 'remove', 'set_stop', 'jump_stop', 'remove_nested',
+ \ 'select_word', 'update_changes', 'update_mirrors',
+ \ 'find_next_stop', 'find_update_objects', 'update' ]), 'error')
+
+" vim:noet:sw=4:ts=4:ft=vim
diff --git a/vim/bundle/vim-snipmate/autoload/snipmate/legacy.vim b/vim/bundle/vim-snipmate/autoload/snipmate/legacy.vim
new file mode 100644
index 0000000..7ff39cb
--- /dev/null
+++ b/vim/bundle/vim-snipmate/autoload/snipmate/legacy.vim
@@ -0,0 +1,139 @@
+let s:sigil = nr2char(31)
+let snipmate#legacy#sigil = s:sigil
+
+" Prepare snippet to be processed by s:BuildTabStops
+function! snipmate#legacy#process_snippet(snip) abort
+ let snippet = a:snip
+ let esc_bslash = '\%(\\\@<!\%(\\\\\)*\)\@<='
+
+ if exists('b:snipmate_visual')
+ let visual = substitute(b:snipmate_visual, "\n$", '', '')
+ unlet b:snipmate_visual
+ else
+ let visual = ''
+ endif
+ let snippet = s:substitute_visual(snippet, visual)
+
+ " Evaluate eval (`...`) expressions.
+ " Backquotes prefixed with a backslash "\" are ignored.
+ " And backslash can be escaped by doubling it.
+ " Using a loop here instead of a regex fixes a bug with nested "\=".
+ if stridx(snippet, '`') != -1
+ let new = []
+ let snip = split(snippet, esc_bslash . '`', 1)
+ let isexp = 0
+ for i in snip
+ if isexp
+ call add(new, substitute(snipmate#util#eval(i),
+ \ "\n\\%$", '', ''))
+ else
+ call add(new, i)
+ endif
+ let isexp = !isexp
+ endfor
+ let snippet = join(new, '')
+ let snippet = substitute(snippet, "\r", "\n", 'g')
+ let snippet = substitute(snippet, '\\`', "`", 'g')
+ endif
+
+ " Place all text after a colon in a tab stop after the tab stop
+ " (e.g. "${#:foo}" becomes "${:foo}foo").
+ " This helps tell the position of the tab stops later.
+ let snippet = substitute(snippet, esc_bslash . '\$\({\d\+:\(.\{-}\)}\|{\d\+}\)', s:sigil . '\1\2', 'g')
+ let snippet = substitute(snippet, esc_bslash . '\$\(\d\+\)', s:sigil . '\1', 'g')
+ let snippet = substitute(snippet, esc_bslash . '\\\$', '$', 'g')
+ let snippet = substitute(snippet, '\\\\', "\\", 'g')
+
+ " Update the a:snip so that all the $# become the text after
+ " the colon in their associated ${#}.
+ " (e.g. "${1:foo}" turns all "$1"'s into "foo")
+ let i = 0
+ if snippet !~ s:sigil . '{0'
+ let snippet .= s:sigil . '{0}'
+ endif
+ while snippet =~ s:sigil.'{'.i
+ let s = matchstr(snippet, s:sigil . '{' . i . ':\zs.\{-}\ze}')
+ if s != ''
+ let snippet = substitute(snippet, s:sigil . i, s.'&', 'g')
+ endif
+ let i += 1
+ endw
+
+ if &et " Expand tabs to spaces if 'expandtab' is set.
+ return substitute(snippet, '\t', repeat(' ', snipmate#util#tabwidth()), 'g')
+ endif
+ return snippet
+endfunction
+
+" Builds a list of a list of each tab stop in the snippet containing:
+" 1.) The tab stop's line number.
+" 2.) The tab stop's column number
+" (by getting the length of the string between the last "\n" and the
+" tab stop).
+" 3.) The length of the text after the colon for the current tab stop
+" (e.g. "${1:foo}" would return 3).
+" 4.) If the "${#:}" construct is given, another list containing all
+" the matches of "$#", to be replaced with the placeholder. This list is
+" composed the same way as the parent; the first item is the line number,
+" and the second is the column.
+function! snipmate#legacy#build_stops(snip, lnum, col, indent) abort
+ let stops = {}
+ let i = 0
+ let withoutVars = substitute(a:snip, s:sigil . '\d\+', '', 'g')
+ while a:snip =~ s:sigil . '{' . i
+ let beforeTabStop = matchstr(withoutVars, '^.*\ze'.s:sigil .'{'.i.'\D')
+ let withoutOthers = substitute(withoutVars, ''.s:sigil .'{\('.i.'\D\)\@!\d\+.\{-}}', '', 'g')
+
+ let stops[i] = {}
+ let stops[i].line = a:lnum + s:count(beforeTabStop, "\n")
+ let stops[i].col = a:indent + len(matchstr(withoutOthers, '[^\n]\{-}\ze'.s:sigil .'{'.i.'\D'))
+ let stops[i].placeholder = 0
+ let stops[i].mirrors = []
+ if stops[i].line == a:lnum
+ let stops[i].col += a:col
+ endif
+
+ " Get all $# matches in another list, if ${#:name} is given
+ if withoutVars =~ printf('%s{%d:', s:sigil, i)
+ let stops[i].placeholder = len(matchstr(withoutVars, ''.s:sigil .'{'.i.':\zs.\{-}\ze}'))
+ let withoutOthers = substitute(a:snip, ''.s:sigil .'{\d\+.\{-}}\|'.s:sigil .''.i.'\@!\d\+', '', 'g')
+
+ while match(withoutOthers, ''.s:sigil .''.i.'\(\D\|$\)') != -1
+ let stops[i].mirrors = get(stops[i], 'mirrors', [])
+ let beforeMark = matchstr(withoutOthers,
+ \ printf('^.\{-}\ze%s%s%d\(\D\|$\)',
+ \ repeat('.', stops[i].placeholder), s:sigil, i))
+ let line = a:lnum + s:count(beforeMark, "\n")
+ let col = a:indent + (line > a:lnum
+ \ ? len(matchstr(beforeMark, '.*\n\zs.*'))
+ \ : a:col + len(beforeMark))
+ call add(stops[i].mirrors, { 'line' : line, 'col' : col })
+ let withoutOthers = substitute(withoutOthers, ''.s:sigil .''.i.'\ze\(\D\|$\)', '', '')
+ endw
+ endif
+ let i += 1
+ endw
+ let stops[i] = stops[0]
+ return [stops, i + 1]
+endfunction
+
+function! s:substitute_visual(snippet, visual) abort
+ let lines = []
+ for line in split(a:snippet, "\n")
+ let indent = matchstr(line, '^\t\+')
+ call add(lines, substitute(line, '{VISUAL}',
+ \ substitute(escape(a:visual, '%\'), "\n", "\n" . indent, 'g'), 'g'))
+ endfor
+ return join(lines, "\n")
+endfunction
+
+" Counts occurences of haystack in needle
+function! s:count(haystack, needle) abort
+ let counter = 0
+ let index = stridx(a:haystack, a:needle)
+ while index != -1
+ let index = stridx(a:haystack, a:needle, index+1)
+ let counter += 1
+ endw
+ return counter
+endfunction
diff --git a/vim/bundle/vim-snipmate/autoload/snipmate/parse.vim b/vim/bundle/vim-snipmate/autoload/snipmate/parse.vim
new file mode 100644
index 0000000..dd495e9
--- /dev/null
+++ b/vim/bundle/vim-snipmate/autoload/snipmate/parse.vim
@@ -0,0 +1,309 @@
+" Snippet definition parsing code
+
+function! s:sfile() abort
+ return expand('<sfile>')
+endfunction
+
+let s:parser_proto = {}
+let s:special_chars = "$`\n"
+
+function! s:new_parser(text) abort
+ let ret = copy(s:parser_proto)
+ let ret.input = a:text
+ let ret.len = strlen(ret.input)
+ let ret.pos = -1
+ let ret.indent = 0
+ let ret.value = []
+ let ret.vars = {}
+ let ret.stored_lines = []
+ call ret.advance()
+ return ret
+endfunction
+
+function! s:parser_advance(...) dict abort
+ let self.pos += a:0 ? a:1 : 1
+ let self.next = self.input[self.pos]
+endfunction
+
+function! s:parser_same(tok) dict abort
+ if self.next == a:tok
+ call self.advance()
+ return 1
+ else
+ return 0
+ endif
+endfunction
+
+function! s:parser_id() dict abort
+ if self.input[(self.pos):(self.pos+5)] == 'VISUAL'
+ call self.advance(6)
+ return 'VISUAL'
+ elseif self.next =~ '\d'
+ let end = matchend(self.input, '\d\+', self.pos)
+ let res = strpart(self.input, self.pos, end - self.pos)
+ call self.advance(end - self.pos)
+ return +res " force conversion to Number
+ endif
+ return -1
+endfunction
+
+function! s:parser_add_var(var) dict abort
+ let id = a:var[0]
+ if !has_key(self.vars, id)
+ let self.vars[id] = { 'instances' : [] }
+ endif
+ call add(self.vars[id].instances, a:var)
+endfunction
+
+function! s:parser_var() dict abort
+ let ret = []
+ if self.same('{')
+ let id = self.id()
+ if id >= 0
+ call add(ret, id)
+ call extend(ret, self.varend())
+ endif
+ else
+ let id = self.id()
+ if id >= 0
+ call add(ret, id)
+ endif
+ endif
+ return ret
+endfunction
+
+function! s:parser_varend() dict abort
+ let ret = []
+ if self.same(':')
+ call extend(ret, self.placeholder())
+ elseif self.same('/')
+ call add(ret, self.subst())
+ endif
+ call self.same('}')
+ return ret
+endfunction
+
+function! s:parser_placeholder() dict abort
+ let ret = self.text('}')
+ return empty(ret) ? [''] : ret
+endfunction
+
+function! s:parser_subst() dict abort
+ let ret = {}
+ let ret.pat = self.pat()
+ if self.same('/')
+ let ret.sub = self.pat(1)
+ endif
+ if self.same('/')
+ let ret.flags = self.pat(1)
+ endif
+ return ret
+endfunction
+
+function! s:parser_pat(...) dict abort
+ let val = ''
+
+ while self.pos < self.len
+ if self.same('\')
+ if self.next == '/'
+ let val .= '/'
+ call self.advance()
+ elseif a:0 && self.next == '}'
+ let val .= '}'
+ call self.advance()
+ else
+ let val .= '\'
+ endif
+ elseif self.next == '/' || a:0 && self.next == '}'
+ break
+ else
+ let val .= self.next
+ call self.advance()
+ endif
+ endwhile
+
+ return val
+endfunction
+
+function! s:parser_expr() dict abort
+ let str = self.string('`')
+ call self.same('`')
+ return snipmate#util#eval(str)
+endfunction
+
+function! s:parser_string(till, ...) dict abort
+ let val = ''
+ let till = '\V\[' . escape(a:till, '\') . ']'
+
+ while self.pos < self.len
+ if self.same('\')
+ if self.next != "\n"
+ let val .= self.next
+ endif
+ call self.advance()
+ elseif self.next =~# till
+ break
+ elseif self.next == "\t"
+ let self.indent += 1
+ let val .= s:indent(1)
+ call self.advance()
+ else
+ let val .= self.next
+ call self.advance()
+ endif
+ endwhile
+
+ return val
+endfunction
+
+function! s:join_consecutive_strings(list) abort
+ let list = a:list
+ let pos = 0
+ while pos + 1 < len(list)
+ if type(list[pos]) == type('') && type(list[pos+1]) == type('')
+ let list[pos] .= list[pos+1]
+ call remove(list, pos + 1)
+ else
+ let pos += 1
+ endif
+ endwhile
+endfunction
+
+function! s:parser_text(till) dict abort
+ let ret = []
+
+ while self.pos < self.len
+ let lines = []
+
+ if self.same('$')
+ let var = self.var()
+ if !empty(var)
+ if var[0] is# 'VISUAL'
+ let lines = s:visual_placeholder(var, self.indent)
+ elseif var[0] >= 0
+ call add(ret, var)
+ call self.add_var(var)
+ endif
+ endif
+ elseif self.same('`')
+ let lines = split(self.expr(), "\n", 1)
+ else
+ let lines = [self.string(a:till . s:special_chars)]
+ endif
+
+ if !empty(lines)
+ call add(ret, lines[0])
+ call extend(self.stored_lines, lines[1:])
+ endif
+
+ " Empty lines are ignored if this is tested at the start of an iteration
+ if self.next ==# a:till
+ break
+ endif
+ endwhile
+
+ call s:join_consecutive_strings(ret)
+ return ret
+endfunction
+
+function! s:parser_line() dict abort
+ let ret = []
+ if !empty(self.stored_lines)
+ call add(ret, remove(self.stored_lines, 0))
+ else
+ call extend(ret, self.text("\n"))
+ call self.same("\n")
+ endif
+ let self.indent = 0
+ return ret
+endfunction
+
+function! s:parser_parse() dict abort
+ while self.pos < self.len || !empty(self.stored_lines)
+ let line = self.line()
+ call add(self.value, line)
+ endwhile
+endfunction
+
+function! s:indent(count) abort
+ if &expandtab
+ let shift = repeat(' ', snipmate#util#tabwidth())
+ else
+ let shift = "\t"
+ endif
+ return repeat(shift, a:count)
+endfunction
+
+function! s:visual_placeholder(var, indent) abort
+ let arg = get(a:var, 1, {})
+ if type(arg) == type({})
+ let pat = get(arg, 'pat', '')
+ let sub = get(arg, 'sub', '')
+ let flags = get(arg, 'flags', '')
+ let content = split(substitute(get(b:, 'snipmate_visual', ''), pat, sub, flags), "\n", 1)
+ else
+ let content = split(get(b:, 'snipmate_visual', arg), "\n", 1)
+ endif
+
+ let indent = s:indent(a:indent)
+ call map(content, '(v:key != 0) ? indent . v:val : v:val')
+
+ return content
+endfunction
+
+function! s:parser_create_stubs() dict abort
+
+ for [id, dict] in items(self.vars)
+ for i in dict.instances
+ if len(i) > 1 && type(i[1]) != type({})
+ if !has_key(dict, 'placeholder')
+ let dict.placeholder = i[1:]
+ call add(i, dict)
+ else
+ unlet i[1:]
+ call s:create_mirror_stub(i, dict)
+ endif
+ else
+ call s:create_mirror_stub(i, dict)
+ endif
+ endfor
+ if !has_key(dict, 'placeholder')
+ let dict.placeholder = []
+ let j = 0
+ while len(dict.instances[j]) > 2
+ let j += 1
+ endwhile
+ let oldstub = remove(dict.instances[j], 1, -1)[-1]
+ call add(dict.instances[j], '')
+ call add(dict.instances[j], dict)
+ call filter(dict.mirrors, 'v:val isnot oldstub')
+ endif
+ unlet dict.instances
+ endfor
+
+endfunction
+
+function! s:create_mirror_stub(mirror, dict)
+ let mirror = a:mirror
+ let dict = a:dict
+ let stub = get(mirror, 1, {})
+ call add(mirror, stub)
+ let dict.mirrors = get(dict, 'mirrors', [])
+ call add(dict.mirrors, stub)
+endfunction
+
+function! snipmate#parse#snippet(text, ...) abort
+ let parser = s:new_parser(a:text)
+ call parser.parse()
+ if !(a:0 && a:1)
+ call parser.create_stubs()
+ endif
+ unlet! b:snipmate_visual
+ return [parser.value, parser.vars]
+endfunction
+
+call extend(s:parser_proto, snipmate#util#add_methods(s:sfile(), 'parser',
+ \ [ 'advance', 'same', 'id', 'add_var', 'var', 'varend',
+ \ 'line', 'string', 'create_stubs', 'pat',
+ \ 'placeholder', 'subst', 'expr', 'text', 'parse',
+ \ ]), 'error')
diff --git a/vim/bundle/vim-snipmate/autoload/snipmate/util.vim b/vim/bundle/vim-snipmate/autoload/snipmate/util.vim
new file mode 100644
index 0000000..a80d307
--- /dev/null
+++ b/vim/bundle/vim-snipmate/autoload/snipmate/util.vim
@@ -0,0 +1,30 @@
+" The next function was based on s:function and s:add_methods in fugitive
+" <https://github.com/tpope/vim-fugitive/blob/master/plugin/fugitive.vim>
+function! snipmate#util#add_methods(sfile, namespace, methods) abort
+ let dict = {}
+ for name in a:methods
+ let dict[name] = function(join([matchstr(a:sfile, '<SNR>\d\+'),
+ \ a:namespace, name], '_'))
+ endfor
+ return dict
+endfunction
+
+function! snipmate#util#eval(arg)
+ try
+ let ret = eval(a:arg)
+ catch
+ echohl ErrorMsg
+ echom 'SnipMate:Expression: ' . v:exception
+ echohl None
+ let ret = ''
+ endtry
+ return type(ret) == type('') ? ret : string(ret)
+endfunction
+
+function! snipmate#util#tabwidth()
+ if &sts > 0
+ return &sts
+ else
+ return exists('*shiftwidth') ? shiftwidth() : &sw
+ endif
+endfunction
diff --git a/vim/bundle/vim-snipmate/doc/SnipMate.txt b/vim/bundle/vim-snipmate/doc/SnipMate.txt
new file mode 100644
index 0000000..230fe68
--- /dev/null
+++ b/vim/bundle/vim-snipmate/doc/SnipMate.txt
@@ -0,0 +1,646 @@
+*SnipMate.txt* Plugin for using TextMate-style snippets in Vim.
+
+SnipMate *snippet* *snippets* *SnipMate*
+
+1. Description |SnipMate-description|
+2. Usage |SnipMate-usage|
+3. Interface and Settings |SnipMate-interface| |SnipMate-settings|
+4. Snippets |SnipMate-snippets|
+ - Snippet files |SnipMate-snippet-files|
+ - Snippet syntax |SnipMate-syntax|
+5. Snippet sources |SnipMate-snippet-sources|
+6. Disadvantages to TextMate |SnipMate-disadvantages|
+7. Contact |SnipMate-contact|
+8. License |SnipMate-license|
+
+For Vim version 7.0 or later.
+This plugin only works if 'compatible' is not set.
+{Vi does not have any of these features.}
+
+SnipMate depends on vim-addon-mw-utils and tlib.
+
+==============================================================================
+DESCRIPTION *SnipMate-description*
+
+SnipMate implements snippet features in Vim. A snippet is like a template,
+reducing repetitive insertion of pieces of text. Snippets can contain
+placeholders for modifying the text if necessary or interpolated code for
+evaluation. For example, in C, typing "for" then pushing <Tab> could expand
+to: >
+
+ for (i = 0; i < count; i++) {
+ /* code */
+ }
+
+SnipMate is inspired by TextMate's snippet features.
+
+==============================================================================
+USAGE *SnipMate-usage*
+
+Every snippet consists of an expansion and a trigger. Typing a trigger into
+your buffer and then hitting your trigger key (<Tab> by default, see
+|SnipMate-mappings|) will replace the trigger with the expansion text.
+
+The expansion text can optionally include tab stops. When it does, upon
+expansion of the snippet, the cursor is placed at the first one, and the user
+can jump between each tab stop. Each of these tab stops can be represented by
+default placeholder text. If such a placeholder is provided, then the text of
+the placeholder can be repeated in the snippet at specified mirrors. Any edits
+to the placeholder are instantly updated at every mirror.
+
+SnipMate allows multiple snippets to use the same trigger. When triggered,
+a list of all snippets with that trigger is provided and prompts for which
+snippet to use.
+
+ *SnipMate-scopes*
+SnipMate searches for snippets inside a directory named "snippets" inside each
+entry in 'runtimepath'. Which files are loaded depends on 'filetype' and
+'syntax'; see |SnipMate-syntax| for more information. Snippets are loaded and
+refreshed automatically on demand.
+
+Note: SnipMate does not ship with any snippets. In order to use it, the user
+must either write their own snippets or obtain some from a repository like
+https://github.com/honza/vim-snippets
+
+==============================================================================
+INTERFACE AND SETTINGS *SnipMate-interface* *SnipMate-settings*
+
+ *SnipMate-commands*
+Commands~
+
+ *:SnipMateOpenSnippetFiles*
+:SnipMateOpenSnippetFiles Opens a list of all valid snippet locations
+ based on the current scope |SnipMate-scopes|.
+ Only existing files and non-existing .snippets
+ files will be shown, with the existing files
+ shown first.
+
+:SnipMateLoadScope[!] scope [scope ...]
+ Load snippets from additional scopes. Without
+ [!] the additional scopes are loaded only in
+ the current buffer. For example >
+ :SnipMateLoadScopes rails
+< will load all rails.snippets in the current
+ buffer.
+
+ *SnipMate-options*
+Options~
+
+g:snips_author A variable used in some snippets in place of
+ the author's (your) name. Similar to
+ $TM_FULLNAME in TextMate. For example, >
+ snippet name
+ `g:snips_author`
+< creates a snippet "name" that expands to your
+ name.
+
+g:snipMate This |Dictionary| contains other SnipMate
+ options. In short add >
+ let g:snipMate = {}
+< to your .vimrc before setting other SnipMate
+ options.
+
+g:snipMate.scope_aliases A |Dictionary| associating certain filetypes
+ with other scopes |SnipMate-scopes|. The
+ entries consist of a filetype as the key and
+ a comma-separated list of aliases as the
+ value. For example, >
+ let g:snipMate.scope_aliases = {}
+ let g:snipMate.scope_aliases['ruby']
+ \ = 'ruby,ruby-rails'
+< tells SnipMate that "ruby-rails" snippets in
+ addition to "ruby" snippets should be loaded
+ when editing files with 'filetype' set to
+ "ruby" or contains "ruby" as an entry in the
+ case of dotted filetypes. A buffer local
+ variant b:snipMate_scope_aliases is merged
+ with the global variant.
+
+g:snipMate_no_default_aliases Note: This has been renamed to the following.
+
+g:snipMate.no_default_aliases
+ When set to 1, prevents SnipMate from loading
+ default scope aliases. The defaults are:
+ Filetype Alias ~
+ cpp c
+ cu c
+ eruby eruby-rails,html
+ html javascript
+ mxml actionscript
+ objc c
+ php php,html,javascript
+ ur html,javascript
+ xhtml html
+ Individual defaults can be disabled by setting
+ them to an empty value: >
+ let g:snipMate.scope_aliases.php = ''
+< will disable the default PHP alias.
+ Note: Setting this option does not disable
+ scope aliases entirely, only those made by
+ SnipMate itself. Any scope aliases created by
+ the user or someone else will still be in
+ effect.
+
+g:snipMate.snippet_version
+ The snippet parser version to use. The
+ possible values are:
+ 0 Use the older parser
+ 1 Use the newer parser
+ If unset, SnipMate defaults to version 0. The
+ value of this option is also used for all
+ .snippet files.
+
+g:snipMate.override
+ As detailed below, when two snippets with the
+ same name and description are loaded, both are
+ kept and differentiated by the location of the
+ file they were in. When this option is enabled
+ (set to 1), the snippet originating in the
+ last loaded file is kept, similar to how Vim
+ maps and other settings work. Note: Load order
+ is determined by 'runtimepath'.
+
+g:snipMate['no_match_completion_feedkeys_chars']
+ A string inserted when no match for a trigger
+ is found. By default a tab is inserted
+ according to 'expandtab', 'tabstop', and
+ 'softtabstop'. Set it to the empty string to
+ prevent anything from being inserted.
+
+ *SnipMate-mappings*
+Mappings~
+
+The mappings SnipMate uses can be customized with the |:map| commands. For
+example, to change the key that triggers snippets and moves to the next
+tab stop, >
+
+ :imap <C-J> <Plug>snipMateNextOrTrigger
+ :smap <C-J> <Plug>snipMateNextOrTrigger
+
+Note: The noremap variants of the map commands must NOT be used.
+
+The list of possible <Plug> mappings is as follows:
+
+<Plug>snipMateNextOrTrigger Default: <Tab> Mode: Insert, Select
+ Jumps to the next tab stop or, if none exists,
+ try to expand a snippet. Use in both insert
+ and select modes.
+
+<Plug>snipMateTrigger Default: unmapped Mode: Insert
+ Try to expand a snippet regardless of any
+ existing snippet expansion. If done within an
+ expanded snippet, the outer snippet's tab
+ stops are lost, unless expansion failed.
+
+<Plug>snipMateBack Default: <S-Tab> Mode: Insert, Select
+ Jump to the previous tab stop, if it exists.
+ Use in both insert and select modes.
+
+<Plug>snipMateShow Default: <C-R><Tab> Mode: Insert
+ Show all available snippets (that start with
+ the previous text, if it exists). Use in
+ insert mode.
+
+<Plug>snipMateVisual Default: <Tab> Mode: Visual
+ See |SnipMate-visual|.
+
+Additionally, <CR> is mapped in visual mode in .snippets files for retabbing
+snippets.
+
+==============================================================================
+SNIPPETS *SnipMate-snippets*
+
+ *SnipMate-snippet-files*
+Snippet Files ~
+
+Note: SnipMate does not ship with any snippets.
+
+SnipMate looks inside of each entry of 'rtp' (or |SnipMate-snippet-sources|)
+for a directory named /snippets/. Based on the 'filetype' and 'syntax'
+settings (dotted filetypes are parsed), the following files are read for
+snippets: >
+
+ .../snippets/<scope>.snippets
+ .../snippets/<scope>_<name>.snippets
+ .../snippets/<scope>/<name>.snippets
+ .../snippets/<scope>/<trigger>.snippet
+ .../snippets/<scope>/<trigger>/<description>.snippet
+
+where <scope> is a scope or 'filetype' or 'syntax', <name> is an arbitrary
+name, <trigger> is the trigger for a snippet, and <description> is
+a description used for |SnipMate-multisnip|.
+
+A .snippet file defines a single snippet with the trigger (and description)
+determined by the filename. The entire contents of the file are used as the
+snippet expansion text.
+
+Multiple snippets can be defined in *.snippets files. Each snippet definition
+looks something like: >
+
+ snippet trigger optional description
+ expanded text
+ more expanded text
+
+< *SnipMate-multisnip*
+The description is optional. If it is left out, the description "default" is
+used. When two snippets in the same scope have the same name and the same
+description, SnipMate will try to preserve both. The g:snipMate.override
+option disables this, in favor of keeping the last-loaded snippet. This can be
+overridden on a per-snippet basis by defining the snippet with a bang (!): >
+
+ snippet! trigger optional description
+ expanded text
+ more expanded text
+
+Two bangs will remove the trigger entirely from SnipMate's lookup. In this
+case any snippet text is unused.
+
+Note: Hard tabs in the expansion text are required. When the snippet is
+expanded in the text and 'expandtab' is set, each tab will be replaced with
+spaces based on 'softtabstop' if nonzero or 'shiftwidth' otherwise.
+
+Which version parser the snippets in a file should be used with can be
+specified with a version line, e.g.: >
+
+ version 1
+
+Specification of a version applies to the snippets following it. Multiple
+version specifications can appear in a single file to intermix version 0 and
+version 1 snippets.
+
+Comments can be made in .snippets files by starting a line with a # character.
+However these can't be used inside of snippet definitions: >
+
+ # this is a correct comment
+ snippet trigger
+ expanded text
+ snippet another_trigger
+ # this isn't a comment!
+ expanded text
+
+This should hopefully be clear with the included syntax highlighting.
+
+ *snipMate-extends*
+Borrowing from UltiSnips, .snippets files can also contain an extends
+directive, for example: >
+
+ extends html, javascript, css
+
+will tell SnipMate to also read html, javascript, and css snippets.
+
+SNIPPET SYNTAX *snippet-syntax* *SnipMate-syntax*
+
+Anywhere in a snippet, a backslash escapes the character following it,
+regardless of whether that character is special or not. That is, '\a' will
+always result in an 'a' in the output. A single backslash can be output by
+using '\\'.
+
+ *SnipMate-tabstops*
+Tab stops~
+
+When triggering a snippet, SnipMate will by default jump to the very end of
+the snippet text. This can be changed through the use of tab stops: $1, $2,
+and so on. After expansion, SnipMate will jump to the first tab stop. From
+then on, the <Plug>snipMateNextOrTrigger map will jump to the next higher
+numbered tabs top.
+
+In the case of an ambiguity, for example if a stop occurs just before
+a literal number, braces may be placed around the stop number to resolve it:
+${3}79 is the third tab stop followed by the string "79".
+
+NOTE: In the version 0 snippet parser, the braces are mandatory.
+
+ *SnipMate-zero-tabstop*
+SnipMate will always stop at the special zero tab stop $0. Once it jumps to
+the zero tab stop, snippet expansion is finished. If the zero tab stop is not
+present in a definition, it will be put at the end.
+
+For example, to place the cursor first on the id of a <div> tag, then on its
+class, and finally end editing its contents: >
+
+ snippet div
+ <div id="$1" class="$2">
+ $0
+ </div>
+
+< *SnipMate-placeholders*
+In addition to being simply a location, each tab stop contains a placeholder,
+or some default text. The placeholder can be specified for every tab stop
+(including the zero tab stop) with a colon after the stop ID, as in
+${1:default text}. The braces are required only when specifying a placeholder.
+Once a tab stop with a placeholder is reached, the placeholder will be
+selected in |Select-mode|. For example, >
+
+ snippet div
+ <div id="${1:id}" class="${2:class}">
+ $0
+ </div>
+
+Finally, placeholders can contain mirrors and evaluations (detailed below) and
+even entire other tab stops. If the placeholder is edited, then these nested
+tab stops are removed and skipped entirely. For example, >
+
+ snippet div
+ <div${1: id="${2:id}"}${3: class="${4:class}"}>
+ $0
+ </div>
+
+When expanded, this snippet selects the entirety of the id attribute. If this
+stop is edited, then the second tab stop is removed and the third tab stop
+becomes the next one. If the first tab stop is left unedited, then SnipMate
+jumps to the second tab stop. This allows the user to use a single div snippet
+that can be used for instances where the id or class attributes are desired
+and those where they are not.
+
+ *SnipMate-mirrors*
+Mirrors~
+
+A mirror is simply a copy of a tab stop's text, updated as the tab stop is
+edited. These look like a tab stop without a placeholder; $1 for example. In
+the event that no placeholder is specified for a certain tab stop--say $1--the
+first instance becomes the tab stop and the rest become mirrors.
+
+Additionally substitutions similar to |:substitute| can be performed. For
+instance ${1/foo/bar/g} will replace all instances of "foo" in the $1 mirror
+with "bar". This uses |substitute()| behind the scenes.
+
+Note: Just like with tab stops, braces can be used to avoid ambiguities: ${1}2
+is a mirror of the first tab stop followed by a 2. Version 0 of the snippet
+parser offers no way to resolve such ambiguities.
+
+As an example, >
+
+ snippet for
+ for ($1 = ${2:start}; ${1:i} < ${3:end}; $1${4:++}) {
+ ${0:/* code */}
+ }
+
+< *SnipMate-eval*
+Expression Evaluation~
+
+Snippets can contain Vim script expressions that are evaluated as the snippet
+is expanded. Expressions are specified inside backticks: >
+
+ snippet date
+ `strftime("%Y-%m-%d")`
+
+If the expression results in any Vim error, the error will be displayed (or
+found in :messages) and the result of the expression will be the empty string.
+
+Filename([{expr}] [, {defaultText}]) *SnipMate-Filename()*
+
+Since the current filename is used often in snippets, a default function
+has been defined for it in SnipMate.vim, appropriately called Filename().
+
+With no arguments, the default filename without an extension is returned;
+the first argument specifies what to place before or after the filename,
+and the second argument supplies the default text to be used if the file
+has not been named. "$1" in the first argument is replaced with the filename;
+if you only want the filename to be returned, the first argument can be left
+blank. Examples: >
+
+ snippet filename
+ `Filename()`
+ snippet filename_with_default
+ `Filename('', 'name')`
+ snippet filename_foo
+ `Filename('$1_foo')`
+
+The first example returns the filename if it the file has been named, and an
+empty string if it hasn't. The second returns the filename if it's been named,
+and "name" if it hasn't. The third returns the filename followed by "_foo" if
+it has been named, and an empty string if it hasn't.
+
+ *SnipMate-visual*
+The VISUAL Stop~
+
+While tab stops have numeric IDs, a special one exists with the ID 'VISUAL'.
+When a snippet is expanded, if any text had been grabbed with the
+snipMateVisual mapping (see |SnipMate-mappings|), all instances of the VISUAL
+stop will be replaced with it. Both transformations as well as a default
+placeholder can be used with the VISUAL stop.
+
+Note: Both $VISUAL and ${VISUAL} are valid in version 1 of the snippet parser.
+In version 0, only {VISUAL} is valid (without the $), and neither
+transformations nor a default placeholder can be used.
+
+Example: >
+
+ snippet div
+ <div>
+ ${0:${VISUAL:<!-- content -->}}
+ </div>
+
+==============================================================================
+SNIPPET SOURCES *SnipMate-snippet-sources*
+
+SnipMate is configurable.
+
+plugin/SnipMate.vim assigns a couple important keys: >
+
+ " default implementation collecting snippets by handlers
+ let g:SnipMate['get_snippets'] = SnipMate#GetSnippets
+ " default handler:
+ let g:SnipMateSources['default'] = SnipMate#DefaultPool
+
+You can override both of those settings.
+
+You can see that the default set of snippets is determined by Vim's 'rtp'.
+
+Example 1:~
+autoload/SnipMate_python_demo.vim shows how you can register additional
+sources such as creating snippets on the fly representing python function
+definitions found in the current file.
+
+Example 2:~
+Add to your ~/.vimrc: For each know snippet add a second version ending in _
+adding folding markers >
+
+ let g:commentChar = {
+ \ 'vim': '"',
+ \ 'c': '//',
+ \ 'cpp': '//',
+ \ 'sh': '#',
+ \ 'python': '#'
+ \ }
+ " url https://github.com/garbas/vim-snipmate/issues/49
+ fun! AddFolding(text)
+ return substitute(a:text,'\n'," ".g:commentChar[&ft]." {{{\n",1)."\n".g:commentChar[&ft]." }}}"
+ endf
+
+ fun! SnippetsWithFolding(scopes, trigger, result)
+ " hacky: temporarely remove this function to prevent infinite recursion:
+ call remove(g:SnipMateSources, 'with_folding')
+ " get list of snippets:
+ let result = SnipMate#GetSnippets(a:scopes, substitute(a:trigger,'_\(\*\)\?$','\1',''))
+ let g:SnipMateSources['with_folding'] = funcref#Function('SnippetsWithFolding')
+
+ " add folding:
+ for k in keys(result)
+ let a:result[k.'_'] = map(result[k],'AddFolding(v:val)')
+ endfor
+ endf
+
+ " force setting default:
+ runtime plugin/SnipMate.vim
+ " add our own source
+ let g:SnipMateSources['with_folding'] = funcref#Function('SnippetsWithFolding')
+
+See |SnipMate-syntax| for more details about all possible relative locations
+to 'rtp' can be found in.
+
+==============================================================================
+KNOWN ISSUES *SnipMate-known-issues*
+
+SnipMate.vim currently has the following disadvantages to TextMate's snippets:
+ - Placeholders cannot span multiple lines.
+ - Activating snippets in different scopes of the same file is
+ not possible.
+ - Vim formatting with fo=t or fo=a can mess up SnipMate.
+
+Perhaps some of these features will be added in a later release.
+
+==============================================================================
+CHANGELOG *SnipMate-changelog*
+
+0.89 - 2016-05-29
+-----------------
+
+* Various regex updates to legacy parser Addition of double bang syntax to
+* completely remove a snippet from lookup Group various SnipMate autocommands
+* Support setting 'shiftwidth' to 0 Parser now operates linewise, adding some
+* flexibility Mirror substitutions are more literal Mirror length is
+* calculated correctly when substitutions occur
+
+0.88 - 2015-04-04
+-----------------
+
+* Implement simple caching
+* Remove expansion guards
+* Add `:SnipMateLoadScope` command and buffer-local scope aliases
+* Load `<scope>_*.snippets` files
+* Use CursorMoved autocmd events entirely
+
+* The nested branch has been merged
+ * A new snippet parser has been added. The g:snipmate.version as well as
+ version lines in snippet files determines which is used
+ * The new parser supports tab stops placed within placeholders,
+ substitutions, non-consecutive stop numbers, and fewer ambiguities
+ * The stop jumping code has been updated
+ * Tests have been added for the jumping code and the new parser
+
+* The override branch has been merged
+ * The g:snipMate.override option is added. When enabled, if two snippets
+ share the same name, the later-loaded one is kept and the other discarded
+ * Override behavior can be enabled on a per-snippet basis with a bang (!) in
+ the snippet file
+ * Otherwise, SnipMate tries to preserve all snippets loaded
+
+* Fix bug with mirrors in the first column
+* Fix bug with tabs in indents
+ <http://github.com/garbas/vim-snipmate/issues/143>
+* Fix bug with mirrors in placeholders
+* Fix reading single snippet files
+* Fix the use of the visual map at the end of a line
+* Fix expansion of stops containing only the zero tab stop
+* Remove select mode mappings
+* Indent visual placeholder expansions and remove extraneous lines
+ <http://github.com/garbas/vim-snipmate/issues/177>
+ <http://github.com/garbas/vim-snipmate/issues/178>
+
+0.87 - 2014-01-04
+-----------------
+
+* Stop indenting empty lines when expanding snippets
+* Support extends keyword in .snippets files
+* Fix visual placeholder support
+* Add zero tabstop support
+* Support negative 'softtabstop'
+* Add g:snipMate_no_default_aliases option
+* Add <Plug>snipMateTrigger for triggering an expansion inside a snippet
+* Add snipMate#CanBeTriggered() function
+
+0.86 - 2013-06-15
+-----------------
+* Use more idiomatic <Plug> maps
+* Remove most select mode mappings
+
+* Fix disappearing variables bug (hpesoj)
+* Fix cursor position bug when a variable is on the same line as the stop
+* Fix undo point creation causing problems with Supertab
+* Fix bug where SnipMate would use a typed trigger as a regular expression
+
+0.85 - 2013-04-03
+-----------------
+
+* Allow trigger key customization
+* Enable undoing of snippet expansion
+* Support backslash escaping in snippets
+* Add support for {VISUAL}
+* Expand filetype extension with scope_aliases
+* Add expansion guards
+* Enable per-buffer expansion of snippets
+* Fix 'cpo' compatibility
+* Update supertab compatibility
+* Enable customization of various things through g:SnipMate
+
+* Disable spelling in snippet files
+* Highlight trigger names in .snippets files
+
+* Update many snippets
+* Separate sample snippets into separate repository
+
+0.84
+----
+
+* Unreleased version by Michael Sanders, available on his GitHub,
+ <https://github.com/msanders/snipmate.vim>
+
+0.83 - 2009-07-13
+-----------------
+
+* Last release done by Michael Sanders, available at
+ <http://www.vim.org/scripts/script.php?script_id=2540>
+
+==============================================================================
+CONTACT *SnipMate-contact* *SnipMate-author*
+
+SnipMate is currently maintained by:
+ - Rok Garbas
+ - Marc Weber (marco-oweber@gmx.de)
+ - Adnan Zafar
+
+For bug reports, issues, or questions, check out the Issues page on GitHub:
+https://github.com/garbas/vim-snipmate/issues
+
+The original author, Michael Sanders, can be reached at:
+msanders42+snipmate <at> gmail <dot> com
+
+
+==============================================================================
+LICENSE *SnipMate-license*
+
+SnipMate is released under the MIT license:
+
+Copyright 2009-2010 Michael Sanders. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The software is provided "as is", without warranty of any kind, express or
+implied, including but not limited to the warranties of merchantability,
+fitness for a particular purpose and noninfringement. In no event shall the
+authors or copyright holders be liable for any claim, damages or other
+liability, whether in an action of contract, tort or otherwise, arising from,
+out of or in connection with the software or the use or other dealings in the
+software.
+
+==============================================================================
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/bundle/vim-snipmate/ftplugin/html_snip_helper.vim b/vim/bundle/vim-snipmate/ftplugin/html_snip_helper.vim
new file mode 100644
index 0000000..4d52392
--- /dev/null
+++ b/vim/bundle/vim-snipmate/ftplugin/html_snip_helper.vim
@@ -0,0 +1,10 @@
+" Helper function for (x)html snippets
+if exists('s:did_snip_helper') || &cp || !exists('loaded_snips')
+ finish
+endif
+let s:did_snip_helper = 1
+
+" Automatically closes tag if in xhtml
+fun! Close() abort
+ return stridx(&ft, 'xhtml') == -1 ? '' : ' /'
+endf
diff --git a/vim/bundle/vim-snipmate/ftplugin/snippets.vim b/vim/bundle/vim-snipmate/ftplugin/snippets.vim
new file mode 100644
index 0000000..dde00e4
--- /dev/null
+++ b/vim/bundle/vim-snipmate/ftplugin/snippets.vim
@@ -0,0 +1,20 @@
+" Vim filetype plugin for SnipMate snippets (.snippets and .snippet files)
+
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl et< sts< cms< fdm< fde<"
+
+" Use hard tabs
+setlocal noexpandtab softtabstop=0
+
+setlocal foldmethod=expr foldexpr=getline(v:lnum)!~'^\\t\\\\|^$'?'>1':1
+
+setlocal commentstring=#\ %s
+setlocal nospell
+
+command! -buffer -range=% RetabSnip
+ \ echom "This command is deprecated. Use :retab and = instead. Doing that now."
+ \ | <line1>,<line2>retab! | <line1>,<line2>normal =
diff --git a/vim/bundle/vim-snipmate/indent/snippets.vim b/vim/bundle/vim-snipmate/indent/snippets.vim
new file mode 100644
index 0000000..0d28f32
--- /dev/null
+++ b/vim/bundle/vim-snipmate/indent/snippets.vim
@@ -0,0 +1,32 @@
+" Simple indent support for SnipMate snippets files
+
+if exists('b:did_indent')
+ finish
+endif
+let b:did_indent = 1
+
+setlocal nosmartindent
+setlocal indentkeys=!^F,o,O,=snippet,=version,=extends
+setlocal indentexpr=GetSnippetIndent()
+
+if exists("*GetSnippetIndent")
+ finish
+endif
+
+function! GetSnippetIndent()
+ let line = getline(v:lnum)
+ let prev_lnum = v:lnum - 1
+ let prev_line = prev_lnum != 0 ? getline(prev_lnum) : ""
+
+ if line =~# '\v^(snippet|extends|version) '
+ return 0
+ elseif indent(v:lnum) > 0
+ return indent(v:lnum)
+ elseif prev_line =~# '^snippet '
+ return &sw
+ elseif indent(prev_lnum) > 0
+ return indent(prev_lnum)
+ endif
+
+ return 0
+endfunction
diff --git a/vim/bundle/vim-snipmate/plugin/snipMate.vim b/vim/bundle/vim-snipmate/plugin/snipMate.vim
new file mode 100644
index 0000000..837f0dc
--- /dev/null
+++ b/vim/bundle/vim-snipmate/plugin/snipMate.vim
@@ -0,0 +1,137 @@
+" File: snipMate.vim
+" Description: snipMate.vim implements some of TextMate's snippets features in
+" Vim. A snippet is a piece of often-typed text that you can
+" insert into your document using a trigger word followed by a "<tab>".
+"
+" For more help see snipMate.txt; you can do this by using:
+" :helptags ~/.vim/doc
+" :h SnipMate
+
+if exists('loaded_snips') || &cp || version < 700
+ finish
+endif
+let loaded_snips = 1
+
+" Save and reset 'cpo'
+let s:save_cpo = &cpo
+set cpo&vim
+
+try
+ call funcref#Function('')
+catch /.*/
+ echoe "you're missing vim-addon-mw-utils. See install instructions at ".expand('<sfile>:h:h').'/README.md'
+endtry
+
+if (!exists('g:snipMateSources'))
+ let g:snipMateSources = {}
+ " Default source: get snippets based on runtimepath
+ let g:snipMateSources['default'] = funcref#Function('snipMate#DefaultPool')
+endif
+
+augroup SnipMateDetect
+ au BufRead,BufNewFile *.snippet,*.snippets setlocal filetype=snippets
+ au FileType snippets if expand('<afile>:e') =~# 'snippet$'
+ \ | setlocal syntax=snippet
+ \ | else
+ \ | setlocal syntax=snippets
+ \ | endif
+augroup END
+
+inoremap <silent> <Plug>snipMateNextOrTrigger <C-R>=snipMate#TriggerSnippet()<CR>
+snoremap <silent> <Plug>snipMateNextOrTrigger <Esc>a<C-R>=snipMate#TriggerSnippet()<CR>
+inoremap <silent> <Plug>snipMateTrigger <C-R>=snipMate#TriggerSnippet(1)<CR>
+inoremap <silent> <Plug>snipMateBack <C-R>=snipMate#BackwardsSnippet()<CR>
+snoremap <silent> <Plug>snipMateBack <Esc>a<C-R>=snipMate#BackwardsSnippet()<CR>
+inoremap <silent> <Plug>snipMateShow <C-R>=snipMate#ShowAvailableSnips()<CR>
+xnoremap <silent> <Plug>snipMateVisual :<C-U>call <SID>grab_visual()<CR>gv"_c
+
+" config variables
+if !exists('g:snips_author')
+ let g:snips_author = 'Me'
+endif
+if !exists('g:snipMate')
+ let g:snipMate = {}
+endif
+
+" SnipMate inserts this string when no snippet expansion can be done
+let g:snipMate['no_match_completion_feedkeys_chars'] =
+ \ get(g:snipMate, 'no_match_completion_feedkeys_chars', "\t")
+
+" Add default scope aliases, without overriding user settings
+let g:snipMate.scope_aliases = get(g:snipMate, 'scope_aliases', {})
+if exists('g:snipMate_no_default_aliases')
+ echom 'The g:snipMate_no_default_aliases option has been renamed.'
+ \ 'See :h snipMate-options.'
+endif
+if (!exists('g:snipMate_no_default_aliases') || !g:snipMate_no_default_aliases)
+ \ && (!exists('g:snipMate.no_default_aliases')
+ \ || !g:snipMate.no_default_aliases)
+ let g:snipMate.scope_aliases.objc =
+ \ get(g:snipMate.scope_aliases, 'objc', 'c')
+ let g:snipMate.scope_aliases.cpp =
+ \ get(g:snipMate.scope_aliases, 'cpp', 'c')
+ let g:snipMate.scope_aliases.cu =
+ \ get(g:snipMate.scope_aliases, 'cu', 'c')
+ let g:snipMate.scope_aliases.xhtml =
+ \ get(g:snipMate.scope_aliases, 'xhtml', 'html')
+ let g:snipMate.scope_aliases.html =
+ \ get(g:snipMate.scope_aliases, 'html', 'javascript')
+ let g:snipMate.scope_aliases.php =
+ \ get(g:snipMate.scope_aliases, 'php', 'php,html,javascript')
+ let g:snipMate.scope_aliases.ur =
+ \ get(g:snipMate.scope_aliases, 'ur', 'html,javascript')
+ let g:snipMate.scope_aliases.mxml =
+ \ get(g:snipMate.scope_aliases, 'mxml', 'actionscript')
+ let g:snipMate.scope_aliases.eruby =
+ \ get(g:snipMate.scope_aliases, 'eruby', 'eruby-rails,html')
+ let g:snipMate.scope_aliases.scss =
+ \ get(g:snipMate.scope_aliases, 'scss', 'css')
+ let g:snipMate.scope_aliases.less =
+ \ get(g:snipMate.scope_aliases, 'less', 'css')
+endif
+
+let g:snipMate['get_snippets'] = get(g:snipMate, 'get_snippets', funcref#Function("snipMate#GetSnippets"))
+
+" List of paths where snippets/ dirs are located
+let g:snipMate['snippet_dirs'] = get(g:snipMate, 'snippet_dirs', split(&rtp, ','))
+if type(g:snipMate['snippet_dirs']) != type([])
+ echohl WarningMsg
+ echom "g:snipMate['snippet_dirs'] must be a List"
+ echohl None
+endif
+
+" _ is default scope added always
+"
+" &ft honors multiple filetypes and syntax such as in set ft=html.javascript syntax=FOO
+let g:snipMate['get_scopes'] = get(g:snipMate, 'get_scopes', funcref#Function('return split(&ft,"\\.")+[&syntax, "_"]'))
+
+" Modified from Luc Hermitte's function on StackOverflow
+" <http://stackoverflow.com/a/1534347>
+function! s:grab_visual() abort
+ let a_save = @a
+ try
+ normal! gv"ay
+ let b:snipmate_visual = @a
+ finally
+ let @a = a_save
+ endtry
+endfunction
+
+" TODO: Allow specifying an arbitrary snippets file
+function! s:load_scopes(bang, ...) abort
+ let gb = a:bang ? g: : b:
+ let gb.snipMate = get(gb, 'snipMate', {})
+ let gb.snipMate.scope_aliases = get(gb.snipMate, 'scope_aliases', {})
+ let gb.snipMate.scope_aliases['_'] = join(split(get(gb.snipMate.scope_aliases, '_', ''), ',') + a:000, ',')
+endfunction
+
+command! -bang -bar -nargs=+ SnipMateLoadScope
+ \ call s:load_scopes(<bang>0, <f-args>)
+
+" Edit snippet files
+command! SnipMateOpenSnippetFiles call snipMate#OpenSnippetFiles()
+
+" restore 'cpo'
+let &cpo = s:save_cpo
+
+" vim:noet:sw=4:ts=4:ft=vim
diff --git a/vim/bundle/vim-snipmate/syntax/snippet.vim b/vim/bundle/vim-snipmate/syntax/snippet.vim
new file mode 100644
index 0000000..a947356
--- /dev/null
+++ b/vim/bundle/vim-snipmate/syntax/snippet.vim
@@ -0,0 +1,11 @@
+" Syntax highlighting for .snippet files (used for snipMate.vim)
+" Hopefully this should make snippets a bit nicer to write!
+syn match placeHolder '\${\d\+\(:.\{-}\)\=}' contains=snipCommand
+syn match tabStop '\$\d\+'
+syn match snipEscape '\\\\\|\\`'
+syn match snipCommand '\%(\\\@<!\%(\\\\\)*\)\@<=`.\{-}\%(\\\@<!\%(\\\\\)*\)\@<=`'
+
+hi link placeHolder Special
+hi link tabStop Special
+hi link snipEscape SpecialChar
+hi link snipCommand String
diff --git a/vim/bundle/vim-snipmate/syntax/snippets.vim b/vim/bundle/vim-snipmate/syntax/snippets.vim
new file mode 100644
index 0000000..63bda4e
--- /dev/null
+++ b/vim/bundle/vim-snipmate/syntax/snippets.vim
@@ -0,0 +1,23 @@
+" Syntax highlighting for .snippets files (used for snipMate.vim)
+" Hopefully this should make snippets a bit nicer to write!
+syn match snipComment '^#.*'
+syn match placeHolder '\${\d\+\(:.\{-}\)\=}' contains=snipCommand
+syn match tabStop '\$\d\+'
+syn match snipEscape '\\\\\|\\`'
+syn match snipCommand '\%(\\\@<!\%(\\\\\)*\)\@<=`.\{-}\%(\\\@<!\%(\\\\\)*\)\@<=`'
+syn match snippet '^snippet.*' contains=multiSnipText,snipKeyword
+syn match snippet '^extends.*' contains=snipKeyword
+syn match snippet '^version.*' contains=snipKeyword
+syn match multiSnipText '\S\+ \zs.*' contained
+syn match snipKeyword '^(snippet|extends|version)'me=s+8 contained
+syn match snipError "^[^#vse\t].*$"
+
+hi link snippet Identifier
+hi link snipComment Comment
+hi link multiSnipText String
+hi link snipKeyword Keyword
+hi link snipEscape SpecialChar
+hi link placeHolder Special
+hi link tabStop Special
+hi link snipCommand String
+hi link snipError Error
diff --git a/vim/bundle/vim-snipmate/t/jumping.vim b/vim/bundle/vim-snipmate/t/jumping.vim
new file mode 100644
index 0000000..1c3ab0d
--- /dev/null
+++ b/vim/bundle/vim-snipmate/t/jumping.vim
@@ -0,0 +1,175 @@
+function! Setup(snip) abort
+ return snipMate#expandSnip(join(a:snip, "\n"), 1)
+endfunction
+
+function! s:to_be_file(expected) abort
+ return a:expected == getline(1,'$')
+endfunction
+
+function! s:to_be_in(item, list) abort
+ return !empty(filter(copy(a:list), 'v:val is a:item'))
+endfunction
+
+call vspec#customize_matcher('to_be_file', function('s:to_be_file'))
+call vspec#customize_matcher('to_be_in', function('s:to_be_in'))
+
+describe 'snippet state'
+
+ before
+ enew
+ let b:snip_state = snipmate#jumping#state()
+ end
+
+ after
+ bwipeout!
+ end
+
+ describe '.remove()'
+
+ it 'removes the state object'
+ Expect exists('b:snip_state') to_be_true
+ call b:snip_state.remove()
+ Expect exists('b:snip_state') to_be_false
+ end
+
+ it 'removes snippet related autocommands'
+ function! ReadAutocmds()
+ redir => autocmds
+ 0verbose au snipmate_changes * <buffer>
+ redir END
+ return split(autocmds, "\n")
+ endfunction
+ aug snipmate_changes
+ au CursorMoved,CursorMovedI <buffer> echo 'event'
+ aug END
+
+ Expect len(ReadAutocmds()) > 1
+ call b:snip_state.remove()
+ Expect len(ReadAutocmds()) == 1
+ end
+
+ end
+
+ describe '.find_next_stop()'
+
+ it 'increments/decrements the stop_no'
+ let b:snip_state.stops = { 1 : {}, 2 : {} }
+ let b:snip_state.stop_no = 1
+ let b:snip_state.stop_count = 4
+
+ call b:snip_state.find_next_stop(0)
+ Expect b:snip_state.stop_no == 2
+ call b:snip_state.find_next_stop(1)
+ Expect b:snip_state.stop_no == 1
+ end
+
+ it 'continues iterating if the next/previous stop does not exist'
+ let b:snip_state.stops = { 3 : {} }
+ let b:snip_state.stop_count = 6
+ let b:snip_state.stop_no = 1
+ call b:snip_state.find_next_stop(0)
+ Expect b:snip_state.stop_no == 3
+ let b:snip_state.stop_no = 5
+ call b:snip_state.find_next_stop(1)
+ Expect b:snip_state.stop_no == 3
+ end
+
+ it 'does something at the ends'
+ "
+ end
+
+ end
+
+ describe '.remove_nested()'
+
+ it 'removes nested mirrors and only nested mirrors'
+ let mirror = { 'line' : 0 }
+ let b:snip_state.stops = { 1 : { 'placeholder' : [[2, mirror]] },
+ \ 2 : { 'mirrors' : [mirror, {}] } }
+
+ call b:snip_state.remove_nested(1)
+ Expect len(b:snip_state.stops[2].mirrors) == 1
+ Expect b:snip_state.stops[2].mirrors[0] isnot mirror
+ end
+
+ it 'removes nested stops'
+ let stop = [2, 'abc']
+ let b:snip_state.stops = { 1 : { 'placeholder' : [stop] },
+ \ 2 : { 'placeholder' : stop[1:1] } }
+
+ call b:snip_state.remove_nested(1)
+ Expect len(b:snip_state.stops) == 1
+ Expect keys(b:snip_state.stops) == ['1']
+ end
+
+ end
+
+ describe '.find_update_objects()'
+
+ it 'finds mirrors/stops on the same line and after cur_stop'
+ let b:snip_state.stops = {
+ \ 1 : { 'line' : 1, 'col' : 5,
+ \ 'placeholder' : ['x'] },
+ \ 2 : { 'line' : 1, 'col' : 7,
+ \ 'mirrors' : [{ 'line' : 1, 'col' : 7 }] }
+ \ }
+ let stop = b:snip_state.stops[1]
+
+ call b:snip_state.find_update_objects(stop)
+ for obj in stop.update_objects
+ Expect obj to_be_in [ b:snip_state.stops[2],
+ \ b:snip_state.stops[2].mirrors[0] ]
+ endfor
+ end
+
+ it 'finds mirrors/stops on the same line and after cur_stop mirrors'
+ let b:snip_state.stops = {
+ \ 1 : { 'line' : 1, 'col' : 5,
+ \ 'mirrors' : [{ 'line' : 2, 'col' : 5 }],
+ \ 'placeholder' : ['x'] },
+ \ 2 : { 'line' : 2, 'col' : 7,
+ \ 'mirrors' : [{ 'line' : 2, 'col' : 7 }] }
+ \ }
+ let stop = b:snip_state.stops[1]
+
+ call b:snip_state.find_update_objects(stop)
+ for obj in stop.update_objects
+ Expect obj to_be_in [ b:snip_state.stops[2],
+ \ b:snip_state.stops[2].mirrors[0] ]
+ endfor
+ end
+
+ it 'ignores mirrors/stops on other lines'
+ let b:snip_state.stops = {
+ \ 1 : { 'line' : 2, 'col' : 5,
+ \ 'placeholder' : ['x'] },
+ \ 2 : { 'line' : 1, 'col' : 7,
+ \ 'mirrors' : [{ 'line' : 1, 'col' : 7 }] },
+ \ 3 : { 'line' : 3, 'col' : 7,
+ \ 'mirrors' : [{ 'line' : 3, 'col' : 7 }] }
+ \ }
+ let stop = b:snip_state.stops[1]
+
+ call b:snip_state.find_update_objects(stop)
+ Expect empty(stop.update_objects) to_be_true
+ end
+
+ it 'ignores mirrors/stops on the same line but before cur_stop/mirrors'
+ let b:snip_state.stops = {
+ \ 1 : { 'line' : 1, 'col' : 5,
+ \ 'mirrors' : [{ 'line' : 2, 'col' : 5 }],
+ \ 'placeholder' : ['x'] },
+ \ 2 : { 'line' : 1, 'col' : 1,
+ \ 'mirrors' : [{ 'line' : 2, 'col' : 1 }] },
+ \ 3 : { 'line' : 2, 'col' : 3,
+ \ 'mirrors' : [{ 'line' : 1, 'col' : 3 }] },
+ \ }
+ let stop = b:snip_state.stops[1]
+
+ call b:snip_state.find_update_objects(stop)
+ Expect empty(stop.update_objects) to_be_true
+ end
+
+ end
+
+end
diff --git a/vim/bundle/vim-snipmate/t/parser.vim b/vim/bundle/vim-snipmate/t/parser.vim
new file mode 100644
index 0000000..c5cf873
--- /dev/null
+++ b/vim/bundle/vim-snipmate/t/parser.vim
@@ -0,0 +1,142 @@
+describe 'snippet parser'
+
+ before
+ function! Parse(snippet, ...)
+ let [snip, stops] = snipmate#parse#snippet(a:snippet, (a:0 ? a:1 : 1))
+ return (a:0 > 1 && a:2) ? [snip, stops] : snip
+ endfunction
+ let b:snipmate_visual = 'testvisual'
+ end
+
+ it 'parses numeric $id and ${id} vars as [id] lists'
+ let expect = [[[1234567890]]]
+ Expect Parse('$1234567890') == expect
+ Expect Parse('${1234567890}') == expect
+ end
+
+ it 'disregards $ or ${ followed by a non-id'
+ Expect Parse('$x1') == [['x1']]
+ Expect Parse('${x}1') == [['x}1']]
+ Expect Parse('$VISUA1') == [['VISUA1']]
+ Expect Parse('${VISUA}1') == [['VISUA}1']]
+ end
+
+ it 'gathers references to each instance of each stop id'
+ let [snip, b:stops] = Parse('x$1x${2:x$1x}x$1x${1/a/b}x$VISUALx', 1, 1)
+ function! InstanceFound(list)
+ return !empty(filter(copy(b:stops[a:list[0]].instances),
+ \ 'v:val is a:list'))
+ endfunction
+ function! CheckList(list)
+ for item in a:list
+ if type(item) == type([])
+ Expect InstanceFound(item) to_be_true
+ call CheckList(item)
+ endif
+ unlet item " E732
+ endfor
+ endfunction
+ call CheckList(snip[0])
+ end
+
+ it 'parses mirror substitutions ${n/pat/sub} as [n, {...}]'
+ let expect = [[[1, { 'pat' : 'abc', 'sub' : 'def' }]]]
+ Expect Parse('${1/abc/def}') == expect
+ let expect[0][0][1].flags = ''
+ Expect Parse('${1/abc/def/}') == expect
+ let expect[0][0][1].flags = 'g'
+ Expect Parse('${1/abc/def/g}') == expect
+ end
+
+ it 'reads patterns literally except for "\/"'
+ Expect Parse('${1/\a\/b/\c\/d\}}') == [[[1, { 'pat' : '\a/b', 'sub' : '\c/d}' }]]]
+ end
+
+ it 'parses vars with placeholders as [id, placeholder] lists'
+ Expect Parse('${1:abc}') == [[[1, 'abc']]]
+ end
+
+ it 'evaluates backtick expressions'
+ Expect Parse('`fnamemodify("x.y", ":r")`') == [['x']]
+ end
+
+ it 'parses placeholders for vars and other specials'
+ let text = 'a `fnamemodify("x.y", ":r")` ${2:(${3/a/b})}'
+ let expect = ['a x ', [2, '(', [3, { 'pat' : 'a', 'sub' : 'b' }], ')']]
+ Expect Parse(text) == [expect]
+ Expect Parse(printf('${1:%s}', text)) == [[[1] + expect]]
+ end
+
+ it 'converts tabs according to &et, &sts, &sw, &ts'
+ " &noet -> leave tabs alone
+ setl noet
+ Expect Parse("abc\tdef\n\t\tghi") == [["abc\tdef"], ["\t\tghi"]]
+
+ " &et -> &sts or &sw
+ setl et sts=2 sw=3
+ Expect Parse("abc\tdef\n\t\tghi") == [["abc def"], [" ghi"]]
+
+ setl et sts=0 sw=3
+ Expect Parse("abc\tdef\n\t\tghi") == [["abc def"], [" ghi"]]
+
+ setl et sts=-1 sw=3
+ Expect Parse("abc\tdef\n\t\tghi") == [["abc def"], [" ghi"]]
+
+ " See #227
+ if exists('*shiftwidth')
+ setl et sts=0 sw=0 ts=3
+ Expect Parse("abc\tdef\n\t\tghi") == [["abc def"], [" ghi"]]
+ endif
+ end
+
+ it 'parses backslashes as escaping the next character or joining lines'
+ Expect Parse('x\x') == [['xx']]
+ Expect Parse('x\\x') == [['x\x']]
+ Expect Parse("x\\\nx") == [['xx']]
+ Expect Parse('x\$1') == [['x$1']]
+ Expect Parse('${1:\}}') == [[[1, '}']]]
+ Expect Parse('`fnamemodify("\`.x", ":r")`') == [['`']]
+ Expect Parse('\`x\`') == [['`x`']]
+ end
+
+ it 'splits text at newlines'
+ Expect Parse("x\nx") == [['x'], ['x']]
+ end
+
+ it 'joins evaluated expressions to surrounding text on the same line'
+ let g:foo = 'bar'
+ Expect Parse("x`g:foo`x") == [['xbarx']]
+ Expect Parse("x`g:foo`\nx") == [['xbar'], ['x']]
+ Expect Parse("x\n`g:foo`x") == [['x'], ['barx']]
+ end
+
+ it 'expands $VISUAL placeholders with any indents'
+ Expect Parse("x$VISUALx") == [['xtestvisualx']]
+ let b:snipmate_visual = " foo\nbar\n baz"
+ setl noet
+ Expect Parse("\tx\n\t$VISUAL\nx") == [["\tx"], ["\t foo"], ["\tbar"],
+ \ ["\t baz"], ["x"]]
+ end
+
+ it 'determines which var with an id is the stop'
+ let [snip, stops] = Parse("$1$1$1", 0, 1)
+ Expect snip == [[[1, "", stops[1]], [1, {}], [1, {}]]]
+
+ let [snip, stops] = Parse("$1${1}$1", 0, 1)
+ Expect snip == [[[1, "", stops[1]], [1, {}], [1, {}]]]
+
+ let [snip, stops] = Parse("$1${1:}$1", 0, 1)
+ Expect snip == [[[1, {}], [1, "", stops[1]], [1, {}]]]
+
+ end
+
+ it 'picks the first of many possible stops'
+ let [snip, stops] = Parse("$1${1:foo}${1:bar}", 0, 1)
+ Expect snip == [[[1, {}], [1, "foo", stops[1]], [1, {}]]]
+ end
+
+ it 'represents empty lines as an empty string'
+ Expect Parse("foo\n\nbar") == [['foo'], [''], ['bar']]
+ end
+
+end
diff --git a/vim/bundle/vim-snipmate/t/tests.sh b/vim/bundle/vim-snipmate/t/tests.sh
new file mode 100755
index 0000000..c1da250
--- /dev/null
+++ b/vim/bundle/vim-snipmate/t/tests.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+tmp="$(mktemp || tmpfile)"
+vim -Es $tmp <<- EOF
+ source ~/.vimrc
+ %delete _
+ call append(0, split(&rtp, ','))
+ delete _
+ wq
+EOF
+
+rtp="$(grep -iE 'vspec|snipmate|tlib|mw-utils' < $tmp | grep -v after)"
+vspec="$(grep -iE 'vspec' < $tmp | grep -v after)"
+test_files="${*:-parser jumping}"
+
+for test in $test_files; do
+ $vspec/bin/vspec $rtp ${test%%.vim}.vim
+done
+
+rm $tmp
diff --git a/vim/bundle/vim-snippets/.gitignore b/vim/bundle/vim-snippets/.gitignore
new file mode 100644
index 0000000..0d20b64
--- /dev/null
+++ b/vim/bundle/vim-snippets/.gitignore
@@ -0,0 +1 @@
+*.pyc
diff --git a/vim/bundle/vim-snippets/.travis.yml b/vim/bundle/vim-snippets/.travis.yml
new file mode 100644
index 0000000..74f2796
--- /dev/null
+++ b/vim/bundle/vim-snippets/.travis.yml
@@ -0,0 +1,8 @@
+language: c
+sudo: false
+
+notifications:
+ email: false
+
+script:
+ - ./tests.sh
diff --git a/vim/bundle/vim-snippets/LICENSE b/vim/bundle/vim-snippets/LICENSE
new file mode 100644
index 0000000..495ced2
--- /dev/null
+++ b/vim/bundle/vim-snippets/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2011 see AUTHORS
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/vim/bundle/vim-snippets/README.md b/vim/bundle/vim-snippets/README.md
new file mode 100644
index 0000000..d4e83c3
--- /dev/null
+++ b/vim/bundle/vim-snippets/README.md
@@ -0,0 +1,252 @@
+snipMate & UltiSnip Snippets
+============================
+
+[![Build Status](https://travis-ci.org/honza/vim-snippets.svg)](https://travis-ci.org/honza/vim-snippets)
+
+This repository contains snippets files for various programming languages.
+
+It is community-maintained and many people have contributed snippet files and
+other improvements already.
+
+Contents
+--------
+
+- `snippets/*`: snippets using snipMate format
+- `UltiSnips/*`: snippets using UltiSnips format
+
+Snippet engines supporting vim-snippets
+----------------------------------------
+
+There are different forks of snippet engines which allow the user to insert
+snippets by typing the name of a snippet hitting the expansion mapping.
+
+- [github.com/SirVer/ultisnips](https://github.com/SirVer/ultisnips):
+ python, supports all snippets in this repo.
+- [github.com/garbas/vim-snipmate](https://github.com/garbas/vim-snipmate):
+ VimL, snipmate-snippets, engine sometimes behaves strange. Supports
+ snippets/*
+- [github.com/Shougo/neosnippet](https://github.com/Shougo/neosnippet.vim):
+ VimL, supports snippets/* with some configuration.
+- [github.com/drmingdrmer/xptemplate](https://github.com/drmingdrmer/xptemplate):
+ Totally different syntax, does not read snippets contained in this file, but
+ it is also very powerful. It does not support vim-snippets (just listing it
+ here for completeness)
+
+There tries to be a more comprehensive list (which still is incomplete) here:
+http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html
+
+UltiSnips has additional features such as high speed, nesting snippets,
+expanding snippets in snippets and offers powerful transformations on text in
+snippets (like visual selections or placeholder texts).
+
+Which one to use? If you have python give
+[SirVer/ultisnips](https://github.com/SirVer/ultisnips) a try because its fast
+and has the most features.
+
+If you have VimL only (vim without python support) your best option is using
+[garbas/vim-snipmate](https://github.com/garbas/vim-snipmate) and cope with the
+minor bugs found in the engine.
+
+Q: Should "snipMate be deprecated in favour of UltiSnips"?
+
+A: No, because snipMate is VimL, and UltiSnips requires Python.
+Some people want to use snippets without having to install Vim with Python
+support. Yes - this sucks.
+
+One solution would be: Use snippets if they are good enough, but allow overriding them
+in UltiSnips. This would avoid most duplication while still serving most users.
+AFAIK there is a nested-placeholder branch for snipMate too. snipMate is still
+improved by Adnan Zafar. So maybe time is not ready to make a final decision yet.
+
+[github issue/discussion](https://github.com/honza/vim-snippets/issues/363)
+
+Vendor Snippets
+---------------
+
+Additional library and framework snippets are available for UltiSnips users in
+the `UltiSnips/` directory. These files are removed from the default language
+namespaces to prevent them from all being loaded automatically. If there is a
+separate library, framework, or package you would like to support open a pull
+request!
+
+Additional snippets can be added to the current buffer with the
+`:UltiSnipsAddFiletypes` command followed by the snippet name without the
+"snippets" ending. For example, to add the JavaScript Jasmine snippets, run:
+`:UltiSnipsAddFiletypes javascript-jasmine`. To have this snippet loaded
+everytime a JavaScript file is opened or created you can add the command to your
+ -`.vim/ftplugin/javascript.vim` file. Another way is to add
+ `autocmd FileType js UltiSnipsAddFiletypes javascript-jasmine` in your `.vimrc`.
+
+
+For more see the UltiSnips docs (`:help UltiSnips`).
+
+Installation
+------------
+
+First be aware that there are many options, see "Snippet engines" above.
+Second be aware than there are [tons of plugin managers](http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html)
+which is why Marc Weber thinks that it doesn't make sense to repeat the same
+repetitive information everywhere.
+
+*Recommended way:*
+[vim-addon-manager](https://github.com/MarcWeber/vim-addon-manager) (because Marc Weber wrote it for exactly
+this reason, it supports simple dependency management). E.g. you're done by this
+line in your `.vimrc`:
+
+```vim
+" assuming you want to use snipmate snippet engine
+ActivateAddons vim-snippets snipmate
+```
+
+[vim-pi](https://bitbucket.org/vimcommunity/vim-pi/issue/90/we-really-need-a-web-interface)
+Is the place to discuss plugin managers and repository resources.
+
+About how to install snipMate see [snipmate@garbas](https://github.com/garbas/vim-snipmate)
+
+(Bundle, Pathogen, git clone - keywords to make people find this link by ctrl-f search)
+I know that I should be reading the docs of the snippet engine, just let me copy paste into my `.vimrc`:
+[See this pull request](https://github.com/honza/vim-snippets/pull/307/files).
+
+TROUBLE
+=======
+
+If you still have trouble getting this to work create a GitHub ticket, ask on
+IRC or the mailing list.
+
+Policies / for contributors
+---------------------------
+
+Some snippets are useful for almost all languages, so let's try to have the same
+triggers for them:
+
+```
+if : if without else
+ife: if $1 else $2
+eif : else if ($1) { .. }
+el : else ..
+wh : while (cond) ...
+```
+
+Don't add useless placeholder default texts like:
+
+```
+if (${1:condition}){
+ ${2:some code here}
+}
+```
+instead use:
+
+```
+if (${1}){
+ ${2}
+}
+```
+
+Exception: Functions which are used less often, such as Vim's `matchall()`, `matchstr()`
+functions which case hints may be helpful to remember order. In the VimL case
+get vim-dev plugin which has function completion
+
+Thus for conditions (while, if ..) and block bodies just use ${N} - Thanks
+
+Open questions:
+What about one line if ee then .. else .. vs if \n .. then \n ... \n else \n .. ?
+Which additional policies to add?
+Discuss at: https://github.com/honza/vim-snippets/issues/230
+
+*folding markers*:
+Until further work is done on `vim-snipmate`, please don't add folding markers
+into snippets. `vim-snipmate` has some comments about how to patch all snippets
+on the fly adding those.
+
+Currently all snippets from UltiSnips have been put into UltiSnips - some work
+on merging should be done (dropping duplicates etc). Also see engines section above.
+
+Related repositories
+--------------------
+
+We also encourage people to maintain sets of snippets for particular use cases
+so that all users can benefit from them. People can list their snippet repositories here:
+
+* https://github.com/rbonvall/snipmate-snippets-bib (snippets for BibTeX files)
+* https://github.com/sudar/vim-arduino-snippets (snippets for Arduino files)
+* https://github.com/zedr/zope-snipmate-bundle.git (snippets for Python, TAL and ZCML)
+* https://github.com/bonsaiben/bootstrap-snippets (snippets for Twitter Bootstrap markup, in HTML and Haml)
+* https://github.com/sniphpets (advanced snippets for PHP, Symfony 2/3, Doctrine and etc.)
+
+Installation using VAM: https://github.com/MarcWeber/vim-addon-manager
+
+Future - ideas - examples
+-------------------------
+
+[overview snippet engines](http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html)
+If you have ideas you can add them to that list of "snippet engine features by example".
+
+Historical notes
+----------------
+
+[vim-snipmate][1] was originally started by [Michael Sanders][2] who has now
+unfortunately abandoned the project. [Rok Garbas][3] is now maintaining a
+[fork][4] of the project in hopes of improving the existing code base.
+
+Versions / dialects / ..
+========================
+
+There are some issues, such as newer language versions may require other
+snippets than older. If this exists we currently recommend doing this:
+
+* add snippets/ruby.snippets (common snippets)
+* add snippets/ruby-1.8.snippets (1.8 only)
+* add snippets/ruby-1.9.snippets (1.9 only)
+
+then configure https://github.com/garbas/vim-snipmate this way:
+
+```vim
+let g:snipMate = {}
+let g:snipMate.scope_aliases = {}
+let g:snipMate.scope_aliases['ruby'] = 'ruby,ruby-rails,ruby-1.9'
+```
+
+If it happens that you work on a project requiring ruby-1.8 snippets instead,
+consider using `vim-addon-local-vimrc` and override the filetypes.
+
+Well - of course it may not make sense to create a new file for each
+ruby-library-version triplet. Sometimes postfixing a name such as
+
+```
+migrate_lib_20_down
+migrate_lib_20_up
+```
+
+will do it then if syntax has changed.
+
+Language maintainers
+--------------------
+
+No one can really be proficient in all programming languages. If you would like
+to maintain snippets for a language, please get in touch.
+
+Notes: People are interested in snippets - and their interest may wane again.
+This list is kept up-to-date on a best effort basis.
+
+* Elixir - [lpil](https://github.com/lpil), [iurifq](https://github.com/iurifq)
+* Falcon - [steveno](https://github.com/steveno)
+* HTML Django - [honza](http://github.com/honza)
+* Javascript - [honza](http://github.com/honza)
+* Markdown - [honza](http://github.com/honza)
+* PHP - [chrisyue](http://github.com/chrisyue)
+* Python - [honza](http://github.com/honza)
+* Ruby - [taq](http://github.com/taq)
+* Scala - [gorodinskiy](https://github.com/gorodinskiy)
+* Supercollider - [lpil](https://github.com/lpil)
+
+License
+-------
+
+Just as the original snipMate plugin, all the snippets are licensed under the
+terms of the MIT license.
+
+[1]: http://github.com/garbas/vim-snipmate
+[2]: http://github.com/msanders
+[3]: http://github.com/garbas
+[4]: http://github.com/garbas/vim-snipmate
+[7]: http://github.com/SirVer/ultisnips
diff --git a/vim/bundle/vim-snippets/UltiSnips/README b/vim/bundle/vim-snippets/UltiSnips/README
new file mode 100644
index 0000000..41d8592
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/README
@@ -0,0 +1,17 @@
+This directory contains the snippets for UltiSnips.
+https://github.com/sirver/ultisnips
+
+Standing On The Shoulders of Giants
+===================================
+
+The snippets have been collected from various other project which I want to
+express my gratitude for. My main source for inspiration where the following
+two projects:
+
+ TextMate: http://svn.textmate.org/trunk/Bundles/
+ SnipMate: http://code.google.com/p/snipmate/
+
+UltiSnips has seen contributions by many individuals. Those contributions have
+been merged into this collection seamlessly and without further comments.
+
+-- vim:ft=rst:nospell:
diff --git a/vim/bundle/vim-snippets/UltiSnips/ada.snippets b/vim/bundle/vim-snippets/UltiSnips/ada.snippets
new file mode 100644
index 0000000..cc35c2c
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/ada.snippets
@@ -0,0 +1,280 @@
+priority -50
+
+global !p
+
+def ada_case(word):
+ out = word[0].upper()
+ for i in range(1, len(word)):
+ if word[i - 1] == '_':
+ out = out + word[i].upper()
+ else:
+ out = out + word[i]
+ return out
+
+endglobal
+
+snippet wi "with"
+with $1;$0
+endsnippet
+
+snippet pac "package"
+package ${1:`!p snip.rv = ada_case(snip.basename)`} is
+ $0
+end $1;
+endsnippet
+
+snippet pacb "package body"
+package body ${1:`!p snip.rv = ada_case(snip.basename)`} is
+ $0
+end $1;
+endsnippet
+
+snippet ent "entry ... when"
+entry $1($2) when $3 is
+begin
+ $0
+end $1;
+endsnippet
+
+snippet task "task"
+task $1 is
+ entry $0
+end $1;
+endsnippet
+
+snippet taskb "task body"
+task body $1 is
+ $2
+begin
+ $0
+end $1;
+endsnippet
+
+snippet acc "accept"
+accept $1($2) do
+ $0
+end $1;
+endsnippet
+
+snippet prot "protected type"
+protected type $1($2) is
+ $0
+end $1;
+endsnippet
+
+snippet prob "protected body"
+protected body $1 is
+ $2
+begin
+ $0
+end $1;
+endsnippet
+
+snippet gen "generic type"
+generic
+ type $1 is $2;$0
+endsnippet
+
+snippet ty "type"
+type $1 is $2;$0
+endsnippet
+
+snippet tyd "type with default value"
+type $1 is $2
+ with Default_Value => $3;$0
+endsnippet
+
+snippet subty "subtype"
+subtype $1 is $2;$0
+endsnippet
+
+snippet dec "declare block"
+declare
+ $1
+begin
+ $0
+end;
+endsnippet
+
+snippet decn "declare named block"
+$1:
+declare
+ $2
+begin
+ $0
+end $1;
+endsnippet
+
+snippet ifex "if expression"
+if $1 then $2 else $0
+endsnippet
+
+snippet casex "case expression"
+case $1 is
+ when $2 => $3,$0
+endsnippet
+
+snippet fora "for all"
+for all $1 ${2:in} $3 => $0
+endsnippet
+
+snippet fors "for some"
+for some $1 ${2:in} $3 => $0
+endsnippet
+
+snippet if "if"
+if $1 then
+ $0
+end if;
+endsnippet
+
+snippet ife "if ... else"
+if $1 then
+ $2
+else
+ $0
+end if;
+endsnippet
+
+snippet el "else"
+else
+ $0
+endsnippet
+
+snippet eif "elsif"
+elsif $1 then
+ $0
+endsnippet
+
+snippet wh "while"
+while $1 loop
+ $0
+end loop;
+endsnippet
+
+snippet nwh "named while"
+$1:
+while $2 loop
+ $0
+end loop $1;
+endsnippet
+
+snippet for "for"
+for ${1:I} in $2 loop
+ $0
+end loop;
+endsnippet
+
+snippet fore "for each"
+for $1 of $2 loop
+ $0
+end loop;
+endsnippet
+
+snippet nfor "named for"
+$1:
+for ${2:I} in $3 loop
+ $0
+end loop $1;
+endsnippet
+
+snippet nfore "named for each"
+$1:
+for $2 of $3 loop
+ $0
+end loop $1;
+endsnippet
+
+snippet proc "procedure"
+procedure $1($2) is
+ $3
+begin
+ $0
+end $1;
+endsnippet
+
+snippet procd "procedure declaration"
+procedure $1;$0
+endsnippet
+
+snippet fun "function"
+function $1($2) return $3 is
+ $4
+begin
+ $0
+end $1;
+endsnippet
+
+snippet fune "expression function"
+function $1 return $2 is
+ ($3);$0
+endsnippet
+
+snippet fund "function declaration"
+function $1 return $2;$0
+endsnippet
+
+snippet ret "extended return"
+return $1 do
+ $0
+end return;
+endsnippet
+
+snippet rec "record"
+record
+ $0
+end record;
+endsnippet
+
+snippet case "case"
+case $1 is
+ when $2 => $3;$0
+end case;
+endsnippet
+
+snippet whe "when"
+when $1 => $2;$0
+endsnippet
+
+snippet wheo "when others"
+when others => $1;$0
+endsnippet
+
+snippet lo "loop"
+loop
+ $0
+end loop;
+endsnippet
+
+snippet nlo "named loop"
+$1:
+loop
+ $0
+end loop $1;
+endsnippet
+
+snippet ex "exit when"
+exit when $1;$0
+endsnippet
+
+snippet put "Ada.Text_IO.Put"
+Ada.Text_IO.Put($1);$0
+endsnippet
+
+snippet putl "Ada.Text_IO.Put_Line"
+Ada.Text_IO.Put_Line($1);$0
+endsnippet
+
+snippet get "Ada.Text_IO.Get"
+Ada.Text_IO.Get($1);$0
+endsnippet
+
+snippet getl "Ada.Text_IO.Get_Line"
+Ada.Text_IO.Get_Line($1);$0
+endsnippet
+
+snippet newline "Ada.Text_IO.New_Line"
+Ada.Text_IO.New_Line(${1:1});$0
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/all.snippets b/vim/bundle/vim-snippets/UltiSnips/all.snippets
new file mode 100644
index 0000000..0e286e5
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/all.snippets
@@ -0,0 +1,76 @@
+# This file contains snippets that are always defined. I personally
+# have snippets for signatures and often needed texts
+
+# sligthly lower priority than everything else since specialized versions
+# should overwrite. The user needs to adjust her priority in her snippets to
+# ~-55 so that other filetypes will still overwrite.
+priority -60
+
+##############
+# NICE BOXES #
+##############
+global !p
+from vimsnippets import foldmarker, make_box, get_comment_format
+endglobal
+
+snippet box "A nice box with the current comment symbol" b
+`!p
+box = make_box(len(t[1]))
+snip.rv = box[0]
+snip += box[1]
+`${1:content}`!p
+box = make_box(len(t[1]))
+snip.rv = box[2]
+snip += box[3]`
+$0
+endsnippet
+
+snippet bbox "A nice box over the full width" b
+`!p
+if not snip.c:
+ width = int(vim.eval("&textwidth - (virtcol('.') == 1 ? 0 : virtcol('.'))")) or 71
+box = make_box(len(t[1]), width)
+snip.rv = box[0]
+snip += box[1]
+`${1:content}`!p
+box = make_box(len(t[1]), width)
+snip.rv = box[2]
+snip += box[3]`
+$0
+endsnippet
+
+snippet fold "Insert a vim fold marker" b
+`!p snip.rv = get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]`${2:1} `!p snip.rv = get_comment_format()[2]`
+endsnippet
+
+snippet foldc "Insert a vim fold close marker" b
+`!p snip.rv = get_comment_format()[0]` ${2:1}`!p snip.rv = foldmarker()[1]` `!p snip.rv = get_comment_format()[2]`
+endsnippet
+
+snippet foldp "Insert a vim fold marker pair" b
+`!p snip.rv = get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]` `!p snip.rv = get_comment_format()[2]`
+${2:${VISUAL:Content}}
+`!p snip.rv = get_comment_format()[0]` `!p snip.rv = foldmarker()[1]` $1 `!p snip.rv = get_comment_format()[2]`
+endsnippet
+
+##########################
+# LOREM IPSUM GENERATORS #
+##########################
+snippet lorem "Lorem Ipsum - 50 Words" b
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
+tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
+vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
+no sea takimata sanctus est Lorem ipsum dolor sit amet.
+endsnippet
+
+##########################
+# VIM MODELINE GENERATOR #
+##########################
+# See advice on `:help 'tabstop'` for why these values are set. Uses second
+# modeline form ('set') to work in languages with comment terminators
+# (/* like C */).
+snippet modeline "Vim modeline"
+vim`!v ':set '. (&expandtab ? printf('et sw=%i ts=%i', &sw, &ts) : printf('noet sts=%i sw=%i ts=%i', &sts, &sw, &ts)) . (&tw ? ' tw='. &tw : '') . ':'`
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/bib.snippets b/vim/bundle/vim-snippets/UltiSnips/bib.snippets
new file mode 100644
index 0000000..c9b8df5
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/bib.snippets
@@ -0,0 +1,52 @@
+priority -50
+
+snippet online "Online resource" b
+@online{${1:name},
+ author={${2:author}},
+ title={${3:title}},
+ date={${4:date}},
+ url={${5:url}}
+}
+$0
+endsnippet
+
+snippet article "Article reference" b
+@article{${1:name},
+ author={${2:author}},
+ title={${3:title}},
+ journaltitle={${4:journal}},
+ volume={${5:NN}},
+ number={${6:NN}},
+ year={${7:YYYY}},
+ pages={${8:NN}--${9:NN}}
+}
+$0
+endsnippet
+
+snippet book "Book reference" b
+@book{${1:name},
+ author={${2:author}},
+ title={${3:title}},
+ subtitle={${4:subtitle}},
+ year={${5:YYYY}},
+ location={${6:somewhere}},
+ publisher={${7:publisher}},
+ pages={${8:NN}--${9:NN}}
+}
+$0
+endsnippet
+
+snippet inb "In Book reference" b
+@inbook{${1:name},
+ author={${2:author}},
+ title={${3:title}},
+ subtitle={${4:subtitle}},
+ booktitle={${5:book}},
+ editor={${6:editor}},
+ year={${7:YYYY}},
+ location={${8:somewhere}},
+ publisher={${9:publisher}},
+ pages={${10:NN}--${11:NN}}
+}
+$0
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/bindzone.snippets b/vim/bundle/vim-snippets/UltiSnips/bindzone.snippets
new file mode 100644
index 0000000..b8ab0df
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/bindzone.snippets
@@ -0,0 +1,29 @@
+priority -50
+
+global !p
+def newsoa():
+ import datetime
+ now = datetime.datetime.now()
+ # return standard SOA formatted serial for today
+ return now.strftime("%Y%m%d00")
+endglobal
+
+snippet zone "Bootstrap a new Bind zonefile" b
+$TTL 86400
+@ IN SOA ${1:example.net}. ${2:hostmaster.$1}.(
+ `!p snip.rv = newsoa()`; serial
+ 21600; refresh every 6 hours
+ 3600; retry after one hour
+ 604800; expire after a week
+ 86400 ); minimum TTL of 1 day
+
+ IN NS ns01.$1.
+ IN MX 10 mail.$1.
+
+ns01.$1 IN A
+mail.$1 IN A
+endsnippet
+
+snippet A "Insert A Record" b
+${1:hostname} IN A ${2:ip}
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/c.snippets b/vim/bundle/vim-snippets/UltiSnips/c.snippets
new file mode 100644
index 0000000..c989464
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/c.snippets
@@ -0,0 +1,99 @@
+###########################################################################
+# TextMate Snippets #
+###########################################################################
+
+priority -50
+
+snippet def "#define ..."
+#define ${1}
+endsnippet
+
+snippet #ifndef "#ifndef ... #define ... #endif"
+#ifndef ${1/([A-Za-z0-9_]+).*/$1/}
+#define ${1:SYMBOL} ${2:value}
+#endif /* ifndef $1 */
+endsnippet
+
+snippet #if "#if #endif" b
+#if ${1:0}
+${VISUAL}${0}
+#endif
+endsnippet
+
+snippet mark "#pragma mark (mark)"
+#if 0
+${1:#pragma mark -
+}#pragma mark $2
+#endif
+
+$0
+endsnippet
+
+snippet main "main() (main)"
+int main(int argc, char *argv[])
+{
+ ${VISUAL}${0}
+ return 0;
+}
+endsnippet
+
+snippet for "for loop (for)"
+for (${2:i} = 0; $2 < ${1:count}; ${3:++$2}) {
+ ${VISUAL}${0}
+}
+endsnippet
+
+snippet fori "for int loop (fori)"
+for (${4:int} ${2:i} = 0; $2 < ${1:count}; ${3:++$2}) {
+ ${VISUAL}${0}
+}
+endsnippet
+
+snippet once "Include header once only guard"
+#ifndef ${1:`!p
+if not snip.c:
+ import random, string
+ name = re.sub(r'[^A-Za-z0-9]+','_', snip.fn).upper()
+ rand = ''.join(random.sample(string.ascii_letters+string.digits, 8))
+ snip.rv = ('%s_%s' % (name,rand)).upper()
+else:
+ snip.rv = snip.c`}
+#define $1
+
+${VISUAL}${0}
+
+#endif /* end of include guard: $1 */
+endsnippet
+
+snippet fprintf "fprintf ..."
+fprintf(${1:stderr}, "${2:%s}\n"${2/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$3${2/([^%]|%%)*(%.)?.*/(?2:\);)/}
+endsnippet
+
+snippet eli "else if .. (eli)"
+else if (${1:/* condition */}) {
+ ${VISUAL}${0}
+}
+endsnippet
+
+snippet printf "printf .. (printf)"
+printf("${1:%s}\n"${1/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$2${1/([^%]|%%)*(%.)?.*/(?2:\);)/}
+endsnippet
+
+snippet st "struct"
+struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`} {
+ ${0:/* data */}
+};
+endsnippet
+
+snippet fun "function" b
+${1:void} ${2:function_name}(${3})
+{
+ ${VISUAL}${0}
+}
+endsnippet
+
+snippet fund "function declaration" b
+${1:void} ${2:function_name}(${3});
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/coffee-jasmine.snippets b/vim/bundle/vim-snippets/UltiSnips/coffee-jasmine.snippets
new file mode 100644
index 0000000..0dd35cd
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/coffee-jasmine.snippets
@@ -0,0 +1,166 @@
+#
+# CoffeeScript versions -- adapted from the JS TextMate bundle + additions
+# for some jasmine-jquery matchers
+#
+priority -50
+
+extends coffee
+
+priority -49
+
+snippet des "Describe (coffee)" b
+describe '${1:description}', ->
+ $0
+endsnippet
+
+snippet it "it (coffee)" b
+it '${1:description}', ->
+ $0
+endsnippet
+
+snippet bef "before each (coffee)" b
+beforeEach ->
+ $0
+endsnippet
+
+snippet aft "after each (coffee)" b
+afterEach ->
+ $0
+endsnippet
+
+snippet any "any (coffee)" b
+jasmine.any($1)
+endsnippet
+
+snippet ru "runs (coffee)" b
+runs ->
+ $0
+endsnippet
+
+snippet wa "waits (coffee)" b
+waits($1)
+endsnippet
+
+snippet ex "expect (coffee)" b
+expect(${1:target})$0
+endsnippet
+
+snippet ee "expect to equal (coffee)" b
+expect(${1:target}).toEqual(${2:value})
+endsnippet
+
+snippet em "expect to match (coffee)" b
+expect(${1:target}).toMatch(${2:pattern})
+endsnippet
+
+snippet eha "expect to have attribute (coffee)" b
+expect(${1:target}).toHaveAttr('${2:attr}'${3:, '${4:value}'})
+endsnippet
+
+snippet et "expect to be truthy (coffee)" b
+expect(${1:target}).toBeTruthy()
+endsnippet
+
+snippet ef "expect to be falsy (coffee)" b
+expect(${1:target}).toBeFalsy()
+endsnippet
+
+snippet ed "expect to be defined (coffee)" b
+expect(${1:target}).toBeDefined()
+endsnippet
+
+snippet en "expect to be null (coffee)" b
+expect(${1:target}).toBeNull()
+endsnippet
+
+snippet ec "expect to contain (coffee)" b
+expect(${1:target}).toContain(${2:value})
+endsnippet
+
+snippet ev "expect to be visible (coffee)" b
+expect(${1:target}).toBeVisible()
+endsnippet
+
+snippet eh "expect to be hidden (coffee)" b
+expect(${1:target}).toBeHidden()
+endsnippet
+
+snippet notx "expect not (coffee)" b
+expect(${1:target}).not$0
+endsnippet
+
+snippet note "expect not to equal (coffee)" b
+expect(${1:target}).not.toEqual(${2:value})
+endsnippet
+
+snippet notm "expect not to match (coffee)" b
+expect(${1:target}).not.toMatch(${2:pattern})
+endsnippet
+
+snippet notha "expect to not have attribute (coffee)" b
+expect(${1:target}).not.toHaveAttr('${2:attr}'${3:, '${4:value}'})
+endsnippet
+
+snippet nott "expect not to be truthy (coffee)" b
+expect(${1:target}).not.toBeTruthy()
+endsnippet
+
+snippet notf "expect not to be falsy (coffee)" b
+expect(${1:target}).not.toBeFalsy()
+endsnippet
+
+snippet notd "expect not to be defined (coffee)" b
+expect(${1:target}).not.toBeDefined()
+endsnippet
+
+snippet notn "expect not to be null (coffee)" b
+expect(${1:target}).not.toBeNull()
+endsnippet
+
+snippet notc "expect not to contain (coffee)" b
+expect(${1:target}).not.toContain(${2:value})
+endsnippet
+
+snippet notv "expect not to be visible (coffee)" b
+expect(${1:target}).not.toBeVisible()
+endsnippet
+
+snippet noth "expect not to be hidden (coffee)" b
+expect(${1:target}).not.toBeHidden()
+endsnippet
+
+snippet s "spy on (coffee)" b
+spyOn(${1:object}, "${2:method}")$0
+endsnippet
+
+snippet sr "spy on and return (coffee)" b
+spyOn(${1:object}, "${2:method}").andReturn(${3:arguments})
+endsnippet
+
+snippet st "spy on and throw (coffee)" b
+spyOn(${1:object}, "${2:method}").andThrow(${3:exception})
+endsnippet
+
+snippet sct "spy on and call through (coffee)" b
+spyOn(${1:object}, "${2:method}").andCallThrough()
+endsnippet
+
+snippet scf "spy on and call fake (coffee)" b
+spyOn(${1:object}, "${2:method}").andCallFake(${3:function})
+endsnippet
+
+snippet esc "expect was called (coffee)" b
+expect(${1:target}).wasCalled()
+endsnippet
+
+snippet escw "expect was called with (coffee)" b
+expect(${1:target}).wasCalledWith(${2:arguments})
+endsnippet
+
+snippet notsc "expect was not called (coffee)" b
+expect(${1:target}).wasNotCalled()
+endsnippet
+
+snippet noscw "expect was not called with (coffee)" b
+expect(${1:target}).wasNotCalledWith(${2:arguments})
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/coffee-react.snippets b/vim/bundle/vim-snippets/UltiSnips/coffee-react.snippets
new file mode 100644
index 0000000..4cdb40f
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/coffee-react.snippets
@@ -0,0 +1,80 @@
+#
+# CoffeeScript versions -- adapted from coffee-jasmine
+# for some ReactJS matchers.
+#
+priority -50
+
+extends coffee
+
+priority -49
+
+snippet createClass "React define Class" b
+${1:classname}Class = React.createClass
+ displayName: "$1"
+ render: ->
+ ${2}
+$1 = React.createFactory($1)
+endsnippet
+
+snippet PropTypes "React define propTypes" b
+propTypes: ->
+ ${1:myVar}: React.PropTypes.${2:type}${3:.isRequired}
+endsnippet
+
+snippet propType "React propType (key/value)" b
+${1:myVar}: React.PropTypes.${2:type}${3:.isRequired}
+${4}
+endsnippet
+
+snippet setState "React setState" b
+@setState
+ ${1:myvar}: ${2:myvalue}
+ ${3}
+endsnippet
+
+snippet getInitialState "React define getInitialState" b
+getInitialState: ->
+ ${1:myvar}: ${2:myvalue}
+ ${3}
+endsnippet
+
+snippet getDefaultProps "React define getDefaultProps" b
+getDefaultProps: ->
+ ${1:myvar}: ${2:myvalue}
+ ${3}
+endsnippet
+
+snippet componentWillMount "React define componentWillMount" b
+componentWillMount: ->
+ ${1}
+endsnippet
+
+snippet componentDidMount "React define componentDidMount" b
+componentDidMount: ->
+ ${1}
+endsnippet
+
+snippet componentWillReceiveProps "React define componentWillReceiveProps" b
+componentWillReceiveProps: (nextProps) ->
+ ${1}
+endsnippet
+
+snippet shouldComponentUpdate "React define shouldComponentUpdate" b
+shouldComponentUpdate: (nextProps, nextState) ->
+ ${1}
+endsnippet
+
+snippet componentWillUpdate "React define componentWillUpdate" b
+componentWillUpdate: (nextProps, nextState) ->
+ ${1}
+endsnippet
+
+snippet componentDidUpdate "React define componentDidUpdate" b
+componentDidUpdate: (prevProps, prevState) ->
+ ${1}
+endsnippet
+
+snippet componentWillUnmount "React define componentWillUnmount" b
+componentWillUnmount: ->
+ ${1}
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/coffee.snippets b/vim/bundle/vim-snippets/UltiSnips/coffee.snippets
new file mode 100644
index 0000000..75e7d06
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/coffee.snippets
@@ -0,0 +1,100 @@
+priority -50
+
+snippet fun "Function" b
+${1:name} = `!p snip.rv = "(" if t[2] else ""`${2:args}`!p snip.rv = ") " if t[2] else ""`->
+ ${0:# body...}
+endsnippet
+
+snippet bfun "Function (bound)" i
+`!p snip.rv = "(" if t[1] else ""`${1:args}`!p snip.rv = ") " if t[1] else ""`=>`!p snip.rv = " " if t[2] and not t[2].startswith("\n") else ""`${2:expr}
+endsnippet
+
+snippet if "If" b
+if ${1:condition}
+ ${0:# body...}
+endsnippet
+
+snippet ife "If .. Else" b
+if ${1:condition}
+ ${2:# body...}
+else
+ ${3:# body...}
+endsnippet
+
+snippet elif "Else if" b
+else if ${1:condition}
+ ${0:# body...}
+endsnippet
+
+snippet ifte "Ternary if" b
+if ${1:condition} then ${2:value} else ${3:other}
+endsnippet
+
+snippet unl "Unless" b
+${1:action} unless ${2:condition}
+endsnippet
+
+snippet fora "Array Comprehension" b
+for ${1:name} in ${2:array}
+ ${0:# body...}
+endsnippet
+
+snippet foro "Object Comprehension" b
+for ${1:key}, ${2:value} of ${3:Object}
+ ${0:# body...}
+endsnippet
+
+snippet forr "Range Comprehension (inclusive)" b
+for ${1:name} in [${2:start}..${3:finish}]`!p snip.rv = " by " if t[4] else ""`${4:step}
+ ${0:# body...}
+endsnippet
+
+snippet forrex "Range Comprehension (exclusive)" b
+for ${1:name} in [${2:start}...${3:finish}]`!p snip.rv = " by " if t[4] else ""`${4:step}
+ ${0:# body...}
+endsnippet
+
+snippet swi "Switch" b
+switch ${1:object}
+ when ${2:value}
+ ${3:# body...}
+ else
+ $0
+endsnippet
+
+snippet swit "Switch when .. then" b
+switch ${1:object}
+ when ${2:condition}`!p snip.rv = " then " if t[3] else ""`${3:value}
+ else`!p snip.rv = " " if t[4] and not t[4].startswith("\n") else ""`${4:value}
+endsnippet
+
+snippet cla "Class" b
+class ${1:ClassName}`!p snip.rv = " extends " if t[2] else ""`${2:Ancestor}
+
+ ${3:constructor:`!p snip.rv = " (" if t[4] else ""`${4:args}`!p snip.rv = ")" if t[4] else ""` ->
+ ${5:# body...}}
+ $0
+endsnippet
+
+snippet try "Try .. Catch" b
+try
+ $1
+catch ${2:error}
+ $3
+endsnippet
+
+snippet req "Require" b
+${1/^'?(\w+)'?$/\L$1\E/} = require(${1:'${2:sys}'})
+endsnippet
+
+snippet # "Interpolated Code" i
+#{$1}$0
+endsnippet
+
+snippet log "Log" b
+console.log ${1:"${2:msg}"}
+endsnippet
+
+snippet kv "Key:value for object" b
+${1:key}:${2:value}
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/cpp.snippets b/vim/bundle/vim-snippets/UltiSnips/cpp.snippets
new file mode 100644
index 0000000..f7c2bd8
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/cpp.snippets
@@ -0,0 +1,73 @@
+priority -50
+
+extends c
+
+# We want to overwrite everything in parent ft.
+priority -49
+
+###########################################################################
+# TextMate Snippets #
+###########################################################################
+snippet beginend "$1.begin(), $1.end() (beginend)"
+${1:v}${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}begin(), $1${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}end()
+endsnippet
+
+snippet cl "class .. (class)"
+class ${1:`!p snip.rv = snip.basename or "name"`}
+{
+public:
+ ${1/(\w+).*/$1/} (${2:arguments});
+ virtual ~${1/(\w+).*/$1/} ();
+
+private:
+ ${0:/* data */}
+};
+endsnippet
+
+snippet ns "namespace .. (namespace)"
+namespace${1/.+/ /m}${1:`!p snip.rv = snip.basename or "name"`}
+{
+ ${VISUAL}${0}
+}${1/.+/ \/* /m}$1${1/.+/ *\/ /m}
+endsnippet
+
+snippet readfile "read file (readF)"
+std::vector<char> v;
+if (FILE *fp = fopen(${1:"filename"}, "r"))
+{
+ char buf[1024];
+ while(size_t len = fread(buf, 1, sizeof(buf), fp))
+ v.insert(v.end(), buf, buf + len);
+ fclose(fp);
+}
+endsnippet
+
+snippet map "std::map (map)"
+std::map<${1:key}, ${2:value}> map$0;
+endsnippet
+
+snippet vector "std::vector (v)"
+std::vector<${1:char}> v$0;
+endsnippet
+
+snippet tp "template <typename ..> (template)"
+template <typename ${1:_InputIter}>
+endsnippet
+
+snippet cla "An entire .h generator" b
+#ifndef ${2:`!v substitute(vim_snippets#Filename('$1_H','ClassName'),'.*','\U&\E','')`}
+#define $2
+
+class ${1:`!v substitute(substitute(vim_snippets#Filename('$1','ClassName'),'^.','\u&',''), '_\(\w\)', '\u\1', 'g')`}
+{
+private:
+ ${3}
+
+public:
+ $1();
+ virtual ~$1();
+};
+
+#endif /* $2 */
+endsnippet
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/cs.snippets b/vim/bundle/vim-snippets/UltiSnips/cs.snippets
new file mode 100644
index 0000000..aca245e
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/cs.snippets
@@ -0,0 +1,328 @@
+#######################################################################
+# C# Snippets for UltiSnips #
+#######################################################################
+
+priority -50
+
+#########################
+# classes and structs #
+#########################
+
+snippet namespace "namespace" b
+namespace ${1:MyNamespace}
+{
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet class "class" w
+class ${1:MyClass}
+{
+ $0
+}
+endsnippet
+
+snippet struct "struct" w
+struct ${1:MyStruct}
+{
+ $0
+}
+endsnippet
+
+snippet interface "interface" w
+interface I${1:Interface}
+{
+ $0
+}
+endsnippet
+
+snippet enum "enumeration" b
+enum ${1:MyEnum} { ${2:Item} };
+endsnippet
+
+
+############
+# Main() #
+############
+
+snippet sim "static int main" b
+static int Main(string[] args)
+{
+ $0
+}
+endsnippet
+
+snippet svm "static void main" b
+static void Main(string[] args)
+{
+ $0
+}
+endsnippet
+
+
+################
+# properties #
+################
+
+snippet prop "Simple property declaration" b
+public ${1:int} ${2:MyProperty} { get; set; }
+endsnippet
+
+snippet propfull "Full property declaration" b
+private ${1:int} ${2:_myProperty};
+
+public $1 ${3:MyProperty}
+{
+ get { return $2; }
+ set { $2 = value; }
+}
+endsnippet
+
+snippet propg "Property with a private setter" b
+public ${1:int} ${2:MyProperty} { get; private set; }
+endsnippet
+
+
+############
+# blocks #
+############
+
+snippet #if "#if #endif" b
+#if ${1:DEBUG}
+${VISUAL}$0
+#endif
+endsnippet
+
+snippet #region "#region #endregion" b
+#region ${1:Region}
+${VISUAL}$0
+#endregion
+endsnippet
+
+
+###########
+# loops #
+###########
+
+snippet for "for loop" b
+for (int ${1:i} = 0; $1 < ${2:10}; $1++)
+{
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet forr "for loop (reverse)" b
+for (int ${1:i} = ${2:10}; $1 >= 0; $1--)
+{
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet foreach "foreach loop" b
+foreach (${3:var} ${2:item} in ${1:items})
+{
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet while "while loop" b
+while (${1:true})
+{
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet do "do loop" b
+do
+{
+ ${VISUAL}$0
+} while (${1:true});
+endsnippet
+
+
+###############
+# branching #
+###############
+
+snippet if "if statement" b
+if ($1)
+{
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet ife "if else statement" b
+if ($1)
+{
+ ${VISUAL}$0
+}
+else
+{
+}
+endsnippet
+
+snippet elif "else if" b
+else if ($1)
+{
+ $0
+}
+endsnippet
+
+snippet elseif "else if" b
+else if ($1)
+{
+ $0
+}
+endsnippet
+
+snippet ifnn "if not null" b
+if ($1 != null)
+{
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet switch "switch statement" b
+switch (${1:statement})
+{
+ case ${2:value}:
+ break;
+
+ default:
+ $0break;
+}
+endsnippet
+
+snippet case "case" b
+case ${1:value}:
+ $2
+ break;
+endsnippet
+
+
+##############
+# wrappers #
+##############
+
+snippet using "using statement" b
+using (${1:resource})
+{
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet unchecked "unchecked block" b
+unchecked
+{
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet checked "checked block" b
+checked
+{
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet unsafe "unsafe" b
+unsafe
+{
+ ${VISUAL}$0
+}
+endsnippet
+
+
+########################
+# exception handling #
+########################
+
+snippet try "try catch block" b
+try
+{
+ ${VISUAL}$0
+}
+catch (${1:Exception} ${2:e})
+{
+ throw;
+}
+endsnippet
+
+snippet tryf "try finally block" b
+try
+{
+ ${VISUAL}$0
+}
+finally
+{
+}
+endsnippet
+
+snippet throw "throw"
+throw new ${1}Exception("${2}");
+endsnippet
+
+
+##########
+# LINQ #
+##########
+
+snippet from "LINQ syntax" b
+var ${1:seq} =
+ from ${2:item1} in ${3:items1}
+ join ${4:item2} in ${5:items2} on $2.${6:prop1} equals $4.${7:prop2}
+ select ${8:$2.prop3}
+ where ${9:clause}
+endsnippet
+
+
+############################
+# feedback and debugging #
+############################
+
+snippet da "Debug.Assert" b
+Debug.Assert(${1:true});
+endsnippet
+
+snippet cw "Console.WriteLine" b
+Console.WriteLine("$1");
+endsnippet
+
+# as you first type comma-separated parameters on the right, {n} values appear in the format string
+snippet cwp "Console.WriteLine with parameters" b
+Console.WriteLine("${2:`!p
+snip.rv = ' '.join(['{' + str(i) + '}' for i in range(t[1].count(','))])
+`}"${1:, something});
+endsnippet
+
+snippet mbox "Message box" b
+MessageBox.Show("${1:message}");
+endsnippet
+
+
+##################
+# full methods #
+##################
+
+snippet equals "Equals method" b
+public override bool Equals(object obj)
+{
+ if (obj == null || GetType() != obj.GetType())
+ {
+ return false;
+ }
+ $0
+ return base.Equals(obj);
+}
+endsnippet
+
+
+##############
+# comments #
+##############
+
+snippet /// "XML comment" b
+/// <summary>
+/// $1
+/// </summary>
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/css.snippets b/vim/bundle/vim-snippets/UltiSnips/css.snippets
new file mode 100644
index 0000000..ff26509
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/css.snippets
@@ -0,0 +1,499 @@
+priority -50
+
+snippet . "selector { }"
+$1 {
+ $0
+}
+endsnippet
+
+snippet p "padding"
+padding: ${1:0};$0
+endsnippet
+
+snippet m "margin"
+margin: ${1:0};$0
+endsnippet
+
+snippet bd "border"
+border: ${1:0};$0
+endsnippet
+
+snippet d "display"
+display: ${1:none};$0
+endsnippet
+
+snippet bg "background"
+background: ${1:none};$0
+endsnippet
+
+snippet ff "font-family"
+font-family: ${1:"Helvetica Neue", Helvetica, Arial, sans-serif};$0
+endsnippet
+
+snippet h "height"
+height: ${1:auto};$0
+endsnippet
+
+snippet w "width"
+width: ${1:auto};$0
+endsnippet
+
+snippet pos "position"
+position: ${1:relative};$0
+endsnippet
+
+snippet tt "text-transform"
+text-transform: ${1:none};$0
+endsnippet
+
+snippet ! "!important CSS (!)"
+!important
+endsnippet
+
+snippet tsh "text-shadow: color-hex x y blur (text)"
+text-shadow: ${1:${2:color} ${3:offset-x} ${4:offset-y} ${5:blur}};$0
+endsnippet
+
+snippet bxsh "box-shadow: color-hex x y blur (text)"
+box-shadow: ${1:${2:offset-x} ${3:offset-y} ${4:blur} ${5:spread} ${6:color}};$0
+endsnippet
+
+#
+# Colors
+#
+
+snippet rgb "color rgb"
+rgb(${1:255}, ${2:255}, ${3:255})$0
+endsnippet
+
+snippet rgba "color rgba"
+rgba(${1:255}, ${2:255}, ${3:255}, ${4:0.5})$0
+endsnippet
+
+snippet hsl "color hsl"
+hsl(${1:360}, ${2:100}%, ${3:100}%)$0
+endsnippet
+
+snippet hsla "color hsla"
+hsla(${1:360}, ${2:100}%, ${3:100}%, ${4:0.5})$0
+endsnippet
+
+#
+# Selectors
+#
+
+snippet :fc
+:first-child
+endsnippet
+
+snippet :lc
+:last-child
+endsnippet
+
+snippet :nc
+:nth-child($0)
+endsnippet
+
+snippet :nlc
+:nth-last-child($0)
+endsnippet
+
+snippet :oc
+:only-child
+endsnippet
+
+#
+# Pseudo-elements
+#
+
+snippet :a
+:after
+endsnippet
+
+snippet :b
+:before
+endsnippet
+
+snippet ::a
+::after
+endsnippet
+
+snippet ::b
+::before
+endsnippet
+
+###########################################################################
+# Most of these came from TextMate #
+###########################################################################
+
+snippet background "background-attachment: scroll:fixed (background)"
+background-attachment: ${1:scroll/fixed};$0
+endsnippet
+
+snippet background "background-color: color-hex (background)"
+background-color: #${1:DDD};$0
+endsnippet
+
+snippet background "background-color: color-name (background)"
+background-color: ${1:red};$0
+endsnippet
+
+snippet background "background-color: color-rgb (background)"
+background-color: rgb(${1:255},${2:255},${3:255});$0
+endsnippet
+
+snippet background "background-color: transparent (background)"
+background-color: transparent;$0
+endsnippet
+
+snippet background "background-image: none (background)"
+background-image: none;$0
+endsnippet
+
+snippet background "background-image: url (background)"
+background-image: url($1);$0
+endsnippet
+
+snippet background "background-position: position (background)"
+background-position: ${1:top left/top center/top right/center left/center center/center right/bottom left/bottom center/bottom right/x-% y-%/x-pos y-pos};$0
+endsnippet
+
+snippet background "background-repeat: r:r-x:r-y:n-r (background)"
+background-repeat: ${1:repeat/repeat-x/repeat-y/no-repeat};$0
+endsnippet
+
+snippet background "background: color image repeat attachment position (background)"
+background:${6: #${1:DDD}} url($2) ${3:repeat/repeat-x/repeat-y/no-repeat} ${4:scroll/fixed} ${5:top left/top center/top right/center left/center center/center right/bottom left/bottom center/bottom right/x-% y-%/x-pos y-pos};$0
+endsnippet
+
+snippet border "border-bottom-color: size style color (border)"
+border-bottom-color: #${1:999};$0
+endsnippet
+
+snippet border "border-bottom-style: size style color (border)"
+border-bottom-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0
+endsnippet
+
+snippet border "border-bottom-width: size style color (border)"
+border-bottom-width: ${1:1}px ${2:solid} #${3:999};$0
+endsnippet
+
+snippet border "border-bottom: size style color (border)"
+border-bottom: ${1:1}px ${2:solid} #${3:999};$0
+endsnippet
+
+snippet border "border-color: color (border)"
+border-color: ${1:999};$0
+endsnippet
+
+snippet border "border-left-color: color (border)"
+border-right-color: #${1:999};$0
+endsnippet
+
+snippet border "border-left-style: style (border)"
+border-left-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0
+endsnippet
+
+snippet border "border-left-width: size (border)"
+border-left-width: ${1:1}px
+endsnippet
+
+snippet border "border-left: size style color (border)"
+border-left: ${1:1}px ${2:solid} #${3:999};$0
+endsnippet
+
+snippet border "border-right-color: color (border)"
+border-right-color: #${1:999};$0
+endsnippet
+
+snippet border "border-right-style: style (border)"
+border-right-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0
+endsnippet
+
+snippet border "border-right-width: size (border)"
+border-right-width: ${1:1}px
+endsnippet
+
+snippet border "border-right: size style color (border)"
+border-right: ${1:1}px ${2:solid} #${3:999};$0
+endsnippet
+
+snippet border "border-style: style (border)"
+border-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0
+endsnippet
+
+snippet border "border-top-color: color (border)"
+border-top-color: #${1:999};$0
+endsnippet
+
+snippet border "border-top-style: style (border)"
+border-top-style: ${1:none/hidden/dotted/dashed/solid/double/groove/ridge/inset/outset};$0
+endsnippet
+
+snippet border "border-top-width: size (border)"
+border-top-width: ${1:1}px
+endsnippet
+
+snippet border "border-top: size style color (border)"
+border-top: ${1:1}px ${2:solid} #${3:999};$0
+endsnippet
+
+snippet border "border-width: width (border)"
+border-width: ${1:1px};$0
+endsnippet
+
+snippet border "border: size style color (border)"
+border: ${1:1px} ${2:solid} #${3:999};$0
+endsnippet
+
+snippet clear "clear: value (clear)"
+clear: ${1:left/right/both/none};$0
+endsnippet
+
+snippet color "color: color-hex (color)"
+color: #${1:DDD};$0
+endsnippet
+
+snippet color "color: color-name (color)"
+color: ${1:red};$0
+endsnippet
+
+snippet color "color: color-rgb (color)"
+color: rgb(${1:255},${2:255},${3:255});$0
+endsnippet
+
+snippet cursor "cursor: type (cursor)"
+cursor: ${1:default/auto/crosshair/pointer/move/*-resize/text/wait/help};$0
+endsnippet
+
+snippet cursor "cursor: url (cursor)"
+cursor: url($1);$0
+endsnippet
+
+snippet direction "direction: ltr|rtl (direction)"
+direction: ${1:ltr|rtl};$0
+endsnippet
+
+snippet display "display: block (display)"
+display: block;$0
+endsnippet
+
+snippet display "display: common-types (display)"
+display: ${1:none/inline/block/list-item/run-in/compact/marker};$0
+endsnippet
+
+snippet display "display: inline (display)"
+display: inline;$0
+endsnippet
+
+snippet display "display: table-types (display)"
+display: ${1:table/inline-table/table-row-group/table-header-group/table-footer-group/table-row/table-column-group/table-column/table-cell/table-caption};$0
+endsnippet
+
+snippet float "float: left:right:none (float)"
+float: ${1:left/right/none};$0
+endsnippet
+
+snippet font "font-family: family (font)"
+font-family: ${1:Arial, "MS Trebuchet"}, ${2:sans-}serif;$0
+endsnippet
+
+snippet font "font-size: size (font)"
+font-size: ${1:100%};$0
+endsnippet
+
+snippet font "font-style: normal:italic:oblique (font)"
+font-style: ${1:normal/italic/oblique};$0
+endsnippet
+
+snippet font "font-variant: normal:small-caps (font)"
+font-variant: ${1:normal/small-caps};$0
+endsnippet
+
+snippet font "font-weight: weight (font)"
+font-weight: ${1:normal/bold};$0
+endsnippet
+
+snippet font "font: style variant weight size:line-height font -family (font)"
+font: ${1:normal/italic/oblique} ${2:normal/small-caps} ${3:normal/bold} ${4:1em/1.5em} ${5:Arial}, ${6:sans-}serif;$0
+endsnippet
+
+snippet font "font: size font (font)"
+font: ${1:75%} ${2:"Lucida Grande", "Trebuchet MS", Verdana,} ${3:sans-}serif;$0
+endsnippet
+
+snippet letter "letter-spacing: length-em (letter)"
+letter-spacing: $1em;$0
+endsnippet
+
+snippet letter "letter-spacing: length-px (letter)"
+letter-spacing: $1px;$0
+endsnippet
+
+snippet list "list-style-image: url (list)"
+list-style-image: url($1);$0
+endsnippet
+
+snippet list "list-style-position: pos (list)"
+list-style-position: ${1:inside/outside};$0
+endsnippet
+
+snippet list "list-style-type: asian (list)"
+list-style-type: ${1:cjk-ideographic/hiragana/katakana/hiragana-iroha/katakana-iroha};$0
+endsnippet
+
+snippet list "list-style-type: marker(list)"
+list-style-type: ${1:none/disc/circle/square};$0
+endsnippet
+
+snippet list "list-style-type: numeric (list)"
+list-style-type: ${1:decimal/decimal-leading-zero/zero};$0
+endsnippet
+
+snippet list "list-style-type: other (list)"
+list-style-type: ${1:hebrew/armenian/georgian};$0
+endsnippet
+
+snippet list "list-style-type: roman-alpha-greek (list)"
+list-style-type: ${1:lower-roman/upper-roman/lower-alpha/upper-alpha/lower-greek/lower-latin/upper-latin};$0
+endsnippet
+
+snippet list "list-style: type position image (list)"
+list-style: ${1:none/disc/circle/square/decimal/zero} ${2:inside/outside} url($3);$0
+endsnippet
+
+snippet margin "margin-bottom: length (margin)"
+margin-bottom: ${1:20px};$0
+endsnippet
+
+snippet margin "margin-left: length (margin)"
+margin-left: ${1:20px};$0
+endsnippet
+
+snippet margin "margin-right: length (margin)"
+margin-right: ${1:20px};$0
+endsnippet
+
+snippet margin "margin-top: length (margin)"
+margin-top: ${1:20px};$0
+endsnippet
+
+snippet margin "margin: all (margin)"
+margin: ${1:20px};$0
+endsnippet
+
+snippet margin "margin: T R B L (margin)"
+margin: ${1:20px} ${2:0px} ${3:40px} ${4:0px};$0
+endsnippet
+
+snippet margin "margin: V H (margin)"
+margin: ${1:20px} ${2:0px};$0
+endsnippet
+
+snippet marker "marker-offset: auto (marker)"
+marker-offset: auto;$0
+endsnippet
+
+snippet marker "marker-offset: length (marker)"
+marker-offset: ${1:10px};$0
+endsnippet
+
+snippet overflow "overflow: type (overflow)"
+overflow: ${1:visible/hidden/scroll/auto};$0
+endsnippet
+
+snippet padding "padding-bottom: length (margin)"
+padding-bottom: ${1:20px};$0
+endsnippet
+
+snippet padding "padding-left: length (margin)"
+padding-left: ${1:20px};$0
+endsnippet
+
+snippet padding "padding-right: length (margin)"
+padding-right: ${1:20px};$0
+endsnippet
+
+snippet padding "padding-top: length (margin)"
+padding-top: ${1:20px};$0
+endsnippet
+
+snippet padding "padding: T R B L (padding)"
+padding: ${1:20px} ${2:0px} ${3:40px} ${4:0px};$0
+endsnippet
+
+snippet padding "padding: V H (padding)"
+padding: ${1:20px} ${2:0px};$0
+endsnippet
+
+snippet padding "padding: all (padding)"
+padding: ${1:20px};$0
+endsnippet
+
+snippet position "position: type (position)"
+position: ${1:static/relative/absolute/fixed};$0
+endsnippet
+
+snippet { "properties { } ( } )"
+{
+ /* $1 */
+ $0
+
+endsnippet
+
+snippet scrollbar "scrollbar"
+scrollbar-base-color: ${1:#CCCCCC};${2:
+scrollbar-arrow-color: ${3:#000000};
+scrollbar-track-color: ${4:#999999};
+scrollbar-3dlight-color: ${5:#EEEEEE};
+scrollbar-highlight-color: ${6:#FFFFFF};
+scrollbar-face-color: ${7:#CCCCCC};
+scrollbar-shadow-color: ${9:#999999};
+scrollbar-darkshadow-color: ${8:#666666};}
+endsnippet
+
+snippet selection "selection"
+$1::-moz-selection,
+$1::selection {
+ color: ${2:inherit};
+ background: ${3:inherit};
+}
+endsnippet
+
+snippet text "text-align: left:center:right (txt)"
+text-align: ${1:left/right/center/justify};$0
+endsnippet
+
+snippet text "text-decoration: none:underline:overline:line-through:blink (text)"
+text-decoration: ${1:none/underline/overline/line-through/blink};$0
+endsnippet
+
+snippet text "text-indent: length (text)"
+text-indent: ${1:10}px;$0
+endsnippet
+
+snippet text "text-transform: capitalize:upper:lower (text)"
+text-transform: ${1:capitalize/uppercase/lowercase};$0
+endsnippet
+
+snippet vertical "vertical-align: type (vertical)"
+vertical-align: ${1:baseline/sub/super/top/text-top/middle/bottom/text-bottom/length/%};$0
+endsnippet
+
+snippet visibility "visibility: type (visibility)"
+visibility: ${1:visible/hidden/collapse};$0
+endsnippet
+
+snippet white "white-space: normal:pre:nowrap (white)"
+white-space: ${1:normal/pre/nowrap};$0
+endsnippet
+
+snippet word "word-spacing: length (word)"
+word-spacing: ${1:10px};$0
+endsnippet
+
+snippet z "z-index: index (z)"
+z-index: $1;$0
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/d.snippets b/vim/bundle/vim-snippets/UltiSnips/d.snippets
new file mode 100644
index 0000000..9ce2751
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/d.snippets
@@ -0,0 +1,584 @@
+# Simple shortcuts
+
+priority -50
+
+snippet imp "import (imp)" b
+import ${1:std.stdio};
+endsnippet
+
+snippet pimp "public import (pimp)" b
+public import ${1:/*module*/};
+endsnippet
+
+snippet over "override (over)" b
+override ${1:/*function*/}
+endsnippet
+
+snippet al "alias (al)"
+alias ${1:/*orig*/} ${2:/*alias*/};
+endsnippet
+
+snippet mixin "mixin (mixin)" b
+mixin ${1:/*mixed_in*/} ${2:/*name*/};
+endsnippet
+
+snippet new "new (new)"
+new ${1}(${2});
+endsnippet
+
+snippet scpn "@safe const pure nothrow (scpn)"
+@safe const pure nothrow
+endsnippet
+
+snippet spn "@safe pure nothrow (spn)"
+@safe pure nothrow
+endsnippet
+
+snippet cont "continue (cont)"
+continue;
+endsnippet
+
+snippet dis "@disable (dis)" b
+@disable ${1:/*method*/};
+endsnippet
+
+snippet pub "public (pub)" b
+public:
+ ${1:/*members*/}
+endsnippet
+
+snippet priv "private (priv)" b
+private:
+ ${1:/*members*/}
+endsnippet
+
+snippet prot "protected (prot)" b
+protected:
+ ${1:/*members*/}
+endsnippet
+
+snippet pack "package (pack)" b
+package:
+ ${1:/*members*/}
+endsnippet
+
+snippet ret "return (ret)"
+return ${1:/*value to return*/};
+endsnippet
+
+snippet auto "auto (auto)" b
+auto ${1:/*variable*/} = ${2:/*value*/};
+endsnippet
+
+snippet con "const (con)" b
+const ${1:/*variable*/} = ${2:/*value*/};
+endsnippet
+
+snippet siz "size_t (siz)" b
+size_t ${1:/*variable*/} = ${2:/*value*/};
+endsnippet
+
+snippet sup "super (sup)" b
+super(${1:/*args*/});
+endsnippet
+
+# Phobos
+
+snippet tup "tuple (tup)"
+tuple(${1:/*args*/})
+endsnippet
+
+snippet wr "writeln (wr)"
+writeln(${1:/*args*/});
+endsnippet
+
+snippet to "to (to)"
+to!(${1:/*type*/})(${2:/*arg*/})
+endsnippet
+
+snippet enf "enforce (enf)" b
+enforce(${1:/*condition*/},
+ new ${2}Exception(${3:/*args*/}));
+endsnippet
+
+# Branches
+
+snippet if "if .. (if)"
+if(${1:/*condition*/})
+{
+ ${VISUAL}${0}
+}
+endsnippet
+
+snippet ife "if .. else (ife)" b
+if(${1:/*condition*/})
+{
+ ${2}
+}
+else
+{
+ ${3:/*else*/}
+}
+endsnippet
+
+snippet el "else (el)" b
+else
+{
+ ${VISUAL}${1}
+}
+endsnippet
+
+snippet elif "else if (elif)" b
+else if(${1:/*condition*/})
+{
+ ${VISUAL}${0}
+}
+endsnippet
+
+snippet sw "switch (sw)"
+switch(${1:/*var*/})
+{
+ case ${2:/*value*/}:
+ ${3}
+ break;
+ case ${4:/*value*/}:
+ ${5}
+ break;
+ ${7:/*more cases*/}
+ default:
+ ${6:assert(false);}
+}
+endsnippet
+
+snippet fsw "final switch (fsw)"
+final switch(${1:/*var*/})
+{
+ case ${2:/*value*/}:
+ ${3}
+ break;
+ case ${4:/*value*/}:
+ ${5}
+ break;
+ ${7:/*more cases*/}
+}
+endsnippet
+
+snippet case "case (case)" b
+case ${1:/*value*/}:
+ ${2}
+ break;
+endsnippet
+
+snippet ?: "ternary operator (?:)"
+${1:/*condition*/} ? ${2:/*then*/} : ${3:/*else*/}$4
+endsnippet
+
+# Loops
+
+snippet do "do while (do)" b
+do
+{
+ ${VISUAL}${2}
+} while(${1:/*condition*/});
+endsnippet
+
+snippet wh "while (wh)" b
+while(${1:/*condition*/})
+{
+ ${VISUAL}${2}
+}
+endsnippet
+
+snippet for "for (for)" b
+for (${4:size_t} ${2:i} = 0; $2 < ${1:count}; ${3:++$2})
+{
+ ${VISUAL}${0}
+}
+endsnippet
+
+snippet forever "forever (forever)" b
+for(;;)
+{
+ ${VISUAL}${0}
+}
+endsnippet
+
+snippet fore "foreach (fore)"
+foreach(${1:/*elem*/}; ${2:/*range*/})
+{
+ ${VISUAL}${3}
+}
+endsnippet
+
+snippet forif "foreach if (forif)" b
+foreach(${1:/*elem*/}; ${2:/*range*/}) if(${3:/*condition*/})
+{
+ ${VISUAL}${4}
+}
+endsnippet
+
+# Contracts
+snippet in "in contract (in)" b
+in
+{
+ assert(${1:/*condition*/}, "${2:error message}");
+ ${3}
+}
+body
+endsnippet
+
+snippet out "out contract (out)" b
+out${1:(result)}
+{
+ assert(${2:/*condition*/}, "${3:error message}");
+ ${4}
+}
+body
+endsnippet
+
+snippet inv "invariant (inv)" b
+invariant()
+{
+ assert(${1:/*condition*/}, "${2:error message}");
+ ${3}
+}
+endsnippet
+
+# Functions (generic)
+
+snippet fun "function definition (fun)"
+${1:void} ${2:/*function name*/}(${3:/*args*/}) ${4:@safe pure nothrow}
+{
+ ${VISUAL}${5}
+}
+endsnippet
+
+snippet void "void function definition (void)"
+void ${1:/*function name*/}(${2:/*args*/}) ${3:@safe pure nothrow}
+{
+ ${VISUAL}${4}
+}
+endsnippet
+
+snippet this "ctor (this)" w
+this(${1:/*args*/})
+{
+ ${VISUAL}${2}
+}
+endsnippet
+
+snippet get "getter property (get)"
+@property ${1:/*type*/} ${2:/*member_name*/}() const pure nothrow {return ${3:$2_};}
+endsnippet
+
+snippet set "setter property (set)"
+@property void ${1:/*member_name*/}(${2:/*type*/} rhs) pure nothrow {${3:$1_} = rhs;}
+endsnippet
+
+# Functions (concrete)
+
+snippet main "Main" b
+void main(string[] args)
+{
+ ${VISUAL}${0: /*code*/}
+}
+endsnippet
+
+# Mixins
+
+snippet signal "signal (signal)" b
+mixin Signal!(${1:/*args*/}) ${2:/*name*/};
+endsnippet
+
+# Scope
+
+snippet scope "scope (scope)" b
+scope(${1:exit})
+{
+ ${VISUAL}${2}
+}
+endsnippet
+
+# With
+
+snippet with "with (with)"
+with(${1})
+{
+ ${VISUAL}${2}
+}
+endsnippet
+
+# Exception handling
+
+snippet try "try/catch (try)" b
+try
+{
+ ${VISUAL}${1:/*code to try*/}
+}
+catch(${2}Exception e)
+{
+ ${3:/*handle exception*/}
+}
+endsnippet
+
+snippet tryf "try/catch/finally (tryf)" b
+try
+{
+ ${VISUAL}${1:/*code to try*/}
+}
+catch(${2}Exception e)
+{
+ ${3:/*handle exception*/}
+}
+finally
+{
+ ${4:/*cleanup*/}
+}
+endsnippet
+
+snippet catch "catch (catch)" b
+catch(${1}Exception e)
+{
+ ${2:/*handle exception*/}
+}
+endsnippet
+
+snippet thr "throw (thr)"
+throw new ${1}Exception("${2}");
+endsnippet
+
+
+# Type declarations
+
+snippet struct "struct (struct)"
+struct ${1:`!p snip.rv = (snip.basename or "name")`}
+{
+ ${2}
+}
+endsnippet
+
+snippet union "union (union)"
+union ${1:`!p snip.rv = (snip.basename or "name")`}
+{
+ ${2}
+}
+endsnippet
+
+snippet class "class (class)"
+class ${1:`!p snip.rv = (snip.basename or "name")`}
+{
+ ${2}
+}
+endsnippet
+
+snippet inter "interface (inter)"
+interface ${1:`!p snip.rv = (snip.basename or "name")`}
+{
+ ${2}
+}
+endsnippet
+
+snippet enum "enum (enum)"
+enum ${1:`!p snip.rv = (snip.basename or "name")`}
+{
+ ${2}
+}
+endsnippet
+
+
+# Exception declarations
+
+snippet exc "exception declaration (exc)" b
+/// ${3:/*documentation*/}
+class ${1}Exception : ${2}Exception
+{
+ public this(string msg, string file = __FILE__, int line = __LINE__)
+ {
+ super(msg, file, line);
+ }
+}
+endsnippet
+
+
+# Conditional compilation
+
+snippet version "version (version)" b
+version(${1:/*version name*/})
+{
+ ${VISUAL}${2}
+}
+endsnippet
+
+snippet debug "debug" b
+debug
+{
+ ${VISUAL}${1}
+}
+endsnippet
+
+
+# Templates
+
+snippet temp "template (temp)" b
+template ${2:/*name*/}(${1:/*args*/})
+{
+ ${3}
+}
+endsnippet
+
+
+# Asserts
+
+snippet ass "assert (ass)" b
+assert(${1:false}, "${2:TODO}");
+
+endsnippet
+
+
+# Unittests
+
+snippet unittest "unittest (unittest)" b
+unittest
+{
+ ${1}
+}
+endsnippet
+
+
+# Common member functions
+
+snippet opDis "opDispatch (opDis)" b
+${1:/*return type*/} opDispatch(string s)()
+{
+ ${2};
+}
+endsnippet
+
+snippet op= "opAssign (op=)" b
+void opAssign(${1} rhs) ${2:@safe pure nothrow}
+{
+ ${2}
+}
+endsnippet
+
+snippet opCmp "opCmp (opCmp)" b
+int opCmp(${1} rhs) @safe const pure nothrow
+{
+ ${2}
+}
+endsnippet
+
+snippet opApply "opApply (opApply)" b
+int opApply(int delegate(ref ${1:/*iterated type/s*/}) dg)
+{
+ int result = 0;
+ ${2:/*loop*/}
+ {
+ result = dg(${3:/*arg/s*/});
+ if(result){break;}
+ }
+ return result;
+}
+endsnippet
+
+snippet toString "toString (toString)" b
+string toString() @safe const pure nothrow
+{
+ ${1}
+}
+endsnippet
+
+
+# Comments
+
+
+snippet todo "TODO (todo)"
+// TODO: ${1}
+endsnippet
+
+
+# DDoc
+
+snippet doc "generic ddoc block (doc)" b
+/// ${1:description}
+///
+/// ${2:details}
+endsnippet
+
+snippet fdoc "function ddoc block (fdoc)" b
+/// ${1:description}
+///
+/// ${2:Params: ${3:param} = ${4:param description}
+/// ${5}}
+///
+/// ${6:Returns: ${7:return value}}
+///
+/// ${8:Throws: ${9}Exception ${10}}
+endsnippet
+
+snippet Par "Params (Par)"
+Params: ${1:param} = ${2:param description}
+/// ${3}
+endsnippet
+
+snippet Ret "Returns (Ret)"
+Returns: ${1:return value/s}
+endsnippet
+
+snippet Thr "Throws (Thr)"
+Throws: ${1}Exception ${2}
+endsnippet
+
+snippet Example "Examples (Example)"
+Examples:
+/// --------------------
+/// ${1:example code}
+/// --------------------
+endsnippet
+
+
+# License blocks
+
+snippet gpl "GPL (gpl)" b
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// Copyright (C) ${1:Author}, `!v strftime("%Y")`
+
+${2}
+endsnippet
+
+snippet boost "Boost (boost)" b
+// Copyright ${1:Author} `!v strftime("%Y")`.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+${2}
+endsnippet
+
+
+# New module
+
+snippet module "New module (module)" b
+// Copyright ${1:Author} `!v strftime("%Y")`.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+module ${2}.`!v vim_snippets#Filename('$1', 'name')`;
+
+
+${3}
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/django.snippets b/vim/bundle/vim-snippets/UltiSnips/django.snippets
new file mode 100644
index 0000000..0ba6c9d
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/django.snippets
@@ -0,0 +1,361 @@
+priority -50
+
+# This files will define django snippets from sublime text djaneiro
+# FORMS SNIPPETS
+
+snippet form "Form" b
+class ${1:FORMNAME}(forms.Form):
+
+ ${2:# TODO: Define form fields here}
+endsnippet
+
+snippet modelform "ModelForm" b
+class ${1:MODELNAME}Form(forms.ModelForm):
+
+ class Meta:
+ model = $1
+endsnippet
+
+snippet fbool "BooleanField" b
+${1:FIELDNAME} = forms.BooleanField($2)
+endsnippet
+
+snippet fchar "CharField" b
+${1:FIELDNAME} = forms.CharField($2)
+endsnippet
+
+snippet fchoice "ChoiceField" b
+${1:FIELDNAME} = forms.ChoiceField($2)
+endsnippet
+
+snippet fcombo "ComboField" b
+${1:FIELDNAME} = forms.ComboField($2)
+endsnippet
+
+snippet fdate "DateField" b
+${1:FIELDNAME} = forms.DateField($2)
+endsnippet
+
+snippet fdatetime "DateTimeField" b
+${1:FIELDNAME} = forms.DateTimeField($2)
+endsnippet
+
+snippet fdecimal "DecimalField" b
+${1:FIELDNAME} = forms.DecimalField($2)
+endsnippet
+
+snippet fmail "EmailField" b
+${1:FIELDNAME} = forms.EmailField($2)
+endsnippet
+
+snippet ffile "FileField" b
+${1:FIELDNAME} = forms.FileField($2)
+endsnippet
+
+snippet ffilepath "FilePathField" b
+${1:FIELDNAME} = forms.FilePathField($2)
+endsnippet
+
+snippet ffloat "FloatField" b
+${1:FIELDNAME} = forms.FloatField($2)
+endsnippet
+
+snippet fip "IPAddressField" b
+${1:FIELDNAME} = forms.IPAddressField($2)
+endsnippet
+
+snippet fimg "ImageField" b
+${1:FIELDNAME} = forms.ImageField($2)
+endsnippet
+
+snippet fint "IntegerField" b
+${1:FIELDNAME} = forms.IntegerField($2)
+endsnippet
+
+snippet fmochoice "ModelChoiceField" b
+${1:FIELDNAME} = forms.ModelChoiceField($2)
+endsnippet
+
+snippet fmomuchoice "ModelMultipleChoiceField" b
+${1:FIELDNAME} = forms.ModelMultipleChoiceField($2)
+endsnippet
+
+snippet fmuval "MultiValueField" b
+${1:FIELDNAME} = forms.MultiValueField($2)
+endsnippet
+
+snippet fmuchoice "MultipleChoiceField" b
+${1:FIELDNAME} = forms.MultipleChoiceField($2)
+endsnippet
+
+snippet fnullbool "NullBooleanField" b
+${1:FIELDNAME} = forms.NullBooleanField($2)
+endsnippet
+
+snippet freg "RegexField" b
+${1:FIELDNAME} = forms.RegexField($2)
+endsnippet
+
+snippet fslug "SlugField" b
+${1:FIELDNAME} = forms.SlugField($2)
+endsnippet
+
+snippet fsdatetime "SplitDateTimeField" b
+${1:FIELDNAME} = forms.SplitDateTimeField($2)
+endsnippet
+
+snippet ftime "TimeField" b
+${1:FIELDNAME} = forms.TimeField($2)
+endsnippet
+
+snippet ftchoice "TypedChoiceField" b
+${1:FIELDNAME} = forms.TypedChoiceField($2)
+endsnippet
+
+snippet ftmuchoice "TypedMultipleChoiceField" b
+${1:FIELDNAME} = forms.TypedMultipleChoiceField($2)
+endsnippet
+
+snippet furl "URLField" b
+${1:FIELDNAME} = forms.URLField($2)
+endsnippet
+
+# MODELS SNIPPETS
+
+snippet model "Model" b
+class ${1:MODELNAME}(models.Model):
+ ${0}
+ class Meta:
+ verbose_name = "$1"
+ verbose_name_plural = "$1s"
+
+ def __str__(self):
+ return super($1, self).__str__()
+
+endsnippet
+
+snippet modelfull "Model" b
+class ${1:MODELNAME}(models.Model):
+ ${2:# TODO: Define fields here}
+
+ class Meta:
+ verbose_name = "$1"
+ verbose_name_plural = "$1s"
+
+ def __str__(self):
+ return super($1, self).__str__()
+
+ def save(self):
+ return super($1, self).save()
+
+ @models.permalink
+ def get_absolute_url(self):
+ return ('')
+
+ ${3:# TODO: Define custom methods here}
+
+endsnippet
+
+snippet mauto "AutoField" b
+${1:FIELDNAME} = models.AutoField($2)
+endsnippet
+
+snippet mbigint "BigIntegerField" b
+${1:FIELDNAME} = models.BigIntegerField($2)
+endsnippet
+
+snippet mbool "BooleanField" b
+${1:FIELDNAME} = models.BooleanField($2)
+endsnippet
+
+snippet mchar "CharField" b
+${1:FIELDNAME} = models.CharField($2, max_length=${3:50})
+endsnippet
+
+snippet mcoseint "CommaSeparatedIntegerField" b
+${1:FIELDNAME} = models.CommaSeparatedIntegerField($2)
+endsnippet
+
+snippet mdate "DateField" b
+${1:FIELDNAME} = models.DateField($2)
+endsnippet
+
+snippet mdatetime "DateTimeField" b
+${1:FIELDNAME} = models.DateTimeField($2)
+endsnippet
+
+snippet mdecimal "DecimalField" b
+${1:FIELDNAME} = models.DecimalField(max_digits=${2:10}, decimal_places=${3:2})
+endsnippet
+
+snippet memail "EmailField" b
+${1:FIELDNAME} = models.EmailField($2)
+endsnippet
+
+snippet mfile "FileField" b
+${1:FIELDNAME} = models.FileField($2)
+endsnippet
+
+snippet mfilepath "FilePathField" b
+${1:FIELDNAME} = models.FilePathField($2)
+endsnippet
+
+snippet mfloat "FloatField" b
+${1:FIELDNAME} = models.FloatField($2)
+endsnippet
+
+snippet fk "ForeignKey" b
+${1:FIELDNAME} = models.ForeignKey($2)
+endsnippet
+
+snippet mip "IPAddressField" b
+${1:FIELDNAME} = models.IPAddressField($2)
+endsnippet
+
+snippet mimg "ImageField" b
+${1:FIELDNAME} = models.ImageField($2)
+endsnippet
+
+snippet mint "IntegerField" b
+${1:FIELDNAME} = models.IntegerField($2)
+endsnippet
+
+snippet m2m "ManyToManyField" b
+${1:FIELDNAME} = models.ManyToManyField($2)
+endsnippet
+
+snippet mnullbool "NullBooleanField" b
+${1:FIELDNAME} = models.NullBooleanField($2)
+endsnippet
+
+snippet o2o "OneToOneField" b
+${1:FIELDNAME} = models.OneToOneField($2)
+endsnippet
+
+snippet mphone "PhoneNumberField" b
+${1:FIELDNAME} = models.PhoneNumberField($2)
+endsnippet
+
+snippet mposint "PositiveIntegerField" b
+${1:FIELDNAME} = models.PositiveIntegerField($2)
+endsnippet
+
+snippet mpossmallint "PositiveSmallIntegerField" b
+${1:FIELDNAME} = models.PositiveSmallIntegerField($2)
+endsnippet
+
+snippet mslug "SlugField" b
+${1:FIELDNAME} = models.SlugField($2)
+endsnippet
+
+snippet msmallint "SmallIntegerField" b
+${1:FIELDNAME} = models.SmallIntegerField($2)
+endsnippet
+
+snippet mtext "TextField" b
+${1:FIELDNAME} = models.TextField($2)
+endsnippet
+
+snippet mtime "TimeField" b
+${1:FIELDNAME} = models.TimeField($2)
+endsnippet
+
+snippet murl "URLField" b
+${1:FIELDNAME} = models.URLField($2)
+endsnippet
+
+snippet musstate "USStateField" b
+${1:FIELDNAME} = models.USStateField($2)
+endsnippet
+
+snippet mxml "XMLField" b
+${1:FIELDNAME} = models.XMLField($2)
+endsnippet
+
+# VIEWS SNIPPETS
+
+snippet adminview "Model Admin View" b
+class ${1}Admin(admin.ModelAdmin):
+ '''
+ Admin View for ${1}
+ '''
+ list_display = ('${2}',)
+ list_filter = ('${3}',)
+ inlines = [
+ ${4}Inline,
+ ]
+ raw_id_fields = ('${5}',)
+ readonly_fields = ('${6}',)
+ search_fields = ['${7}']
+admin.site.register(${1}, ${1}Admin)
+endsnippet
+
+snippet createview "Generic Create View" b
+class ${1:MODEL_NAME}CreateView(CreateView):
+ model = ${1:MODEL_NAME}
+ template_name = "${2:TEMPLATE_NAME}"
+endsnippet
+
+snippet deleteview "Generic Delete View" b
+class ${1:MODEL_NAME}DeleteView(DeleteView):
+ model = ${1:MODEL_NAME}
+ template_name = "${2:TEMPLATE_NAME}"
+endsnippet
+
+snippet detailview "Generic Detail View" b
+class ${1:MODEL_NAME}DetailView(DetailView):
+ model = ${1:MODEL_NAME}
+ template_name = "${2:TEMPLATE_NAME}"
+endsnippet
+
+snippet listview "Generic List View" b
+class ${1:MODEL_NAME}ListView(ListView):
+ model = ${1:MODEL_NAME}
+ template_name = "${2:TEMPLATE_NAME}"
+endsnippet
+
+snippet stackedinline "Stacked Inline" b
+class ${1}Inline(admin.StackedInline):
+ '''
+ Stacked Inline View for ${1}
+ '''
+ model = ${2:${1}}
+ min_num = ${3:3}
+ max_num = ${4:20}
+ extra = ${5:1}
+ raw_id_fields = (${6},)
+endsnippet
+
+snippet tabularinline "Tabular Inline" b
+class ${1}Inline(admin.TabularInline):
+ '''
+ Tabular Inline View for ${1}
+ '''
+ model = ${2:${1}}
+ min_num = ${3:3}
+ max_num = ${4:20}
+ extra = ${5:1}
+ raw_id_fields = (${6},)
+endsnippet
+
+snippet templateview "Generic Template View" b
+class ${1:CLASS_NAME}(TemplateView):
+ template_name = "${2:TEMPLATE_NAME}"
+endsnippet
+
+snippet updateview "Generic Update View" b
+class ${1:MODEL_NAME}UpdateView(UpdateView):
+ model = ${1:MODEL_NAME}
+ template_name = "${2:TEMPLATE_NAME}"
+endsnippet
+
+snippet dispatch "Dispatch View method" b
+def dispatch(self, request, *args, **kwargs):
+ return super(${1:CLASS_NAME}, self).dispatch(request, *args, **kwargs)
+endsnippet
+
+snippet context "get_context_data view method" b
+def get_context_data(self, **kwargs):
+ kwargs['extra_context'] = ${1:'New Value'}
+ return super(${2:CLASS_NAME}, self).get_context_data(**kwargs)
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/eelixir.snippets b/vim/bundle/vim-snippets/UltiSnips/eelixir.snippets
new file mode 100644
index 0000000..72fb7ce
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/eelixir.snippets
@@ -0,0 +1,39 @@
+priority -50
+
+extends html
+
+snippet % "<% %>" w
+<% $0 %>
+endsnippet
+
+snippet = "<%= %>" w
+<%= $0 %>
+endsnippet
+
+snippet end "<% end %>" w
+<% end %>
+endsnippet
+
+snippet for
+<%= for ${1:item} <- ${2:$1s} ${3:@conn} do %>
+ $0
+<% end %>
+endsnippet
+
+snippet ft "form_tag" w
+<%= form_tag(${1:"${2:/users}"}, method: ${3::post}) %>
+ $0
+</form>
+endsnippet
+
+snippet lin "link" w
+<%= link ${1:"${2:Submit}"}, to: ${3:"${4:/users}"}, method: ${5::delete} %>
+endsnippet
+
+snippet ff "form_for" w
+<%= form_for @changeset, ${1:"${2:/users}"}, fn f -> %>
+ $0
+
+ <%= submit "Submit" %>
+<% end %>
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/erlang.snippets b/vim/bundle/vim-snippets/UltiSnips/erlang.snippets
new file mode 100644
index 0000000..f317685
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/erlang.snippets
@@ -0,0 +1,108 @@
+###########################################################################
+# TEXTMATE SNIPPETS #
+###########################################################################
+
+priority -50
+
+snippet pat "Case:Receive:Try Clause"
+${1:pattern}${2: when ${3:guard}} ->
+ ${4:body}
+endsnippet
+
+snippet beh "Behaviour Directive" b
+-behaviour(${1:behaviour}).
+endsnippet
+
+snippet case "Case Expression"
+case ${1:expression} of
+ ${2:pattern}${3: when ${4:guard}} ->
+ ${5:body}
+end
+endsnippet
+
+snippet def "Define Directive" b
+-define(${1:macro}${2: (${3:param})}, ${4:body}).
+endsnippet
+
+snippet exp "Export Directive" b
+-export([${1:function}/${2:arity}]).
+endsnippet
+
+snippet fun "Fun Expression"
+fun
+ (${1:pattern})${2: when ${3:guard}} ->
+ ${4:body}
+end
+endsnippet
+
+snippet fu "Function"
+${1:function}(${2:param})${3: when ${4:guard}} ->
+ ${5:body}
+endsnippet
+
+snippet if "If Expression"
+if
+ ${1:guard} ->
+ ${2:body}
+end
+endsnippet
+
+snippet ifdef "Ifdef Directive" b
+-ifdef(${1:macro}).
+endsnippet
+
+snippet ifndef "Ifndef Directive" b
+-ifndef(${1:macro}).
+endsnippet
+
+snippet imp "Import Directive" b
+-import(${1:module}, [${2:function}/${3:arity}]).
+endsnippet
+
+snippet inc "Include Directive" b
+-include("${1:file}").
+endsnippet
+
+snippet mod "Module Directive" b
+-module(${1:`!p snip.rv = snip.basename or "module"`}).
+endsnippet
+
+snippet rcv "Receive Expression"
+receive
+${1: ${2:pattern}${3: when ${4:guard}} ->
+ ${5:body}}
+${6:after
+ ${7:expression} ->
+ ${8:body}}
+end
+endsnippet
+
+snippet rec "Record Directive" b
+-record(${1:record}, {${2:field}${3: = ${4:value}}}).
+endsnippet
+
+snippet try "Try Expression"
+try${1: ${2:expression}${3: of
+ ${4:pattern}${5: when ${6:guard}} ->
+ ${7:body}}}
+${8:catch
+ ${9:pattern}${10: when ${11:guard}} ->
+ ${12:body}}
+${13:after
+ ${14:body}}
+end
+endsnippet
+
+snippet undef "Undef Directive" b
+-undef(${1:macro}).
+endsnippet
+
+snippet || "List Comprehension"
+[${1:X} || ${2:X} <- ${3:List}${4:, gen}]
+endsnippet
+
+snippet gen "Generator Expression"
+${1:X} <- ${2:List}${3:, gen}
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/eruby.snippets b/vim/bundle/vim-snippets/UltiSnips/eruby.snippets
new file mode 100644
index 0000000..fe38c2f
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/eruby.snippets
@@ -0,0 +1,237 @@
+extends html
+
+priority -50
+
+# TextMate added these variables to cope with changes in ERB handling
+# in different versions of Rails -- for instance, Rails 3 automatically
+# strips whitespace so that it's no longer necessary to use a form like
+# <% end -%>, but if you're still maintaining Rails 2 projects, you
+# can't omit the minus sign and get the same behavior.
+#
+# The following regex replace substitutes the function below for the
+# TextMate variable references after the snippets are converted:
+#
+# /\v\$\{(TM_RAILS_TEMPLATE_([^_]+)_RUBY_([^_\s]+))\}/`!p textmate_var('\1', snip)`/g
+#
+global !p
+def textmate_var(var, snip):
+ lookup = dict(
+ TM_RAILS_TEMPLATE_START_RUBY_EXPR = snip.opt('g:tm_rails_template_start_ruby_expr', '<%= '),
+ TM_RAILS_TEMPLATE_END_RUBY_EXPR = snip.opt('g:tm_rails_template_end_ruby_expr', ' %>'),
+ TM_RAILS_TEMPLATE_START_RUBY_INLINE = snip.opt('g:tm_rails_template_start_ruby_inline', '<% '),
+ TM_RAILS_TEMPLATE_END_RUBY_INLINE = snip.opt('g:tm_rails_template_end_ruby_inline', ' %>'),
+ TM_RAILS_TEMPLATE_END_RUBY_BLOCK = '<% end %>'
+ )
+ snip.rv = lookup[var]
+ return
+endglobal
+
+
+snippet % "<% ${0} %>" i
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`${0}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)`
+endsnippet
+
+snippet = "<%= ${0} %>" i
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`${0}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+###########################################################################
+# GENERATED FROM get_tm_snippets.py + REGEX REPLACE #
+###########################################################################
+
+snippet fi "<%= Fixtures.identify(:symbol) %>"
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`Fixtures.identify(:${1:name})`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`$0
+endsnippet
+
+snippet ft "form_tag" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`form_tag(${1::action => '${2:update}'}${3:, ${4:${5:class} => '${6:form}'\}}}) do`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+ $0
+`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)`
+endsnippet
+
+snippet ffs "form_for submit 2" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`${1:f}.submit '${2:Submit}'${3:, :disable_with => '${4:$2ing...}'}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet f. "f_fields_for (nff)" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`f.fields_for :${1:attribute} do |${2:f}|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)`
+ $0
+`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)`
+endsnippet
+
+snippet f. "f.checkbox" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.check_box :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet f. "f.file_field" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.file_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet f. "f.hidden_field" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.hidden_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet f. "f.label" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.label :${1:attribute}${2:, "${3:${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g}}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet f. "f.password_field" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.password_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet f. "f.radio_button" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.radio_button :${1:attribute}, :${2:tag_value}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet f. "f.submit" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.submit "${1:Submit}"${2:, :disable_with => '${3:$1ing...}'}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet f. "f.text_area" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_area :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet f. "f.text_field" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.text_field :${1:attribute}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet ffe "form_for with errors" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`error_messages_for :${1:model}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`form_for @${2:$1} do |f|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+ $0
+`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)`
+endsnippet
+
+snippet ff "form_for" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`form_for @${1:model} do |f|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+ $0
+`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)`
+endsnippet
+
+snippet ist "image_submit_tag" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`image_submit_tag("${1:agree.png}"${2:${3:, :id => "${4:${1/^(\w+)(\.\w*)?$/$1/}}"}${5:, :name => "${6:${1/^(\w+)(\.\w*)?$/$1/}}"}${7:, :class => "${8:${1/^(\w+)(\.\w*)?$/$1/}-button}"}${9:, :disabled => ${10:false}}})`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet it "image_tag" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`image_tag "$1${2:.png}"${3:${4:, :title => "${5:title}"}${6:, :class => "${7:class}"}}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet layout "layout"
+layout "${1:template_name}"${2:${3:, :only => ${4:[:${5:action}, :${6:action}]}}${7:, :except => ${8:[:${9:action}, :${10:action}]}}}
+endsnippet
+
+snippet jit "javascript_include_tag" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`javascript_include_tag ${1::all}${2:, :cache => ${3:true}}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet lt "link_to (name, dest)" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", ${2:dest}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet lia "link_to (action)" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :action => "${2:index}"`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet liai "link_to (action, id)" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :action => "${2:edit}", :id => ${3:@item}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet lic "link_to (controller)" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :controller => "${2:items}"`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet lica "link_to (controller, action)" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :controller => "${2:items}", :action => "${3:index}"`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet licai "link_to (controller, action, id)" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to "${1:link text...}", :controller => "${2:items}", :action => "${3:edit}", :id => ${4:@item}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet linpp "link_to (nested path plural)" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${10:parent}_${11:child}_path(${12:@}${13:${10}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet linp "link_to (nested path)" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet lipp "link_to (path plural)" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${4:model}s_path}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet lip "link_to (path)" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${12:model}_path(${13:@}${14:${12}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet lim "link_to model" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:model}.${2:name}, ${3:${4:$1}_path(${14:$1})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet hide "page.hide (*ids)"
+page.hide ${1:"${2:id(s)}"}
+endsnippet
+
+snippet ins "page.insert_html (position, id, partial)"
+page.insert_html :${1:top}, ${2:"${3:id}"}, :${4:partial => "${5:template}"}
+endsnippet
+
+snippet rep "page.replace (id, partial)"
+page.replace ${1:"${2:id}"}, :${3:partial => "${4:template}"}
+endsnippet
+
+snippet reph "page.replace_html (id, partial)"
+page.replace_html ${1:"${2:id}"}, :${3:partial => "${4:template}"}
+endsnippet
+
+snippet show "page.show (*ids)"
+page.show ${1:"${2:id(s)}"}
+endsnippet
+
+snippet tog "page.toggle (*ids)"
+page.toggle ${1:"${2:id(s)}"}
+endsnippet
+
+snippet vis "page.visual_effect (effect, id)"
+page.visual_effect :${1:toggle_slide}, ${2:"${3:DOM ID}"}
+endsnippet
+
+snippet rp "render (partial) (rp)"
+render :partial => "${1:item}"
+endsnippet
+
+snippet rpc "render (partial,collection) (rpc)"
+render :partial => "${1:item}", :collection => ${2:@$1s}
+endsnippet
+
+snippet rpl "render (partial,locals) (rpl)"
+render :partial => "${1:item}", :locals => { :${2:$1} => ${3:@$1}$0 }
+endsnippet
+
+snippet rpo "render (partial,object) (rpo)"
+render :partial => "${1:item}", :object => ${2:@$1}
+endsnippet
+
+snippet rps "render (partial,status) (rps)"
+render :partial => "${1:item}", :status => ${2:500}
+endsnippet
+
+snippet slt "stylesheet_link_tag" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`stylesheet_link_tag ${1::all}${2:, :cache => ${3:true}}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet st "submit_tag" w
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`submit_tag "${1:Save changes}"${2:, :id => "${3:submit}"}${4:, :name => "${5:$3}"}${6:, :class => "${7:form_$3}"}${8:, :disabled => ${9:false}}${10:, :disable_with => "${11:Please wait...}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+snippet else "else (ERB)"
+<% else %>
+ $0
+endsnippet
+
+snippet lf "link_to_function"
+`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to_function ${1:"${2:Greeting}"}, "${3:alert('Hello world!')}"$4`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)`
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/go.snippets b/vim/bundle/vim-snippets/UltiSnips/go.snippets
new file mode 100644
index 0000000..b6891ff
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/go.snippets
@@ -0,0 +1,115 @@
+# Snippets for Go
+
+priority -50
+
+# when to abbriviate and when not?
+# b doesn't work here, because it ignores whitespace
+# optional local name?
+snippet /^import/ "Import declaration" r
+import (
+ "${1:package}"
+)
+endsnippet
+
+snippet /^package/ "Package declaration" r
+// Package $1 provides ...
+package ${1:main}
+endsnippet
+
+# Mostly converted from: https://github.com/AlanQuatermain/go-tmbundle
+snippet /^cons/ "Constants declaration" r
+const (
+ ${1:constant}${2/(.+)/ /}${2:type} = ${0:value}
+)
+endsnippet
+
+snippet /^con/ "Constant declaration" r
+const ${1:name}${2/(.+)/ /}${2:type} = ${0:value}
+endsnippet
+
+snippet iota "Iota constant generator" b
+const (
+ ${1:constant}${2/(.+)/ /}${2:type} = iota
+)
+endsnippet
+
+snippet struct "Struct declaration" b
+type ${1:Struct} struct {
+ ${0:${VISUAL}}
+}
+endsnippet
+
+snippet interface "Interface declaration" b
+type ${1:Interface} interface {
+ ${0:${VISUAL}}
+}
+endsnippet
+
+snippet if "If statement" b
+if ${1:condition}${1/(.+)/ /}{
+ ${0:${VISUAL}}
+}
+endsnippet
+
+snippet switch "Switch statement" b
+switch ${1:expression}${1/(.+)/ /}{
+case${0}
+}
+endsnippet
+
+# functions
+snippet /^main/ "Main function" r
+func main() {
+ ${0:${VISUAL}}
+}
+endsnippet
+
+snippet /^meth/ "Method" r
+func (${1:receiver} ${2:type}) ${3:name}(${4:params})${5/(.+)/ /}${5:type} {
+ ${0:${VISUAL}}
+}
+endsnippet
+
+snippet func "Function" b
+func ${1:name}(${2:params})${3/(.+)/ /}${3:type} {
+ ${0:${VISUAL}}
+}
+endsnippet
+
+snippet funch "HTTP handler" b
+func ${1:handler}(${2:w} http.ResponseWriter, ${3:r} *http.Request) {
+ ${0:${VISUAL}}
+}
+endsnippet
+
+# types and variables
+snippet map "Map type" b
+map[${1:keytype}]${2:valtype}
+endsnippet
+
+snippet : "Variable declaration :=" b
+${1:name} := ${0:value}
+endsnippet
+
+snippet var "Variable declaration" b
+var ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value}}
+endsnippet
+
+snippet vars "Variables declaration" b
+var (
+ ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value} }
+)
+endsnippet
+
+snippet json "JSON field"
+\`json:"${1:displayName}"\`
+endsnippet
+
+# vim:ft=snippets:
+
+# error handling
+snippet err "Basic error handling" b
+if err != nil {
+ log.${1:Fatal}(err)
+}
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/help.snippets b/vim/bundle/vim-snippets/UltiSnips/help.snippets
new file mode 100644
index 0000000..b07a7de
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/help.snippets
@@ -0,0 +1,37 @@
+# Snippets for VIM Help Files
+
+priority -50
+
+global !p
+def sec_title(snip, t):
+ file_start = snip.fn.split('.')[0]
+ sec_name = t[1].strip("1234567890. ").lower().replace(' ', '-')
+ return ("*%s-%s*" % (file_start, sec_name)).rjust(78-len(t[1]))
+endglobal
+
+snippet sec "Section marker" b
+==============================================================================
+${1:SECTION}`!p snip.rv = sec_title(snip, t)`
+
+$0
+endsnippet
+
+snippet ssec "Sub section marker" b
+${1:Subsection}`!p snip.rv = sec_title(snip, t)
+snip += "-"*len(t[1])`
+
+$0
+endsnippet
+
+snippet sssec "Subsub Section marker" b
+${1:SubSubsection}:`!p snip.rv = sec_title(snip, t)`
+
+$0
+endsnippet
+
+# For vim help, follow the same settings as the official docs.
+snippet modeline "Vim help modeline"
+ `!v 'vim'`:tw=78:ts=8:ft=help:norl:
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/html.snippets b/vim/bundle/vim-snippets/UltiSnips/html.snippets
new file mode 100644
index 0000000..fd1aca5
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/html.snippets
@@ -0,0 +1,306 @@
+priority -50
+
+###########################################################################
+# TextMate Snippets #
+###########################################################################
+
+global !p
+def x(snip):
+ if snip.ft.startswith("x"):
+ snip.rv = '/'
+ else:
+ snip.rv = ""
+endglobal
+
+############
+# Doctypes #
+############
+snippet doctype "DocType XHTML 1.0 Strict" b
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+endsnippet
+
+snippet doctype "DocType XHTML 1.0 Transitional" b
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+endsnippet
+
+snippet doctype "DocType XHTML 1.1" b
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+endsnippet
+
+snippet doctype "HTML - 4.0 Transitional (doctype)" b
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+endsnippet
+
+snippet doctype "HTML - 5.0 (doctype)" b
+<!DOCTYPE html>
+
+endsnippet
+
+#############
+# Shortcuts #
+#############
+snippet down "Down (down)"
+&#x2193;
+endsnippet
+
+snippet enter "Enter (enter)"
+&#x2305;
+endsnippet
+
+snippet escape "Escape (escape)"
+&#x238B;
+endsnippet
+
+snippet shift "Shift (shift)"
+&#x21E7;
+endsnippet
+
+snippet tab "Tab (tab)"
+&#x21E5;
+endsnippet
+
+snippet up "Up (up)"
+&#x2191;
+endsnippet
+
+snippet return "Return (return)"
+&#x21A9;
+endsnippet
+
+snippet right "Right (right)"
+&#x2192;
+endsnippet
+
+snippet left "Left (left)"
+&#x2190;
+endsnippet
+
+snippet option "Option (option)"
+&#x2325;
+endsnippet
+
+#######################
+# Conditional inserts #
+#######################
+snippet ! "IE Conditional Comment: Internet Explorer 5_0 only"
+<!--[if IE 5.0]>${1:IE Conditional Comment: Internet Explorer 5.0 only }<![endif]-->$0
+endsnippet
+
+snippet ! "IE Conditional Comment: Internet Explorer 5_5 only"
+<!--[if IE 5.5000]>${1:IE Conditional Comment: Internet Explorer 5.5 only }<![endif]-->$0
+endsnippet
+
+snippet ! "IE Conditional Comment: Internet Explorer 5_x"
+<!--[if lt IE 6]>${1:IE Conditional Comment: Internet Explorer 5.x }<![endif]-->$0
+endsnippet
+
+snippet ! "IE Conditional Comment: Internet Explorer 6 and below"
+<!--[if lte IE 6]>${1:IE Conditional Comment: Internet Explorer 6 and below }<![endif]-->$0
+endsnippet
+
+snippet ! "IE Conditional Comment: Internet Explorer 6 only"
+<!--[if IE 6]>${1:IE Conditional Comment: Internet Explorer 6 only }<![endif]-->$0
+endsnippet
+
+snippet ! "IE Conditional Comment: Internet Explorer 7+"
+<!--[if gte IE 7]>${1:IE Conditional Comment: Internet Explorer 7 and above }<![endif]-->$0
+endsnippet
+
+snippet ! "IE Conditional Comment: Internet Explorer"
+<!--[if IE]>${1: IE Conditional Comment: Internet Explorer }<![endif]-->$0
+endsnippet
+
+snippet ! "IE Conditional Comment: NOT Internet Explorer"
+<!--[if !IE]><!-->${1: IE Conditional Comment: NOT Internet Explorer }<!-- <![endif]-->$0
+endsnippet
+
+#############
+# HTML TAGS #
+#############
+snippet input "Input with Label" w
+<label for="${2:${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}}">$1</label><input type="${3:text/submit/hidden/button}" name="${4:$2}" value="$5"${6: id="${7:$2}"}`!p x(snip)`>
+
+endsnippet
+
+snippet input "XHTML <input>" w
+<input type="${1:text/submit/hidden/button}" name="${2:some_name}" value="$3"${4: id="${5:$2}"}`!p x(snip)`>
+endsnippet
+
+
+snippet opt "Option" w
+<option${1: value="${2:option}"}>${3:$2}</option>
+endsnippet
+
+snippet select "Select Box" w
+<select name="${1:some_name}" id="${2:$1}"${3:${4: multiple}${5: onchange="${6:}"}${7: size="${8:1}"}}>
+ <option${9: value="${10:option1}"}>${11:$10}</option>
+ <option${12: value="${13:option2}"}>${14:$13}</option>${15:}
+ $0
+</select>
+endsnippet
+
+
+snippet textarea "XHTML <textarea>" w
+<textarea name="${1:Name}" rows="${2:8}" cols="${3:40}">$0</textarea>
+endsnippet
+
+snippet mailto "XHTML <a mailto: >" w
+<a href="mailto:${1:joe@example.com}?subject=${2:feedback}">${3:email me}</a>
+endsnippet
+
+snippet base "XHTML <base>" w
+<base href="$1"${2: target="$3"}`!p x(snip)`>
+endsnippet
+
+snippet body "<body>"
+<body>
+ $0
+</body>
+endsnippet
+
+snippet div "<div>" w
+<div>
+ $0
+</div>
+endsnippet
+
+snippet div. "<div> with class" w
+<div`!p snip.rv=' class="' if t[1] else ""`${1:name}`!p snip.rv = '"' if t[1] else ""`>
+ $0
+</div>
+endsnippet
+
+snippet div# "<div> with ID & class" w
+<div`!p snip.rv=' id="' if t[1] else ""`${1:name}`!p snip.rv = '"' if t[1] else ""``!p snip.rv=' class="' if t[2] else ""`${2:name}`!p snip.rv = '"' if t[2] else ""`>
+ $0
+</div>
+endsnippet
+
+snippet form "XHTML <form>" w
+<form action="${1:`!p
+snip.rv = (snip.basename or 'unnamed') + '_submit'
+`}" method="${2:get}" accept-charset="utf-8">
+ $0
+
+ <p><input type="submit" value="Continue →"`!p x(snip)`></p>
+</form>
+endsnippet
+
+snippet h1 "XHTML <h1>" w
+<h1>$0</h1>
+endsnippet
+
+snippet h2 "XHTML <h2>" w
+<h2>$0</h2>
+endsnippet
+
+snippet h3 "XHTML <h3>" w
+<h3>$0</h3>
+endsnippet
+
+snippet h4 "XHTML <h4>" w
+<h4>$0</h4>
+endsnippet
+
+snippet head "XHTML <head>"
+<head>
+ <meta charset="utf-8">
+ <title>${1:`!p snip.rv = snip.basename or "Page Title"`}</title>
+ $0
+</head>
+endsnippet
+
+snippet link "XHTML <link>" w
+<link rel="${1:stylesheet}" href="${2:/css/master.css}" type="text/css" media="${3:screen}" title="${4:no title}" charset="${5:utf-8}"`!p x(snip)`>
+endsnippet
+
+snippet meta "XHTML <meta>" w
+<meta name="${1:name}" content="${2:content}"`!p x(snip)`>
+endsnippet
+
+snippet scriptsrc "XHTML <script src...>" w
+<script src="$1" type="text/javascript" charset="${3:utf-8}"></script>
+endsnippet
+
+snippet script "XHTML <script>" w
+<script type="text/javascript" charset="utf-8">
+ $0
+</script>
+endsnippet
+
+snippet style "XHTML <style>" w
+<style type="text/css" media="screen">
+ $0
+</style>
+endsnippet
+
+snippet table "XHTML <table>" w
+<table border="${1:0}"${2: cellspacing="${3:5}" cellpadding="${4:5}"}>
+ <tr><th>${5:Header}</th></tr>
+ <tr><td>${0:Data}</td></tr>
+</table>
+endsnippet
+
+snippet a "Link" w
+<a href="${1:http://www.${2:url.com}}"${3: target="_blank"}>${4:Anchor Text}</a>
+endsnippet
+
+snippet p "paragraph" w
+<p>$0</p>
+endsnippet
+
+snippet li "list item" w
+<li>$0</li>
+endsnippet
+
+snippet ul "unordered list" w
+<ul>
+$0
+</ul>
+endsnippet
+
+snippet td "table cell" w
+<td>$0</td>
+endsnippet
+
+snippet th "table header" w
+<th>$0</th>
+endsnippet
+
+snippet tr "table row" w
+<tr>$0</tr>
+endsnippet
+
+snippet title "XHTML <title>" w
+<title>${1:`!p snip.rv = snip.basename or "Page Title"`}</title>
+endsnippet
+
+snippet fieldset "Fieldset" w
+<fieldset id="${1/[\w\d]+|( )/(?1:_:\L$0\E)/g}" ${2:class="${3:}"}>
+ <legend>$1</legend>
+ $0
+</fieldset>
+endsnippet
+
+snippet movie "Embed QT movie (movie)" b
+<object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
+ <param name="src" value="$1"`!p x(snip)`>
+ <param name="controller" value="$4"`!p x(snip)`>
+ <param name="autoplay" value="$5"`!p x(snip)`>
+ <embed src="${1:movie.mov}"
+ width="${2:320}" height="${3:240}"
+ controller="${4:true}" autoplay="${5:true}"
+ scale="tofit" cache="true"
+ pluginspage="http://www.apple.com/quicktime/download/"
+ `!p x(snip)`>
+</object>
+endsnippet
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/html_minimal.snippets b/vim/bundle/vim-snippets/UltiSnips/html_minimal.snippets
new file mode 100644
index 0000000..e7ca5e0
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/html_minimal.snippets
@@ -0,0 +1,33 @@
+# more can be found in snippets/html_minimal.snippets
+# these UltiSnips override snippets because nested placeholders are being used
+
+priority -50
+
+snippet id
+id="${1}"${2}
+endsnippet
+
+snippet idn
+id="${1}" name="${2:$1}"
+endsnippet
+
+snippet label_and_input
+<label for="${2:$1}">${1}</label>
+<input type="${3:text}" name="${4:$2}"${5: id="${6:$2}"} value="${7}" />${8}
+endsnippet
+
+snippet input
+<input type="${1:text}" value="${2}" name="${3}"${4: id="${5:$3}"}/>${7}
+endsnippet
+
+snippet submit
+<input type="submit" value="${2}" ${3}/>${7}
+endsnippet
+
+snippet textarea
+<textarea name="$2"${3: id="$4"}>$5</textarea>
+endsnippet
+
+snippet img
+<img src="$1"${2: alt="$3"}/>
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/htmldjango.snippets b/vim/bundle/vim-snippets/UltiSnips/htmldjango.snippets
new file mode 100644
index 0000000..37fa85f
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/htmldjango.snippets
@@ -0,0 +1,299 @@
+priority -50
+
+extends html
+
+# Generic Tags
+snippet % "" bi
+{% ${1} %}${2}
+endsnippet
+
+snippet %% "" bi
+{% ${1:tag_name} %}
+ ${2}
+{% end$1 %}
+endsnippet
+
+snippet { "" bi
+{{ ${1} }}${2}
+endsnippet
+
+# Template Tags
+
+snippet autoescape "" bi
+{% autoescape ${1:off} %}
+ ${2}
+{% endautoescape %}
+endsnippet
+
+snippet block "" bi
+{% block ${1} %}
+ ${2}
+{% endblock $1 %}
+endsnippet
+
+snippet # "" bi
+{# ${1:comment} #}
+endsnippet
+
+snippet comment "" bi
+{% comment %}
+ ${1}
+{% endcomment %}
+endsnippet
+
+snippet cycle "" bi
+{% cycle ${1:val1} ${2:val2} ${3:as ${4}} %}
+endsnippet
+
+snippet debug "" bi
+{% debug %}
+endsnippet
+
+snippet extends "" bi
+{% extends "${1:base.html}" %}
+endsnippet
+
+snippet filter "" bi
+{% filter ${1} %}
+ ${2}
+{% endfilter %}
+endsnippet
+
+snippet firstof "" bi
+{% firstof ${1} %}
+endsnippet
+
+snippet for "" bi
+{% for ${1} in ${2} %}
+ ${3}
+{% endfor %}
+endsnippet
+
+snippet empty "" bi
+{% empty %}
+ ${1}
+endsnippet
+
+snippet if "" bi
+{% if ${1} %}
+ ${2}
+{% endif %}
+endsnippet
+
+snippet iif "" bi
+{% if ${1} %}${2}{% endif %}
+endsnippet
+
+snippet ielse "" bi
+{% else %}${1}
+endsnippet
+
+snippet else "" bi
+{% else %}
+ ${1}
+endsnippet
+
+snippet ielif "" bi
+{% elif %}${1}
+endsnippet
+
+snippet elif "" bi
+{% elif %}
+ ${1}
+endsnippet
+
+snippet ifchanged "" bi
+{% ifchanged %}${1}{% endifchanged %}
+endsnippet
+
+snippet ifequal "" bi
+{% ifequal ${1} ${2} %}
+ ${3}
+{% endifequal %}
+endsnippet
+
+snippet ifnotequal "" bi
+{% ifnotequal ${1} ${2} %}
+ ${3}
+{% endifnotequal %}
+endsnippet
+
+snippet include "" bi
+{% include "${1}" %}
+endsnippet
+
+snippet load "" bi
+{% load ${1} %}
+endsnippet
+
+snippet now "" bi
+{% now "${1:jS F Y H:i}" %}
+endsnippet
+
+snippet regroup "" bi
+{% regroup ${1} by ${2} as ${3} %}
+endsnippet
+
+snippet spaceless "" bi
+{% spaceless %}${1}{% endspaceless %}
+endsnippet
+
+snippet ssi "" bi
+{% ssi ${1} %}
+endsnippet
+
+snippet trans "" bi
+{% trans "${1:string}" %}
+endsnippet
+
+snippet url "" bi
+{% url ${1} as ${2} %}
+endsnippet
+
+snippet widthratio "" bi
+{% widthratio ${1:this_value} ${2:max_value} ${3:100} %}
+endsnippet
+
+snippet with "" bi
+{% with ${1} as ${2} %}
+ ${VISUAL}
+{% endwith %}
+endsnippet
+
+snippet verbatim "" bi
+{% verbatim %}
+ ${VISUAL}
+{% endverbatim %}
+endsnippet
+
+snippet super "" bi
+{{ block.super }}
+endsnippet
+
+snippet staticu "" bi
+{{ STATIC_URL }}
+endsnippet
+
+snippet static "" bi
+{% static "${VISUAL}" %}
+endsnippet
+
+snippet mediau "" bi
+{{ MEDIA_URL }}
+endsnippet
+
+snippet iblock "" bi
+{% block ${1:blockname} %}${VISUAL}{% endblock $1 %}
+endsnippet
+
+snippet csrf "" bi
+{% csrf_token %}
+endsnippet
+
+snippet blocktrans "" bi
+{% blocktrans %}
+ ${VISUAL}
+{% endblocktrans %}
+endsnippet
+
+snippet lorem "" bi
+{% lorem ${1} %}
+endsnippet
+
+# Template Filters
+
+# Note: Since SnipMate can't determine which template filter you are
+# expanding without the "|" character, these do not add the "|"
+# character. These save a few keystrokes still.
+
+# Note: Template tags that take no arguments are not implemented.
+
+snippet add "" bi
+add:"${1}"
+endsnippet
+
+snippet center "" bi
+center:"${1}"
+endsnippet
+
+snippet cut "" bi
+cut:"${1}"
+endsnippet
+
+snippet date "" bi
+date:"${1}"
+endsnippet
+
+snippet default "" bi
+default:"${1}"
+endsnippet
+
+snippet defaultifnone "" bi
+default_if_none:"${1}"
+endsnippet
+
+snippet dictsort "" bi
+dictsort:"${1}"
+endsnippet
+
+snippet dictsortrev "" bi
+dictsortreversed:"${1}"
+endsnippet
+
+snippet divisibleby "" bi
+divisibleby:"${1}"
+endsnippet
+
+snippet floatformat "" bi
+floatformat:"${1}"
+endsnippet
+
+snippet getdigit "" bi
+get_digit:"${1}"
+endsnippet
+
+snippet join "" bi
+join:"${1}"
+endsnippet
+
+snippet lengthis "" bi
+length_is:"${1}"
+endsnippet
+
+snippet pluralize "" bi
+pluralize:"${1}"
+endsnippet
+
+snippet removetags "" bi
+removetags:"${1}"
+endsnippet
+
+snippet slice "" bi
+slice:"${1}"
+endsnippet
+
+snippet stringformat "" bi
+stringformat:"${1}"
+endsnippet
+
+snippet time "" bi
+time:"${1}"
+endsnippet
+
+snippet truncatewords "" bi
+truncatewords:${1}
+endsnippet
+
+snippet truncatewordshtml "" bi
+truncatewords_html:${1}
+endsnippet
+
+snippet urlizetrunc "" bi
+urlizetrunc:${1}
+endsnippet
+
+snippet wordwrap "" bi
+wordwrap:${1}
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/htmljinja.snippets b/vim/bundle/vim-snippets/UltiSnips/htmljinja.snippets
new file mode 100644
index 0000000..fa3b3c2
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/htmljinja.snippets
@@ -0,0 +1,3 @@
+priority -50
+
+extends html, jinja2
diff --git a/vim/bundle/vim-snippets/UltiSnips/java.snippets b/vim/bundle/vim-snippets/UltiSnips/java.snippets
new file mode 100644
index 0000000..54d026d
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/java.snippets
@@ -0,0 +1,435 @@
+priority -50
+
+# Many of the snippets here use a global option called
+# "g:ultisnips_java_brace_style" which, if set to "nl" will put a newline
+# before '{' braces.
+# Setting "g:ultisnips_java_junit" will change how the test method snippet
+# looks, it is defaulted to junit4, setting this option to 3 will remove the
+# @Test annotation from the method
+
+global !p
+def junit(snip):
+ if snip.opt("g:ultisnips_java_junit", "") == "3":
+ snip += ""
+ else:
+ snip.rv += "@Test\n\t"
+
+def nl(snip):
+ if snip.opt("g:ultisnips_java_brace_style", "") == "nl":
+ snip += ""
+ else:
+ snip.rv += " "
+def getArgs(group):
+ import re
+ word = re.compile('[a-zA-Z0-9><.]+ \w+')
+ return [i.split(" ") for i in word.findall(group) ]
+
+def camel(word):
+ if not word: return ''
+ return word[0].upper() + word[1:]
+
+def mixedCase(word):
+ if not word: return ''
+ return word[0].lower() + word[1:]
+
+endglobal
+
+snippet sleep "try sleep catch" b
+try {
+ Thread.sleep(${1:1000});
+} catch (InterruptedException e){
+ e.printStackTrace();
+}
+endsnippet
+
+snippet /i|n/ "new primitive or int" br
+${1:int} ${2:i} = ${3:1};
+$0
+endsnippet
+
+snippet /o|v/ "new Object or variable" br
+${1:Object} ${2:var} = new $1(${3});
+endsnippet
+
+snippet f "field" b
+${1:private} ${2:String} ${3:`!p snip.rv = t[2].lower()`};
+endsnippet
+
+snippet ab "abstract" b
+abstract $0
+endsnippet
+
+snippet as "assert" b
+assert ${1:test}${2/(.+)/(?1: \: ")/}${2:Failure message}${2/(.+)/(?1:")/};
+endsnippet
+
+snippet at "assert true" b
+assertTrue(${1:actual});
+endsnippet
+
+snippet af "assert false" b
+assertFalse(${1:actual});
+endsnippet
+
+snippet ae "assert equals" b
+assertEquals(${1:expected}, ${2:actual});
+endsnippet
+
+snippet br "break"
+break;
+
+endsnippet
+
+snippet cs "case" b
+case $1:
+ $2
+$0
+endsnippet
+
+snippet ca "catch" b
+catch (${1:Exception} ${2:e})`!p nl(snip)`{
+ $0
+}
+endsnippet
+
+snippet cle "class extends" b
+public class ${1:`!p
+snip.rv = snip.basename or "untitled"`} ${2:extends ${3:Parent} }${4:implements ${5:Interface} }{
+ $0
+}
+endsnippet
+
+snippet clc "class with constructor, fields, setter and getters" b
+public class `!p
+snip.rv = snip.basename or "untitled"` {
+`!p
+args = getArgs(t[1])
+if len(args) == 0: snip.rv = ""
+for i in args:
+ snip.rv += "\n\tprivate " + i[0] + " " + i[1]+ ";"
+if len(args) > 0:
+ snip.rv += "\n"`
+ public `!p snip.rv = snip.basename or "unknown"`($1) {`!p
+args = getArgs(t[1])
+for i in args:
+ snip.rv += "\n\t\tthis." + i[1] + " = " + i[1] + ";"
+if len(args) == 0:
+ snip.rv += "\n"`
+ }$0
+`!p
+args = getArgs(t[1])
+if len(args) == 0: snip.rv = ""
+for i in args:
+ snip.rv += "\n\tpublic void set" + camel(i[1]) + "(" + i[0] + " " + i[1] + ") {\n" + "\
+ \tthis." + i[1] + " = " + i[1] + ";\n\t}\n"
+
+ snip.rv += "\n\tpublic " + i[0] + " get" + camel(i[1]) + "() {\n\
+ \treturn " + i[1] + ";\n\t}\n"
+`
+}
+endsnippet
+
+snippet clc "class with constructor, with field names" b
+public class `!p
+snip.rv = snip.basename or "untitled"` {
+`!p
+args = getArgs(t[1])
+for i in args:
+ snip.rv += "\n\tprivate " + i[0] + " " + i[1]+ ";"
+if len(args) > 0:
+ snip.rv += "\n"`
+ public `!p snip.rv = snip.basename or "unknown"`($1) {`!p
+args = getArgs(t[1])
+for i in args:
+ snip.rv += "\n\t\tthis.%s = %s;" % (i[1], i[1])
+if len(args) == 0:
+ snip.rv += "\n"`
+ }
+}
+endsnippet
+
+snippet clc "class and constructor" b
+public class `!p
+snip.rv = snip.basename or "untitled"` {
+
+ public `!p snip.rv = snip.basename or "untitled"`($2) {
+ $0
+ }
+}
+endsnippet
+
+snippet cl "class" b
+public class ${1:`!p
+snip.rv = snip.basename or "untitled"`} {
+ $0
+}
+endsnippet
+
+snippet cos "constant string" b
+public static final String ${1:var} = "$2";$0
+endsnippet
+
+snippet co "constant" b
+public static final ${1:String} ${2:var} = $3;$0
+endsnippet
+
+snippet de "default" b
+default:
+ $0
+endsnippet
+
+snippet elif "else if"
+else if ($1)`!p nl(snip)`{
+ $0${VISUAL}
+}
+endsnippet
+
+snippet el "else" w
+else`!p nl(snip)`{
+ $0${VISUAL}
+}
+endsnippet
+
+snippet fi "final" b
+final $0
+endsnippet
+
+snippet fore "for (each)" b
+for ($1 : $2)`!p nl(snip)`{
+ $0
+}
+endsnippet
+
+snippet fori "for" b
+for (int ${1:i} = 0; $1 < ${2:10}; $1++)`!p nl(snip)`{
+ $0
+}
+endsnippet
+
+snippet for "for" b
+for ($1; $2; $3)`!p nl(snip)`{
+ $0
+}
+endsnippet
+
+snippet if "if" b
+if ($1)`!p nl(snip)`{
+ $0${VISUAL}
+}
+endsnippet
+
+snippet imt "import junit_framework_TestCase;" b
+import junit.framework.TestCase;
+$0
+endsnippet
+
+snippet im "import" b
+import ${1:java}.${2:util}.$0;
+endsnippet
+
+snippet in "interface" b
+interface ${1:`!p snip.rv = snip.basename or "untitled"`} ${2:extends ${3:Parent} }{
+ $0
+}
+endsnippet
+
+snippet cc "constructor call or setter body"
+this.${1:var} = $1;
+endsnippet
+
+snippet list "Collections List" b
+List<${1:String}> ${2:list} = new ${3:Array}List<$1>();
+endsnippet
+
+snippet map "Collections Map" b
+Map<${1:String}, ${2:String}> ${3:map} = new ${4:Hash}Map<$1, $2>();
+endsnippet
+
+snippet set "Collections Set" b
+Set<${1:String}> ${2:set} = new ${3:Hash}Set<$1>();
+endsnippet
+
+snippet /Str?|str/ "String" br
+String $0
+endsnippet
+
+snippet cn "Constructor" b
+public `!p snip.rv = snip.basename or "untitled"`(${1:}) {
+ $0
+}
+endsnippet
+
+snippet cn "constructor, \w fields + assigments" b
+ `!p
+args = getArgs(t[1])
+for i in args:
+ snip.rv += "\n\tprivate " + i[0] + " " + i[1]+ ";"
+if len(args) > 0:
+ snip.rv += "\n"`
+public `!p snip.rv = snip.basename or "unknown"`($1) {`!p
+args = getArgs(t[1])
+for i in args:
+ snip.rv += "\n\t\tthis.%s = %s;" % (i[1], i[1])
+if len(args) == 0:
+ snip.rv += "\n"`
+}
+endsnippet
+
+snippet j.b "java_beans_" i
+java.beans.
+endsnippet
+
+snippet j.i "java_io" i
+java.io.
+endsnippet
+
+snippet j.m "java_math" i
+java.math.
+endsnippet
+
+snippet j.n "java_net_" i
+java.net.
+endsnippet
+
+snippet j.u "java_util_" i
+java.util.
+endsnippet
+
+snippet main "method (main)" b
+public static void main(String[] args)`!p nl(snip)`{
+ $0
+}
+endsnippet
+
+snippet try "try/catch" b
+try {
+ $1${VISUAL}
+} catch(${2:Exception} ${3:e}){
+ ${4:e.printStackTrace();}
+}
+endsnippet
+
+snippet mt "method throws" b
+${1:private} ${2:void} ${3:method}(${4}) ${5:throws $6 }{
+ $0
+}
+endsnippet
+
+snippet m "method" b
+${1:private} ${2:void} ${3:method}(${4}) {
+ $0
+}
+endsnippet
+
+snippet md "Method With javadoc" b
+/**
+ * ${7:Short Description}`!p
+for i in getArgs(t[4]):
+ snip.rv += "\n\t * @param " + i[1] + " usage..."`
+ *`!p
+if "throws" in t[5]:
+ snip.rv = "\n\t * @throws " + t[6]
+else:
+ snip.rv = ""``!p
+if not "void" in t[2]:
+ snip.rv = "\n\t * @return object"
+else:
+ snip.rv = ""`
+ **/
+${1:public} ${2:void} ${3:method}($4) ${5:throws $6 }{
+ $0
+}
+endsnippet
+
+snippet /get(ter)?/ "getter" br
+public ${1:String} get${2:Name}() {
+ return `!p snip.rv = mixedCase(t[2])`;
+}
+endsnippet
+
+snippet /set(ter)?/ "setter" br
+public void set${1:Name}(${2:String} `!p snip.rv = mixedCase(t[1])`) {
+ this.`!p snip.rv = mixedCase(t[1])` = `!p snip.rv = mixedCase(t[1])`;
+}
+endsnippet
+
+snippet /se?tge?t|ge?tse?t|gs/ "setter and getter" br
+public void set${1:Name}(${2:String} `!p snip.rv = mixedCase(t[1])`) {
+ this.`!p snip.rv = mixedCase(t[1])` = `!p snip.rv = mixedCase(t[1])`;
+}`!p snip.rv += "\n"`
+public $2 get$1() {
+ return `!p snip.rv = mixedCase(t[1])`;
+}
+endsnippet
+
+snippet pa "package" b
+package $0
+endsnippet
+
+snippet p "print" b
+System.out.print($1);$0
+endsnippet
+
+snippet pl "println" b
+System.out.println($1);$0
+endsnippet
+
+snippet pr "private" b
+private $0
+endsnippet
+
+snippet po "protected" b
+protected $0
+endsnippet
+
+snippet pu "public" b
+public $0
+endsnippet
+
+snippet re "return" b
+return $0
+endsnippet
+
+snippet st "static"
+static $0
+endsnippet
+
+snippet sw "switch" b
+switch ($1)`!p nl(snip)`{
+ case $2: $0
+}
+endsnippet
+
+snippet sy "synchronized"
+synchronized $0
+endsnippet
+
+snippet tc "test case"
+public class ${1:`!p snip.rv = snip.basename or "untitled"`} extends ${2:TestCase}`!p nl(snip)`{
+ $0
+}
+endsnippet
+
+snippet t "test" b
+`!p junit(snip)`public void test${1:Name}() {
+ $0
+}
+endsnippet
+
+snippet tt "test throws" b
+`!p junit(snip)`public void test${1:Name}() ${2:throws Exception }{
+ $0
+}
+endsnippet
+
+snippet th "throw" b
+throw new $0
+endsnippet
+
+snippet wh "while" b
+while ($1)`!p nl(snip)`{
+ $0
+}
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/javascript-angular.snippets b/vim/bundle/vim-snippets/UltiSnips/javascript-angular.snippets
new file mode 100644
index 0000000..91b5931
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/javascript-angular.snippets
@@ -0,0 +1,77 @@
+priority -50
+
+snippet iti "it (js, inject)" b
+it('${1:description}', inject(function($2) {
+ $0
+}));
+endsnippet
+
+snippet befi "before each (js, inject)" b
+beforeEach(inject(function($1) {
+ $0
+}));
+endsnippet
+
+snippet aconf "angular config" i
+config(function($1) {
+ $0
+});
+endsnippet
+
+snippet acont "angular controller" i
+controller('${1:name}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
+ $0
+}]);
+endsnippet
+
+snippet aconts "angular controller with scope" i
+controller('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
+ $0
+}]);
+endsnippet
+
+snippet adir "angular directive" i
+directive('${1}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
+ return {
+ restrict: '${3:EA}',
+ link: function(scope, element, attrs) {
+ ${0}
+ }
+ };
+}]);
+endsnippet
+
+snippet adirs "angular directive with scope" i
+directive('${1}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
+ return {
+ restrict: '${3:EA}',
+ link: function(scope, element, attrs) {
+ ${0}
+ }
+ };
+}]);
+endsnippet
+
+snippet afact "angular factory" i
+factory('${1:name}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
+ $0
+}]);
+endsnippet
+
+snippet afacts "angular factory with scope" i
+factory('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
+ $0
+}]);
+endsnippet
+
+snippet aserv "angular service" i
+service('${1:name}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
+ $0
+}]);
+endsnippet
+
+snippet aservs "angular service" i
+service('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) {
+ $0
+}]);
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/javascript-ember.snippets b/vim/bundle/vim-snippets/UltiSnips/javascript-ember.snippets
new file mode 100644
index 0000000..1b7e7b8
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/javascript-ember.snippets
@@ -0,0 +1,90 @@
+###################################################################
+# Ember snippets #
+###################################################################
+
+priority -50
+
+# Application
+snippet eapp "App.Name = Ember.Application.create({});"
+${1:App.Name} = Ember.Application.create({});
+endsnippet
+
+# Models
+snippet emod "App.ModelName = Ember.Model.extend({...});"
+${1:model_name} = Ember.Model.extend({
+ ${0://Properties here...}
+});
+endsnippet
+
+# View
+snippet eview "App.ViewName = Ember.Model.extend({...});"
+${1:view_name} = Ember.View.extend({
+ ${0://Properties here...}
+});
+endsnippet
+
+# Controller
+snippet econtroller "App.ControllerName = Ember.Model.extend({...});"
+${1:controller_name} = Ember.ObjectController.extend({
+ ${0://Properties here...}
+});
+endsnippet
+
+# Route
+snippet eroute "App.RouteName = Ember.Route.extend({...});"
+${1:route_name} = Ember.Route.extend({
+ ${0://Properties here...}
+});
+endsnippet
+
+snippet eview "App.ViewName = Ember.Model.create({...});"
+${1:view_name} = Ember.View.create({
+ ${0://Properties here...}
+});
+endsnippet
+
+# Object
+snippet eobj "App.ObjectName = Ember.Object.extend({...});"
+${1:object_name} = Ember.Object.create({
+ ${0://Properties here...}
+});
+endsnippet
+
+# Mixin
+snippet emix "App.MixinName = Ember.Model.extend({...});"
+${1:view_name} = Ember.Mixin.create({
+ ${0://Properties here...}
+});
+endsnippet
+
+# Ember getter and setter
+snippet eget "this.get('property');"
+${1:this}.get('${2:property}');
+endsnippet
+
+snippet eset "this.set('property', value);"
+${1:this}.set('${2:property}', ${3:value});
+endsnippet
+
+# Computer properties
+snippet cpro "property_name: function() {...}.property(),"
+${1:property_name}: function() {
+ ${0://body...}
+}.property('${3:argumenet}'),
+endsnippet
+
+snippet cpro ": function() {...}.property('property'),"
+${1:property_name}: function() {
+ ${0://body...}
+}.property(),
+endsnippet
+
+
+# Observes
+snippet proo "property_name: function() {...}.property()"
+${1:property_name}: function() {
+ ${0://body...}
+}.observes('${3:property}'),
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/javascript-jasmine.snippets b/vim/bundle/vim-snippets/UltiSnips/javascript-jasmine.snippets
new file mode 100644
index 0000000..77aec77
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/javascript-jasmine.snippets
@@ -0,0 +1,218 @@
+priority -50
+
+# JavaScript versions -- from the TextMate bundle + some additions
+# for jasmine-jquery matchers
+#
+
+snippet des "Describe (js)" b
+describe('${1:description}', function() {
+ $0
+});
+endsnippet
+
+snippet it "it (js)" b
+it('${1:description}', function() {
+ $0
+});
+endsnippet
+
+snippet bef "before each (js)" b
+beforeEach(function() {
+ $0
+});
+endsnippet
+
+snippet aft "after each (js)" b
+afterEach(function() {
+ $0
+});
+endsnippet
+
+snippet befa "before all (js)" b
+beforeAll(function() {
+ $0
+});
+endsnippet
+
+snippet afta "after all (js)" b
+afterAll(function() {
+ $0
+});
+endsnippet
+
+snippet any "any (js)" b
+jasmine.any($1)
+endsnippet
+
+snippet anyt "anything (js)" b
+jasmine.anything()
+endsnippet
+
+snippet objc "object containing (js)" b
+jasmine.objectContaining({
+ ${VISUAL}$0
+});
+endsnippet
+
+snippet arrc "array containing (js)" b
+jasmine.arrayContaining([${1:value1}]);
+endsnippet
+
+snippet strm "string matching (js)" b
+jasmine.stringMatching("${1:matcher}")
+endsnippet
+
+snippet ru "runs (js)" b
+runs(function() {
+ $0
+});
+endsnippet
+
+snippet wa "waits (js)" b
+waits($1);
+endsnippet
+
+snippet ex "expect (js)" b
+expect(${1:target})$0;
+endsnippet
+
+snippet ee "expect to equal (js)" b
+expect(${1:target}).toEqual(${2:value});
+endsnippet
+
+snippet el "expect to be less than (js)" b
+expect(${1:target}).toBeLessThan(${2:value});
+endsnippet
+
+snippet eg "expect to be greater than (js)" b
+expect(${1:target}).toBeGreaterThan(${2:value});
+endsnippet
+
+snippet eb "expect to be (js)" b
+expect(${1:target}).toBe(${2:value});
+endsnippet
+
+snippet em "expect to match (js)" b
+expect(${1:target}).toMatch(${2:pattern});
+endsnippet
+
+snippet eha "expect to have attribute (js)" b
+expect(${1:target}).toHaveAttr('${2:attr}'${3:, '${4:value}'});
+endsnippet
+
+snippet et "expect to be truthy (js)" b
+expect(${1:target}).toBeTruthy();
+endsnippet
+
+snippet ef "expect to be falsy (js)" b
+expect(${1:target}).toBeFalsy();
+endsnippet
+
+snippet ed "expect to be defined (js)" b
+expect(${1:target}).toBeDefined();
+endsnippet
+
+snippet eud "expect to be defined (js)" b
+expect(${1:target}).toBeUndefined();
+endsnippet
+
+snippet en "expect to be null (js)" b
+expect(${1:target}).toBeNull();
+endsnippet
+
+snippet ec "expect to contain (js)" b
+expect(${1:target}).toContain(${2:value});
+endsnippet
+
+snippet ev "expect to be visible (js)" b
+expect(${1:target}).toBeVisible();
+endsnippet
+
+snippet eh "expect to be hidden (js)" b
+expect(${1:target}).toBeHidden();
+endsnippet
+
+snippet notx "expect not (js)" b
+expect(${1:target}).not$0;
+endsnippet
+
+snippet note "expect not to equal (js)" b
+expect(${1:target}).not.toEqual(${2:value});
+endsnippet
+
+snippet notl "expect to not be less than (js)" b
+expect(${1:target}).not.toBeLessThan(${2:value});
+endsnippet
+
+snippet notg "expect to not be greater than (js)" b
+expect(${1:target})..not.toBeGreaterThan(${2:value});
+endsnippet
+
+snippet notm "expect not to match (js)" b
+expect(${1:target}).not.toMatch(${2:pattern});
+endsnippet
+
+snippet notha "expect to not have attribute (js)" b
+expect(${1:target}).not.toHaveAttr('${2:attr}'${3:, '${4:value}'});
+endsnippet
+
+snippet nott "expect not to be truthy (js)" b
+expect(${1:target}).not.toBeTruthy();
+endsnippet
+
+snippet notf "expect not to be falsy (js)" b
+expect(${1:target}).not.toBeFalsy();
+endsnippet
+
+snippet notd "expect not to be defined (js)" b
+expect(${1:target}).not.toBeDefined();
+endsnippet
+
+snippet notn "expect not to be null (js)" b
+expect(${1:target}).not.toBeNull();
+endsnippet
+
+snippet notc "expect not to contain (js)" b
+expect(${1:target}).not.toContain(${2:value});
+endsnippet
+
+snippet notv "expect not to be visible (js)" b
+expect(${1:target}).not.toBeVisible();
+endsnippet
+
+snippet noth "expect not to be hidden (js)" b
+expect(${1:target}).not.toBeHidden();
+endsnippet
+
+snippet s "spy on (js)" b
+spyOn(${1:object}, '${2:method}')$0;
+endsnippet
+
+snippet sr "spy on and return (js)" b
+spyOn(${1:object}, '${2:method}').and.returnValue(${3:arguments});
+endsnippet
+
+snippet st "spy on and throw (js)" b
+spyOn(${1:object}, '${2:method}').and.throwError(${3:exception});
+endsnippet
+
+snippet sct "spy on and call through (js)" b
+spyOn(${1:object}, '${2:method}').and.callThrough();
+endsnippet
+
+snippet scf "spy on and call fake (js)" b
+spyOn(${1:object}, '${2:method}').and.callFake(${3:function});
+endsnippet
+
+snippet ethbc "expect to have been called (js)" b
+expect(${1:target}).toHaveBeenCalled();
+endsnippet
+
+snippet nthbc "expect not to have been called (js)" b
+expect(${1:target}).not.toHaveBeenCalled();
+endsnippet
+
+snippet ethbcw "expect to have been called with (js)" b
+expect(${1:target}).toHaveBeenCalledWith(${2:arguments});
+endsnippet
+
diff --git a/vim/bundle/vim-snippets/UltiSnips/javascript-jsdoc.snippets b/vim/bundle/vim-snippets/UltiSnips/javascript-jsdoc.snippets
new file mode 100644
index 0000000..959f805
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/javascript-jsdoc.snippets
@@ -0,0 +1,51 @@
+priority -50
+
+# JSDoc snippets
+
+snippet /* "A JSDoc comment" b
+/**
+ * ${1:${VISUAL}}$0
+ */
+endsnippet
+
+snippet @au "@author email (First Last)"
+@author ${1:`!v g:snips_author`} [${2:`!v g:snips_author_email`}]
+endsnippet
+
+snippet @li "@license Description"
+@license ${1:MIT}$0
+endsnippet
+
+snippet @ver "@version Semantic version"
+@version ${1:0.1.0}$0
+endsnippet
+
+snippet @fileo "@fileoverview Description" b
+/**
+ * @fileoverview ${1:${VISUAL:A description of the file}}$0
+ */
+endsnippet
+
+snippet @constr "@constructor"
+@constructor
+endsnippet
+
+snippet @p "@param {Type} varname Description"
+@param {${1:Type}} ${2:varname} ${3:Description}
+endsnippet
+
+snippet @ret "@return {Type} Description"
+@return {${1:Type}} ${2:Description}
+endsnippet
+
+snippet @pri "@private"
+@private
+endsnippet
+
+snippet @over "@override"
+@override
+endsnippet
+
+snippet @pro "@protected"
+@protected
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/javascript-node.snippets b/vim/bundle/vim-snippets/UltiSnips/javascript-node.snippets
new file mode 100644
index 0000000..7a14dee
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/javascript-node.snippets
@@ -0,0 +1,65 @@
+priority -50
+
+snippet #! "shebang"
+#!/usr/bin/env node
+endsnippet
+
+snippet vreq "assign a CommonJS-style module to a var"
+var ${0:${1/(.+\/)*(\w+)(-|\b|$)(\..+$)?/\u$2/g}} = require('${1}');
+endsnippet
+
+snippet ex "module.exports"
+module.exports = ${1};
+endsnippet
+
+snippet hcs "http.createServer"
+http.createServer(${1}).listen(${2});
+endsnippet
+
+snippet ncs "net.createServer"
+net.createServer(function(${1:socket}){
+ ${1}.on('data', function(${3:data}){
+ ${4}
+ });
+ ${1}.on('end', function(){
+ ${5}
+ });
+}).listen(${6:8124});
+endsnippet
+
+snippet pipe "pipe"
+pipe(${1:stream})${2}
+endsnippet
+
+# Express snippets
+
+snippet eget "express GET"
+${1:app}.get('${2}', ${3});
+endsnippet
+
+snippet epost "express POST"
+${1:app}.post('${2}', ${3});
+endsnippet
+
+snippet eput "express PUT"
+${1:app}.put('${2}', ${3});
+endsnippet
+
+snippet edelete "express DELETE"
+${1:app}.delete('${2}', ${3});
+endsnippet
+
+# process snippets
+
+snippet stdout "stdout"
+process.stdout
+endsnippet
+
+snippet stdin "stdin"
+process.stdin
+endsnippet
+
+snippet stderr "stderr"
+process.stderr
+endsnippet
+
diff --git a/vim/bundle/vim-snippets/UltiSnips/javascript-openui5.snippets b/vim/bundle/vim-snippets/UltiSnips/javascript-openui5.snippets
new file mode 100644
index 0000000..5553c79
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/javascript-openui5.snippets
@@ -0,0 +1,205 @@
+snippet sapmlabel
+ var ${1} = new sap.m.Label({
+ design : ${2},
+ text : ${3},
+ visible : ${4},
+ textAlign : ${5},
+ textDirection : ${6},
+ width : ${7},
+ required : ${7}
+ });
+
+snippet sapmtext
+ var ${1} = new sap.m.Text({
+ text :${2},
+ textDirection :${3},
+ visible :${4},
+ wrapping : ${5},
+ textAlign : ${6},
+ width :${7},
+ maxLines :${8}
+ });
+
+snippet sapmbutton
+ var ${1} = new sap.m.Button({
+ text : ${2},
+ type : ${3},
+ width : ${4},
+ enabled :${5},
+ visible :${6},
+ icon : ${7},
+ iconFirst : ${8},
+ activeIcon :${9},
+ iconDensityAware : ${10},
+ });
+snippet sapmflexbox
+ var ${1} = new sap.m.FlexBox({
+ visible : ${2},
+ height : ${3},
+ width : ${4},
+ displayInline :${5},
+ direction :${6},
+ fitContainer : ${7},
+ renderType : ${8},
+ justifyContent :${9},
+ alignItems : ${10},
+ items:[]
+ });
+snippet sapmhbox
+ var ${1} = new sap.m.HBox({
+ visible : ${2},
+ height : ${3},
+ width : ${4},
+ displayInline :${5},
+ direction :${6},
+ fitContainer : ${7},
+ renderType : ${8},
+ justifyContent :${9},
+ alignItems : ${10},
+ items:[]
+ });
+
+snippet sapmvbox
+ var ${1} = new sap.m.VBox({
+ visible : ${2},
+ height : ${3},
+ width : ${4},
+ displayInline :${5},
+ direction :${6},
+ fitContainer : ${7},
+ renderType : ${8},
+ justifyContent :${9},
+ alignItems : ${10},
+ items:[]
+ });
+
+snippet sapcomponent
+ sap.ui.controller("${1}", {
+ onInit: function(){
+ },
+ onAfterRendering: function() {
+ },
+ onAfterRendering: function() {
+ },
+ onExit: function() {
+ },
+ });
+
+snippet sapminput
+ var ${1} = new sap.m.Input({
+ value :${2},
+ width : ${3},
+ enabled :${4},
+ visible :${5},
+ valueState :${6},
+ name : ${7},
+ placeholder : ${8},
+ editable : ${9},
+ type : ${10},
+ maxLength :${11},
+ valueStateText :${12},
+ showValueStateMessage :${13},
+ dateFormat :${14},
+ showValueHelp :${15},
+ showSuggestion :${16},
+ valueHelpOnly :${17},
+ filterSuggests :${18},
+ maxSuggestionWidth :${19},
+ startSuggestion : ${20},
+ showTableSuggestionValueHelp : ${21},
+ description : ${22},
+ fieldWidth : ${23},
+ valueLiveUpdate :${24},
+ suggestionItems :[${25}],
+ suggestionColumns : [${26}],
+ suggestionRows : [${27}],
+ liveChange : ${28},
+ valueHelpRequest :${29},
+ suggest : ${30},
+ suggestionItemSelected : ${31}
+ });
+snippet _sthis
+ var _self = this;
+
+snippet sapmresponsivepopup
+ var ${1} = new sap.m.ResponsivePopover({
+ placement :${2} ,//sap.m.PlacementType (default: sap.m.PlacementType.Right)
+ showHeader :${3} ,//boolean (default: true)
+ title : ${4},//string
+ icon :${5} ,//sap.ui.core.URI
+ modal :${6} ,// boolean
+ offsetX :${7}, //int
+ offsetY :${8}, //int
+ contentWidth : ${9},//sap.ui.core.CSSSize
+ contentHeight :${10}, //sap.ui.core.CSSSize
+ horizontalScrolling :${11}, //boolean
+ verticalScrolling :${12}, //boolean
+ showCloseButton :${13}, //boolean (default: true)
+ //Aggregations
+ content :${14}, //sap.ui.core.Control[]
+ customHeader :${15}, //sap.m.IBar
+ subHeader : ${16}, //sap.m.IBar
+ beginButton :${17}, //sap.m.Button
+ endButton : ${18}, //sap.m.Button
+ //Associations
+ initialFocus : ${19}, //string | sap.ui.core.Control
+ //Events
+ beforeOpen :${20}, //fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
+ afterOpen : ${21}, //fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
+ beforeClose : ${22}, //fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
+ afterClose : ${23} //fnList
+ });
+
+snippet sapicon
+ var ${1} = new sap.ui.core.Icon({
+ src :${2} , //sap.ui.core.URI
+ size :${3} , //sap.ui.core.CSSSize
+ color :${4} , //sap.ui.core.CSSColor
+ hoverColor : ${5} , // sap.ui.core.CSSColor
+ activeColor :${6} , //sap.ui.core.CSSColor
+ width :${7} , //sap.ui.core.CSSSize
+ height : ${8} ,//sap.ui.core.CSSSize
+ backgroundColor :${8} , //sap.ui.core.CSSColor
+ hoverBackgroundColor :${9} , //sap.ui.core.CSSColor
+ activeBackgroundColor :${10} , //sap.ui.core.CSSColor
+ visible :${11} , //boolean (default: true)
+ decorative : ${12} ,//boolean (default: true)
+ });
+snippet extendVerticalL
+ sap.ui.layout.VerticalLayout.extend("${1}", {
+ metadata: {
+ properties: {
+ ${2}
+ },
+ aggregations: {
+ ${3}
+ },
+ events: {
+ ${4}
+ }
+ },
+ init: function(){
+ ${5}
+ },
+
+ renderer: "${6}"
+ });
+snippet extendHorizontalL
+ sap.ui.layout.HorizontalLayout.extend("${1}", {
+ metadata: {
+ properties: {
+ ${2}
+ },
+ aggregations: {
+ ${3}
+ },
+ events: {
+ ${4}
+ }
+ },
+ init: function(){
+ ${5}
+ },
+
+ renderer: "${6}"
+ });
diff --git a/vim/bundle/vim-snippets/UltiSnips/javascript.snippets b/vim/bundle/vim-snippets/UltiSnips/javascript.snippets
new file mode 100644
index 0000000..4537bae
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/javascript.snippets
@@ -0,0 +1,171 @@
+priority -50
+
+###########################################################################
+# TextMate Snippets #
+###########################################################################
+snippet get "Get Elements"
+getElement${1/(T)|.*/(?1:s)/}By${1:T}${1/(T)|(I)|.*/(?1:agName)(?2:d)/}('$2')
+endsnippet
+
+snippet '':f "object method string"
+'${1:${2:#thing}:${3:click}}': function(element) {
+ ${VISUAL}$0
+}${10:,}
+endsnippet
+
+snippet :f "Object Method"
+${1:method_name}: function(${3:attribute}) {
+ ${VISUAL}$0
+}${10:,}
+endsnippet
+
+snippet :, "Object Value JS"
+${1:value_name}: ${0:value},
+endsnippet
+
+snippet : "Object key key: 'value'"
+${1:key}: ${2:"${3:value}"}${4:, }
+endsnippet
+
+snippet proto "Prototype (proto)"
+${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) {
+ ${VISUAL}$0
+};
+
+endsnippet
+
+snippet for "for (...) {...} (counting up)" b
+for (var ${1:i} = 0, ${2:len} = ${3:Things.length}; $1 < $2; $1++) {
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet ford "for (...) {...} (counting down, faster)" b
+for (var ${2:i} = ${1:Things.length} - 1; $2 >= 0; $2--) {
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet fun "function (fun)"
+function ${1:function_name}(${2:argument}) {
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet vf "Function assigned to var"
+${1:var }${2:function_name} = function $2(${3}) {
+ ${VISUAL}$0
+};
+endsnippet
+
+snippet af "Anonymous Function" i
+function($1) {
+ ${VISUAL}$0
+}
+endsnippet
+
+snippet iife "Immediately-Invoked Function Expression (iife)"
+(function(${1:window}) {
+ ${VISUAL}$0
+}(${2:$1}));
+endsnippet
+
+snippet timeout "setTimeout function"
+setTimeout(function() {
+ ${VISUAL}$0
+}${2:.bind(${3:this})}, ${1:10});
+endsnippet
+
+snippet fi "for prop in obj using hasOwnProperty" b
+for (${1:prop} in ${2:obj}){
+ if ($2.hasOwnProperty($1)) {
+ ${VISUAL}$0
+ }
+}
+endsnippet
+
+# Snippets for Console Debug Output
+
+snippet ca "console.assert" b
+console.assert(${1:assertion}, ${2:"${3:message}"});
+endsnippet
+
+snippet cclear "console.clear" b
+console.clear();
+endsnippet
+
+snippet cdir "console.dir" b
+console.dir(${1:object});
+endsnippet
+
+snippet cdirx "console.dirxml" b
+console.dirxml(${1:object});
+endsnippet
+
+snippet ce "console.error" b
+console.error(${1:"${2:value}"});
+endsnippet
+
+snippet cgroup "console.group" b
+console.group("${1:label}");
+${VISUAL}$0
+console.groupEnd();
+endsnippet
+
+snippet cgroupc "console.groupCollapsed" b
+console.groupCollapsed("${1:label}");
+${VISUAL}$0
+console.groupEnd();
+endsnippet
+
+snippet ci "console.info" b
+console.info(${1:"${2:value}"});
+endsnippet
+
+snippet cl "console.log" b
+console.log(${1:"${2:value}"});
+endsnippet
+
+snippet cd "console.debug" b
+console.debug(${1:"${2:value}"});
+endsnippet
+
+snippet cprof "console.profile" b
+console.profile("${1:label}");
+${VISUAL}$0
+console.profileEnd();
+endsnippet
+
+snippet ctable "console.table" b
+console.table(${1:"${2:value}"});
+endsnippet
+
+snippet ctime "console.time" b
+console.time("${1:label}");
+${VISUAL}$0
+console.timeEnd("$1");
+endsnippet
+
+snippet ctimestamp "console.timeStamp" b
+console.timeStamp("${1:label}");
+endsnippet
+
+snippet ctrace "console.trace" b
+console.trace();
+endsnippet
+
+snippet cw "console.warn" b
+console.warn(${1:"${2:value}"});
+endsnippet
+
+# AMD (Asynchronous Module Definition) snippets
+
+snippet def "define an AMD module"
+define(${1:optional_name, }[${2:'jquery'}], ${3:callback});
+endsnippet
+
+snippet req "require an AMD module"
+require([${1:'dependencies'}], ${2:callback});
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/jinja2.snippets b/vim/bundle/vim-snippets/UltiSnips/jinja2.snippets
new file mode 100644
index 0000000..ded01dc
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/jinja2.snippets
@@ -0,0 +1,209 @@
+priority -50
+
+# http://jinja.pocoo.org/
+
+# jinja2 is a full featured template engine for Python. It has full
+# unicode support, an optional integrated sandboxed execution
+# environment, widely used and BSD licensed.
+
+# possible extends:
+#extends html
+
+
+snippet block "block" b
+{% block ${1:name} %}
+ $2
+{% endblock $1 %}
+endsnippet
+
+
+snippet {{ "variable" b
+{{ $1 }}
+endsnippet
+
+
+snippet {# "comment" b
+{# $1 #}
+endsnippet
+
+
+snippet # "comment" b
+{# $1 #}
+endsnippet
+
+
+snippet raw "escaped block" b
+{% raw %}
+ $1
+{% endraw %}
+endsnippet
+
+
+snippet extends "extends" b
+{% extends "${1:template}" %}
+endsnippet
+
+
+snippet include "include" b
+{% include "${1:template}" %}
+endsnippet
+
+
+snippet import "import" b
+{% import "${1:template}" %}
+endsnippet
+
+
+snippet from "from/import/as" b
+{% from "${1:template}" import ${2:name}${3: as ${4:$2}} %}
+endsnippet
+
+
+snippet filter "filter" b
+{% filter ${1:filter} %}
+ $2
+{% endfilter %}
+endsnippet
+
+
+# Being able to quickly remove the whole 'else' block seems faster to me than
+# choosing between 'for' and 'for/else' snippets from the menu.
+# snippet for "for" b
+# {% for ${1:item} in ${2:sequence} %}
+# $3${4:
+# {% else %}
+# $5}
+# {% endfor %}
+# endsnippet
+
+
+snippet for "for" b
+{% for ${1:item} in ${2:sequence} %}
+ $3
+{% endfor %}
+endsnippet
+
+
+snippet for "for/else" b
+{% for ${1:item} in ${2:sequence} %}
+ $3
+{% else %}
+ $4
+{% endfor %}
+endsnippet
+
+
+snippet if "if" b
+{% if ${1:expr} %}
+ $2
+{% endif %}
+endsnippet
+
+
+snippet if "if/else" b
+{% if ${1:expr} %}
+ $2
+{% else %}
+ $3
+{% endif %}
+endsnippet
+
+
+snippet if "if/elif/else" b
+{% if ${1:expr} %}
+ $2
+{% elif %}
+ $3
+{% else %}
+ $4
+{% endif %}
+endsnippet
+
+
+snippet macro "macro" b
+{% macro ${1:name}(${2:args}) %}
+ $3
+{% endmacro %}
+endsnippet
+
+
+snippet call "call" b
+{% call ${1:name}(${2:args}) %}
+ $3
+{% endcall %}
+endsnippet
+
+
+snippet set "set" b
+{% set ${1:name} = ${2:'value'} %}
+endsnippet
+
+
+snippet trans "translation" b
+{% trans %}
+ $1
+{% endtrans %}
+endsnippet
+
+
+snippet with "with" b
+{% with %}
+ $1
+{% endwith %}
+endsnippet
+
+snippet autoescape "autoescape" b
+{% autoescape ${1:true} %}
+ $2
+{% endautoescape %}
+endsnippet
+
+# Filters
+# @todo: expand only when snippet is preceeded by a |
+
+snippet batch "batch items" w
+batch(linecount=$1, fill_with=${2:None})
+endsnippet
+
+
+snippet dictsort "sort and yield (key, value) pairs" w
+dictsort(case_sensitive=${1:False}, by=${2:'key'})
+endsnippet
+
+
+snippet round "round number" w
+round(precision=${1:0}, method=${2:'common|ceil|floor'})
+endsnippet
+
+
+snippet urlize "convert plain-text url to <a/>" w
+urlize(trim_url_limit=${1:None}, nofollow=${2:False})
+endsnippet
+
+
+snippet wordwrap "wordwrap" w
+wordwrap(width=${1:79}, break_long_words=${2:True})
+endsnippet
+
+
+snippet truncate "truncate" w
+truncate(lenght=${1:79}, killwords=${2:False}, end=${3:'...''})
+endsnippet
+
+
+snippet sum "sum of sequence of numbers + start" w
+sum(attribute=${1:None}, start=${2:0})
+endsnippet
+
+
+snippet sort "sort an iterable" w
+sort(reverse=${1:False}, case_sensitive=${2:False}, attribute=${3:None})
+endsnippet
+
+
+snippet indent "indent" w
+indent(width=${1:4}, indentfirst=${2:False})
+endsnippet
+
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/json.snippets b/vim/bundle/vim-snippets/UltiSnips/json.snippets
new file mode 100644
index 0000000..75edef9
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/json.snippets
@@ -0,0 +1,51 @@
+priority -50
+
+snippet s "String" b
+"${1:key}": "${0:value}",
+endsnippet
+
+snippet n "Number" b
+"${1:key}": ${0:value},
+endsnippet
+
+snippet a "Array" b
+[
+ ${VISUAL}$0
+],
+endsnippet
+
+snippet na "Named array" b
+"${1:key}": [
+ ${VISUAL}$0
+],
+endsnippet
+
+snippet o "Object" b
+{
+ ${VISUAL}$0
+},
+endsnippet
+
+snippet no "Named object" b
+"${1:key}": {
+ ${VISUAL}$0
+},
+endsnippet
+
+snippet null "Null" b
+"${0:key}": null,
+endsnippet
+
+
+global !p
+def compB(t, opts):
+ if t:
+ opts = [m[len(t):] for m in opts if m.startswith(t)]
+ if len(opts) == 1:
+ return opts[0]
+ return "(" + '|'.join(opts) + ')'
+endglobal
+
+snippet b "Bool" b
+"${1:key}": $2`!p snip.rv=compB(t[2], ['true', 'false'])`,
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/julia.snippets b/vim/bundle/vim-snippets/UltiSnips/julia.snippets
new file mode 100644
index 0000000..259c5f4
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/julia.snippets
@@ -0,0 +1,34 @@
+# Documentation
+snippet docf "function documentation" b
+#' @description
+#'
+#' ${1:function description}
+#'
+#' ${2:@param ${3:name}::${4:Type} ${5:Description}}
+#'
+#' ${6:@returns ${7:name}::${8:Type} ${9:Description}}
+#'
+#' @examples
+#'
+#' ${10: function call examples}
+endsnippet
+
+snippet doct "type definition" b
+#' @description
+#'
+#' ${1:type description}
+#'
+#' ${2:@field ${3:name}::${4:Type} ${5:Description}}
+#'
+#' @examples
+#'
+#' ${10: constructor examples}
+endsnippet
+
+snippet par "function parameter documentation" b
+#' @param ${1:name}::${2:Type} ${0:Description}
+endsnippet
+
+snippet fld "type field documentation" b
+#' @field ${1:name}::${2:Type} ${0:Description}
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/ledger.snippets b/vim/bundle/vim-snippets/UltiSnips/ledger.snippets
new file mode 100644
index 0000000..7d7a84d
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/ledger.snippets
@@ -0,0 +1,7 @@
+priority -50
+
+snippet t "Transaction" b
+${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} ${4:*} ${5:Payee}
+ ${6:Expenses} \$${7:0.00}
+ ${8:Assets:Checking}$0
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/lhaskell.snippets b/vim/bundle/vim-snippets/UltiSnips/lhaskell.snippets
new file mode 100644
index 0000000..29169a5
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/lhaskell.snippets
@@ -0,0 +1,3 @@
+priority -50
+
+extends haskell
diff --git a/vim/bundle/vim-snippets/UltiSnips/lua.snippets b/vim/bundle/vim-snippets/UltiSnips/lua.snippets
new file mode 100644
index 0000000..b6d0c1a
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/lua.snippets
@@ -0,0 +1,98 @@
+priority -50
+
+#################################
+# Snippets for the Lua language #
+#################################
+snippet #! "Shebang header" b
+#!/usr/bin/env lua
+$0
+endsnippet
+
+snippet !fun(ction)?! "New function" br
+function ${1:new_function}(${2:args})
+ $0
+end
+endsnippet
+
+snippet forp "pair for loop" b
+for ${1:name},${2:val} in pairs(${3:table_name}) do
+ $0
+end
+endsnippet
+
+snippet fori "ipair for foop" b
+for ${1:idx},${2:val} in ipairs(${3:table_name}) do
+ $0
+end
+endsnippet
+
+snippet for "numeric for loop" b
+for ${1:i}=${2:first},${3:last}${4/^..*/(?0:,:)/}${4:step} do
+ $0
+end
+endsnippet
+
+snippet do "do block"
+do
+ $0
+end
+endsnippet
+
+snippet repeat "repeat loop" b
+repeat
+ $1
+until $0
+endsnippet
+
+snippet while "while loop" b
+while $1 do
+ $0
+end
+endsnippet
+
+snippet if "if statement" b
+if $1 then
+ $0
+end
+endsnippet
+
+snippet ife "if/else statement" b
+if $1 then
+ $2
+else
+ $0
+end
+endsnippet
+
+snippet eif "if/elseif statement" b
+if $1 then
+ $2
+elseif $3 then
+ $0
+end
+endsnippet
+
+snippet eife "if/elseif/else statement" b
+if $1 then
+ $2
+elseif $3 then
+ $4
+else
+ $0
+end
+endsnippet
+
+snippet pcall "pcall statement" b
+local ok, err = pcall(${1:your_function})
+if not ok then
+ handler(${2:ok, err})
+${3:else
+ success(${4:ok, err})
+}end
+endsnippet
+
+snippet local "local x = 1"
+local ${1:x} = ${0:1}
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/mako.snippets b/vim/bundle/vim-snippets/UltiSnips/mako.snippets
new file mode 100644
index 0000000..fb31ec8
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/mako.snippets
@@ -0,0 +1,92 @@
+priority -50
+
+#################
+# From snipmate #
+#################
+snippet def "definition" b
+<%def name="${1:name}">
+ ${2:}
+</%def>
+endsnippet
+
+snippet call "call" b
+<%call expr="${1:name}">
+ ${2:}
+</%call>
+endsnippet
+
+snippet doc "doc" b
+<%doc>
+ ${1:}
+</%doc>
+endsnippet
+
+snippet text "text" b
+<%text>
+ ${1:}
+</%text>
+endsnippet
+
+snippet for "for" b
+% for ${1:i} in ${2:iter}:
+ ${3:}
+% endfor
+endsnippet
+
+snippet if "if " b
+% if ${1:condition}:
+ ${2:}
+% endif
+endsnippet
+
+snippet if "if/else" b
+% if ${1:condition}:
+ ${2:}
+% else:
+ ${3:}
+% endif
+endsnippet
+
+snippet try "try" b
+% try:
+ ${1:}
+% except${2:}:
+ ${3:pass}
+% endtry
+endsnippet
+
+snippet wh "wh" b
+% while ${1:}:
+ ${2:}
+% endwhile
+endsnippet
+
+snippet $ "$" i
+${${1:}}
+endsnippet
+
+snippet <% "<%" b
+<% ${1:} %>
+endsnippet
+
+snippet <!% "<!%" b
+<!% ${1:} %>
+endsnippet
+
+snippet inherit "inherit" b
+<%inherit file="${1:filename}" />
+endsnippet
+
+snippet include "include" b
+<%include file="${1:filename}" />
+endsnippet
+
+snippet namespace "namespace" b
+<%namespace file="${1:name}" />
+endsnippet
+
+snippet page "page" b
+<%page args="${1:}" />
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/markdown.snippets b/vim/bundle/vim-snippets/UltiSnips/markdown.snippets
new file mode 100644
index 0000000..0720cbf
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/markdown.snippets
@@ -0,0 +1,53 @@
+priority -50
+
+###########################
+# Sections and Paragraphs #
+###########################
+snippet sec "Section" b
+# ${1:Section Name} #
+$0
+endsnippet
+
+snippet ssec "Sub Section" b
+## ${1:Section Name} ##
+$0
+endsnippet
+
+snippet sssec "SubSub Section" b
+### ${1:Section Name} ###
+$0
+endsnippet
+
+snippet par "Paragraph" b
+#### ${1:Paragraph Name} ####
+$0
+endsnippet
+
+snippet spar "Paragraph" b
+##### ${1:Paragraph Name} #####
+$0
+endsnippet
+
+################
+# Common stuff #
+################
+snippet link "Link to something"
+[${1:${VISUAL:Text}}](${3:http://${2:www.url.com}})$0
+endsnippet
+
+snippet img "Image"
+![${1:pic alt}](${2:path}${3/.+/ "/}${3:opt title}${3/.+/"/})$0
+endsnippet
+
+snippet ilc "Inline Code" i
+\`$1\`$0
+endsnippet
+
+snippet cbl "Codeblock" b
+\`\`\`
+$1
+\`\`\`
+$0
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/objc.snippets b/vim/bundle/vim-snippets/UltiSnips/objc.snippets
new file mode 100644
index 0000000..45e41fc
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/objc.snippets
@@ -0,0 +1,272 @@
+priority -50
+
+###########################################################################
+# TextMate Snippets #
+###########################################################################
+
+snippet imp "#import (imp)" b
+#import "${1:`!p snip.rv = re.sub(r'\..*$', '.h', fn)`}"
+endsnippet
+
+snippet Imp "#import <> (Imp)"
+#import <${1:Cocoa/Cocoa.h}>
+endsnippet
+
+snippet cl "020 Class (objc)"
+@interface ${1:`!p
+if len(fn):
+ snip.rv = re.sub(r'\..*$', '', fn)
+else:
+ snip.rv = "object"
+`} : ${2:NSObject}
+{
+}
+@end
+
+@implementation $1
+- (id)init
+{
+ if((self = [super init]))
+ {$0
+ }
+ return self;
+}
+@end
+endsnippet
+
+snippet array "NSArray (array)"
+NSMutableArray *${1:array} = [NSMutableArray array];
+endsnippet
+
+snippet dict "NSDictionary (dict)"
+NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];
+endsnippet
+
+snippet forarray "for NSArray loop (forarray)"
+unsigned int ${1:object}Count = [${2:array} count];
+
+for(unsigned int index = 0; index < $1Count; index += 1)
+{
+ ${3:id} $1 = [$2 objectAtIndex:index];
+ $0
+}
+endsnippet
+
+snippet objacc "Object Accessors (objacc)"
+- (${1:id})${2:thing}
+{
+ return $2;
+}
+
+- (void)set${2/./\u$0/}:($1)aValue
+{
+ $0${1/( \*)?$/(?1:$1: )/}old${2/./\u$0/} = $2;
+ $2 = [aValue retain];
+ [old${2/./\u$0/} release];
+}
+endsnippet
+
+snippet sel "@selector"
+@selector(${1:method}:)
+endsnippet
+
+snippet cdacc "CoreData Accessors Implementation"
+- (${1:id})${2:attribute}
+{
+ [self willAccessValueForKey:@"$2"];
+ $1 value = [self primitiveValueForKey:@"$2"];
+ [self didAccessValueForKey:@"$2"];
+ return value;
+}
+
+- (void)set${2/./\u$0/}:($1)aValue
+{
+ [self willChangeValueForKey:@"$2"];
+ [self setPrimitiveValue:aValue forKey:@"$2"];
+ [self didChangeValueForKey:@"$2"];
+}
+endsnippet
+
+snippet delegate "Delegate Responds to Selector"
+if([${1:[self delegate]} respondsToSelector:@selector(${2:selfDidSomething:})])
+ [$1 ${3:${2/((^\s*([A-Za-z0-9_]*:)\s*)|(:\s*$)|(:\s*))/(?2:$2self :\:<>)(?4::)(?5: :)/g}}];
+
+endsnippet
+
+snippet thread "Detach New NSThread"
+[NSThread detachNewThreadSelector:@selector(${1:method}:) toTarget:${2:aTarget} withObject:${3:anArgument}]
+endsnippet
+
+snippet ibo "IBOutlet (ibo)"
+IBOutlet ${1:NSSomeClass} *${2:${1/^[A-Z](?:[A-Z]+|[a-z]+)([A-Z]\w*)/\l$1/}};
+endsnippet
+
+snippet I "Initialize Implementation (I)"
++ (void)initialize
+{
+ [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
+ $0@"value", @"key",
+ nil]];
+}
+endsnippet
+
+snippet bind "Key:value binding (bind)"
+bind:@"${1:binding}" toObject:${2:observableController} withKeyPath:@"${3:keyPath}" options:${4:nil}
+endsnippet
+
+snippet arracc "LoD array (arracc)"
+- (void)addObjectTo${1:Things}:(${2:id})anObject
+{
+ [${3:${1/./\l$0/}} addObject:anObject];
+}
+
+- (void)insertObject:($2)anObject in$1AtIndex:(unsigned int)i
+{
+ [$3 insertObject:anObject atIndex:i];
+}
+
+- ($2)objectIn$1AtIndex:(unsigned int)i
+{
+ return [$3 objectAtIndex:i];
+}
+
+- (unsigned int)indexOfObjectIn$1:($2)anObject
+{
+ return [$3 indexOfObject:anObject];
+}
+
+- (void)removeObjectFrom$1AtIndex:(unsigned int)i
+{
+ [$3 removeObjectAtIndex:i];
+}
+
+- (unsigned int)countOf$1
+{
+ return [$3 count];
+}
+
+- (NSArray *${1/./\l$0/}
+{
+ return $3;
+}
+
+- (void)set$1:(NSArray *)new$1
+{
+ [$3 setArray:new$1];
+}
+endsnippet
+
+snippet arracc "LoD array interface (arracc)"
+- (void)addObjectTo${1:Things}:(${2:id})anObject;
+- (void)insertObject:($2)anObject in$1AtIndex:(unsigned int)i;
+- ($2)objectIn$1AtIndex:(unsigned int)i;
+- (unsigned int)indexOfObjectIn$1:($2)anObject;
+- (void)removeObjectFrom$1AtIndex:(unsigned int)i;
+- (unsigned int)countOf$1;
+- (NSArray *)${1/./\l$0/};
+- (void)set$1:(NSArray *)new$1;
+endsnippet
+
+snippet focus "Lock Focus"
+[self lockFocus];
+$0
+[self unlockFocus];
+endsnippet
+
+snippet pool "NSAutoreleasePool (pool)"
+NSAutoreleasePool *pool = [NSAutoreleasePool new];
+$0
+[pool drain];
+endsnippet
+
+snippet log "NSLog (log) 2"
+NSLog(@"$1"${1/[^%]*(%)?.*/(?1:, :\);)/}$2${1/[^%]*(%)?.*/(?1:\);)/}
+endsnippet
+
+snippet alert "NSRunAlertPanel (alert)"
+int choice = NSRunAlertPanel(@"${1:Something important!}", @"${2:Something important just happend, and now I need to ask you, do you want to continue?}", @"${3:Continue}", @"${4:Cancel}", nil);
+if(choice == NSAlertDefaultReturn) // "$3"
+{
+ $0;
+}
+else if(choice == NSAlertAlternateReturn) // "$4"
+{
+ $0
+}
+endsnippet
+
+snippet format "NSString stringWithFormat (format)"
+[NSString stringWithFormat:@"$1", $2]$0
+endsnippet
+
+snippet objacc "Object Accessors Interface (objacc)"
+- (${1:id})${2:thing};
+- (void)set${2/./\u$0/}:($1)aValue;
+endsnippet
+
+snippet prop "Property"
+@property (${1/^(e)$|.*/(?1:r)/}${1:r}${1/^(?:(r)|(e)|(c)|(a))$|.*/(?1:etain)(?2:adonly)(?3:opy)(?4:ssign)/}) ${2:NSSomeClass}$ *${3:${2/^[A-Z](?:[A-Z]+|[a-z]+)([A-Z]\w*)/\l$1/}};
+endsnippet
+
+snippet getprefs "Read from defaults (getprefs)"
+[[NSUserDefaults standardUserDefaults] objectForKey:${1:key}];
+endsnippet
+
+snippet obs "Register for Notification"
+[[NSNotificationCenter defaultCenter] addObserver:${1:self} selector:@selector(${3:${2/^([A-Z]{2})?(.+?)(Notification)?$/\l$2/}}:) name:${2:NSWindowDidBecomeMainNotification} object:${4:nil}];
+endsnippet
+
+snippet responds "Responds to Selector"
+if ([${1:self} respondsToSelector:@selector(${2:someSelector:})])
+{
+ [$1 ${3:${2/((:\s*$)|(:\s*))/:<>(?3: )/g}}];
+}
+endsnippet
+
+snippet gsave "Save and Restore Graphics Context (gsave)"
+[NSGraphicsContext saveGraphicsState];
+$0
+[NSGraphicsContext restoreGraphicsState];
+
+endsnippet
+
+snippet acc "Scalar Accessors (acc)"
+- (${1:unsigned int})${2:thing}
+{
+ return ${3:$2};
+}
+
+- (void)set${2/./\u$0/}:(${1:unsigned int})new${2/./\u$0/}
+{
+ $3 = new${2/./\u$0/};
+}
+endsnippet
+
+snippet acc "Scalar Accessors Interface (acc)"
+- (${1:unsigned int})${2:thing};
+- (void)set${2/./\u$0/}:($1)new${2/./\u$0/};
+endsnippet
+
+snippet stracc "String Accessors (stracc)"
+- (NSString *)${1:thing}
+{
+ return ${2:$1};
+}
+
+- (void)set${1/.*/\u$0/}:(NSString *)/})${3:a${1/.*/\u$0/}}
+{
+ $3 = [$3 copy];
+ [$2 release];
+ $2 = $3;
+}
+endsnippet
+
+snippet syn "Synthesize"
+@synthesize ${1:property};
+endsnippet
+
+snippet setprefs "Write to defaults (setprefs)"
+[[NSUserDefaults standardUserDefaults] setObject:${1:object} forKey:${2:key}];
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/ocaml.snippets b/vim/bundle/vim-snippets/UltiSnips/ocaml.snippets
new file mode 100644
index 0000000..1ebc347
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/ocaml.snippets
@@ -0,0 +1,174 @@
+priority -50
+
+snippet rs "raise" b
+raise (${1:Not_found})
+endsnippet
+
+snippet open "open"
+let open ${1:module} in
+${2:e}
+endsnippet
+
+snippet try "try"
+try ${1:e}
+with ${2:Not_found} -> ${3:()}
+endsnippet
+
+snippet ref "ref"
+let ${1:name} = ref ${2:val} in
+${3:e}
+endsnippet
+
+snippet matchl "pattern match on a list"
+match ${1:list} with
+| [] -> ${2:()}
+| x::xs -> ${3:()}
+endsnippet
+
+snippet matcho "pattern match on an option type"
+match ${1:x} with
+| Some(${2:y}) -> ${3:()}
+| None -> ${4:()}
+endsnippet
+
+snippet fun "anonymous function"
+(fun ${1:x} -> ${2:x})
+endsnippet
+
+snippet cc "commment"
+(* ${1:comment} *)
+endsnippet
+
+snippet let "let .. in binding"
+let ${1:x} = ${2:v} in
+${3:e}
+endsnippet
+
+snippet lr "let rec"
+let rec ${1:f} =
+ ${2:expr}
+endsnippet
+
+snippet if "if"
+if ${1:(* condition *)} then
+ ${2:(* A *)}
+else
+ ${3:(* B *)}
+endsnippet
+
+snippet If "If"
+if ${1:(* condition *)} then
+ ${2:(* A *)}
+endsnippet
+
+snippet while "while"
+while ${1:(* condition *)} do
+ ${2:(* A *)}
+done
+endsnippet
+
+snippet for "for"
+for ${1:i} = ${2:1} to ${3:10} do
+ ${4:(* BODY *)}
+done
+endsnippet
+
+snippet match "match"
+match ${1:(* e1 *)} with
+| ${2:p} -> ${3:e2}
+endsnippet
+
+snippet Match "match"
+match ${1:(* e1 *)} with
+| ${2:p} -> ${3:e2}
+endsnippet
+
+snippet class "class"
+class ${1:name} = object
+ ${2:methods}
+end
+endsnippet
+
+snippet obj "obj"
+object
+ ${2:methods}
+end
+endsnippet
+
+snippet Obj "object"
+object (self)
+ ${2:methods}
+end
+endsnippet
+
+snippet {{ "object functional update"
+{< ${1:x} = ${2:y} >}
+endsnippet
+
+snippet beg "beg"
+begin
+ ${1:block}
+end
+endsnippet
+
+snippet ml "module instantiantion with functor"
+module ${1:Mod} = ${2:Functor}(${3:Arg})
+endsnippet
+
+snippet mod "module - no signature"
+module ${1:(* Name *)} = struct
+ ${2:(* BODY *)}
+end
+endsnippet
+
+snippet Mod "module with signature"
+module ${1:(* Name *)} : ${2:(* SIG *)} = struct
+ ${3:(* BODY *)}
+end
+endsnippet
+
+snippet sig "anonymous signature"
+sig
+ ${2:(* BODY *)}
+end
+endsnippet
+
+snippet sigf "functor signature or anonymous functor"
+functor (${1:Arg} : ${2:ARG}) -> ${3:(* BODY *)}
+endsnippet
+
+snippet func "define functor - no signature"
+module ${1:M} (${2:Arg} : ${3:ARG}) = struct
+ ${4:(* BODY *)}
+end
+endsnippet
+
+snippet Func "define functor - with signature"
+module ${1:M} (${2:Arg} : ${3:ARG}) : ${4:SIG} = struct
+ ${5:(* BODY *)}
+end
+endsnippet
+
+snippet mot "Declare module signature"
+module type ${1:(* Name *)} = sig
+ ${2:(* BODY *)}
+end
+endsnippet
+
+snippet module "Module with anonymous signature"
+module ${1:(* Name *)} : sig
+ ${2:(* SIGNATURE *)}
+end = struct
+ ${3:(* BODY *)}
+end
+endsnippet
+
+snippet oo "odoc"
+(** ${1:odoc} *)
+endsnippet
+
+snippet qt "inline qtest"
+(*$T ${1:name}
+ ${2:test}
+*)
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/pandoc.snippets b/vim/bundle/vim-snippets/UltiSnips/pandoc.snippets
new file mode 100644
index 0000000..ce858f0
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/pandoc.snippets
@@ -0,0 +1,12 @@
+extends markdown
+
+# overwrite if necessary
+priority -49
+
+snippet title "Title Header" b
+% ${1:`!v vim_snippets#Filename('$1', 'title')`}
+% ${2:`!v g:snips_author`}
+% ${3:`!v strftime("%d %B %Y")`}
+
+$0
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/perl.snippets b/vim/bundle/vim-snippets/UltiSnips/perl.snippets
new file mode 100644
index 0000000..67c7f27
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/perl.snippets
@@ -0,0 +1,139 @@
+priority -50
+
+###########################################################################
+# TextMate Snippets #
+###########################################################################
+snippet ife "Conditional if..else (ife)"
+if ($1) {
+ ${2:# body...}
+}
+else {
+ ${3:# else...}
+}
+
+endsnippet
+
+snippet ifee "Conditional if..elsif..else (ifee)"
+if ($1) {
+ ${2:# body...}
+}
+elsif ($3) {
+ ${4:# elsif...}
+}
+else {
+ ${5:# else...}
+}
+
+endsnippet
+
+snippet xunless "Conditional one-line (unless)"
+${1:expression} unless ${2:condition};
+
+endsnippet
+
+snippet xif "Conditional one-line (xif)"
+${1:expression} if ${2:condition};
+
+endsnippet
+
+snippet sub "Function (sub)"
+sub ${1:function_name} {
+ ${2:# body...}
+}
+
+endsnippet
+
+snippet xfore "Loop one-line (xforeach)"
+${1:expression} foreach @${2:array};
+
+endsnippet
+
+snippet xwhile "Loop one-line (xwhile)"
+${1:expression} while ${2:condition};
+
+endsnippet
+
+snippet test "Test"
+#!/usr/bin/env perl -w
+
+use strict;
+use Test::More tests => ${1:1};
+use ${2:ModuleName};
+
+ok(${3:assertion});
+
+endsnippet
+
+snippet class "class"
+package ${1:ClassName};
+
+${2:use parent qw(${3:ParentClass});}${2/.+/\n\n/}sub new {
+ my $class = shift;
+ $class = ref $class if ref $class;
+ my $self = bless {}, $class;
+ $self;
+}
+
+1;
+
+endsnippet
+
+snippet eval "eval"
+local $@;
+eval {
+ ${1:# do something risky...}
+};
+if (my $${2:exception} = $@) {
+ ${3:# handle failure...}
+}
+
+endsnippet
+
+snippet for "for"
+for (my $${1:var} = 0; $$1 < ${2:expression}; $$1++) {
+ ${3:# body...}
+}
+
+endsnippet
+
+snippet fore "foreach"
+foreach ${1:my $${2:x}} (@${3:array}) {
+ ${4:# body...}
+}
+
+endsnippet
+
+snippet if "if"
+if ($1) {
+ ${2:# body...}
+}
+
+endsnippet
+
+snippet slurp "slurp"
+my $${1:var} = do { local $/ = undef; open my $fh, '<', ${2:$file}; <$fh> };
+
+endsnippet
+
+snippet unless "unless"
+unless ($1) {
+ ${2:# body...}
+}
+
+endsnippet
+
+snippet while "while"
+while ($1) {
+ ${2:# body...}
+}
+
+endsnippet
+
+snippet until "until"
+until ($1) {
+ ${2:# body...}
+}
+
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/php-laravel.snippets b/vim/bundle/vim-snippets/UltiSnips/php-laravel.snippets
new file mode 100644
index 0000000..7367a14
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/php-laravel.snippets
@@ -0,0 +1,270 @@
+#resource controller
+snippet l_rsc "Laravel resource controller" b
+/*!
+ * \class $1
+ *
+ * \author ${3:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+class ${1:`!v expand('%:t:r')`} extends ${2:BaseController} {
+ function __construct() {
+ }
+
+ public function index() {
+ }
+
+ public function create() {
+ }
+
+ public function store() {
+ }
+
+ public function show($id) {
+ }
+
+ public function edit($id) {
+ }
+
+ public function update($id) {
+ }
+
+ public function destroy($id) {
+ }
+}
+endsnippet
+
+#service service provider
+snippet l_ssp "Laravel service provider for service" b
+<?php
+
+/*!
+ * \namespace $1
+ * \class $2
+ *
+ * \author ${3:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+namespace ${1:Services};
+
+use Illuminate\Support\ServiceProvider;
+
+class ${2:`!v expand('%:t:r')`} extends ServiceProvider {
+
+ public function register() {
+ $this->app->bind('${4}Service', function ($app) {
+ return new ${5}(
+ $app->make('Repositories\\${6}Interface')
+ );
+ });
+ }
+}
+endsnippet
+
+#repository service provider
+snippet l_rsp "Laravel service provider for repository" b
+<?php
+
+/*!
+ * \namespace $2
+ * \class $3
+ *
+ * \author ${4:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+namespace ${2:Repositories\\${1:}};
+
+use Entities\\$1;
+use $2\\$1Repository;
+use Illuminate\Support\ServiceProvider;
+
+class ${3:`!v expand('%:t:r')`} extends ServiceProvider {
+ /*!
+ * \var defer
+ * \brief Defer service
+ */
+ protected $defer = ${5:true};
+
+ public function register() {
+ $this->app->bind('$2\\$1Interface', function($app) {
+ return new $1Repository(new $1());
+ });
+ }
+
+ /*!
+ * \brief If $defer == true need this fn
+ */
+ public function provides() {
+ return ['$2\\$1Interface'];
+ }
+}
+endsnippet
+
+#model
+snippet l_md "Laravel simple model" b
+<?php
+
+/*!
+ * \namespace $1
+ * \class $2
+ *
+ * \author ${3:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+namespace ${1:Entities};
+
+class ${2:`!v expand('%:t:r')`} extends \Eloquent {
+ protected $table = '${4:`!p snip.rv = t[2].lower()`}';
+
+ public $timestamps = ${5:false};
+
+ protected $hidden = array(${6});
+
+ protected $guarded = array(${7:'id'});
+}
+endsnippet
+
+#abstract repository
+snippet l_ar "Laravel abstract Repository" b
+<?php
+
+/*!
+ * \namespace $1
+ * \class $2
+ * \implements $3
+ *
+ * \author ${4:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+namespace ${1:Repositories};
+
+use Illuminate\Database\Eloquent\Model;
+
+abstract class ${2:`!v expand('%:t:r')`} implements ${3:BaseRepositoryInterface} {
+ protected $model;
+
+ /*!
+ * \fn __construct
+ *
+ * \brief Take the model
+ */
+
+ public function __construct(Model $model) {
+ $this->model = $model;
+ }
+
+ /*!
+ * \fn all
+ *
+ * \return Illuminate\Database\Eloquent\Collection
+ */
+ public function all($columns = array('*')) {
+ return $this->model->all()->toArray();
+ }
+
+ /*!
+ * \fn create
+ *
+ * \return Illuminate\Database\Eloquent\Model
+ */
+ public function create(array $attributes) {
+ return $this->model->create($attributes);
+ }
+
+ /*!
+ * \fn destroy
+ *
+ * \return int
+ */
+ public function destroy($ids) {
+ return $this->model->destroy($ids);
+ }
+
+ /*!
+ * \fn find
+ *
+ * \return mixed
+ */
+ public function find($id, $columns = array('*')) {
+ return $this->model->find($id, $columns);
+ }
+}
+endsnippet
+
+#repository
+snippet l_r "Laravel Repository" b
+<?php
+
+/*!
+ * \namespace $1
+ * \class $3
+ * \implements $4
+ *
+ * \author ${5:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+namespace ${1:Repositories\\${2}};
+
+class ${3:`!v expand('%:t:r')`} extends \\${6} implements ${4:$3RepositoryInterface} {
+ ${7}
+}
+endsnippet
+
+#service
+snippet l_s "Laravel Service" b
+<?php
+
+/*!
+ * \namespace $1
+ * \class $2
+ *
+ * \author ${6:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+namespace Services\\${1};
+
+use ${3:Repositories\\${4:Interface}};
+
+class ${2:`!v expand('%:t:r')`} {
+ protected $${5:repo};
+
+ /*!
+ * \fn __construct
+ */
+ public function __construct($4 $repo) {
+ $this->$5 = $repo;
+ }
+}
+endsnippet
+
+#facade
+snippet l_f "Laravel Facade" b
+<?php
+
+/*!
+ * \namespace $1
+ * \class $2
+ *
+ * \author ${5:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+namespace ${1:Services};
+
+use \Illuminate\Support\Facades\Facade;
+
+class ${2:`!v expand('%:t:r')`} extends Facade {
+ /*!
+ * \fn getFacadeAccessor
+ *
+ * \return string
+ */
+ protected static function getFacadeAccessor() { return '${4:${3}Service}'; }
+}
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/php-phpspec.snippets b/vim/bundle/vim-snippets/UltiSnips/php-phpspec.snippets
new file mode 100644
index 0000000..08d84a0
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/php-phpspec.snippets
@@ -0,0 +1,222 @@
+# Snippets for phpspec, to use add the following to your .vimrc
+# `autocmd BufRead,BufNewFile,BufEnter *Spec.php UltiSnipsAddFiletypes php-phpspec`
+
+priority -50
+
+snippet spec "class XYZSpec extends ObjectBehaviour"
+<?php
+
+namespace `!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`;
+
+use PhpSpec\ObjectBehavior;
+use Prophecy\Argument;
+
+/**
+ * @author `!v g:snips_author`
+ */
+class `!p
+snip.rv = re.match(r'.*(?=\.)', fn).group()
+` extends ObjectBehavior
+{
+ function it_${1}()
+ {
+ $0
+ }
+}
+endsnippet
+
+snippet it "function it_does_something() { ... }"
+function it_${1}()
+{
+ ${0:${VISUAL}}
+}
+endsnippet
+
+snippet let "function let() { ... }"
+function let()
+{
+ ${0:${VISUAL}}
+}
+endsnippet
+
+snippet letgo "function letgo() { ... }"
+function letgo()
+{
+ ${0:${VISUAL}}
+}
+endsnippet
+
+# Object construction
+snippet cw "$this->beConstructedWith($arg)"
+$this->beConstructedWith(${1});
+endsnippet
+
+snippet ct "$this->beConstructedThrough($methodName, [$arg])"
+$this->beConstructedThrough(${1:'methodName'}, [${2:'$arg'}]);
+endsnippet
+
+# Identity and comparison matchers
+snippet sreturn "$this->XYZ()->shouldReturn('value')"
+$this->${1:method}()->shouldReturn(${2:'value'});
+endsnippet
+
+snippet snreturn "$this->XYZ()->shouldNotReturn('value')"
+$this->${1:method}()->shouldNotReturn(${2:'value'});
+endsnippet
+
+snippet sbe "$this->XYZ()->shouldBe('value')"
+$this->${1:method}()->shouldBe(${2:'value'});
+endsnippet
+
+snippet snbe "$this->XYZ()->shouldNotBe('value')"
+$this->${1:method}()->shouldNotBe(${2:'value'});
+endsnippet
+
+snippet sequal "$this->XYZ()->shouldEqual('value')"
+$this->${1:method}()->shouldEqual(${2:'value'});
+endsnippet
+
+snippet snequal "$this->XYZ()->shouldNotEqual('value')"
+$this->${1:method}()->shouldNotEqual(${2:'value'});
+endsnippet
+
+snippet sbequalto "$this->XYZ()->shouldBeEqualTo('value')"
+$this->${1:method}()->shouldBeEqualTo(${2:'value'});
+endsnippet
+
+snippet snbequalto "$this->XYZ()->shouldNotBeEqualTo('value')"
+$this->${1:method}()->shouldNotBeEqualTo(${2:'value'});
+endsnippet
+
+snippet sblike "$this->XYZ()->shouldBeLike('value')"
+$this->${1:method}()->shouldBeLike(${2:'value'});
+endsnippet
+
+snippet snblike "$this->XYZ()->shouldNotBeLike('value')"
+$this->${1:method}()->shouldNotBeLike(${2:'value'});
+endsnippet
+
+# Throw matcher
+snippet sthrowm "$this->shouldThrow('\Exception')->duringXYZ($arg)"
+$this->shouldThrow(${1:'\Exception'})->during${2:Method}(${3:'$arg'});
+endsnippet
+
+snippet sthrowi "$this->shouldThrow('\Exception')->duringInstantiation()"
+$this->shouldThrow(${1:'\Exception'})->duringInstantiation();
+endsnippet
+
+# Type matchers
+snippet stype "$this->shouldHaveType('Type')"
+$this->shouldHaveType(${1});
+endsnippet
+
+snippet sntype "$this->shouldNotHaveType('Type')"
+$this->shouldNotHaveType(${1});
+endsnippet
+
+snippet srinstance "$this->shouldReturnAnInstanceOf('Type')"
+$this->shouldReturnAnInstanceOf(${1});
+endsnippet
+
+snippet snrinstance "$this->shouldNotReturnAnInstanceOf('Type')"
+$this->shouldNotReturnAnInstanceOf(${1});
+endsnippet
+
+snippet sbinstance "$this->shouldBeAnInstanceOf('Type')"
+$this->shouldBeAnInstanceOf(${1});
+endsnippet
+
+snippet snbinstance "$this->shouldNotBeAnInstanceOf('Type')"
+$this->shouldNotBeAnInstanceOf(${1});
+endsnippet
+
+snippet simplement "$this->shouldImplement('Type')"
+$this->shouldImplement(${1});
+endsnippet
+
+snippet snimplement "$this->shouldNotImplement('Type')"
+$this->shouldNotImplement(${1});
+endsnippet
+
+# Object state matchers
+snippet sbstate "$this->shouldBeXYZ()"
+$this->shouldBe${1}();
+endsnippet
+
+snippet snbstate "$this->shouldNotBeXYZ()"
+$this->shouldNotBe${1}();
+endsnippet
+
+# Count matchers
+snippet scount "$this->XYZ()->shouldHaveCount(7)"
+$this->${1:method}()->shouldHaveCount(${2:7});
+endsnippet
+
+snippet sncount "$this->XYZ()->shouldNotHaveCount(7)"
+$this->${1:method}()->shouldNotHaveCount(${2:7});
+endsnippet
+
+# Scalar type matchers
+snippet sbscalar "$this->XYZ()->shouldBeString|Array|Bool()"
+$this->${1:method}()->shouldBe${2:String|Array|Bool}();
+endsnippet
+
+snippet snbscalar "$this->XYZ()->shouldNotBeString|Array|Bool()"
+$this->${1:method}()->shouldNotBe${2:String|Array|Bool}();
+endsnippet
+
+# Contain matcher
+snippet scontain "$this->XYZ()->shouldContain('value')"
+$this->${1:method}()->shouldContain(${2:'value'});
+endsnippet
+
+snippet sncontain "$this->XYZ()->shouldNotContain('value')"
+$this->${1:method}()->shouldNotContain(${2:'value'});
+endsnippet
+
+# Array matchers
+snippet skey "$this->XYZ()->shouldHaveKey('key')"
+$this->${1:method}()->shouldHaveKey(${2:'key'});
+endsnippet
+
+snippet snkey "$this->XYZ()->shouldNotHaveKey('key')"
+$this->${1:method}()->shouldNotHaveKey(${2:'key'});
+endsnippet
+
+snippet skeyvalue "$this->XYZ()->shouldHaveKeyWithValue('key', 'value')"
+$this->${1:method}()->shouldHaveKeyWithValue(${2:'key'}, ${3:'value'});
+endsnippet
+
+snippet snkeyvalue "$this->XYZ()->shouldNotHaveKeyWithValue('key', 'value')"
+$this->${1:method}()->shouldNotHaveKeyWithValue(${2:'key'}, ${3:'value'});
+endsnippet
+
+# String matchers
+snippet sstart "$this->XYZ()->shouldStartWith('string')"
+$this->${1:method}()->shouldStartWith(${2:'string'});
+endsnippet
+
+snippet snstart "$this->XYZ()->shouldNotStartWith('string')"
+$this->${1:method}()->shouldNotStartWith(${2:'string'});
+endsnippet
+
+snippet send "$this->XYZ()->shouldEndWith('string')"
+$this->${1:method}()->shouldEndWith(${2:'string'});
+endsnippet
+
+snippet snend "$this->XYZ()->shouldNotEndWith('string')"
+$this->${1:method}()->shouldNotEndWith(${2:'string'});
+endsnippet
+
+snippet smatch "$this->XYZ()->shouldMatch('/wizard/i')"
+$this->${1:method}()->shouldMatch(${2:'/wizard/i'});
+endsnippet
+
+snippet snmatch "$this->XYZ()->shouldNotMatch('/wizard/i')"
+$this->${1:method}()->shouldNotMatch(${2:'/wizard/i'});
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/php-symfony2.snippets b/vim/bundle/vim-snippets/UltiSnips/php-symfony2.snippets
new file mode 100644
index 0000000..2b127ee
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/php-symfony2.snippets
@@ -0,0 +1,360 @@
+# sugguestion? report bugs?
+# go to https://github.com/chrisyue/vim-snippets/issues
+
+priority -50
+
+snippet classn "Basic class with namespace snippet" b
+<?php
+
+namespace `!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`;
+
+/**
+ * ${1:@author `!v g:snips_author`}
+ */
+class `!p
+snip.rv = re.match(r'.*(?=\.)', fn).group()
+`$2
+{
+ public function __construct(${3:$options})
+ {
+ ${4:// code}
+ }$0
+}
+endsnippet
+
+snippet contr "Symfony2 controller" b
+<?php
+
+namespace `!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`;
+
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+ * ${1:@author `!v g:snips_author`}
+ */
+class `!p
+snip.rv = re.match(r'.*(?=\.)', fn).group()
+` extends Controller
+{
+}
+endsnippet
+
+snippet sfa "Symfony 2 Controller action"
+/**
+* @Route("/${1:route_name}", name="$1")
+* @Template()
+*/
+public function $1Action($2)
+{
+ $3
+ return ${4:array();}$0
+}
+endsnippet
+
+snippet act "Symfony2 action" b
+/**
+ * @Route("${3}", name="${4}")
+ * @Method({${5:"POST"}})
+ * @Template()
+ */
+public function ${1}Action(${2})
+{
+ ${6}
+}
+endsnippet
+
+snippet actt "Symfony2 action and template" b
+/**
+ * @Route("${3}", name="${4}")
+ * @Method({${5:"GET"}})
+ * @Template()
+ */
+public function ${1}Action(${2})
+{
+ ${6}
+ return [];
+}`!p
+relpath = os.path.relpath(path)`
+endsnippet
+
+snippet comm "Symfony2 command" b
+<?php
+
+namespace `!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`;
+
+use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * ${3:@author `!v g:snips_author`}
+ */
+class `!p
+snip.rv = re.match(r'.*(?=\.)', fn).group()
+` extends ContainerAwareCommand
+{
+ protected function configure()
+ {
+ $this->setName('${1}')
+ ->setDescription('${2}')
+ ->setDefinition([
+ new InputArgument('', InputArgument::REQUIRED, ''),
+ new InputOption('', null, InputOption::VALUE_NONE, ''),
+ ]);
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ }
+}
+endsnippet
+
+snippet subs "Symfony2 subscriber" b
+<?php
+
+namespace `!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`;
+
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * ${1:@author `!v g:snips_author`}
+ */
+class `!p
+snip.rv = re.match(r'.*(?=\.)', fn).group()
+` implements EventSubscriberInterface
+{
+ public function __construct()
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public static function getSubscribedEvents()
+ {
+ return [];
+ }
+}
+endsnippet
+
+snippet transf "Symfony2 form data transformer" b
+<?php
+
+namespace `!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`;
+
+use Symfony\Component\Form\DataTransformerInterface;
+use Symfony\Component\Form\Exception\TransformationFailedException;
+
+/**
+ * ${3:@author `!v g:snips_author`}
+ */
+class `!p
+snip.rv = re.match(r'.*(?=\.)', fn).group()
+` implements DataTransformerInterface
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function transform(${1})
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function reverseTransform(${2})
+ {
+ }
+}
+endsnippet
+
+snippet ent "Symfony2 doctrine entity" b
+<?php
+
+namespace `!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`;
+
+use Doctrine\ORM\Mapping as ORM;
+
+/**
+ * ${3:@author `!v g:snips_author`}
+ *
+ * @ORM\Entity()
+ * @ORM\Table(name="`!p
+tmp = re.match(r'.*(?=\.)', fn).group()
+tmp = re.sub(r'\B([A-Z])', r'_\1', tmp)
+snip.rv = tmp.lower()
+`")
+ */
+`!p
+m = re.search(r'Abstract', path)
+if m:
+ snip.rv = 'abstract '
+`class `!p
+snip.rv = re.match(r'.*(?=\.)', fn).group()
+`
+{
+ /**
+ * @ORM\Column(type="integer")
+ * @ORM\GeneratedValue
+ * @ORM\Id
+ */
+ private $id;
+}
+endsnippet
+
+snippet form "Symfony2 form type" b
+<?php
+
+namespace `!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`;
+
+use Symfony\Component\Form\AbstractType;
+use Symfony\Component\Form\FormBuilderInterface;
+use Symfony\Component\OptionsResolver\OptionsResolverInterface;
+
+/**
+ * ${2:@author `!v g:snips_author`}
+ */
+class `!p
+snip.rv = re.match(r'.*(?=\.)', fn).group()
+` extends AbstractType
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function buildForm(FormBuilderInterface $builder, array $options)
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function setDefaultOptions(OptionsResolverInterface $resolver)
+ {
+ $resolver->setDefaults();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
+ {
+ return '${1}';
+ }
+}
+endsnippet
+
+snippet ev "Symfony2 event" b
+<?php
+
+namespace `!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`;
+
+use Symfony\Component\EventDispatcher\Event;
+
+/**
+ * ${2:@author `!v g:snips_author`}
+ */
+class `!p
+snip.rv = re.match(r'.*(?=\.)', fn).group()
+` extends Event
+{
+}
+endsnippet
+
+snippet redir "Symfony2 redirect" b
+$this->redirect($this->generateUrl('${1}', ${2}));
+endsnippet
+
+snippet usecontroller "Symfony2 use Symfony\..\Controller" b
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;${1}
+endsnippet
+
+snippet usereauest "Symfony2 use Symfony\..\Request" b
+use Symfony\Component\HttpFoundation\Request;${1}
+endsnippet
+
+snippet useroute "Symfony2 use Sensio\..\Route" b
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;${1}
+endsnippet
+
+snippet useresponse "Symfony2 use Symfony\..\Response" b
+use Symfony\Component\HttpFoundation\Response;${1}
+endsnippet
+
+snippet usefile "Symfony2 use Symfony\..\File" b
+use Symfony\Component\HttpFoundation\File\UploadedFile;${1}
+endsnippet
+
+snippet useassert "Symfony2 use Symfony\..\Constraints as Assert" b
+use Symfony\Component\Validator\Constraints as Assert;${1}
+endsnippet
+
+snippet usetemplate "Symfony2 use Sensio\..\Template" b
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;${1}
+endsnippet
+
+snippet usecache "Symfony2 use Sensio\..\Cache" b
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;${1}
+endsnippet
+
+snippet usemethod "Symfony2 use Sensio\..\Method" b
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;${1}
+endsnippet
+
+snippet usearray "Symfony2 use Doctrine\..\ArrayCollection" b
+use Doctrine\Common\Collections\ArrayCollection;${1}
+endsnippet
+
+snippet useorm "Symfony2 use Doctrine\..\Mapping as ORM" b
+use Doctrine\ORM\Mapping as ORM;${1}
+endsnippet
+
+snippet usesecure "Symfony2 use JMS\..\Secure" b
+use JMS\SecurityExtraBundle\Annotation\Secure;${1}
+endsnippet
+
diff --git a/vim/bundle/vim-snippets/UltiSnips/php.snippets b/vim/bundle/vim-snippets/UltiSnips/php.snippets
new file mode 100644
index 0000000..7ba51c7
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/php.snippets
@@ -0,0 +1,251 @@
+priority -50
+
+## Snippets from SnipMate, taken from
+## https://github.com/scrooloose/snipmate-snippets.git
+
+snippet gm "PHP Class Getter" b
+/**
+ * Getter for $1
+ *
+ * @return ${2:string}
+ */
+public function get${1/\w+\s*/\u$0/}()
+{
+ return $this->$1;
+}
+endsnippet
+
+snippet sm "PHP Class Setter" b
+/**
+ * Setter for $1
+ *
+ * @param ${2:string} $$1
+ * @return ${3:`!p snip.rv=snip.basename`}
+ */
+public function set${1/\w+\s*/\u$0/}(${4:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1)
+{
+ $this->$1 = $$1;
+
+ ${5:return $this;}
+}
+endsnippet
+
+snippet gs "PHP Class Getter Setter" b
+/**
+ * Getter for $1
+ *
+ * @return ${2:string}
+ */
+public function get${1/\w+\s*/\u$0/}()
+{
+ return $this->$1;
+}
+
+/**
+ * Setter for $1
+ *
+ * @param $2 $$1
+ * @return ${3:`!p snip.rv=snip.basename`}
+ */
+public function set${1/\w+\s*/\u$0/}(${4:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1)
+{
+ $this->$1 = $$1;
+
+ ${5:return $this;}
+}
+endsnippet
+
+snippet pub "Public function" b
+/**
+ * ${3:undocumented function}
+ *
+ * @return ${4:void}
+ */
+public function ${1:name}(${2:$param})
+{
+ ${VISUAL}${5:return null;}
+}
+$0
+endsnippet
+
+snippet pro "Protected function" b
+/**
+ * ${3:undocumented function}
+ *
+ * @return ${4:void}
+ */
+protected function ${1:name}(${2:$param})
+{
+ ${VISUAL}${5:return null;}
+}
+$0
+endsnippet
+
+snippet pri "Private function" b
+/**
+ * ${3:undocumented function}
+ *
+ * @return ${4:void}
+ */
+private function ${1:name}(${2:$param})
+{
+ ${VISUAL}${5:return null;}
+}
+$0
+endsnippet
+
+snippet pubs "Public static function" b
+/**
+ * ${3:undocumented function}
+ *
+ * @return ${4:void}
+ */
+public static function ${1:name}(${2:$param})
+{
+ ${VISUAL}${5:return null;}
+}
+$0
+endsnippet
+
+snippet pros "Protected static function" b
+/**
+ * ${3:undocumented function}
+ *
+ * @return ${4:void}
+ */
+protected static function ${1:name}(${2:$param})
+{
+ ${VISUAL}${5:return null;}
+}
+$0
+endsnippet
+
+snippet pris "Private static function" b
+/**
+ * ${3:undocumented function}
+ *
+ * @return ${4:void}
+ */
+private static function ${1:name}(${2:$param})
+{
+ ${VISUAL}${5:return null;}
+}
+$0
+endsnippet
+
+snippet fu "Function snip" b
+function ${1:name}(${2:$param})
+{
+ ${VISUAL}${3:return null;}
+}
+$0
+endsnippet
+
+snippet new "New class instance" b
+$${1:variableName} = new ${2:${1/\w+\s*/\u$0/}}($3);
+$0
+endsnippet
+
+snippet ns "namespace declaration" b
+namespace ${1:`!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`};
+endsnippet
+
+snippet class "Class declaration template" b
+<?php
+
+namespace ${1:`!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`};
+
+/**
+ * Class ${1:`!p snip.rv=snip.basename`}
+ * @author ${2:`!v g:snips_author`}
+ */
+class $1
+{
+}
+endsnippet
+
+snippet interface "Interface declaration template" b
+<?php
+
+namespace ${1:`!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`};
+
+/**
+ * Interface ${1:`!p snip.rv=snip.basename`}
+ * @author ${2:`!v g:snips_author`}
+ */
+interface $1
+{
+ public function ${3:someFunction}();$4
+}
+endsnippet
+
+snippet trait "Trait declaration template" b
+<?php
+
+namespace ${1:`!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`};
+
+/**
+ * Trait ${1:`!p snip.rv=snip.basename`}
+ * @author ${2:`!v g:snips_author`}
+ */
+trait $1
+{
+}
+endsnippet
+
+snippet construct "__construct()" b
+/**
+ * @param $2mixed ${1/, /\n * \@param mixed /g}
+ */
+public function __construct(${1:$dependencies})
+{${1/\$(\w+)(, )*/\n $this->$1 = $$1;/g}
+}
+$0
+endsnippet
+
+# PHPUnit snippets
+snippet testcase "class XYZTest extends \PHPUnit_Framework_TestCase { ... }"
+<?php
+
+namespace `!p
+relpath = os.path.relpath(path)
+m = re.search(r'[A-Z].+(?=/)', relpath)
+if m:
+ snip.rv = m.group().replace('/', '\\')
+`;
+
+/**
+ * @author `!v g:snips_author`
+ */
+class `!p
+snip.rv = re.match(r'.*(?=\.)', fn).group()
+` extends \PHPUnit_Framework_TestCase
+{
+ public function test${1}()
+ {
+ ${0:${VISUAL}}
+ }
+}
+endsnippet
+
+# :vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/proto.snippets b/vim/bundle/vim-snippets/UltiSnips/proto.snippets
new file mode 100644
index 0000000..923be57
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/proto.snippets
@@ -0,0 +1,52 @@
+priority -50
+
+global !p
+from vimsnippets import complete
+
+FIELD_TYPES = [
+ 'double',
+ 'float',
+ 'int32',
+ 'int64',
+ 'uint32',
+ 'uint64',
+ 'sint32',
+ 'sint64',
+ 'fixed32',
+ 'fixed64',
+ 'sfixed32',
+ 'sfixed64',
+ 'bool',
+ 'string',
+ 'bytes']
+endglobal
+
+snippet mess "Proto message" b
+// ${2:TODO(`whoami`): Describe this message.}
+message ${1:Name} {
+ $0
+
+ // Next available id: 1
+}
+endsnippet
+
+snippet reqf "Required field" b
+// ${4:TODO(`whoami`): Describe this field.}
+optional ${1}`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1}; // Required
+endsnippet
+
+snippet optf "Optional field" b
+// ${4:TODO(`whoami`): Describe this field.}
+optional ${1}`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1};
+endsnippet
+
+snippet repf "Repeated field" b
+// ${4:TODO(`whoami`): Describe this field.}
+repeated ${1}`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1};
+endsnippet
+
+snippet enum "Enumeration" b
+// ${2:TODO(`whoami`): Describe this enum.}
+enum ${1:Name} {
+}
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/puppet.snippets b/vim/bundle/vim-snippets/UltiSnips/puppet.snippets
new file mode 100644
index 0000000..1b2cfc5
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/puppet.snippets
@@ -0,0 +1,235 @@
+priority -50
+
+#########################################################################
+# Python helper code #
+#########################################################################
+
+global !p
+import vim
+import os.path
+def get_module_namespace_and_basename():
+ """This function will try to guess the current class or define name you are
+ trying to create. Note that for this to work you should be using the module
+ structure as per the style guide. Examples inputs and it's output
+ * /home/nikolavp/puppet/modules/collectd/manifests/init.pp -> collectd
+ * /home/nikolavp/puppet/modules/collectd/manfistes/mysql.pp -> collectd::mysql
+ """
+ first_time = True
+ current_file_path_without_ext = vim.eval('expand("%:p:r")') or ""
+ if not current_file_path_without_ext:
+ return "name"
+ parts = os.path.split(current_file_path_without_ext)
+ namespace = ''
+ while parts[0] and parts[0] != '/':
+ if parts[1] == 'init' and first_time and not namespace:
+ first_time = False
+ parts = os.path.split(parts[0])
+ continue
+ if parts[1] == 'manifests':
+ return os.path.split(parts[0])[1] + ('::' + namespace).rstrip(':')
+ else:
+ namespace = parts[1] + '::' + namespace
+ parts = os.path.split(parts[0])
+ # couldn't guess the namespace. The user is editing a raw file in no module like the site.pp file
+ return "name"
+endglobal
+
+###############################################################################
+# Puppet Language Constructs #
+# See http://docs.puppetlabs.com/puppet/latest/reference/lang_summary.html #
+###############################################################################
+
+snippet class "Class declaration" b
+class ${1:`!p snip.rv = get_module_namespace_and_basename()`} {
+ ${0:# body}
+}
+endsnippet
+
+snippet define "Definition" b
+define ${1:`!p snip.rv = get_module_namespace_and_basename()`} {
+ ${0:# body}
+}
+endsnippet
+
+#################################################################
+# Puppet Types #
+# See http://docs.puppetlabs.com/references/latest/type.html #
+#################################################################
+
+snippet cron "Cron resource type" b
+cron { '${1:name}':
+ user => ${2:user},
+ command => '${3:command}',
+ minute => ${3:minute},
+ hour => ${4:hour},
+}
+endsnippet
+
+snippet exec "Exec resource type" b
+exec { '${1:command}':
+ refreshonly => true,
+}
+endsnippet
+
+snippet file "File resource type" b
+file { '${1:name}':
+ source => "puppet://${2:path}",
+ mode => ${3:mode},
+}
+endsnippet
+
+snippet File "Defaults for file" b
+File {
+ owner => ${1:username},
+ group => ${2:groupname},
+}
+endsnippet
+
+snippet group "Group resource type" b
+group { '${1:groupname}':
+ ensure => ${3:present},
+ gid => ${2:gid},
+}
+endsnippet
+
+snippet mount "Mount resource type" b
+mount { '${1:path}':
+ device => '${2:/dev}',
+ fstype => '${3:filesystem}',
+ ensure => mounted,
+ options => 'rw,errors=remount-ro',
+}
+endsnippet
+
+snippet package "Package resource type" b
+package { '${1:name}':
+ ensure => ${2:installed},
+}
+endsnippet
+
+snippet user "user resource type" b
+user { '${1:username}':
+ ensure => ${2:present},
+ uid => ${3:uid},
+ gid => ${4:gid},
+ comment => ${5:gecos},
+ home => ${6:homedirectory},
+ managehome => false,
+ require => Group['${7:group'}],
+}
+endsnippet
+
+snippet service "Service resource type" b
+service { '${1:name}':
+ hasstatus => true,
+ enable => true,
+ ensure => running,
+}
+endsnippet
+
+########################################################################
+# Puppet Functions #
+# See http://docs.puppetlabs.com/references/latest/function.html #
+########################################################################
+
+snippet alert "Alert Function" b
+alert("${1:message}")${0}
+endsnippet
+
+snippet crit "Crit Function" b
+crit("${1:message}")${0}
+endsnippet
+
+snippet debug "Debug Function" b
+debug("${1:message}")${0}
+endsnippet
+
+snippet defined "Defined Function" b
+defined(${1:Resource}["${2:name}"])${0}
+endsnippet
+
+snippet emerg "Emerg Function" b
+emerg("${1:message}")${0}
+endsnippet
+
+snippet extlookup "Simple Extlookup" b
+$${1:Variable} = extlookup("${2:Lookup}")${0}
+endsnippet
+
+snippet extlookup "Extlookup with defaults" b
+$${1:Variable} = extlookup("${2:Lookup}", ${3:Default})${0}
+endsnippet
+
+snippet extlookup "Extlookup with defaults and custom data file" b
+$${1:Variable} = extlookup("${2:Lookup}", ${3:Default}, ${4:Data Source})${0}
+endsnippet
+
+snippet fail "Fail Function" b
+fail("${1:message}")${0}
+endsnippet
+
+snippet hiera "Hiera Function" b
+$${1:Variable} = hiera("${2:Lookup}")${0}
+endsnippet
+
+snippet hiera "Hiera with defaults" b
+$${1:Variable} = hiera("${2:Lookup}", ${3:Default})${0}
+endsnippet
+
+snippet hiera "Hiera with defaults and override" b
+$${1:Variable} = hiera("${2:Lookup}", ${3:Default}, ${4:Override})${0}
+endsnippet
+
+snippet hiera_hash "Hiera Hash Function" b
+$${1:Variable} = hiera_hash("${2:Lookup}")${0}
+endsnippet
+
+snippet hiera_hash "Hiera Hash with defaults" b
+$${1:Variable} = hiera_hash("${2:Lookup}", ${3:Default})${0}
+endsnippet
+
+snippet hiera_hash "Hiera Hash with defaults and override" b
+$${1:Variable} = hiera_hash("${2:Lookup}", ${3:Default}, ${4:Override})${0}
+endsnippet
+
+snippet hiera_include "Hiera Include Function" b
+hiera_include("${1:Lookup}")${0}
+endsnippet
+
+snippet include "Include Function" b
+include ${1:classname}${0}
+endsnippet
+
+snippet info "Info Function" b
+info("${1:message}")${0}
+endsnippet
+
+snippet inline_template "Inline Template Function" b
+inline_template("<%= ${1:template} %>")${0}
+endsnippet
+
+snippet notice "Notice Function" b
+notice("${1:message}")${0}
+endsnippet
+
+snippet realize "Realize Function" b
+realize(${1:Resource}["${2:name}"])${0}
+endsnippet
+
+snippet regsubst "Regsubst Function" b
+regsubst($${1:Target}, '${2:regexp}', '${3:replacement}')${0}
+endsnippet
+
+snippet split "Split Function" b
+$${1:Variable} = split($${1:Target}, '${2:regexp}')${0}
+endsnippet
+
+snippet versioncmp "Version Compare Function" b
+$${1:Variable} = versioncmp('${1:version}', '${2:version}')${0}
+endsnippet
+
+snippet warning "Warning Function" b
+warning("${1:message}")${0}
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/python.snippets b/vim/bundle/vim-snippets/UltiSnips/python.snippets
new file mode 100644
index 0000000..fa3ff8b
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/python.snippets
@@ -0,0 +1,707 @@
+priority -50
+
+###########################################################################
+# TEXTMATE SNIPPETS #
+###########################################################################
+
+#! header
+snippet #! "Shebang header for python scripts" b
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+$0
+endsnippet
+
+snippet ifmain "ifmain" b
+if __name__ == `!p snip.rv = get_quoting_style(snip)`__main__`!p snip.rv = get_quoting_style(snip)`:
+ ${1:${VISUAL:main()}}
+endsnippet
+
+snippet with "with" b
+with ${1:expr}`!p snip.rv = " as " if t[2] else ""`${2:var}:
+ ${3:${VISUAL:pass}}
+${0}
+endsnippet
+
+snippet for "for loop" b
+for ${1:item} in ${2:iterable}:
+ ${3:${VISUAL:pass}}
+endsnippet
+
+##########
+# COMMON #
+##########
+
+# The smart def and smart class snippets use a global option called
+# "g:ultisnips_python_style" which, if set to "doxygen" will use doxygen
+# style comments in docstrings.
+
+global !p
+
+NORMAL = 0x1
+DOXYGEN = 0x2
+SPHINX = 0x3
+GOOGLE = 0x4
+NUMPY = 0x5
+JEDI = 0x6
+
+SINGLE_QUOTES = "'"
+DOUBLE_QUOTES = '"'
+
+
+class Arg(object):
+ def __init__(self, arg):
+ self.arg = arg
+ self.name = arg.split('=')[0].strip()
+
+ def __str__(self):
+ return self.name
+
+ def __unicode__(self):
+ return self.name
+
+ def is_kwarg(self):
+ return '=' in self.arg
+
+
+def get_args(arglist):
+ args = [Arg(arg) for arg in arglist.split(',') if arg]
+ args = [arg for arg in args if arg.name != 'self']
+
+ return args
+
+
+def get_quoting_style(snip):
+ style = snip.opt("g:ultisnips_python_quoting_style", "double")
+ if style == 'single':
+ return SINGLE_QUOTES
+ return DOUBLE_QUOTES
+
+def triple_quotes(snip):
+ style = snip.opt("g:ultisnips_python_triple_quoting_style")
+ if not style:
+ return get_quoting_style(snip) * 3
+ return (SINGLE_QUOTES if style == 'single' else DOUBLE_QUOTES) * 3
+
+def triple_quotes_handle_trailing(snip, quoting_style):
+ """
+ Generate triple quoted strings and handle any trailing quote char,
+ which might be there from some autoclose/autopair plugin,
+ i.e. when expanding ``"|"``.
+ """
+ if not snip.c:
+ # Do this only once, otherwise the following error would happen:
+ # RuntimeError: The snippets content did not converge: …
+ _, col = vim.current.window.cursor
+ line = vim.current.line
+
+ # Handle already existing quote chars after the trigger.
+ _ret = quoting_style * 3
+ while True:
+ try:
+ nextc = line[col]
+ except IndexError:
+ break
+ if nextc == quoting_style and len(_ret):
+ _ret = _ret[1:]
+ col = col+1
+ else:
+ break
+ snip.rv = _ret
+ else:
+ snip.rv = snip.c
+
+def get_style(snip):
+ style = snip.opt("g:ultisnips_python_style", "normal")
+
+ if style == "doxygen": return DOXYGEN
+ elif style == "sphinx": return SPHINX
+ elif style == "google": return GOOGLE
+ elif style == "numpy": return NUMPY
+ elif style == "jedi": return JEDI
+ else: return NORMAL
+
+
+def format_arg(arg, style):
+ if style == DOXYGEN:
+ return "@param %s TODO" % arg
+ elif style == SPHINX:
+ return ":param %s: TODO" % arg
+ elif style == NORMAL:
+ return ":%s: TODO" % arg
+ elif style == GOOGLE:
+ return "%s (TODO): TODO" % arg
+ elif style == JEDI:
+ return ":type %s: TODO" % arg
+ elif style == NUMPY:
+ return "%s : TODO" % arg
+
+
+def format_return(style):
+ if style == DOXYGEN:
+ return "@return: TODO"
+ elif style in (NORMAL, SPHINX, JEDI):
+ return ":returns: TODO"
+ elif style == GOOGLE:
+ return "Returns: TODO"
+
+
+def write_docstring_args(args, snip):
+ if not args:
+ snip.rv += ' {0}'.format(triple_quotes(snip))
+ return
+
+ snip.rv += '\n' + snip.mkline('', indent='')
+
+ style = get_style(snip)
+
+ if style == GOOGLE:
+ write_google_docstring_args(args, snip)
+ elif style == NUMPY:
+ write_numpy_docstring_args(args, snip)
+ else:
+ for arg in args:
+ snip += format_arg(arg, style)
+
+
+def write_google_docstring_args(args, snip):
+ kwargs = [arg for arg in args if arg.is_kwarg()]
+ args = [arg for arg in args if not arg.is_kwarg()]
+
+ if args:
+ snip += "Args:"
+ snip.shift()
+ for arg in args:
+ snip += format_arg(arg, GOOGLE)
+ snip.unshift()
+ snip.rv += '\n' + snip.mkline('', indent='')
+
+ if kwargs:
+ snip += "Kwargs:"
+ snip.shift()
+ for kwarg in kwargs:
+ snip += format_arg(kwarg, GOOGLE)
+ snip.unshift()
+ snip.rv += '\n' + snip.mkline('', indent='')
+
+
+def write_numpy_docstring_args(args, snip):
+ if args:
+ snip += "Parameters"
+ snip += "----------"
+
+ kwargs = [arg for arg in args if arg.is_kwarg()]
+ args = [arg for arg in args if not arg.is_kwarg()]
+
+ if args:
+ for arg in args:
+ snip += format_arg(arg, NUMPY)
+ if kwargs:
+ for kwarg in kwargs:
+ snip += format_arg(kwarg, NUMPY) + ', optional'
+ snip.rv += '\n' + snip.mkline('', indent='')
+
+
+def write_init_body(args, parents, snip):
+ parents = [p.strip() for p in parents.split(",")]
+ parents = [p for p in parents if p != 'object']
+
+ for p in parents:
+ snip += p + ".__init__(self)"
+
+ if parents:
+ snip.rv += '\n' + snip.mkline('', indent='')
+
+ for arg in args:
+ snip += "self._%s = %s" % (arg, arg)
+
+
+def write_slots_args(args, snip):
+ args = ['"_%s"' % arg for arg in args]
+ snip += '__slots__ = (%s,)' % ', '.join(args)
+
+
+def write_function_docstring(t, snip):
+ """
+ Writes a function docstring with the current style.
+
+ :param t: The values of the placeholders
+ :param snip: UltiSnips.TextObjects.SnippetUtil object instance
+ """
+ snip.rv = ""
+ snip >> 1
+
+ args = get_args(t[2])
+ if args:
+ write_docstring_args(args, snip)
+
+ style = get_style(snip)
+
+ if style == NUMPY:
+ snip += 'Returns'
+ snip += '-------'
+ snip += 'TODO'
+ else:
+ snip += format_return(style)
+ snip.rv += '\n' + snip.mkline('', indent='')
+ snip += triple_quotes(snip)
+
+def get_dir_and_file_name(snip):
+ return os.getcwd().split(os.sep)[-1] + '.' + snip.basename
+
+endglobal
+
+########################################
+# Class & Special Method Name Snippets #
+########################################
+
+snippet class "class with docstrings" b
+class ${1:MyClass}(${2:object}):
+
+ `!p snip.rv = triple_quotes(snip)`${3:Docstring for $1. }`!p snip.rv = triple_quotes(snip)`
+
+ def __init__(self$4):
+ `!p snip.rv = triple_quotes(snip)`${5:TODO: to be defined1.}`!p
+snip.rv = ""
+snip >> 2
+
+args = get_args(t[4])
+
+write_docstring_args(args, snip)
+if args:
+ snip.rv += '\n' + snip.mkline('', indent='')
+ snip += '{0}'.format(triple_quotes(snip))
+
+write_init_body(args, t[2], snip)
+`
+ $0
+endsnippet
+
+
+snippet slotclass "class with slots and docstrings" b
+class ${1:MyClass}(${2:object}):
+
+ `!p snip.rv = triple_quotes(snip)`${3:Docstring for $1. }`!p snip.rv = triple_quotes(snip)`
+`!p
+snip >> 1
+args = get_args(t[4])
+write_slots_args(args, snip)
+`
+
+ def __init__(self$4):
+ `!p snip.rv = triple_quotes(snip)`${5:TODO: to be defined.}`!p
+snip.rv = ""
+snip >> 2
+
+args = get_args(t[4])
+
+write_docstring_args(args, snip)
+if args:
+ snip.rv += '\n' + snip.mkline('', indent='')
+ snip += triple_quotes(snip)
+
+write_init_body(args, t[2], snip)
+`
+ $0
+endsnippet
+
+
+snippet contain "methods for emulating a container type" b
+def __len__(self):
+ ${1:pass}
+
+def __getitem__(self, key):
+ ${2:pass}
+
+def __setitem__(self, key, value):
+ ${3:pass}
+
+def __delitem__(self, key):
+ ${4:pass}
+
+def __iter__(self):
+ ${5:pass}
+
+def __reversed__(self):
+ ${6:pass}
+
+def __contains__(self, item):
+ ${7:pass}
+endsnippet
+
+
+snippet context "context manager methods" b
+def __enter__(self):
+ ${1:pass}
+
+def __exit__(self, exc_type, exc_value, traceback):
+ ${2:pass}
+endsnippet
+
+
+snippet attr "methods for customizing attribute access" b
+def __getattr__(self, name):
+ ${1:pass}
+
+def __setattr__(self, name, value):
+ ${2:pass}
+
+def __delattr__(self, name):
+ ${3:pass}
+endsnippet
+
+
+snippet desc "methods implementing descriptors" b
+def __get__(self, instance, owner):
+ ${1:pass}
+
+def __set__(self, instance, value):
+ ${2:pass}
+
+def __delete__(self, instance):
+ ${3:pass}
+endsnippet
+
+
+snippet cmp "methods implementing rich comparison"
+def __eq__(self, other):
+ ${1:pass}
+
+def __ne__(self, other):
+ ${2:pass}
+
+def __lt__(self, other):
+ ${3:pass}
+
+def __le__(self, other):
+ ${4:pass}
+
+def __gt__(self, other):
+ ${5:pass}
+
+def __ge__(self, other):
+ ${6:pass}
+
+def __cmp__(self, other):
+ ${7:pass}
+endsnippet
+
+
+snippet repr "methods implementing string representation"
+def __repr__(self):
+ ${1:pass}
+
+def __str__(self):
+ ${2:pass}
+
+def __unicode__(self):
+ ${3:pass}
+endsnippet
+
+
+# note: reflected operands and augmented arithmeitc assignements have been
+# intentionally ommited to reduce verbosity.
+snippet numeric "methods for emulating a numeric type" b
+def __add__(self, other):
+ ${1:pass}
+
+def __sub__(self, other):
+ ${2:pass}
+
+def __mul__(self, other):
+ ${3:pass}
+
+def __div__(self, other):
+ ${4:pass}
+
+def __truediv__(self, other):
+ ${5:pass}
+
+def __floordiv__(self, other):
+ ${6:pass}
+
+
+def __mod__(self, other):
+ ${7:pass}
+
+def __divmod__(self, other):
+ ${8:pass}
+
+def __pow__(self, other):
+ ${9:pass}
+
+
+def __lshift__(self, other):
+ ${10:pass}
+
+def __rshift__(self, other):
+ ${11:pass}
+
+def __and__(self, other):
+ ${12:pass}
+
+def __xor__(self, other):
+ ${13:pass}
+
+def __or__(self, other):
+ ${14:pass}
+
+
+def __neg__(self):
+ ${15:pass}
+
+def __pos__(self):
+ ${16:pass}
+
+def __abs__(self):
+ ${17:pass}
+
+def __invert__(self):
+ ${18:pass}
+
+
+def __complex__(self):
+ ${19:pass}
+
+def __int__(self):
+ ${20:pass}
+
+def __long__(self):
+ ${21:pass}
+
+def __float__(self):
+ ${22:pass}
+
+
+def __oct__(self):
+ ${22:pass}
+
+def __hex__(self):
+ ${23:pass}
+
+
+def __index__(self):
+ ${24:pass}
+
+def __coerce__(self, other):
+ ${25:pass}
+endsnippet
+
+snippet def "function with docstrings" b
+def ${1:function}(`!p
+if snip.indent:
+ snip.rv = 'self' + (", " if len(t[2]) else "")`${2:arg1}):
+ `!p snip.rv = triple_quotes(snip)`${4:TODO: Docstring for $1.}`!p
+write_function_docstring(t, snip) `
+ ${5:${VISUAL:pass}}
+endsnippet
+
+
+snippet defc "class method with docstrings" b
+@classmethod
+def ${1:function}(`!p
+if snip.indent:
+ snip.rv = 'cls' + (", " if len(t[2]) else "")`${2:arg1}):
+ `!p snip.rv = triple_quotes(snip)`${4:TODO: Docstring for $1.}`!p
+write_function_docstring(t, snip) `
+ ${5:${VISUAL:pass}}
+endsnippet
+
+
+snippet defs "static method with docstrings" b
+@staticmethod
+def ${1:function}(${2:arg1}):
+ `!p snip.rv = triple_quotes(snip)`${4:TODO: Docstring for $1.}`!p
+write_function_docstring(t, snip) `
+ ${5:${VISUAL:pass}}
+endsnippet
+
+
+# doesn't expand when there is a word in front
+snippet /(^|(?<=\W))\./ "self." r
+self.
+endsnippet
+
+snippet from "from module import name" b
+from ${1:module} import ${2:Stuff}
+endsnippet
+
+
+##############
+# PROPERTIES #
+##############
+snippet roprop "Read Only Property" b
+@property
+def ${1:name}(self):
+ ${2:return self._$1}$0
+endsnippet
+
+snippet rwprop "Read write property" b
+def ${1:name}():
+ `!p snip.rv = triple_quotes(snip) if t[2] else ''
+`${2:TODO: Docstring for $1.}`!p
+if t[2]:
+ snip >> 1
+
+ style = get_style(snip)
+ snip.rv += '\n' + snip.mkline('', indent='')
+ snip += format_return(style)
+ snip.rv += '\n' + snip.mkline('', indent='')
+ snip += triple_quotes(snip)
+else:
+ snip.rv = ""`
+ def fget(self):
+ return self._$1$0
+
+ def fset(self, value):
+ self._$1 = value
+ return locals()
+
+$1 = property(**$1(), doc=$1.__doc__)
+endsnippet
+
+
+####################
+# If / Else / Elif #
+####################
+snippet if "If" b
+if ${1:condition}:
+ ${2:${VISUAL:pass}}
+endsnippet
+
+snippet ife "If / Else" b
+if ${1:condition}:
+ ${2:${VISUAL:pass}}
+else:
+ ${3:pass}
+endsnippet
+
+snippet ifee "If / Elif / Else" b
+if ${1:condition}:
+ ${2:${VISUAL:pass}}
+elif ${3:condition}:
+ ${4:pass}
+else:
+ ${5:pass}
+endsnippet
+
+
+##########################
+# Try / Except / Finally #
+##########################
+snippet try "Try / Except" b
+try:
+ ${1:${VISUAL:pass}}
+except ${2:Exception} as ${3:e}:
+ ${4:raise $3}
+endsnippet
+
+snippet trye "Try / Except / Else" b
+try:
+ ${1:${VISUAL:pass}}
+except ${2:Exception} as ${3:e}:
+ ${4:raise $3}
+else:
+ ${5:pass}
+endsnippet
+
+snippet tryf "Try / Except / Finally" b
+try:
+ ${1:${VISUAL:pass}}
+except ${2:Exception} as ${3:e}:
+ ${4:raise $3}
+finally:
+ ${5:pass}
+endsnippet
+
+snippet tryef "Try / Except / Else / Finally" b
+try:
+ ${1:${VISUAL:pass}}
+except${2: ${3:Exception} as ${4:e}}:
+ ${5:raise}
+else:
+ ${6:pass}
+finally:
+ ${7:pass}
+endsnippet
+
+
+######################
+# Assertions & Tests #
+######################
+
+snippet ae "Assert equal" b
+self.assertEqual(${1:${VISUAL:first}},${2:second})
+endsnippet
+
+snippet at "Assert True" b
+self.assertTrue(${1:${VISUAL:expression}})
+endsnippet
+
+snippet af "Assert False" b
+self.assertFalse(${1:${VISUAL:expression}})
+endsnippet
+
+snippet aae "Assert almost equal" b
+self.assertAlmostEqual(${1:${VISUAL:first}},${2:second})
+endsnippet
+
+snippet ar "Assert raises" b
+self.assertRaises(${1:exception}, ${2:${VISUAL:func}}${3/.+/, /}${3:arguments})
+endsnippet
+
+snippet an "Assert is None" b
+self.assertIsNone(${1:${VISUAL:expression}})
+endsnippet
+
+snippet ann "Assert is not None" b
+self.assertIsNotNone(${1:${VISUAL:expression}})
+endsnippet
+
+snippet testcase "pyunit testcase" b
+class Test${1:Class}(${2:unittest.TestCase}):
+
+ `!p snip.rv = triple_quotes(snip)`${3:Test case docstring.}`!p snip.rv = triple_quotes(snip)`
+
+ def setUp(self):
+ ${4:pass}
+
+ def tearDown(self):
+ ${5:pass}
+
+ def test_${6:name}(self):
+ ${7:${VISUAL:pass}}
+endsnippet
+
+snippet " "triple quoted string (double quotes)" b
+"""
+${1:${VISUAL:doc}}
+`!p triple_quotes_handle_trailing(snip, '"')`
+endsnippet
+
+snippet ' "triple quoted string (single quotes)" b
+'''
+${1:${VISUAL:doc}}
+`!p triple_quotes_handle_trailing(snip, "'")`
+endsnippet
+
+snippet doc "doc block (triple quotes)"
+`!p snip.rv = triple_quotes(snip)`
+${1:${VISUAL:doc}}
+`!p snip.rv = triple_quotes(snip)`
+endsnippet
+
+snippet pmdoc "pocoo style module doc string" b
+# -*- coding: utf-8 -*-
+"""
+ `!p snip.rv = get_dir_and_file_name(snip)`
+ `!p snip.rv = '~' * len(get_dir_and_file_name(snip))`
+
+ ${1:DESCRIPTION}
+
+ :copyright: (c) `date +%Y` by ${2:YOUR_NAME}.
+ :license: ${3:LICENSE_NAME}, see LICENSE for more details.
+"""
+$0
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/r.snippets b/vim/bundle/vim-snippets/UltiSnips/r.snippets
new file mode 100644
index 0000000..02c4c25
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/r.snippets
@@ -0,0 +1,178 @@
+priority -50
+
+global !p
+import os
+from vimsnippets import complete
+
+FIELD_TYPES = [
+'character',
+'data.frame',
+'integer',
+'list',
+'logical',
+'matrix',
+'numeric',
+'vector']
+endglobal
+
+snippet #! "Hashbang for Rscript (#!)" b
+#!/usr/bin/env Rscript
+endsnippet
+
+snippet setwd "Set workingdir" b
+setwd("${1:`!p snip.rv = os.getcwd()`}")
+endsnippet
+
+snippet as "Apply type on variable" w
+as.$1`!p snip.rv = complete(t[1], FIELD_TYPES)`(${2}${VISUAL})
+endsnippet
+
+snippet is "Test type on variable" w
+is.$1`!p snip.rv = complete(t[1], FIELD_TYPES)`(${2}${VISUAL})
+endsnippet
+
+snippet dl "Download and install a package" b
+download.file("${1:${VISUAL:url to package}}", destfile = "${2:${1/.*\/(\S*)$/(?1:$1)/ga}}")
+install.packages("$2", type = "source", repos = NULL)
+library("${3:${2/^(\w+)_.*$/(?1:$1)/ga}}")
+endsnippet
+
+snippet lib "Import a library"
+library(${0:package})
+endsnippet
+
+snippet req "Require a file"
+require(${0:package})
+endsnippet
+
+snippet source "Source a file"
+source('${0:file}')
+endsnippet
+
+snippet if "If statement"
+if (${1}) {
+ ${0}
+}
+endsnippet
+
+snippet eif "Else-If statement"
+else if (${1}) {
+ ${0}
+}
+endsnippet
+
+snippet el "Else statement"
+else {
+ ${0}
+}
+endsnippet
+
+snippet ife "if .. else"
+if (${1}) {
+ ${2}
+} else {
+ ${3}
+}
+endsnippet
+
+snippet wh "while loop"
+while(${1}) {
+ ${2}
+}
+endsnippet
+
+snippet for "for loop"
+for (${1:item} in ${2:list}) {
+ ${3}
+}
+endsnippet
+
+snippet fun "Function definition"
+${1:name} <- function (${2}) {
+ ${0}
+}
+endsnippet
+
+snippet ret "Return call"
+return(${0})
+endsnippet
+
+snippet df "Data frame"
+${1:name}[${2:rows}, ${0:cols}]
+endsnippet
+
+snippet c "c function"
+c(${0:items})
+endsnippet
+
+snippet li "list function"
+list(${0:items})
+endsnippet
+
+snippet mat "matrix function"
+matrix(${1:data}, nrow = ${2:rows}, ncol = ${0:cols})
+endsnippet
+
+snippet apply "apply function"
+apply(${1:array}, ${2:margin}, ${0:function})
+endsnippet
+
+snippet lapply "lapply function"
+lapply(${1:list}, ${0:function})
+endsnippet
+
+snippet sapply "sapply function"
+sapply(${1:list}, ${0:function})
+endsnippet
+
+snippet vapply "vapply function"
+vapply(${1:list}, ${2:function}, ${0:type})
+endsnippet
+
+snippet mapply "mapply function"
+mapply(${1:function}, ${0:...})
+endsnippet
+
+snippet tapply "tapply function"
+tapply(${1:vector}, ${2:index}, ${0:function})
+endsnippet
+
+snippet rapply "rapply function"
+rapply(${1:list}, ${0:function})
+endsnippet
+
+snippet pl "Plot function"
+plot(${1:x}, ${0:y})
+endsnippet
+
+snippet ggp "ggplot2 plot"
+ggplot(${1:data}, aes(${0:aesthetics}))
+endsnippet
+
+snippet fis "Fisher test"
+fisher.test(${1:x}, ${0:y})
+endsnippet
+
+snippet chi "Chi Squared test"
+chisq.test(${1:x}, ${0:y})
+endsnippet
+
+snippet tt "t-test"
+t.test(${1:x}, ${0:y})
+endsnippet
+
+snippet wil "Wilcox test"
+wilcox.test(${1:x}, ${0:y})
+endsnippet
+
+snippet cor "Correlation test"
+cor.test(${1:x}, ${0:y})
+endsnippet
+
+snippet fte "FTE test"
+var.test(${1:x}, ${0:y})
+endsnippet
+
+snippet kvt "KV test"
+kv.test(${1:x}, ${0:y})
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/rails.snippets b/vim/bundle/vim-snippets/UltiSnips/rails.snippets
new file mode 100644
index 0000000..e7b2757
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/rails.snippets
@@ -0,0 +1,894 @@
+priority -50
+
+snippet anaf "accepts_nested_attributes_for"
+accepts_nested_attributes_for :${1:association_name}${2:${3:, :allow_destroy => true}${4:, :reject_if => proc \{ |obj| ${5:obj.blank?} \}}}
+
+endsnippet
+
+snippet tcbi "Create binary column"
+t.binary :${1:title}${2:, :limit => ${3:2}.megabytes}
+$0
+endsnippet
+
+snippet tcb "Create boolean column"
+t.boolean :${1:title}
+$0
+endsnippet
+
+snippet clac "Create controller class"
+class ${1:Model}Controller < ApplicationController
+ before_filter :find_${2:model}
+
+ $0
+
+ private
+ def find_${2}
+ @$2 = ${3:$1}.find(params[:id]) if params[:id]
+ end
+end
+endsnippet
+
+snippet tcda "Create date column"
+t.date :${1:title}
+$0
+endsnippet
+
+snippet tcdt "Create datetime column"
+t.datetime :${1:title}
+$0
+endsnippet
+
+snippet tcd "Create decimal column"
+t.decimal :${1:title}${2:${3:, :precision => ${4:10}}${5:, :scale => ${6:2}}}
+$0
+endsnippet
+
+snippet tcf "Create float column"
+t.float :${1:title}
+$0
+endsnippet
+
+snippet clact "Create functional test class"
+require 'test_helper'
+
+class ${1:Model}ControllerTest < ActionController::TestCase
+ test$0
+end
+
+endsnippet
+
+snippet tci "Create integer column"
+t.integer :${1:title}
+$0
+endsnippet
+
+snippet tcl "Create lock_version column"
+t.integer :lock_version, :null => false, :default => 0
+$0
+endsnippet
+
+# FIXME: handling literal bracket pair inside of nested tab groups?
+snippet tcr "Create references column"
+t.references :${1:taggable}${2:, :polymorphic => ${3:{ :default => '${4:Photo}' \}}}
+$0
+endsnippet
+
+snippet resources "Create resources controller class"
+class ${1:Model}sController < ApplicationController
+ before_filter :find_${1/./\l$0/}, :only => [:show, :edit, :update, :destroy]
+
+ # GET /${1/./\l$0/}s
+ # GET /${1/./\l$0/}s.xml
+ def index
+ @${1/./\l$0/}s = ${1:Model}.all
+
+ respond_to do |wants|
+ wants.html # index.html.erb
+ wants.xml { render :xml => @${1/./\l$0/}s }
+ end
+ end
+
+ # GET /${1/./\l$0/}s/1
+ # GET /${1/./\l$0/}s/1.xml
+ def show
+ respond_to do |wants|
+ wants.html # show.html.erb
+ wants.xml { render :xml => @${1/./\l$0/} }
+ end
+ end
+
+ # GET /${1/./\l$0/}s/new
+ # GET /${1/./\l$0/}s/new.xml
+ def new
+ @${1/./\l$0/} = ${1:Model}.new
+
+ respond_to do |wants|
+ wants.html # new.html.erb
+ wants.xml { render :xml => @${1/./\l$0/} }
+ end
+ end
+
+ # GET /${1/./\l$0/}s/1/edit
+ def edit
+ end
+
+ # POST /${1/./\l$0/}s
+ # POST /${1/./\l$0/}s.xml
+ def create
+ @${1/./\l$0/} = ${1:Model}.new(params[:${1/./\l$0/}])
+
+ respond_to do |wants|
+ if @${1/./\l$0/}.save
+ flash[:notice] = '${1:Model} was successfully created.'
+ wants.html { redirect_to(@${1/./\l$0/}) }
+ wants.xml { render :xml => @${1/./\l$0/}, :status => :created, :location => @${1/./\l$0/} }
+ else
+ wants.html { render :action => "new" }
+ wants.xml { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /${1/./\l$0/}s/1
+ # PUT /${1/./\l$0/}s/1.xml
+ def update
+ respond_to do |wants|
+ if @${1/./\l$0/}.update(params[:${1/./\l$0/}])
+ flash[:notice] = '${1:Model} was successfully updated.'
+ wants.html { redirect_to(@${1/./\l$0/}) }
+ wants.xml { head :ok }
+ else
+ wants.html { render :action => "edit" }
+ wants.xml { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /${1/./\l$0/}s/1
+ # DELETE /${1/./\l$0/}s/1.xml
+ def destroy
+ @${1/./\l$0/}.destroy
+
+ respond_to do |wants|
+ wants.html { redirect_to(${1/./\l$0/}s_url) }
+ wants.xml { head :ok }
+ end
+ end
+
+ private
+ def find_${1/./\l$0/}
+ @${1/./\l$0/} = ${1:Model}.find(params[:id])
+ end
+
+end
+
+endsnippet
+
+snippet tcs "Create string column"
+t.string :${1:title}
+$0
+endsnippet
+
+snippet tct "Create text column"
+t.text :${1:title}
+$0
+endsnippet
+
+snippet tcti "Create time column"
+t.time :${1:title}
+$0
+endsnippet
+
+snippet tcts "Create timestamp column"
+t.timestamp :${1:title}
+$0
+endsnippet
+
+snippet tctss "Create timestamps columns"
+t.timestamps
+$0
+endsnippet
+
+snippet mcol "Migration Create Column (mcc)"
+t.column ${1:title}, :${2:string}
+$0
+endsnippet
+
+snippet mccc "Migration Create Column Continue (mccc)"
+t.column ${1:title}, :${2:string}
+mccc$0
+endsnippet
+
+snippet mtab "Migration Drop Create Table (mdct)"
+drop_table :${1:table}${2: [press tab twice to generate create_table]}
+endsnippet
+
+snippet mcol "Migration Remove and Add Column (mrac)"
+remove_column :${1:table}, :${2:column}${3: [press tab twice to generate add_column]}
+endsnippet
+
+snippet rdb "RAILS_DEFAULT_LOGGER.debug (rdb)"
+RAILS_DEFAULT_LOGGER.debug "${1:message}"$0
+endsnippet
+
+snippet tre "Table column(s) rename"
+t.rename(:${1:old_column_name}, :${2:new_column_name})
+$0
+endsnippet
+
+snippet art "Test Assert Redirected To (art)"
+assert_redirected_to ${2::action => "${1:index}"}
+endsnippet
+
+snippet asre "Test Assert Response (are)"
+assert_response :${1:success}, @response.body$0
+endsnippet
+
+snippet aftc "after_create"
+after_create $0
+endsnippet
+
+snippet aftd "after_destroy"
+after_destroy $0
+endsnippet
+
+snippet afts "after_save"
+after_save $0
+endsnippet
+
+snippet aftu "after_update"
+after_update $0
+endsnippet
+
+snippet aftv "after_validation"
+after_validation $0
+endsnippet
+
+snippet aftvoc "after_validation_on_create"
+after_validation_on_create $0
+endsnippet
+
+snippet aftvou "after_validation_on_update"
+after_validation_on_update $0
+endsnippet
+
+snippet asg "assert(var = assigns(:var))"
+assert(${1:var} = assigns(:${1}), "Cannot find @${1}")
+$0
+endsnippet
+
+snippet asd "assert_difference"
+assert_difference "${1:Model}.${2:count}", ${3:1} do
+ $0
+end
+endsnippet
+
+snippet asnd "assert_no_difference"
+assert_no_difference "${1:Model}.${2:count}" do
+ $0
+end
+endsnippet
+
+snippet artnpp "assert_redirected_to (nested path plural)"
+assert_redirected_to ${10:${2:parent}_${3:child}_path(${4:@}${5:${2}})}
+endsnippet
+
+snippet artnp "assert_redirected_to (nested path)"
+assert_redirected_to ${2:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})}
+endsnippet
+
+snippet artpp "assert_redirected_to (path plural)"
+assert_redirected_to ${10:${2:model}s_path}
+endsnippet
+
+snippet artp "assert_redirected_to (path)"
+assert_redirected_to ${2:${12:model}_path(${13:@}${14:${12}})}
+endsnippet
+
+snippet asrj "assert_rjs"
+assert_rjs :${1:replace}, ${2:"${3:dom id}"}
+endsnippet
+
+snippet ass "assert_select"
+assert_select '${1:path}'${2:, :${3:text} => ${4:'${5:inner_html}'}}${6: do
+ $0
+end}
+endsnippet
+
+snippet befc "before_create"
+before_create $0
+endsnippet
+
+snippet befd "before_destroy"
+before_destroy $0
+endsnippet
+
+snippet befs "before_save"
+before_save $0
+endsnippet
+
+snippet befu "before_update"
+before_update $0
+endsnippet
+
+snippet befv "before_validation"
+before_validation $0
+endsnippet
+
+snippet befvoc "before_validation_on_create"
+before_validation_on_create $0
+endsnippet
+
+snippet befvou "before_validation_on_update"
+before_validation_on_update
+endsnippet
+
+snippet bt "belongs_to (bt)"
+belongs_to :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:${1}_id}"}
+endsnippet
+
+snippet crw "cattr_accessor"
+cattr_accessor :${0:attr_names}
+endsnippet
+
+snippet defcreate "def create - resource"
+def create
+ @${1:model} = ${2:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}.new(params[:$1])
+ $0
+ respond_to do |wants|
+ if @$1.save
+ flash[:notice] = '$2 was successfully created.'
+ wants.html { redirect_to(@$1) }
+ wants.xml { render :xml => @$1, :status => :created, :location => @$1 }
+ else
+ wants.html { render :action => "new" }
+ wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity }
+ end
+ end
+end
+
+endsnippet
+
+snippet test "test do..end"
+test "${1:something interesting}" do
+ $0
+end
+endsnippet
+
+snippet deftg "def get request"
+def test_should_get_${1:action}
+ ${2:@${3:model} = ${4:$3s}(:${5:fixture_name})
+ }get :${1}${6:, :id => @$3.to_param}
+ assert_response :success
+ $0
+end
+endsnippet
+
+snippet deftp "def post request"
+def test_should_post_${1:action}
+ ${3:@$2 = ${4:$2s}(:${5:fixture_name})
+ }post :${1}${6:, :id => @$2.to_param}, :${2:model} => { $0 }
+ assert_response :redirect
+
+end
+endsnippet
+
+snippet fina "find(:all)"
+find(:all${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]})
+endsnippet
+
+snippet finf "find(:first)"
+find(:first${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]})
+endsnippet
+
+snippet fini "find(id)"
+find(${1:id})
+endsnippet
+
+snippet fine "find_each"
+find_each(${1::conditions => {:${2:field} => ${3:true}\}}) do |${4:${TM_CURRENT_WORD/(\w+)\./\L$1/g}}|
+ $0
+end
+endsnippet
+
+snippet finb "find_in_batches"
+find_in_batches(${1::conditions => {:${2:field} => ${3:true}\}}) do |${4:${TM_CURRENT_WORD/(\w+)\./\L$1/g}}s|
+ $4s.each do |$4|
+ $0
+ end
+end
+endsnippet
+
+snippet habtm "has_and_belongs_to_many (habtm)"
+has_and_belongs_to_many :${1:object}${2:, :join_table => "${3:table_name}", :foreign_key => "${4:${1}_id}"}
+endsnippet
+
+snippet hm "has_many (hm)"
+has_many :${1:object}s${2:, :class_name => "${1}", :foreign_key => "${4:reference}_id"}
+endsnippet
+
+snippet hmt "has_many (through)"
+has_many :${1:objects}, :through => :${2:join_association}${3:, :source => :${4:${2}_table_foreign_key_to_${1}_table}}
+endsnippet
+
+snippet hmd "has_many :dependent => :destroy"
+has_many :${1:object}s${2:, :class_name => "${1}", :foreign_key => "${4:reference}_id"}, :dependent => :destroy$0
+endsnippet
+
+snippet ho "has_one (ho)"
+has_one :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:${1}_id}"}
+endsnippet
+
+snippet logd "logger.debug"
+${1:Rails.}logger.debug { "${1:message}" }$0
+endsnippet
+
+snippet loge "logger.error"
+logger.error { "${1:message}" }$0
+endsnippet
+
+snippet logf "logger.fatal"
+logger.fatal { "${1:message}" }$0
+endsnippet
+
+snippet logi "logger.info"
+logger.info { "${1:message}" }$0
+endsnippet
+
+snippet logw "logger.warn"
+logger.warn { "${1:message}" }$0
+endsnippet
+
+snippet mp "map(&:sym_proc)"
+map(&:${1:id})
+endsnippet
+
+snippet mapca "map.catch_all"
+${1:map}.catch_all "*${2:anything}", :controller => "${3:default}", :action => "${4:error}"
+
+endsnippet
+
+snippet map "map.named_route"
+${1:map}.${2:connect} '${3::controller/:action/:id}'
+endsnippet
+
+snippet mapr "map.resource"
+${1:map}.resource :${2:resource}${10: do |${11:$2}|
+ $0
+end}
+endsnippet
+
+snippet maprs "map.resources"
+${1:map}.resources :${2:resource}${10: do |${11:$2}|
+ $0
+end}
+endsnippet
+
+snippet mapwo "map.with_options"
+${1:map}.with_options :${2:controller} => '${3:thing}' do |${4:$3}|
+ $0
+end
+
+endsnippet
+
+snippet mrw "mattr_accessor"
+mattr_accessor :${0:attr_names}
+endsnippet
+
+snippet ncl "named_scope lambda"
+named_scope :name, lambda { |${1:param}| { :conditions => ${3:['${4:${5:field} = ?}', ${6:$1}]} } }
+
+endsnippet
+
+snippet nc "named_scope"
+named_scope :name${1:, :joins => :${2:table}}, :conditions => ${3:['${4:${5:field} = ?}', ${6:true}]}
+
+endsnippet
+
+snippet dscope "default_scope"
+default_scope ${1:order(${2:'${3:created_at DESC}'})}
+endsnippet
+
+snippet flash "flash[...]"
+flash[:${1:notice}] = "${2:Successfully created...}"$0
+endsnippet
+
+snippet rea "redirect_to (action)"
+redirect_to :action => "${1:index}"
+endsnippet
+
+snippet reai "redirect_to (action, id)"
+redirect_to :action => "${1:show}", :id => ${0:@item}
+endsnippet
+
+snippet rec "redirect_to (controller)"
+redirect_to :controller => "${1:items}"
+endsnippet
+
+snippet reca "redirect_to (controller, action)"
+redirect_to :controller => "${1:items}", :action => "${2:list}"
+endsnippet
+
+snippet recai "redirect_to (controller, action, id)"
+redirect_to :controller => "${1:items}", :action => "${2:show}", :id => ${0:@item}
+endsnippet
+
+snippet renpp "redirect_to (nested path plural)"
+redirect_to(${2:${10:parent}_${11:child}_path(${12:@}${13:${10}})})
+endsnippet
+
+snippet renp "redirect_to (nested path)"
+redirect_to(${2:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})})
+endsnippet
+
+snippet repp "redirect_to (path plural)"
+redirect_to(${2:${10:model}s_path})
+endsnippet
+
+snippet rep "redirect_to (path)"
+redirect_to(${2:${12:model}_path(${13:@}${14:${12}})})
+endsnippet
+
+snippet reb "redirect_to :back"
+redirect_to :back
+endsnippet
+
+snippet ra "render (action)... (ra)"
+render :action => "${1:action}"
+endsnippet
+
+snippet ral "render (action,layout) (ral)"
+render :action => "${1:action}", :layout => "${2:layoutname}"
+endsnippet
+
+snippet rf "render (file) (rf)"
+render :file => "${1:filepath}"
+endsnippet
+
+snippet rfu "render (file,use_full_path) (rfu)"
+render :file => "${1:filepath}", :use_full_path => ${2:false}
+endsnippet
+
+snippet ri "render (inline) (ri)"
+render :inline => "${1:<%= 'hello' %>}"
+endsnippet
+
+snippet ril "render (inline,locals) (ril)"
+render :inline => "${1:<%= 'hello' %>}", :locals => { ${2::name} => "${3:value}"$4 }
+endsnippet
+
+snippet rit "render (inline,type) (rit)"
+render :inline => "${1:<%= 'hello' %>}", :type => ${2::rxml}
+endsnippet
+
+snippet rl "render (layout) (rl)"
+render :layout => "${1:layoutname}"
+endsnippet
+
+snippet rn "render (nothing) (rn)"
+render :nothing => ${1:true}
+endsnippet
+
+snippet rns "render (nothing,status) (rns)"
+render :nothing => ${1:true}, :status => ${2:401}
+endsnippet
+
+snippet rt "render (text) (rt)"
+render :text => "${1:text to render...}"
+endsnippet
+
+snippet rtl "render (text,layout) (rtl)"
+render :text => "${1:text to render...}", :layout => "${2:layoutname}"
+endsnippet
+
+snippet rtlt "render (text,layout => true) (rtlt)"
+render :text => "${1:text to render...}", :layout => ${2:true}
+endsnippet
+
+snippet rts "render (text,status) (rts)"
+render :text => "${1:text to render...}", :status => ${2:401}
+endsnippet
+
+snippet ru "render (update)"
+render :update do |${2:page}|
+ $2.$0
+end
+endsnippet
+
+snippet rest "respond_to"
+respond_to do |wants|
+ wants.${1:html}${2: { $0 \}}
+end
+endsnippet
+
+# FIXME
+snippet returning "returning do |variable| ... end"
+returning ${1:variable} do${2/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1: |)/}${2:v}${2/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}
+ $0
+end
+endsnippet
+
+snippet t. "t.binary (tcbi)"
+t.binary :${1:title}${2:, :limit => ${3:2}.megabytes}
+t.$0
+endsnippet
+
+snippet t. "t.boolean (tcb)"
+t.boolean :${1:title}
+t.$0
+endsnippet
+
+snippet t. "t.date (tcda)"
+t.date :${1:title}
+t.$0
+endsnippet
+
+snippet t. "t.datetime (tcdt)"
+t.datetime :${1:title}
+t.$0
+endsnippet
+
+snippet t. "t.decimal (tcd)"
+t.decimal :${1:title}${2:${3:, :precision => ${4:10}}${5:, :scale => ${6:2}}}
+t.$0
+endsnippet
+
+snippet t. "t.float (tcf)"
+t.float :${1:title}
+t.$0
+endsnippet
+
+snippet t. "t.integer (tci)"
+t.integer :${1:title}
+t.$0
+endsnippet
+
+snippet t. "t.lock_version (tcl)"
+t.integer :lock_version, :null => false, :default => 0
+t.$0
+endsnippet
+
+snippet t. "t.references (tcr)"
+t.references :${1:taggable}${2:, :polymorphic => ${3:{ :default => '${4:Photo}' \}}}
+t.$0
+endsnippet
+
+snippet t. "t.rename (tre)"
+t.rename(:${1:old_column_name}, :${2:new_column_name})
+t.$0
+endsnippet
+
+snippet t. "t.string (tcs)"
+t.string :${1:title}
+t.$0
+endsnippet
+
+snippet t. "t.text (tct)"
+t.text :${1:title}
+t.$0
+endsnippet
+
+snippet t. "t.time (tcti)"
+t.time :${1:title}
+t.$0
+endsnippet
+
+snippet t. "t.timestamp (tcts)"
+t.timestamp :${1:title}
+t.$0
+endsnippet
+
+snippet t. "t.timestamps (tctss)"
+t.timestamps
+t.$0
+endsnippet
+
+snippet vaoif "validates_acceptance_of if"
+validates_acceptance_of :${1:terms}${2:${3:, :accept => "${4:1}"}${5:, :message => "${6:You must accept the terms of service}"}}, :if => proc { |obj| ${7:obj.condition?} }}
+endsnippet
+
+snippet vao "validates_acceptance_of"
+validates_acceptance_of :${1:terms}${2:${3:, :accept => "${4:1}"}${5:, :message => "${6:You must accept the terms of service}"}}
+endsnippet
+
+snippet va "validates_associated (va)"
+validates_associated :${1:attribute}${2:, :on => :${3:create}}
+endsnippet
+
+snippet vaif "validates_associated if (vaif)"
+validates_associated :${1:attribute}${2:, :on => :${3:create}, :if => proc { |obj| ${5:obj.condition?} }}
+endsnippet
+
+snippet vc "validates_confirmation_of (vc)"
+validates_confirmation_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:should match confirmation}"}
+endsnippet
+
+snippet vcif "validates_confirmation_of if (vcif)"
+validates_confirmation_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:should match confirmation}", :if => proc { |obj| ${5:obj.condition?} }}
+endsnippet
+
+snippet ve "validates_exclusion_of (ve)"
+validates_exclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not allowed}"}
+endsnippet
+
+snippet veif "validates_exclusion_of if (veif)"
+validates_exclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not allowed}"}, :if => proc { |obj| ${7:obj.condition?} }}
+endsnippet
+
+snippet vfif "validates_format_of if"
+validates_format_of :${1:attribute}, :with => /${2:^[${3:\w\d}]+\$}/${4:, :on => :${5:create}, :message => "${6:is invalid}"}, :if => proc { |obj| ${7:obj.condition?} }}
+endsnippet
+
+snippet vf "validates_format_of"
+validates_format_of :${1:attribute}, :with => /${2:^[${3:\w\d}]+\$}/${4:, :on => :${5:create}, :message => "${6:is invalid}"}
+endsnippet
+
+snippet viif "validates_inclusion_of if"
+validates_inclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not included in the list}"}, :if => proc { |obj| ${7:obj.condition?} }}
+endsnippet
+
+snippet vi "validates_inclusion_of"
+validates_inclusion_of :${1:attribute}${2:, :in => ${3:%w( ${4:mov avi} )}, :on => :${5:create}, :message => "${6:extension %s is not included in the list}"}
+endsnippet
+
+snippet vl "validates_length_of (vl)"
+validates_length_of :${1:attribute}, :within => ${2:3..20}${3:, :on => :${4:create}, :message => "${5:must be present}"}
+endsnippet
+
+snippet vlif "validates_length_of if"
+validates_length_of :${1:attribute}, :within => ${2:3..20}${3:, :on => :${4:create}, :message => "${5:must be present}"}, :if => proc { |obj| ${6:obj.condition?} }}
+endsnippet
+
+snippet vnif "validates_numericality_of if"
+validates_numericality_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:is not a number}"}, :if => proc { |obj| ${5:obj.condition?} }}
+endsnippet
+
+snippet vn "validates_numericality_of"
+validates_numericality_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:is not a number}"}
+endsnippet
+
+snippet vp "validates_presence_of (vp)"
+validates_presence_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:can't be blank}"}
+endsnippet
+
+snippet vpif "validates_presence_of if (vpif) 2"
+validates_presence_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:can't be blank}"}, :if => proc { |obj| ${5:obj.condition?} }}
+endsnippet
+
+snippet vu "validates_uniqueness_of (vu)"
+validates_uniqueness_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:must be unique}"}
+endsnippet
+
+snippet vuif "validates_uniqueness_of if (vuif)"
+validates_uniqueness_of :${1:attribute}${2:, :on => :${3:create}, :message => "${4:must be unique}", :if => proc { |obj| ${6:obj.condition?} }}
+endsnippet
+
+snippet verify "verify -- render"
+verify :only => [:$1], :method => :post, :render => {:status => 500, :text => "use HTTP-POST"}
+
+endsnippet
+
+snippet verify "verify -- redirect"
+verify :only => [:$1], :session => :user, :params => :id, :redirect_to => {:action => '${2:index}'}
+
+endsnippet
+
+snippet wants "wants_format"
+wants.${1:js|xml|html}${2: { $0 \}}
+endsnippet
+
+snippet xdelete "xhr delete"
+xhr :delete, :${1:destroy}, :id => ${2:1}$0
+endsnippet
+
+snippet xget "xhr get"
+xhr :get, :${1:show}${2:, :id => ${3:1}}$0
+endsnippet
+
+snippet xpost "xhr post"
+xhr :post, :${1:create}, :${2:object} => { $3 }
+endsnippet
+
+snippet xput "xhr put"
+xhr :put, :${1:update}, :id => ${2:1}, :${3:object} => { $4 }$0
+endsnippet
+
+snippet sweeper "Create sweeper class"
+class ${1:Model}Sweeper < ActionController::Caching::Sweeper
+ observe ${1:Model}
+
+ def after_save(${1/./\l$0/})
+ expire_cache(${1/./\l$0/})
+ end
+
+ def after_destroy(${1/./\l$0/})
+ expire_cache(${1/./\l$0/})
+ end
+
+ private
+
+ def expire_cache(${1/./\l$0/})
+ ${0:expire_page ${1/./\l$0/}s_path
+ expire_page ${1/./\l$0/}_path(${1/./\l$0/})}
+ end
+
+end
+endsnippet
+
+snippet col "collection routes"
+collection do
+ ${1:get :${2:action}}
+ ${3:put :${4:action}}
+ ${5:post :${6:action}}
+ ${7:delete :${8:action}}
+end
+endsnippet
+
+snippet format "format (respond_with)"
+format.${1:html|xml|json|js|any} { $0 }
+endsnippet
+
+snippet gem "gem"
+gem '${1:name}'${2:${3:, "${4:1.0}"}${5:${6:, :require => ${7:"${8:$1}"}}${9:, :group => :${10:test}}}}
+endsnippet
+
+snippet gemg "gem :git"
+gem '${1:paperclip}', :git => "${2:git://github.com/thoughtbot/paperclip.git}"${3:, :branch => "${4:rails3}"}
+endsnippet
+
+snippet match "match"
+match '${1:${2::controller}${3:/${4::action}${5:/${6::id}${7:(.:format)}}}}'${8: => '${9:$2}#${10:$4}'${11:, :as => :${12:$10}}}
+endsnippet
+
+snippet member "member routes"
+member do
+ ${1:get :${2:action}}
+ ${3:put :${4:action}}
+ ${5:post :${6:action}}
+ ${7:delete :${8:action}}
+end
+endsnippet
+
+snippet res "resources"
+resources :${1:posts}${2: do
+ $3
+end}
+endsnippet
+
+snippet scope "scope"
+scope :${1:name}, ${2:joins(:${3:table}).}where(${4:'${5:$3.${6:field}} = ?', ${7:'${8:value}'}})
+endsnippet
+
+snippet scopel "scope lambda"
+scope :${1:name}, lambda { |${2:param}| ${3:where(${4::${5:field} => ${6:"${7:value}"}})} }
+endsnippet
+
+snippet scopee "scope with extension"
+scope :${1:name}, ${2:where(${3::${4:field} => ${5:'${6:value}'}})} do
+ def ${7:method_name}
+ $0
+ end
+end
+endsnippet
+
+snippet sb "scoped_by"
+scoped_by_${1:attribute}(${2:id})
+endsnippet
+
+snippet setup "setup do..end"
+setup do
+ $0
+end
+endsnippet
+
+snippet trans "Translation snippet"
+I18n.t('`!v substitute(substitute(substitute(@%, substitute(getcwd() . "/", "\/", "\\\\/", "g"), "", ""), "\\(\\.\\(html\\|js\\)\\.\\(haml\\|erb\\)\\|\\(_controller\\)\\?\\.rb\\)$", "", ""), "/", ".", "g")`.${2:${1/[^\w]/_/g}}${3}', :default => "${1:some_text}"${4})${5:$0}
+endsnippet
+
+snippet route_spec
+it 'routes to #${1:action}' do
+ ${2:get}('/${3:url}').should route_to('`!v substitute(expand('%:t:r'), '_routing_spec$', '', '')`#$1'${4:, ${5:params}})${6}
+end
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/rnoweb.snippets b/vim/bundle/vim-snippets/UltiSnips/rnoweb.snippets
new file mode 100644
index 0000000..773b9aa
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/rnoweb.snippets
@@ -0,0 +1,3 @@
+priority -50
+
+extends tex, r
diff --git a/vim/bundle/vim-snippets/UltiSnips/rst.snippets b/vim/bundle/vim-snippets/UltiSnips/rst.snippets
new file mode 100644
index 0000000..0596eee
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/rst.snippets
@@ -0,0 +1,293 @@
+# -*- coding: utf-8 -*-
+
+priority -50
+
+###########################################################################
+# General Stuff #
+###########################################################################
+global !p
+import vim
+from os import path as ospath
+from string import Template
+import re
+from collections import Counter
+
+from vimsnippets import complete
+
+#http://docutils.sourceforge.net/docs/ref/rst/roles.html
+TEXT_ROLES = ['emphasis','literal','code','math',
+ 'pep-reference','rfc-reference',
+ 'strong','subscript','superscript',
+ 'title-reference','raw']
+TEXT_ROLES_REGEX = r'\.\.\srole::?\s(w+)'
+
+#http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions
+SPECIFIC_ADMONITIONS = ["attention", "caution", "danger",
+ "error", "hint", "important", "note",
+ "tip", "warning"]
+#http://docutils.sourceforge.net/docs/ref/rst/directives.html
+DIRECTIVES = ['topic','sidebar','math','epigraph',
+ 'parsed-literal','code','highlights',
+ 'pull-quote','compound','container',
+ 'list-table','class','sectnum',
+ 'role','default-role','unicode',
+ 'raw']
+
+NONE_CONTENT_DIRECTIVES = ['rubric', 'contents', 'header',
+ 'footer', 'date', 'include', 'title']
+
+INCLUDABLE_DIRECTIVES = ['image', 'figure', 'include']
+# CJK chars
+# http://stackoverflow.com/questions/2718196/find-all-chinese-text-in-a-string-using-python-and-regex
+CJK_RE = re.compile(u'[⺀-⺙⺛-⻳⼀-⿕々〇〡-〩〸-〺〻㐀-䶵一-鿃豈-鶴侮-頻並-龎]', re.UNICODE)
+
+
+def has_cjk(s):
+ """Detect if s contains CJK characters."""
+ return CJK_RE.search(s) is not None
+
+def real_filename(filename):
+ """pealeextension name off if possible
+ # i.e. "foo.bar.png will return "foo.bar"
+ """
+ return ospath.splitext(filename)[0]
+
+def check_file_exist(rst_path, relative_path):
+ """
+ For RST file, it can just include files as relative path.
+
+ :param rst_path: absolute path to rst file
+ :param relative_path: path related to rst file
+ :return: relative file's absolute path if file exist
+ """
+ abs_path = ospath.join(ospath.dirname(rst_path), relative_path)
+ if ospath.isfile(abs_path):
+ return abs_path
+
+
+try:
+ rst_char_len = vim.strwidth # Requires Vim 7.3+
+except AttributeError:
+ from unicodedata import east_asian_width
+ def rst_char_len(s):
+ """Return the required over-/underline length for s."""
+ result = 0
+ for c in s:
+ result += 2 if east_asian_width(c) in ('W', 'F') else 1
+ return result
+
+
+def make_items(times, leading='+'):
+ """
+ make lines with leading char multitimes
+
+ :param: times, how many times you need
+ :param: leading, leading character
+ """
+ times = int(times)
+ if leading == 1:
+ msg = ""
+ for x in range(1, times+1):
+ msg += "%s. Item\n" % x
+ return msg
+ else:
+ return ("%s Item\n" % leading) * times
+
+
+def look_up_directives(regex, fpath):
+ """
+ find all directive args in given file
+ :param: regex, the regex that needs to match
+ :param: path, to path to rst file
+
+ :return: list, empty list if nothing match
+ """
+ try:
+ with open(fpath) as source:
+ match = re.findall(regex, source.read())
+ except IOError:
+ match = []
+ return match
+
+
+def get_popular_code_type():
+ """
+ find most popular code type in the given rst
+
+ :param path: file to detect
+
+ :return: string, most popular code type in file
+ """
+ buf = "".join(vim.current.buffer)
+ types = re.findall(r'[:|\.\.\s]code::?\s(\w+)', buf)
+ try:
+ popular_type = Counter(types).most_common()[0][0]
+ except IndexError:
+ popular_type = "lua" # Don't break default
+ return popular_type
+endglobal
+
+snippet part "Part" b
+`!p snip.rv = rst_char_len(t[1])*'#'`
+${1:${VISUAL:Part name}}
+`!p snip.rv = rst_char_len(t[1])*'#'`
+
+$0
+endsnippet
+
+snippet chap "Chapter" b
+`!p snip.rv = rst_char_len(t[1])*'*'`
+${1:${VISUAL:Chapter name}}
+`!p snip.rv = rst_char_len(t[1])*'*'`
+
+$0
+endsnippet
+
+snippet sec "Section" b
+${1:${VISUAL:Section name}}
+`!p snip.rv = rst_char_len(t[1])*'='`
+
+$0
+endsnippet
+
+snippet ssec "Subsection" b
+${1:${VISUAL:Subsection name}}
+`!p snip.rv = rst_char_len(t[1])*'-'`
+
+$0
+endsnippet
+
+snippet sssec "Subsubsection" b
+${1:${VISUAL:Subsubsection name}}
+`!p snip.rv = rst_char_len(t[1])*'^'`
+
+$0
+endsnippet
+
+snippet para "Paragraph" b
+${1:${VISUAL:Paragraph name}}
+`!p snip.rv = rst_char_len(t[1])*'"'`
+
+$0
+endsnippet
+
+snippet em "Emphasize string" i
+`!p
+# dirty but works with CJK character detection
+if has_cjk(vim.current.line):
+ snip.rv ="\ "`*${1:${VISUAL:Em}}*`!p
+if has_cjk(vim.current.line):
+ snip.rv ="\ "
+else:
+ snip.rv = " "
+`$0
+endsnippet
+
+snippet st "Strong string" i
+`!p
+if has_cjk(vim.current.line):
+ snip.rv ="\ "`**${1:${VISUAL:Strong}}**`!p
+if has_cjk(vim.current.line):
+ snip.rv ="\ "
+else:
+ snip.rv = " "
+`$0
+endsnippet
+
+snippet "li(st)? (?P<num>\d+)" "List" br
+$0
+`!p
+# usage: li 4<tab>
+# which will extand into a unordered list contains 4 items
+snip.rv = make_items(match.groupdict()['num'])
+`
+endsnippet
+
+snippet "ol(st)? (?P<num>\d+)" "Order List" br
+$0
+`!p
+# usage: ol 4<tab>
+# which will extand into a ordered list contains 4 items
+snip.rv = make_items(match.groupdict()['num'], 1)
+`
+endsnippet
+###########################################################################
+# More Specialized Stuff. #
+###########################################################################
+snippet cb "Code Block" b
+.. code-block:: ${1:`!p snip.rv = get_popular_code_type()`}
+
+ ${2:${VISUAL:code}}
+
+$0
+endsnippet
+
+# match snippets :
+# img, inc, fig
+snippet id "Includable Directives" b
+`!p
+real_name=real_filename(ospath.basename(t[2]))
+di=t[1][:2]
+
+link=""
+content=""
+
+if di == 'im':
+ link = "|{0}|".format(real_name)
+
+if di == 'fi':
+ content="""
+ :alt: {0}
+ {0}""".format(real_name)
+`
+..`!p snip.rv = " %s" % link if link else ""` $1`!p
+snip.rv=complete(t[1], INCLUDABLE_DIRECTIVES)
+`:: ${2:${VISUAL:file}}`!p
+if content:
+ snip.rv +=" "+content`
+`!p
+# Tip of whether file is exist in comment type
+if not check_file_exist(path, t[2]):
+ snip.rv='.. FILE {0} does not exist'.format(t[2])
+else:
+ snip.rv=""
+`$0
+endsnippet
+
+snippet di "Directives" b
+.. $1`!p snip.rv=complete(t[1], DIRECTIVES)`:: $2
+
+ ${3:${VISUAL:Content}}
+$0
+endsnippet
+
+snippet nd "None Content Directives" b
+.. $1`!p snip.rv=complete(t[1], NONE_CONTENT_DIRECTIVES)`:: $2
+$0
+endsnippet
+
+snippet sa "Specific Admonitions" b
+.. $1`!p snip.rv =complete(t[1], SPECIFIC_ADMONITIONS)`::
+
+ ${2:${VISUAL:Content}}
+
+$0
+endsnippet
+
+#it will be trigger at start of line or after a word
+snippet ro "Text Roles" w
+\ :$1`!p snip.rv=complete(t[1],
+ TEXT_ROLES+look_up_directives(TEXT_ROLES_REGEX,
+ path))`:\`$2\`\
+endsnippet
+
+############
+# Sphinx #
+############
+
+snippet sid "SideBar" b
+.. sidebar:: ${1:SideBar Title}
+
+ ${2:${VISUAL:SideBar Content}}
+endsnippet
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/ruby.snippets b/vim/bundle/vim-snippets/UltiSnips/ruby.snippets
new file mode 100644
index 0000000..b7124f8
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/ruby.snippets
@@ -0,0 +1,353 @@
+priority -50
+
+snippet "^#!" "#!/usr/bin/env ruby" r
+#!/usr/bin/env ruby
+$0
+endsnippet
+
+snippet "^# ?[uU][tT][fF]-?8" "# encoding: UTF-8" r
+# encoding: UTF-8
+$0
+endsnippet
+
+snippet "\b(de)?f" "def <name>..." r
+def ${1:function_name}${2:(${3:*args})}
+ $0
+end
+endsnippet
+
+snippet defi "def initialize ..."
+def initialize${1:(${2:*args})}
+ $0
+end
+endsnippet
+
+snippet defr "def <name> ... rescue ..."
+def ${1:function_name}${2:(${3:*args})}
+ $4
+rescue
+ $0
+end
+endsnippet
+
+snippet For "(<from>..<to>).each { |<i>| <block> }"
+(${1:from}..${2:to}).each { |${3:i}| $0 }
+endsnippet
+
+snippet "(\S+)\.Merge!" ".merge!(<other_hash>) { |<key>,<oldval>,<newval>| <block> }" r
+`!p snip.rv=match.group(1)`.merge!(${1:other_hash}) { |${2:key},${3:oldval},${4:newval}| ${5:block} }
+endsnippet
+
+snippet "(\S+)\.merge!" ".merge!(<other_hash>) do |<key>,<oldval>,<newval>| <block> end" r
+`!p snip.rv=match.group(1)`.merge!(${1:other_hash}) do |${2:key},${3:oldval},${4:newval}|
+ ${0:block}
+end
+endsnippet
+
+snippet "(\S+)\.Del(ete)?_?if" ".delete_if { |<key>,<value>| <block> }" r
+`!p snip.rv=match.group(1)`.delete_if { |${1:key},${2:value}| $0 }
+endsnippet
+
+snippet "(\S+)\.del(ete)?_?if" ".delete_if do |<key>,<value>| <block> end" r
+`!p snip.rv=match.group(1)`.delete_if do |${1:key},${2:value}|
+ $0
+end
+endsnippet
+
+snippet "(\S+)\.Keep_?if" ".keep_if { |<key>,<value>| <block> }" r
+`!p snip.rv=match.group(1)`.keep_if { |${1:key},${2:value}| $0 }
+endsnippet
+
+snippet "(\S+)\.keep_?if" ".keep_if do <key>,<value>| <block> end" r
+`!p snip.rv=match.group(1)`.keep_if do |${1:key},${2:value}|
+ $0
+end
+endsnippet
+
+snippet "(\S+)\.Reject" ".reject { |<key>,<value>| <block> }" r
+`!p snip.rv=match.group(1)`.reject { |${1:key},${2:value}| $0 }
+endsnippet
+
+snippet "(\S+)\.reject" ".reject do <key>,<value>| <block> end" r
+`!p snip.rv=match.group(1)`.reject do |${1:key},${2:value}|
+ $0
+end
+endsnippet
+
+snippet "(\S+)\.Select" ".select { |<item>| <block>}" r
+`!p snip.rv=match.group(1)`.select { |${1:item}| ${2:block} }
+endsnippet
+
+snippet "(\S+)\.select" ".select do |<item>| <block> end" r
+`!p snip.rv=match.group(1)`.select do |${1:item}|
+ ${0:block}
+end
+endsnippet
+
+snippet "(\S+)\.Sort" ".sort { |<a>,<b>| <block> }" r
+`!p snip.rv=match.group(1)`.sort { |${1:a},${2:b}| $0 }
+endsnippet
+
+snippet "(\S+)\.sort" ".sort do |<a>,<b>| <block> end" r
+`!p snip.rv=match.group(1)`.sort do |${1:a},${2:b}|
+ $0
+end
+endsnippet
+
+snippet "(\S+)\.Each_?k(ey)?" ".each_key { |<key>| <block> }" r
+`!p snip.rv=match.group(1)`.each_key { |${1:key}| $0 }
+endsnippet
+
+snippet "(\S+)\.each_?k(ey)?" ".each_key do |key| <block> end" r
+`!p snip.rv=match.group(1)`.each_key do |${1:key}|
+ $0
+end
+endsnippet
+
+snippet "(\S+)\.Each_?val(ue)?" ".each_value { |<value>| <block> }" r
+`!p snip.rv=match.group(1)`.each_value { |${1:value}| $0 }
+endsnippet
+
+snippet "(\S+)\.each_?val(ue)?" ".each_value do |<value>| <block> end" r
+`!p snip.rv=match.group(1)`.each_value do |${1:value}|
+ $0
+end
+endsnippet
+
+snippet "(\S+)\.ea" "<elements>.each do |<element>| <block> end" r
+`!p snip.rv=match.group(1)`.each { |${1:e}| $0 }
+endsnippet
+
+snippet "(\S+)\.ead" "<elements>.each do |<element>| <block> end" r
+`!p snip.rv=match.group(1)`.each do |${1:e}|
+ $0
+end
+endsnippet
+
+snippet "each_?s(lice)?" "<array>.each_slice(n) do |slice| <block> end" r
+${1:elements}.each_slice(${2:2}) do |${3:slice}|
+ $0
+end
+endsnippet
+
+snippet "Each_?s(lice)?" "<array>.each_slice(n) { |slice| <block> }" r
+${1:elements}.each_slice(${2:2}) { |${3:slice}| $0 }
+endsnippet
+
+snippet "(\S+)\.Map" ".map { |<element>| <block> }" r
+`!p snip.rv=match.group(1)`.map { |${1:`!p
+element_name = match.group(1).lstrip('$@')
+ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
+try:
+ wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
+ snip.rv = wmatch.group(1).lower()
+except:
+ snip.rv = 'element'
+`}| $0 }
+endsnippet
+
+snippet "(\S+)\.map" ".map do |<element>| <block> end" r
+`!p snip.rv=match.group(1)`.map do |${1:`!p
+element_name = match.group(1).lstrip('$@')
+ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
+try:
+ wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
+ snip.rv = wmatch.group(1).lower()
+except:
+ snip.rv = 'element'
+`}|
+ $0
+end
+endsnippet
+
+snippet "(\S+)\.Rev(erse)?_?each" ".reverse_each { |<element>| <block> }" r
+`!p snip.rv=match.group(1)`.reverse_each { |${1:`!p
+element_name = match.group(1).lstrip('$@')
+ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
+try:
+ wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
+ snip.rv = wmatch.group(1).lower()
+except:
+ snip.rv = 'element'
+`}| $0 }
+endsnippet
+
+snippet "(\S+)\.rev(erse)?_?each" ".reverse_each do |<element>| <block> end" r
+`!p snip.rv=match.group(1)`.reverse_each do |${1:`!p
+element_name = match.group(1).lstrip('$@')
+ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
+try:
+ wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
+ snip.rv = wmatch.group(1).lower()
+except:
+ snip.rv = 'element'
+`}|
+ $0
+end
+endsnippet
+
+snippet "(\S+)\.Each" ".each { |<element>| <block> }" r
+`!p snip.rv=match.group(1)`.each { |${1:`!p
+element_name = match.group(1).lstrip('$@')
+ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
+try:
+ wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
+ snip.rv = wmatch.group(1).lower()
+except:
+ snip.rv = 'element'
+`}| $0 }
+endsnippet
+
+snippet "(\S+)\.each" ".each do |<element>| <block> end" r
+`!p snip.rv=match.group(1)`.each do |${1:`!p
+element_name = match.group(1).lstrip('$@')
+ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
+try:
+ wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
+ snip.rv = wmatch.group(1).lower()
+except:
+ snip.rv = 'element'
+`}|
+ $0
+end
+endsnippet
+
+snippet "(\S+)\.Each_?w(ith)?_?i(ndex)?" ".each_with_index { |<element>,<i>| <block> }" r
+`!p snip.rv=match.group(1)`.each_with_index { |${1:`!p
+element_name = match.group(1).lstrip('$@')
+ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
+try:
+ wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
+ snip.rv = wmatch.group(1).lower()
+except:
+ snip.rv = 'element'
+`},${2:i}| $0 }
+endsnippet
+
+snippet "(\S+)\.each_?w(ith)?_?i(ndex)?" ".each_with_index do |<element>,<i>| <block> end" r
+`!p snip.rv=match.group(1)`.each_with_index do |${1:`!p
+element_name = match.group(1).lstrip('$@')
+ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name)
+try:
+ wmatch = re.search("([A-Za-z][A-Za-z0-9_]+)$", ematch.group(1))
+ snip.rv = wmatch.group(1).lower()
+except:
+ snip.rv = 'element'
+`},${2:i}|
+ $0
+end
+endsnippet
+
+snippet "(\S+)\.Each_?p(air)?" ".each_pair { |<key>,<value>| <block> }" r
+`!p snip.rv=match.group(1)`.each_pair { |${1:key},${2:value}| $0 }
+endsnippet
+
+snippet "(\S+)\.each_?p(air)?" ".each_pair do |<key>,<value>| <block> end" r
+`!p snip.rv=match.group(1)`.each_pair do |${1:key},${2:value}|
+ $0
+end
+endsnippet
+
+snippet "(\S+)\.sub" ".sub(<expression>) { <block> }" r
+`!p snip.rv=match.group(1)`.sub(${1:expression}) { ${2:"replace_with"} }
+endsnippet
+
+snippet "(\S+)\.gsub" ".gsub(<expression>) { <block> }" r
+`!p snip.rv=match.group(1)`.gsub(${1:expression}) { ${2:"replace_with"} }
+endsnippet
+
+snippet "(\S+)\.index" ".index { |item| <block> }" r
+`!p snip.rv=match.group(1)`.index { |${1:item}| ${2:block} }
+endsnippet
+
+snippet "(\S+)\.Index" ".index do |item| ... end" r
+`!p snip.rv=match.group(1)`.index do |${1:item}|
+ ${0:block}
+end
+endsnippet
+
+snippet until "until <expression> ... end"
+until ${1:expression}
+ $0
+end
+endsnippet
+
+snippet Until "begin ... end until <expression>"
+begin
+ $0
+end until ${1:expression}
+endsnippet
+
+snippet while "while <expression> ... end"
+while ${1:expression}
+ $0
+end
+endsnippet
+
+snippet While "begin ... end while <expression>"
+begin
+ $0
+end while ${1:expression}
+endsnippet
+
+snippet begin "begin ... rescue ... end"
+begin
+ $1
+rescue
+ $0
+end
+endsnippet
+
+snippet begin "begin ... rescue ... else ... ensure ... end"
+begin
+ ${1:# Raise exception}
+rescue Exception => e
+ puts e.message
+ puts e.backtrace.inspect
+ ${2:# Rescue}
+else
+ ${3:# other exception}
+ensure
+ ${0:# always excute}
+end
+endsnippet
+
+snippet rescue
+rescue Exception => e
+ puts e.message
+ puts e.backtrace.inspect
+ ${0:# Rescue}
+endsnippet
+
+snippet "\b(case|sw(itch)?)" "case <variable> when <expression> ... end" r
+case ${1:variable}
+when ${2:expression}
+$0
+end
+endsnippet
+
+snippet alias "alias :<new_name> :<old_name>"
+alias :${1:new_name} :${2:old_name}
+endsnippet
+
+snippet class "class <class_name> def initialize ... end end"
+class ${1:class_name}
+ def initialize(${2:*args})
+ $0
+ end
+end
+endsnippet
+
+snippet module "module"
+module ${1:module_name}
+ $0
+end
+endsnippet
+
+snippet ###
+=begin
+ $0
+=end
+endsnippet
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/vim/bundle/vim-snippets/UltiSnips/rust.snippets b/vim/bundle/vim-snippets/UltiSnips/rust.snippets
new file mode 100644
index 0000000..40e7605
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/rust.snippets
@@ -0,0 +1,106 @@
+#######################################################################
+# Rust Snippets #
+#######################################################################
+
+priority -50
+
+snippet let "let variable declaration" b
+let ${1:name}${2:: ${3:type}} = ${4};
+endsnippet
+
+snippet letm "let mut variable declaration" b
+let mut ${1:name}${2:: ${3:type}} = ${4};
+endsnippet
+
+snippet fn "A function, optionally with arguments and return type."
+fn ${1:function_name}(${2})${3/..*/ -> /}${3} {
+ ${VISUAL}${0}
+}
+endsnippet
+
+snippet pfn "A public function, optionally with arguments and return type."
+pub fn ${1:function_name}(${2})${3/..*/ -> /}${3} {
+ ${VISUAL}${0}
+}
+endsnippet
+
+snippet arg "Function Arguments" i
+${1:a}: ${2:T}${3:, arg}
+endsnippet
+
+snippet || "Closure, anonymous function (inline)" i
+${1:move }|${2}| { $3 }
+endsnippet
+
+snippet |} "Closure, anonymous function (block)" i
+${1:move }|${2}| {
+ $3
+}
+endsnippet
+
+snippet pri "print!(..)" b
+print!("${1}"${2/..*/, /}${2});
+endsnippet
+
+snippet pln "println!(..)" b
+println!("${1}"${2/..*/, /}${2});
+endsnippet
+
+snippet fmt "format!(..)"
+format!("${1}"${2/..*/, /}${2});
+endsnippet
+
+snippet macro "macro_rules!" b
+macro_rules! ${1:name} {
+ (${2:matcher}) => (
+ ${3}
+ )
+}
+endsnippet
+
+snippet mod "A module" b
+mod ${1:`!p snip.rv = snip.basename.lower() or "name"`} {
+ ${VISUAL}${0}
+}
+endsnippet
+
+snippet for "for .. in .." b
+for ${1:i} in ${2} {
+ ${VISUAL}${0}
+}
+endsnippet
+
+snippet todo "A Todo comment"
+// [TODO]: ${1:Description} - `!v strftime("%Y-%m-%d %I:%M%P")`
+endsnippet
+
+snippet st "Struct" b
+struct ${1:`!p snip.rv = snip.basename.title() or "Name"`} {
+ ${VISUAL}${0}
+}
+endsnippet
+
+# TODO: fancy dynamic field mirroring like Python slotclass
+snippet stn "Struct with new constructor." b
+pub struct ${1:`!p snip.rv = snip.basename.title() or "Name"`} {
+ fd${0}
+}
+
+impl $1 {
+ pub fn new(${2}) -> $1 {
+ $1 { ${3} }
+ }
+}
+endsnippet
+
+snippet fd "Struct field definition" w
+${1:name}: ${2:Type},
+endsnippet
+
+snippet impl "Struct/Trait implementation" b
+impl ${1:Type/Trait}${2: for ${3:Type}} {
+ ${0}
+}
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/sh.snippets b/vim/bundle/vim-snippets/UltiSnips/sh.snippets
new file mode 100644
index 0000000..7018184
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/sh.snippets
@@ -0,0 +1,99 @@
+priority -50
+
+global !p
+import vim
+
+# Tests for the existence of a variable declared by Vim's filetype detection
+# suggesting the type of shell script of the current file
+def testShell(scope, shell):
+ return vim.eval("exists('" + scope + ":is_" + shell + "')")
+
+# Loops over the possible variables, checking for global variables
+# first since they indicate an override by the user.
+def getShell():
+ for scope in ["g", "b"]:
+ for shell in ["bash", "posix", "sh", "kornshell"]:
+ if testShell(scope, shell) == "1":
+ if shell == "kornshell":
+ return "ksh"
+ if shell == "posix":
+ return "sh"
+ return shell
+ return "sh"
+endglobal
+
+###########################################################################
+# TextMate Snippets #
+###########################################################################
+snippet #!
+`!p snip.rv = '#!/bin/' + getShell() + "\n\n" `
+endsnippet
+
+snippet !env "#!/usr/bin/env (!env)"
+`!p snip.rv = '#!/usr/bin/env ' + getShell() + "\n\n" `
+endsnippet
+
+snippet sbash "safe bash options"
+#!/usr/bin/env bash
+set -euo pipefail
+IFS=$'\n\t'
+`!p snip.rv ='\n\n' `
+endsnippet
+
+snippet temp "Tempfile"
+${1:TMPFILE}="$(mktemp -t ${2:`!p
+snip.rv = re.sub(r'[^a-zA-Z]', '_', snip.fn) or "untitled"
+`})"
+${3:${4/(.+)/trap "/}${4:rm -f '$${1/.*\s//}'}${4/(.+)/" 0 # EXIT\n/}${5/(.+)/trap "/}${5:rm -f '$${1/.*\s//}'; exit 1}${5/(.+)/" 2 # INT\n/}${6/(.+)/trap "/}${6:rm -f '$${1/.*\s//}'; exit 1}${6/(.+)/" 1 15 # HUP TERM\n/}}
+
+endsnippet
+
+snippet case "case .. esac (case)"
+case ${1:word} in
+ ${2:pattern} )
+ $0;;
+esac
+endsnippet
+
+snippet elif "elif .. (elif)"
+elif ${2:[[ ${1:condition} ]]}; then
+ ${0:#statements}
+endsnippet
+
+snippet for "for ... done (for)"
+for (( i = 0; i < ${1:10}; i++ )); do
+ ${0:#statements}
+done
+endsnippet
+
+snippet forin "for ... in ... done (forin)"
+for ${1:i}${2/.+/ in /}${2:words}; do
+ ${0:#statements}
+done
+endsnippet
+
+snippet here "here document (here)"
+<<-${2:'${1:TOKEN}'}
+ $0
+${1/['"`](.+)['"`]/$1/}
+endsnippet
+
+snippet if "if ... then (if)"
+if ${2:[[ ${1:condition} ]]}; then
+ ${0:#statements}
+fi
+endsnippet
+
+snippet until "until ... (done)"
+until ${2:[[ ${1:condition} ]]}; do
+ ${0:#statements}
+done
+endsnippet
+
+snippet while "while ... (done)"
+while ${2:[[ ${1:condition} ]]}; do
+ ${0:#statements}
+done
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/snippets.snippets b/vim/bundle/vim-snippets/UltiSnips/snippets.snippets
new file mode 100644
index 0000000..ee0c8c7
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/snippets.snippets
@@ -0,0 +1,21 @@
+priority -50
+
+# We use a little hack so that the snippet is expanded
+# and parsed correctly
+snippet snip "Snippet definition" b
+`!p snip.rv = "snippet"` ${1:Tab_trigger} "${2:Description}" ${3:b}
+$0
+`!p snip.rv = "endsnippet"`
+endsnippet
+
+snippet global "Global snippet" b
+`!p snip.rv = "global"` !p
+$0
+`!p snip.rv = "endglobal"`
+endsnippet
+
+snippet vis "${VISUAL}" i
+\$\{VISUAL${1:${2:default}${3:/transform/}}\}
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/soy.snippets b/vim/bundle/vim-snippets/UltiSnips/soy.snippets
new file mode 100644
index 0000000..9a22a57
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/soy.snippets
@@ -0,0 +1,63 @@
+priority -50
+
+extends html
+
+snippet ns "Namespace" b
+{namespace ${1:name}}
+endsnippet
+
+snippet tmpl "Template" b
+/**
+ * ${2:TODO(`whoami`): Describe this template.}
+ */
+{template .${1:name}}
+ $0
+{/template}
+endsnippet
+
+snippet msg "Message" b
+{msg desc="${1:description}"}
+ $0
+{/msg}
+endsnippet
+
+snippet let "let command" b
+{let $${1:identifier}: ${2:expression} /}
+endsnippet
+
+snippet if "if .. (if)" b
+{if ${1:expression}}
+ $0
+{/if}
+endsnippet
+
+snippet ife "if .. else (ife)" b
+{if ${1:expression}}
+ $2
+{else}
+ $0
+{/if}
+endsnippet
+
+snippet eli "else if .. (eli)" b
+{elif ${1:expression}}
+ $0
+endsnippet
+
+snippet fore "foreach command" b
+{foreach $${1:var} in ${2:ref}}
+ $0
+{/foreach}
+endsnippet
+
+snippet for "for command" b
+{for $${1:var} in range(${2:rangeexpr})}
+ $0
+{/for}
+endsnippet
+
+snippet call "template call" b
+{call ${1:tmpl}}
+ $0
+{/call}
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/supercollider.snippets b/vim/bundle/vim-snippets/UltiSnips/supercollider.snippets
new file mode 100644
index 0000000..b8538aa
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/supercollider.snippets
@@ -0,0 +1,10 @@
+snippet for
+for (${1:1}, ${2:10}) {${3: |i}|}
+ $0
+}
+endsnippet
+snippet sdef
+SynthDef(\\${1:synthName}, {${2: |${3:x}|}
+ ${0}
+}).add;
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/tcl.snippets b/vim/bundle/vim-snippets/UltiSnips/tcl.snippets
new file mode 100644
index 0000000..6584915
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/tcl.snippets
@@ -0,0 +1,52 @@
+priority -50
+
+###########################################################################
+# TEXTMATE SNIPPETS #
+###########################################################################
+snippet for "for... (for)" b
+for {${1:set i 0}} {${2:\$i < \$n}} {${3:incr i}} {
+ ${4}
+}
+
+endsnippet
+
+snippet foreach "foreach... (foreach)"
+foreach ${1:var} ${2:\$list} {
+ ${3}
+}
+
+endsnippet
+
+snippet if "if... (if)" b
+if {${1:condition}} {
+ ${2}
+}
+
+endsnippet
+
+snippet proc "proc... (proc)" b
+proc ${1:name} {${2:args}} \
+{
+ ${3}
+}
+
+endsnippet
+
+snippet switch "switch... (switch)" b
+switch ${1:-exact} -- ${2:\$var} {
+ ${3:match} {
+ ${4}
+ }
+ default {${5}}
+}
+
+endsnippet
+
+snippet while "while... (while)" b
+while {${1:condition}} {
+ ${2}
+}
+
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/tex.snippets b/vim/bundle/vim-snippets/UltiSnips/tex.snippets
new file mode 100644
index 0000000..4c7e44b
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/tex.snippets
@@ -0,0 +1,121 @@
+priority -50
+
+extends texmath
+
+snippet "b(egin)?" "begin{} / end{}" br
+\begin{${1:something}}
+ ${0:${VISUAL}}
+\end{$1}
+endsnippet
+
+snippet tab "tabular / array environment" b
+\begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}}
+$0${2/((?<=.)c|l|r)|./(?1: & )/g}
+\end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}
+endsnippet
+
+snippet table "Table environment" b
+\begin{table}[${1:htpb}]
+ \centering
+ \caption{${2:caption}}
+ \label{tab:${3:label}}
+ \begin{${4:t}${4/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${5:c}}
+ $0${5/((?<=.)c|l|r)|./(?1: & )/g}
+ \end{$4${4/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}
+\end{table}
+endsnippet
+
+snippet fig "Figure environment" b
+\begin{figure}[${2:htpb}]
+ \centering
+ \includegraphics[width=${3:0.8}\linewidth]{${4:name.ext}}
+ \caption{${4/(\w+)\.\w+/\u$1/}$0}
+ \label{fig:${4/(\w+)\.\w+/$1/}}
+\end{figure}
+endsnippet
+
+snippet enum "Enumerate" b
+\begin{enumerate}
+ \item $0
+\end{enumerate}
+endsnippet
+
+snippet item "Itemize" b
+\begin{itemize}
+ \item $0
+\end{itemize}
+endsnippet
+
+snippet desc "Description" b
+\begin{description}
+ \item[$1] $0
+\end{description}
+endsnippet
+
+snippet it "Individual item" b
+\item ${1}
+$0
+endsnippet
+
+snippet part "Part" b
+\part{${1:part name}}
+\label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/ga}}}
+
+${0}
+endsnippet
+
+snippet cha "Chapter" b
+\chapter{${1:chapter name}}
+\label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
+
+${0}
+endsnippet
+
+snippet sec "Section" b
+\section{${1:section name}}
+\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
+
+${0}
+endsnippet
+
+snippet sub "Subsection" b
+\subsection{${1:subsection name}}
+\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
+
+${0}
+endsnippet
+
+snippet ssub "Subsubsection" b
+\subsubsection{${1:subsubsection name}}
+\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
+
+${0}
+endsnippet
+
+snippet par "Paragraph" b
+\paragraph{${1:paragraph name}}
+\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
+
+${0}
+endsnippet
+
+snippet subp "Subparagraph" b
+\subparagraph{${1:subparagraph name}}
+\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}}
+
+${0}
+endsnippet
+
+snippet ni "Non-indented paragraph" b
+\noindent
+${0}
+endsnippet
+
+snippet pac "Package" b
+\usepackage[${1:options}]{${2:package}}$0
+endsnippet
+
+snippet lp "Long parenthesis"
+\left(${1:${VISUAL:contents}}\right)$0
+endsnippet
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/texmath.snippets b/vim/bundle/vim-snippets/UltiSnips/texmath.snippets
new file mode 100644
index 0000000..d0a25e9
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/texmath.snippets
@@ -0,0 +1,56 @@
+priority -50
+
+##############
+# MATH STUFF #
+##############
+snippet eq "Equation" b
+\begin{equation}
+ $0
+\end{equation}
+endsnippet
+
+snippet eqnn "Equation without number" b
+\begin{equation*}
+ $0
+\end{equation*}
+endsnippet
+
+snippet eqa "Equation array" b
+\begin{eqnarray}
+ $1 & $2 & $0
+\end{eqnarray}
+endsnippet
+
+snippet eqann "Equation array without numbers" b
+\begin{eqnarray*}
+ $1 & $2 & $0
+\end{eqnarray*}
+
+endsnippet
+snippet frac "Fraction" w
+\frac{${1:${VISUAL:nom}}}{${2:denom}}
+endsnippet
+
+snippet mat "Smart Matrix"
+\begin{${1:p/b/v/V/B/small}matrix}
+ $0
+\end{$1matrix}
+endsnippet
+
+snippet lr( "left( right)" w
+\left( ${1:${VISUAL}} \right)
+endsnippet
+
+snippet lr| "left| right|" w
+\left| ${1:${VISUAL}} \right|
+endsnippet
+
+snippet lr{ "left\{ right\}" w
+\left\\{ ${1:${VISUAL}} \right\\}
+endsnippet
+
+snippet lr[ "left[ right]" w
+\left[ ${1:${VISUAL}} \right]
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/typescript.snippets b/vim/bundle/vim-snippets/UltiSnips/typescript.snippets
new file mode 100644
index 0000000..11072dd
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/typescript.snippets
@@ -0,0 +1,3 @@
+priority -50
+
+extends javascript
diff --git a/vim/bundle/vim-snippets/UltiSnips/vim.snippets b/vim/bundle/vim-snippets/UltiSnips/vim.snippets
new file mode 100644
index 0000000..dbb2396
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/vim.snippets
@@ -0,0 +1,24 @@
+priority -50
+
+###########################################################################
+# SnipMate Snippets #
+###########################################################################
+snippet gvar "Global / configuration variable" b
+if !exists("g:${1:MyUltraImportantVar}")
+ let g:$1 = ${2:"${3:<tab>}"}
+endif
+endsnippet
+
+snippet guard "script reload guard" b
+if exists('${1:did_`!p snip.rv = snip.fn.replace('.','_')`}') || &cp${2: || version < 700}
+ finish
+endif
+let $1 = 1${3}
+endsnippet
+
+snippet f "function" b
+fun ${1:function_name}(${2})
+ ${3:" code}
+endf
+endsnippet
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/UltiSnips/xhtml.snippets b/vim/bundle/vim-snippets/UltiSnips/xhtml.snippets
new file mode 100644
index 0000000..a9c5a29
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/xhtml.snippets
@@ -0,0 +1,3 @@
+priority -50
+
+extends html
diff --git a/vim/bundle/vim-snippets/UltiSnips/xml.snippets b/vim/bundle/vim-snippets/UltiSnips/xml.snippets
new file mode 100644
index 0000000..92dfb6e
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/xml.snippets
@@ -0,0 +1,16 @@
+priority -50
+
+snippet xml "XML declaration" b
+<?xml version="1.0"?>
+
+endsnippet
+
+snippet t "Simple tag" b
+<${1:tag}>
+ ${2:content}
+</${1/([\w:._-]+).*/$1/}>
+endsnippet
+
+snippet ti "Inline tag" b
+<${1:tag}>${2:content}</${1/([\w:._-]+).*/$1/}>
+endsnippet
diff --git a/vim/bundle/vim-snippets/UltiSnips/zsh.snippets b/vim/bundle/vim-snippets/UltiSnips/zsh.snippets
new file mode 100644
index 0000000..f7986ea
--- /dev/null
+++ b/vim/bundle/vim-snippets/UltiSnips/zsh.snippets
@@ -0,0 +1,17 @@
+priority -50
+
+extends sh
+
+priority -49
+
+snippet #! "shebang" b
+#!/bin/zsh
+
+endsnippet
+
+snippet !env "#!/usr/bin/env (!env)" b
+#!/usr/bin/env zsh
+
+endsnippet
+
+# vim:ft=snippets:
diff --git a/vim/bundle/vim-snippets/addon-info.json b/vim/bundle/vim-snippets/addon-info.json
new file mode 100644
index 0000000..303bf28
--- /dev/null
+++ b/vim/bundle/vim-snippets/addon-info.json
@@ -0,0 +1,9 @@
+{
+ "name" : "snipmate-snippets",
+ "author" : "community",
+ "maintainer" : "honza @ github & others",
+ "repository" : {"type": "git", "url": "git://github.com/honza/snipmate-snippets.git"},
+ "dependencies" : {
+ },
+ "description" : "community driven set of snippets for snipmate"
+}
diff --git a/vim/bundle/vim-snippets/autoload/vim_snippets.vim b/vim/bundle/vim-snippets/autoload/vim_snippets.vim
new file mode 100644
index 0000000..061f171
--- /dev/null
+++ b/vim/bundle/vim-snippets/autoload/vim_snippets.vim
@@ -0,0 +1,27 @@
+" this is well known Filename found in snipmate (and the other engines), but
+" rewritten and documented :)
+"
+" optional arg1: string in which to replace '$1' by filename with extension
+" and path dropped. Defaults to $1
+" optional arg2: return this value if buffer has no filename
+" But why not use the template in this case, too?
+" Doesn't make sense to me
+fun! vim_snippets#Filename(...)
+ let template = get(a:000, 0, "$1")
+ let arg2 = get(a:000, 1, "")
+
+ let basename = expand('%:t:r')
+
+ if basename == ''
+ return arg2
+ else
+ return substitute(template, '$1', basename, 'g')
+ endif
+endf
+
+" original code:
+" fun! Filename(...)
+" let filename = expand('%:t:r')
+" if filename == '' | return a:0 == 2 ? a:2 : '' | endif
+" return !a:0 || a:1 == '' ? filename : substitute(a:1, '$1', filename, 'g')
+" endf
diff --git a/vim/bundle/vim-snippets/plugin/vimsnippets.vim b/vim/bundle/vim-snippets/plugin/vimsnippets.vim
new file mode 100644
index 0000000..f58374c
--- /dev/null
+++ b/vim/bundle/vim-snippets/plugin/vimsnippets.vim
@@ -0,0 +1,50 @@
+if exists("b:done_vimsnippets")
+ finish
+endif
+let b:done_vimsnippets = 1
+
+" Some variables need default value
+if !exists("g:snips_author")
+ let g:snips_author = "yourname"
+endif
+
+if !exists("g:snips_email")
+ let g:snips_email = "yourname@email.com"
+endif
+
+if !exists("g:snips_github")
+ let g:snips_github = "https://github.com/yourname"
+endif
+
+" Expanding the path is not needed on Vim 7.4
+if &cp || version >= 704
+ finish
+endif
+
+" Add pythonx to the python search path if needed (i.e. <= Vim 7.3).
+if !has("python") && !has("python3")
+ finish
+end
+
+" This will fail if UltiSnips is not installed.
+try
+ call UltiSnips#bootstrap#Bootstrap()
+catch /E117/
+ finish
+endtry
+
+
+" This should have been set by UltiSnips, otherwise something is wrong.
+if !exists("g:_uspy")
+ finish
+end
+
+
+" Expand our path
+let s:SourcedFile=expand("<sfile>")
+exec g:_uspy "import vim, os, sys"
+exec g:_uspy "sourced_file = vim.eval('s:SourcedFile')"
+exec g:_uspy "while not os.path.exists(os.path.join(sourced_file, 'pythonx')):
+ \ sourced_file = os.path.dirname(sourced_file)"
+exec g:_uspy "module_path = os.path.join(sourced_file, 'pythonx')"
+exec g:_uspy "sys.path.append(module_path)"
diff --git a/vim/bundle/vim-snippets/pythonx/vimsnippets.py b/vim/bundle/vim-snippets/pythonx/vimsnippets.py
new file mode 100644
index 0000000..6a446a2
--- /dev/null
+++ b/vim/bundle/vim-snippets/pythonx/vimsnippets.py
@@ -0,0 +1,92 @@
+"""Helper methods used in UltiSnips snippets."""
+
+import string, vim
+
+def complete(tab, opts):
+ """
+ get options that start with tab
+
+ :param tab: query string
+ :param opts: list that needs to be completed
+
+ :return: a string that start with tab
+ """
+ msg = "({0})"
+ if tab:
+ opts = [m[len(tab):] for m in opts if m.startswith(tab)]
+ if len(opts) == 1:
+ return opts[0]
+
+ if not len(opts):
+ msg = "{0}"
+ return msg.format("|".join(opts))
+
+def _parse_comments(s):
+ """ Parses vim's comments option to extract comment format """
+ i = iter(s.split(","))
+
+ rv = []
+ try:
+ while True:
+ # get the flags and text of a comment part
+ flags, text = next(i).split(':', 1)
+
+ if len(flags) == 0:
+ rv.append((text, text, text, ""))
+ # parse 3-part comment, but ignore those with O flag
+ elif 's' in flags and 'O' not in flags:
+ ctriple = ["TRIPLE"]
+ indent = ""
+
+ if flags[-1] in string.digits:
+ indent = " " * int(flags[-1])
+ ctriple.append(text)
+
+ flags, text = next(i).split(':', 1)
+ assert flags[0] == 'm'
+ ctriple.append(text)
+
+ flags, text = next(i).split(':', 1)
+ assert flags[0] == 'e'
+ ctriple.append(text)
+ ctriple.append(indent)
+
+ rv.append(ctriple)
+ elif 'b' in flags:
+ if len(text) == 1:
+ rv.insert(0, ("SINGLE_CHAR", text, text, text, ""))
+ except StopIteration:
+ return rv
+
+def get_comment_format():
+ """ Returns a 4-element tuple (first_line, middle_lines, end_line, indent)
+ representing the comment format for the current file.
+
+ It first looks at the 'commentstring', if that ends with %s, it uses that.
+ Otherwise it parses '&comments' and prefers single character comment
+ markers if there are any.
+ """
+ commentstring = vim.eval("&commentstring")
+ if commentstring.endswith("%s"):
+ c = commentstring[:-2]
+ return (c, c, c, "")
+ comments = _parse_comments(vim.eval("&comments"))
+ for c in comments:
+ if c[0] == "SINGLE_CHAR":
+ return c[1:]
+ return comments[0][1:]
+
+
+def make_box(twidth, bwidth=None):
+ b, m, e, i = (s.strip() for s in get_comment_format())
+ bwidth_inner = bwidth - 3 - max(len(b), len(i + e)) if bwidth else twidth + 2
+ sline = b + m + bwidth_inner * m[0] + 2 * m[0]
+ nspaces = (bwidth_inner - twidth) // 2
+ mlines = i + m + " " + " " * nspaces
+ mlinee = " " + " "*(bwidth_inner - twidth - nspaces) + m
+ eline = i + m + bwidth_inner * m[0] + 2 * m[0] + e
+ return sline, mlines, mlinee, eline
+
+def foldmarker():
+ "Return a tuple of (open fold marker, close fold marker)"
+ return vim.eval("&foldmarker").split(",")
diff --git a/vim/bundle/vim-snippets/snippets/_.snippets b/vim/bundle/vim-snippets/snippets/_.snippets
new file mode 100644
index 0000000..0153a14
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/_.snippets
@@ -0,0 +1,281 @@
+# Global snippets
+
+# (c) holds no legal value ;)
+snippet c)
+ Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${1:`g:snips_author`}. All Rights Reserved.
+snippet date
+ `strftime("%Y-%m-%d")`
+snippet ddate
+ `strftime("%B %d, %Y")`
+snippet diso
+ `strftime("%Y-%m-%dT%H:%M:%S")`
+snippet time
+ `strftime("%H:%M")`
+snippet datetime
+ `strftime("%Y-%m-%d %H:%M")`
+snippet lorem
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+snippet GPL2
+ ${1:One line to give the program's name and a brief description.}
+ Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+ ${0}
+snippet LGPL2
+ ${1:One line to give the program's name and a brief description.}
+ Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, see <http://www.gnu.org/licenses/>.
+ ${0}
+snippet GPL3
+ ${1:one line to give the program's name and a brief description.}
+ Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ ${0}
+snippet LGPL3
+ ${1:One line to give the program's name and a brief description.}
+ Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, see <http://www.gnu.org/licenses/>.
+ ${0}
+snippet AGPL3
+ ${1:one line to give the program's name and a brief description.}
+ Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ ${0}
+snippet GMGPL linking exception
+ As a special exception, if other files instantiate generics from
+ this unit, or you link this unit with other files to produce an
+ executable, this unit does not by itself cause the resulting
+ executable to be covered by the GNU General Public License.
+ This exception does not however invalidate any other reasons why the
+ executable file might be covered by the GNU Public License.
+
+ ${0}
+snippet BSD2
+ ${1:one line to give the program's name and a brief description}
+ Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL $2 BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ The views and conclusions contained in the software and documentation
+ are those of the authors and should not be interpreted as representing
+ official policies, either expressedor implied, of $2.
+ ${0}
+snippet BSD3
+ ${1:one line to give the program's name and a brief description}
+ Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the ${3:organization} nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL $2 BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ${0}
+snippet BSD4
+ ${1:one line to give the program's name and a brief description}
+ Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. All advertising materials mentioning features or use of this software
+ must display the following acknowledgement:
+ This product includes software developed by the ${3:organization}.
+ 4. Neither the name of the $3 nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL $2 BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ${0}
+snippet MIT
+ ${1:one line to give the program's name and a brief description}
+ Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+ OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ ${0}
+snippet APACHE
+ ${1:one line to give the program's name and a brief description}
+ Copyright `strftime("%Y")` ${2:`g:snips_author`}
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ${0}
+snippet BEERWARE
+ ${1:one line to give the program's name and a brief description}
+ Copyright `strftime("%Y")` ${2:`g:snips_author`}
+
+ Licensed under the "THE BEER-WARE LICENSE" (Revision 42):
+ $2 wrote this file. As long as you retain this notice you
+ can do whatever you want with this stuff. If we meet some day, and you think
+ this stuff is worth it, you can buy me a beer or coffee in return
+ ${0}
+snippet WTFPL
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ Version 2, December 2004
+
+ Copyright `strftime("%Y")` ${0:`g:snips_author`}
+
+ Everyone is permitted to copy and distribute verbatim or modified
+ copies of this license document, and changing it is allowed as long
+ as the name is changed.
+
+ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. You just DO WHAT THE FUCK YOU WANT TO.
+
+ ${0}
+snippet MPL2
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ ${0}
+snippet AGPL
+ ${1:One line to give the program's name and a brief description.}
+ Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${2:`g:snips_author`}
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/vim/bundle/vim-snippets/snippets/actionscript.snippets b/vim/bundle/vim-snippets/snippets/actionscript.snippets
new file mode 100644
index 0000000..b7aa7cb
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/actionscript.snippets
@@ -0,0 +1,153 @@
+snippet main
+ package {
+ import flash.display.*;
+ import flash.Events.*;
+
+ public class Main extends Sprite {
+ public function Main ( ) {
+ trace("start");
+ stage.scaleMode = StageScaleMode.NO_SCALE;
+ stage.addEventListener(Event.RESIZE, resizeListener);
+ }
+
+ private function resizeListener (e:Event):void {
+ trace("The application window changed size!");
+ trace("New width: " + stage.stageWidth);
+ trace("New height: " + stage.stageHeight);
+ }
+
+ }
+
+ }
+snippet class
+ ${1:public|internal} class ${2:name} ${0:extends } {
+ public function $2 ( ) {
+ ("start");
+ }
+ }
+snippet all
+ package name {
+
+ ${1:public|internal|final} class ${2:name} ${0:extends } {
+ private|public| static const FOO = "abc";
+ private|public| static var BAR = "abc";
+
+ // class initializer - no JIT !! one time setup
+ if Cababilities.os == "Linux|MacOS" {
+ FOO = "other";
+ }
+
+ // constructor:
+ public function $2 ( ){
+ super2();
+ trace("start");
+ }
+ public function name (a, b...){
+ super.name(..);
+ lable:break
+ }
+ }
+ }
+
+ function A(){
+ // A can only be accessed within this file
+ }
+snippet switch
+ switch(${1}){
+ case ${2}:
+ ${0}
+ break;
+ default:
+ }
+snippet case
+ case ${1}:
+ ${0}
+ break;
+snippet package
+ package ${1:package}{
+ ${0}
+ }
+snippet wh
+ while ${1:cond}{
+ ${0}
+ }
+snippet do
+ do {
+ ${0}
+ } while (${1:cond})
+snippet for enumerate names
+ for (${1:var} in ${2:object}){
+ ${0}
+ }
+snippet for enumerate values
+ for each (${1:var} in ${2:object}){
+ ${0}
+ }
+snippet get_set
+ function get ${1:name} {
+ return ${2}
+ }
+ function set $1 (newValue) {
+ ${0}
+ }
+snippet interface
+ interface name {
+ function method(${1}):${0:returntype};
+ }
+snippet try
+ try {
+ ${1}
+ } catch (error:ErrorType) {
+ ${2}
+ } finally {
+ ${0}
+ }
+# For Loop (same as c.snippet)
+snippet for for (..) {..}
+ for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
+ ${0}
+ }
+# Custom For Loop
+snippet forr
+ for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
+ ${0}
+ }
+# If Condition
+snippet if
+ if (${1:/* condition */}) {
+ ${0}
+ }
+snippet el
+ else {
+ ${0}
+ }
+# Ternary conditional
+snippet t
+ ${1:/* condition */} ? ${2:a} : ${0:b}
+snippet fun
+ function ${1:function_name}(${2})${3}
+ {
+ ${0}
+ }
+# FlxSprite (usefull when using the flixel library)
+snippet FlxSprite
+ package
+ {
+ import org.flixel.*
+
+ public class ${1:ClassName} extends ${2:FlxSprite}
+ {
+ public function $1(${3: X:Number, Y:Number}):void
+ {
+ super(X,Y);
+ ${4}
+ }
+
+ override public function update():void
+ {
+ super.update();
+ ${0}
+ }
+ }
+ }
+
diff --git a/vim/bundle/vim-snippets/snippets/ada.snippets b/vim/bundle/vim-snippets/snippets/ada.snippets
new file mode 100644
index 0000000..1039946
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/ada.snippets
@@ -0,0 +1,217 @@
+snippet wi with
+ with ${1};${0}
+
+snippet pac package
+ package ${1} is
+ ${0}
+ end $1;
+
+snippet pacb package body
+ package body ${1} is
+ ${0}
+ end $1;
+
+snippet ent entry ... when
+ entry ${1}(${2}) when ${3} is
+ begin
+ ${0}
+ end $1;
+
+snippet task task
+ task ${1} is
+ entry ${0}
+ end $1;
+
+snippet taskb task body
+ task body ${1} is
+ ${2}
+ begin
+ ${0}
+ end $1;
+
+snippet acc accept
+ accept ${1}(${2}) do
+ ${0}
+ end $1;
+
+snippet prot protected type
+ protected type ${1}(${2}) is
+ ${0}
+ end $1;
+
+snippet prob protected body
+ protected body ${1} is
+ ${2}
+ begin
+ ${0}
+ end $1;
+
+snippet gen generic type
+ generic
+ type ${1} is ${2};${0}
+
+snippet ty type
+ type ${1} is ${2};${0}
+
+snippet tyd type with default value
+ type ${1} is ${2}
+ with Default_Value => ${3};${0}
+
+snippet subty subtype
+ subtype ${1} is ${2};${0}
+
+snippet dec declare block
+ declare
+ ${1}
+ begin
+ ${0}
+ end;
+
+snippet decn declare named block
+ ${1}:
+ declare
+ ${2}
+ begin
+ ${0}
+ end $1;
+
+snippet ifex if expression
+ if ${1} then ${2} else ${0}
+
+snippet casex case expression
+ case ${1} is
+ when ${2} => ${3},${0}
+
+snippet fora for all
+ for all ${1} ${2:in} ${3} => ${0}
+
+snippet fors for some
+ for some ${1} ${2:in} ${3} => ${0}
+
+snippet if if
+ if ${1} then
+ ${0}
+ end if;
+
+snippet ife if ... else
+ if ${1} then
+ ${2}
+ else
+ ${0}
+ end if;
+
+snippet el else
+ else
+ ${0}
+
+snippet eif elsif
+ elsif ${1} then
+ ${0}
+
+snippet wh while
+ while ${1} loop
+ ${0}
+ end loop;
+
+snippet nwh named while
+ ${1}:
+ while ${2} loop
+ ${0}
+ end loop $1;
+
+snippet for for
+ for ${1:I} in ${2} loop
+ ${0}
+ end loop;
+
+snippet fore for each
+ for ${1} of ${2} loop
+ ${0}
+ end loop;
+
+snippet nfor named for
+ ${1}:
+ for ${2:I} in ${3} loop
+ ${0}
+ end loop $1;
+
+snippet nfore named for each
+ ${1}:
+ for ${2} of ${3} loop
+ ${0}
+ end loop $1;
+
+snippet proc procedure
+ procedure ${1}(${2}) is
+ ${3}
+ begin
+ ${0}
+ end $1;
+
+snippet procd procedure declaration
+ procedure ${1};${0}
+
+snippet fun function
+ function ${1}(${2}) return ${3} is
+ ${4}
+ begin
+ ${0}
+ end $1;
+
+snippet fune expression function
+ function ${1} return ${2} is
+ (${3});${0}
+
+snippet fund function declaration
+ function ${1} return ${2};${0}
+
+snippet ret extended return
+ return ${1} do
+ ${0}
+ end return;
+
+snippet rec record
+ record
+ ${0}
+ end record;
+
+snippet case case
+ case ${1} is
+ when ${2} => ${3};${0}
+ end case;
+
+snippet whe when
+ when ${1} => ${2};${0}
+
+snippet wheo when others
+ when others => ${1};${0}
+
+snippet lo loop
+ loop
+ ${0}
+ end loop;
+
+snippet nlo named loop
+ ${1}:
+ loop
+ ${0}
+ end loop $1;
+
+snippet ex exit when
+ exit when ${1};${0}
+
+snippet put Ada.Text_IO.Put
+ Ada.Text_IO.Put(${1});${0}
+
+snippet putl Ada.Text_IO.Put_Line
+ Ada.Text_IO.Put_Line(${1});${0}
+
+snippet get Ada.Text_IO.Get
+ Ada.Text_IO.Get(${1});${0}
+
+snippet getl Ada.Text_IO.Get_Line
+ Ada.Text_IO.Get_Line(${1});${0}
+
+snippet newline Ada.Text_IO.New_Line
+ Ada.Text_IO.New_Line(${1:1});${0}
+
diff --git a/vim/bundle/vim-snippets/snippets/apache.snippets b/vim/bundle/vim-snippets/snippets/apache.snippets
new file mode 100644
index 0000000..db3256e
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/apache.snippets
@@ -0,0 +1,35 @@
+# Snippets for code blocks used oftenly in Apache files.
+# <Directory>
+snippet dir
+ <Directory ${1:/}>
+ DirectoryIndex ${0:index.html}
+ Order Deny,Allow
+ Deny from All
+ </Directory>
+# <FilesMatch>
+snippet filesmatch
+ <FilesMatch "${1:regex}">
+ ${0}
+ </FilesMatch>
+# <IfModule>
+snippet ifmodule
+ <IfModule ${1:mod_example.c}>
+ ${0}
+ </IfModule>
+# <LimitExcept>
+snippet limitexcept
+ <LimitExcept ${1:POST GET}>
+ ${0}
+ </LimitExcept>
+# <Proxy>
+snippet proxy
+ <Proxy ${1:*}>
+ ${0}
+ </Proxy>
+# <VirtualHost>
+snippet virtualhost
+ <VirtualHost ${1:*}:${2:80}>
+ ServerAdmin ${3:webmaster@example.com}
+ DocumentRoot ${4:/www/example.com}
+ ServerName ${0:www.example.com}
+ </VirtualHost>
diff --git a/vim/bundle/vim-snippets/snippets/arduino.snippets b/vim/bundle/vim-snippets/snippets/arduino.snippets
new file mode 100644
index 0000000..77ee46f
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/arduino.snippets
@@ -0,0 +1,106 @@
+snippet setup
+ void setup()
+ {
+ ${0}
+ Serial.begin(9600);
+ }
+
+snippet loop
+ void loop()
+ {
+ ${0}
+ }
+
+snippet inc
+ #include <${1}.h>
+
+# if
+snippet if
+ if (${1:/* condition */}) {
+ ${2}
+ }
+# else
+snippet el
+ else {
+ ${1}
+ }
+# else if
+snippet elif
+ else if (${1:/* condition */}) {
+ ${2}
+ }
+# ifi
+snippet ifi
+ if (${1:/* condition */}) ${2};
+
+# switch
+snippet switch
+ switch (${1:/* variable */}) {
+ case ${2:/* variable case */}:
+ ${3}
+ ${4:break;}${5}
+ default:
+ ${6}
+ }
+
+snippet case
+ case ${1:/* variable case */}:
+ ${2}
+ ${3:break;}
+
+# for
+snippet for
+ for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
+ ${4}
+ }
+# for (custom)
+snippet forr
+ for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
+ ${5}
+ }
+# while
+snippet wh
+ while (${1:/* condition */}) {
+ ${2}
+ }
+# do... while
+snippet do
+ do {
+ ${2}
+ } while (${1:/* condition */});
+##
+## Functions
+# function definition
+snippet fun
+ ${1:void} ${2:function_name}(${3})
+ {
+ ${4}
+ }
+
+## IO
+# pinMode OUTPUT
+snippet pinout
+ pinMode(${1}, OUTPUT);
+# pinMode INPUT
+snippet pinin
+ pinMode(${1}, INPUT);
+# digitalWrite HIGH
+snippet dwHigh
+ digitalWrite(${1}, HIGH);
+# digitalWrite LOW
+snippet dwLow
+ digitalWrite(${1}, LOW);
+# digitalRead
+snippet dr
+ digitalRead(${1});
+# serialRead
+snippet sr
+ serialRead();
+# serial.println
+snippet sp
+ serial.println(${1});
+
+
+# delay
+snippet dl
+ delay(${1});
diff --git a/vim/bundle/vim-snippets/snippets/autoit.snippets b/vim/bundle/vim-snippets/snippets/autoit.snippets
new file mode 100644
index 0000000..f973fbc
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/autoit.snippets
@@ -0,0 +1,66 @@
+snippet if
+ If ${1:condition} Then
+ ${0:; True code}
+ EndIf
+snippet el
+ Else
+ ${0}
+snippet eif
+ ElseIf ${1:condition} Then
+ ${0:; True code}
+# If/Else block
+snippet ife
+ If ${1:condition} Then
+ ${2:; True code}
+ Else
+ ${0:; Else code}
+ EndIf
+# If/ElseIf/Else block - because there is eif this is not really neccessary
+snippet ifelif
+ If ${1:condition 1} Then
+ ${2:; True code}
+ ElseIf ${3:condition 2} Then
+ ${4:; True code}
+ Else
+ ${0:; Else code}
+ EndIf
+# Switch block
+snippet switch
+ Switch (${1:condition})
+ Case ${2:case1}:
+ ${3:; Case 1 code}
+ Case Else:
+ ${0:; Else code}
+ EndSwitch
+# Select block
+snippet select
+ Select (${1:condition})
+ Case ${2:case1}:
+ ${3:; Case 1 code}
+ Case Else:
+ ${0:; Else code}
+ EndSelect
+# While loop
+snippet wh
+ While (${1:condition})
+ ${0:; code...}
+ WEnd
+# For loop
+snippet for
+ For ${1:n} = ${3:1} to ${2:count}
+ ${0:; code...}
+ Next
+# New Function
+snippet func
+ Func ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
+ ${0:Return}
+ EndFunc
+# Message box
+snippet msg
+ MsgBox(${0:MsgType}, ${1:"Title"}, ${2:"Message Text"})
+# Debug Message
+snippet debug
+ MsgBox(0, "Debug", ${0:"Debug Message"})
+# Show Variable Debug Message
+snippet showvar
+ MsgBox(0, "${0:VarName}", $1)
diff --git a/vim/bundle/vim-snippets/snippets/awk.snippets b/vim/bundle/vim-snippets/snippets/awk.snippets
new file mode 100644
index 0000000..32e56f2
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/awk.snippets
@@ -0,0 +1,102 @@
+# cannot use /usr/bin/env because it does not support parameters (as -f)
+snippet #! #!/usr/bin/awk -f
+ #!/usr/bin/awk -f
+
+# @include is a gawk extension
+snippet inc @include
+ @include "${1}"${0}
+
+# @load is a gawk extension
+snippet loa @load
+ @load "${1}"${0}
+
+snippet beg BEGIN { ... }
+ BEGIN {
+ ${0}
+ }
+
+# BEGINFILE is a gawk extension
+snippet begf BEGINFILE { ... }
+ BEGINFILE {
+ ${0}
+ }
+
+snippet end END { ... }
+ END {
+ ${0}
+ }
+
+# ENDFILE is a gawk extension
+snippet endf ENDFILE { ... }
+ ENDFILE {
+ ${0}
+ }
+
+snippet pri print
+ print ${1:"${2}"}${0}
+
+snippet printf printf
+ printf("${1:%s}\n", ${2})${0}
+
+snippet ign IGNORECASE
+ IGNORECASE = ${1:1}
+
+snippet if if {...}
+ if (${1}) {
+ ${0}
+ }
+
+snippet ife if ... else ...
+ if (${1}) {
+ ${2}
+ } else {
+ ${0}
+ }
+
+snippet eif else if ...
+ else if (${1}) {
+ ${0}
+ }
+
+snippet el else {...}
+ else {
+ ${0}
+ }
+
+snippet wh while
+ while (${1}) {
+ ${2}
+ }
+
+snippet do do ... while
+ do {
+ ${0}
+ } while (${1})
+
+snippet for for
+ for (${2:i} = 0; i < ${1:n}; ${3:++i}) {
+ ${0}
+ }
+
+snippet fore for each
+ for (${1:i} in ${2:array}) {
+ ${0}
+ }
+
+# the switch is a gawk extension
+snippet sw switch
+ switch (${1}) {
+ case ${2}:
+ ${3}
+ break
+ default:
+ ${0}
+ break
+ }
+
+# the switch is a gawk extension
+snippet case case
+ case ${1}:
+ ${0}
+ break
+
diff --git a/vim/bundle/vim-snippets/snippets/c.snippets b/vim/bundle/vim-snippets/snippets/c.snippets
new file mode 100644
index 0000000..f4745c2
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/c.snippets
@@ -0,0 +1,228 @@
+## Main
+# main
+snippet main
+ int main(int argc, const char *argv[])
+ {
+ ${0}
+ return 0;
+ }
+# main(void)
+snippet mainn
+ int main(void)
+ {
+ ${0}
+ return 0;
+ }
+##
+## Preprocessor
+# #include <...>
+snippet inc
+ #include <${1:stdio}.h>
+# #include "..."
+snippet Inc
+ #include "${1:`vim_snippets#Filename("$1.h")`}"
+# ifndef...define...endif
+snippet ndef
+ #ifndef $1
+ #define ${1:SYMBOL} ${2:value}
+ #endif /* ifndef $1 */
+# define
+snippet def
+ #define
+# ifdef...endif
+snippet ifdef
+ #ifdef ${1:FOO}
+ ${2:#define }
+ #endif
+# if
+snippet #if
+ #if ${1:FOO}
+ ${0}
+ #endif
+# header include guard
+snippet once
+ #ifndef ${1:`toupper(vim_snippets#Filename('$1_H', 'UNTITLED_H'))`}
+
+ #define $1
+
+ ${0}
+
+ #endif /* end of include guard: $1 */
+##
+## Control Statements
+# if
+snippet if
+ if (${1:true}) {
+ ${0}
+ }
+snippet ife
+ if (${1:true}) {
+ ${2}
+ } else {
+ ${0}
+ }
+# else
+snippet el
+ else {
+ ${0}
+ }
+# else if
+snippet elif
+ else if (${1:true}) {
+ ${0}
+ }
+# ifi
+snippet ifi
+ if (${1:true}) ${0};
+# ternary
+snippet t
+ ${1:/* condition */} ? ${2:a} : ${3:b}
+# switch
+snippet switch
+ switch (${1:/* variable */}) {
+ case ${2:/* variable case */}:
+ ${3}
+ ${4:break;}${5}
+ default:
+ ${6}
+ }
+# switch without default
+snippet switchndef
+ switch (${1:/* variable */}) {
+ case ${2:/* variable case */}:
+ ${3}
+ ${4:break;}${5}
+ }
+# case
+snippet case
+ case ${1:/* variable case */}:
+ ${2}
+ ${3:break;}
+snippet ret
+ return ${0};
+##
+## Loops
+# for
+snippet for
+ for (${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
+ ${4}
+ }
+# for (custom)
+snippet forr
+ for (${1:i} = ${2:0}; ${3:$1 < 10}; $1${4:++}) {
+ ${5}
+ }
+# while
+snippet wh
+ while (${1:/* condition */}) {
+ ${2}
+ }
+# do... while
+snippet do
+ do {
+ ${2}
+ } while (${1:/* condition */});
+##
+## Functions
+# function definition
+snippet fun
+ ${1:void} ${2:function_name}(${3})
+ {
+ ${4}
+ }
+# function declaration
+snippet fund
+ ${1:void} ${2:function_name}(${3});
+##
+## Types
+# typedef
+snippet td
+ typedef ${1:int} ${2:MyCustomType};
+# struct
+snippet st
+ struct ${1:`vim_snippets#Filename('$1_t', 'name')`} {
+ ${2:/* data */}
+ }${3: /* optional variable list */};
+# typedef struct
+snippet tds
+ typedef struct ${2:_$1 }{
+ ${3:/* data */}
+ } ${1:`vim_snippets#Filename('$1_t', 'name')`};
+
+snippet enum
+ enum ${1:name} { ${0} };
+# typedef enum
+snippet tde
+ typedef enum {
+ ${1:/* data */}
+ } ${2:foo};
+##
+## Input/Output
+# printf
+snippet pr
+ printf("${1:%s}\n"${2});
+# fprintf (again, this isn't as nice as TextMate's version, but it works)
+snippet fpr
+ fprintf(${1:stderr}, "${2:%s}\n"${3});
+# getopt
+snippet getopt
+ int choice;
+ while (1)
+ {
+ static struct option long_options[] =
+ {
+ /* Use flags like so:
+ {"verbose", no_argument, &verbose_flag, 'V'}*/
+ /* Argument styles: no_argument, required_argument, optional_argument */
+ {"version", no_argument, 0, 'v'},
+ {"help", no_argument, 0, 'h'},
+ ${1}
+ {0,0,0,0}
+ };
+
+ int option_index = 0;
+
+ /* Argument parameters:
+ no_argument: " "
+ required_argument: ":"
+ optional_argument: "::" */
+
+ choice = getopt_long( argc, argv, "vh",
+ long_options, &option_index);
+
+ if (choice == -1)
+ break;
+
+ switch( choice )
+ {
+ case 'v':
+ ${2}
+ break;
+
+ case 'h':
+ ${3}
+ break;
+
+ case '?':
+ /* getopt_long will have already printed an error */
+ break;
+
+ default:
+ /* Not sure how to get here... */
+ return EXIT_FAILURE;
+ }
+ }
+
+ /* Deal with non-option arguments here */
+ if ( optind < argc )
+ {
+ while ( optind < argc )
+ {
+ ${0}
+ }
+ }
+##
+## Miscellaneous
+# This is kind of convenient
+snippet .
+ [${1}]
diff --git a/vim/bundle/vim-snippets/snippets/chef.snippets b/vim/bundle/vim-snippets/snippets/chef.snippets
new file mode 100644
index 0000000..429146a
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/chef.snippets
@@ -0,0 +1,204 @@
+# Opscode Chef Cookbook Recipe Resources
+# Snippet by: Mike Smullin <mike@smullindesign.com>
+# Based on: http://wiki.opscode.com/display/chef/Resources
+
+# @TODO: Include Meta attributes and actions in all snippets
+# @TODO: Finish writing snippets for remaining Resources
+
+snippet cookbook_file
+ # Cookbook File resource
+ cookbook_file ${1:"/path/to/file"} do # The remote path where the file will reside
+ ${2:#}backup ${3} # How many backups of this file to keep. Set to false if you want no backups
+ ${4:#}group ${5} # The group owner of the file (string or id)
+ ${6:#}mode ${7} # The octal mode of the file - e.g. 0755
+ ${8:#}owner ${9} # The owner for the file
+ ${10:#}source ${11} # The basename of the source file
+ ${12:#}cookbook ${13} # The cookbook this file is stored in
+
+ ${14:#}${15: action :create} # Create this file (Default)
+ ${16:#}${17: action :create_if_missing} # Create only if it doesn't exist yet
+ ${18:#}${0: action :delete} # Delete this file
+ end
+
+snippet execute
+ # Execute resource
+ execute ${1:"command to execute"} do # The command to execute
+ ${2:#}creates ${3:nil} # A file this command creates - if the file exists, the command will not be run.
+ ${4:#}cwd ${5:nil} # Current working directory to run the command from.
+ ${6:#}environment ${7:nil} # A hash of environment variables to set before running this command.
+ ${8:#}group ${9:nil} # A group name or group ID that we should change to before running this command.
+ ${10:#}path ${11:nil} # An array of paths to use when searching for the command. Nil uses system path.
+ ${12:#}returns ${13:0} # The return value of the command - this resource raises an exception if the return value does not match.
+ ${14:#}timeout ${15:nil} # How many seconds to let the command run before timing it out.
+ ${16:#}user ${17:nil} # A user name or user ID that we should change to before running this command.
+ ${18:#}umask ${19:nil} # Umask for files created by the command
+
+ ${20:#}${21:action :run} # Run this command (Default)
+ ${22:#}${0:action :nothing} # Do not run this command
+ end
+
+snippet link
+ # Link resource
+ link ${1:"/target/file"} do # The file name of the link
+ ${2:#}to ${3} # The real file you want to link to
+ ${4:#}link_type ${5:symbolic} # Either :symbolic or :hard
+ ${6:#}owner ${7} # The owner of the symlink
+ ${8:#}group ${9} # The group of the symlink
+
+ ${10:#}${11:action :create} # Create a link (Default)
+ ${12:#}${0:action :delete} # Delete a link
+ end
+
+snippet package
+ # Package resource
+ package ${1:"package_name"} do # Name of the package to install
+ ${2:#}version ${3:nil} # The version of the package to install/upgrade
+ ${4:#}response_file ${5:nil} # An optional response file - used to pre-seed packages (note: the file is fetched by Remote File)
+ ${6:#}source ${7} # Used to provide an optional package source for providers that use a local file (rubygems, dpkg and rpm)
+ ${8:#}options ${9:nil} # Add additional options to the underlying package command
+ ${10:#}gem_binary ${11:gem} # A gem_package attribut to specify a gem binary. Useful for installing ruby 1.9 gems while running chef in ruby 1.8
+
+ ${12:#}${13:action :install} # Install a package - if version is provided, install that specific version (Default)
+ ${14:#}${15:action :upgrade} # Upgrade a package - if version is provided, upgrade to that specific version
+ ${16:#}${17:action :remove} # Remove a package
+ ${18:#}${0:action :purge} # Purge a package (this usually entails removing configuration files as well as the package itself)
+ end
+
+snippet service
+ # Service resource
+ service ${1:"service_name"} do # Name of the service
+ ${2:#}enabled ${3:nil} # Whether the service is enabled at boot time
+ ${4:#}running ${5:nil} # Make sure the service is running. Start if stopped
+ ${6:#}pattern ${7} # Pattern to look for in the process table
+ ${8:#}start_command ${9:nil} # Command used to start this service
+ ${10:#}stop_command ${11:nil} # Command used to stop this service
+ ${12:#}status_command ${13:nil} # Command used to check the service run status
+ ${14:#}restart_command ${15:nil} # Command used to restart this service
+ ${16:#}reload_command ${17:nil} # Command used to tell this service to reload its configuration
+ ${18:#}supports ${19:false} # Features this service supports, ie :restart, :reload, :status
+
+ ${20:#}${21:action :enable} # Enable this service
+ ${22:#}${23:action :disable} # Disable this service
+ ${24:#}${25:action :nothing} # Don't do anything with this service (Default)
+ ${26:#}${27:action :start} # Start this service
+ ${28:#}${29:action :stop} # Stop this service
+ ${30:#}${31:action :restart} # Restart this service
+ ${32:#}${0:action :reload} # Reload the configuration for this service
+ end
+
+snippet file
+ # File resource
+ file ${1:"/path/to/file"} do # Path to the file
+ ${2:#}backup ${3:5} # How many backups of this file to keep. Set to false if you want no backups.
+ ${4:#}owner ${5} # The owner for the file
+ ${6:#}group ${7} # The group owner of the file (string or id)
+ ${8:#}mode ${9} # The octal mode of the file (4-digit format)
+ ${10:#}content ${11:nil} # A string to write to the file. This will replace any previous content if set
+
+ ${12:#}${13:action :create} # Create this file (Default)
+ ${14:#}${15:action :delete} # Delete this file
+ ${16:#}${0:action :touch} # Touch this file (update the mtime/atime)
+ end
+
+snippet directory
+ # Directory resource
+ directory ${1:"/path/to/dir"} do # The path to the directory
+ ${2:#}group ${3} # The group owner of the directory (string or id)
+ ${4:#}mode ${5} # The octal mode of the directory, eg 0755
+ ${6:#}owner ${7} # The owner for the directory
+ ${10:#}recursive ${11:false} # When deleting the directory, delete it recursively. When creating the directory, create recursively (ie, mkdir -p)
+
+ ${12:#}${13:action :create} # Create this directory (Default)
+ ${14:#}${0:action :delete} # Delete this directory
+ end
+
+snippet template
+ # Template resource
+ template ${1:"/path/to/file"} do # Path to the file
+ ${2:#}cookbook ${3:nil} # Specify the cookbook where the template is located, default is current cookbook
+ ${4:#}source ${5:nil} # Template source file. Found in templates/default for the cookbook
+ ${6:#}variables ${7} # Variables to use in the template
+ ${8:#}local ${9:false} # Is the template already present on the node?
+ ${10:#}backup ${11:5} # How many backups of this file to keep. Set to false if you want no backups.
+ ${12:#}owner ${13} # The owner for the file
+ ${14:#}group ${15} # The group owner of the file (string or id)
+ ${16:#}mode ${17} # The octal mode of the file (4-digit format)
+ ${18:#}content ${19:nil} # A string to write to the file. This will replace any previous content if set
+
+ ${20:#}${21:action :create} # Create the file (Default)
+ ${22:#}${23:action :delete} # Delete this file
+ ${24:#}${0:action :touch} # Touch this file (update the mtime/atime)
+ end
+
+snippet svn
+ # SCM Resource, Chef::Provider::Subversion
+ svn ${1:"/destination/path"} do # Path to clone/checkout/export the source to
+ ${2:#}repository ${3} # URI of the repository
+ ${4:#}revision ${5:"HEAD"} # revision to checkout. can be symbolic, like "HEAD" or an SCM specific revision id
+ ${6:#}reference ${7} # (Git only) alias for revision
+ ${8:#}user ${9:nil} # System user to own the checked out code
+ ${10:#}group ${11:nil} # System group to own the checked out code
+ ${12:#}svn_username ${13} # (Subversion only) Username for Subversion operations
+ ${14:#}svn_password ${15} # (Subversion only) Password for Subversion operations
+ ${16:#}svn_arguments ${17} # (Subversion only) Extra arguments passed to the subversion command
+
+ ${18:#}${19:action :sync} # Update the source to the specified revision, or get a new checkout (Default)
+ ${20:#}${21:action :checkout} # Checkout the source. Does nothing if a checkout is available
+ ${22:#}${0:action :export} # Export the source, excluding or removing any version control artifacts
+ end
+
+snippet git
+ # SCM Resource, Chef::Provider::Git
+ git ${1:"/destination/path"} do # Path to clone/checkout/export the source to
+ ${2:#}repository ${3} # URI of the repository
+ ${4:#}revision ${5:"HEAD"} # revision to checkout. can be symbolic, like "HEAD" or an SCM specific revision id
+ ${6:#}reference ${7} # (Git only) alias for revision
+ ${8:#}user ${9:nil} # System user to own the checked out code
+ ${10:#}group ${11:nil} # System group to own the checked out code
+ ${12:#}depth ${13:nil} # (Git only) Number of past revisions to include in Git shallow clone
+ ${14:#}enable_submodules ${15:"false"} # (Git only) performs a submodule init and submodule update
+ ${16:#}remote ${17:"origin"} # (Git only) remote repository to use for syncing an existing clone
+ ${18:#}ssh_wrapper ${19} # (Git only) path to a wrapper script for running SSH with git. GIT_SSH environment variable is set to this.
+
+ ${20:#}${21:action :sync} # Update the source to the specified revision, or get a new clone (Default)
+ ${22:#}${23:action :checkout} # Clone the source. Does nothing if a checkout is available
+ ${24:#}${0:action :export} # Export the source, excluding or removing any version control artifacts
+ end
+
+snippet deploy
+ # Deploy resource
+ deploy ${1:"/deploy/dir/"} do # Path to deploy to
+ ${2:#}deploy_to ${3} # The "meta root" for your application.
+ ${4:#}repository ${5} # URI of the repository
+ ${6:#}repo ${7} # alias for repository
+ ${8:#}revision ${9:"HEAD"} # revision to checkout. can be symbolic, like "HEAD" or an SCM specific revision id
+ ${10:#}branch ${11} # alias for revision
+ ${12:#}user ${13:nil} # System user to run the deploy as
+ ${14:#}group ${15:nil} # System group to run the deploy as
+ ${16:#}svn_username ${17} # (Subversion only) Username for Subversion operations}
+ ${18:#}svn_password ${19} # (Subversion only) Password for Subversion operations}
+ ${20:#}svn_arguments ${21} # (Subversion only) Extra arguments passed to the subversion command}
+ ${22:#}shallow_clone ${23:nil} # (Git only) boolean, true sets clone depth to 5
+ ${24:#}enable_submodules ${25:false} # (Git only) performs a submodule init and submodule update
+ ${26:#}remote ${27:"origin"} # (Git only) remote repository to use for syncing an existing clone
+ ${28:#}ssh_wrapper ${29} # (Git only) path to a wrapper script for running SSH with git. GIT_SSH environment variable is set to this.
+ ${30:#}git_ssh_wrapper ${31} # alias for ssh_wrapper
+ ${32:#}scm_provider ${33:Chef::Provider::Git} # SCM Provider to use.
+ ${34:#}repository_cache ${35: "cached-copy"} # Name of the subdirectory where the pristine copy of your app's source is kept
+ ${36:#}environment ${37} # A hash of the form {"ENV_VARIABLE"=>"VALUE"}}
+ ${38:#}purge_before_symlink ${39:%w(log tmp/pids public/system)} # An array of paths, relative to app root, to be removed from a checkout before symlinking
+ ${40:#}create_dirs_before_symlink ${41:%w(tmp public config)} # Directories to create before symlinking. Runs after purge_before_symlink
+ ${42:#}symlinks ${43:"system" => "public/system", "pids" => "tmp/pids", "log" => "log"} # A hash that maps files in the shared directory to their paths in the current release
+ ${44:#}symlink_before_migrate ${45:"config/database.yml" => "config/database.yml"} # A hash that maps files in the shared directory into the current release. Runs before migration
+ ${46:#}migrate ${47:false} # Should the migration command be executed? (true or false)
+ ${48:#}migration_command ${49} # A string containing a shell command to execute to run the migration
+ ${50:#}restart_command ${51:nil} # A code block to evaluate or a string containing a shell command
+ ${52:#}before_migrate ${53:"deploy/before_migrate.rb"} # A block or path to a file containing chef code to run before migrating
+ ${54:#}before_symlink ${55:"deploy/before_symlink.rb"} # A block or path to a file containing chef code to run before symlinking
+ ${56:#}before_restart ${57:"deploy/before_restart.rb"} # A block or path to a file containing chef code to run before restarting
+ ${58:#}after_restart ${59:"deploy/after_restart.rb"} # A block or path to a file containing chef code to run after restarting
+
+ ${60:#}${61::deploy} # Deploy the application (Default)
+ ${62:#}${63::force_deploy} # For the revision deploy strategy, this removes any existing release of the same code version and re-deploys in its place
+ ${64:#}${0::rollback} # Rollback the application to the previous release
+ end
diff --git a/vim/bundle/vim-snippets/snippets/clojure.snippets b/vim/bundle/vim-snippets/snippets/clojure.snippets
new file mode 100644
index 0000000..152f896
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/clojure.snippets
@@ -0,0 +1,87 @@
+snippet comm
+ (comment
+ ${0})
+snippet condp
+ (condp ${1:pred} ${2:expr}
+ ${0})
+snippet def
+ (def ${0})
+snippet defm
+ (defmethod ${1:multifn} "${2:doc-string}" ${3:dispatch-val} [${4:args}]
+ ${0})
+snippet defmm
+ (defmulti ${1:name} "${2:doc-string}" ${0:dispatch-fn})
+snippet defma
+ (defmacro ${1:name} "${2:doc-string}" ${0:dispatch-fn})
+snippet defn
+ (defn ${1:name} "${2:doc-string}" [${3:arg-list}]
+ ${0})
+snippet defp
+ (defprotocol ${1:name}
+ ${0})
+snippet defr
+ (defrecord ${1:name} [${2:fields}]
+ ${3:protocol}
+ ${0})
+snippet deft
+ (deftest ${1:name}
+ (is (= ${0:assertion})))
+snippet is
+ (is (= ${1} ${0}))
+snippet defty
+ (deftype ${1:Name} [${2:fields}]
+ ${3:Protocol}
+ ${0})
+snippet doseq
+ (doseq [${1:elem} ${2:coll}]
+ ${0})
+snippet fn
+ (fn [${1:arg-list}] ${0})
+snippet if
+ (if ${1:test-expr}
+ ${2:then-expr}
+ ${0:else-expr})
+snippet if-let
+ (if-let [${1:result} ${2:test-expr}]
+ (${3:then-expr} $1)
+ (${0:else-expr}))
+snippet imp
+ (:import [${1:package}])
+ & {:keys [${1:keys}] :or {${0:defaults}}}
+snippet let
+ (let [${1:name} ${2:expr}]
+ ${0})
+snippet letfn
+ (letfn [(${1:name}) [${2:args}]
+ ${0})])
+snippet map
+ (map ${1:func} ${0:coll})
+snippet mapl
+ (map #(${1:lambda}) ${0:coll})
+snippet met
+ (${1:name} [${2:this} ${3:args}]
+ ${0})
+snippet ns
+ (ns ${0:name})
+snippet dotimes
+ (dotimes [_ 10]
+ (time
+ (dotimes [_ ${1:times}]
+ ${0})))
+snippet pmethod
+ (${1:name} [${2:this} ${0:args}])
+snippet refer
+ (:refer-clojure :exclude [${0}])
+snippet require
+ (:require [${1:namespace} :as [${0}]])
+snippet use
+ (:use [${1:namespace} :only [${0}]])
+snippet print
+ (println ${0})
+snippet reduce
+ (reduce ${1:(fn [p n] ${3})} ${2})
+snippet when
+ (when ${1:test} ${0:body})
+snippet when-let
+ (when-let [${1:result} ${2:test}]
+ ${0:body})
diff --git a/vim/bundle/vim-snippets/snippets/cmake.snippets b/vim/bundle/vim-snippets/snippets/cmake.snippets
new file mode 100644
index 0000000..3a0b920
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/cmake.snippets
@@ -0,0 +1,83 @@
+snippet init
+ cmake_minimum_required(version ${1:2.8.2})
+ project(${2:ProjectName})
+
+ find_package(${3:library})
+
+ include_directories(${$3_INCLUDE_DIRS})
+
+ add_subdirectory(${0:src})
+
+ add_executable($2)
+
+ target_link_libraries($2 ${$3_LIBRARIES})
+
+snippet proj
+ project(${0:Name})
+
+snippet min
+ cmake_minimum_required(version ${0:2.8.2})
+
+snippet include
+ include_directories(${${0:include_dir}})
+
+snippet find
+ find_package(${1:library} ${0:REQUIRED})
+
+snippet glob
+ file(glob ${1:srcs} *.${0:cpp})
+
+snippet subdir
+ add_subdirectory(${0:src})
+
+snippet lib
+ add_library(${1:lib} ${${0:srcs}})
+
+snippet link
+ target_link_libraries(${1:bin} ${0:somelib})
+
+snippet bin
+ add_executable(${1:bin})
+
+snippet set
+ set(${1:var} ${0:val})
+
+snippet dep
+ add_dependencies(${1:target}
+ ${0:dep}
+ )
+
+snippet Ext_url
+ include(ExternalProject)
+ ExternalProject_Add(${1:googletest}
+ URL ${2:http://googletest.googlecode.com/files/gtest-1.7.0.zip}
+ URL_HASH SHA1=${3:f85f6d2481e2c6c4a18539e391aa4ea8ab0394af}
+ SOURCE_DIR "${4:${CMAKE_BINARY_DIR}/gtest-src}"
+ BINARY_DIR "${0:${CMAKE_BINARY_DIR}/gtest-build}"
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ TEST_COMMAND ""
+ )
+
+snippet Ext_git
+ include(ExternalProject)
+ ExternalProject_Add(${1:googletest}
+ GIT_REPOSITORY ${2:https://github.com/google/googletest.git}
+ GIT_TAG ${3:master}
+ SOURCE_DIR "${4:${CMAKE_BINARY_DIR}/googletest-src}"
+ BINARY_DIR "${0:${CMAKE_BINARY_DIR}/googletest-build}"
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ TEST_COMMAND ""
+ )
+
+snippet props
+ set_target_properties(${1:target}
+ ${2:properties} ${3:compile_flags}
+ ${0:"-O3 -Wall -pedantic"}
+ )
+
+snippet test
+ add_test(${1:ATestName} ${0:testCommand --options})
diff --git a/vim/bundle/vim-snippets/snippets/codeigniter.snippets b/vim/bundle/vim-snippets/snippets/codeigniter.snippets
new file mode 100644
index 0000000..c38aa4d
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/codeigniter.snippets
@@ -0,0 +1,171 @@
+# Based on nebjak/snipmate.vim/snippets/php.snippets
+
+# Controller
+snippet ci_controller
+ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+ class ${1:ClassName} extends CI_Controller
+ {
+ function __construct()
+ {
+ parent::__construct();
+ ${2:// code...}
+ }
+
+ function ${3:index}()
+ {
+ ${4:// code...}
+ }
+ }
+# Model
+snippet ci_model
+ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+ class ${1:ClassName_model} extends CI_Model
+ {
+ function __construct()
+ {
+ parent::__construct();
+ ${2:// code...}
+ }
+ }
+snippet ci_model_crudl
+ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+ class ${1:ClassName_model} extends CI_Model
+ {
+ private $table = '${2:table_name}';
+
+ function __construct()
+ {
+ parent::__construct();
+ ${3:// code...}
+ }
+
+ public function create($data)
+ {
+ if($this->db->insert($this->table, $data))
+ return true;
+ else
+ return false;
+ }
+
+ public function read($id)
+ {
+ return $this->db->get_where($this->table, array('id', $id))->result();
+ }
+
+ public function update($id, $data)
+ {
+ if($this->db->update($this->table, $data, array('id' => $id)))
+ return true;
+ else
+ return false;
+ }
+
+ public function delete($id)
+ {
+ if(is_array($id))
+ {
+ $this->db->trans_start();
+ foreach($id as $elem)
+ $this->db->delete($this->table, array('id' => $elem));
+ $this->db->trans_complete();
+ }
+ else
+ {
+ if($this->db->delete($this->table, array('id' => $id)))
+ return true;
+ else
+ return false;
+ }
+ }
+
+ public function listRows($limit = null, $offset = 0)
+ {
+ if(!is_null($limit))
+ $this->db->limit($limit, $offset);
+ return $this->db->get($this->table)->result();
+ }
+ }
+# Load view
+snippet ci_load-view
+ $this->load->view("${1:view_name}", $${2:data});${3}
+# DB Class snippets
+snippet ci_db-insert
+ $this->db->insert("${1:table}", $${2:data});${3}
+snippet ci_db-select
+ $this->db->select("${1:id, ...}");${2}
+snippet ci_db-from
+ $this->db->from("${1:table}");${2}
+snippet ci_db-join
+ $this->db->join("${1:table}", "${2:condition}", "${3:type}");${4}
+snippet ci_db-where
+ $this->db->where("${1:key}", "${2:value}");${3}
+snippet ci_db-or_where
+ $this->db->or_where("${1:key}", "${2:value}");${3}
+snippet ci_db-get
+ $this->db->get("${1:table}", ${2:limit}, ${3:offset});${4}
+snippet ci_db-delete
+ $this->db->delete("${1:table}", "${2:where}");${3}
+snippet ci_db-update
+ $this->db->update("${1:table}", $${2:set}, $${3:where});${4}
+# Input Class snippets
+snippet ci_input-post
+ $this->input->post("${1:index}");${2}
+snippet ci_input-get
+ $this->input->get("${1:index}");${2}
+snippet ci_input-cookie
+ $this->input->cookie("${1:index}");${2}
+snippet ci_input-server
+ $this->input->server("${1:index}");${2}
+snippet ci_input-user_agent
+ $this->input->user_agent();${1}
+snippet ci_input-is_ajax_request
+ $this->input->is_ajax_request();${1}
+snippet ci_input-is_cli_request
+ $this->input->is_cli_request();${1}
+# Form Validation Class and Form Helper snippets
+snippet ci_form_validation-set_rules
+ $this->form_validation->set_rules("${1:field}", "${2:label}", "${3:trim|required}");${4}
+snippet ci_form_open
+ form_open("${1:action}");${2}
+snippet ci_form_open_multipart
+ form_open_multipart("${1:action}");${2}
+snippet ci_form_hidden
+ form_hidden("${1:name}", "${2:value}");${3}
+snippet ci_form_input
+ form_input("${1:name}", "${2:value}");${3}
+snippet ci_form_password
+ form_password("${1:name}", "${2:value}");${3}
+snippet ci_form_upload
+ form_upload("${1:name}", "${2:value}");${3}
+snippet ci_form_textarea
+ form_textarea("${1:name}", "${2:value}");${3}
+snippet ci_form_dropdown
+ form_dropdown("${1:name}", $${2:options}, $${3:selected);${4}
+snippet ci_form_checkbox
+ form_checkbox("${1:name}", "${2:value}");${3}
+snippet ci_form_radio
+ form_radio("${1:name}", "${2:value}");${3}
+snippet ci_form_submit
+ form_submit("${1:name}", "${2:value}");${3}
+snippet ci_form_reset
+ form_reset("${1:name}", "${2:value}");${3}
+snippet ci_form_button
+ form_button("${1:name}", "${2:value}");${3}
+snippet ci_form_label
+ form_label("${1:label text}", "${2:id}");${3}
+snippet ci_form_close
+ form_close();${1}
+snippet ci_validation_errors
+ validation_errors();${1}
+# Session Class snippets
+snippet ci_session_userdata
+ $this->session->userdata("${1:item}");${2}
+snippet ci_session_set_userdata
+ $this->session->set_userdata($${1:array});${2}
+snippet ci_session_flashdata
+ $this->session->flashdata("${1:item}");${2}
+snippet ci_session_set_flashdata
+ $this->session->set_flashdata("${1:item}", "${2:value}");${3}
diff --git a/vim/bundle/vim-snippets/snippets/coffee/angular_coffee.snippets b/vim/bundle/vim-snippets/snippets/coffee/angular_coffee.snippets
new file mode 100644
index 0000000..f98cae3
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/coffee/angular_coffee.snippets
@@ -0,0 +1,116 @@
+## Global Snippets
+# Define a new Angular Controller;
+# You can change the controller name and parameters
+snippet ngc
+ ${1:controllerName} = (${2:scope}, ${3:injectables}) ->
+ ${4}
+# angular.foreach loop
+snippet ngfor
+ angular.forEach ${1:iterateOver}, (value, key) ->
+ ${2}
+## Module Based Snippets
+# A new angular module without a config function
+snippet ngm
+ angular.module '${1:moduleName}', [${2:moduleDependencies}]
+ ${3}
+# A new angular module without a config function and a variable assignment
+snippet ngma
+ ${1:moduleName} = angular.module '$1', [${2:moduleDeps}]
+ ${3}
+# A new angular module with a config function
+snippet ngmc
+ ${1:moduleName} = angular.module('$1', [${2:moduleDeps}], (${3:configDeps}) ->
+ ${4}
+ )
+# A factory in a module
+snippet ngmfa
+ factory '${1:factoryName}', (${2:dependencies}) ->
+ ${3}
+# Define an Angular Module Service to be attached to a previously defined module
+# You can change the service name and service injectables
+snippet ngms
+ service '${1:serviceName}', (${2:injectables}) ->
+ ${3}
+# Define an Angular Module Filter to be attached to a previously defined module
+# You can change the filter name
+snippet ngmfi
+ filter '${1:filterName}', (${2:injectables}) ->
+ (input, ${3:args}) ->
+ ${4}
+## Route Based Snippets
+# Defines a when condition of an AngularJS route
+snippet ngrw
+ $routeProvider.when '${1:url}',
+ templateUrl: '${2:templateUrl}'
+ controller: '${3:controller}'
+ ${4}
+# Defines a when condition of an AngularJS route with the resolve block
+snippet ngrwr
+ $routeProvider.when '${1:url}',
+ templateUrl: '${2:templateUrl}'
+ controller: '${3:controller}'
+ resolve:
+ ${4}
+ ${5}
+# Defines an otherwise condition of an AngularJS route
+snippet ngro
+ $routeProvider.otherwise redirectTo: '${1:url}'
+ ${2}
+## Scope Related Snippets
+# Define a new $scope'd function (usually inside an AngularJS Controller)
+# You can change the function name and arguments
+snippet $f
+ $scope.${1:functionName} = (${2:args}) ->
+ ${3}
+# Defines a new $scope'd variable inside an AngularJS controller
+snippet $v
+ $scope.${1:variable} = ${2:value}
+ ${3}
+# Defines a new $scope'd variable inside an AngularJS controller and assigns a value from a constructor arguments
+snippet $va
+ $scope.${1:variable} = ${2:variable}
+ ${3}
+# Define a $watch for an expression
+# You can change the expression to be watched
+snippet $w
+ $scope.$watch '${1:watchExpr}', (newValue, oldValue) ->
+ ${2}
+# Define a $on for a $broadcast/$emit on the $scope inside an Angular Controller
+# You can change the event name to listen on
+snippet $on
+ $scope.$on '${1:eventName}', (event, ${2:args}) ->
+ ${3}
+# Define a $broadcast for a $scope inside an Angular Controller / Angular Controller Function
+# You can change the event name and optional event arguments
+snippet $b
+ $scope.$broadcast '${1:eventName}', ${2:eventArgs}
+ ${3}
+# Define an $emit for a $scope inside an Angular Controller / Angular Controller Function
+# You can change the event name and optional event arguments
+snippet $e
+ $scope.$emit '${1:eventName}', ${2:eventArgs}
+ ${3}
+## Directive related snippets
+# A compile function
+snippet ngdcf
+ compile = (tElement, tAttrs, transclude) ->
+ (scope, element, attrs) ->
+ ${1}
+# A linking function in a directive
+snippet ngdlf
+ (scope, element, attrs${1:ctrl}) ->
+ ${2}
+# A directive with a compile function
+snippet ngdc
+ directive '${1:directiveName}', factory = (${2:injectables}) ->
+ directiveDefinitionObject =
+ ${3:directiveAttrs}
+ compile: compile = (tElement, tAttrs, transclude) ->
+ (scope, element, attrs) ->
+ directiveDefinitionObject
+# A directive with a linking function only
+snippet ngdl
+ .directive('${1:directiveName}', (${2:directiveDeps}) ->
+ (scope, element, attrs${3:ctrl}) ->
+ ${4}
+ ) \ No newline at end of file
diff --git a/vim/bundle/vim-snippets/snippets/coffee/coffee.snippets b/vim/bundle/vim-snippets/snippets/coffee/coffee.snippets
new file mode 100644
index 0000000..bb96434
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/coffee/coffee.snippets
@@ -0,0 +1,101 @@
+# Closure loop
+snippet forindo
+ for ${1:name} in ${2:array}
+ do ($1) ->
+ ${0:// body}
+# Array comprehension
+snippet fora
+ for ${1:name} in ${2:array}
+ ${0:# body...}
+# Object comprehension
+snippet foro
+ for ${1:key}, ${2:value} of ${3:object}
+ ${0:# body...}
+# Range comprehension (inclusive)
+snippet forr
+ for ${1:name} in [${2:start}..${3:finish}]
+ ${0:# body...}
+snippet forrb
+ for ${1:name} in [${2:start}..${3:finish}] by ${4:step}
+ ${0:# body...}
+# Range comprehension (exclusive)
+snippet forrex
+ for ${1:name} in [${2:start}...${3:finish}]
+ ${0:# body...}
+snippet forrexb
+ for ${1:name} in [${2:start}...${3:finish}] by ${4:step}
+ ${0:# body...}
+# Function
+snippet fun
+ (${1:args}) ->
+ ${0:# body...}
+# Function (bound)
+snippet bfun
+ (${1:args}) =>
+ ${0:# body...}
+# Class
+snippet cla class ..
+ class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
+ ${0}
+snippet cla class .. constructor: ..
+ class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
+ constructor: (${2:args}) ->
+ ${3}
+
+ ${0}
+snippet cla class .. extends ..
+ class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
+ ${0}
+snippet cla class .. extends .. constructor: ..
+ class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
+ constructor: (${3:args}) ->
+ ${4}
+
+ ${0}
+# If
+snippet if
+ if ${1:condition}
+ ${0:# body...}
+# If __ Else
+snippet ife
+ if ${1:condition}
+ ${2:# body...}
+ else
+ ${0:# body...}
+# Else if
+snippet eif
+ else if ${1:condition}
+ ${0:# body...}
+# Ternary If
+snippet ifte
+ if ${1:condition} then ${2:value} else ${0:other}
+# Unless
+snippet unl
+ ${1:action} unless ${0:condition}
+# Switch
+snippet swi
+ switch ${1:object}
+ when ${2:value}
+ ${0:# body...}
+
+# Log
+snippet log
+ console.log ${0}
+# Try __ Catch
+snippet try
+ try
+ ${1}
+ catch ${2:error}
+ ${0}
+# Require
+snippet req
+ ${2:$1} = require '${1:sys}'
+# Export
+snippet exp
+ ${0:root} = exports ? this
+
+snippet jsonp
+ JSON.parse ${0:jstr}
+# JSON.stringify
+snippet jsons
+ JSON.stringify ${0:object}
diff --git a/vim/bundle/vim-snippets/snippets/coffee/jquery_coffee.snippets b/vim/bundle/vim-snippets/snippets/coffee/jquery_coffee.snippets
new file mode 100644
index 0000000..10bcd77
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/coffee/jquery_coffee.snippets
@@ -0,0 +1,524 @@
+snippet add
+ ${1:obj}.add('${2:selector expression}')
+snippet addClass
+ ${1:obj}.addClass('${2:class name}')
+snippet after
+ ${1:obj}.after('${2:Some text <b>and bold!</b>}')
+snippet ajax
+ $.ajax
+ url: "${1:mydomain.com/url}"
+ type: "${2:POST}"
+ dataType: "${3:xml/html/script/json}"
+ data: ${4:data}
+ complete: (jqXHR, textStatus) ->
+ ${5:// callback}
+ success: (data, textStatus, jqXHR) ->
+ ${6:// success callback}
+ error: (jqXHR, textStatus, errorThrown) ->
+ ${0:// error callback}
+snippet ajaxcomplete
+ ${1:obj}.ajaxComplete (${1:e}, xhr, settings) ->
+ ${0:// callback}
+snippet ajaxerror
+ ${1:obj}.ajaxError (${1:e}, xhr, settings, thrownError) ->
+ ${2:// error callback}
+ ${0}
+snippet ajaxget
+ $.get '${1:mydomain.com/url}',
+ ${2:{ param1: value1 },}
+ (data, textStatus, jqXHR) ->
+ ${0:// success callback}
+snippet ajaxpost
+ $.post '${1:mydomain.com/url}',
+ ${2:{ param1: value1 },}
+ (data, textStatus, jqXHR) ->
+ ${0:// success callback}
+snippet ajaxprefilter
+ $.ajaxPrefilter (${1:options}, ${2:originalOptions}, jqXHR) ->
+ ${0: // Modify options, control originalOptions, store jqXHR, etc}
+snippet ajaxsend
+ ${1:obj}.ajaxSend (${1:request, settings}) ->
+ ${2:// error callback}
+ ${0}
+snippet ajaxsetup
+ $.ajaxSetup({
+ url: "${1:mydomain.com/url}",
+ type: "${2:POST}",
+ dataType: "${3:xml/html/script/json}",
+ data: $.param( $("${4:Element or Expression}") ),
+ complete: (jqXHR, textStatus) ->
+ ${5:// callback}
+ ,
+ success: (data, textStatus, jqXHR) ->
+ ${6:// success callback}
+ ,
+ error: (jqXHR, textStatus, errorThrown) ->
+ ${0:// error callback}
+ })
+snippet ajaxstart
+ $.ajaxStart ->
+ ${1:// handler for when an AJAX call is started and no other AJAX calls are in progress}
+ ${0}
+snippet ajaxstop
+ $.ajaxStop ->
+ ${1:// handler for when all AJAX calls have been completed}
+ ${0}
+snippet ajaxsuccess
+ $.ajaxSuccess (${1:e}, xhr, settings) ->
+ ${2:// handler for when any AJAX call is successfully completed}
+ ${0}
+snippet andself
+ ${1:obj}.andSelf()
+snippet animate
+ ${1:obj}.animate({${2:param1: value1, param2: value2}}, ${3:speed})
+snippet append
+ ${1:obj}.append('${2:Some text <b>and bold!</b>}')
+snippet appendTo
+ ${1:obj}.appendTo('${2:selector expression}')
+snippet attr
+ ${1:obj}.attr('${2:attribute}', '${3:value}')
+snippet attrm
+ ${1:obj}.attr({'${2:attr1}': '${3:value1}', '${4:attr2}': '${5:value2}'})
+snippet before
+ ${1:obj}.before('${2:Some text <b>and bold!</b>}')
+snippet bind
+ ${1:obj}.bind('${2:event name}', (${3:e}) ->
+ ${0:// event handler}
+snippet blur
+ ${1:obj}.blur (${2:e}) ->
+ ${0:// event handler}
+snippet C
+ $.Callbacks()
+snippet Cadd
+ ${1:callbacks}.add(${2:callbacks})
+snippet Cdis
+ ${1:callbacks}.disable()
+snippet Cempty
+ ${1:callbacks}.empty()
+snippet Cfire
+ ${1:callbacks}.fire(${2:args})
+snippet Cfired
+ ${1:callbacks}.fired()
+snippet Cfirew
+ ${1:callbacks}.fireWith(${2:this}, ${3:args})
+snippet Chas
+ ${1:callbacks}.has(${2:callback})
+snippet Clock
+ ${1:callbacks}.lock()
+snippet Clocked
+ ${1:callbacks}.locked()
+snippet Crem
+ ${1:callbacks}.remove(${2:callbacks})
+snippet change
+ ${1:obj}.change (${2:e}) ->
+ ${0:// event handler}
+snippet children
+ ${1:obj}.children('${2:selector expression}')
+snippet clearq
+ ${1:obj}.clearQueue(${2:'queue name'})
+snippet click
+ ${1:obj}.click (${2:e}) ->
+ ${0:// event handler}
+snippet clone
+ ${1:obj}.clone()
+snippet contains
+ $.contains(${1:container}, ${0:contents})
+snippet css
+ ${1:obj}.css('${2:attribute}', '${3:value}')
+snippet csshooks
+ $.cssHooks['${1:CSS prop}'] = {
+ get: (elem, computed, extra) ->
+ ${2: // handle getting the CSS property}
+ set: (elem, value) ->
+ ${0: // handle setting the CSS value}
+ }
+snippet cssm
+ ${1:obj}.css({${2:attribute1}: '${3:value1}', ${4:attribute2}: '${5:value2}'})
+snippet D
+ $.Deferred()
+snippet Dalways
+ ${1:deferred}.always(${2:callbacks})
+snippet Ddone
+ ${1:deferred}.done(${2:callbacks})
+snippet Dfail
+ ${1:deferred}.fail(${2:callbacks})
+snippet Disrej
+ ${1:deferred}.isRejected()
+snippet Disres
+ ${1:deferred}.isResolved()
+snippet Dnotify
+ ${1:deferred}.notify(${2:args})
+snippet Dnotifyw
+ ${1:deferred}.notifyWith(${2:this}, ${3:args})
+snippet Dpipe
+ ${1:deferred}.then(${2:doneFilter}, ${3:failFilter}, ${4:progressFilter})
+snippet Dprog
+ ${1:deferred}.progress(${2:callbacks})
+snippet Dprom
+ ${1:deferred}.promise(${2:target})
+snippet Drej
+ ${1:deferred}.reject(${2:args})
+snippet Drejw
+ ${1:deferred}.rejectWith(${2:this}, ${3:args})
+snippet Dres
+ ${1:deferred}.resolve(${2:args})
+snippet Dresw
+ ${1:deferred}.resolveWith(${2:this}, ${3:args})
+snippet Dstate
+ ${1:deferred}.state()
+snippet Dthen
+ ${1:deferred}.then(${2:doneCallbacks}, ${3:failCallbacks}, ${4:progressCallbacks})
+snippet Dwhen
+ $.when(${1:deferreds})
+snippet data
+ ${1:obj}.data(${2:obj})
+snippet dataa
+ $.data('${1:selector expression}', '${2:key}'${3:, 'value'})
+snippet dblclick
+ ${1:obj}.dblclick (${2:e}) ->
+ ${0:// event handler}
+snippet delay
+ ${1:obj}.delay('${2:slow/400/fast}'${3:, 'queue name'})
+snippet dele
+ ${1:obj}.delegate '${2:selector expression}', '${3:event name}', (${4:e}) ->
+ ${0:// event handler}
+snippet deq
+ ${1:obj}.dequeue(${2:'queue name'})
+snippet deqq
+ $.dequeue('${1:selector expression}'${2:, 'queue name'})
+snippet detach
+ ${1:obj}.detach('${2:selector expression}')
+snippet die
+ ${1:obj}.die(${2:event}, ${3:handler})
+snippet each
+ ${1:obj}.each (index) ->
+ ${0:this.innerHTML = this + " is the element, " + index + " is the position"}
+snippet el
+ $('<${1}/>'${2:, {}})
+snippet eltrim
+ $.trim('${1:string}')
+snippet empty
+ ${1:obj}.empty()
+snippet end
+ ${1:obj}.end()
+snippet eq
+ ${1:obj}.eq(${2:element index})
+snippet error
+ ${1:obj}.error (${2:e}) ->
+ ${0:// event handler}
+snippet eventsmap
+ {
+ :f${0}
+ }
+snippet extend
+ $.extend(${1:true, }${2:target}, ${3:obj})
+snippet fadein
+ ${1:obj}.fadeIn('${2:slow/400/fast}')
+snippet fadeinc
+ ${1:obj}.fadeIn 'slow/400/fast', ->
+ ${0:// callback}
+snippet fadeout
+ ${1:obj}.fadeOut('${2:slow/400/fast}')
+snippet fadeoutc
+ ${1:obj}.fadeOut 'slow/400/fast', ->
+ ${0:// callback}
+snippet fadeto
+ ${1:obj}.fadeTo('${2:slow/400/fast}', ${3:0.5})
+snippet fadetoc
+ ${1:obj}.fadeTo 'slow/400/fast', ${2:0.5}, ->
+ ${0:// callback}
+snippet filter
+ ${1:obj}.filter('${2:selector expression}')
+snippet filtert
+ ${1:obj}.filter (${2:index}) ->
+ ${3}
+snippet find
+ ${1:obj}.find('${2:selector expression}')
+snippet focus
+ ${1:obj}.focus (${2:e}) ->
+ ${0:// event handler}
+snippet focusin
+ ${1:obj}.focusIn (${2:e}) ->
+ ${0:// event handler}
+snippet focusout
+ ${1:obj}.focusOut (${2:e}) ->
+ ${0:// event handler}
+snippet get
+ ${1:obj}.get(${2:element index})
+snippet getjson
+ $.getJSON '${1:mydomain.com/url}',
+ ${2:{ param1: value1 },}
+ (data, textStatus, jqXHR) ->
+ ${0:// success callback}
+snippet getscript
+ $.getScript '${1:mydomain.com/url}', (script, textStatus, jqXHR) ->
+ ${0:// callback}
+snippet grep
+ $.grep(${1:array}, (item, index) >
+ ${2}
+ ${0:, true})
+snippet hasc
+ ${1:obj}.hasClass('${2:className}')
+snippet hasd
+ $.hasData('${0:selector expression}')
+snippet height
+ ${1:obj}.height(${2:integer})
+snippet hide
+ ${1:obj}.hide('${2:slow/400/fast}')
+snippet hidec
+ ${1:obj}.hide '${2:slow/400/fast}', ->
+ ${0:// callback}
+snippet hover
+ ${1:obj}.hover (${2:e}) ->
+ ${3:// event handler}
+ , ($2) ->
+ ${4:// event handler}
+snippet html
+ ${1:obj}.html('${2:Some text <b>and bold!</b>}')
+snippet inarr
+ $.inArray(${1:value}, ${0:array})
+snippet insa
+ ${1:obj}.insertAfter('${2:selector expression}')
+snippet insb
+ ${1:obj}.insertBefore('${2:selector expression}')
+snippet is
+ ${1:obj}.is('${2:selector expression}')
+snippet isarr
+ $.isArray(${1:obj})
+snippet isempty
+ $.isEmptyObject(${1:obj})
+snippet isfunc
+ $.isFunction(${1:obj})
+snippet isnum
+ $.isNumeric(${1:value})
+snippet isobj
+ $.isPlainObject(${1:obj})
+snippet iswin
+ $.isWindow(${1:obj})
+snippet isxml
+ $.isXMLDoc(${1:node})
+snippet jj
+ $('${1:selector}')
+snippet kdown
+ ${1:obj}.keydown (${2:e}) ->
+ ${0:// event handler}
+snippet kpress
+ ${1:obj}.keypress (${2:e}) ->
+ ${0:// event handler}
+snippet kup
+ ${1:obj}.keyup (${2:e}) ->
+ ${0:// event handler}
+snippet last
+ ${1:obj}.last('${1:selector expression}')
+snippet live
+ ${1:obj}.live '${2:events}', (${3:e}) ->
+ ${0:// event handler}
+snippet load
+ ${1:obj}.load (${2:e}) ->
+ ${0:// event handler}
+snippet loadf
+ ${1:obj}.load('${2:mydomain.com/url}',
+ ${2:{ param1: value1 },}
+ (responseText, textStatus, xhr) ->
+ ${0:// success callback}
+ })
+snippet makearray
+ $.makeArray(${0:obj})
+snippet map
+ ${1:obj}.map (${2:index}, ${3:element}) ->
+ ${0:// callback}
+snippet mapp
+ $.map ${1:arrayOrObject}, (${2:value}, ${3:indexOrKey}) ->
+ ${0:// callback}
+snippet merge
+ $.merge(${1:target}, ${0:original})
+snippet mdown
+ ${1:obj}.mousedown (${2:e}) ->
+ ${0:// event handler}
+snippet menter
+ ${1:obj}.mouseenter (${2:e}) ->
+ ${0:// event handler}
+snippet mleave
+ ${1:obj}.mouseleave (${2:e}) ->
+ ${0:// event handler}
+snippet mmove
+ ${1:obj}.mousemove (${2:e}) ->
+ ${0:// event handler}
+snippet mout
+ ${1:obj}.mouseout (${2:e}) ->
+ ${0:// event handler}
+snippet mover
+ ${1:obj}.mouseover (${2:e}) ->
+ ${0:// event handler}
+snippet mup
+ ${1:obj}.mouseup (${2:e}) ->
+ ${0:// event handler}
+snippet next
+ ${1:obj}.next('${2:selector expression}')
+snippet nexta
+ ${1:obj}.nextAll('${2:selector expression}')
+snippet nextu
+ ${1:obj}.nextUntil('${2:selector expression}'${3:, 'filter expression'})
+snippet not
+ ${1:obj}.not('${2:selector expression}')
+snippet off
+ ${1:obj}.off('${2:events}', '${3:selector expression}'${4:, handler})
+snippet offset
+ ${1:obj}.offset()
+snippet offsetp
+ ${1:obj}.offsetParent()
+snippet on
+ ${1:obj}.on '${2:events}', '${3:selector expression}', (${4:e}) ->
+ ${0:// event handler}
+snippet one
+ ${1:obj}.one '${2:event name}', (${3:e}) ->
+ ${0:// event handler}
+snippet outerh
+ ${1:obj}.outerHeight()
+snippet outerw
+ ${1:obj}.outerWidth()
+snippet param
+ $.param(${1:obj})
+snippet parent
+ ${1:obj}.parent('${2:selector expression}')
+snippet parents
+ ${1:obj}.parents('${2:selector expression}')
+snippet parentsu
+ ${1:obj}.parentsUntil('${2:selector expression}'${3:, 'filter expression'})
+snippet parsejson
+ $.parseJSON(${1:data})
+snippet parsexml
+ $.parseXML(${1:data})
+snippet pos
+ ${1:obj}.position()
+snippet prepend
+ ${1:obj}.prepend('${2:Some text <b>and bold!</b>}')
+snippet prependto
+ ${1:obj}.prependTo('${2:selector expression}')
+snippet prev
+ ${1:obj}.prev('${2:selector expression}')
+snippet preva
+ ${1:obj}.prevAll('${2:selector expression}')
+snippet prevu
+ ${1:obj}.prevUntil('${2:selector expression}'${3:, 'filter expression'})
+snippet promise
+ ${1:obj}.promise(${2:'fx'}, ${3:target})
+snippet prop
+ ${1:obj}.prop('${2:property name}')
+snippet proxy
+ $.proxy(${1:function}, ${2:this})
+snippet pushstack
+ ${1:obj}.pushStack(${2:elements})
+snippet queue
+ ${1:obj}.queue(${2:name}${3:, newQueue})
+snippet queuee
+ $.queue(${1:element}${2:, name}${3:, newQueue})
+snippet ready
+ $(() ->
+ ${0}
+ )
+snippet rem
+ ${1:obj}.remove()
+snippet rema
+ ${1:obj}.removeAttr('${2:attribute name}')
+snippet remc
+ ${1:obj}.removeClass('${2:class name}')
+snippet remd
+ ${1:obj}.removeData('${2:key name}')
+snippet remdd
+ $.removeData(${1:element}${2:, 'key name}')
+snippet remp
+ ${1:obj}.removeProp('${2:property name}')
+snippet repa
+ ${1:obj}.replaceAll(${2:target})
+snippet repw
+ ${1:obj}.replaceWith(${2:content})
+snippet reset
+ ${1:obj}.reset (${2:e}) ->
+ ${0:// event handler}
+snippet resize
+ ${1:obj}.resize (${2:e}) ->
+ ${0:// event handler}
+snippet scroll
+ ${1:obj}.scroll (${2:e}) ->
+ ${0:// event handler}
+snippet scrolll
+ ${1:obj}.scrollLeft(${2:value})
+snippet scrollt
+ ${1:obj}.scrollTop(${2:value})
+snippet sdown
+ ${1:obj}.slideDown('${2:slow/400/fast}')
+snippet sdownc
+ ${1:obj}.slideDown('${2:slow/400/fast}', ->
+ ${0:// callback}
+snippet select
+ ${1:obj}.select (${2:e}) ->
+ ${0:// event handler}
+snippet serialize
+ ${1:obj}.serialize()
+snippet serializea
+ ${1:obj}.serializeArray()
+snippet show
+ ${1:obj}.show('${2:slow/400/fast}')
+snippet showc
+ ${1:obj}.show '${2:slow/400/fast}', ->
+ ${0:// callback}
+snippet sib
+ ${1:obj}.siblings('${2:selector expression}')
+snippet size
+ ${1:obj}.size()
+snippet slice
+ ${1:obj}.slice(${2:start}${3:, end})
+snippet stoggle
+ ${1:obj}.slideToggle('${2:slow/400/fast}')
+snippet stop
+ ${1:obj}.stop('${2:queue}', ${3:false}, ${4:false})
+snippet submit
+ ${1:obj}.submit (${2:e}) ->
+ ${0:// event handler}
+snippet sup
+ ${1:obj}.slideUp('${2:slow/400/fast}')
+snippet supc
+ ${1:obj}.slideUp '${2:slow/400/fast}', ->
+ ${0:// callback}
+snippet text
+ ${1:obj}.text(${2:'some text'})
+snippet this
+ $(this)
+snippet toarr
+ ${0:obj}.toArray()
+snippet tog
+ ${1:obj}.toggle (${2:e}) ->
+ ${3:// event handler}
+ , ($2) ->
+ ${4:// event handler}
+ ${0}
+snippet togclass
+ ${1:obj}.toggleClass('${2:class name}')
+snippet togsh
+ ${1:obj}.toggle('${2:slow/400/fast}')
+snippet trig
+ ${1:obj}.trigger('${2:event name}')
+snippet trigh
+ ${1:obj}.triggerHandler('${2:event name}')
+snippet $trim
+ $.trim(${1:str})
+snippet $type
+ $.type(${1:obj})
+snippet unbind
+ ${1:obj}.unbind('${2:event name}')
+snippet undele
+ ${1:obj}.undelegate(${2:selector expression}, ${3:event}, ${4:handler})
+snippet uniq
+ $.unique(${1:array})
+snippet unload
+ ${1:obj}.unload (${2:e}) ->
+ ${0:// event handler}
+snippet unwrap
+ ${1:obj}.unwrap()
+snippet val
+ ${1:obj}.val('${2:text}')
+snippet width
+ ${1:obj}.width(${2:integer})
+snippet wrap
+ ${1:obj}.wrap('${2:&ltdiv class="extra-wrapper"&gt&lt/div&gt}')
diff --git a/vim/bundle/vim-snippets/snippets/coffee/requirejs_coffee.snippets b/vim/bundle/vim-snippets/snippets/coffee/requirejs_coffee.snippets
new file mode 100644
index 0000000..6dfe179
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/coffee/requirejs_coffee.snippets
@@ -0,0 +1,11 @@
+snippet def
+ define ["${1:#dependencies1}"], (${2:#dependencies2}) ->
+ ${0:TARGET}
+
+snippet defn
+ define "${1:#name}", ["${2:#dependencies1}"], (${3:#dependencies2}) ->
+ ${0:TARGET}
+
+snippet reqjs
+ require ["${1:#dependencies1}"], (${2:#dependencies2}) ->
+ ${0:TARGET}
diff --git a/vim/bundle/vim-snippets/snippets/cpp.snippets b/vim/bundle/vim-snippets/snippets/cpp.snippets
new file mode 100644
index 0000000..d06b3c9
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/cpp.snippets
@@ -0,0 +1,154 @@
+extends c
+
+##
+## Preprocessor
+# #include <...>
+snippet inc
+ #include <${1:iostream}>
+snippet binc
+ #include <boost/${1:shared_ptr}.hpp>
+##
+## STL Collections
+# std::array
+snippet array
+ std::array<${1:T}, ${2:N}> ${3};
+# std::vector
+snippet vector
+ std::vector<${1:T}> ${2};
+# std::deque
+snippet deque
+ std::deque<${1:T}> ${2};
+# std::forward_list
+snippet flist
+ std::forward_list<${1:T}> ${2};
+# std::list
+snippet list
+ std::list<${1:T}> ${2};
+# std::set
+snippet set
+ std::set<${1:T}> ${2};
+# std::map
+snippet map
+ std::map<${1:Key}, ${2:T}> ${3};
+# std::multiset
+snippet mset
+ std::multiset<${1:T}> ${2};
+# std::multimap
+snippet mmap
+ std::multimap<${1:Key}, ${2:T}> ${3};
+# std::unordered_set
+snippet uset
+ std::unordered_set<${1:T}> ${2};
+# std::unordered_map
+snippet umap
+ std::unordered_map<${1:Key}, ${2:T}> ${3};
+# std::unordered_multiset
+snippet umset
+ std::unordered_multiset<${1:T}> ${2};
+# std::unordered_multimap
+snippet ummap
+ std::unordered_multimap<${1:Key}, ${2:T}> ${3};
+# std::stack
+snippet stack
+ std::stack<${1:T}> ${2};
+# std::queue
+snippet queue
+ std::queue<${1:T}> ${2};
+# std::priority_queue
+snippet pqueue
+ std::priority_queue<${1:T}> ${2};
+##
+## Access Modifiers
+# private
+snippet pri
+ private
+# protected
+snippet pro
+ protected
+# public
+snippet pub
+ public
+# friend
+snippet fr
+ friend
+# mutable
+snippet mu
+ mutable
+##
+## Class
+# class
+snippet cl
+ class ${1:`vim_snippets#Filename('$1', 'name')`}
+ {
+ public:
+ $1(${2});
+ ~$1();
+
+ private:
+ ${0:/* data */}
+ };
+# member function implementation
+snippet mfun
+ ${4:void} ${1:`vim_snippets#Filename('$1', 'ClassName')`}::${2:memberFunction}(${3}) {
+ ${0}
+ }
+# namespace
+snippet ns
+ namespace ${1:`vim_snippets#Filename('', 'my')`} {
+ ${0}
+ } /* namespace $1 */
+##
+## Input/Output
+# std::cout
+snippet cout
+ std::cout << ${1} << std::endl;
+# std::cin
+snippet cin
+ std::cin >> ${1};
+##
+## Casts
+# static
+snippet sca
+ static_cast<${1:unsigned}>(${2:expr})${3}
+# dynamic
+snippet dca
+ dynamic_cast<${1:unsigned}>(${2:expr})${3}
+# reinterpret
+snippet rca
+ reinterpret_cast<${1:unsigned}>(${2:expr})${3}
+# const
+snippet cca
+ const_cast<${1:unsigned}>(${2:expr})${3}
+## Iteration
+# for i
+snippet fori
+ for (int ${2:i} = 0; $2 < ${1:count}; $2${3:++}) {
+ ${4}
+ }
+
+# foreach
+snippet fore
+ for (${1:auto} ${2:i} : ${3:container}) {
+ ${4}
+ }
+# iterator
+snippet iter
+ for (${1:std::vector}<${2:type}>::${3:const_iterator} ${4:i} = ${5:container}.begin(); $4 != $5.end(); ++$4) {
+ ${6}
+ }
+
+# auto iterator
+snippet itera
+ for (auto ${1:i} = ${2:container}.begin(); $1 != $2.end(); ++$1) {
+ ${3:std::cout << *$1 << std::endl;}
+ }
+##
+## Lambdas
+# lamda (one line)
+snippet ld
+ [${1}](${2}){${3}};
+# lambda (multi-line)
+snippet lld
+ [${1}](${2}){
+ ${3}
+ };
diff --git a/vim/bundle/vim-snippets/snippets/cs.snippets b/vim/bundle/vim-snippets/snippets/cs.snippets
new file mode 100644
index 0000000..40e9c8f
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/cs.snippets
@@ -0,0 +1,470 @@
+# cs.snippets
+# ===========
+#
+# Standard C-Sharp snippets for snipmate.
+#
+# Largely ported over from Visual Studio 2010 snippets plus
+# a few snippets from Resharper plus a few widely known snippets.
+#
+# Most snippets on elements (i.e. classes, properties)
+# follow suffix conventions. The order of suffixes to a snippet
+# is fixed.
+#
+# Snippet Suffix Order
+# --------------------
+# 1. Access Modifiers
+# 2. Class Modifiers
+#
+# Access Modifier Suffix Table
+# ----------------------------
+# + = public
+# & = internal
+# | = protected
+# - = private
+#
+# Example: `cls&` expands to `internal class $1`.
+# Access modifiers might be doubled to indicate
+# different modifiers for get/set on properties.
+# Example: `pb+-` expands to `public bool $1 { get; private set; }`
+#
+# Class Modifier Table
+# --------------------
+# ^ = static
+# % = abstract
+#
+# Example: `cls|%` expands to `protected abstract class $1`
+#
+# On method and property snippets, you can directly set
+# one of the common types int, string and bool, if desired,
+# just by appending the type modifier.
+#
+# Type Modifier Table
+# -------------------
+# i = integer
+# s = string
+# b = bool
+#
+# Example: `pi+&` expands to `public int $1 { get; internal set; }`
+#
+# I'll most propably add more stuff in here like
+# * List/Array constructio
+# * Mostly used generics
+# * Linq
+# * Funcs, Actions, Predicates
+# * Lambda
+# * Events
+#
+# Feedback is welcome!
+#
+# Main
+snippet sim
+ ${1:public }static int Main(string[] args) {
+ ${0}
+ return 0;
+ }
+snippet simc
+ public class Application {
+ ${1:public }static int Main(string[] args) {
+ ${0}
+ return 0;
+ }
+ }
+snippet svm
+ ${1:public }static void Main(string[] args) {
+ ${0}
+ }
+# if condition
+snippet if
+ if (${1:true}) {
+ ${0}
+ }
+snippet el
+ else {
+ ${0}
+ }
+snippet ifs
+ if (${1})
+ ${0}
+# ternary conditional
+snippet t
+ ${1} ? ${2} : ${0}
+snippet ?
+ ${1} ? ${2} : ${0}
+# do while loop
+snippet do
+ do {
+ ${0}
+ } while (${1:true});
+# while loop
+snippet wh
+ while (${1:true}) {
+ ${0}
+ }
+# for loop
+snippet for
+ for (int ${1:i} = 0; $1 < ${2:count}; $1${3:++}) {
+ ${0}
+ }
+snippet forr
+ for (int ${1:i} = ${2:length}; $1 >= 0; $1--) {
+ ${0}
+ }
+# foreach
+snippet fore
+ foreach (${1:var} ${2:entry} in ${3}) {
+ ${0}
+ }
+snippet foreach
+ foreach (${1:var} ${2:entry} in ${3}) {
+ ${0}
+ }
+snippet each
+ foreach (${1:var} ${2:entry} in ${3}) {
+ ${0}
+ }
+# interfaces
+snippet interface
+ public interface ${1:`vim_snippets#Filename()`} {
+ ${0}
+ }
+snippet if+
+ public interface ${1:`vim_snippets#Filename()`} {
+ ${0}
+ }
+# class bodies
+snippet class
+ public class ${1:`vim_snippets#Filename()`} {
+ ${0}
+ }
+snippet cls
+ ${2:public} class ${1:`vim_snippets#Filename()`} {
+ ${0}
+ }
+snippet cls+
+ public class ${1:`vim_snippets#Filename()`} {
+ ${0}
+ }
+snippet cls+^
+ public static class ${1:`vim_snippets#Filename()`} {
+ ${0}
+ }
+snippet cls&
+ internal class ${1:`vim_snippets#Filename()`} {
+ ${0}
+ }
+snippet cls&^
+ internal static class ${1:`vim_snippets#Filename()`} {
+ ${0}
+ }
+snippet cls|
+ protected class ${1:`vim_snippets#Filename()`} {
+ ${0}
+ }
+snippet cls|%
+ protected abstract class ${1:`vim_snippets#Filename()`} {
+ ${0}
+ }
+# constructor
+snippet ctor
+ public ${1:`vim_snippets#Filename()`}() {
+ ${0}
+ }
+# properties - auto properties by default.
+# default type is int with layout get / set.
+snippet prop
+ ${1:public} ${2:int} ${3} { get; set; }
+snippet p
+ ${1:public} ${2:int} ${3} { get; set; }
+snippet p+
+ public ${1:int} ${2} { get; set; }
+snippet p+&
+ public ${1:int} ${2} { get; internal set; }
+snippet p+|
+ public ${1:int} ${2} { get; protected set; }
+snippet p+-
+ public ${1:int} ${2} { get; private set; }
+snippet p&
+ internal ${1:int} ${2} { get; set; }
+snippet p&|
+ internal ${1:int} ${2} { get; protected set; }
+snippet p&-
+ internal ${1:int} ${2} { get; private set; }
+snippet p|
+ protected ${1:int} ${2} { get; set; }
+snippet p|-
+ protected ${1:int} ${2} { get; private set; }
+snippet p-
+ private ${1:int} ${2} { get; set; }
+# property - bool
+snippet pi
+ ${1:public} int ${2} { get; set; }
+snippet pi+
+ public int ${1} { get; set; }
+snippet pi+&
+ public int ${1} { get; internal set; }
+snippet pi+|
+ public int ${1} { get; protected set; }
+snippet pi+-
+ public int ${1} { get; private set; }
+snippet pi&
+ internal int ${1} { get; set; }
+snippet pi&|
+ internal int ${1} { get; protected set; }
+snippet pi&-
+ internal int ${1} { get; private set; }
+snippet pi|
+ protected int ${1} { get; set; }
+snippet pi|-
+ protected int ${1} { get; private set; }
+snippet pi-
+ private int ${1} { get; set; }
+# property - bool
+snippet pb
+ ${1:public} bool ${2} { get; set; }
+snippet pb+
+ public bool ${1} { get; set; }
+snippet pb+&
+ public bool ${1} { get; internal set; }
+snippet pb+|
+ public bool ${1} { get; protected set; }
+snippet pb+-
+ public bool ${1} { get; private set; }
+snippet pb&
+ internal bool ${1} { get; set; }
+snippet pb&|
+ internal bool ${1} { get; protected set; }
+snippet pb&-
+ internal bool ${1} { get; private set; }
+snippet pb|
+ protected bool ${1} { get; set; }
+snippet pb|-
+ protected bool ${1} { get; private set; }
+snippet pb-
+ private bool ${1} { get; set; }
+# property - string
+snippet ps
+ ${1:public} string ${2} { get; set; }
+snippet ps+
+ public string ${1} { get; set; }
+snippet ps+&
+ public string ${1} { get; internal set; }
+snippet ps+|
+ public string ${1} { get; protected set; }
+snippet ps+-
+ public string ${1} { get; private set; }
+snippet ps&
+ internal string ${1} { get; set; }
+snippet ps&|
+ internal string ${1} { get; protected set; }
+snippet ps&-
+ internal string ${1} { get; private set; }
+snippet ps|
+ protected string ${1} { get; set; }
+snippet ps|-
+ protected string ${1} { get; private set; }
+snippet ps-
+ private string ${1} { get; set; }
+# members - void
+snippet m
+ ${1:public} ${2:void} ${3}(${4}) {
+ ${0}
+ }
+snippet m+
+ public ${1:void} ${2}(${3}) {
+ ${0}
+ }
+snippet m&
+ internal ${1:void} ${2}(${3}) {
+ ${0}
+ }
+snippet m|
+ protected ${1:void} ${2}(${3}) {
+ ${0}
+ }
+snippet m-
+ private ${1:void} ${2}(${3}) {
+ ${0}
+ }
+# members - int
+snippet mi
+ ${1:public} int ${2}(${3}) {
+ ${0:return 0;}
+ }
+snippet mi+
+ public int ${1}(${2}) {
+ ${0:return 0;}
+ }
+snippet mi&
+ internal int ${1}(${2}) {
+ ${0:return 0;}
+ }
+snippet mi|
+ protected int ${1}(${2}) {
+ ${0:return 0;}
+ }
+snippet mi-
+ private int ${1}(${2}) {
+ ${0:return 0;}
+ }
+# members - bool
+snippet mb
+ ${1:public} bool ${2}(${3}) {
+ ${0:return false;}
+ }
+snippet mb+
+ public bool ${1}(${2}) {
+ ${0:return false;}
+ }
+snippet mb&
+ internal bool ${1}(${2}) {
+ ${0:return false;}
+ }
+snippet mb|
+ protected bool ${1}(${2}) {
+ ${0:return false;}
+ }
+snippet mb-
+ private bool ${1}(${2}) {
+ ${0:return false;}
+ }
+# members - string
+snippet ms
+ ${1:public} string ${2}(${3}) {
+ ${0:return "";}
+ }
+snippet ms+
+ public string ${1}(${2}) {
+ ${0:return "";}
+ }
+snippet ms&
+ internal string ${1}(${2}) {
+ ${0:return "";}
+ }
+snippet ms|
+ protected string ${1:}(${2:}) {
+ ${0:return "";}
+ }
+snippet ms-
+ private string ${1}(${2}) {
+ ${0:return "";}
+ }
+# structure
+snippet struct
+ public struct ${1:`vim_snippets#Filename()`} {
+ ${0}
+ }
+# enumeration
+snippet enum
+ enum ${1} {
+ ${0}
+ }
+
+snippet enum+
+ public enum ${1} {
+ ${0}
+ }
+# preprocessor directives
+snippet #if
+ #if
+ ${0}
+ #endif
+# inline xml documentation
+snippet ///
+ /// <summary>
+ /// ${0}
+ /// </summary>
+snippet <p
+ <param name="${1}">${2:$1}</param>
+snippet <ex
+ <exception cref="${1:System.Exception}">${2}</exception>
+snippet <r
+ <returns>${1}</returns>{
+snippet <s
+ <see cref="${1}"/>
+snippet <rem
+ <remarks>${1}</remarks>
+snippet <c
+ <code>${1}</code>
+
+snippet cw
+ Console.WriteLine(${1});
+
+# equals override
+snippet eq
+ public override bool Equals(object obj) {
+ if (obj == null || GetType() != obj.GetType()) {
+ return false;
+ }
+ ${0:throw new NotImplementedException();}
+ return base.Equals(obj);
+ }
+# exception
+snippet exc
+ public class ${1:MyException} : ${2:Exception} {
+ public $1() { }
+ public $1(string message) : base(message) { }
+ public $1(string message, Exception inner) : base(message, inner) { }
+ protected $1(
+ System.Runtime.Serialization.SerializationInfo info,
+ System.Runtime.Serialization.StreamingContext context)
+ : base(info, context) { }
+ }
+# indexer
+snippet index
+ public ${1:object} this[${2:int} index] {
+ get { ${0} }
+ set { ${0} }
+ }
+# eventhandler
+snippet inv
+ EventHandler temp = ${1:MyEvent};
+ if (${2:temp} != null) {
+ $2();
+ }
+# lock
+snippet lock
+ lock (${1:this}) {
+ ${0}
+ }
+# namespace
+snippet namespace
+ namespace ${1:MyNamespace} {
+ ${0}
+ }
+# property
+snippet prop
+ public ${1:int} ${2:MyProperty} { get; set; }
+snippet propf
+ private ${1:int} ${2:myVar};
+ public $1 ${3:MyProperty} {
+ get { return $2; }
+ set { $2 = value; }
+ }
+snippet propg
+ public ${1:int} ${2:MyProperty} { get; private set; }
+# switch
+snippet switch
+ switch (${1:switch_on}) {
+ ${0}
+ default:
+ }
+# try
+snippet try
+ try {
+ ${0}
+ }
+ catch (${1:System.Exception}) {
+ throw;
+ }
+snippet tryf
+ try {
+ ${0}
+ }
+ finally {
+ ${1}
+ }
+# using
+snippet usi
+ using(${1:resource}) {
+ ${0}
+ }
diff --git a/vim/bundle/vim-snippets/snippets/css.snippets b/vim/bundle/vim-snippets/snippets/css.snippets
new file mode 100644
index 0000000..c4a74de
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/css.snippets
@@ -0,0 +1,987 @@
+snippet .
+ ${1} {
+ ${0}
+ }
+snippet !
+ !important
+snippet bdi:m+
+ -moz-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch};
+snippet bdi:m
+ -moz-border-image: ${0};
+snippet bdrz:m
+ -moz-border-radius: ${0};
+snippet bxsh:m+
+ -moz-box-shadow: ${1:0} ${2:0} ${3:0} #${0:000};
+snippet bxsh:m
+ -moz-box-shadow: ${0};
+snippet bdi:w+
+ -webkit-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch};
+snippet bdi:w
+ -webkit-border-image: ${0};
+snippet bdrz:w
+ -webkit-border-radius: ${0};
+snippet bxsh:w+
+ -webkit-box-shadow: ${1:0} ${2:0} ${3:0} #${0:000};
+snippet bxsh:w
+ -webkit-box-shadow: ${0};
+snippet @f
+ @font-face {
+ font-family: ${1};
+ src: url(${0});
+ }
+snippet @i
+ @import url(${0});
+snippet @m
+ @media ${1:print} {
+ ${0}
+ }
+snippet bg+
+ background: #${1:FFF} url(${2}) ${3:0} ${4:0} ${0:no-repeat};
+snippet bga
+ background-attachment: ${0};
+snippet bga:f
+ background-attachment: fixed;
+snippet bga:s
+ background-attachment: scroll;
+snippet bgbk
+ background-break: ${0};
+snippet bgbk:bb
+ background-break: bounding-box;
+snippet bgbk:c
+ background-break: continuous;
+snippet bgbk:eb
+ background-break: each-box;
+snippet bgcp
+ background-clip: ${0};
+snippet bgcp:bb
+ background-clip: border-box;
+snippet bgcp:cb
+ background-clip: content-box;
+snippet bgcp:nc
+ background-clip: no-clip;
+snippet bgcp:pb
+ background-clip: padding-box;
+snippet bgc
+ background-color: #${0:FFF};
+snippet bgc:t
+ background-color: transparent;
+snippet bgi
+ background-image: url(${0});
+snippet bgi:n
+ background-image: none;
+snippet bgo
+ background-origin: ${0};
+snippet bgo:bb
+ background-origin: border-box;
+snippet bgo:cb
+ background-origin: content-box;
+snippet bgo:pb
+ background-origin: padding-box;
+snippet bgpx
+ background-position-x: ${0};
+snippet bgpy
+ background-position-y: ${0};
+snippet bgp
+ background-position: ${1:0} ${0:0};
+snippet bgr
+ background-repeat: ${0};
+snippet bgr:n
+ background-repeat: no-repeat;
+snippet bgr:x
+ background-repeat: repeat-x;
+snippet bgr:y
+ background-repeat: repeat-y;
+snippet bgr:r
+ background-repeat: repeat;
+snippet bgz
+ background-size: ${0};
+snippet bgz:a
+ background-size: auto;
+snippet bgz:ct
+ background-size: contain;
+snippet bgz:cv
+ background-size: cover;
+snippet bg
+ background: ${0};
+snippet bg:ie
+ filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1}',sizingMethod='${0:crop}');
+snippet bg:n
+ background: none;
+snippet bd+
+ border: ${1:1px} ${2:solid} #${0:000};
+snippet bdb+
+ border-bottom: ${1:1px} ${2:solid} #${0:000};
+snippet bdbc
+ border-bottom-color: #${0:000};
+snippet bdbi
+ border-bottom-image: url(${0});
+snippet bdbi:n
+ border-bottom-image: none;
+snippet bdbli
+ border-bottom-left-image: url(${0});
+snippet bdbli:c
+ border-bottom-left-image: continue;
+snippet bdbli:n
+ border-bottom-left-image: none;
+snippet bdblrz
+ border-bottom-left-radius: ${0};
+snippet bdbri
+ border-bottom-right-image: url(${0});
+snippet bdbri:c
+ border-bottom-right-image: continue;
+snippet bdbri:n
+ border-bottom-right-image: none;
+snippet bdbrrz
+ border-bottom-right-radius: ${0};
+snippet bdbs
+ border-bottom-style: ${0};
+snippet bdbs:n
+ border-bottom-style: none;
+snippet bdbw
+ border-bottom-width: ${0};
+snippet bdb
+ border-bottom: ${0};
+snippet bdb:n
+ border-bottom: none;
+snippet bdbk
+ border-break: ${0};
+snippet bdbk:c
+ border-break: close;
+snippet bdcl
+ border-collapse: ${0};
+snippet bdcl:c
+ border-collapse: collapse;
+snippet bdcl:s
+ border-collapse: separate;
+snippet bdc
+ border-color: #${0:000};
+snippet bdci
+ border-corner-image: url(${0});
+snippet bdci:c
+ border-corner-image: continue;
+snippet bdci:n
+ border-corner-image: none;
+snippet bdf
+ border-fit: ${0};
+snippet bdf:c
+ border-fit: clip;
+snippet bdf:of
+ border-fit: overwrite;
+snippet bdf:ow
+ border-fit: overwrite;
+snippet bdf:r
+ border-fit: repeat;
+snippet bdf:sc
+ border-fit: scale;
+snippet bdf:sp
+ border-fit: space;
+snippet bdf:st
+ border-fit: stretch;
+snippet bdi
+ border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch};
+snippet bdi:n
+ border-image: none;
+snippet bdl+
+ border-left: ${1:1px} ${2:solid} #${0:000};
+snippet bdlc
+ border-left-color: #${0:000};
+snippet bdli
+ border-left-image: url(${0});
+snippet bdli:n
+ border-left-image: none;
+snippet bdls
+ border-left-style: ${0};
+snippet bdls:n
+ border-left-style: none;
+snippet bdlw
+ border-left-width: ${0};
+snippet bdl
+ border-left: ${0};
+snippet bdl:n
+ border-left: none;
+snippet bdlt
+ border-length: ${0};
+snippet bdlt:a
+ border-length: auto;
+snippet bdrz
+ border-radius: ${0};
+snippet bdr+
+ border-right: ${1:1px} ${2:solid} #${0:000};
+snippet bdrc
+ border-right-color: #${0:000};
+snippet bdri
+ border-right-image: url(${0});
+snippet bdri:n
+ border-right-image: none;
+snippet bdrs
+ border-right-style: ${0};
+snippet bdrs:n
+ border-right-style: none;
+snippet bdrw
+ border-right-width: ${0};
+snippet bdr
+ border-right: ${0};
+snippet bdr:n
+ border-right: none;
+snippet bdsp
+ border-spacing: ${0};
+snippet bds
+ border-style: ${0};
+snippet bds:ds
+ border-style: dashed;
+snippet bds:dtds
+ border-style: dot-dash;
+snippet bds:dtdtds
+ border-style: dot-dot-dash;
+snippet bds:dt
+ border-style: dotted;
+snippet bds:db
+ border-style: double;
+snippet bds:g
+ border-style: groove;
+snippet bds:h
+ border-style: hidden;
+snippet bds:i
+ border-style: inset;
+snippet bds:n
+ border-style: none;
+snippet bds:o
+ border-style: outset;
+snippet bds:r
+ border-style: ridge;
+snippet bds:s
+ border-style: solid;
+snippet bds:w
+ border-style: wave;
+snippet bdt+
+ border-top: ${1:1px} ${2:solid} #${0:000};
+snippet bdtc
+ border-top-color: #${0:000};
+snippet bdti
+ border-top-image: url(${0});
+snippet bdti:n
+ border-top-image: none;
+snippet bdtli
+ border-top-left-image: url(${0});
+snippet bdtli:c
+ border-corner-image: continue;
+snippet bdtli:n
+ border-corner-image: none;
+snippet bdtlrz
+ border-top-left-radius: ${0};
+snippet bdtri
+ border-top-right-image: url(${0});
+snippet bdtri:c
+ border-top-right-image: continue;
+snippet bdtri:n
+ border-top-right-image: none;
+snippet bdtrrz
+ border-top-right-radius: ${0};
+snippet bdts
+ border-top-style: ${0};
+snippet bdts:n
+ border-top-style: none;
+snippet bdtw
+ border-top-width: ${0};
+snippet bdt
+ border-top: ${0};
+snippet bdt:n
+ border-top: none;
+snippet bdw
+ border-width: ${0};
+snippet bd
+ border: ${0};
+snippet bd:n
+ border: none;
+snippet b
+ bottom: ${0};
+snippet b:a
+ bottom: auto;
+snippet bxsh+
+ box-shadow: ${1:0} ${2:0} ${3:0} #${0:000};
+snippet bxsh
+ box-shadow: ${0};
+snippet bxsh:n
+ box-shadow: none;
+snippet bxz
+ box-sizing: ${0};
+snippet bxz:bb
+ box-sizing: border-box;
+snippet bxz:cb
+ box-sizing: content-box;
+snippet cps
+ caption-side: ${0};
+snippet cps:b
+ caption-side: bottom;
+snippet cps:t
+ caption-side: top;
+snippet cl
+ clear: ${0};
+snippet cl:b
+ clear: both;
+snippet cl:l
+ clear: left;
+snippet cl:n
+ clear: none;
+snippet cl:r
+ clear: right;
+snippet cp
+ clip: ${0};
+snippet cp:a
+ clip: auto;
+snippet cp:r
+ clip: rect(${1:0} ${2:0} ${3:0} ${0:0});
+snippet c
+ color: #${0:000};
+snippet ct
+ content: ${0};
+snippet ct:a
+ content: attr(${0});
+snippet ct:cq
+ content: close-quote;
+snippet ct:c
+ content: counter(${0});
+snippet ct:cs
+ content: counters(${0});
+snippet ct:ncq
+ content: no-close-quote;
+snippet ct:noq
+ content: no-open-quote;
+snippet ct:n
+ content: normal;
+snippet ct:oq
+ content: open-quote;
+snippet coi
+ counter-increment: ${0};
+snippet cor
+ counter-reset: ${0};
+snippet cur
+ cursor: ${0};
+snippet cur:a
+ cursor: auto;
+snippet cur:c
+ cursor: crosshair;
+snippet cur:d
+ cursor: default;
+snippet cur:ha
+ cursor: hand;
+snippet cur:he
+ cursor: help;
+snippet cur:m
+ cursor: move;
+snippet cur:p
+ cursor: pointer;
+snippet cur:t
+ cursor: text;
+snippet d
+ display: ${0};
+snippet d:mib
+ display: -moz-inline-box;
+snippet d:mis
+ display: -moz-inline-stack;
+snippet d:b
+ display: block;
+snippet d:cp
+ display: compact;
+snippet d:ib
+ display: inline-block;
+snippet d:itb
+ display: inline-table;
+snippet d:i
+ display: inline;
+snippet d:li
+ display: list-item;
+snippet d:n
+ display: none;
+snippet d:ri
+ display: run-in;
+snippet d:tbcp
+ display: table-caption;
+snippet d:tbc
+ display: table-cell;
+snippet d:tbclg
+ display: table-column-group;
+snippet d:tbcl
+ display: table-column;
+snippet d:tbfg
+ display: table-footer-group;
+snippet d:tbhg
+ display: table-header-group;
+snippet d:tbrg
+ display: table-row-group;
+snippet d:tbr
+ display: table-row;
+snippet d:tb
+ display: table;
+snippet ec
+ empty-cells: ${0};
+snippet ec:h
+ empty-cells: hide;
+snippet ec:s
+ empty-cells: show;
+snippet exp
+ expression()
+snippet fl
+ float: ${0};
+snippet fl:l
+ float: left;
+snippet fl:n
+ float: none;
+snippet fl:r
+ float: right;
+snippet f+
+ font: ${1:1em} ${2:Arial},${0:sans-serif};
+snippet fef
+ font-effect: ${0};
+snippet fef:eb
+ font-effect: emboss;
+snippet fef:eg
+ font-effect: engrave;
+snippet fef:n
+ font-effect: none;
+snippet fef:o
+ font-effect: outline;
+snippet femp
+ font-emphasize-position: ${0};
+snippet femp:a
+ font-emphasize-position: after;
+snippet femp:b
+ font-emphasize-position: before;
+snippet fems
+ font-emphasize-style: ${0};
+snippet fems:ac
+ font-emphasize-style: accent;
+snippet fems:c
+ font-emphasize-style: circle;
+snippet fems:ds
+ font-emphasize-style: disc;
+snippet fems:dt
+ font-emphasize-style: dot;
+snippet fems:n
+ font-emphasize-style: none;
+snippet fem
+ font-emphasize: ${0};
+snippet ff
+ font-family: ${0};
+snippet ff:c
+ font-family: ${0:'Monotype Corsiva','Comic Sans MS'},cursive;
+snippet ff:f
+ font-family: ${0:Capitals,Impact},fantasy;
+snippet ff:m
+ font-family: ${0:Monaco,'Courier New'},monospace;
+snippet ff:ss
+ font-family: ${0:Helvetica,Arial},sans-serif;
+snippet ff:s
+ font-family: ${0:Georgia,'Times New Roman'},serif;
+snippet fza
+ font-size-adjust: ${0};
+snippet fza:n
+ font-size-adjust: none;
+snippet fz
+ font-size: ${0};
+snippet fsm
+ font-smooth: ${0};
+snippet fsm:aw
+ font-smooth: always;
+snippet fsm:a
+ font-smooth: auto;
+snippet fsm:n
+ font-smooth: never;
+snippet fst
+ font-stretch: ${0};
+snippet fst:c
+ font-stretch: condensed;
+snippet fst:e
+ font-stretch: expanded;
+snippet fst:ec
+ font-stretch: extra-condensed;
+snippet fst:ee
+ font-stretch: extra-expanded;
+snippet fst:n
+ font-stretch: normal;
+snippet fst:sc
+ font-stretch: semi-condensed;
+snippet fst:se
+ font-stretch: semi-expanded;
+snippet fst:uc
+ font-stretch: ultra-condensed;
+snippet fst:ue
+ font-stretch: ultra-expanded;
+snippet fs
+ font-style: ${0};
+snippet fs:i
+ font-style: italic;
+snippet fs:n
+ font-style: normal;
+snippet fs:o
+ font-style: oblique;
+snippet fv
+ font-variant: ${0};
+snippet fv:n
+ font-variant: normal;
+snippet fv:sc
+ font-variant: small-caps;
+snippet fw
+ font-weight: ${0};
+snippet fw:b
+ font-weight: bold;
+snippet fw:br
+ font-weight: bolder;
+snippet fw:lr
+ font-weight: lighter;
+snippet fw:n
+ font-weight: normal;
+snippet f
+ font: ${0};
+snippet h
+ height: ${0};
+snippet h:a
+ height: auto;
+snippet l
+ left: ${0};
+snippet l:a
+ left: auto;
+snippet lts
+ letter-spacing: ${0};
+snippet lh
+ line-height: ${0};
+snippet lisi
+ list-style-image: url(${0});
+snippet lisi:n
+ list-style-image: none;
+snippet lisp
+ list-style-position: ${0};
+snippet lisp:i
+ list-style-position: inside;
+snippet lisp:o
+ list-style-position: outside;
+snippet list
+ list-style-type: ${0};
+snippet list:c
+ list-style-type: circle;
+snippet list:dclz
+ list-style-type: decimal-leading-zero;
+snippet list:dc
+ list-style-type: decimal;
+snippet list:d
+ list-style-type: disc;
+snippet list:lr
+ list-style-type: lower-roman;
+snippet list:n
+ list-style-type: none;
+snippet list:s
+ list-style-type: square;
+snippet list:ur
+ list-style-type: upper-roman;
+snippet lis
+ list-style: ${0};
+snippet lis:n
+ list-style: none;
+snippet mb
+ margin-bottom: ${0};
+snippet mb:a
+ margin-bottom: auto;
+snippet ml
+ margin-left: ${0};
+snippet ml:a
+ margin-left: auto;
+snippet mr
+ margin-right: ${0};
+snippet mr:a
+ margin-right: auto;
+snippet mt
+ margin-top: ${0};
+snippet mt:a
+ margin-top: auto;
+snippet m
+ margin: ${0};
+snippet m:4
+ margin: ${1:0} ${2:0} ${3:0} ${0:0};
+snippet m:3
+ margin: ${1:0} ${2:0} ${0:0};
+snippet m:2
+ margin: ${1:0} ${0:0};
+snippet m:0
+ margin: 0;
+snippet m:a
+ margin: auto;
+snippet mah
+ max-height: ${0};
+snippet mah:n
+ max-height: none;
+snippet maw
+ max-width: ${0};
+snippet maw:n
+ max-width: none;
+snippet mih
+ min-height: ${0};
+snippet miw
+ min-width: ${0};
+snippet op
+ opacity: ${0};
+snippet op:ie
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100});
+snippet op:ms
+ -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100})';
+snippet orp
+ orphans: ${0};
+snippet o+
+ outline: ${1:1px} ${2:solid} #${0:000};
+snippet oc
+ outline-color: ${0:#000};
+snippet oc:i
+ outline-color: invert;
+snippet oo
+ outline-offset: ${0};
+snippet os
+ outline-style: ${0};
+snippet ow
+ outline-width: ${0};
+snippet o
+ outline: ${0};
+snippet o:n
+ outline: none;
+snippet ovs
+ overflow-style: ${0};
+snippet ovs:a
+ overflow-style: auto;
+snippet ovs:mq
+ overflow-style: marquee;
+snippet ovs:mv
+ overflow-style: move;
+snippet ovs:p
+ overflow-style: panner;
+snippet ovs:s
+ overflow-style: scrollbar;
+snippet ovx
+ overflow-x: ${0};
+snippet ovx:a
+ overflow-x: auto;
+snippet ovx:h
+ overflow-x: hidden;
+snippet ovx:s
+ overflow-x: scroll;
+snippet ovx:v
+ overflow-x: visible;
+snippet ovy
+ overflow-y: ${0};
+snippet ovy:a
+ overflow-y: auto;
+snippet ovy:h
+ overflow-y: hidden;
+snippet ovy:s
+ overflow-y: scroll;
+snippet ovy:v
+ overflow-y: visible;
+snippet ov
+ overflow: ${0};
+snippet ov:a
+ overflow: auto;
+snippet ov:h
+ overflow: hidden;
+snippet ov:s
+ overflow: scroll;
+snippet ov:v
+ overflow: visible;
+snippet pb
+ padding-bottom: ${0};
+snippet pl
+ padding-left: ${0};
+snippet pr
+ padding-right: ${0};
+snippet pt
+ padding-top: ${0};
+snippet p
+ padding: ${0};
+snippet p:4
+ padding: ${1:0} ${2:0} ${3:0} ${0:0};
+snippet p:3
+ padding: ${1:0} ${2:0} ${0:0};
+snippet p:2
+ padding: ${1:0} ${0:0};
+snippet p:0
+ padding: 0;
+snippet pgba
+ page-break-after: ${0};
+snippet pgba:aw
+ page-break-after: always;
+snippet pgba:a
+ page-break-after: auto;
+snippet pgba:l
+ page-break-after: left;
+snippet pgba:r
+ page-break-after: right;
+snippet pgbb
+ page-break-before: ${0};
+snippet pgbb:aw
+ page-break-before: always;
+snippet pgbb:a
+ page-break-before: auto;
+snippet pgbb:l
+ page-break-before: left;
+snippet pgbb:r
+ page-break-before: right;
+snippet pgbi
+ page-break-inside: ${0};
+snippet pgbi:a
+ page-break-inside: auto;
+snippet pgbi:av
+ page-break-inside: avoid;
+snippet pos
+ position: ${0};
+snippet pos:a
+ position: absolute;
+snippet pos:f
+ position: fixed;
+snippet pos:r
+ position: relative;
+snippet pos:s
+ position: static;
+snippet q
+ quotes: ${0};
+snippet q:en
+ quotes: '\201C' '\201D' '\2018' '\2019';
+snippet q:n
+ quotes: none;
+snippet q:ru
+ quotes: '\00AB' '\00BB' '\201E' '\201C';
+snippet rz
+ resize: ${0};
+snippet rz:b
+ resize: both;
+snippet rz:h
+ resize: horizontal;
+snippet rz:n
+ resize: none;
+snippet rz:v
+ resize: vertical;
+snippet r
+ right: ${0};
+snippet r:a
+ right: auto;
+snippet tbl
+ table-layout: ${0};
+snippet tbl:a
+ table-layout: auto;
+snippet tbl:f
+ table-layout: fixed;
+snippet tal
+ text-align-last: ${0};
+snippet tal:a
+ text-align-last: auto;
+snippet tal:c
+ text-align-last: center;
+snippet tal:l
+ text-align-last: left;
+snippet tal:r
+ text-align-last: right;
+snippet ta
+ text-align: ${0};
+snippet ta:c
+ text-align: center;
+snippet ta:l
+ text-align: left;
+snippet ta:r
+ text-align: right;
+snippet td
+ text-decoration: ${0};
+snippet td:l
+ text-decoration: line-through;
+snippet td:n
+ text-decoration: none;
+snippet td:o
+ text-decoration: overline;
+snippet td:u
+ text-decoration: underline;
+snippet te
+ text-emphasis: ${0};
+snippet te:ac
+ text-emphasis: accent;
+snippet te:a
+ text-emphasis: after;
+snippet te:b
+ text-emphasis: before;
+snippet te:c
+ text-emphasis: circle;
+snippet te:ds
+ text-emphasis: disc;
+snippet te:dt
+ text-emphasis: dot;
+snippet te:n
+ text-emphasis: none;
+snippet th
+ text-height: ${0};
+snippet th:a
+ text-height: auto;
+snippet th:f
+ text-height: font-size;
+snippet th:m
+ text-height: max-size;
+snippet th:t
+ text-height: text-size;
+snippet ti
+ text-indent: ${0};
+snippet ti:-
+ text-indent: -9999px;
+snippet tj
+ text-justify: ${0};
+snippet tj:a
+ text-justify: auto;
+snippet tj:d
+ text-justify: distribute;
+snippet tj:ic
+ text-justify: inter-cluster;
+snippet tj:ii
+ text-justify: inter-ideograph;
+snippet tj:iw
+ text-justify: inter-word;
+snippet tj:k
+ text-justify: kashida;
+snippet tj:t
+ text-justify: tibetan;
+snippet to+
+ text-outline: ${1:0} ${2:0} #${0:000};
+snippet to
+ text-outline: ${0};
+snippet to:n
+ text-outline: none;
+snippet tr
+ text-replace: ${0};
+snippet tr:n
+ text-replace: none;
+snippet tsh+
+ text-shadow: ${1:0} ${2:0} ${3:0} #${0:000};
+snippet tsh
+ text-shadow: ${0};
+snippet tsh:n
+ text-shadow: none;
+snippet tt
+ text-transform: ${0};
+snippet tt:c
+ text-transform: capitalize;
+snippet tt:l
+ text-transform: lowercase;
+snippet tt:n
+ text-transform: none;
+snippet tt:u
+ text-transform: uppercase;
+snippet tw
+ text-wrap: ${0};
+snippet tw:no
+ text-wrap: none;
+snippet tw:n
+ text-wrap: normal;
+snippet tw:s
+ text-wrap: suppress;
+snippet tw:u
+ text-wrap: unrestricted;
+snippet t
+ top: ${0};
+snippet t:a
+ top: auto;
+snippet va
+ vertical-align: ${0};
+snippet va:bl
+ vertical-align: baseline;
+snippet va:b
+ vertical-align: bottom;
+snippet va:m
+ vertical-align: middle;
+snippet va:sub
+ vertical-align: sub;
+snippet va:sup
+ vertical-align: super;
+snippet va:tb
+ vertical-align: text-bottom;
+snippet va:tt
+ vertical-align: text-top;
+snippet va:t
+ vertical-align: top;
+snippet v
+ visibility: ${0};
+snippet v:c
+ visibility: collapse;
+snippet v:h
+ visibility: hidden;
+snippet v:v
+ visibility: visible;
+snippet whsc
+ white-space-collapse: ${0};
+snippet whsc:ba
+ white-space-collapse: break-all;
+snippet whsc:bs
+ white-space-collapse: break-strict;
+snippet whsc:k
+ white-space-collapse: keep-all;
+snippet whsc:l
+ white-space-collapse: loose;
+snippet whsc:n
+ white-space-collapse: normal;
+snippet whs
+ white-space: ${0};
+snippet whs:n
+ white-space: normal;
+snippet whs:nw
+ white-space: nowrap;
+snippet whs:pl
+ white-space: pre-line;
+snippet whs:pw
+ white-space: pre-wrap;
+snippet whs:p
+ white-space: pre;
+snippet wid
+ widows: ${0};
+snippet w
+ width: ${0};
+snippet w:a
+ width: auto;
+snippet wob
+ word-break: ${0};
+snippet wob:ba
+ word-break: break-all;
+snippet wob:bs
+ word-break: break-strict;
+snippet wob:k
+ word-break: keep-all;
+snippet wob:l
+ word-break: loose;
+snippet wob:n
+ word-break: normal;
+snippet wos
+ word-spacing: ${0};
+snippet wow
+ word-wrap: ${0};
+snippet wow:no
+ word-wrap: none;
+snippet wow:n
+ word-wrap: normal;
+snippet wow:s
+ word-wrap: suppress;
+snippet wow:u
+ word-wrap: unrestricted;
+snippet z
+ z-index: ${0};
+snippet z:a
+ z-index: auto;
+snippet zoo
+ zoom: 1;
+snippet :h
+ :hover
+snippet :fc
+ :first-child
+snippet :lc
+ :last-child
+snippet :nc
+ :nth-child(${0})
+snippet :nlc
+ :nth-last-child(${0})
+snippet :oc
+ :only-child
+snippet :a
+ :after
+snippet :b
+ :before
+snippet ::a
+ ::after
+snippet ::b
+ ::before
diff --git a/vim/bundle/vim-snippets/snippets/d.snippets b/vim/bundle/vim-snippets/snippets/d.snippets
new file mode 100644
index 0000000..216a4d8
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/d.snippets
@@ -0,0 +1,338 @@
+### Import
+snippet imp
+ import
+snippet pimp
+ public import
+### My favorite modules
+snippet io
+ std.stdio
+snippet traits
+ std.traits
+snippet conv
+ std.conv
+snippet arr
+ std.array
+snippet algo
+ std.algorithm
+snippet theusual
+ import std.stdio, std.string, std.array;
+ import std.traits, std.conv, std.algorithm;
+ import std.math, std.regex;
+### Control Structures
+snippet for
+ for(int ${1:i} = 0; $1 < ${2:count}; $1++) {
+ ${0}
+ }
+snippet fe
+ foreach(${1:elem}; ${2:range}) {
+ ${0}
+ }
+snippet fei
+ foreach(${1:i}, ${2:elem}; ${3:range}) {
+ ${0}
+ }
+snippet fer
+ foreach_reverse(${1:elem}; ${2:range}) {
+ ${0}
+ }
+snippet feri
+ foreach_reverse(${1:i}, ${2:elem}; ${3:range}) {
+ ${0}
+ }
+snippet sce
+ scope(exit) ${1:f.close();}
+snippet scs
+ scope(success) ${1}
+snippet scf
+ scope(failure) ${1}
+snippet el
+ else {
+ ${1}
+ }
+snippet eif
+ else if(${1}) {
+ ${0}
+ }
+snippet if
+ if(${1}) {
+ ${0}
+ }
+snippet ife
+ if(${1}) {
+ ${2}
+ } else {
+ ${3}
+ }
+snippet ifee
+ if(${1}) {
+ ${2}
+ } else if(${3}) {
+ ${4}
+ } else {
+ ${5}
+ }
+snippet sw
+ switch(${1}) {
+ ${0}
+ }
+snippet cs
+ case ${1:0}:
+ ${2}
+ break;
+snippet def
+ default:
+ ${0}
+snippet fsw
+ final switch(${1}) {
+ ${0}
+ }
+snippet try
+ try {
+ ${1}
+ } catch(${2:Exception} ${3:e}) {
+ ${4}
+ }
+snippet tcf
+ try {
+ ${0}
+ } catch(${1:Exception} ${2:e}) {
+ ${3}
+ } finally {
+ ${4}
+ }
+snippet wh
+ while(${1:cond}) {
+ ${0}
+ }
+snippet dowh
+ do {
+ ${1}
+ } while(${2});
+snippet sif
+ static if(${1:cond}) {
+ ${2}
+ }
+snippet sife
+ static if(${1}) {
+ ${2}
+ } else {
+ ${3}
+ }
+snippet sifee
+ static if(${1}) {
+ ${2}
+ } else static if(${3}) {
+ ${4}
+ } else {
+ ${5}
+ }
+snippet seif
+ else static if(${1}) {
+ ${2}
+ }
+snippet ?
+ (${1: a > b}) ? ${2:a} : ${3:b};
+snippet with
+ with(${1:exp}) {
+ ${2}
+ } ${0}
+### Functions
+snippet fun
+ ${1:auto} ${2:func}(${3:params}) {
+ ${0}
+ }
+snippet contr
+ in {
+ ${1}
+ } out {
+ ${2}
+ } body {
+ ${0}
+ }
+snippet l
+ (${1:x}) => ${2:x}${0:;}
+snippet funl
+ function (${1:int x}) => ${2}${3:;}
+snippet del
+ delegate (${1:int x}) => ${2}${3:;}
+### Templates
+snippet temp
+ template ${1:`vim_snippets#Filename("$2", "untitled")`}(${2:T}) {
+ ${0}
+ }
+snippet tempif
+ template ${1:`vim_snippets#Filename("$2", "untitled")`}(${2:T}) if(${3:isSomeString!}$2) {
+ ${0}
+ }
+snippet opApply
+ int opApply(Dg)(Dg dg) if(ParameterTypeTuble!Dg.length == 2) {
+ ${0}
+ }
+snippet psn
+ pure @safe nothrow
+snippet safe
+ @safe
+snippet trusted
+ @trusted
+snippet system
+ @system
+### OOPs
+snippet cl
+ class${1:(T)} ${2:`vim_snippets#Filename("$3", "untitled")`} {
+ ${0}
+ }
+snippet str
+ struct${1:(T)} ${2:`vim_snippets#Filename("$3", "untitled")`} {
+ ${0}
+ }
+snippet uni
+ union${1:(T)} ${2:`vim_snippets#Filename("$3", "untitled")`} {
+ ${0}
+ }
+snippet inter
+ interface I${1:`vim_snippets#Filename("$2", "untitled")`} {
+ ${0}
+ }
+snippet enum
+ enum ${1} {
+ ${0}
+ }
+snippet pu
+ public
+snippet pr
+ private
+snippet po
+ protected
+snippet ctor
+ this(${1}) {
+ ${0}
+ }
+snippet dtor
+ ~this(${1}) {
+ ${0}
+ }
+### Type Witchery
+snippet al
+ alias ${1:b} = ${2:a};
+ ${0}
+snippet alth
+ alias ${1:value} this;
+ ${0}
+### The Commonplace
+snippet main
+ void main() {
+ ${0}
+ }
+snippet maina
+ void main(string[] args) {
+ ${0}
+ }
+snippet mod
+ module ${1:main};${0}
+snippet var
+ ${1:auto} ${2:var} = ${0:1};
+snippet new
+ ${1:auto} ${2:var} = new ${3:Object}(${4});
+ ${0}
+snippet file
+ auto ${1:f} = File(${2:"useful_info.xml"}, ${3:"rw"});
+ ${0}
+snippet map
+ map!(${1:f})(${2:xs});
+ ${0}
+snippet filter
+ filter!(${1:p})(${2:xs});
+ ${0}
+snippet reduce
+ reduce!(${1:f})(${2:xs});
+ ${0}
+snippet find
+ find!(${1:p})($2:xs);
+ ${0}
+snippet aa
+ ${1:int}[${2:string}] ${3:dict} = ${0};
+### Misc
+snippet #!
+ #!/usr/bin/env rdmd
+snippet bang
+ #!/usr/bin/env rdmd
+snippet rdmd
+ #!/usr/bin/env rdmd
+snippet isstr
+ isSomeString!${1:S}
+snippet isnum
+ isNumeric!${1:N}
+snippet tos
+ to!string(${1:x});
+ ${0}
+snippet toi
+ to!int(${1:str});
+ ${0}
+snippet tod
+ to!double(${1:str});
+ ${0}
+snippet un
+ unittest {
+ ${0}
+ }
+snippet ver
+ version(${1:Posix}) {
+ ${0}
+ }
+snippet de
+ debug {
+ ${0}
+ }
+snippet sst
+ shared static this(${1}) {
+ ${0}
+ }
+snippet td
+ // Typedef is deprecated. Use alias instead.
+ typedef
+snippet ino
+ inout
+snippet imm
+ immutable
+snippet fin
+ final
+snippet con
+ const
+snippet psi
+ private static immutable ${1:int} ${2:Constant} = ${3:1};
+ ${0}
+snippet prag
+ pragma(${1})
+snippet pms
+ pragma(msg, ${1:Warning});
+snippet asm
+ asm {
+ ${1}
+ }
+snippet mixin
+ mixin(${1:`writeln("Hello, World!");`});
+snippet over
+ override
+snippet ret
+ return ${1};
+snippet FILE
+ __FILE__
+snippet MOD
+ __MODULE__
+snippet LINE
+ __LINE__
+snippet FUN
+ __FUNCTION__
+snippet PF
+ __PRETTY_FUNCTION__
+snippet cast
+ cast(${1:T})(${2:val});
+snippet /*
+ /*
+ * ${1}
+ */
+### Fun stuff
+snippet idk
+ // I don't know how this works. Don't touch it.
+snippet idfk
+ // Don't FUCKING touch this.
diff --git a/vim/bundle/vim-snippets/snippets/dart.snippets b/vim/bundle/vim-snippets/snippets/dart.snippets
new file mode 100644
index 0000000..0093f2b
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/dart.snippets
@@ -0,0 +1,82 @@
+snippet lib
+ #library('${1}');
+ ${0}
+snippet im
+ #import('${1}');
+ ${0}
+snippet so
+ #source('${1}');
+ ${0}
+snippet main
+ static void main() {
+ ${0}
+ }
+snippet st
+ static ${0}
+snippet fi
+ final ${0}
+snippet re
+ return ${0}
+snippet br
+ break;
+snippet th
+ throw ${0}
+snippet cl
+ class ${1:`vim_snippets#Filename("", "untitled")`} ${0}
+snippet in
+ interface ${1:`vim_snippets#Filename("", "untitled")`} ${0}
+snippet imp
+ implements ${0}
+snippet ext
+ extends ${0}
+snippet if
+ if (${1:true}) {
+ ${0}
+ }
+snippet ife
+ if (${1:true}) {
+ ${2}
+ } else {
+ ${0}
+ }
+snippet el
+ else
+snippet sw
+ switch (${1}) {
+ ${0}
+ }
+snippet cs
+ case ${1}:
+ ${0}
+snippet de
+ default:
+ ${0}
+snippet for
+ for (var ${2:i} = 0, len = ${1:things}.length; $2 < len; ${3:++}$2) {
+ ${0:$1[$2]}
+ }
+snippet fore
+ for (final ${2:item} in ${1:itemList}) {
+ ${0}
+ }
+snippet wh
+ while (${1:/* condition */}) {
+ ${0}
+ }
+snippet dowh
+ do {
+ ${0}
+ } while (${0:/* condition */});
+snippet as
+ assert(${0:/* condition */});
+snippet try
+ try {
+ ${0}
+ } catch (${1:Exception e}) {
+ }
+snippet tryf
+ try {
+ ${0}
+ } catch (${1:Exception e}) {
+ } finally {
+ }
diff --git a/vim/bundle/vim-snippets/snippets/diff.snippets b/vim/bundle/vim-snippets/snippets/diff.snippets
new file mode 100644
index 0000000..89bc31d
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/diff.snippets
@@ -0,0 +1,11 @@
+# DEP-3 (http://dep.debian.net/deps/dep3/) style patch header
+snippet header DEP-3 style header
+ Description: ${1}
+ Origin: ${2:vendor|upstream|other}, ${3:url of the original patch}
+ Bug: ${4:url in upstream bugtracker}
+ Forwarded: ${5:no|not-needed|url}
+ Author: ${6:`g:snips_author`}
+ Reviewed-by: ${7:name and email}
+ Last-Update: ${8:`strftime("%Y-%m-%d")`}
+ Applied-Upstream: ${0:upstream version|url|commit}
+
diff --git a/vim/bundle/vim-snippets/snippets/django.snippets b/vim/bundle/vim-snippets/snippets/django.snippets
new file mode 100644
index 0000000..e2a8d6d
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/django.snippets
@@ -0,0 +1,112 @@
+# Model Fields
+
+# Note: Optional arguments are using defaults that match what Django will use
+# as a default, e.g. with max_length fields. Doing this as a form of self
+# documentation and to make it easy to know whether you should override the
+# default or not.
+
+# Note: Optional arguments that are booleans will use the opposite since you
+# can either not specify them, or override them, e.g. auto_now_add=False.
+
+snippet auto
+ ${1:FIELDNAME} = models.AutoField(${0})
+snippet bigint
+ ${1:FIELDNAME} = models.BigIntegerField(${0})
+snippet binary
+ ${1:FIELDNAME} = models.BinaryField(${0})
+snippet bool
+ ${1:FIELDNAME} = models.BooleanField(${0:default=True})
+snippet char
+ ${1:FIELDNAME} = models.CharField(max_length=${2}${0:, blank=True})
+snippet comma
+ ${1:FIELDNAME} = models.CommaSeparatedIntegerField(max_length=${2}${0:, blank=True})
+snippet date
+ ${1:FIELDNAME} = models.DateField(${2:auto_now_add=True, auto_now=True}${0:, blank=True, null=True})
+snippet datetime
+ ${1:FIELDNAME} = models.DateTimeField(${2:auto_now_add=True, auto_now=True}${0:, blank=True, null=True})
+snippet decimal
+ ${1:FIELDNAME} = models.DecimalField(max_digits=${2}, decimal_places=${0})
+snippet email
+ ${1:FIELDNAME} = models.EmailField(max_length=${2:75}${0:, blank=True})
+snippet file
+ ${1:FIELDNAME} = models.FileField(upload_to=${2:path/for/upload}${0:, max_length=100})
+snippet filepath
+ ${1:FIELDNAME} = models.FilePathField(path=${2:"/abs/path/to/dir"}${3:, max_length=100}${4:, match="*.ext"}${5:, recursive=True}${0:, blank=True, })
+snippet float
+ ${1:FIELDNAME} = models.FloatField(${0})
+snippet image
+ ${1:FIELDNAME} = models.ImageField(upload_to=${2:path/for/upload}${3:, height_field=height, width_field=width}${0:, max_length=100})
+snippet int
+ ${1:FIELDNAME} = models.IntegerField(${0})
+snippet ip
+ ${1:FIELDNAME} = models.IPAddressField(${0})
+snippet nullbool
+ ${1:FIELDNAME} = models.NullBooleanField(${0})
+snippet posint
+ ${1:FIELDNAME} = models.PositiveIntegerField(${0})
+snippet possmallint
+ ${1:FIELDNAME} = models.PositiveSmallIntegerField(${0})
+snippet slug
+ ${1:FIELDNAME} = models.SlugField(max_length=${2:50}${0:, blank=True})
+snippet smallint
+ ${1:FIELDNAME} = models.SmallIntegerField(${0})
+snippet text
+ ${1:FIELDNAME} = models.TextField(${0:blank=True})
+snippet time
+ ${1:FIELDNAME} = models.TimeField(${2:auto_now_add=True, auto_now=True}${0:, blank=True, null=True})
+snippet url
+ ${1:FIELDNAME} = models.URLField(${2:verify_exists=False}${3:, max_length=200}${0:, blank=True})
+snippet xml
+ ${1:FIELDNAME} = models.XMLField(schema_path=${2:None}${0:, blank=True})
+# Relational Fields
+snippet fk
+ ${1:FIELDNAME} = models.ForeignKey(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${0:, to_field=''})
+snippet m2m
+ ${1:FIELDNAME} = models.ManyToManyField(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${5:, symmetrical=False}${6:, through=''}${0:, db_table=''})
+snippet o2o
+ ${1:FIELDNAME} = models.OneToOneField(${2:OtherModel}${3:, parent_link=True}${4:, related_name=''}${5:, limit_choices_to=}${0:, to_field=''})
+
+# Code Skeletons
+
+snippet form
+ class ${1:FormName}(forms.Form):
+ """${2:docstring}"""
+ ${0}
+
+snippet model
+ class ${1:ModelName}(models.Model):
+ """${2:docstring}"""
+ ${3}
+
+ class Meta:
+ ${4}
+
+ def __unicode__(self):
+ ${5}
+
+ def save(self, *args, **kwargs):
+ ${6}
+
+ @models.permalink
+ def get_absolute_url(self):
+ return ('${7:view_or_url_name}' ${0})
+
+snippet modeladmin
+ class ${1:ModelName}Admin(admin.ModelAdmin):
+ ${0}
+
+ admin.site.register($1, $1Admin)
+
+snippet tabularinline
+ class ${0:ModelName}Inline(admin.TabularInline):
+ model = $1
+
+snippet stackedinline
+ class ${0:ModelName}Inline(admin.StackedInline):
+ model = $1
+
+snippet r2r
+ return render_to_response('${1:template.html}', {
+ ${2}
+ }${0:, context_instance=RequestContext(request)}
+ )
diff --git a/vim/bundle/vim-snippets/snippets/dosini.snippets b/vim/bundle/vim-snippets/snippets/dosini.snippets
new file mode 100644
index 0000000..95c759c
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/dosini.snippets
@@ -0,0 +1,12 @@
+snippet ec
+ ; http://editorconfig.org
+
+ root = true
+
+ [*]
+ indent_style = ${1:space_or_tab}
+ indent_size = ${2:indent_size}
+ end_of_line = lf
+ charset = utf-8
+ trim_trailing_whitespace = true
+ insert_final_newline = true
diff --git a/vim/bundle/vim-snippets/snippets/eelixir.snippets b/vim/bundle/vim-snippets/snippets/eelixir.snippets
new file mode 100644
index 0000000..3d6e33d
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/eelixir.snippets
@@ -0,0 +1,34 @@
+extends html
+
+snippet %
+ <% ${0} %>
+snippet =
+ <%= ${0} %>
+snippet end
+ <% end %>
+snippet for
+ <%= for ${1:item} <- ${2:items} ${3:@conn} do %>
+ ${0}
+ <% end %>
+snippet if
+ <%= if ${1} do %>
+ ${0}
+ <% end %>
+snippet ife
+ <%= if ${1} do %>
+ ${2}
+ <%= else %>
+ ${0}
+ <% end %>
+snippet ft
+ <%= form_tag(${1:"/users"}, method: ${2::post}) %>
+ ${0}
+ </form>
+snippet lin
+ <%= link "${1:Submit}", to: ${2:"/users"}, method: ${3::delete} %>
+snippet ff
+ <%= form_for @changeset, ${1:"/users"}, fn f -> %>
+ ${0}
+
+ <%= submit "Submit" %>
+ <% end %>
diff --git a/vim/bundle/vim-snippets/snippets/elixir.snippets b/vim/bundle/vim-snippets/snippets/elixir.snippets
new file mode 100644
index 0000000..851dc8b
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/elixir.snippets
@@ -0,0 +1,136 @@
+snippet do
+ do
+ ${0}
+ end
+snippet if if .. do .. end
+ if ${1} do
+ ${0}
+ end
+snippet if: if .. do: ..
+ if ${1:condition}, do: ${0}
+snippet ife if .. do .. else .. end
+ if ${1:condition} do
+ ${2}
+ else
+ ${0}
+ end
+snippet ife: if .. do: .. else:
+ if ${1:condition}, do: ${2}, else: ${0}
+snippet unless unless .. do .. end
+ unless ${1} do
+ ${0}
+ end
+snippet unless: unless .. do: ..
+ unless ${1:condition}, do: ${0}
+snippet unlesse unless .. do .. else .. end
+ unless ${1:condition} do
+ ${2}
+ else
+ ${0}
+ end
+snippet unlesse: unless .. do: .. else:
+ unless ${1:condition}, do: ${2}, else: ${0}
+snippet cond
+ cond do
+ ${1} ->
+ ${0}
+ end
+snippet case
+ case ${1} do
+ ${2} ->
+ ${0}
+ end
+snippet for
+ for ${1:item} <- ${2:items} do
+ ${0}
+ end
+snippet fori
+ for ${1:item} <- ${2:items}, into: ${3} do
+ ${0}
+ end
+snippet df
+ def ${1:name}, do: ${2}
+snippet def
+ def ${1:name} do
+ ${0}
+ end
+snippet defd
+ @doc """
+ ${1:doc string}
+ """
+ def ${2:name} do
+ ${0}
+ end
+snippet defim
+ defimpl ${1:protocol_name}, for: ${2:data_type} do
+ ${0}
+ end
+snippet defma
+ defmacro ${1:name} do
+ ${0}
+ end
+snippet defmo
+ defmodule ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} do
+ ${0}
+ end
+snippet defp
+ defp ${1:name} do
+ ${0}
+ end
+snippet defpr
+ defprotocol ${1:name}, [${0:function}]
+snippet defr
+ defrecord ${1:record_name}, ${0:fields}
+snippet doc
+ @doc """
+ ${0}
+ """
+snippet fn
+ fn ${1:args} -> ${0} end
+snippet mdoc
+ @moduledoc """
+ ${0}
+ """
+snippet mdocf
+ @moduledoc false
+snippet rec
+ receive do
+ ${1} ->
+ ${0}
+ end
+snippet req
+ require ${0:module_name}
+snippet imp
+ import ${0:module_name}
+snippet ali
+ alias ${0:module_name}
+snippet test
+ test "${1:test_name}" do
+ ${0}
+ end
+snippet testa
+ test "${1:test_name}", %{${2:arg: arg}} do
+ ${0}
+ end
+snippet exunit
+ defmodule ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} do
+ use ExUnit.Case, async: true
+
+ ${0}
+ end
+snippet try try .. rescue .. end
+ try do
+ ${1}
+ rescue
+ ${2} -> ${0}
+ end
+snippet pry
+ require IEx; IEx.pry
+ ${0}
+snippet qu
+ quote do
+ ${1}
+ end
+snippet beh
+ @behaviour ${1:Mix.Task}
+ ${0}
diff --git a/vim/bundle/vim-snippets/snippets/elm.snippets b/vim/bundle/vim-snippets/snippets/elm.snippets
new file mode 100644
index 0000000..6a15c83
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/elm.snippets
@@ -0,0 +1,50 @@
+snippet mod
+ module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')` exposing (${1})
+ ${0}
+snippet imp
+ import ${0:List}
+snippet impe
+ import ${1:List} exposing (${0:map})
+snippet fn
+ ${1:fn} : ${2:a} -> ${3:a}
+ $1 ${4} =
+ ${0}
+snippet fn1
+ ${1:fn} : ${2:a} -> ${3:a}
+ $1 ${4} =
+ ${0}
+snippet fn2
+ ${1:fn} : ${2:a} -> ${3:a} -> ${4:a}
+ $1 ${5} =
+ ${0}
+snippet fn3
+ ${1:fn} : ${2:a} -> ${3:a} -> ${4:a} -> ${5:a}
+ $1 ${6} =
+ ${0}
+snippet fn0
+ ${1:fn} : ${2:a}
+ $1 =
+ ${0}
+snippet case
+ case ${1} of
+ ${2} ->
+ ${0}
+snippet -
+ ${1} ->
+ ${0}
+snippet let
+ let
+ ${1} = ${2}
+ in
+ ${0}
+snippet if
+ if ${1} then
+ ${2}
+ else
+ ${0}
+snippet ty
+ type ${1:Msg}
+ = ${0}
+snippet tya
+ type alias ${1:Model} =
+ ${0}
diff --git a/vim/bundle/vim-snippets/snippets/erlang.snippets b/vim/bundle/vim-snippets/snippets/erlang.snippets
new file mode 100644
index 0000000..5440d7c
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/erlang.snippets
@@ -0,0 +1,706 @@
+# module and export all
+snippet mod
+ -module(${1:`vim_snippets#Filename('', 'my')`}).
+
+ -compile([export_all]).
+
+ start() ->
+ ${0}
+
+ stop() ->
+ ok.
+# define directive
+snippet def
+ -define(${1:macro}, ${2:body}).
+# export directive
+snippet exp
+ -export([${1:function}/${0:arity}]).
+# include directive
+snippet inc
+ -include("${1:file}").
+# include_lib directive
+snippet incl
+ -include_lib("${1:lib}/include/${1}.hrl").${2}
+# behavior directive
+snippet beh
+ -behaviour(${1:behaviour}).
+snippet ifd
+ -ifdef(${1:TEST}).
+ ${0}
+ -endif.
+# if expression
+snippet if
+ if
+ ${1:guard} ->
+ ${0:body}
+ end
+# case expression
+snippet case
+ case ${1:expression} of
+ ${2:pattern} ->
+ ${0:body};
+ end
+# anonymous function
+snippet fun
+ fun (${1:Parameters}) -> ${2:body} end
+# try...catch
+snippet try
+ try
+ ${1}
+ catch
+ ${2:_:_} -> ${0:got_some_exception}
+ end
+# record directive
+snippet rec
+ -record(${1:record}, {
+ ${2:field}=${3:value}}).
+# todo comment
+snippet todo
+ %% TODO: ${0}
+## Snippets below (starting with '%') are in EDoc format.
+## See http://www.erlang.org/doc/apps/edoc/chapter.html#id56887 for more details
+# doc comment
+snippet %d
+ %% @doc ${0}
+# end of doc comment
+snippet %e
+ %% @end
+# specification comment
+snippet %s
+ %% @spec ${0}
+# private function marker
+snippet %p
+ %% @private
+# OTP application
+snippet application
+ -module(${1:`vim_snippets#Filename('', 'my')`}).
+
+ -behaviour(application).
+
+ -export([start/2, stop/1]).
+
+ start(_Type, _StartArgs) ->
+ case ${0:root_supervisor}:start_link() of
+ {ok, Pid} ->
+ {ok, Pid};
+ Other ->
+ {error, Other}
+ end.
+
+ stop(_State) ->
+ ok.
+# OTP supervisor
+snippet supervisor
+ -module(${1:`vim_snippets#Filename('', 'my')`}).
+
+ -behaviour(supervisor).
+
+ %% API
+ -export([start_link/0]).
+
+ %% Supervisor callbacks
+ -export([init/1]).
+
+ -define(SERVER, ?MODULE).
+
+ start_link() ->
+ supervisor:start_link({local, ?SERVER}, ?MODULE, []).
+
+ init([]) ->
+ Server = {${0:my_server}, {${2}, start_link, []},
+ permanent, 2000, worker, [${2}]},
+ Children = [Server],
+ RestartStrategy = {one_for_one, 0, 1},
+ {ok, {RestartStrategy, Children}}.
+# OTP gen_server
+snippet gen_server
+ -module(${0:`vim_snippets#Filename('', 'my')`}).
+
+ -behaviour(gen_server).
+
+ %% API
+ -export([
+ start_link/0
+ ]).
+
+ %% gen_server callbacks
+ -export([init/1,
+ handle_call/3,
+ handle_cast/2,
+ handle_info/2,
+ terminate/2,
+ code_change/3]).
+
+ -define(SERVER, ?MODULE).
+
+ -record(state, {}).
+
+ %%%===================================================================
+ %%% API
+ %%%===================================================================
+
+ start_link() ->
+ gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
+
+ %%%===================================================================
+ %%% gen_server callbacks
+ %%%===================================================================
+
+ init([]) ->
+ {ok, #state{}}.
+
+ handle_call(_Request, _From, State) ->
+ Reply = ok,
+ {reply, Reply, State}.
+
+ handle_cast(_Msg, State) ->
+ {noreply, State}.
+
+ handle_info(_Info, State) ->
+ {noreply, State}.
+
+ terminate(_Reason, _State) ->
+ ok.
+
+ code_change(_OldVsn, State, _Extra) ->
+ {ok, State}.
+
+ %%%===================================================================
+ %%% Internal functions
+ %%%===================================================================
+# OTP gen_fsm
+snippet gen_fsm
+ -module(${0:`vim_snippets#Filename('', 'my')`}).
+
+ -behaviour(gen_fsm).
+
+ %% API
+ -export([start_link/0]).
+
+ %% gen_fsm callbacks
+ -export([init/1,
+ state_name/2,
+ state_name/3,
+ handle_event/3,
+ handle_sync_event/4,
+ handle_info/3,
+ terminate/3,
+ code_change/4]).
+
+ -record(state, {}).
+
+ %%%===================================================================
+ %%% API
+ %%%===================================================================
+
+ %%--------------------------------------------------------------------
+ %% @doc
+ %% Creates a gen_fsm process which calls Module:init/1 to
+ %% initialize. To ensure a synchronized start-up procedure, this
+ %% function does not return until Module:init/1 has returned.
+ %%
+ %% @spec start_link() -> {ok, Pid} | ignore | {error, Error}
+ %% @end
+ %%--------------------------------------------------------------------
+ start_link() ->
+ gen_fsm:start_link({local, ?MODULE}, ?MODULE, [], []).
+
+ %%%===================================================================
+ %%% gen_fsm callbacks
+ %%%===================================================================
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% Whenever a gen_fsm is started using gen_fsm:start/[3,4] or
+ %% gen_fsm:start_link/[3,4], this function is called by the new
+ %% process to initialize.
+ %%
+ %% @spec init(Args) -> {ok, StateName, State} |
+ %% {ok, StateName, State, Timeout} |
+ %% ignore |
+ %% {stop, StopReason}
+ %% @end
+ %%--------------------------------------------------------------------
+ init([]) ->
+ {ok, state_name, #state{}}.
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% There should be one instance of this function for each possible
+ %% state name. Whenever a gen_fsm receives an event sent using
+ %% gen_fsm:send_event/2, the instance of this function with the same
+ %% name as the current state name StateName is called to handle
+ %% the event. It is also called if a timeout occurs.
+ %%
+ %% @spec state_name(Event, State) ->
+ %% {next_state, NextStateName, NextState} |
+ %% {next_state, NextStateName, NextState, Timeout} |
+ %% {stop, Reason, NewState}
+ %% @end
+ %%--------------------------------------------------------------------
+ state_name(_Event, State) ->
+ {next_state, state_name, State}.
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% There should be one instance of this function for each possible
+ %% state name. Whenever a gen_fsm receives an event sent using
+ %% gen_fsm:sync_send_event/[2,3], the instance of this function with
+ %% the same name as the current state name StateName is called to
+ %% handle the event.
+ %%
+ %% @spec state_name(Event, From, State) ->
+ %% {next_state, NextStateName, NextState} |
+ %% {next_state, NextStateName, NextState, Timeout} |
+ %% {reply, Reply, NextStateName, NextState} |
+ %% {reply, Reply, NextStateName, NextState, Timeout} |
+ %% {stop, Reason, NewState} |
+ %% {stop, Reason, Reply, NewState}
+ %% @end
+ %%--------------------------------------------------------------------
+ state_name(_Event, _From, State) ->
+ Reply = ok,
+ {reply, Reply, state_name, State}.
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% Whenever a gen_fsm receives an event sent using
+ %% gen_fsm:send_all_state_event/2, this function is called to handle
+ %% the event.
+ %%
+ %% @spec handle_event(Event, StateName, State) ->
+ %% {next_state, NextStateName, NextState} |
+ %% {next_state, NextStateName, NextState, Timeout} |
+ %% {stop, Reason, NewState}
+ %% @end
+ %%--------------------------------------------------------------------
+ handle_event(_Event, StateName, State) ->
+ {next_state, StateName, State}.
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% Whenever a gen_fsm receives an event sent using
+ %% gen_fsm:sync_send_all_state_event/[2,3], this function is called
+ %% to handle the event.
+ %%
+ %% @spec handle_sync_event(Event, From, StateName, State) ->
+ %% {next_state, NextStateName, NextState} |
+ %% {next_state, NextStateName, NextState, Timeout} |
+ %% {reply, Reply, NextStateName, NextState} |
+ %% {reply, Reply, NextStateName, NextState, Timeout} |
+ %% {stop, Reason, NewState} |
+ %% {stop, Reason, Reply, NewState}
+ %% @end
+ %%--------------------------------------------------------------------
+ handle_sync_event(_Event, _From, StateName, State) ->
+ Reply = ok,
+ {reply, Reply, StateName, State}.
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% This function is called by a gen_fsm when it receives any
+ %% message other than a synchronous or asynchronous event
+ %% (or a system message).
+ %%
+ %% @spec handle_info(Info,StateName,State)->
+ %% {next_state, NextStateName, NextState} |
+ %% {next_state, NextStateName, NextState, Timeout} |
+ %% {stop, Reason, NewState}
+ %% @end
+ %%--------------------------------------------------------------------
+ handle_info(_Info, StateName, State) ->
+ {next_state, StateName, State}.
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% This function is called by a gen_fsm when it is about to
+ %% terminate. It should be the opposite of Module:init/1 and do any
+ %% necessary cleaning up. When it returns, the gen_fsm terminates with
+ %% Reason. The return value is ignored.
+ %%
+ %% @spec terminate(Reason, StateName, State) -> void()
+ %% @end
+ %%--------------------------------------------------------------------
+ terminate(_Reason, _StateName, _State) ->
+ ok.
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% Convert process state when code is changed
+ %%
+ %% @spec code_change(OldVsn, StateName, State, Extra) ->
+ %% {ok, StateName, NewState}
+ %% @end
+ %%--------------------------------------------------------------------
+ code_change(_OldVsn, StateName, State, _Extra) ->
+ {ok, StateName, State}.
+
+ %%%===================================================================
+ %%% Internal functions
+ %%%===================================================================
+# OTP gen_event
+snippet gen_event
+ -module(${0:`vim_snippets#Filename('', 'my')`}).
+
+ -behaviour(gen_event).
+
+ %% API
+ -export([start_link/0,
+ add_handler/2]).
+
+ %% gen_event callbacks
+ -export([init/1,
+ handle_event/2,
+ handle_call/2,
+ handle_info/2,
+ terminate/2,
+ code_change/3]).
+
+ -record(state, {}).
+
+ %%%===================================================================
+ %%% gen_event callbacks
+ %%%===================================================================
+
+ %%--------------------------------------------------------------------
+ %% @doc
+ %% Creates an event manager
+ %%
+ %% @spec start_link() -> {ok, Pid} | {error, Error}
+ %% @end
+ %%--------------------------------------------------------------------
+ start_link() ->
+ gen_event:start_link({local, ?MODULE}).
+
+ %%--------------------------------------------------------------------
+ %% @doc
+ %% Adds an event handler
+ %%
+ %% @spec add_handler(Handler, Args) -> ok | {'EXIT', Reason} | term()
+ %% @end
+ %%--------------------------------------------------------------------
+ add_handler(Handler, Args) ->
+ gen_event:add_handler(?MODULE, Handler, Args).
+
+ %%%===================================================================
+ %%% gen_event callbacks
+ %%%===================================================================
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% Whenever a new event handler is added to an event manager,
+ %% this function is called to initialize the event handler.
+ %%
+ %% @spec init(Args) -> {ok, State}
+ %% @end
+ %%--------------------------------------------------------------------
+ init([]) ->
+ {ok, #state{}}.
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% Whenever an event manager receives an event sent using
+ %% gen_event:notify/2 or gen_event:sync_notify/2, this function is
+ %% called for each installed event handler to handle the event.
+ %%
+ %% @spec handle_event(Event, State) ->
+ %% {ok, State} |
+ %% {swap_handler, Args1, State1, Mod2, Args2} |
+ %% remove_handler
+ %% @end
+ %%--------------------------------------------------------------------
+ handle_event(_Event, State) ->
+ {ok, State}.
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% Whenever an event manager receives a request sent using
+ %% gen_event:call/3,4, this function is called for the specified
+ %% event handler to handle the request.
+ %%
+ %% @spec handle_call(Request, State) ->
+ %% {ok, Reply, State} |
+ %% {swap_handler, Reply, Args1, State1, Mod2, Args2} |
+ %% {remove_handler, Reply}
+ %% @end
+ %%--------------------------------------------------------------------
+ handle_call(_Request, State) ->
+ Reply = ok,
+ {ok, Reply, State}.
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% This function is called for each installed event handler when
+ %% an event manager receives any other message than an event or a
+ %% synchronous request (or a system message).
+ %%
+ %% @spec handle_info(Info, State) ->
+ %% {ok, State} |
+ %% {swap_handler, Args1, State1, Mod2, Args2} |
+ %% remove_handler
+ %% @end
+ %%--------------------------------------------------------------------
+ handle_info(_Info, State) ->
+ {ok, State}.
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% Whenever an event handler is deleted from an event manager, this
+ %% function is called. It should be the opposite of Module:init/1 and
+ %% do any necessary cleaning up.
+ %%
+ %% @spec terminate(Reason, State) -> void()
+ %% @end
+ %%--------------------------------------------------------------------
+ terminate(_Reason, _State) ->
+ ok.
+
+ %%--------------------------------------------------------------------
+ %% @private
+ %% @doc
+ %% Convert process state when code is changed
+ %%
+ %% @spec code_change(OldVsn, State, Extra) -> {ok, NewState}
+ %% @end
+ %%--------------------------------------------------------------------
+ code_change(_OldVsn, State, _Extra) ->
+ {ok, State}.
+
+ %%%===================================================================
+ %%% Internal functions
+ %%%===================================================================
+# EUnit snippets
+snippet eunit
+ -module(${1:`vim_snippets#Filename('', 'my')`}).
+ -include_lib("eunit/include/eunit.hrl").
+
+ ${0}
+snippet ieunit
+ -ifdef(TEST).
+ -include_lib("eunit/include/eunit.hrl").
+
+ ${0}
+
+ -endif.
+snippet as
+ ?assert(${0})
+snippet asn
+ ?assertNot(${0})
+snippet aseq
+ ?assertEqual(${1}, ${0})
+snippet asneq
+ ?assertNotEqual(${1}, ${0})
+snippet asmat
+ ?assertMatch(${1:Pattern}, ${0:Expression})
+snippet asnmat
+ ?assertNotMatch(${1:Pattern}, ${0:Expression})
+snippet aserr
+ ?assertError(${1:Pattern}, ${0:Expression})
+snippet asex
+ ?assertExit(${1:Pattern}, ${0:Expression})
+snippet asexc
+ ?assertException(${1:Class}, ${2:Pattern}, ${0:Expression})
+# common_test test_SUITE
+snippet testsuite
+ -module(${0:`vim_snippets#Filename('', 'my')`}).
+
+ -include_lib("common_test/include/ct.hrl").
+
+ %% Test server callbacks
+ -export([suite/0, all/0, groups/0,
+ init_per_suite/1, end_per_suite/1,
+ init_per_group/2, end_per_group/2,
+ init_per_testcase/2, end_per_testcase/2]).
+
+ %% Test cases
+ -export([
+ ]).
+
+ %%--------------------------------------------------------------------
+ %% COMMON TEST CALLBACK FUNCTIONS
+ %%--------------------------------------------------------------------
+
+ %%--------------------------------------------------------------------
+ %% Function: suite() -> Info
+ %%
+ %% Info = [tuple()]
+ %% List of key/value pairs.
+ %%
+ %% Description: Returns list of tuples to set default properties
+ %% for the suite.
+ %%
+ %% Note: The suite/0 function is only meant to be used to return
+ %% default data values, not perform any other operations.
+ %%--------------------------------------------------------------------
+ suite() ->
+ [{timetrap,{minutes,10}}].
+
+ %%--------------------------------------------------------------------
+ %% Function: init_per_suite(Config0) ->
+ %% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+ %%
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %% Reason = term()
+ %% The reason for skipping the suite.
+ %%
+ %% Description: Initialization before the suite.
+ %%
+ %% Note: This function is free to add any key/value pairs to the Config
+ %% variable, but should NOT alter/remove any existing entries.
+ %%--------------------------------------------------------------------
+ init_per_suite(Config) ->
+ Config.
+
+ %%--------------------------------------------------------------------
+ %% Function: end_per_suite(Config0) -> void() | {save_config,Config1}
+ %%
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %%
+ %% Description: Cleanup after the suite.
+ %%--------------------------------------------------------------------
+ end_per_suite(_Config) ->
+ ok.
+
+ %%--------------------------------------------------------------------
+ %% Function: init_per_group(GroupName, Config0) ->
+ %% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+ %%
+ %% GroupName = atom()
+ %% Name of the test case group that is about to run.
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding configuration data for the group.
+ %% Reason = term()
+ %% The reason for skipping all test cases and subgroups in the group.
+ %%
+ %% Description: Initialization before each test case group.
+ %%--------------------------------------------------------------------
+ init_per_group(_GroupName, Config) ->
+ Config.
+
+ %%--------------------------------------------------------------------
+ %% Function: end_per_group(GroupName, Config0) ->
+ %% void() | {save_config,Config1}
+ %%
+ %% GroupName = atom()
+ %% Name of the test case group that is finished.
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding configuration data for the group.
+ %%
+ %% Description: Cleanup after each test case group.
+ %%--------------------------------------------------------------------
+ end_per_group(_GroupName, _Config) ->
+ ok.
+
+ %%--------------------------------------------------------------------
+ %% Function: init_per_testcase(TestCase, Config0) ->
+ %% Config1 | {skip,Reason} | {skip_and_save,Reason,Config1}
+ %%
+ %% TestCase = atom()
+ %% Name of the test case that is about to run.
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %% Reason = term()
+ %% The reason for skipping the test case.
+ %%
+ %% Description: Initialization before each test case.
+ %%
+ %% Note: This function is free to add any key/value pairs to the Config
+ %% variable, but should NOT alter/remove any existing entries.
+ %%--------------------------------------------------------------------
+ init_per_testcase(_TestCase, Config) ->
+ Config.
+
+ %%--------------------------------------------------------------------
+ %% Function: end_per_testcase(TestCase, Config0) ->
+ %% void() | {save_config,Config1} | {fail,Reason}
+ %%
+ %% TestCase = atom()
+ %% Name of the test case that is finished.
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %% Reason = term()
+ %% The reason for failing the test case.
+ %%
+ %% Description: Cleanup after each test case.
+ %%--------------------------------------------------------------------
+ end_per_testcase(_TestCase, _Config) ->
+ ok.
+
+ %%--------------------------------------------------------------------
+ %% Function: groups() -> [Group]
+ %%
+ %% Group = {GroupName,Properties,GroupsAndTestCases}
+ %% GroupName = atom()
+ %% The name of the group.
+ %% Properties = [parallel | sequence | Shuffle | {RepeatType,N}]
+ %% Group properties that may be combined.
+ %% GroupsAndTestCases = [Group | {group,GroupName} | TestCase]
+ %% TestCase = atom()
+ %% The name of a test case.
+ %% Shuffle = shuffle | {shuffle,Seed}
+ %% To get cases executed in random order.
+ %% Seed = {integer(),integer(),integer()}
+ %% RepeatType = repeat | repeat_until_all_ok | repeat_until_all_fail |
+ %% repeat_until_any_ok | repeat_until_any_fail
+ %% To get execution of cases repeated.
+ %% N = integer() | forever
+ %%
+ %% Description: Returns a list of test case group definitions.
+ %%--------------------------------------------------------------------
+ groups() ->
+ [].
+
+ %%--------------------------------------------------------------------
+ %% Function: all() -> GroupsAndTestCases | {skip,Reason}
+ %%
+ %% GroupsAndTestCases = [{group,GroupName} | TestCase]
+ %% GroupName = atom()
+ %% Name of a test case group.
+ %% TestCase = atom()
+ %% Name of a test case.
+ %% Reason = term()
+ %% The reason for skipping all groups and test cases.
+ %%
+ %% Description: Returns the list of groups and test cases that
+ %% are to be executed.
+ %%--------------------------------------------------------------------
+ all() ->
+ [].
+
+
+ %%--------------------------------------------------------------------
+ %% TEST CASES
+ %%--------------------------------------------------------------------
+
+ %%--------------------------------------------------------------------
+ %% Function: TestCase(Config0) ->
+ %% ok | exit() | {skip,Reason} | {comment,Comment} |
+ %% {save_config,Config1} | {skip_and_save,Reason,Config1}
+ %%
+ %% Config0 = Config1 = [tuple()]
+ %% A list of key/value pairs, holding the test case configuration.
+ %% Reason = term()
+ %% The reason for skipping the test case.
+ %% Comment = term()
+ %% A comment about the test case that will be printed in the html log.
+ %%
+ %% Description: Test case function. (The name of it must be specified in
+ %% the all/0 list or in a test case group for the test case
+ %% to be executed).
+ %%--------------------------------------------------------------------
+
diff --git a/vim/bundle/vim-snippets/snippets/eruby.snippets b/vim/bundle/vim-snippets/snippets/eruby.snippets
new file mode 100644
index 0000000..adad8cb
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/eruby.snippets
@@ -0,0 +1,131 @@
+# .erb and .rhmtl files
+
+# Includes html.snippets
+
+# Rails *****************************
+snippet rc
+ <% ${0} %>
+snippet rce
+ <%= ${1} %>
+snippet %
+ <% ${0} %>
+snippet =
+ <%= ${1} %>
+snippet end
+ <% end %>
+snippet ead
+ <% ${1}.each do |${2}| %>
+ ${0}
+ <% end %>
+snippet for
+ <% for ${2:item} in ${1} %>
+ ${0}
+ <% end %>
+snippet rp
+ <%= render partial: '${0:item}' %>
+snippet rpl
+ <%= render partial: '${1:item}', locals: { :${2:name} => '${3:value}'${0} } %>
+snippet rps
+ <%= render partial: '${1:item}', status: ${0:500} %>
+snippet rpc
+ <%= render partial: '${1:item}', collection: ${0:items} %>
+snippet lia
+ <%= link_to '${1:link text...}', action: '${0:index}' %>
+snippet liai
+ <%= link_to '${1:link text...}', action: '${2:edit}', id: ${0:@item} %>
+snippet lic
+ <%= link_to '${1:link text...}', controller: '${0:items}' %>
+snippet lica
+ <%= link_to '${1:link text...}', controller: '${2:items}', action: '${0:index}' %>
+snippet licai
+ <%= link_to '${1:link text...}', controller: '${2:items}', action: '${3:edit}', id: ${0:@item} %>
+snippet yield
+ <%= yield ${1::content_symbol} %>
+snippet conf
+ <% content_for :${1:head} do %>
+ ${0}
+ <% end %>
+snippet cs
+ <%= collection_select <+object+>, <+method+>, <+collection+>, <+value_method+>, <+text_method+><+, <+[options]+>, <+[html_options]+>+> %>
+snippet ct
+ <%= content_tag '${1:DIV}', ${2:content}${0:,options} %>
+snippet ff
+ <%= form_for @${1:model} do |f| %>
+ ${0}
+ <% end %>
+snippet ffi
+ <%= ${1:f}.input :${0:attribute} %>
+snippet ffcb
+ <%= ${1:f}.check_box :${0:attribute} %>
+snippet ffe
+ <% error_messages_for :${1:model} %>
+
+ <%= form_for @${2:model} do |f| %>
+ ${0}
+ <% end %>
+snippet ffff
+ <%= ${1:f}.file_field :${0:attribute} %>
+snippet ffhf
+ <%= ${1:f}.hidden_field :${0:attribute} %>
+snippet ffl
+ <%= ${1:f}.label :${2:attribute}, '${0:$2}' %>
+snippet ffpf
+ <%= ${1:f}.password_field :${0:attribute} %>
+snippet ffrb
+ <%= ${1:f}.radio_button :${2:attribute}, :${0:tag_value} %>
+snippet ffs
+ <%= ${1:f}.submit "${0:submit}" %>
+snippet ffta
+ <%= ${1:f}.text_area :${0:attribute} %>
+snippet fftf
+ <%= ${1:f}.text_field :${0:attribute} %>
+snippet fields
+ <%= fields_for :${1:model}, @$1 do |${2:f}| %>
+ ${0}
+ <% end %>
+snippet i18
+ I18n.t('${1:type.key}')
+snippet it
+ <%= image_tag "${1}"${0} %>
+snippet jit
+ <%= javascript_include_tag ${0::all} %>
+snippet jsit
+ <%= javascript_include_tag "${0}" %>
+snippet lim
+ <%= link_to ${1:model}.${2:name}, ${3:$1}_path(${0:$1}) %>
+snippet linp
+ <%= link_to "${1:Link text...}", ${2:parent}_${3:child}_path(${4:@$2}, ${0:@$3}) %>
+snippet linpp
+ <%= link_to "${1:Link text...}", ${2:parent}_${3:child}_path(${0:@$2}) %>
+snippet lip
+ <%= link_to "${1:Link text...}", ${2:model}_path(${0:@$2}) %>
+snippet lipp
+ <%= link_to "${1:Link text...}", ${0:model}s_path %>
+snippet lt
+ <%= link_to "${1:name}", ${0:dest} %>
+snippet ntc
+ <%= number_to_currency(${1}) %>
+snippet ofcfs
+ <%= options_from_collection_for_select ${1:collection}, ${2:value_method}, ${3:text_method}, ${0:selected_value} %>
+snippet ofs
+ <%= options_for_select ${1:collection}, ${2:value_method} %>
+snippet rf
+ <%= render file: "${1:file}"${0} %>
+snippet rt
+ <%= render template: "${1:file}"${0} %>
+snippet slt
+ <%= stylesheet_link_tag ${1::all}, cache: ${0:true} %>
+snippet sslt
+ <%= stylesheet_link_tag "${0}" %>
+snippet if
+ <% if ${1} %>
+ ${0}
+ <% end %>
+snippet ife
+ <% if ${1} %>
+ ${2}
+ <% else %>
+ ${0}
+ <% end %>
+snippet pry
+ <% require 'pry'; binding.pry %>
diff --git a/vim/bundle/vim-snippets/snippets/falcon.snippets b/vim/bundle/vim-snippets/snippets/falcon.snippets
new file mode 100644
index 0000000..c523980
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/falcon.snippets
@@ -0,0 +1,71 @@
+snippet #!
+ #!/usr/bin/env falcon
+
+# Import
+snippet imp
+ import ${0:module}
+
+# Function
+snippet fun
+ function ${2:function_name}(${3})
+ ${0}
+ end
+
+# Class
+snippet class
+ class ${1:class_name}(${2:class_params})
+ ${0:/* members/methods */}
+ end
+
+# If
+snippet if
+ if ${1:condition}
+ ${0}
+ end
+
+# If else
+snippet ife
+ if ${1:condition}
+ ${0}
+ else
+ ${1}
+ end
+
+# If else if
+snippet eif
+ elif ${1:condition}
+ ${0}
+
+# Switch case
+snippet switch
+ switch ${1:expression}
+ case ${2:item}
+ case ${0:item}
+ default
+ end
+
+# Select
+snippet select
+ select ${1:variable}
+ case ${2:TypeSpec}
+ case ${0:TypeSpec}
+ default
+ end
+
+# For/in Loop
+snippet forin
+ for ${1:element} in ${2:container}
+ ${0}
+ end
+
+# For/to Loop
+snippet forto
+ for ${1:lowerbound} to ${2:upperbound}
+ ${0}
+ end
+
+# While Loop
+snippet wh
+ while ${1:conidition}
+ ${0}
+ end
diff --git a/vim/bundle/vim-snippets/snippets/fortran.snippets b/vim/bundle/vim-snippets/snippets/fortran.snippets
new file mode 100644
index 0000000..c9ab060
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/fortran.snippets
@@ -0,0 +1,93 @@
+snippet impl
+ implicit none
+ $0
+snippet prog
+ program ${1:main}
+ $0
+ end program $1
+snippet mod
+ module ${1:modulename}
+ $0
+ end module $1
+snippet proc
+ procedure ${1:name}
+ ${0}
+ end procedure $1
+snippet iface
+ interface ${1:name}
+ ${0}
+ end interface $1
+snippet doc
+ ! """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ ! File: ${2:`vim_snippets#Filename('$1')`}
+ ! Author: `g:snips_author`
+ ! Email: `g:snips_email`
+ ! Github: `g:snips_github`
+ ! Description: $1
+ ! """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ $0
+# Variables definitions
+# Boolean
+snippet bool
+ logical :: $0
+# Integer
+snippet int
+ integer :: $0
+snippet real
+ real :: $0
+# Double Precision
+snippet double
+ double precision :: $0
+# Char
+snippet str
+ character(len=${1:*}) :: ${0:}
+# Types
+snippet type
+ type(${1:name})
+ $0
+ end type
+snippet const
+ ${1:type}, parameter :: $2 = $0
+snippet arr
+ ${1:type}, allocatable, dimension(${2::}) :: $0
+snippet intent
+ ${1:type}, intent(inout) :: $0
+# Array
+snippet /
+ (/ $1 /) ${2:,&} $0
+snippet if
+ if (${1:condition}) then
+ $2
+ end if
+snippet case
+ select case (${1:expr})
+ case ($2)
+ case default
+ $3
+ end select $0
+snippet do
+ do ${1:i} = ${2:start},${3:end}, ${4:incr}
+ $4
+ end do
+snippet dow
+ do while (${1:condition})
+ $2
+ end do
+snippet sub
+ subroutine ${1:name}($2)
+ $0
+ end subroutine $1
+snippet func
+ function ${1:name}($2) result($3)
+ $0
+ end function $1
+snippet pr
+ write(*,*) $0
+snippet read
+ read( unit = ${1:fp}, file = ${2:filename}${3:, iostat = IERR }) $0
+snippet write
+ write( unit = ${1:fp}, file = ${2:filename}${3:, iostat = IERR }) $0
+snippet open
+ open (unit = ${1:fp}, file = ${2:filename}, status = unknown${3:, iostat = IERR }) $0
+snippet close
+ close ( unit = ${1:fp} ) $0
diff --git a/vim/bundle/vim-snippets/snippets/go.snippets b/vim/bundle/vim-snippets/snippets/go.snippets
new file mode 100644
index 0000000..b3acac1
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/go.snippets
@@ -0,0 +1,234 @@
+# shorthand variable declaration
+snippet v
+ ${1} := ${2}
+# variable initialization
+snippet vr
+ var ${1:t} ${0:string}
+# variable declaration
+snippet var
+ var ${1} ${2} = ${3}
+# variables declaration
+snippet vars
+ var (
+ ${1} ${2} = ${3}
+ )
+# append
+snippet ap
+ append(${1:slice}, ${0:value})
+# bool
+snippet bl
+ bool
+# byte
+snippet bt
+ byte
+# break
+snippet br
+ break
+# channel
+snippet ch
+ chan ${0:int}
+# case
+snippet cs
+ case ${1:value}:
+ ${0}
+# const
+snippet c
+ const ${1:NAME} = ${0:0}
+# constants with iota
+snippet co
+ const (
+ ${1:NAME1} = iota
+ ${0:NAME2}
+ )
+# continue
+snippet cn
+ continue
+# defer
+snippet df
+ defer ${0:func}()
+# defer recover
+snippet dfr
+ defer func() {
+ if err := recover(); err != nil {
+ ${0}
+ }
+ }()
+# int
+snippet i
+ int
+# import
+snippet im
+ import (
+ "${1:package}"
+ )
+# interface
+snippet in
+ interface{}
+# full interface snippet
+snippet inf
+ interface ${1:name} {
+ ${2:/* methods */}
+ }
+# if condition
+snippet if
+ if ${1:/* condition */} {
+ ${2}
+ }
+snippet ife
+ if ${1:/* condition */} {
+ ${2}
+ } else {
+ ${0}
+ }
+# else snippet
+snippet el
+ else {
+ ${1}
+ }
+# error snippet
+snippet ir
+ if err != nil {
+ return err
+ }
+ ${0}
+# false
+snippet f
+ false
+# fallthrough
+snippet ft
+ fallthrough
+# float
+snippet fl
+ float32
+# float32
+snippet f3
+ float32
+# float64
+snippet f6
+ float64
+# if else
+snippet ie
+ if ${1:/* condition */} {
+ ${2}
+ } else {
+ ${3}
+ }
+ ${0}
+# for int loop
+snippet for
+ for ${1}{
+ ${0}
+ }
+# for int loop
+snippet fori
+ for ${2:i} := 0; $2 < ${1:count}; $2${3:++} {
+ ${0}
+ }
+# for range loop
+snippet forr
+ for ${1:e} := range ${2:collection} {
+ ${0}
+ }
+# function simple
+snippet fun
+ func ${1:funcName}(${2}) ${3:error} {
+ ${4}
+ }
+ ${0}
+# function on receiver
+snippet fum
+ func (${1:receiver} ${2:type}) ${3:funcName}(${4}) ${5:error} {
+ ${6}
+ }
+ ${0}
+# log printf
+snippet lf
+ log.Printf("%${1:s}", ${2:var})
+# log printf
+snippet lp
+ log.Println("${1}")
+# make
+snippet mk
+ make(${1:[]string}, ${0:0})
+# map
+snippet mp
+ map[${1:string}]${0:int}
+# main()
+snippet main
+ func main() {
+ ${1}
+ }
+ ${0}
+# new
+snippet nw
+ new(${0:type})
+# package
+snippet pa
+ package ${1:main}
+# panic
+snippet pn
+ panic("${0:msg}")
+# print
+snippet pr
+ fmt.Printf("%${1:s}\n", ${2:var})
+# range
+snippet rn
+ range ${0}
+# return
+snippet rt
+ return ${0}
+# result
+snippet rs
+ result
+# select
+snippet sl
+ select {
+ case ${1:v1} := <-${2:chan1}
+ ${3}
+ default:
+ ${0}
+ }
+# string
+snippet sr
+ string
+# struct
+snippet st
+ struct ${1:name} {
+ ${2:/* data */}
+ }
+ ${0}
+# switch
+snippet sw
+ switch ${1:var} {
+ case ${2:value1}:
+ ${3}
+ case ${4:value2}:
+ ${5}
+ default:
+ ${0}
+ }
+snippet sp
+ fmt.Sprintf("%${1:s}", ${2:var})
+# true
+snippet t
+ true
+# goroutine named function
+snippet g
+ go ${1:funcName}(${0})
+# goroutine anonymous function
+snippet ga
+ go func(${1} ${2:type}) {
+ ${3:/* code */}
+ }(${0})
+snippet test test function
+ func Test${1:name}(t *testing.T) {
+ ${2}
+ }
+ ${0}
+snippet bench benchmark function
+ func Benchmark${1:name}(b *testing.B) {
+ for i := 0; i < b.N; i++ {
+ ${2}
+ }
+ }
+ ${0}
diff --git a/vim/bundle/vim-snippets/snippets/haml.snippets b/vim/bundle/vim-snippets/snippets/haml.snippets
new file mode 100644
index 0000000..09217c6
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/haml.snippets
@@ -0,0 +1,37 @@
+snippet t
+ %table
+ %tr
+ %th
+ ${1:headers}
+ %tr
+ %td
+ ${0:headers}
+snippet ul
+ %ul
+ %li
+ ${0:item}
+ %li
+snippet rp
+ = render :partial => "${0:item}"
+snippet rpc
+ = render :partial => "${1:item}", :collection => ${0:@$1s}
+snippet rpl
+ = render :partial => "${1:item}", :locals => { :${2:$1} => ${0:@$1}
+snippet rpo
+ = render :partial => "${1:item}", :object => ${0:@$1}
+snippet lt
+ = link_to ${1:name}, ${2:dest}
+snippet mt
+ = mail_to ${1:email_address}, ${2:name}
+snippet mts
+ = mail_to ${1:email_address}, ${2:name}, :subject => ${3}, :body => ${4}
+snippet ife
+ - if ${1:condition}
+ ${2}
+ - else
+ ${0}
+snippet ifp
+ - if ${1:condition}.presence?
+ ${0}
+snippet ntc
+ = number_to_currency(${1})
diff --git a/vim/bundle/vim-snippets/snippets/haskell.snippets b/vim/bundle/vim-snippets/snippets/haskell.snippets
new file mode 100644
index 0000000..e4957e4
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/haskell.snippets
@@ -0,0 +1,115 @@
+snippet lang
+ {-# LANGUAGE ${0:OverloadedStrings} #-}
+snippet haddock
+ {-# OPTIONS_HADDOCK ${0:hide} #-}
+snippet ghc
+ {-# OPTIONS_GHC ${0:-fno-warn-unused-imports} #-}
+snippet inline
+ {-# INLINE ${0:name} #-}
+snippet info
+ -- |
+ -- Module : ${1:`substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')`}
+ -- Copyright : ${2:Author} ${3:2011-2012}
+ -- License : ${4:BSD3}
+ --
+ -- Maintainer : ${5:email@something.com}
+ -- Stability : ${6:experimental}
+ -- Portability : ${7:unknown}
+ --
+ -- ${0:Description}
+ --
+snippet imp
+ import ${0:Data.Text}
+snippet import
+ import ${0:Data.Text}
+snippet import2
+ import ${1:Data.Text} (${0:head})
+snippet impq
+ import qualified ${1:Data.Text} as ${0:T}
+snippet importq
+ import qualified ${1:Data.Text} as ${0:T}
+snippet inst
+ instance ${1:Monoid} ${2:Type} where
+ ${0}
+snippet type
+ type ${1:Type} = ${0:Type}
+snippet data
+ data ${1:Type} = ${2:$1} ${0:Int}
+snippet newtype
+ newtype ${1:Type} = ${2:$1} ${0:Int}
+snippet class
+ class ${1:Class} a where
+ ${0}
+snippet module
+ module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')` (
+ ) where
+ `expand('%') =~ 'Main' ? "\nmain :: IO ()\nmain = undefined" : ""`
+
+snippet main
+ main :: IO ()
+ main = ${0:undefined}
+snippet const
+ ${1:name} :: ${2:a}
+ $1 = ${0:undefined}
+snippet fn
+ ${1:fn} :: ${2:a} -> ${3:a}
+ $1 ${4} = ${0:undefined}
+snippet fn2
+ ${1:fn} :: ${2:a} -> ${3:a} -> ${4:a}
+ $1 ${5} = ${0:undefined}
+snippet fn3
+ ${1:fn} :: ${2:a} -> ${3:a} -> ${4:a} -> ${5:a}
+ $1 ${6} = ${0:undefined}
+snippet => "Type constraint"
+ (${1:Class} ${2:a}) => $2
+snippet ap
+ ${1:map} ${2:fn} ${0:list}
+snippet \
+ \\${1:x} -> ${0:expression}
+snippet (\
+ (\\${1:x} -> ${0:expression})
+snippet <-
+ ${1:a} <- ${0:m a}
+snippet ->
+ ${1:m a} -> ${0:a}
+snippet tup
+ (${1:a}, ${0:b})
+snippet tup2
+ (${1:a}, ${2:b}, ${0:c})
+snippet tup3
+ (${1:a}, ${2:b}, ${3:c}, ${0:d})
+snippet rec
+ ${1:Record} { ${2:recFieldA} = ${3:undefined}
+ , ${4:recFieldB} = ${0:undefined}
+ }
+snippet case
+ case ${1:something} of
+ ${2} -> ${0}
+snippet let
+ let ${1} = ${2}
+ in ${3}
+snippet where
+ where
+ ${1:fn} = ${0:undefined}
+snippet spec
+ module `substitute(substitute(expand('%:r'), '[/\\]','.','g'),'^\%(\l*\.\)\?','','')` (main, spec) where
+
+ import Test.Hspec
+ import Test.QuickCheck
+
+ main :: IO ()
+ main = hspec spec
+
+ spec :: Spec
+ spec =
+ describe "${1}" $ do
+ $0
+snippet desc
+ describe "${1}" $ do
+ $0
+snippet it
+ it "${1}" $
+ $0
+snippet itp
+ it "${1}" $ property $
+ $0
diff --git a/vim/bundle/vim-snippets/snippets/html.snippets b/vim/bundle/vim-snippets/snippets/html.snippets
new file mode 100644
index 0000000..f41f983
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/html.snippets
@@ -0,0 +1,879 @@
+# Some useful Unicode entities
+# Non-Breaking Space
+snippet nbs
+ &nbsp;
+# ←
+snippet left
+ &#x2190;
+# →
+snippet right
+ &#x2192;
+# ↑
+snippet up
+ &#x2191;
+# ↓
+snippet down
+ &#x2193;
+# ↩
+snippet return
+ &#x21A9;
+# ⇤
+snippet backtab
+ &#x21E4;
+# ⇥
+snippet tab
+ &#x21E5;
+# ⇧
+snippet shift
+ &#x21E7;
+# ⌃
+snippet ctrl
+ &#x2303;
+# ⌅
+snippet enter
+ &#x2305;
+# ⌘
+snippet cmd
+ &#x2318;
+# ⌥
+snippet option
+ &#x2325;
+# ⌦
+snippet delete
+ &#x2326;
+# ⌫
+snippet backspace
+ &#x232B;
+# ⎋
+snippet esc
+ &#x238B;
+# comment
+snippet //
+ <!-- ${1} -->${0}
+# Generic Doctype
+snippet doctype HTML 4.01 Strict
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+snippet doctype HTML 4.01 Transitional
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+snippet doctype HTML 5
+ <!DOCTYPE HTML>
+snippet doctype XHTML 1.0 Frameset
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+snippet doctype XHTML 1.0 Strict
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+snippet doctype XHTML 1.0 Transitional
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+snippet doctype XHTML 1.1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+# HTML Doctype 4.01 Strict
+snippet docts
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+# HTML Doctype 4.01 Transitional
+snippet doct
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+# HTML Doctype 5
+snippet doct5
+ <!DOCTYPE HTML>
+# XHTML Doctype 1.0 Frameset
+snippet docxf
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+# XHTML Doctype 1.0 Strict
+snippet docxs
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+# XHTML Doctype 1.0 Transitional
+snippet docxt
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+# XHTML Doctype 1.1
+snippet docx
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+# Attributes
+snippet attr
+ ${1:attribute}="${0:property}"
+snippet attr+
+ ${1:attribute}="${2:property}" attr+
+snippet .
+ class="${1}"
+snippet #
+ id="${1}"
+snippet alt
+ alt="${1}"
+snippet charset
+ charset="${1:utf-8}"
+snippet data
+ data-${1}="${2:$1}"
+snippet for
+ for="${1}"
+snippet height
+ height="${1}"
+snippet href
+ href="${1:#}"
+snippet lang
+ lang="${1:en}"
+snippet media
+ media="${1}"
+snippet name
+ name="${1}"
+snippet rel
+ rel="${1}"
+snippet scope
+ scope="${1:row}"
+snippet src
+ src="${1}"
+snippet title=
+ title="${1}"
+snippet type
+ type="${1}"
+snippet value
+ value="${1}"
+snippet width
+ width="${1}"
+# Elements
+snippet a
+ <a href="${1:#}">${0:$1}</a>
+snippet a.
+ <a class="${1}" href="${2:#}">${0:$1}</a>
+snippet a#
+ <a id="${1}" href="${2:#}">${0:$1}</a>
+snippet a:ext
+ <a href="http://${1:example.com}">${0:$1}</a>
+snippet a:mail
+ <a href="mailto:${1:joe@example.com}?subject=${2:feedback}">${0:email me}</a>
+snippet ac
+ <a href="`@+`">${0:`@+`}</a>
+snippet abbr
+ <abbr title="${1}">${0}</abbr>
+snippet address
+ <address>
+ ${0}
+ </address>
+snippet area
+ <area shape="${1:rect}" coords="${2}" href="${3}" alt="${0}">
+snippet area+
+ <area shape="${1:rect}" coords="${2}" href="${3}" alt="${4}">
+ area+
+snippet area:c
+ <area shape="circle" coords="${1}" href="${2}" alt="${0}">
+snippet area:d
+ <area shape="default" coords="${1}" href="${2}" alt="${0}">
+snippet area:p
+ <area shape="poly" coords="${1}" href="${2}" alt="${0}">
+snippet area:r
+ <area shape="rect" coords="${1}" href="${2}" alt="${0}">
+snippet article
+ <article>
+ ${0}
+ </article>
+snippet article.
+ <article class="${1}">
+ ${0}
+ </article>
+snippet article#
+ <article id="${1}">
+ ${0}
+ </article>
+snippet aside
+ <aside>
+ ${0}
+ </aside>
+snippet aside.
+ <aside class="${1}">
+ ${0}
+ </aside>
+snippet aside#
+ <aside id="${1}">
+ ${0}
+ </aside>
+snippet audio
+ <audio src="${1}>${0}</audio>
+snippet b
+ <b>${0}</b>
+snippet base
+ <base href="${1}" target="${0}">
+snippet bdi
+ <bdi>${0}</bdo>
+snippet bdo
+ <bdo dir="${1}">${0}</bdo>
+snippet bdo:l
+ <bdo dir="ltr">${0}</bdo>
+snippet bdo:r
+ <bdo dir="rtl">${0}</bdo>
+snippet blockquote
+ <blockquote>
+ ${0}
+ </blockquote>
+snippet body
+ <body>
+ ${0}
+ </body>
+snippet br
+ <br>
+snippet button
+ <button type="${1:submit}">${0}</button>
+snippet button.
+ <button class="${1:button}" type="${2:submit}">${0}</button>
+snippet button#
+ <button id="${1}" type="${2:submit}">${0}</button>
+snippet button:s
+ <button type="submit">${0}</button>
+snippet button:r
+ <button type="reset">${0}</button>
+snippet canvas
+ <canvas>
+ ${0}
+ </canvas>
+snippet caption
+ <caption>${0}</caption>
+snippet cite
+ <cite>${0}</cite>
+snippet code
+ <code>${0}</code>
+snippet col
+ <col>
+snippet col+
+ <col>
+ col+
+snippet colgroup
+ <colgroup>
+ ${0}
+ </colgroup>
+snippet colgroup+
+ <colgroup>
+ <col />
+ col+${0}
+ </colgroup>
+snippet command
+ <command type="command" label="${1}" icon="${0}">
+snippet command:c
+ <command type="checkbox" label="${1}" icon="${0}">
+snippet command:r
+ <command type="radio" radiogroup="${1}" label="${2}" icon="${0}">
+snippet datagrid
+ <datagrid>
+ ${0}
+ </datagrid>
+snippet datalist
+ <datalist>
+ ${0}
+ </datalist>
+snippet datatemplate
+ <datatemplate>
+ ${0}
+ </datatemplate>
+snippet dd
+ <dd>${0}</dd>
+snippet dd.
+ <dd class="${1}">${0}</dd>
+snippet dd#
+ <dd id="${1}">${0}</dd>
+snippet del
+ <del>${0}</del>
+snippet details
+ <details>${0}</details>
+snippet dfn
+ <dfn>${0}</dfn>
+snippet dialog
+ <dialog>
+ ${0}
+ </dialog>
+snippet div
+ <div>
+ ${0}
+ </div>
+snippet div.
+ <div class="${1}">
+ ${0}
+ </div>
+snippet div#
+ <div id="${1}">
+ ${0}
+ </div>
+snippet dl
+ <dl>
+ ${0}
+ </dl>
+snippet dl.
+ <dl class="${1}">
+ ${0}
+ </dl>
+snippet dl#
+ <dl id="${1}">
+ ${0}
+ </dl>
+snippet dl+
+ <dl>
+ <dt>${1}</dt>
+ <dd>${2}</dd>
+ dt+${0}
+ </dl>
+snippet dt
+ <dt>${0}</dt>
+snippet dt.
+ <dt class="${1}">${0}</dt>
+snippet dt#
+ <dt id="${1}">${0}</dt>
+snippet dt+
+ <dt>${1}</dt>
+ <dd>${2}</dd>
+ dt+${0}
+snippet em
+ <em>${0}</em>
+snippet embed
+ <embed src="${1}" type="${0}">
+snippet fieldset
+ <fieldset>
+ ${0}
+ </fieldset>
+snippet fieldset.
+ <fieldset class="${1}">
+ ${0}
+ </fieldset>
+snippet fieldset#
+ <fieldset id="${1}">
+ ${0}
+ </fieldset>
+snippet fieldset+
+ <fieldset>
+ <legend><span>${1}</span></legend>
+ ${2}
+ </fieldset>
+ fieldset+${0}
+snippet figcaption
+ <figcaption>${0}</figcaption>
+snippet figure
+ <figure>${0}</figure>
+snippet figure#
+ <figure id="${1}">
+ ${0}
+ </figure>
+snippet figure.
+ <figure class="${1}">
+ ${0}
+ </figure>
+snippet footer
+ <footer>
+ ${0}
+ </footer>
+snippet footer.
+ <footer class="${1}">
+ ${0}
+ </footer>
+snippet footer#
+ <footer id="${1}">
+ ${0}
+ </footer>
+snippet form
+ <form action="${1}" method="${2:post}">
+ ${0}
+ </form>
+snippet form.
+ <form class="${1}" action="${2}" method="${3:post}">
+ ${0}
+ </form>
+snippet form#
+ <form id="${1}" action="${2}" method="${3:post}">
+ ${0}
+ </form>
+snippet h1
+ <h1>${0}</h1>
+snippet h1.
+ <h1 class="${1}">${0}</h1>
+snippet h1#
+ <h1 id="${1}">${0}</h1>
+snippet h2
+ <h2>${0}</h2>
+snippet h2.
+ <h2 class="${1}">${0}</h2>
+snippet h2#
+ <h2 id="${1}">${0}</h2>
+snippet h3
+ <h3>${0}</h3>
+snippet h3.
+ <h3 class="${1}">${0}</h3>
+snippet h3#
+ <h3 id="${1}">${0}</h3>
+snippet h4
+ <h4>${0}</h4>
+snippet h4.
+ <h4 class="${1}">${0}</h4>
+snippet h4#
+ <h4 id="${1}">${0}</h4>
+snippet h5
+ <h5>${0}</h5>
+snippet h5.
+ <h5 class="${1}">${0}</h5>
+snippet h5#
+ <h5 id="${1}">${0}</h5>
+snippet h6
+ <h6>${0}</h6>
+snippet h6.
+ <h6 class="${1}">${0}</h6>
+snippet h6#
+ <h6 id="${1}">${0}</h6>
+snippet head
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+
+ <title>${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
+ ${0}
+ </head>
+snippet header
+ <header>
+ ${0}
+ </header>
+snippet header.
+ <header class="${1}">
+ ${0}
+ </header>
+snippet header#
+ <header id="${1}">
+ ${0}
+ </header>
+snippet hgroup
+ <hgroup>
+ ${0}
+ </hgroup>
+snippet hgroup.
+ <hgroup class="${1}>
+ ${0}
+ </hgroup>
+snippet hr
+ <hr>
+snippet html
+ <html>
+ ${0}
+ </html>
+snippet xhtml
+ <html xmlns="http://www.w3.org/1999/xhtml">
+ ${0}
+ </html>
+snippet html5
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width">
+ <title>${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
+ ${2:link}
+ </head>
+ <body>
+ ${0:body}
+ </body>
+ </html>
+snippet html5l
+ <!DOCTYPE html>
+ <html lang="${1:es}">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width">
+ <title>${2:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
+ ${3:link}
+ </head>
+ <body>
+ ${0:body}
+ </body>
+ </html>
+snippet i
+ <i>${0}</i>
+snippet iframe
+ <iframe src="${1}" frameborder="0"></iframe>
+snippet iframe.
+ <iframe class="${1}" src="${2}" frameborder="0"></iframe>
+snippet iframe#
+ <iframe id="${1}" src="${2}" frameborder="0"></iframe>
+snippet img
+ <img src="${1}" alt="${2}">
+snippet img.
+ <img class="${1}" src="${2}" alt="${3}">
+snippet img#
+ <img id="${1}" src="${2}" alt="${3}">
+snippet input
+ <input type="${1:text/submit/hidden/button/image}" name="${2}" id="${3:$2}" value="${4}">
+snippet input.
+ <input class="${1}" type="${2:text/submit/hidden/button/image}" name="${3}" id="${4:$3}" value="${5}">
+snippet input:text
+ <input type="text" name="${1}" id="${2:$1}" value="${3}">
+snippet input:submit
+ <input type="submit" name="${1}" id="${2:$1}" value="${3}">
+snippet input:hidden
+ <input type="hidden" name="${1}" id="${2:$1}" value="${3}">
+snippet input:button
+ <input type="button" name="${1}" id="${2:$1}" value="${3}">
+snippet input:image
+ <input type="image" name="${1}" id="${2:$1}" src="${3}" alt="${4}">
+snippet input:checkbox
+ <input type="checkbox" name="${1}" id="${2:$1}">
+snippet input:radio
+ <input type="radio" name="${1}" id="${2:$1}">
+snippet input:color
+ <input type="color" name="${1}" id="${2:$1}" value="${3}">
+snippet input:date
+ <input type="date" name="${1}" id="${2:$1}" value="${3}">
+snippet input:datetime
+ <input type="datetime" name="${1}" id="${2:$1}" value="${3}">
+snippet input:datetime-local
+ <input type="datetime-local" name="${1}" id="${2:$1}" value="${3}">
+snippet input:email
+ <input type="email" name="${1}" id="${2:$1}" value="${3}">
+snippet input:file
+ <input type="file" name="${1}" id="${2:$1}" value="${3}">
+snippet input:month
+ <input type="month" name="${1}" id="${2:$1}" value="${3}">
+snippet input:number
+ <input type="number" name="${1}" id="${2:$1}" value="${3}">
+snippet input:password
+ <input type="password" name="${1}" id="${2:$1}" value="${3}">
+snippet input:range
+ <input type="range" name="${1}" id="${2:$1}" value="${3}">
+snippet input:reset
+ <input type="reset" name="${1}" id="${2:$1}" value="${3}">
+snippet input:search
+ <input type="search" name="${1}" id="${2:$1}" value="${3}">
+snippet input:time
+ <input type="time" name="${1}" id="${2:$1}" value="${3}">
+snippet input:url
+ <input type="url" name="${1}" id="${2:$1}" value="${3}">
+snippet input:week
+ <input type="week" name="${1}" id="${2:$1}" value="${3}">
+snippet ins
+ <ins>${0}</ins>
+snippet kbd
+ <kbd>${0}</kbd>
+snippet keygen
+ <keygen>${0}</keygen>
+snippet label
+ <label for="${0:$1}">${1}</label>
+snippet label:i
+ <label for="${2:$1}">${1}</label>
+ <input type="${3:text/submit/hidden/button}" name="${4:$2}" id="${5:$2}" value="${6}" />
+snippet label:s
+ <label for="${2:$1}">${1}</label>
+ <select name="${3:$2}" id="${4:$2}">
+ <option value="${5}">${0:$5}</option>
+ </select>
+snippet legend
+ <legend>${0}</legend>
+snippet legend+
+ <legend><span>${0}</span></legend>
+snippet li
+ <li>${0}</li>
+snippet li.
+ <li class="${1}">${0}</li>
+snippet li+
+ <li>${1}</li>
+ li+
+snippet lia
+ <li><a href="${0:#}">${1}</a></li>
+snippet lia+
+ <li><a href="${2:#}">${1}</a></li>
+ lia+
+snippet link
+ <link rel="${1}" href="${2}" title="${3}" type="${4}">
+snippet link:atom
+ <link rel="alternate" href="${1:atom.xml}" title="Atom" type="application/atom+xml">
+snippet link:s
+ <link rel="stylesheet" href="${1:style.css}">
+snippet link:css
+ <link rel="stylesheet" href="${1:style.css}" type="text/css" media="${2:all}">
+snippet link:favicon
+ <link rel="shortcut icon" href="${1:favicon.ico}" type="image/x-icon">
+snippet link:rss
+ <link rel="alternate" href="${1:rss.xml}" title="RSS" type="application/atom+xml">
+snippet link:touch
+ <link rel="apple-touch-icon" href="${1:favicon.png}">
+snippet main
+ <main role="main">
+ ${0}
+ </main>
+snippet map
+ <map name="${1}">
+ ${0}
+ </map>
+snippet map.
+ <map class="${1}" name="${2}">
+ ${0}
+ </map>
+snippet map#
+ <map name="${1}" id="${2:$1}>
+ ${0}
+ </map>
+snippet map+
+ <map name="${1}">
+ <area shape="${2}" coords="${3}" href="${4}" alt="${5}">${6}
+ </map>
+snippet mark
+ <mark>${0}</mark>
+snippet menu
+ <menu>
+ ${0}
+ </menu>
+snippet menu:c
+ <menu type="context">
+ ${0}
+ </menu>
+snippet menu:t
+ <menu type="toolbar">
+ ${0}
+ </menu>
+snippet meta
+ <meta http-equiv="${1}" content="${2}">
+snippet meta:s
+ <meta ${0}>
+snippet meta:d
+ <meta name="description" content="${0}">
+snippet meta:compat
+ <meta http-equiv="X-UA-Compatible" content="IE=${1:7,8,edge}">
+snippet meta:refresh
+ <meta http-equiv="refresh" content="text/html;charset=UTF-8">
+snippet meta:utf
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8">
+snippet meter
+ <meter>${0}</meter>
+snippet nav
+ <nav>
+ ${0}
+ </nav>
+snippet nav.
+ <nav class="${1}">
+ ${0}
+ </nav>
+snippet nav#
+ <nav id="${1}">
+ ${0}
+ </nav>
+snippet noscript
+ <noscript>
+ ${0}
+ </noscript>
+snippet object
+ <object data="${1}" type="${2}">
+ ${3}
+ </object>
+# Embed QT Movie
+snippet movie
+ <object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
+ codebase="http://www.apple.com/qtactivex/qtplugin.cab">
+ <param name="src" value="$1" />
+ <param name="controller" value="$4">
+ <param name="autoplay" value="$5">
+ <embed src="${1:movie.mov}"
+ width="${2:320}" height="${3:240}"
+ controller="${4:true}" autoplay="${5:true}"
+ scale="tofit" cache="true"
+ pluginspage="http://www.apple.com/quicktime/download/">
+ </object>
+snippet ol
+ <ol>
+ ${0}
+ </ol>
+snippet ol.
+ <ol class="${1}">
+ ${0}
+ </ol>
+snippet ol#
+ <ol id="${1}">
+ ${0}
+ </ol>
+snippet ol+
+ <ol>
+ <li>${1}</li>
+ li+${0}
+ </ol>
+snippet opt
+ <option value="${1}">${0:$1}</option>
+snippet opt+
+ <option value="${1}">${2:$1}</option>
+ opt+${0}
+snippet optt
+ <option>${0}</option>
+snippet optgroup
+ <optgroup>
+ <option value="${1}">${2:$1}</option>
+ opt+${0}
+ </optgroup>
+snippet output
+ <output>${0}</output>
+snippet p
+ <p>${0}</p>
+snippet p.
+ <p class="${1}">${0}</p>
+snippet p#
+ <p id="${1}">${0}</p>
+snippet param
+ <param name="${1}" value="${2}">
+snippet pre
+ <pre>
+ ${0}
+ </pre>
+snippet progress
+ <progress>${0}</progress>
+snippet q
+ <q>${0}</q>
+snippet rp
+ <rp>${0}</rp>
+snippet rt
+ <rt>${0}</rt>
+snippet ruby
+ <ruby>
+ <rp><rt>${0}</rt></rp>
+ </ruby>
+snippet s
+ <s>${0}</s>
+snippet samp
+ <samp>
+ ${0}
+ </samp>
+snippet script
+ <script type="text/javascript" charset="utf-8">
+ ${0}
+ </script>
+snippet scripts
+ <script src="${0}.js"></script>
+snippet scriptt
+ <script type="${1}" id="${2}">
+ ${0}
+ </script>
+snippet scriptsrc
+ <script src="${0}.js" type="text/javascript" charset="utf-8"></script>
+snippet section
+ <section>
+ ${0}
+ </section>
+snippet section.
+ <section class="${1}">
+ ${0}
+ </section>
+snippet section#
+ <section id="${1}">
+ ${0}
+ </section>
+snippet select
+ <select name="${1}" id="${2:$1}">
+ ${0}
+ </select>
+snippet select.
+ <select name="${1}" id="${2:$1}" class="${3}>
+ ${0}
+ </select>
+snippet select+
+ <select name="${1}" id="${2:$1}">
+ <option value="${3}">${4:$3}</option>
+ opt+${0}
+ </select>
+snippet small
+ <small>${0}</small>
+snippet source
+ <source src="${1}" type="${2}" media="${0}">
+snippet span
+ <span>${0}</span>
+snippet span.
+ <span class="${1}">${0}</span>
+snippet span#
+ <span id="${1}">${0}</span>
+snippet strong
+ <strong>${0}</strong>
+snippet style
+ <style type="text/css" media="${1:all}">
+ ${0}
+ </style>
+snippet sub
+ <sub>${0}</sub>
+snippet summary
+ <summary>
+ ${0}
+ </summary>
+snippet sup
+ <sup>${0}</sup>
+snippet table
+ <table>
+ ${0}
+ </table>
+snippet table.
+ <table class="${1}">
+ ${0}
+ </table>
+snippet table#
+ <table id="${1}">
+ ${0}
+ </table>
+snippet tbody
+ <tbody>
+ ${0}
+ </tbody>
+snippet td
+ <td>${0}</td>
+snippet td.
+ <td class="${1}">${0}</td>
+snippet td#
+ <td id="${1}">${0}</td>
+snippet td+
+ <td>${1}</td>
+ td+${0}
+snippet textarea
+ <textarea name="${1}" id="${2:$1}" rows="${3:8}" cols="${4:40}">${5}</textarea>
+snippet tfoot
+ <tfoot>
+ ${0}
+ </tfoot>
+snippet th
+ <th>${0}</th>
+snippet th.
+ <th class="${1}">${0}</th>
+snippet th#
+ <th id="${1}">${0}</th>
+snippet th+
+ <th>${1}</th>
+ th+${0}
+snippet thead
+ <thead>
+ ${0}
+ </thead>
+snippet time
+ <time datetime="${1}" pubdate="${2:$1}">${0:$1}</time>
+snippet title
+ <title>${0:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
+snippet tr
+ <tr>
+ ${0}
+ </tr>
+snippet tr+
+ <tr>
+ <td>${1}</td>
+ td+${0}
+ </tr>
+snippet track
+ <track src="${1}" srclang="${2}" label="${3}" default="${4:default}>${5}</track>
+snippet ul
+ <ul>
+ ${0}
+ </ul>
+snippet ul.
+ <ul class="${1}">
+ ${0}
+ </ul>
+snippet ul#
+ <ul id="${1}">
+ ${0}
+ </ul>
+snippet ul+
+ <ul>
+ <li>${1}</li>
+ li+${0}
+ </ul>
+snippet var
+ <var>${0}</var>
+snippet video
+ <video src="${1} height="${2}" width="${3}" preload="${5:none}" autoplay="${6:autoplay}>${7}</video>
+snippet wbr
+ <wbr>
diff --git a/vim/bundle/vim-snippets/snippets/htmldjango.snippets b/vim/bundle/vim-snippets/snippets/htmldjango.snippets
new file mode 100644
index 0000000..7d14ca8
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/htmldjango.snippets
@@ -0,0 +1,142 @@
+# Generic tags
+
+extends html
+
+snippet %
+ {% ${1} %}
+snippet %%
+ {% ${1:tag_name} %}
+ ${0}
+ {% end$1 %}
+snippet {
+ {{ ${1} }}
+# Template Tags
+
+snippet autoescape
+ {% autoescape ${1:off} %}
+ ${0}
+ {% endautoescape %}
+snippet block
+ {% block ${1} %}
+ ${0}
+ {% endblock %}
+snippet #
+ {# ${0:comment} #}
+snippet comment
+ {% comment %}
+ ${0}
+ {% endcomment %}
+snippet cycle
+ {% cycle ${1:val1} ${2:val2} ${3:as ${4}} %}
+snippet debug
+ {% debug %}
+snippet extends
+ {% extends "${0:base.html}" %}
+snippet filter
+ {% filter ${1} %}
+ ${0}
+ {% endfilter %}
+snippet firstof
+ {% firstof ${1} %}
+snippet for
+ {% for ${1} in ${2} %}
+ ${0}
+ {% endfor %}
+snippet empty
+ {% empty %}
+ ${0}
+snippet if
+ {% if ${1} %}
+ ${0}
+ {% endif %}
+snippet el
+ {% else %}
+ ${1}
+snippet eif
+ {% elif ${1} %}
+ ${0}
+snippet ifchanged
+ {% ifchanged %}${1}{% endifchanged %}
+snippet ifequal
+ {% ifequal ${1} ${2} %}
+ ${0}
+ {% endifequal %}
+snippet ifnotequal
+ {% ifnotequal ${1} ${2} %}
+ ${0}
+ {% endifnotequal %}
+snippet include
+ {% include "${0}" %}
+snippet load
+ {% load ${0} %}
+snippet now
+ {% now "${0:jS F Y H:i}" %}
+snippet regroup
+ {% regroup ${1} by ${2} as ${0} %}
+snippet spaceless
+ {% spaceless %}${0}{% endspaceless %}
+snippet ssi
+ {% ssi ${0} %}
+snippet trans
+ {% trans "${0:string}" %}
+snippet url
+ {% url ${1} as ${0} %}
+snippet widthratio
+ {% widthratio ${1:this_value} ${2:max_value} ${0:100} %}
+snippet with
+ {% with ${1} as ${2} %}
+ ${0}
+ {% endwith %}
+
+# Template Filters
+
+# Note: Since SnipMate can't determine which template filter you are
+# expanding without the "|" character, these do not add the "|"
+# character. These save a few keystrokes still.
+
+# Note: Template tags that take no arguments are not implemented.
+
+snippet add
+ add:"${0}"
+snippet center
+ center:"${0}"
+snippet cut
+ cut:"${0}"
+snippet date
+ date:"${0}"
+snippet default
+ default:"${0}"
+snippet defaultifnone
+ default_if_none:"${0}"
+snippet dictsort
+ dictsort:"${0}"
+snippet dictsortrev
+ dictsortreversed:"${0}"
+snippet divisibleby
+ divisibleby:"${0}"
+snippet floatformat
+ floatformat:"${0}"
+snippet getdigit
+ get_digit:"${0}"
+snippet join
+ join:"${0}"
+snippet lengthis
+ length_is:"${0}"
+snippet pluralize
+ pluralize:"${0}"
+snippet removetags
+ removetags:"${0}"
+snippet slice
+ slice:"${0}"
+snippet stringformat
+ stringformat:"${0}"
+snippet time
+ time:"${0}"
+snippet truncatewords
+ truncatewords:${0}
+snippet truncatewordshtml
+ truncatewords_html:${0}
+snippet urlizetrunc
+ urlizetrunc:${0}
+snippet wordwrap
+ wordwrap:${0}
diff --git a/vim/bundle/vim-snippets/snippets/htmltornado.snippets b/vim/bundle/vim-snippets/snippets/htmltornado.snippets
new file mode 100644
index 0000000..46f5dab
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/htmltornado.snippets
@@ -0,0 +1,55 @@
+# Generic tags
+
+snippet {
+ {{ ${0} }}
+
+# Template tags
+
+snippet extends
+ {% extends "${0:base.html}" %}
+snippet autoescape
+ {% autoescape ${0:xhtml_escape | None} %}
+snippet apply
+ {% apply ${1:function} %}
+ ${0}
+ {% end %}
+snippet block
+ {% block ${1} %}
+ ${0}
+ {% end %}
+snippet for
+ {% for ${1:item} in ${2} %}
+ ${0}
+ {% end %}
+snippet from
+ {% from ${1:x} import ${0:y} %}
+snippet if
+ {% if ${1:condition} %}
+ ${0}
+ {% end %}
+snippet eif
+ {% elif ${0:condition} %}
+snippet el
+ {% else %}
+snippet import
+ {% import ${0:module} %}
+snippet include
+ {% include "${0:filename}" %}
+snippet module
+ {% module ${0:expression} %}
+snippet raw
+ {% raw ${0:expression} %}
+snippet set
+ {% set ${1:x} = ${0:y} %}
+snippet try
+ {% try %}
+ ${1}
+ {% except %}
+ ${2}
+ {% finallly %}
+ ${0}
+ {% end %}
+snippet wh
+ {% while ${1:condition} %}
+ ${0}
+ {% end %}
diff --git a/vim/bundle/vim-snippets/snippets/jade.snippets b/vim/bundle/vim-snippets/snippets/jade.snippets
new file mode 100644
index 0000000..55f0af7
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/jade.snippets
@@ -0,0 +1,18 @@
+# Angular HTML
+snippet rep
+ div(ng-repeat='${1} in ${2}')
+
+snippet repf
+ div(ng-repeat='${1} in ${2}' | ${3})
+
+snippet repi
+ div(ng-repeat='${1} in ${2}' track by $index)
+
+snippet hide
+ div(ng-hide='${1}')
+
+snippet show
+ div(ng-show='${1}')
+
+snippet if
+ div(ng-if='${1}')
diff --git a/vim/bundle/vim-snippets/snippets/java.snippets b/vim/bundle/vim-snippets/snippets/java.snippets
new file mode 100644
index 0000000..e40bbf5
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/java.snippets
@@ -0,0 +1,287 @@
+## Access Modifiers
+snippet po
+ protected ${0}
+snippet pu
+ public ${0}
+snippet pr
+ private ${0}
+##
+## Annotations
+snippet before
+ @Before
+ static void ${1:intercept}(${2:args}) { ${0} }
+snippet mm
+ @ManyToMany
+ ${0}
+snippet mo
+ @ManyToOne
+ ${0}
+snippet om
+ @OneToMany${1:(cascade=CascadeType.ALL)}
+ ${0}
+snippet oo
+ @OneToOne
+ ${1}
+##
+## Basic Java packages and import
+snippet im
+ import ${0}
+snippet j.b
+ java.beans.
+snippet j.i
+ java.io.
+snippet j.m
+ java.math.
+snippet j.n
+ java.net.
+snippet j.u
+ java.util.
+##
+## Class
+snippet cl
+ class ${1:`vim_snippets#Filename("$1", "untitled")`} ${0}
+snippet pcl
+ public class ${1:`vim_snippets#Filename("$1", "untitled")`} ${0}
+snippet in
+ interface ${1:`vim_snippets#Filename("$1", "untitled")`} ${2:extends Parent}
+snippet tc
+ public class ${1:`vim_snippets#Filename("$1")`} extends ${0:TestCase}
+##
+## Class Enhancements
+snippet ext
+ extends ${0}
+snippet imp
+ implements ${0}
+##
+## Comments
+snippet /*
+ /*
+ * ${0}
+ */
+##
+## Constants
+snippet co
+ static public final ${1:String} ${2:var} = ${3};
+snippet cos
+ static public final String ${1:var} = "${2}";
+##
+## Control Statements
+snippet case
+ case ${1}:
+ ${0}
+snippet def
+ default:
+ ${0}
+snippet el
+ else
+snippet eif
+ else if (${1}) ${0}
+snippet if
+ if (${1}) ${0}
+snippet sw
+ switch (${1}) {
+ ${0}
+ }
+##
+## Create a Method
+snippet m
+ ${1:void} ${2:method}(${3}) ${4:throws }
+##
+## Create a Variable
+snippet v
+ ${1:String} ${2:var}${3: = null}${4};
+##
+## Declaration for ArrayList
+snippet d.al
+ List<${1:Object}> ${2:list} = new ArrayList<$1>();${0}
+## Declaration for HashMap
+snippet d.hm
+ Map<${1:Object}, ${2:Object}> ${3:map} = new HashMap<$1, $2>();${0}
+## Declaration for HashSet
+snippet d.hs
+ Set<${1:Object}> ${2:set} = new HashSet<$1>();${0}
+## Declaration for Stack
+snippet d.st
+ Stack<${1:Object}> ${2:stack} = new Stack<$1>();${0}
+##
+## Singleton Pattern
+snippet singlet
+ private static class Holder {
+ private static final ${1:`vim_snippets#Filename("$1")`} INSTANCE = new $1();
+ }
+
+ private $1() { }
+
+ public static $1 getInstance() {
+ return Holder.INSTANCE;
+ }
+##
+## Enhancements to Methods, variables, classes, etc.
+snippet ab
+ abstract ${0}
+snippet fi
+ final ${0}
+snippet st
+ static ${0}
+snippet sy
+ synchronized ${0}
+##
+## Error Methods
+snippet err
+ System.err.print("${0:Message}");
+snippet errf
+ System.err.printf("${1:Message}", ${0:exception});
+snippet errln
+ System.err.println("${0:Message}");
+##
+## Exception Handling
+snippet as
+ assert ${1:test} : "${2:Failure message}";
+snippet ae
+ assertEquals("${1:Failure message}", ${2:expected}, ${3:actual});
+snippet aae
+ assertArrayEquals("${1:Failure message}", ${2:expecteds}, ${3:actuals});
+snippet af
+ assertFalse("${1:Failure message}", ${2:condition});
+snippet at
+ assertTrue("${1:Failure message}", ${2:condition});
+snippet an
+ assertNull("${1:Failure message}", ${2:object});
+snippet ann
+ assertNotNull("${1:Failure message}", ${2:object});
+snippet ass
+ assertSame("${1:Failure message}", ${2:expected}, ${3:actual});
+snippet asns
+ assertNotSame("${1:Failure message}", ${2:expected}, ${3:actual});
+snippet fa
+ fail("${1:Failure message}");
+snippet ca
+ catch(${1:Exception} ${2:e}) ${0}
+snippet thr
+ throw ${0}
+snippet ths
+ throws ${0}
+snippet try
+ try {
+ ${0}
+ } catch(${1:Exception} ${2:e}) {
+ }
+snippet tryf
+ try {
+ ${0}
+ } catch(${1:Exception} ${2:e}) {
+ } finally {
+ }
+##
+## Find Methods
+snippet findall
+ List<${1:listName}> ${2:items} = ${1}.findAll();
+snippet findbyid
+ ${1:var} ${2:item} = ${1}.findById(${3});
+##
+## Javadocs
+snippet /**
+ /**
+ * ${0}
+ */
+snippet @au
+ @author `system("grep \`id -un\` /etc/passwd | cut -d \":\" -f5 | cut -d \",\" -f1")`
+snippet @br
+ @brief ${0:Description}
+snippet @fi
+ @file ${0:`vim_snippets#Filename("$1")`}.java
+snippet @pa
+ @param ${0:param}
+snippet @re
+ @return ${0:param}
+##
+## Logger Methods
+snippet debug
+ Logger.debug(${1:param});
+snippet error
+ Logger.error(${1:param});
+snippet info
+ Logger.info(${1:param});
+snippet warn
+ Logger.warn(${1:param});
+##
+## Loops
+snippet enfor
+ for (${1} : ${2}) ${0}
+snippet for
+ for (${1}; ${2}; ${3}) ${0}
+snippet wh
+ while (${1}) ${0}
+##
+## Main method
+snippet main
+ public static void main (String[] args) {
+ ${0}
+ }
+##
+## Print Methods
+snippet print
+ System.out.print("${0:Message}");
+snippet printf
+ System.out.printf("${1:Message}", ${0:args});
+snippet println
+ System.out.println(${0});
+snippet printlna
+ System.out.println(Arrays.toString(${0}));
+##
+## Render Methods
+snippet ren
+ render(${1:param});
+snippet rena
+ renderArgs.put("${1}", ${2});
+snippet renb
+ renderBinary(${1:param});
+snippet renj
+ renderJSON(${1:param});
+snippet renx
+ renderXml(${1:param});
+##
+## Setter and Getter Methods
+snippet set
+ ${1:public} void set${3:}(${2:String} ${0:}){
+ this.$4 = $4;
+ }
+snippet get
+ ${1:public} ${2:String} get${3:}(){
+ return this.${0:};
+ }
+##
+## Terminate Methods or Loops
+snippet re
+ return ${0}
+snippet br
+ break;
+##
+## Test Methods
+snippet t
+ public void test${1:Name}() throws Exception {
+ ${0}
+ }
+snippet test
+ @Test
+ public void test${1:Name}() throws Exception {
+ ${0}
+ }
+##
+## Utils
+snippet Sc
+ Scanner
+##
+## Miscellaneous
+snippet action
+ public static void ${1:index}(${2:args}) { ${0} }
+snippet rnf
+ notFound(${1:param});
+snippet rnfin
+ notFoundIfNull(${1:param});
+snippet rr
+ redirect(${1:param});
+snippet ru
+ unauthorized(${1:param});
+snippet unless
+ (unless=${1:param});
diff --git a/vim/bundle/vim-snippets/snippets/javascript-mocha.snippets b/vim/bundle/vim-snippets/snippets/javascript-mocha.snippets
new file mode 100644
index 0000000..f08bf84
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/javascript-mocha.snippets
@@ -0,0 +1,14 @@
+snippet des "Describe" b
+ describe('${1:}', () => {
+ ${0}
+ });
+snippet it "it" b
+ it('${1:}', () => {
+ ${0}
+ });
+snippet exp "expect" b
+ expect(${1:})${0};
+snippet expe "expect" b
+ expect(${1:}).to.equal(${0});
+snippet expd "expect" b
+ expect(${1:}).to.deep.equal(${0});
diff --git a/vim/bundle/vim-snippets/snippets/javascript/javascript-jquery.snippets b/vim/bundle/vim-snippets/snippets/javascript/javascript-jquery.snippets
new file mode 100644
index 0000000..ef6f66c
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/javascript/javascript-jquery.snippets
@@ -0,0 +1,589 @@
+snippet add
+ ${1:obj}.add('${2:selector expression}')
+snippet addClass
+ ${1:obj}.addClass('${2:class name}')
+snippet after
+ ${1:obj}.after('${2:Some text <b>and bold!</b>}')
+snippet ajax
+ $.ajax({
+ url: '${1:mydomain.com/url}',
+ type: '${2:POST}',
+ dataType: '${3:xml/html/script/json}',
+ data: $.param( $('${4:Element or Expression}') ),
+ complete: function (jqXHR, textStatus) {
+ ${5:// callback}
+ },
+ success: function (data, textStatus, jqXHR) {
+ ${6:// success callback}
+ },
+ error: function (jqXHR, textStatus, errorThrown) {
+ ${0:// error callback}
+ }
+ });
+snippet ajaxcomplete
+ ${1:obj}.ajaxComplete(function (${1:e}, xhr, settings) {
+ ${0:// callback}
+ });
+snippet ajaxerror
+ ${1:obj}.ajaxError(function (${1:e}, xhr, settings, thrownError) {
+ ${2:// error callback}
+ });
+ ${0}
+snippet ajaxget
+ $.get('${1:mydomain.com/url}',
+ ${2:{ param1: value1 },}
+ function (data, textStatus, jqXHR) {
+ ${0:// success callback}
+ }
+ );
+snippet ajaxpost
+ $.post('${1:mydomain.com/url}',
+ ${2:{ param1: value1 },}
+ function (data, textStatus, jqXHR) {
+ ${0:// success callback}
+ }
+ );
+snippet ajaxprefilter
+ $.ajaxPrefilter(function (${1:options}, ${2:originalOptions}, jqXHR) {
+ ${0: // Modify options, control originalOptions, store jqXHR, etc}
+ });
+snippet ajaxsend
+ ${1:obj}.ajaxSend(function (${1:request, settings}) {
+ ${2:// error callback}
+ });
+ ${0}
+snippet ajaxsetup
+ $.ajaxSetup({
+ url: "${1:mydomain.com/url}",
+ type: "${2:POST}",
+ dataType: "${3:xml/html/script/json}",
+ data: $.param( $("${4:Element or Expression}") ),
+ complete: function (jqXHR, textStatus) {
+ ${5:// callback}
+ },
+ success: function (data, textStatus, jqXHR) {
+ ${6:// success callback}
+ },
+ error: function (jqXHR, textStatus, errorThrown) {
+ ${0:// error callback}
+ }
+ });
+snippet ajaxstart
+ $.ajaxStart(function () {
+ ${1:// handler for when an AJAX call is started and no other AJAX calls are in progress};
+ });
+ ${0}
+snippet ajaxstop
+ $.ajaxStop(function () {
+ ${1:// handler for when all AJAX calls have been completed};
+ });
+ ${0}
+snippet ajaxsuccess
+ $.ajaxSuccess(function (${1:e}, xhr, settings) {
+ ${2:// handler for when any AJAX call is successfully completed};
+ });
+ ${0}
+snippet andself
+ ${1:obj}.andSelf()
+snippet animate
+ ${1:obj}.animate({${2:param1: value1, param2: value2}}, ${3:speed})
+snippet append
+ ${1:obj}.append('${2:Some text <b>and bold!</b>}')
+snippet appendTo
+ ${1:obj}.appendTo('${2:selector expression}')
+snippet attr
+ ${1:obj}.attr('${2:attribute}', '${3:value}')
+snippet attrm
+ ${1:obj}.attr({'${2:attr1}': '${3:value1}', '${4:attr2}': '${5:value2}'})
+snippet before
+ ${1:obj}.before('${2:Some text <b>and bold!</b>}')
+snippet bind
+ ${1:obj}.bind('${2:event name}', function (${3:e}) {
+ ${0:// event handler}
+ });
+snippet blur
+ ${1:obj}.blur(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet C
+ $.Callbacks()
+snippet Cadd
+ ${1:callbacks}.add(${2:callbacks})
+snippet Cdis
+ ${1:callbacks}.disable()
+snippet Cempty
+ ${1:callbacks}.empty()
+snippet Cfire
+ ${1:callbacks}.fire(${2:args})
+snippet Cfired
+ ${1:callbacks}.fired()
+snippet Cfirew
+ ${1:callbacks}.fireWith(${2:this}, ${3:args})
+snippet Chas
+ ${1:callbacks}.has(${2:callback})
+snippet Clock
+ ${1:callbacks}.lock()
+snippet Clocked
+ ${1:callbacks}.locked()
+snippet Crem
+ ${1:callbacks}.remove(${2:callbacks})
+snippet change
+ ${1:obj}.change(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet children
+ ${1:obj}.children('${2:selector expression}')
+snippet clearq
+ ${1:obj}.clearQueue(${2:'queue name'})
+snippet click
+ ${1:obj}.click(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet clone
+ ${1:obj}.clone()
+snippet contains
+ $.contains(${1:container}, ${0:contents});
+snippet css
+ ${1:obj}.css('${2:attribute}', '${3:value}')
+snippet csshooks
+ $.cssHooks['${1:CSS prop}'] = {
+ get: function (elem, computed, extra) {
+ ${2: // handle getting the CSS property}
+ },
+ set: function (elem, value) {
+ ${0: // handle setting the CSS value}
+ }
+ };
+snippet cssm
+ ${1:obj}.css({${2:attribute1}: '${3:value1}', ${4:attribute2}: '${5:value2}'})
+snippet D
+ $.Deferred()
+snippet Dalways
+ ${1:deferred}.always(${2:callbacks})
+snippet Ddone
+ ${1:deferred}.done(${2:callbacks})
+snippet Dfail
+ ${1:deferred}.fail(${2:callbacks})
+snippet Disrej
+ ${1:deferred}.isRejected()
+snippet Disres
+ ${1:deferred}.isResolved()
+snippet Dnotify
+ ${1:deferred}.notify(${2:args})
+snippet Dnotifyw
+ ${1:deferred}.notifyWith(${2:this}, ${3:args})
+snippet Dpipe
+ ${1:deferred}.then(${2:doneFilter}, ${3:failFilter}, ${4:progressFilter})
+snippet Dprog
+ ${1:deferred}.progress(${2:callbacks})
+snippet Dprom
+ ${1:deferred}.promise(${2:target})
+snippet Drej
+ ${1:deferred}.reject(${2:args})
+snippet Drejw
+ ${1:deferred}.rejectWith(${2:this}, ${3:args})
+snippet Dres
+ ${1:deferred}.resolve(${2:args})
+snippet Dresw
+ ${1:deferred}.resolveWith(${2:this}, ${3:args})
+snippet Dstate
+ ${1:deferred}.state()
+snippet Dthen
+ ${1:deferred}.then(${2:doneCallbacks}, ${3:failCallbacks}, ${4:progressCallbacks})
+snippet Dwhen
+ $.when(${1:deferreds})
+snippet data
+ ${1:obj}.data(${2:obj})
+snippet dataa
+ $.data('${1:selector expression}', '${2:key}'${3:, 'value'})
+snippet dblclick
+ ${1:obj}.dblclick(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet delay
+ ${1:obj}.delay('${2:slow/400/fast}'${3:, 'queue name'})
+snippet dele
+ ${1:obj}.delegate('${2:selector expression}', '${3:event name}', function (${4:e}) {
+ ${0:// event handler}
+ });
+snippet deq
+ ${1:obj}.dequeue(${2:'queue name'})
+snippet deqq
+ $.dequeue('${1:selector expression}'${2:, 'queue name'})
+snippet detach
+ ${1:obj}.detach('${2:selector expression}')
+snippet die
+ ${1:obj}.die(${2:event}, ${3:handler})
+snippet each
+ ${1:obj}.each(function (index) {
+ ${0:this.innerHTML = this + " is the element, " + index + " is the position";}
+ });
+snippet el
+ $('<${1}/>'${2:, {}})
+snippet eltrim
+ $.trim('${1:string}')
+snippet empty
+ ${1:obj}.empty()
+snippet end
+ ${1:obj}.end()
+snippet eq
+ ${1:obj}.eq(${2:element index})
+snippet error
+ ${1:obj}.error(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet eventsmap
+ {
+ :f${0}
+ }
+snippet extend
+ $.extend(${1:true, }${2:target}, ${3:obj})
+snippet fadein
+ ${1:obj}.fadeIn('${2:slow/400/fast}')
+snippet fadeinc
+ ${1:obj}.fadeIn('slow/400/fast', function () {
+ ${0:// callback};
+ });
+snippet fadeout
+ ${1:obj}.fadeOut('${2:slow/400/fast}')
+snippet fadeoutc
+ ${1:obj}.fadeOut('slow/400/fast', function () {
+ ${0:// callback};
+ });
+snippet fadeto
+ ${1:obj}.fadeTo('${2:slow/400/fast}', ${3:0.5})
+snippet fadetoc
+ ${1:obj}.fadeTo('slow/400/fast', ${2:0.5}, function () {
+ ${0:// callback};
+ });
+snippet filter
+ ${1:obj}.filter('${2:selector expression}')
+snippet filtert
+ ${1:obj}.filter(function (${2:index}) {
+ ${3}
+ })
+snippet find
+ ${1:obj}.find('${2:selector expression}')
+snippet focus
+ ${1:obj}.focus(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet focusin
+ ${1:obj}.focusIn(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet focusout
+ ${1:obj}.focusOut(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet get
+ ${1:obj}.get(${2:element index})
+snippet getjson
+ $.getJSON('${1:mydomain.com/url}',
+ ${2:{ param1: value1 },}
+ function (data, textStatus, jqXHR) {
+ ${0:// success callback}
+ }
+ );
+snippet getscript
+ $.getScript('${1:mydomain.com/url}', function (script, textStatus, jqXHR) {
+ ${0:// callback}
+ });
+snippet grep
+ $.grep(${1:array}, function (item, index) {
+ ${2}
+ }${0:, true});
+snippet hasc
+ ${1:obj}.hasClass('${2:className}')
+snippet hasd
+ $.hasData('${0:selector expression}');
+snippet height
+ ${1:obj}.height(${2:integer})
+snippet hide
+ ${1:obj}.hide('${2:slow/400/fast}')
+snippet hidec
+ ${1:obj}.hide('${2:slow/400/fast}', function () {
+ ${0:// callback}
+ });
+snippet hover
+ ${1:obj}.hover(function (${2:e}) {
+ ${3:// event handler}
+ }, function ($2) {
+ ${4:// event handler}
+ });
+snippet html
+ ${1:obj}.html('${2:Some text <b>and bold!</b>}')
+snippet inarr
+ $.inArray(${1:value}, ${0:array});
+snippet insa
+ ${1:obj}.insertAfter('${2:selector expression}')
+snippet insb
+ ${1:obj}.insertBefore('${2:selector expression}')
+snippet is
+ ${1:obj}.is('${2:selector expression}')
+snippet isarr
+ $.isArray(${1:obj})
+snippet isempty
+ $.isEmptyObject(${1:obj})
+snippet isfunc
+ $.isFunction(${1:obj})
+snippet isnum
+ $.isNumeric(${1:value})
+snippet isobj
+ $.isPlainObject(${1:obj})
+snippet iswin
+ $.isWindow(${1:obj})
+snippet isxml
+ $.isXMLDoc(${1:node})
+snippet jj
+ $('${1:selector}')
+snippet kdown
+ ${1:obj}.keydown(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet kpress
+ ${1:obj}.keypress(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet kup
+ ${1:obj}.keyup(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet last
+ ${1:obj}.last('${1:selector expression}')
+snippet live
+ ${1:obj}.live('${2:events}', function (${3:e}) {
+ ${0:// event handler}
+ });
+snippet load
+ ${1:obj}.load(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet loadf
+ ${1:obj}.load('${2:mydomain.com/url}',
+ ${2:{ param1: value1 },}
+ function (responseText, textStatus, xhr) {
+ ${0:// success callback}
+ }
+ });
+snippet makearray
+ $.makeArray(${0:obj});
+snippet map
+ ${1:obj}.map(function (${2:index}, ${3:element}) {
+ ${0:// callback}
+ });
+snippet mapp
+ $.map(${1:arrayOrObject}, function (${2:value}, ${3:indexOrKey}) {
+ ${0:// callback}
+ });
+snippet merge
+ $.merge(${1:target}, ${0:original});
+snippet mdown
+ ${1:obj}.mousedown(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet menter
+ ${1:obj}.mouseenter(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet mleave
+ ${1:obj}.mouseleave(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet mmove
+ ${1:obj}.mousemove(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet mout
+ ${1:obj}.mouseout(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet mover
+ ${1:obj}.mouseover(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet mup
+ ${1:obj}.mouseup(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet next
+ ${1:obj}.next('${2:selector expression}')
+snippet nexta
+ ${1:obj}.nextAll('${2:selector expression}')
+snippet nextu
+ ${1:obj}.nextUntil('${2:selector expression}'${3:, 'filter expression'})
+snippet not
+ ${1:obj}.not('${2:selector expression}')
+snippet off
+ ${1:obj}.off('${2:events}', '${3:selector expression}'${4:, handler})
+snippet offset
+ ${1:obj}.offset()
+snippet offsetp
+ ${1:obj}.offsetParent()
+snippet on
+ ${1:obj}.on('${2:events}', '${3:selector expression}', function (${4:e}) {
+ ${0:// event handler}
+ });
+snippet one
+ ${1:obj}.one('${2:event name}', function (${3:e}) {
+ ${0:// event handler}
+ });
+snippet outerh
+ ${1:obj}.outerHeight()
+snippet outerw
+ ${1:obj}.outerWidth()
+snippet param
+ $.param(${1:obj})
+snippet parent
+ ${1:obj}.parent('${2:selector expression}')
+snippet parents
+ ${1:obj}.parents('${2:selector expression}')
+snippet parentsu
+ ${1:obj}.parentsUntil('${2:selector expression}'${3:, 'filter expression'})
+snippet parsejson
+ $.parseJSON(${1:data})
+snippet parsexml
+ $.parseXML(${1:data})
+snippet pos
+ ${1:obj}.position()
+snippet prepend
+ ${1:obj}.prepend('${2:Some text <b>and bold!</b>}')
+snippet prependto
+ ${1:obj}.prependTo('${2:selector expression}')
+snippet prev
+ ${1:obj}.prev('${2:selector expression}')
+snippet preva
+ ${1:obj}.prevAll('${2:selector expression}')
+snippet prevu
+ ${1:obj}.prevUntil('${2:selector expression}'${3:, 'filter expression'})
+snippet promise
+ ${1:obj}.promise(${2:'fx'}, ${3:target})
+snippet prop
+ ${1:obj}.prop('${2:property name}')
+snippet proxy
+ $.proxy(${1:function}, ${2:this})
+snippet pushstack
+ ${1:obj}.pushStack(${2:elements})
+snippet queue
+ ${1:obj}.queue(${2:name}${3:, newQueue})
+snippet queuee
+ $.queue(${1:element}${2:, name}${3:, newQueue})
+snippet ready
+ $(function () {
+ ${0}
+ });
+snippet rem
+ ${1:obj}.remove()
+snippet rema
+ ${1:obj}.removeAttr('${2:attribute name}')
+snippet remc
+ ${1:obj}.removeClass('${2:class name}')
+snippet remd
+ ${1:obj}.removeData('${2:key name}')
+snippet remdd
+ $.removeData(${1:element}${2:, 'key name}')
+snippet remp
+ ${1:obj}.removeProp('${2:property name}')
+snippet repa
+ ${1:obj}.replaceAll(${2:target})
+snippet repw
+ ${1:obj}.replaceWith(${2:content})
+snippet reset
+ ${1:obj}.reset(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet resize
+ ${1:obj}.resize(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet scroll
+ ${1:obj}.scroll(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet scrolll
+ ${1:obj}.scrollLeft(${2:value})
+snippet scrollt
+ ${1:obj}.scrollTop(${2:value})
+snippet sdown
+ ${1:obj}.slideDown('${2:slow/400/fast}')
+snippet sdownc
+ ${1:obj}.slideDown('${2:slow/400/fast}', function () {
+ ${0:// callback};
+ });
+snippet select
+ ${1:obj}.select(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet serialize
+ ${1:obj}.serialize()
+snippet serializea
+ ${1:obj}.serializeArray()
+snippet show
+ ${1:obj}.show('${2:slow/400/fast}')
+snippet showc
+ ${1:obj}.show('${2:slow/400/fast}', function () {
+ ${0:// callback}
+ });
+snippet sib
+ ${1:obj}.siblings('${2:selector expression}')
+snippet size
+ ${1:obj}.size()
+snippet slice
+ ${1:obj}.slice(${2:start}${3:, end})
+snippet stoggle
+ ${1:obj}.slideToggle('${2:slow/400/fast}')
+snippet stop
+ ${1:obj}.stop('${2:queue}', ${3:false}, ${4:false})
+snippet submit
+ ${1:obj}.submit(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet sup
+ ${1:obj}.slideUp('${2:slow/400/fast}')
+snippet supc
+ ${1:obj}.slideUp('${2:slow/400/fast}', function () {
+ ${0:// callback};
+ });
+snippet text
+ ${1:obj}.text(${2:'some text'})
+snippet this
+ $(this)
+snippet toarr
+ ${0:obj}.toArray()
+snippet tog
+ ${1:obj}.toggle(function (${2:e}) {
+ ${3:// event handler}
+ }, function ($2) {
+ ${4:// event handler}
+ });
+ ${0}
+snippet togclass
+ ${1:obj}.toggleClass('${2:class name}')
+snippet togsh
+ ${1:obj}.toggle('${2:slow/400/fast}')
+snippet trig
+ ${1:obj}.trigger('${2:event name}')
+snippet trigh
+ ${1:obj}.triggerHandler('${2:event name}')
+snippet $trim
+ $.trim(${1:str})
+snippet $type
+ $.type(${1:obj})
+snippet unbind
+ ${1:obj}.unbind('${2:event name}')
+snippet undele
+ ${1:obj}.undelegate(${2:selector expression}, ${3:event}, ${4:handler})
+snippet uniq
+ $.unique(${1:array})
+snippet unload
+ ${1:obj}.unload(function (${2:e}) {
+ ${0:// event handler}
+ });
+snippet unwrap
+ ${1:obj}.unwrap()
+snippet val
+ ${1:obj}.val('${2:text}')
+snippet width
+ ${1:obj}.width(${2:integer})
+snippet wrap
+ ${1:obj}.wrap('${2:&lt;div class="extra-wrapper"&gt;&lt;/div&gt;}')
diff --git a/vim/bundle/vim-snippets/snippets/javascript/javascript-requirejs.snippets b/vim/bundle/vim-snippets/snippets/javascript/javascript-requirejs.snippets
new file mode 100644
index 0000000..8e72ada
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/javascript/javascript-requirejs.snippets
@@ -0,0 +1,14 @@
+snippet def
+ define(["${1:#dependencies1}"], function (${2:#dependencies2}) {
+ return ${0:TARGET};
+ });
+
+snippet defn
+ define("${1:#name}", ["${2:#dependencies1}"], function (${3:#dependencies2}) {
+ return ${0:TARGET};
+ });
+
+snippet reqjs
+ require(["${1:#dependencies1}"], function (${2:#dependencies2}) {
+ return ${0:TARGET};
+ });
diff --git a/vim/bundle/vim-snippets/snippets/javascript/javascript.d3.snippets b/vim/bundle/vim-snippets/snippets/javascript/javascript.d3.snippets
new file mode 100644
index 0000000..f5be918
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/javascript/javascript.d3.snippets
@@ -0,0 +1,30 @@
+snippet .attr
+ .attr("${1}", ${2})
+snippet .style
+ .style("${1}", ${2})
+snippet axis
+ d3.svg.axis()
+ .orient(${1})
+ .scale(${2})
+snippet fd
+ function(d) { ${1} }
+snippet fdi
+ function(d, i) { ${1} }
+snippet marginconvention
+ var ${1:margin} = { top: ${2:10}, right: ${3:10}, bottom: ${4:10}, left: ${5:10} };
+ var ${6:width} = ${7:970} - $1.left - $1.right;
+ var ${8:height} = ${9:500} - $1.top - $1.bottom;
+
+ var ${10:svg} = d3.select("${11}").append("svg")
+ .attr("width", $6 + $1.left + $1.right)
+ .attr("height", $8 + $1.top + $1.bottom)
+ .append("g")
+ .attr("transform", "translate(" + $1.left + "," + $1.top + ")")
+snippet nest
+ d3.nest()
+ .key(${1})
+ .entries(${2})
+snippet scale
+ d3.scale.linear()
+ .domain(${1})
+ .range(${2})
diff --git a/vim/bundle/vim-snippets/snippets/javascript/javascript.es6.snippets b/vim/bundle/vim-snippets/snippets/javascript/javascript.es6.snippets
new file mode 100644
index 0000000..df059a1
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/javascript/javascript.es6.snippets
@@ -0,0 +1,28 @@
+snippet const
+ const ${1} = ${0};
+snippet let
+ let ${1} = ${0};
+snippet im
+ import ${1} from '${0}';
+snippet cla
+ class ${1} {
+ ${0}
+ }
+snippet clax
+ class ${1} extends ${2} {
+ ${0}
+ }
+snippet =>
+ (${1}) => {
+ ${0}
+ }
+snippet af
+ (${1}) => {
+ ${0}
+ }
+snippet sym
+ const ${1} = Symbol('${0}');
+snippet ed
+ export default ${0}
+snippet ${
+ ${${1}}${0}
diff --git a/vim/bundle/vim-snippets/snippets/javascript/javascript.node.snippets b/vim/bundle/vim-snippets/snippets/javascript/javascript.node.snippets
new file mode 100644
index 0000000..2b5aefb
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/javascript/javascript.node.snippets
@@ -0,0 +1,51 @@
+snippet #!
+ #!/usr/bin/env node
+# module exports
+snippet ex
+ module.exports = ${1};
+# require
+snippet re
+ ${1:var} ${2} = require('${3:module_name}');
+# EventEmitter
+snippet on
+ on('${1:event_name}', function(${2:stream}) {
+ ${3}
+ });
+snippet emit
+ emit('${1:event_name}', ${2:args});
+snippet once
+ once('${1:event_name}', function(${2:stream}) {
+ ${3}
+ });
+# http. User js function snippet as handler
+snippet http
+ http.createServer(${1:handler}).listen(${2:port_number});
+# net
+snippet net
+ net.createServer(function(${1:socket}){
+ ${1}.on('data', function('data'){
+ ${2}
+ ]});
+ ${1}.on('end', function(){
+ ${3}
+ });
+ }).listen(${4:8124});
+# Stream snippets
+snippet pipe
+ pipe(${1:stream})${2}
+# Express snippets
+snippet eget
+ ${1:app}.get('${2:route}', ${3:handler});
+snippet epost
+ ${1:app}.post('${2:route}', ${3:handler});
+snippet eput
+ ${1:app}.put('${2:route}', ${3:handler});
+snippet edel
+ ${1:app}.delete('${2:route}', ${3:handler});
+# process snippets
+snippet stdin
+ process.stdin
+snippet stdout
+ process.stdout
+snippet stderr
+ process.stderr
diff --git a/vim/bundle/vim-snippets/snippets/javascript/javascript.snippets b/vim/bundle/vim-snippets/snippets/javascript/javascript.snippets
new file mode 100644
index 0000000..0d054f4
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/javascript/javascript.snippets
@@ -0,0 +1,281 @@
+# Functions
+
+# prototype
+snippet proto
+ ${1:class_name}.prototype.${2:method_name} = function(${3}) {
+ ${0}
+ };
+# Function
+snippet fun
+ function ${1:function_name}(${2}) {
+ ${0}
+ }
+# Anonymous Function
+snippet f "" w
+ function(${1}) {
+ ${0}
+ }
+# Anonymous Function assigned to variable
+snippet vaf
+ var ${1:function_name} = function(${2}) {
+ ${0}
+ };
+# Function assigned to variable
+snippet vf
+ var ${1:function_name} = function $1(${2}) {
+ ${0}
+ };
+# Immediate function
+snippet (f
+ (function(${1}) {
+ ${0}
+ }(${2}));
+# self-defining function
+snippet sdf
+ var ${1:function_name} = function (${2:argument}) {
+ ${3}
+
+ $1 = function ($2) {
+ ${0}
+ };
+ };
+
+# Flow control
+
+# if
+snippet if
+ if (${1:true}) {
+ ${0}
+ }
+# if ... else
+snippet ife
+ if (${1:true}) {
+ ${2}
+ } else {
+ ${0}
+ }
+# tertiary conditional
+snippet ter
+ ${1:/* condition */} ? ${2:/* if true */} : ${0:/* if false */}
+# switch
+snippet switch
+ switch (${1:expression}) {
+ case '${3:case}':
+ ${4}
+ break;
+ ${0}
+ default:
+ ${2}
+ }
+# case
+snippet case
+ case '${1:case}':
+ ${2}
+ break;
+ ${0}
+# try
+snippet try
+ try {
+ ${1}
+ } catch (${2:e}) {
+ ${0:/* handle error */}
+ }
+# try finally
+snippet tryf
+ try {
+ ${1}
+ } catch (${2:e}) {
+ ${0:/* handle error */}
+ } finally {
+ ${3:/* be executed regardless of the try / catch result*/}
+ }
+# throw Error
+snippet terr
+ throw new Error('${1:error message}')
+# return
+snippet ret
+ return ${0:result};
+
+# Loops
+
+# for loop
+snippet for
+ for (var ${2:i} = 0, l = ${1:arr}.length; $2 < l; $2++) {
+ var ${3:v} = $1[$2];${0:}
+ }
+# Reversed for loop
+snippet forr
+ for (var ${2:i} = ${1:arr}.length - 1; $2 >= 0; $2--) {
+ var ${3:v} = $1[$2];${0:}
+ }
+# While loop
+snippet wh
+ while (${1:/* condition */}) {
+ ${0}
+ }
+# Do while loop
+snippet do
+ do {
+ ${0}
+ } while (${1:/* condition */});
+# For in loop
+snippet fori
+ for (var ${1:prop} in ${2:object}) {
+ ${0:$2[$1]}
+ }
+
+# Objects
+
+# Object Method
+snippet :f
+ ${1:method_name}: function (${2:attribute}) {
+ ${3}
+ },
+# hasOwnProperty
+snippet has
+ hasOwnProperty(${0})
+# singleton
+snippet sing
+ function ${1:Singleton} (${2:argument}) {
+ // the cached instance
+ var instance;
+
+ // rewrite the constructor
+ $1 = function $1($2) {
+ return instance;
+ };
+
+ // carry over the prototype properties
+ $1.prototype = this;
+
+ // the instance
+ instance = new $1();
+
+ // reset the constructor pointer
+ instance.constructor = $1;
+
+ ${0}
+
+ return instance;
+ }
+# Crockford's object function
+snippet obj
+ function object(o) {
+ function F() {}
+ F.prototype = o;
+ return new F();
+ }
+# Define multiple properties
+snippet props
+ var ${1:my_object} = Object.defineProperties(
+ ${2:new Object()},
+ {
+ ${3:property} : {
+ get : function $1_$3_getter() {
+ // getter code
+ },
+ set : function $1_$3_setter(value) {
+ // setter code
+ },
+ value : ${4:value},
+ writeable : ${5:boolean},
+ enumerable : ${6:boolean},
+ configurable : ${0:boolean}
+ }
+ }
+ );
+# Define single property
+snippet prop
+ Object.defineProperty(
+ ${1:object},
+ '${2:property}',
+ {
+ get : function $1_$2_getter() {
+ // getter code
+ },
+ set : function $1_$2_setter(value) {
+ // setter code
+ },
+ value : ${3:value},
+ writeable : ${4:boolean},
+ enumerable : ${5:boolean},
+ configurable : ${0:boolean}
+ }
+ );
+
+# Documentation
+
+# docstring
+snippet /**
+ /**
+ * ${0:description}
+ *
+ */
+snippet @par
+ @param {${1:type}} ${2:name} ${0:description}
+snippet @ret
+ @return {${1:type}} ${0:description}
+# JSON
+
+# JSON.parse
+snippet jsonp
+ JSON.parse(${0:jstr});
+# JSON.stringify
+snippet jsons
+ JSON.stringify(${0:object});
+
+# DOM selectors
+
+# Get elements
+snippet get
+ getElementsBy${1:TagName}('${0}')
+# Get element
+snippet gett
+ getElementBy${1:Id}('${0}')
+# Elements by class
+snippet by.
+ ${1:document}.getElementsByClassName('${0:class}')
+# Element by ID
+snippet by#
+ ${1:document}.getElementById('${0:element ID}')
+# Query selector
+snippet qs
+ ${1:document}.querySelector('${0:CSS selector}')
+# Query selector all
+snippet qsa
+ ${1:document}.querySelectorAll('${0:CSS selector}')
+
+# Debugging
+snippet de
+ debugger;
+# console.log
+snippet cl
+ console.log(${0});
+# console.debug
+snippet cd
+ console.debug(${0});
+# console.error
+snippet ce
+ console.error(${0});
+# console.trace
+snippet ct
+ console.trace(${0:label});
+# console.time
+snippet ctime
+ console.time(${0:label});
+# console.assert
+snippet ca
+ console.assert(${1:expression}, ${0:obj});
+# console.dir
+snippet cdir
+ console.dir(${0:obj});
+
+# Misc
+
+# 'use strict';
+snippet us
+ 'use strict';
+
+# setTimeout function
+snippet timeout
+ setTimeout(function () {${0}}${2}, ${1:10});
diff --git a/vim/bundle/vim-snippets/snippets/jinja.snippets b/vim/bundle/vim-snippets/snippets/jinja.snippets
new file mode 100644
index 0000000..7d14ca8
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/jinja.snippets
@@ -0,0 +1,142 @@
+# Generic tags
+
+extends html
+
+snippet %
+ {% ${1} %}
+snippet %%
+ {% ${1:tag_name} %}
+ ${0}
+ {% end$1 %}
+snippet {
+ {{ ${1} }}
+# Template Tags
+
+snippet autoescape
+ {% autoescape ${1:off} %}
+ ${0}
+ {% endautoescape %}
+snippet block
+ {% block ${1} %}
+ ${0}
+ {% endblock %}
+snippet #
+ {# ${0:comment} #}
+snippet comment
+ {% comment %}
+ ${0}
+ {% endcomment %}
+snippet cycle
+ {% cycle ${1:val1} ${2:val2} ${3:as ${4}} %}
+snippet debug
+ {% debug %}
+snippet extends
+ {% extends "${0:base.html}" %}
+snippet filter
+ {% filter ${1} %}
+ ${0}
+ {% endfilter %}
+snippet firstof
+ {% firstof ${1} %}
+snippet for
+ {% for ${1} in ${2} %}
+ ${0}
+ {% endfor %}
+snippet empty
+ {% empty %}
+ ${0}
+snippet if
+ {% if ${1} %}
+ ${0}
+ {% endif %}
+snippet el
+ {% else %}
+ ${1}
+snippet eif
+ {% elif ${1} %}
+ ${0}
+snippet ifchanged
+ {% ifchanged %}${1}{% endifchanged %}
+snippet ifequal
+ {% ifequal ${1} ${2} %}
+ ${0}
+ {% endifequal %}
+snippet ifnotequal
+ {% ifnotequal ${1} ${2} %}
+ ${0}
+ {% endifnotequal %}
+snippet include
+ {% include "${0}" %}
+snippet load
+ {% load ${0} %}
+snippet now
+ {% now "${0:jS F Y H:i}" %}
+snippet regroup
+ {% regroup ${1} by ${2} as ${0} %}
+snippet spaceless
+ {% spaceless %}${0}{% endspaceless %}
+snippet ssi
+ {% ssi ${0} %}
+snippet trans
+ {% trans "${0:string}" %}
+snippet url
+ {% url ${1} as ${0} %}
+snippet widthratio
+ {% widthratio ${1:this_value} ${2:max_value} ${0:100} %}
+snippet with
+ {% with ${1} as ${2} %}
+ ${0}
+ {% endwith %}
+
+# Template Filters
+
+# Note: Since SnipMate can't determine which template filter you are
+# expanding without the "|" character, these do not add the "|"
+# character. These save a few keystrokes still.
+
+# Note: Template tags that take no arguments are not implemented.
+
+snippet add
+ add:"${0}"
+snippet center
+ center:"${0}"
+snippet cut
+ cut:"${0}"
+snippet date
+ date:"${0}"
+snippet default
+ default:"${0}"
+snippet defaultifnone
+ default_if_none:"${0}"
+snippet dictsort
+ dictsort:"${0}"
+snippet dictsortrev
+ dictsortreversed:"${0}"
+snippet divisibleby
+ divisibleby:"${0}"
+snippet floatformat
+ floatformat:"${0}"
+snippet getdigit
+ get_digit:"${0}"
+snippet join
+ join:"${0}"
+snippet lengthis
+ length_is:"${0}"
+snippet pluralize
+ pluralize:"${0}"
+snippet removetags
+ removetags:"${0}"
+snippet slice
+ slice:"${0}"
+snippet stringformat
+ stringformat:"${0}"
+snippet time
+ time:"${0}"
+snippet truncatewords
+ truncatewords:${0}
+snippet truncatewordshtml
+ truncatewords_html:${0}
+snippet urlizetrunc
+ urlizetrunc:${0}
+snippet wordwrap
+ wordwrap:${0}
diff --git a/vim/bundle/vim-snippets/snippets/jsp.snippets b/vim/bundle/vim-snippets/snippets/jsp.snippets
new file mode 100644
index 0000000..db185b2
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/jsp.snippets
@@ -0,0 +1,99 @@
+snippet @page
+ <%@page contentType="text/html" pageEncoding="UTF-8"%>
+snippet jstl
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+snippet jstl:c
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+snippet jstl:fn
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
+snippet cpath
+ ${pageContext.request.contextPath}
+snippet cout
+ <c:out value="${1}" default="${0}" />
+snippet cset
+ <c:set var="${1}" value="${0}" />
+snippet cremove
+ <c:remove var="${1}" scope="${0:page}" />
+snippet ccatch
+ <c:catch var="${0}" />
+snippet cif
+ <c:if test="${${1}}">
+ ${0}
+ </c:if>
+snippet cchoose
+ <c:choose>
+ ${0}
+ </c:choose>
+snippet cwhen
+ <c:when test="${${1}}">
+ ${0}
+ </c:when>
+snippet cother
+ <c:otherwise>
+ ${0}
+ </c:otherwise>
+snippet cfore
+ <c:forEach items="${${1}}" var="${2}" varStatus="${3}">
+ ${0:<c:out value="$2" />}
+ </c:forEach>
+snippet cfort
+ <c:set var="${1}">${2:item1,item2,item3}</c:set>
+ <c:forTokens var="${3}" items="${$1}" delims="${4:,}">
+ ${0:<c:out value="$3" />}
+ </c:forTokens>
+snippet cparam
+ <c:param name="${1}" value="${0}" />
+snippet cparam+
+ <c:param name="${1}" value="${2}" />
+ cparam+${0}
+snippet cimport
+ <c:import url="${1}" />
+snippet cimport+
+ <c:import url="${1}">
+ <c:param name="${2}" value="${3}" />
+ cparam+${0}
+ </c:import>
+snippet curl
+ <c:url value="${1}" var="${2}" />
+ <a href="${$2}">${0}</a>
+snippet curl+
+ <c:url value="${1}" var="${2}">
+ <c:param name="${4}" value="${5}" />
+ cparam+${0}
+ </c:url>
+ <a href="${$2}">${3}</a>
+snippet credirect
+ <c:redirect url="${0}" />
+snippet contains
+ ${fn:contains(${1:string}, ${0:substr})}
+snippet contains:i
+ ${fn:containsIgnoreCase(${1:string}, ${0:substr})}
+snippet endswith
+ ${fn:endsWith(${1:string}, ${0:suffix})}
+snippet escape
+ ${fn:escapeXml(${0:string})}
+snippet indexof
+ ${fn:indexOf(${1:string}, ${0:substr})}
+snippet join
+ ${fn:join(${1:collection}, ${0:delims})}
+snippet length
+ ${fn:length(${0:collection_or_string})}
+snippet replace
+ ${fn:replace(${1:string}, ${2:substr}, ${0:replace})}
+snippet split
+ ${fn:split(${1:string}, ${0:delims})}
+snippet startswith
+ ${fn:startsWith(${1:string}, ${0:prefix})}
+snippet substr
+ ${fn:substring(${1:string}, ${2:begin}, ${0:end})}
+snippet substr:a
+ ${fn:substringAfter(${1:string}, ${0:substr})}
+snippet substr:b
+ ${fn:substringBefore(${1:string}, ${0:substr})}
+snippet lc
+ ${fn:toLowerCase(${0:string})}
+snippet uc
+ ${fn:toUpperCase(${0:string})}
+snippet trim
+ ${fn:trim(${0:string})}
diff --git a/vim/bundle/vim-snippets/snippets/julia.snippets b/vim/bundle/vim-snippets/snippets/julia.snippets
new file mode 100644
index 0000000..1876ed8
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/julia.snippets
@@ -0,0 +1,102 @@
+snippet #!
+ #!/usr/bin/env julia
+
+# Functions
+snippet fun function definition
+ function ${1}(${2})
+ ${0}
+ end
+
+snippet ret return
+ return(${0})
+
+# Printing to console
+snippet pr print
+ print("${1}")
+ ${0}
+
+snippet prl print line
+ println("${1}")
+ ${0}
+
+# Includes
+snippet use load a package
+ using ${0}
+
+snippet incl include source code
+ include("${1}")
+ ${0}
+
+# Loops
+snippet forc for loop iterating over iterable container
+ for ${1} in ${2}
+ ${0}
+ end
+
+snippet for standard for loop
+ for ${1} = ${2}
+ ${0}
+ end
+
+snippet fornest nested for loop
+ for ${1} = ${2}, ${3} = ${4}
+ ${0}
+ end
+
+snippet wh while loop
+ while ${1} ${2:<=} ${3}
+ ${0}
+ end
+
+# Conditionals
+snippet if if statement
+ if ${1}
+ ${0}
+ end
+
+snippet el else part of statement
+ else
+ ${0}
+
+snippet eif else if part of if statement
+ else if ${1}
+ ${0}
+
+snippet ife full if-else statement
+ if ${1}
+ ${2}
+ else
+ ${0}
+ end
+
+snippet tern ternary operator
+ ${1} ? ${2} : ${3:nothing}
+
+# Exceptions
+snippet try try catch
+ try
+ ${1}
+ catch ${2}
+ ${0}
+ end
+
+snippet fin finally statement
+ finally
+ ${0}
+
+snippet thr throw
+ throw(${1})
+ ${0}
+
+# Messages
+snippet in
+ info("${1}")
+ ${0}
+
+snippet wa
+ warn("${1}")
+ ${0}
+
+snippet err
+ error("${1}")
+ ${0}
diff --git a/vim/bundle/vim-snippets/snippets/laravel.snippets b/vim/bundle/vim-snippets/snippets/laravel.snippets
new file mode 100644
index 0000000..e7435e3
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/laravel.snippets
@@ -0,0 +1,242 @@
+#resource controller
+snippet l_rsc
+ /*!
+ * \class $1
+ *
+ * \author ${3:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+ class ${1:`!v expand('%:t:r')`} extends ${2:BaseController} {
+ function __construct() {
+ }
+
+ public function index() {
+ }
+
+ public function create() {
+ }
+
+ public function store() {
+ }
+
+ public function show($id) {
+ }
+
+ public function edit($id) {
+ }
+
+ public function update($id) {
+ }
+
+ public function destroy($id) {
+ }
+ }
+#service service provider
+snippet l_ssp
+ /*!
+ * \namespace $1
+ * \class $2
+ *
+ * \author ${3:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+ namespace ${1:Services};
+
+ use Illuminate\Support\ServiceProvider;
+
+ class ${2:`!v expand('%:t:r')`} extends ServiceProvider {
+
+ public function register() {
+ $this->app->bind('${4}Service', function ($app) {
+ return new ${5}(
+ $app->make('Repositories\\${6}Interface')
+ );
+ });
+ }
+ }
+#repository service provider
+snippet l_rsp
+ /*!
+ * \namespace $2
+ * \class $3
+ *
+ * \author ${4:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+ namespace ${2:Repositories\\${1:}};
+
+ use Entities\\$1;
+ use $2\\$1Repository;
+ use Illuminate\Support\ServiceProvider;
+
+ class ${3:`!v expand('%:t:r')`} extends ServiceProvider {
+ /*!
+ * \var defer
+ * \brief Defer service
+ */
+ protected $defer = ${5:true};
+
+ public function register() {
+ $this->app->bind('$2\\$1Interface', function($app) {
+ return new $1Repository(new $1());
+ });
+ }
+
+ /*!
+ * \brief If $defer == true need this fn
+ */
+ public function provides() {
+ return ['$2\\$1Interface'];
+ }
+ }
+#model
+snippet l_md
+ /*!
+ * \namespace $1
+ * \class $2
+ *
+ * \author ${3:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+ namespace ${1:Entities};
+
+ class ${2:`!v expand('%:t:r')`} extends \Eloquent {
+ protected $table = '${4:`!p snip.rv = t[2].lower()`}';
+
+ public $timestamps = ${5:false};
+
+ protected $hidden = array(${6});
+
+ protected $guarded = array(${7:'id'});
+ }
+#abstract repository
+snippet l_ar
+ /*!
+ * \namespace $1
+ * \class $2
+ * \implements $3
+ *
+ * \author ${4:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+ namespace ${1:Repositories};
+
+ use Illuminate\Database\Eloquent\Model;
+
+ abstract class ${2:`!v expand('%:t:r')`} implements ${3:BaseRepositoryInterface} {
+ protected $model;
+
+ /*!
+ * \fn __construct
+ *
+ * \brief Take the model
+ */
+
+ public function __construct(Model $model) {
+ $this->model = $model;
+ }
+
+ /*!
+ * \fn all
+ *
+ * \return Illuminate\Database\Eloquent\Collection
+ */
+ public function all($columns = array('*')) {
+ return $this->model->all()->toArray();
+ }
+
+ /*!
+ * \fn create
+ *
+ * \return Illuminate\Database\Eloquent\Model
+ */
+ public function create(array $attributes) {
+ return $this->model->create($attributes);
+ }
+
+ /*!
+ * \fn destroy
+ *
+ * \return int
+ */
+ public function destroy($ids) {
+ return $this->model->destroy($ids);
+ }
+
+ /*!
+ * \fn find
+ *
+ * \return mixed
+ */
+ public function find($id, $columns = array('*')) {
+ return $this->model->find($id, $columns);
+ }
+ }
+
+#repository
+snippet l_r
+ /*!
+ * \namespace $1
+ * \class $3
+ * \implements $4
+ *
+ * \author ${5:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+ namespace ${1:Repositories\\${2}};
+
+ class ${3:`!v expand('%:t:r')`} extends \\${6} implements ${4:$3RepositoryInterface} {
+ ${7}
+ }
+#service
+snippet l_s
+ /*!
+ * \namespace $1
+ * \class $2
+ *
+ * \author ${6:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+ namespace Services\\${1};
+
+ use ${3:Repositories\\${4:Interface}};
+
+ class ${2:`!v expand('%:t:r')`} {
+ protected $${5:repo};
+
+ /*!
+ * \fn __construct
+ */
+ public function __construct($4 $repo) {
+ $this->$5 = $repo;
+ }
+ }
+#facade
+snippet l_f
+ /*!
+ * \namespace $1
+ * \class $2
+ *
+ * \author ${5:`!v g:snips_author`}
+ * \date `!v strftime('%d-%m-%y')`
+ */
+
+ namespace ${1:Services};
+
+ use \Illuminate\Support\Facades\Facade;
+
+ class ${2:`!v expand('%:t:r')`} extends Facade {
+ /*!
+ * \fn getFacadeAccessor
+ *
+ * \return string
+ */
+ protected static function getFacadeAccessor() { return '${4:${3}Service}'; }
+ }
diff --git a/vim/bundle/vim-snippets/snippets/ledger.snippets b/vim/bundle/vim-snippets/snippets/ledger.snippets
new file mode 100644
index 0000000..b401f61
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/ledger.snippets
@@ -0,0 +1,5 @@
+# Ledger <http://ledger-cli.org/>
+snippet ent
+ `strftime("%Y/%m/%d")` ${1:transaction}
+ ${2:account} ${3:value}
+ ${0:account}
diff --git a/vim/bundle/vim-snippets/snippets/ls.snippets b/vim/bundle/vim-snippets/snippets/ls.snippets
new file mode 100644
index 0000000..909b35e
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/ls.snippets
@@ -0,0 +1,108 @@
+# Closure loop
+snippet forinlet
+ for ${1:name} in ${2:array}
+ let $1
+ ${3}
+# Array comprehension
+snippet fora
+ for ${1:name} in ${2:array}
+ ${3}
+# Object comprehension
+snippet foro
+ for ${1:key}, ${2:value} of ${3:object}
+ ${4}
+# Range comprehension (inclusive)
+snippet forr
+ for ${1:name} from ${2:start} to ${3:finish}
+ ${4}
+snippet forrb
+ for ${1:name} from ${2:start} to ${3:finish} by ${4:step}
+ ${5}
+# Range comprehension (exclusive)
+snippet forrex
+ for ${1:name} from ${2:start} til ${3:finish}
+ ${4}
+snippet forrexb
+ for ${1:name} from ${2:start} til ${3:finish} by ${4:step}
+ ${5}
+# Function
+snippet fun
+ (${1:args}) ->
+ ${2}
+# Function (bound)
+snippet bfun
+ (${1:args}) ~>
+ ${2}
+# Class
+snippet cla class ..
+ class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
+ ${2}
+snippet cla class .. constructor: ..
+ class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
+ (${2:args}) ->
+ ${3}
+
+ ${4}
+snippet cla class .. extends ..
+ class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
+ ${3}
+snippet cla class .. extends .. constructor: ..
+ class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass}
+ (${3:args}) ->
+ ${4}
+
+ ${5}
+# If
+snippet if
+ if ${1:condition}
+ ${2}
+# If __ Else
+snippet ife
+ if ${1:condition}
+ ${2}
+ else
+ ${3}
+# Else if
+snippet elif
+ else if ${1:condition}
+ ${2}
+# Ternary If
+snippet ifte
+ if ${1:condition} then ${2:value} else ${3:other}
+# Unless
+snippet unl
+ ${1:action} unless ${2:condition}
+# Switch
+snippet swi
+ switch ${1:object}
+ case ${2:value}
+ ${3}
+ default void
+snippet mat
+ match ${1:object}
+ | ${2:value} => ${3}
+ | otherwise => void
+
+# Log
+snippet log
+ console.log ${1}
+# stringify
+snippet str
+ JSON.stringify ${1}, void, 2
+
+# Try __ Catch
+snippet try
+ try
+ ${1}
+ catch ${2:error}
+ ${3}
+# Require
+snippet req
+ ${2:$1} = require '${1}'${3}
+# Require!
+snippet req!
+ require! ${1}
+
+# Export
+snippet exp
+ ${1:root} = exports ? this
diff --git a/vim/bundle/vim-snippets/snippets/lua.snippets b/vim/bundle/vim-snippets/snippets/lua.snippets
new file mode 100644
index 0000000..b7de2de
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/lua.snippets
@@ -0,0 +1,21 @@
+snippet #!
+ #!/usr/bin/env lua
+ $1
+snippet local
+ local ${1:x} = ${0:1}
+snippet fun
+ function ${1:fname}(${2:...})
+ ${0:-- body}
+ end
+snippet for
+ for ${1:i}=${2:1},${3:10} do
+ ${0:print(i)}
+ end
+snippet forp
+ for ${1:i},${2:v} in pairs(${3:table_name}) do
+ ${0:-- body}
+ end
+snippet fori
+ for ${1:i},${2:v} in ipairs(${3:table_name}) do
+ ${0:-- body}
+ end
diff --git a/vim/bundle/vim-snippets/snippets/make.snippets b/vim/bundle/vim-snippets/snippets/make.snippets
new file mode 100644
index 0000000..332d6fc
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/make.snippets
@@ -0,0 +1,50 @@
+# base
+snippet base
+ .PHONY: clean, mrproper
+ CC = gcc
+ CFLAGS = -g -Wall
+
+ all: $1
+
+ %.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+ ${1:out}: $1.o
+ $(CC) $(CFLAGS) -o $@ $+
+
+ clean:
+ rm -f *.o core.*
+
+ mrproper: clean
+ rm -f $1
+# add
+snippet add
+ ${1:out}: $1.o
+ $(CC) $(CFLAGS) -o $@ $+
+# print
+snippet print
+ print-%: ; @echo $*=$($*)
+# ifeq
+snippet if
+ ifeq (${1:cond0}, ${2:cond1})
+ ${0}
+ endif
+# ifeq ... else ... endif
+snippet ife
+ ifeq (${1:cond0}, ${2:cond1})
+ ${3}
+ else
+ ${0}
+ endif
+# else ...
+snippet el
+ else
+ ${0}
+# .DEFAULT_GOAL := target
+snippet default
+ .DEFAULT_GOAL := ${1}
+# help target for self-documented Makefile
+snippet help
+ help: ## Prints help for targets with comments
+ @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $\$1, $\$2}'
+ ${0}
diff --git a/vim/bundle/vim-snippets/snippets/mako.snippets b/vim/bundle/vim-snippets/snippets/mako.snippets
new file mode 100644
index 0000000..2264eac
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/mako.snippets
@@ -0,0 +1,54 @@
+snippet def
+ <%def name="${1:name}">
+ ${0:}
+ </%def>
+snippet call
+ <%call expr="${1:name}">
+ ${0:}
+ </%call>
+snippet doc
+ <%doc>
+ ${0:}
+ </%doc>
+snippet text
+ <%text>
+ ${0:}
+ </%text>
+snippet for
+ % for ${1:i} in ${2:iter}:
+ ${0:}
+ % endfor
+snippet if if
+ % if ${1:condition}:
+ ${0:}
+ % endif
+snippet ife if/else
+ % if ${1:condition}:
+ ${2:}
+ % else:
+ ${0:}
+ % endif
+snippet try
+ % try:
+ ${1:}
+ % except${2:}:
+ ${0:pass}
+ % endtry
+snippet wh
+ % while ${1:}:
+ ${0:}
+ % endwhile
+snippet $
+ ${ ${0:} }
+snippet <%
+ <% ${0:} %>
+snippet <!%
+ <!% ${0:} %>
+snippet inherit
+ <%inherit file="${0:filename}" />
+snippet include
+ <%include file="${0:filename}" />
+snippet namespace
+ <%namespace file="${0:name}" />
+snippet page
+ <%page args="${0:}" />
diff --git a/vim/bundle/vim-snippets/snippets/markdown.snippets b/vim/bundle/vim-snippets/snippets/markdown.snippets
new file mode 100644
index 0000000..d258aa8
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/markdown.snippets
@@ -0,0 +1,139 @@
+# Markdown
+
+# Includes octopress (http://octopress.org/) snippets
+
+# The suffix `c` stands for "Clipboard".
+
+snippet [
+ [${1:text}](http://${2:address})
+snippet [*
+ [${1:link}](${2:`@*`})
+snippet [c
+ [${1:link}](${2:`@+`})
+snippet ["
+ [${1:text}](http://${2:address} "${3:title}")
+snippet ["*
+ [${1:link}](${2:`@*`} "${3:title}")
+snippet ["c
+ [${1:link}](${2:`@+`} "${3:title}")
+snippet [:
+ [${1:id}]: http://${2:url}
+
+snippet [:*
+ [${1:id}]: ${2:`@*`}
+
+snippet [:c
+ [${1:id}]: ${2:`@+`}
+
+snippet [:"
+ [${1:id}]: http://${2:url} "${3:title}"
+
+snippet [:"*
+ [${1:id}]: ${2:`@*`} "${3:title}"
+
+snippet [:"c
+ [${1:id}]: ${2:`@+`} "${3:title}"
+
+snippet ![
+ ![${1:alttext}](${2:/images/image.jpg})
+snippet ![*
+ ![${1:alt}](${2:`@*`})
+snippet ![c
+ ![${1:alt}](${2:`@+`})
+snippet !["
+ ![${1:alttext}](${2:/images/image.jpg} "${3:title}")
+snippet !["*
+ ![${1:alt}](${2:`@*`} "${3:title}")
+snippet !["c
+ ![${1:alt}](${2:`@+`} "${3:title}")
+snippet ![:
+ ![${1:id}]: ${2:url}
+
+snippet ![:*
+ ![${1:id}]: ${2:`@*`}
+
+snippet ![:"
+ ![${1:id}]: ${2:url} "${3:title}"
+
+snippet ![:"*
+ ![${1:id}]: ${2:`@*`} "${3:title}"
+
+snippet ![:"c
+ ![${1:id}]: ${2:`@+`} "${3:title}"
+
+snippet <
+ <http://${1:url}>
+snippet <*
+ <`@*`>
+snippet <c
+ <`@+`>
+snippet **
+ **${1:bold}**
+snippet __
+ __${1:bold}__
+snippet ===
+ `repeat('=', strlen(getline(line(".") - 1)) - strlen(getline('.')))`
+
+ ${0}
+snippet -
+ - ${0}
+snippet ---
+ `repeat('-', strlen(getline(line(".") - 1)) - strlen(getline('.')))`
+
+ ${0}
+
+snippet blockquote
+ {% blockquote %}
+ ${0:quote}
+ {% endblockquote %}
+
+snippet blockquote-author
+ {% blockquote ${1:author}, ${2:title} %}
+ ${0:quote}
+ {% endblockquote %}
+
+snippet blockquote-link
+ {% blockquote ${1:author} ${2:URL} ${3:link_text} %}
+ ${0:quote}
+ {% endblockquote %}
+
+snippet ```
+ \`\`\`
+ ${1:code}
+ \`\`\`
+
+# Language.
+snippet ```l
+ \`\`\`${1:language}
+ ${2:code}
+ \`\`\`
+
+snippet codeblock-short
+ {% codeblock %}
+ ${0:code_snippet}
+ {% endcodeblock %}
+
+snippet codeblock-full
+ {% codeblock ${1:title} lang:${2:language} ${3:URL} ${4:link_text} %}
+ ${0:code_snippet}
+ {% endcodeblock %}
+
+snippet gist-full
+ {% gist ${1:gist_id} ${0:filename} %}
+
+snippet gist-short
+ {% gist ${0:gist_id} %}
+
+snippet img
+ {% img ${1:class} ${2:URL} ${3:width} ${4:height} ${5:title_text} ${0:alt_text} %}
+
+snippet youtube
+ {% youtube ${0:video_id} %}
+
+# The quote should appear only once in the text. It is inherently part of it.
+# See http://octopress.org/docs/plugins/pullquote/ for more info.
+
+snippet pullquote
+ {% pullquote %}
+ ${1:text} {" ${2:quote} "} ${0:text}
+ {% endpullquote %}
diff --git a/vim/bundle/vim-snippets/snippets/mustache.snippets b/vim/bundle/vim-snippets/snippets/mustache.snippets
new file mode 100644
index 0000000..8296afc
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/mustache.snippets
@@ -0,0 +1,18 @@
+# if {{#value}} ... {{/value}}
+snippet if
+ {{#${1:value}}}
+ ${0}
+ {{/$1}}
+# if not {{^value}} ... {{/value}}
+snippet ifn
+ {{^${1:value}}}
+ ${0}
+ {{/$1}}
+# if else {{#value}} ... {{/value}} {{^value}} ... {{/value}}
+snippet ife
+ {{#${1:value}}}
+ ${2}
+ {{/$1}}
+ {{^$1}}
+ ${3}
+ {{/$1}}
diff --git a/vim/bundle/vim-snippets/snippets/objc.snippets b/vim/bundle/vim-snippets/snippets/objc.snippets
new file mode 100644
index 0000000..24cfb97
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/objc.snippets
@@ -0,0 +1,247 @@
+# #import <...>
+snippet Imp
+ #import <${1:Cocoa/Cocoa.h}>
+# #import "..."
+snippet imp
+ #import "${1:`vim_snippets#Filename()`.h}"
+# @selector(...)
+snippet sel
+ @selector(${1:method}:)
+# @"..." string
+snippet s
+ @"${1}"
+# Object
+snippet o
+ ${1:NSObject} *${2:foo} = [${3:$1 alloc}]${4};
+# NSLog(...)
+snippet log
+ NSLog(@"${1:%@}"${2});
+# Class
+snippet objc
+ @interface ${1:`vim_snippets#Filename('', 'someClass')`} : ${2:NSObject}
+ {
+ }
+ @end
+
+ @implementation $1
+ ${0}
+ @end
+# Class Interface
+snippet int
+ @interface ${1:`vim_snippets#Filename('', 'someClass')`} : ${2:NSObject}
+ {${3}
+ }
+ ${0}
+ @end
+snippet @interface
+ @interface ${1:`vim_snippets#Filename('', 'someClass')`} : ${2:NSObject}
+ {${3}
+ }
+ ${0}
+ @end
+# Class Implementation
+snippet impl
+ @implementation ${1:`vim_snippets#Filename('', 'someClass')`}
+ ${0}
+ @end
+snippet @implementation
+ @implementation ${1:`vim_snippets#Filename('', 'someClass')`}
+ ${0}
+ @end
+# Protocol
+snippet pro
+ @protocol ${1:`vim_snippets#Filename('$1Delegate', 'MyProtocol')`} ${2:<NSObject>}
+ ${0}
+ @end
+snippet @protocol
+ @protocol ${1:`vim_snippets#Filename('$1Delegate', 'MyProtocol')`} ${2:<NSObject>}
+ ${0}
+ @end
+# init Definition
+snippet init
+ - (id)init
+ {
+ if (self = [super init]) {
+ ${0}
+ }
+ return self;
+ }
+# dealloc Definition
+snippet dealloc
+ - (void) dealloc
+ {
+ ${0:deallocations}
+ [super dealloc];
+ }
+snippet su
+ [super ${1:init}]
+snippet ibo
+ IBOutlet ${1:NSSomeClass} *${2:$1};
+# Category
+snippet cat
+ @interface ${1:NSObject} (${2:MyCategory})
+ @end
+
+ @implementation $1 ($2)
+ ${0}
+ @end
+# Category Interface
+snippet cath
+ @interface ${1:`vim_snippets#Filename('$1', 'NSObject')`} (${2:MyCategory})
+ ${0}
+ @end
+# Method
+snippet m
+ - (${1:id})${2:method}
+ {
+ ${0}
+ }
+# Method declaration
+snippet md
+ - (${1:id})${2:method};
+# IBAction declaration
+snippet ibad
+ - (IBAction)${1:method}:(${2:id})sender;
+# IBAction method
+snippet iba
+ - (IBAction)${1:method}:(${2:id})sender
+ {
+ ${0}
+ }
+# awakeFromNib method
+snippet wake
+ - (void)awakeFromNib
+ {
+ ${0}
+ }
+# Class Method
+snippet M
+ + (${1:id})${2:method}
+ {
+ ${0:return nil;}
+ }
+# Sub-method (Call super)
+snippet sm
+ - (${1:id})${2:method}
+ {
+ [super $2];${0}
+ return self;
+ }
+# Accessor Methods For:
+# Object
+snippet objacc
+ - (${1:id})${2:thing}
+ {
+ return $2;
+ }
+
+ - (void)set$2:($1)${3:new$2}
+ {
+ [$3 retain];
+ [$2 release];
+ $2 = $3;
+ }
+# for (object in array)
+snippet forin
+ for (${1:Class} *${2:some$1} in ${3:array}) {
+ ${0}
+ }
+snippet fore
+ for (${1:object} in ${2:array}) {
+ ${0:statements}
+ }
+snippet forarray
+ unsigned int ${1:object}Count = [${2:array} count];
+
+ for (unsigned int index = 0; index < $1Count; index++) {
+ ${3:id} $1 = [$2 $1AtIndex:index];
+ ${0}
+ }
+snippet fora
+ unsigned int ${1:object}Count = [${2:array} count];
+
+ for (unsigned int index = 0; index < $1Count; index++) {
+ ${3:id} $1 = [$2 $1AtIndex:index];
+ ${0}
+ }
+# Try / Catch Block
+snippet @try
+ @try {
+ ${1:statements}
+ }
+ @catch (NSException * e) {
+ ${2:handler}
+ }
+ @finally {
+ ${0:statements}
+ }
+snippet @catch
+ @catch (${1:exception}) {
+ ${0:handler}
+ }
+snippet @finally
+ @finally {
+ ${0:statements}
+ }
+# IBOutlet
+# @property (Objective-C 2.0)
+snippet prop
+ @property (${1:retain}) ${2:NSSomeClass} ${3:*$2};
+# @synthesize (Objective-C 2.0)
+snippet syn
+ @synthesize ${1:property};
+# [[ alloc] init]
+snippet alloc
+ [[${1:foo} alloc] init${2}];
+snippet a
+ [[${1:foo} alloc] init${2}];
+# retain
+snippet ret
+ [${1:foo} retain];
+# release
+snippet rel
+ [${0:foo} release];
+# autorelease
+snippet arel
+ [${0:foo} autorelease];
+# autorelease pool
+snippet pool
+ NSAutoreleasePool *${1:pool} = [[NSAutoreleasePool alloc] init];
+ ${0}
+ [$1 drain];
+# Throw an exception
+snippet except
+ NSException *${1:badness};
+ $1 = [NSException exceptionWithName:@"${2:$1Name}"
+ reason:@"${0}"
+ userInfo:nil];
+ [$1 raise];
+snippet prag
+ #pragma mark ${0:-}
+snippet cl
+ @class ${1:Foo};
+snippet color
+ [[NSColor ${0:blackColor}] set];
+# NSArray
+snippet array
+ NSMutableArray *${1:array} = [NSMutable array];
+snippet nsa
+ NSArray ${0}
+snippet nsma
+ NSMutableArray ${0}
+snippet aa
+ NSArray * array;
+snippet ma
+ NSMutableArray * array;
+# NSDictionary
+snippet dict
+ NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];
+snippet nsd
+ NSDictionary ${0}
+snippet nsmd
+ NSMutableDictionary ${0}
+# NSString
+snippet nss
+ NSString ${0}
+snippet nsms
+ NSMutableString ${0}
diff --git a/vim/bundle/vim-snippets/snippets/openfoam.snippets b/vim/bundle/vim-snippets/snippets/openfoam.snippets
new file mode 100644
index 0000000..950cbda
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/openfoam.snippets
@@ -0,0 +1,53 @@
+# 0/*
+snippet fv
+ type fixedValue;
+ value uniform ${0};
+snippet zg
+ type zeroGradient;
+snippet sym
+ type symmetryPlane;
+# system/controlDict
+snippet forces
+ forces
+ {
+ type forces;
+ functionObjectLibs ("libforces.so");
+ enabled true;
+ outputControl ${1:timeStep};
+ outputInterval ${2:1};
+ patches (${3});
+ log ${4:true};
+ CofR (${0:0 0 0});
+ }
+# system/fvSolution
+# solvers
+snippet gamg
+ ${1:p}
+ {
+ solver GAMG;
+ tolerance 1e-${2:6};
+ relTol ${0:0.0};
+ smoother GaussSeidel;
+ cacheAgglomeration true;
+ nCellsInCoarsestLevel 10;
+ agglomerator faceAreaPair;
+ mergeLevels 1;
+ }
+snippet pbicg
+ ${1:U}
+ {
+ solver PBiCG;
+ preconditioner DILU;
+ tolerance 1e-${2:6};
+ relTol ${0:0.0};
+ }
+# PIMPLE
+snippet pimple
+ PIMPLE
+ {
+ nOuterCorrectors ${1:outer};
+ nCorrectors ${2:inner};
+ nNonOrthogonalCorrectors ${3:nonOrtho};
+ pRefCell ${4:cell};
+ pRefValue ${0:value for $4};
+ }
diff --git a/vim/bundle/vim-snippets/snippets/perl.snippets b/vim/bundle/vim-snippets/snippets/perl.snippets
new file mode 100644
index 0000000..65120a2
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/perl.snippets
@@ -0,0 +1,359 @@
+# #!/usr/bin/perl
+snippet #!
+ #!/usr/bin/env perl
+
+# Hash Pointer
+snippet .
+ =>
+# Function
+snippet sub
+ sub ${1:function_name} {
+ ${0}
+ }
+# Conditional
+snippet if
+ if (${1}) {
+ ${0}
+ }
+# Conditional if..else
+snippet ife
+ if (${1}) {
+ ${2}
+ }
+ else {
+ ${0}
+ }
+# Conditional if..elsif..else
+snippet ifee
+ if (${1}) {
+ ${2}
+ }
+ elsif (${3}) {
+ ${4:# elsif...}
+ }
+ else {
+ ${0}
+ }
+snippet eif
+ elsif (${1}) {
+ ${0}
+ }
+# Conditional One-line
+snippet xif
+ ${1:expression} if ${2:condition};
+# Unless conditional
+snippet unless
+ unless (${1}) {
+ ${0}
+ }
+# Unless conditional One-line
+snippet xunless
+ ${1:expression} unless ${2:condition};
+# Try/Except
+snippet eval
+ local $@;
+ eval {
+ ${1:# do something risky...}
+ };
+ if (my $e = $@) {
+ ${0:# handle failure...}
+ }
+# While Loop
+snippet wh
+ while (${1}) {
+ ${0}
+ }
+# While Loop One-line
+snippet xwh
+ ${1:expression} while ${2:condition};
+# C-style For Loop
+snippet cfor
+ for (my $${2:var} = 0; $$2 < ${1:count}; $$2${3:++}) {
+ ${0}
+ }
+# For loop one-line
+snippet xfor
+ ${1:expression} for @${2:array};
+# Foreach Loop
+snippet for
+ foreach my $${1:x} (@${2:array}) {
+ ${0}
+ }
+# Foreach Loop One-line
+snippet fore
+ ${1:expression} foreach @${2:array};
+# Package
+snippet package
+ package ${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`};
+
+ ${0}
+
+ 1;
+
+ __END__
+# Package syntax perl >= 5.14
+snippet packagev514
+ package ${1:`substitute(vim_snippets#Filename('', 'Page Title'), '^.', '\u&', '')`} ${2:0.99};
+
+ ${0}
+
+ 1;
+
+ __END__
+#moose
+snippet moose
+ use Moose;
+ use namespace::autoclean;
+ ${1:#}BEGIN {extends '${2:ParentClass}'};
+
+ ${0}
+# parent
+snippet parent
+ use parent qw(${0:Parent Class});
+# Read File
+snippet slurp
+ my $${1:var} = do { local $/; open my $file, '<', "${2:file}"; <$file> };
+ ${0}
+# strict warnings
+snippet strwar
+ use strict;
+ use warnings;
+# older versioning with perlcritic bypass
+snippet vers
+ ## no critic
+ our $VERSION = '${0:version}';
+ eval $VERSION;
+ ## use critic
+# new 'switch' like feature
+snippet switch
+ use feature 'switch';
+
+# Anonymous subroutine
+snippet asub
+ sub {
+ ${0}
+ }
+
+
+
+# Begin block
+snippet begin
+ BEGIN {
+ ${0}
+ }
+
+# call package function with some parameter
+snippet pkgmv
+ __PACKAGE__->${1:package_method}(${0:var})
+
+# call package function without a parameter
+snippet pkgm
+ __PACKAGE__->${0:package_method}()
+
+# call package "get_" function without a parameter
+snippet pkget
+ __PACKAGE__->get_${0:package_method}()
+
+# call package function with a parameter
+snippet pkgetv
+ __PACKAGE__->get_${1:package_method}(${0:var})
+
+# complex regex
+snippet qrx
+ qr/
+ ${0:regex}
+ /xms
+
+#simpler regex
+snippet qr/
+ qr/${0:regex}/x
+
+#given
+snippet given
+ given ($${1:var}) {
+ ${2:# cases}
+ ${0:# default}
+ }
+
+# switch-like case
+snippet when
+ when (${1:case}) {
+ ${0}
+ }
+
+# hash slice
+snippet hslice
+ @{ ${1:hash} }{ ${0:array} }
+
+
+# map
+snippet map
+ map { ${0: body } } ${1: @array } ;
+
+
+
+# Pod stub
+snippet ppod
+ =head1 NAME
+
+ ${1:ClassName} - ${2:ShortDesc}
+
+ =head1 SYNOPSIS
+
+ use $1;
+
+ ${3:# synopsis...}
+
+ =head1 DESCRIPTION
+
+ ${0:# longer description...}
+
+
+ =head1 INTERFACE
+
+
+ =head1 DEPENDENCIES
+
+
+ =head1 SEE ALSO
+
+
+# Heading for a subroutine stub
+snippet psub
+ =head2 ${1:MethodName}
+
+ ${0:Summary....}
+
+# Heading for inline subroutine pod
+snippet psubi
+ =head2 ${1:MethodName}
+
+ ${0:Summary...}
+
+
+ =cut
+# inline documented subroutine
+snippet subpod
+ =head2 $1
+
+ Summary of $1
+
+ =cut
+
+ sub ${1:subroutine_name} {
+ ${0}
+ }
+# Subroutine signature
+snippet parg
+ =over 2
+
+ =item
+ Arguments
+
+
+ =over 3
+
+ =item
+ C<${1:DataStructure}>
+
+ ${2:Sample}
+
+
+ =back
+
+
+ =item
+ Return
+
+ =over 3
+
+
+ =item
+ C<${0:...return data}>
+
+
+ =back
+
+
+ =back
+
+
+
+# Moose has
+snippet has
+ has ${1:attribute} => (
+ is => '${2:ro|rw}',
+ isa => '${3:Str|Int|HashRef|ArrayRef|etc}',
+ default => sub {
+ ${4:defaultvalue}
+ },
+ ${0:# other attributes}
+ );
+
+
+# override
+snippet override
+ override ${1:attribute} => sub {
+ ${2:# my $self = shift;};
+ ${0:# my ($self, $args) = @_;};
+ };
+
+
+# use test classes
+snippet tuse
+ use Test::More;
+ use Test::Deep; # (); # uncomment to stop prototype errors
+ use Test::Exception;
+
+# local test lib
+snippet tlib
+ use lib qw{ ./t/lib };
+
+#test methods
+snippet tmeths
+ $ENV{TEST_METHOD} = '${0:regex}';
+
+# runtestclass
+snippet trunner
+ use ${0:test_class};
+ $1->runtests();
+
+# Test::Class-style test
+snippet tsub
+ sub t${1:number}_${2:test_case} :Test(${3:num_of_tests}) {
+ my $self = shift;
+ ${0}
+
+ }
+
+# Test::Routine-style test
+snippet trsub
+ test ${1:test_name} => { description => '${2:Description of test.}'} => sub {
+ my ($self) = @_;
+ ${0}
+ };
+
+#prep test method
+snippet tprep
+ sub prep${1:number}_${2:test_case} :Test(startup) {
+ my $self = shift;
+ ${0}
+ }
+
+# cause failures to print stack trace
+snippet debug_trace
+ use Carp; # 'verbose';
+ # cloak "die"
+ # warn "warning"
+ $SIG{'__DIE__'} = sub {
+ require Carp; Carp::confess
+ };
+
+snippet dump
+ use Data::Dump qw(dump);
+ warn dump ${1:variable}
+
+snippet subtest
+ subtest '${1: test_name}' => sub {
+ ${2}
+ };
diff --git a/vim/bundle/vim-snippets/snippets/perl6.snippets b/vim/bundle/vim-snippets/snippets/perl6.snippets
new file mode 100644
index 0000000..21ddf5b
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/perl6.snippets
@@ -0,0 +1,116 @@
+# shebang
+snippet #!
+ #!/usr/bin/env perl6
+
+# Hash Pointer
+snippet .
+ =>
+# Function
+snippet sub
+ sub ${1:function_name}(${2:Str $var}) {
+ ${3}
+ }
+snippet mul
+ multi ${1:function_name}(${2:Str $var}) {
+ ${3}
+ }
+# Conditional
+snippet if
+ if ${1} {
+ ${2}
+ }
+# Conditional if..else
+snippet ife
+ if ${1} {
+ ${2}
+ }
+ else {
+ ${3}
+ }
+snippet eif
+ elsif ${1) {
+ ${2}
+ }
+# Conditional One-line
+snippet xif
+ ${1:expression} if ${2:condition};
+# Unless conditional
+snippet unless
+ unless ${1} {
+ ${2}
+ }
+# Unless conditional One-line
+snippet xunless
+ ${1:expression} unless ${2:condition};
+# Ternary conditional
+snippet tc
+ ${1:condition} ?? ${2:value-if-true} !! ${3:value-if-false};
+# given - when (perl6 switch)
+snippet switch
+ given ${1:$var} {
+ when ${2:condition} {
+ ${3:# code block ...}
+ }
+ ${4}
+ default {
+ ${5}
+ }
+ }
+# 'loop' - C's for.
+snippet loop
+ loop (my ${1:$i} = 0; $$1 < ${2:count}; $$1++) {
+ ${3}
+ }
+# for loop
+snippet for
+ for ${1:@array} -> ${2:$variable} {
+ ${3}
+ }
+# While Loop
+snippet wh
+ while ${1} {
+ ${2}
+ }
+# Repeat while and repean until
+snippet rp
+ repeat {
+ ${1}
+ } ${2:while|until} ${3};
+# classes ..
+snippet cl
+ ${1:my} class ${2:ClassName} ${3:is|does Parent|Role}{
+ ${4}
+ }
+snippet has
+ has ${1:Type} ${2:$!identifier};
+snippet mth
+ method ${1:method_name}(${2:$attr}) {
+ ${3}
+ }
+snippet pmth
+ method ${1:!}${2:method_name}(${3:$attr}) {
+ ${4}
+ }
+snippet smth
+ submethod ${1:submethod_name}(${2:$attr}) {
+ ${3}
+ }
+# Tests
+snippet test
+ use v6;
+ use Test;
+ ${1:use lib 'lib';}
+
+ plan ${2:$num-tests};
+
+# IO
+snippet slurp
+ my ${1:$var} = "${2:filename}".IO.slurp;
+snippet rfile
+ for "${1:filename}".IO.lines -> $line {
+ ${2}
+ }
+snippet open
+ my $fh = open "${1:filename}", ${2::r|:w|:a};
+ ${3:# actions};
+ $fh.close;
diff --git a/vim/bundle/vim-snippets/snippets/php.snippets b/vim/bundle/vim-snippets/snippets/php.snippets
new file mode 100644
index 0000000..4faa167
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/php.snippets
@@ -0,0 +1,661 @@
+snippet <?
+ <?php
+
+ ${0}
+snippet ec
+ echo ${0};
+snippet <?e
+ <?php echo ${0} ?>
+# this one is for php5.4
+snippet <?=
+ <?=${0}?>
+snippet ?=
+ <?= ${0} ?>
+snippet ?
+ <?php ${0} ?>
+snippet ?f
+ <?php foreach ($${1:vars} as $${2:$var}): ?>
+ ${0}
+ <?php endforeach ?>
+snippet ?i
+ <?php if ($${1:var}): ?>
+ ${0}
+ <?php endif ?>
+snippet ns
+ namespace ${1:Foo\Bar\Baz};
+ ${0}
+snippet c
+ class ${1:`vim_snippets#Filename()`}
+ {
+ ${0}
+ }
+snippet i
+ interface ${1:`vim_snippets#Filename()`}
+ {
+ ${0}
+ }
+snippet t.
+ $this->
+snippet f
+ function ${1}(${3})
+ {
+ ${0}
+ }
+# method
+snippet m
+ ${1:protected} function ${2:foo}()
+ {
+ ${0}
+ }
+snippet sm "PHP Class Setter"
+ /**
+ * Sets the value of ${1:foo}
+ *
+ * @param ${2:string} $$1 ${3:description}
+ *
+ * @return ${4:`vim_snippets#Filename()`}
+ */
+ ${5:public} function set${6:$1}(${7:$2 }$$1)
+ {
+ $this->${8:$1} = $$1;
+
+ return $this;
+ }
+snippet gm "PHP Class Getter Setter"
+ /**
+ * Gets the value of ${1:foo}
+ *
+ * @return ${2:string}
+ */
+ ${3:public} function get${4:$1}()
+ {
+ return $this->${5:$1};
+ }
+#setter
+snippet $s
+ ${1:$foo}->set${2:Bar}(${0});
+#getter
+snippet $g
+ ${1:$foo}->get${0:Bar}();
+# Tertiary conditional
+snippet =?:
+ $${1:foo} = ${2:true} ? ${3:a} : ${0};
+snippet ?:
+ ${1:true} ? ${2:a} : ${0}
+snippet t "$retVal = (condition) ? a : b"
+ $${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};
+# Predefined variables
+snippet C
+ $_COOKIE['${1:variable}']
+snippet E
+ $_ENV['${1:variable}']
+snippet F
+ $_FILES['${1:variable}']
+snippet G
+ $_GET['${1:variable}']
+snippet P
+ $_POST['${1:variable}']
+snippet R
+ $_REQUEST['${1:variable}']
+snippet S
+ $_SERVER['${1:variable}']
+snippet SS
+ $_SESSION['${1:variable}']
+snippet get "get"
+ $_GET['${1}']
+snippet post "post"
+ $_POST['${1}']
+snippet session "session"
+ $_SESSION['${1}']
+# the following are old ones
+snippet inc
+ include '${1:file}';
+snippet inc1
+ include_once '${1:file}';
+snippet req
+ require '${1:file}';
+snippet req1
+ require_once '${1:file}';
+# Start Docblock
+snippet /*
+ /**
+ * ${0}
+ */
+# Class - post doc
+snippet doc_cp
+ /**
+ * ${1:undocumented class}
+ *
+ * @package ${2:default}
+ * @subpackage ${3:default}
+ * @author ${4:`g:snips_author`}
+ */
+# Class Variable - post doc
+snippet doc_vp
+ /**
+ * ${1:undocumented class variable}
+ *
+ * @var ${2:string}
+ */
+# Class Variable
+snippet doc_v
+ /**
+ * ${3:undocumented class variable}
+ *
+ * @var ${4:string}
+ */
+ ${1:var} $${2};
+# Class
+snippet doc_c
+ /**
+ * ${3:undocumented class}
+ *
+ * @package ${4:default}
+ * @subpackage ${5:default}
+ * @author ${6:`g:snips_author`}
+ */
+ ${1:}class ${2:}
+ {
+ ${0}
+ } // END $1class $2
+# Constant Definition - post doc
+snippet doc_dp
+ /**
+ * ${1:undocumented constant}
+ */
+# Constant Definition
+snippet doc_d
+ /**
+ * ${3:undocumented constant}
+ */
+ define(${1}, ${2});
+# Function - post doc
+snippet doc_fp
+ /**
+ * ${1:undocumented function}
+ *
+ * @return ${2:void}
+ * @author ${3:`g:snips_author`}
+ */
+# Function signature
+snippet doc_s
+ /**
+ * ${4:undocumented function}
+ *
+ * @return ${5:void}
+ * @author ${6:`g:snips_author`}
+ */
+ ${1}function ${2}(${3});
+# Function
+snippet doc_f
+ /**
+ * ${4:undocumented function}
+ *
+ * @return ${5:void}
+ * @author ${6:`g:snips_author`}
+ */
+ ${1}function ${2}(${3})
+ {${0}
+ }
+# Header
+snippet doc_h
+ /**
+ * ${1}
+ *
+ * @author ${2:`g:snips_author`}
+ * @version ${3:$Id$}
+ * @copyright ${4:$2}, `strftime('%d %B, %Y')`
+ * @package ${0:default}
+ */
+snippet doc_i "interface someClass {}"
+ /**
+ * $1
+ * @package ${2:default}
+ * @author ${3:`!v g:snips_author`}
+ **/
+ interface ${1:someClass}
+ {${4}
+ }
+snippet inheritdoc "@inheritdoc docblock"
+ /**
+ * {@inheritdoc}
+ */
+# Interface
+snippet interface
+ /**
+ * ${2:undocumented class}
+ *
+ * @package ${3:default}
+ * @author ${4:`g:snips_author`}
+ */
+ interface ${1:`vim_snippets#Filename()`}
+ {
+ ${0}
+ }
+# Trait
+snippet trait
+ /**
+ * ${2:undocumented class}
+ *
+ * @package ${3:default}
+ * @author ${4:`g:snips_author`}
+ */
+ trait ${1:`vim_snippets#Filename()`}
+ {
+ ${0}
+ }
+# class ...
+snippet class
+ /**
+ * ${1}
+ */
+ class ${2:`vim_snippets#Filename()`}
+ {
+ ${3}
+ /**
+ * ${4}
+ */
+ ${5:public} function ${6:__construct}(${7:argument})
+ {
+ ${0}
+ }
+ }
+snippet nc
+ namespace ${1:`substitute(substitute(expand("%:h"), '\v^\w+\/(\u)', '\1', ''), '\/', '\\\', 'g')`};
+
+ ${2:abstract }class ${3:`vim_snippets#Filename()`}
+ {
+ ${0}
+ }
+# define(...)
+snippet def "define('VARIABLE_NAME', 'definition')"
+ define('${1:VARIABLE_NAME}', ${2:'definition'});
+# defined(...)
+snippet def?
+ ${1}defined('${2}')
+snippet wh "while (condition) { ... }"
+ while (${1:/* condition */}) {
+ ${0}
+ }
+snippet do "do { ... } while (condition)"
+ do {
+ ${0}
+ } while (${1});
+snippet if "if (condition) { ... }"
+ if (${1}) {
+ ${0}
+ }
+snippet ifn "if (!condition) { ... }"
+ if (!${1}) {
+ ${2}
+ }
+snippet ifil "<?php if (condition): ?> ... <?php endif; ?>"
+ <?php if (${1}): ?>
+ ${0}
+ <?php endif; ?>
+snippet ife "if (cond) { ... } else { ... }"
+ if (${1}) {
+ ${2}
+ } else {
+ ${3}
+ }
+ ${0}
+snippet ifeil "<?php if (condition): ?> ... <?php else: ?> ... <?php endif; ?>"
+ <?php if (${1}): ?>
+ ${2}
+ <?php else: ?>
+ ${3}
+ <?php endif; ?>
+ ${0}
+snippet el "else { ... }"
+ else {
+ ${0}
+ }
+snippet eif "elseif(condition) { ... }"
+ elseif (${1}) {
+ ${0}
+ }
+snippet switch "switch($var) { case 'xyz': ... default: .... }"
+ switch ($${1:variable}) {
+ case '${2:value}':
+ ${3}
+ break;
+ ${0}
+ default:
+ ${4}
+ break;
+ }
+snippet case "case 'value': ... break"
+ case '${1:value}':
+ ${2}
+ break;
+snippet for "for ($i = 0; $i < $count; $i++) { ... }"
+ for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {
+ ${0}
+ }
+snippet foreach "foreach ($var as $value) { .. }"
+ foreach ($${1:variable} as $${2:value}) {
+ ${0}
+ }
+snippet foreachil "<?php foreach ($var as $value): ?> ... <?php endforeach; ?>"
+ <?php foreach ($${1:variable} as $${2:value}): ?>
+ ${0}
+ <?php endforeach; ?>
+snippet foreachk "foreach ($var as $key => $value) { .. }"
+ foreach ($${1:variable} as $${2:key} => $${3:value}) {
+ ${0}
+ }
+snippet foreachkil "<?php foreach ($var as $key => $value): ?> ... <?php endforeach; ?>"
+ <?php foreach ($${1:variable} as $${2:key} => $${3:value}): ?>
+ ${0:<!-- html... -->}
+ <?php endforeach; ?>
+snippet array "$... = array(...)"
+ $${1:arrayName} = array('${2}' => ${3});
+snippet try "try { ... } catch (Exception $e) { ... }"
+ try {
+ ${0}
+ } catch (${1:Exception} $e) {
+ }
+# lambda with closure
+snippet lambda
+ ${1:static }function (${2:args}) use (${3:&$x, $y /*put vars in scope (closure) */}) {
+ ${0}
+ };
+# pre_dump();
+snippet pd
+ echo '<pre>'; var_dump(${0}); echo '</pre>';
+# pre_dump(); die();
+snippet pdd
+ echo '<pre>'; var_dump(${1}); echo '</pre>'; die(${0:});
+snippet vd
+ var_dump(${0});
+snippet vdd
+ var_dump(${1}); die(${0:});
+snippet pr
+ print_r(${0});
+snippet prs
+ print_r(${0}, 1);
+snippet vdf
+ error_log(print_r($${1:foo}, true), 3, '${2:/tmp/debug.log}');
+snippet http_redirect
+ header ("HTTP/1.1 301 Moved Permanently");
+ header ("Location: ".URL);
+ exit();
+snippet log "error_log(var_export($var, true));"
+ error_log(var_export(${1}, true));
+snippet var "var_export($var)"
+ var_export(${1});
+snippet ve "Dumb debug helper in HTML"
+ echo '<pre>' . var_export(${1}, 1) . '</pre>';
+snippet pc "Dumb debug helper in cli"
+ var_export($1);$0
+# Getters & Setters
+snippet gs "PHP Class Getter Setter"
+ /**
+ * Gets the value of ${1:foo}
+ *
+ * @return ${2:string}
+ */
+ public function get${3:$1}()
+ {
+ return $this->${4:$1};
+ }
+
+ /**
+ * Sets the value of $1
+ *
+ * @param $2 $$1 ${5:description}
+ *
+ * @return ${6:`vim_snippets#Filename()`}
+ */
+ public function set$3(${7:$2 }$$1)
+ {
+ $this->$4 = $$1;
+ return $this;
+ }
+# anotation, get, and set, useful for doctrine
+snippet ags
+ /**
+ * ${1:description}
+ *
+ * @${0}
+ */
+ ${2:protected} $${3:foo};
+
+ public function get${4:$3}()
+ {
+ return $this->$3;
+ }
+
+ public function set$4(${5:$4 }$${6:$3})
+ {
+ $this->$3 = $$6;
+ return $this;
+ }
+snippet rett
+ return true;
+snippet retf
+ return false;
+snippet am
+ $${1:foo} = array_map(function($${2:v}) {
+ ${0}
+ return $$2;
+ }, $$1);
+snippet aw
+ array_walk($${1:foo}, function(&$${2:v}, $${3:k}) {
+ $$2 = ${0};
+ });
+# static var assign once
+snippet static_var
+ static $${1} = null;
+ if (is_null($$1)){
+ $$1 = ${2};
+ }
+snippet CSVWriter
+ <?php
+
+ class CSVWriter {
+ public function __construct($file_or_handle, $sep = "\t", $quot = '"'){
+ $args = func_get_args();
+ $mode = isset($opts['mode']) ? $opts['mode'] : 'w';
+
+ $this->f =
+ is_string($file_or_handle)
+ ? fopen($file_or_handle, $mode)
+ : $file_or_handle;
+
+ $this->fputcsv_args = array($this->f, null, $sep, $quot);
+
+ if (!$this->f) throw new Exception('bad file descriptor');
+ }
+
+ public function write($row){
+ $this->fputcsv_args[1] =& $row;
+ call_user_func_array('fputcsv', $this->fputcsv_args);
+ }
+
+ public function close(){
+ if (!is_null($this->f))
+ fclose($this->f);
+ $this->f = null;
+ }
+
+ public function __destruct(){
+ $this->close();
+ }
+
+ }
+snippet CSVIterator
+
+ // http://snipplr.com/view.php?codeview&id=1986 // modified
+ class CSVIterator implements Iterator
+ {
+ private $f;
+ private $curr;
+ private $rowCounter;
+
+ /* opts keys:
+ * row_size
+ * escape
+ * enclosure
+ * delimiter
+ */
+ public function __construct( $file_or_handle, $opts = array(4096, ',') )
+ {
+ $d = function($n) use(&$opts){ return isset($opts[$n]) ? $opts[$n] : false; };
+
+ $this->combine = $d('combine');
+ $this->headers = $d('headers');
+ $this->headerCheckFunction = $d('header_check_function');
+
+ $this->f =
+ is_string($file_or_handle)
+ ? fopen( $file_or_handle, 'r' )
+ : $file_or_handle;
+ if (!$this->f) throw new Exception('bad file descriptor');
+ $this->fgetcsv_args = array(
+ $this->f,
+ isset($opts['row_size']) ? $opts['row_size'] : 4096,
+ isset($opts['delimiter']) ? $opts['delimiter'] : ',',
+ isset($opts['enclosure']) ? $opts['enclosure'] : '"',
+ isset($opts['escape']) ? $opts['escape'] : '\\',
+ );
+ $this->start();
+ }
+
+ protected function readRow(){
+ $this->curr = call_user_func_array('fgetcsv', $this->fgetcsv_args );
+ $this->rowCounter++;
+ if ($this->rowCounter == 1){
+ $this->processHeader();
+ } elseif ($this->curr) {
+ $this->processRow();
+ }
+ }
+
+ public function processHeader(){
+ if ($this->headers || $this->combine){
+ $this->header = $this->curr;
+ if ($this->headerCheckFunction){
+ $f = $this->headerCheckFunction;
+ $f($this->header);
+ }
+ $this->readRow();
+ }
+ }
+
+ public function processRow(){
+ if ($this->combine)
+ $this->curr = array_combine($this->header, $this->curr);
+ }
+
+ public function start(){
+ $this->rowCounter = 0;
+ rewind( $this->f );
+ $this->readRow();
+ }
+
+ public function rewind()
+ {
+ $this->start();
+ }
+
+ public function current()
+ {
+ $curr = $this->curr;
+ $this->readRow();
+ return $curr;
+ }
+
+ public function key()
+ {
+ return $this->rowCounter;
+ }
+
+ public function next()
+ {
+ return $this->curr;
+ }
+
+ public function valid(){
+ if( !$this->next() )
+ {
+ fclose( $this->f );
+ return FALSE;
+ }
+ return TRUE;
+ }
+
+ } // end class
+# phpunit
+snippet ase "$this->assertEquals()"
+ $this->assertEquals(${1:expected}, ${2:actual});
+snippet asne "$this->assertNotEquals()"
+ $this->assertNotEquals(${1:expected}, ${2:actual});
+snippet asf "$this->assertFalse()"
+ $this->assertFalse(${1});
+snippet ast "$this->assertTrue()"
+ $this->assertTrue(${1});
+snippet asfex "$this->assertFileExists()"
+ $this->assertFileExists(${1:'path/to/file'});
+snippet asfnex "$this->assertFileNotExists()"
+ $this->assertFileNotExists(${1:'path/to/file'});
+snippet ascon "$this->assertContains()"
+ $this->assertContains(${1:$needle}, ${2:$haystack});
+snippet ashk "$this->assertArrayHasKey()"
+ $this->assertArrayHasKey(${1:$key}, ${2:$array});
+snippet asnhk "$this->assertArrayNotHasKey()"
+ this->assertArrayNotHasKey(${1:$key}, ${2:$array});
+snippet ascha "$this->assertClassHasAttribute()"
+ $this->assertClassHasAttribute(${1:$attributeName}, '${2:$className}');
+snippet asi "$this->assertInstanceOf(...)"
+ $this->assertInstanceOf(${1:expected}, ${2:actual});
+snippet test "public function testXYZ() { ... }"
+ public function test${1}()
+ {
+ ${0}
+ }
+snippet setup "protected function setUp() { ... }"
+ protected function setUp()
+ {
+ ${0}
+ }
+snippet teardown "protected function tearDown() { ... }"
+ protected function tearDown()
+ {
+ ${0}
+ }
+snippet exp "phpunit expects"
+ expects($this->${1:once}())
+ ->method('${2}')
+ ->with($this->equalTo(${3})${4})
+ ->will($this->returnValue(${5}));
+snippet testcmt "phpunit comment with group"
+ /**
+ * @group ${1}
+ */
+snippet fail "$this->fail()"
+ $this->fail(${1});
+snippet marki "$this->markTestIncomplete()"
+ $this->markTestIncomplete(${1});
+snippet marks "$this->markTestSkipped()"
+ $this->markTestSkipped(${1});
+# end of phpunit snippets
+snippet te "throw new Exception()"
+ throw new ${1:Exception}("${2:Error Processing Request}");
+snippet fpc "file_put_contents" b
+ file_put_contents(${1:file}, ${2:content}${3:, FILE_APPEND});$0
+snippet sr "str_replace"
+ str_replace(${1:search}, ${2:replace}, ${3:subject})$0
+snippet ia "in_array"
+ in_array(${1:needle}, ${2:haystack})$0
+snippet is "isset"
+ isset(${1:var})$0
+snippet isa "isset array"
+ isset($${1:array}[${2:key}])$0
+snippet in "is_null"
+ is_null($${1:var})$0
+snippet fe "file_exists"
+ file_exists(${1:file})$0
+snippet id "is_dir"
+ is_dir(${1:path})$0
diff --git a/vim/bundle/vim-snippets/snippets/plsql.snippets b/vim/bundle/vim-snippets/snippets/plsql.snippets
new file mode 100644
index 0000000..2920758
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/plsql.snippets
@@ -0,0 +1,109 @@
+# create package spec
+snippet ps
+ create or replace package ${1:name}
+ as
+ ${0:-- spec}
+ end; -- end of package spec $1
+# create package body
+snippet pb
+ create or replace package body ${1:name}
+ as
+ ${0:-- body}
+ end; -- end of package body $1;
+# package procedure spec
+snippet pps
+ procedure ${1:name}(${0:args});
+# package procedure body
+snippet ppb
+ procedure ${1:name}(${2:args})
+ as
+ begin
+ ${0:-- body}
+ end $2;
+# package function spec
+snippet pfs
+ function ${1:name}(${2:args})
+ return ${0:type};
+# package function body
+snippet pfb
+ function ${1:name}(${2:args})
+ return ${3:type}
+ as
+ l_res $3;
+ begin
+ ${0:-- body};
+ return l_res;
+ end $1;
+# snow errors
+snippet err
+ show errors;
+# proc/func in parameter
+snippet p
+ ${1:name} ${2:in} ${3:type} ${0: := null}
+# package type: record
+snippet tr
+ type tr_${1:name} is record (${0:/* columns */});
+# package type: nested table
+snippet tt
+ type tt_${1:name} is table of tr_${0:name};
+# package type: indexed table
+snippet tti
+ type tt_${1:name} is table of tr_${0:name} index by binary_integer;
+# proc/func comment
+snippet doc
+ /*
+ * ${0: comment ...}
+ */
+# plsql block
+snippet beg
+ begin
+ ${0}
+ end;
+# plsql block with declare part
+snippet dec
+ declare
+ ${1}
+ begin
+ ${0}
+ end;
+# return pipe row
+snippet rpipe
+ for ${1:i} in 1 .. ${0:l_res}.count loop
+ pipe row( $2($1) );
+ end loop;
+ return;
+# bulk collect
+snippet bc
+ bulk collect into ${0}
+# local variable
+snippet l
+ l_${1} ${0:number};
+# output
+snippet log
+ dbms_output.put_line('${0}');
+# for loop
+snippet for
+ for ${1:i} in ${2:1}..${3:42} loop
+ ${0}
+ end loop;
+# for loop with select
+snippet fors
+ for ${1:rec} in (${2: select}) loop
+ ${0}
+ end loop;
+# for loop with collection
+snippet forc
+ for ${1:i} in ${2:l_var}.first .. $2.last loop
+ ${0: -- dbms_output.put_line($2($1)); }
+ end loop;
+# if
+snippet if
+ if ${1} then
+ ${0}
+ end if;
+snippet ife
+ if ${1} then
+ ${2}
+ else
+ ${0}
+ end if;
diff --git a/vim/bundle/vim-snippets/snippets/po.snippets b/vim/bundle/vim-snippets/snippets/po.snippets
new file mode 100644
index 0000000..84916fa
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/po.snippets
@@ -0,0 +1,5 @@
+snippet msg
+ msgid "${1}"
+ msgstr "${2}"
+
+ ${0}
diff --git a/vim/bundle/vim-snippets/snippets/processing.snippets b/vim/bundle/vim-snippets/snippets/processing.snippets
new file mode 100755
index 0000000..015af4a
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/processing.snippets
@@ -0,0 +1,705 @@
+#BASICS
+# doc
+snippet doc
+ /**
+ * ${1:Description}
+ *
+ * @author ${2:name}
+ * @since ${3:`strftime("%d/%m/%y %H:%M:%S")`}
+ */
+ ${0}
+# doc comment
+snippet docc
+ /**
+ * ${1:@private}$0
+ */
+ ${0}
+# class
+snippet class
+ ${1:public }class ${2:`fnamemodify(bufname("%"),":t:r")`} ${3:extends}
+ {
+
+ //--------------------------------------
+ // CONSTRUCTOR
+ //--------------------------------------
+
+ public $2 (${4:arguments}) {
+ ${0:// expression}
+ }
+ }
+# package
+snippet package
+ /**
+ * ${1:Description}
+ *
+ * @author ${2:$TM_FULLNAME}
+ * @since ${3:`strftime("%d/%m/%y %H:%M:%S")`}
+ */
+
+ package ${0:package};
+# function
+snippet fun
+ ${1:void/private/protected/public}${2: static} ${3:name}(${4}) {
+ ${5://if not void return null;}
+ }
+ ${0}
+snippet fn
+ ${1:void }${2:name}(${3}) {
+ ${4://if not void return null;}
+ }
+ ${0}
+# constant
+snippet const
+ static final ${1:Object} ${2:VAR_NAM} = ${0};
+# var
+snippet var
+ ${1:private/public }${2:static }${3:String} ${4:str}${5: =}${0:value};
+# var objects
+snippet obj
+ ${1:private/public }${2:Object} ${3:o}${4: = new }$2(${0});
+#loop for
+snippet for
+ for (int ${2:i} = 0; $2 < ${1:Things}.length; $2${3:++}) {
+ ${0:$1[$2]}
+ };
+#loop while
+snippet wh
+ while (${1:/* condition */}) {
+ ${0}
+ }
+#break
+snippet break
+ break ${1:label};
+#case
+snippet case
+ case ${1:expression} :
+ ${0}
+ break;
+#default
+snippet default
+ default :
+ ${1}
+ break;
+#switch
+snippet switch
+ switch(${1:expression}) {
+ case '${3:case}':
+ ${4}
+ break;
+ ${0}
+ default:
+ ${2}
+ }
+#try
+snippet try
+ try {
+ ${0}
+ } catch(${1:Exception} ${2:e}) {
+ }
+#try catch finally
+snippet tryf
+ try {
+ ${0}
+ } catch(${1:Exception} ${2:e}) {
+ } finally {
+ }
+#throw
+snippet throw
+ throw new ("${1:Exception()}");
+#ternary
+snippet ?
+ ? ${1:trueExpression} : ${2:falseExpression}
+ ${0}
+snippet if
+ if (${1:true}) {${0}}
+# if ... else
+snippet ife
+ if (${1:true}) {${2}}
+ else{${0}}
+#get
+snippet get
+ public ${1:String} get${2}() {
+ return ${0:fieldName};
+ }
+#set
+snippet set
+ public void set${1}(${0:String} new${1}) {
+ ${1:fieldName} = new${1};
+ }
+#printIn
+snippet println
+ println("${1:`fnamemodify(bufname("%"),":t:r")`}::${2:method}() "${3: +} ${0});
+#println string
+snippet pr
+ println("${0}");
+#setup draw
+snippet setup
+ void setup(){
+ ${1}
+ }
+
+ void draw(){
+ ${0}
+ }
+#setup OPENGL
+snippet opengl
+ import processing.opengl.*;
+ import javax.media.opengl.*;
+
+ PGraphicsOpenGL pgl;
+ GL gl;
+
+ void setup(){
+ size( ${1:300}, ${2:300}, OPENGL );
+ colorMode( RGB, 1.0 );
+ hint( ENABLE_OPENGL_4X_SMOOTH );
+ pgl = (PGraphicsOpenGL) g;
+ gl = pgl.gl;
+ gl.setSwapInterval(1);
+ initGL();
+ ${3}
+ }
+
+ void draw(){
+ pgl.beginGL();
+ ${4}
+ pgl.endGL();
+ getOpenGLErrors();
+ }
+
+ void initGL(){
+ ${0}
+ }
+
+ void getOpenGLErrors(){
+ int error = gl.glGetError();
+ switch (error){
+ case 1280 :
+ println("GL_INVALID_ENUM - An invalid enumerant was passed to an OpenGL command.");
+ break;
+ case 1282 :
+ println("GL_INVALID_OPERATION - An OpenGL command was issued that was invalid or inappropriate for the current state.");
+ break;
+ case 1281 :
+ println("GL_INVALID_VALUE - A value was passed to OpenGL that was outside the allowed range.");
+ break;
+ case 1285 :
+ println("GL_OUT_OF_MEMORY - OpenGL was unable to allocate enough memory to process a command.");
+ break;
+ case 1283 :
+ println("GL_STACK_OVERFLOW - A command caused an OpenGL stack to overflow.");
+ break;
+ case 1284 :
+ println("GL_STACK_UNDERFLOW - A command caused an OpenGL stack to underflow.");
+ break;
+ case 32817 :
+ println("GL_TABLE_TOO_LARGE");
+ break;
+ }
+ }
+
+#GL Functions
+snippet gl begin gl
+ pgl.beginGL();
+ ${0}
+ pgl.endGL();
+snippet gl gl swap interval
+ // specify the minimum swap interval for buffer swaps.
+ gl.setSwapInterval(${0:interval});
+snippet gl gl call list
+ // execute a display list
+ gl.glCallList(${0:list});
+snippet gl gl gen buffers
+ // import java.nio.IntBuffer;
+ // import java.nio.FloatBuffer;
+ // import com.sun.opengl.util.BufferUtil;
+
+ // You might need to create four buffers to store vertext data, normal data, texture coordinate data, and indices in vertex arrays
+ IntBuffer bufferObjects = IntBuffer.allocate(${1:4});
+ gl.glGenBuffers($1, bufferObjects);
+
+ int vertexCount = ${2:3};
+ int numCoordinates = ${0:3};
+ // vertexCount * numCoordinates
+ FloatBuffer vertices = BufferUtil.newFloatBuffer(vertexCount * numCoordinates);
+ float[] v = {0.0f, 0.0f, 0.0f,
+ 1.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 1.0f};
+ vertices.put(v);
+
+ // Bind the first buffer object ID for use with vertext array data
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, bufferObjects.get(0));
+ gl.glBufferData(GL.GL_ARRAY_BUFFER, vertexCount * numCoordinates * BufferUtil.SIZEOF_FLOAT, vertices, GL.GL_STATIC_DRAW);
+snippet gl gl bind buffer
+ ${0:// A buffer ID of zero unbinds a buffer object}
+ gl.glBindBuffer(GL.GL_ARRAY_BUFFER, ${1:0});
+snippet gl gl delete buffers
+ ${0:// Parameters are the same for glGenBuffers}
+ gl.glDeleteBuffers(${1:4}, ${2:bufferObjects});
+snippet gl gl depth mask
+ // enable or disable writing into the depth buffer
+ gl.glDepthMask(${0:flag});
+snippet gl gl load identity
+ // replaces the top of the active matrix stack with the identity matrix
+ gl.glLoadIdentity();
+snippet gl gl tex coord 2f
+ // set the current texture coordinates - 2 floats
+ gl.glTexCoord2f(${1:0.0f}, ${0:0.0f});
+snippet gl gl vertex 2f
+ gl.glVertex2f(${1:0.0f}, ${0:0.0f});
+snippet gl gl vertex 3f
+ gl.glVertex3f(${1:0.0f}, ${2:0.0f}, ${0:0.0f});
+snippet gl gl translate f
+ // multiply the current matrix by a translation matrix
+ gl.glTranslatef(${1:x}, ${2:y}, ${0:z});
+snippet gl gl rotate f
+ // rotate, x-axis, y-axis, z-axiz
+ gl.glRotatef(${1:angle}, ${2:x}, ${3:y}, ${0:z});
+snippet gl gl scale f
+ // multiply the current matrix by a general scaling matrix
+ gl.glScalef(${1:x}, ${2:y}, ${0:z});
+snippet gl gl color 4f
+ gl.glColor4f(${1:red}, ${2:green}, ${3:blue}, ${0:alpha});
+snippet gl gl clear color
+ gl.glClearColor(${1:red}, ${2:green}, ${3:blue}, ${0:alpha});
+snippet gl gl color 3f
+ gl.glColor3f(${1:red}, ${2:green}, ${0:blue});
+snippet gl gl push matrix
+ // spush and pop the current matrix stack
+ gl.glPushMatrix();
+ ${0}
+ gl.glPopMatrix();
+snippet gl gl gen lists
+ gl.glGenLists(${0:1})
+snippet gl gl flush
+ // Empties buffers. Call this when all previous issues commands completed
+ gl.glFlush();
+ ${0}
+snippet gl gl get error
+ println(gl.glGetError());
+snippet gl gl clear
+ gl.glClear(${1:GL.GL_COLOR_BUFFER_BIT}${2: | }${0:GL.GL_DEPTH_BUFFER_BIT});
+
+#frame operations
+snippet frameRate
+ frameRate(${1:30});
+ ${0}
+snippet saveFrame
+ saveFrame("${1:filename-####}${0:.ext}");
+
+#size
+snippet size normal
+ size(${1:200}, ${2:200}${0:, P3D});
+snippet size opengl
+ size(${1:200}, ${2:200}${0:, OPENGL});
+
+#PRIMITIVES
+#color
+snippet color
+ color ${1:c}${2: = color(}${3:value1, }${4:value2, }${0:value3)};
+#char
+snippet char
+ char ${1:m}${2: = "}${0:char"};
+#float
+snippet float
+ float ${1:f}${2: = }${0:0.0f};
+#int
+snippet int
+ int ${1:f}${2: = }${0:0};
+#boolean
+snippet boolean
+ boolean ${1:b}${2: = }${0:true};
+#byte
+snippet byte
+ byte ${1:b}${2: = }${0:127};
+#string
+snippet string
+ String ${1:str}${2: = "}${0:CCCP"};
+#array
+snippet array
+ ${1:int}[] ${2:numbers}${3: = new $1}[${0:length}];
+#object
+snippet object
+ ${1:Object} ${2:o}${3: = new $1}(${0});
+
+#curve
+snippet curve
+ curve(${1:x1}, ${2:y1}, ${3:x2}, ${4:y2}, ${5:x3}, ${6:y3}, ${7:x4}, ${0:y4});
+snippet curve 3D
+ curve(${1:x1}, ${2:y1}, ${3:z1}, ${4:x2}, ${5:y2}, ${6:z2}, ${7:x3}, ${8:y3}, ${9:z3}, ${10:x4}, ${11:y4}, ${0:z4});
+snippet curveDetail
+ curveDetail(${0:detail});
+snippet curvePoint
+ curvePoint(${1:a}, ${2:b}, ${3:c}, ${4:d}, ${0:t});
+snippet curveTightness
+ curveTightness(${0:squishy});
+
+#bezier
+snippet bezier
+ bezier(${1:x1}, ${2:y1}, ${3:cx1}, ${4:cy1}, ${5:cx2}, ${6:cy2}, ${7:x2}, ${0:y2});
+snippet bezier 3D
+ bezier(${1:x1}, ${2:y1}, ${3:z1}, ${4:cx1}, ${5:cy1}, ${6:cz1}, ${7:cx2}, ${8:cy2}, ${9:cz2}, ${10:x2}, ${11:y2}, ${0:z2});
+snippet bezierDetail
+ bezierDetail(${0:detail});
+snippet bezierTangent
+ bezierTangent(${1:a}, ${2:b}, ${3:c}, ${4:d}, ${0:t});
+snippet bezierPoint
+ bezierPoint(${1:a}, ${2:b}, ${3:c}, ${4:d}, ${0:t});
+
+#vertex
+snippet vertex
+ vertex(${1:x}, ${2:y}${3:, }${4:u}${5:, }${0:v});
+snippet vertex 3D
+ vertex(${1:x}, ${2:y}, ${3:z}${4:, }${5:u}${6:, }${0:v});
+snippet bezierVertex
+ bezierVertex(${1:cx1}, ${2:cy1}, ${3:cx2}, ${4:cy2}, ${5:x}, ${0:y});
+snippet bezierVertex 3D
+ bezierVertex(${1:cx1}, ${2:cy1}, ${3:cz1}, ${4:cx2}, ${5:cy2}, ${6:cz2}, ${7:x}, ${8:y}, ${0:z});
+snippet curveVertex
+ curveVertex(${1:x}, ${0:y});
+snippet curveVertex 3D
+ curveVertex(${1:x}, ${2:y}, ${0:z});
+
+#stroke
+snippet stroke
+ stroke(${1:value1}, ${2:value2}, ${3:value3}${4:, }${0:alpha});
+snippet strokeWeight
+ strokeWeight(${0:1});
+
+#mouse
+snippet mouseDragged
+ void mouseDragged(){
+ ${0}
+ }
+snippet mouseMoved
+ void mouseMoved(){
+ ${0}
+ }
+snippet mouseReleased
+ void mouseReleased(){
+ ${0}
+ }
+snippet mousePressed
+ void mousePressed(){
+ ${0}
+ }
+
+#key
+snippet keyReleased
+ void keyReleased(){
+ ${0}
+ }
+snippet keyTyped
+ void keyTyped(){
+ ${0}
+ }
+snippet keyPressed
+ void keyPressed(){
+ ${0}
+ }
+
+#file
+snippet loadStrings
+ loadStrings("${0:filename}");
+snippet saveStrings
+ saveStrings(${1:filename}, ${0:strings});
+snippet loadBytes
+ loadBytes("${0:filename}");
+snippet beginRecord
+ beginRecord(${1:renderer}, ${0:filename});
+snippet saveBytes
+ saveBytes(${1:filename}, ${0:bytes});
+snippet createWriter
+ createWriter(${0:filename});
+snippet createReader
+ createReader(${0:filename});
+
+#matrix
+snippet pushMatrix
+ pushMatrix();
+ ${0:};
+ popMatrix();
+
+
+#text
+snippet text data
+ text(${1:data}, ${2:x}, ${3:y}${4:, }${0:z});
+snippet text stringdata
+ text(${1:stringdata}, ${2:x}, ${3:y}, ${4:width}, ${5:height}${6:, }${0:z});
+snippet textSize
+ textSize(${0:size});
+snippet textLeading
+ textLeading(${0:size});
+snippet textWidth
+ textWidth(${0:data});
+snippet font
+ PFont ${1:font};
+ $1 = loadFont("${0:FFScala-32.vlw}");
+#load font
+snippet loadFont
+ ${1:font} = loadFont("${0:FFScala-32.vlw}");
+snippet textFont
+ textFont(${1:font}${2:, }${0:size});
+
+#math
+snippet tan
+ tan(${0:rad});
+snippet atan
+ atan(${0:rad});
+snippet atan2
+ atan2(${0:rad});
+snippet sin
+ sin(${0:rad});
+snippet asin
+ asin(${0:rad});
+snippet cos
+ cos(${0:rad});
+snippet acos
+ acos(${0:rad});
+snippet degrees
+ degrees(${0:rad});
+snippet radians
+ radians(${0:deg});
+snippet randomSseed
+ randomSeed(${0:value});
+snippet random
+ random(${1:value1}${2:, }${0:value2});
+snippet pow
+ pow(${1:num}, ${0:exponent});
+snippet floor
+ floor(${0:value});
+snippet sqrt
+ sqrt(${0:value});
+snippet abs
+ abs(${0:value});
+snippet sq
+ sq(${0:value});
+snippet ceil
+ ceil(${0:value});
+snippet exp
+ exp(${0:value});
+snippet round
+ round(${0:value}};
+snippet min
+ min(${1:value1}, ${2:value2}${3:, }${0:value3});
+snippet max
+ max(${1:value1}, ${2:value2}${3:, }${0:value3});
+snippet max array
+ max(${0:array});
+snippet min array
+ min(${0:array});
+snippet log
+ log(${0:value});
+snippet map
+ map(${1:value}, ${2:low1}, ${4:high1}, ${5:low2}, ${0:high2});
+snippet norm
+ norm(${1:value}, ${2:low}, ${0:high});
+snippet constrain
+ constrain(${1:value}, ${2:min}, ${0:max});
+snippet mag
+ mag(${1:a}, ${2:b}${3:, }${0:c});
+snippet dist
+ dist(${1:x1}, ${2:y1}, ${4:x2}, ${0:y2});
+snippet dist 3D
+ dist(${1:x1}, ${2:y1}, ${3:z1}, ${4:x2}, ${5:y2}, ${0:z2});
+
+#noise math
+snippet noise
+ noise(${1:x}${2:, }${3:y}${4:, }${0:z});
+snippet noiseDetail
+ noiseDetail(${1:octaves}${2:, }${0:falloff});
+snippet noiseSeed
+ noiseSeed(${0:x});
+
+#material
+snippet shininess
+ shininess(${0:shine});
+snippet specular
+ specular(${1:value1}, ${2:value2}, ${3:value3}${4:, }${0:alpha});
+snippet ambient
+ ambient(${1:value1}, ${2:value2}, ${0:value3});
+snippet emissive
+ emissive(${1:value1}, ${2:value2}, ${0:value3});
+
+#light
+snippet diretionalLight
+ directionalLight(${1:v1}, ${2:v2}, ${3:v3}, ${4:nx}, ${5:ny}, ${0:nz});
+snippet pointLight
+ pointLight(${1:v1}, ${2:v2}, ${3:v3}, ${4:nx}, ${5:ny}, ${0:nz});
+snippet lightFalloff
+ lightFalloff(${1:constant}, ${2:linear}, ${0:quadratic});
+snippet normal
+ normal(${1:nx}, ${2:ny}, ${0:nz});
+snippet lightSpecular
+ lightSpecular(${1:v1}, ${2:v2}, ${0:v3});
+snippet ambientLight
+ ambientLight(${1:v1}, ${2:v2}, ${3:v3}${7:, ${4:x}, ${5:y}, ${0:z}});
+snippet spotLight
+ spotLight(${1:v1}, ${2:v2}, ${3:v3}, ${4:x}, ${5:y}, ${6:z}, ${7:nx}, ${8:ny}, ${9:nz}, ${10:angle}, ${0:concentration});
+
+#camera
+snippet camera
+ camera(${1:eyeX}, ${2:eyeY}, ${3:eyeZ}, ${4:centerX}, ${5:centerY}, ${6:centerZ}, ${7:upX}, ${8:upY}, ${0:upZ});
+snippet ortho
+ ortho(${1:left}, ${2:right}, ${3:bottom}, ${4:top}, ${5:near}, ${0:far});
+snippet perspective
+ perspective(${1:fov}, ${2:aspect}, ${3:zNear}, ${0:zFar});
+snippet frustrum
+ frustrum(${1:left}, ${2:right}, ${3:bottom}, ${4:top}, ${5:near}, ${0:far});
+
+#transformations
+snippet rotate
+ rotate${1:X}(${0:angle});
+snippet translate
+ translate(${1:x}, ${2:y}${3:, }${0:z});
+snippet scale size
+ scale(${0:size});
+snippet scale
+ scale(${1:x}, ${2:y}${3:, }${0:z});
+
+#coordinates
+snippet coord
+ ${1:model/screen}${2:X}(${3:x}, ${4:y}, ${0:z});
+
+#effects
+snippet brightness
+ brightness(${0:color});
+snippet lerpColor
+ lerpColor(${1:c1}, ${2:c2}, ${0:amt});
+snippet saturation
+ saturation(${0:color});
+snippet hue
+ hue(${0:color});
+snippet alpha
+ alpha(${0:color});
+snippet tint
+ tint(${1:value1}, ${2:value2}, ${3:value3}${4:, }${0:alpha});
+
+#pixel
+snippet set pixel
+ set(${1:x}, ${2:y}, ${0:color/image});
+snippet pixels
+ pixels[${0:index}]
+snippet get pixel
+ get(${1:x}, ${2:y}${3:, }${4:width}${5:, }${0:height});
+
+#geometric figures
+snippet triangle
+ triangle(${1:x1}, ${2:y1}, ${3:x2}, ${4:y2}, ${5:x3}, ${0:y3});
+snippet line
+ line(${1:x1}, ${2:y1}, ${3:x2}, ${0:y2});
+snippet line 3D
+ line(${1:x1}, ${2:y1}, ${3:z1}, ${4:x2}, ${5:y2}, ${0:z2});
+snippet arc
+ arc(${1:x}, ${2:y}, ${3:width}, ${4:height}, ${5:start}, ${0:stop});
+snippet point
+ point(${1:x}, ${2:y}${3:, }${0:z});
+snippet quad
+ quad(${1:x1}, ${2:y1}, ${3:x2}, ${4:y2}, ${5:x3}, ${6:y3}, ${7:x4}, ${0:y4});
+snippet ellipse
+ ellipse(${1:x}, ${2:y}, ${3:width}, ${0:height});
+snippet rect
+ rect(${1:x}, ${2:y}, ${3:width}, ${0:height});
+snippet box
+ box(${1:width}, ${2:height}, ${0:depth});
+snippet sphere
+ sphere(${0:radius});
+snippet sphereDetails
+ sphereDetail(${0:n});
+
+#array operations
+snippet split
+ split("${1:str}"${2: , }${0:delimiter});
+snippet splitTokens
+ splitTokens(${1:str}${2:, }${0:tokens});
+snippet join
+ join(${1:strgArray}${2: , }${0:seperator});
+snippet shorten
+ shorten(${0:array});
+snippet concat
+ concat(${1:array1}, ${0:array2});
+snippet subset
+ subset(${1:array}, ${0:offset});
+snippet append
+ append(${1:array}, ${0:element});
+snippet reverse
+ reverse(${0:array});
+snippet splice
+ splice(${1:array}, ${2:value/array2}, ${0:index});
+snippet sort
+ sort(${1:dataArray}${2:, }${0:count});
+snippet expand
+ expand(${1:array}${2:, }${0:newSize});
+snippet arrayCopy
+ arrayCopy(${1:src}, ${2:dest}, ${3:, }${0:length});
+
+#string operations
+snippet str
+ str("${0:str}");
+snippet match
+ match(${1:str}, ${0:regexp});
+snippet trim
+ trim(${0:str});
+snippet nf
+ nf(${2:value}, ${3:left}${4:, }${0:right});
+snippet nfs
+ nfs(${2:value}, ${3:left}${4:, }${0:right});
+snippet nfp
+ nfp(${2:value}, ${3:left}${4:, }${0:right});
+snippet nfc
+ nfc(${1:value}${2:, }${0:right});
+
+#convert
+snippet unbinary
+ unbinary("${0:str}"});
+snippet hexadecimal
+ hex(${0:c});
+snippet unhex
+ unhex(${0:c});
+snippet binary
+ binary(${1:value}${2:, }${0:digits});
+
+#image operations
+snippet loadImage
+ loadImage(${0:filename});
+snippet image
+ image(${1:img}, ${2:x}, ${3:y}${4:, }${5:width}${6:, }${0:height});
+snippet copy
+ copy(${1:srcImg}${2:, }${3:x}, ${4:y}, ${5:width}, ${6:height}, ${7:dx}, ${8:dy}, ${9:dwidth}, ${0:dheight});
+
+
+
+#containers
+snippet bg
+ background(${1:value1}, ${2:value2}, ${3:value3}${4:, }${0:alpha});
+snippet pg
+ PGraphics pg;
+ pg = createGraphics(${1:width}, ${2:height}${3:, }${0:applet});
+snippet pimage
+ PImage(${1:width}, ${0:height});
+
+#UTILS
+#fill
+snippet fill
+ fill(${1:value1}, ${2:value2}, ${3:value3}${4:, }${0:alpha});
+#red
+snippet red
+ red(${0:color});
+#green
+snippet green
+ green(${0:color});
+#blue
+snippet blue
+ blue(${0:color});
+#status
+snippet status
+ status(${0:text});
+#param
+snippet param
+ param(${0:s});
+#link
+snippet link
+ link(${1:url}${2:, }${0:target});
+#@param
+snippet @
+ @${1:param/return/private/public} ${1:parameter} ${0:description}
diff --git a/vim/bundle/vim-snippets/snippets/progress.snippets b/vim/bundle/vim-snippets/snippets/progress.snippets
new file mode 100644
index 0000000..dee07a8
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/progress.snippets
@@ -0,0 +1,58 @@
+# Progress/OpenEdge ABL snippets
+# define
+snippet defbuf
+ DEFINE BUFFER b_${1:TableName} FOR $1 ${0}.
+snippet defvar
+ DEFINE VARIABLE ${1:VariableName} AS ${0}.
+snippet nl
+ NO-LOCK
+snippet ne
+ NO-ERROR
+snippet nle
+ NO-LOCK NO-ERROR
+snippet ini
+ INITIAL ${0:?}
+snippet nu
+ NO-UNDO
+snippet err
+ ERROR
+snippet ff
+ FIND FIRST ${1:BufferName}
+ ${2:WHERE $1.${3}} ${0}
+snippet input
+ DEFINE INPUT PARAMETER ${1:ParamName} AS ${0}.
+snippet output
+ DEFINE OUTPUT PARAMETER ${1:ParamName} AS ${0:ParamType}.
+snippet proc
+
+ /******************************************************************************/
+
+ PROCEDURE ${1:ProcName}:
+
+ ${0}
+
+ END PROCEDURE. /* $1 */
+
+ /******************************************************************************/
+
+snippet alert
+ MESSAGE "${1:MessageContent}" ${2:Data} VIEW-AS ALERT-BOX.
+snippet if
+ IF ${1:Condition}
+ THEN ${2:Action}
+ ${3:ELSE ${4:OtherWise}}
+snippet do
+ DO${1: Clauses}:
+ ${0}
+ END.
+# datatypes
+snippet int
+ INTEGER
+snippet char
+ CHARACTER
+snippet log
+ LOGICAL
+snippet dec
+ DECIMAL
+snippet sep
+ /* ------------------------------------------------------------------------- */
diff --git a/vim/bundle/vim-snippets/snippets/puppet.snippets b/vim/bundle/vim-snippets/snippets/puppet.snippets
new file mode 100644
index 0000000..9e9ceeb
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/puppet.snippets
@@ -0,0 +1,269 @@
+# Snippets for use with VIM and http://www.vim.org/scripts/script.php?script_id=2540
+#
+# Please contact R.I.Pienaar <rip@devco.net> for additions and feedback,
+# see it in action @ http://www.devco.net/archives/2009/09/22/vim_and_puppet.php
+
+# Header to match http://docs.puppetlabs.com/guides/style_guide.html#puppet-doc
+snippet classheader
+ # == Class: ${1:`vim_snippets#Filename(expand('%:p:s?.*modules/??:h:h'), 'name')`}
+ #
+ # ${2:Full description of class $1 here}
+ #
+ # === Parameters
+ #
+ # Document parameters here.
+ #
+ # [*parameter1*]
+ # Explanation of what this parameter affects and what it defaults to.
+ # e.g. "Specify one or more upstream ntp servers as an array."
+ #
+ # === Variables
+ #
+ # Here you should define a list of variables that this module would require.
+ #
+ # [*variable1*]
+ # Explanation of how this variable affects the funtion of this class and
+ # if it has a default. e.g. "The parameter enc_ntp_servers must be set by the
+ # External Node Classifier as a comma separated list of hostnames."
+ #
+ # === Examples
+ #
+ # class { '$1':
+ # parameter1 => [ 'just', 'an', 'example', ]
+ # }
+ #
+ # === Authors
+ #
+ # `g:snips_author` <`g:snips_email`>
+ #
+ # === Copyright
+ #
+ # Copyright `strftime("%Y")` `g:snips_author`
+ #
+ class $1 (${3}){
+ ${4}
+ }
+
+snippet defheader
+ # == Define: ${1:`vim_snippets#Filename(expand('%:p:s?.*modules/??:r:s?/manifests/?::?'), 'name')`}
+ #
+ # ${2:Full description of defined resource type $1 here}
+ #
+ # === Parameters
+ #
+ # Document parameters here
+ #
+ # [*namevar*]
+ # If there is a parameter that defaults to the value of the title string
+ # when not explicitly set, you must always say so. This parameter can be
+ # referred to as a "namevar," since it's functionally equivalent to the
+ # namevar of a core resource type.
+ #
+ # [*basedir*]
+ # Description of this variable. For example, "This parameter sets the
+ # base directory for this resource type. It should not contain a trailing
+ # slash."
+ #
+ # === Examples
+ #
+ # Provide some examples on how to use this type:
+ #
+ # $1 { 'namevar':
+ # basedir => '/tmp/src',
+ # }
+ #
+ # === Authors
+ #
+ # `g:snips_author` <`g:snips_email`>
+ #
+ # === Copyright
+ #
+ # Copyright `strftime("%Y")` `g:snips_author`
+ #
+ define $1(${3}) {
+ ${4}
+ }
+
+# Language Constructs
+snippet class
+ class ${1:`vim_snippets#Filename('', 'name')`} {
+ ${0}
+ }
+snippet node
+ node "${1:`vim_snippets#Filename('', 'fqdn')`}" {
+ ${0}
+ }
+snippet case
+ case $${1:variable} {
+ default: { ${0} }
+ }
+snippet ife
+ if $${1:variable} {
+ ${2}
+ } else {
+ ${0}
+ }
+snippet if
+ if $${1:variable} {
+ ${0}
+ }
+snippet ifd
+ if defined(${1:Resource}["${2:name}"]) {
+ ${0}
+ }
+snippet ifnd
+ if !defined(${1:Resource}["${2:name}"]) {
+ ${0}
+ }
+snippet el
+ else {
+ ${0}
+ }
+snippet ?
+ ? {
+ "${1}" => ${0}
+ }
+#
+# blocks etc and general syntax sugar
+snippet [
+ [ ${1} ]
+snippet >
+ ${1} => ${0}
+snippet p:
+ "puppet://puppet/${1:module name}/${0:file name}"
+#
+# Functions
+snippet alert
+ alert("${1:message}")
+snippet crit
+ crit("${1:message}")
+snippet debug
+ debug("${1:message}")
+snippet defined
+ defined(${1:Resource}["${2:name}"])
+snippet emerg
+ emerg("${1:message}")
+snippet extlookup Simple extlookup
+ extlookup("${1:variable}")
+snippet extlookup Extlookup with defaults
+ extlookup("${1:variable}", "${2:default}")
+snippet extlookup Extlookup with defaults and custom data file
+ extlookup("${1:variable}", "${2:default}", "${3:data source}")
+snippet fail
+ fail("${1:message}")
+snippet info
+ info("${1:message}")
+snippet inline_template
+ inline_template("<%= ${1} %>")
+snippet notice
+ notice("${1:message}")
+snippet realize
+ realize(${1:Resource}[${2:name}])
+snippet regsubst
+ regsubst(${1:hay stack}, ${2:needle}, "${3:replacement}")
+snippet inc
+ include ${1:classname}
+snippet split
+ split(${1:hay stack}, "${2:patten}")
+snippet versioncmp
+ versioncmp("${1:version}", "${2:version}")
+snippet warning
+ warning("${1:message}")
+#
+# Types
+snippet cron
+ cron { "${1:name}":
+ command => "${2}",
+ user => "${3:root}",
+ ${4} => ${0},
+ }
+
+snippet exec
+ exec { "${1:name}":
+ command => "${2:$1}",
+ user => "${3:root}",
+ ${4} => ${0},
+ }
+
+snippet user
+ user { "${1:user}":
+ ensure => present,
+ comment => "${2:$1}",
+ managehome => true,
+ home => "${0:/home/$1}",
+ }
+
+snippet group
+ group { "${1:group}":
+ ensure => ${0:present},
+ }
+
+snippet host
+ host { "${1:hostname}":
+ ip => ${0:127.0.0.1},
+ }
+
+snippet mailalias
+ mailalias { "${1:localpart}":
+ recipient => "${0:recipient}",
+ }
+
+snippet mount
+ mount { "${1:destination path}":
+ ensure => ${2:mounted},
+ device => "${0:device name or path}",
+ }
+
+snippet package
+ package { "${1:package name}":
+ ensure => ${0:present},
+ }
+
+snippet yumrepo
+ yumrepo { "${1:repo name}":
+ descr => "${2:$1}",
+ enabled => ${0:1},
+ }
+
+snippet define
+ define ${1} (${2}) {
+ ${0}
+ }
+
+snippet service
+ service { "${1:service}" :
+ ensure => running,
+ enable => true,
+ require => [ Package["${2:package}"], File["${3:file}"], ],
+ subscribe => [ File["${4:configfile1}"], File["${5:configfile2}"], Package["${6:package}"], ],
+ }
+
+snippet file
+ file { "${1:filename}" :
+ ensure => ${2:present},
+ owner => "${3:root}",
+ group => "${4:root}",
+ mode => "${5:0644}",
+ source => "puppet:///modules/${6:module}/${7:source}",
+ content => template("${8:module}/${9:template}"),
+ alias => "${10:alias}",
+ require => [ Package["${11:package}"], File["${12:file}"], ],
+ }
+
+snippet archive
+ archive { "${1:filename}" :
+ ensure => ${2:present},
+ url => "http://${3:url}",
+ extension => "${4:tgz}",
+ target => "${5:target}",
+ checksum => ${6:false},
+ src_target => "${7:/tmp}",
+ }
+
+snippet firewall
+ firewall { "${1:comment}" :
+ proto => ${2:tcp},
+ action => ${3:accept},
+ port => ${4},
+ }
+
diff --git a/vim/bundle/vim-snippets/snippets/python.snippets b/vim/bundle/vim-snippets/snippets/python.snippets
new file mode 100644
index 0000000..0f68acb
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/python.snippets
@@ -0,0 +1,242 @@
+snippet #!
+ #!/usr/bin/env python
+ # -*- coding: utf-8 -*-
+snippet #!3
+ #!/usr/bin/env python3
+ # -*- coding: utf-8 -*-
+snippet imp
+ import ${0:module}
+snippet uni
+ def __unicode__(self):
+ ${0:representation}
+snippet from
+ from ${1:package} import ${0:module}
+# Module Docstring
+snippet docs
+ """
+ File: ${1:`vim_snippets#Filename('$1.py', 'foo.py')`}
+ Author: `g:snips_author`
+ Email: `g:snips_email`
+ Github: `g:snips_github`
+ Description: ${0}
+ """
+
+snippet wh
+ while ${1:condition}:
+ ${0}
+# dowh - does the same as do...while in other languages
+snippet dowh
+ while True:
+ ${1}
+ if ${0:condition}:
+ break
+snippet with
+ with ${1:expr} as ${2:var}:
+ ${0}
+# New Class
+snippet cl
+ class ${1:ClassName}(${2:object}):
+ """${3:docstring for $1}"""
+ def __init__(self, ${4:arg}):
+ ${5:super($1, self).__init__()}
+ self.$4 = $4
+ ${0}
+# New Function
+snippet def
+ def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
+ """${3:docstring for $1}"""
+ ${0}
+snippet deff
+ def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
+ ${0}
+# New Method
+snippet defm
+ def ${1:mname}(self, ${2:arg}):
+ ${0}
+# New Property
+snippet property
+ def ${1:foo}():
+ doc = "${2:The $1 property.}"
+ def fget(self):
+ ${3:return self._$1}
+ def fset(self, value):
+ ${4:self._$1 = value}
+ def fdel(self):
+ ${0:del self._$1}
+ return locals()
+ $1 = property(**$1())
+# Ifs
+snippet if
+ if ${1:condition}:
+ ${0}
+snippet el
+ else:
+ ${0}
+snippet ei
+ elif ${1:condition}:
+ ${0}
+# For
+snippet for
+ for ${1:item} in ${2:items}:
+ ${0}
+# Encodes
+snippet cutf8
+ # -*- coding: utf-8 -*-
+snippet clatin1
+ # -*- coding: latin-1 -*-
+snippet cascii
+ # -*- coding: ascii -*-
+# Lambda
+snippet ld
+ ${1:var} = lambda ${2:vars} : ${0:action}
+snippet .
+ self.
+snippet try Try/Except
+ try:
+ ${1}
+ except ${2:Exception}, ${3:e}:
+ ${0:raise $3}
+snippet try Try/Except/Else
+ try:
+ ${1}
+ except ${2:Exception}, ${3:e}:
+ ${4:raise $3}
+ else:
+ ${0}
+snippet try Try/Except/Finally
+ try:
+ ${1}
+ except ${2:Exception}, ${3:e}:
+ ${4:raise $3}
+ finally:
+ ${0}
+snippet try Try/Except/Else/Finally
+ try:
+ ${1}
+ except ${2:Exception}, ${3:e}:
+ ${4:raise $3}
+ else:
+ ${5}
+ finally:
+ ${0}
+# if __name__ == '__main__':
+snippet ifmain
+ if __name__ == '__main__':
+ ${0:main()}
+# __magic__
+snippet _
+ __${1:init}__
+# python debugger (pdb)
+snippet pdb
+ import pdb
+ pdb.set_trace()
+# bpython debugger (bpdb)
+snippet bpdb
+ import bpdb
+ bpdb.set_trace()
+# ipython debugger (ipdb)
+snippet ipdb
+ import ipdb
+ ipdb.set_trace()
+# embed ipython itself
+snippet iem
+ import IPython
+ IPython.embed()
+# ipython debugger (pdbbb)
+snippet pdbbb
+ import pdbpp
+ pdbpp.set_trace()
+# remote python debugger (rpdb)
+snippet rpdb
+ import rpdb
+ rpdb.set_trace()
+# ptpython
+snippet ptpython
+ from ptpython.repl import embed
+ embed(globals(), locals(), vi_mode=${1:False}, history_filename=${2:None})
+# python console debugger (pudb)
+snippet pudb
+ import pudb
+ pudb.set_trace()
+# pdb in nosetests
+snippet nosetrace
+ from nose.tools import set_trace
+ set_trace()
+snippet pprint
+ import pprint
+ pprint.pprint(${1})
+snippet "
+ """${0:doc}
+ """
+# assertions
+snippet a=
+ self.assertEqual(${0}, ${1})
+# test function/method
+snippet test
+ def test_${1:description}(${2:`indent('.') ? 'self' : ''`}):
+ ${0}
+# test case
+snippet testcase
+ class ${1:ExampleCase}(unittest.TestCase):
+
+ def test_${2:description}(self):
+ ${0}
+snippet fut
+ from __future__ import ${0}
+#getopt
+snippet getopt
+ try:
+ # Short option syntax: "hv:"
+ # Long option syntax: "help" or "verbose="
+ opts, args = getopt.getopt(sys.argv[1:], "${1:short_options}", [${2:long_options}])
+
+ except getopt.GetoptError, err:
+ # Print debug info
+ print str(err)
+ ${3:error_action}
+
+ for option, argument in opts:
+ if option in ("-h", "--help"):
+ ${0}
+ elif option in ("-v", "--verbose"):
+ verbose = argument
+# logging
+# glog = get log
+snippet glog
+ import logging
+ logger = logging.getLogger(${0:__name__})
+snippet le
+ logger.error(${0:msg})
+# conflict with lambda=ld, therefor we change into Logger.debuG
+snippet lg
+ logger.debug(${0:msg})
+snippet lw
+ logger.warning(${0:msg})
+snippet lc
+ logger.critical(${0:msg})
+snippet li
+ logger.info(${0:msg})
+snippet epydoc
+ """${1:Description}
+
+ @param ${2:param}: ${3: Description}
+ @type $2: ${4: Type}
+
+ @return: ${5: Description}
+ @rtype : ${6: Type}
+
+ @raise e: ${0: Description}
+ """
+snippet dol
+ def ${1:__init__}(self, *args, **kwargs):
+ super(${0:ClassName}, self).$1(*args, **kwargs)
+snippet kwg
+ self.${1:var_name} = kwargs.get('$1', ${2:None})
+snippet lkwg
+ ${1:var_name} = kwargs.get('$1', ${2:None})
+snippet args
+ *args${1:,}${0}
+snippet kwargs
+ **kwargs${1:,}${0}
+snippet akw
+ *args, **kwargs${1:,}${0}
diff --git a/vim/bundle/vim-snippets/snippets/r.snippets b/vim/bundle/vim-snippets/snippets/r.snippets
new file mode 100644
index 0000000..7bdeeec
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/r.snippets
@@ -0,0 +1,131 @@
+snippet #!
+ #!/usr/bin/env Rscript
+
+# includes
+snippet lib
+ library(${0:package})
+snippet req
+ require(${0:package})
+snippet source
+ source('${0:file}')
+
+# conditionals
+snippet if
+ if (${1:condition}) {
+ ${0}
+ }
+snippet el
+ else {
+ ${0}
+ }
+snippet ei
+ else if (${1:condition}) {
+ ${0}
+ }
+
+# loops
+snippet wh
+ while(${1}) {
+ ${2}
+ }
+snippet for
+ for (${1:item} in ${2:list}) {
+ ${3}
+ }
+
+# functions
+snippet fun
+ ${1:name} <- function (${2:variables}) {
+ ${0}
+ }
+snippet ret
+ return(${0})
+
+# dataframes, lists, etc
+snippet df
+ ${1:name}[${2:rows}, ${0:cols}]
+snippet c
+ c(${0:items})
+snippet li
+ list(${0:items})
+snippet mat
+ matrix(${1:data}, nrow = ${2:rows}, ncol = ${0:cols})
+
+# apply functions
+snippet apply
+ apply(${1:array}, ${2:margin}, ${0:function})
+snippet lapply
+ lapply(${1:list}, ${0:function})
+snippet sapply
+ lapply(${1:list}, ${0:function})
+snippet vapply
+ vapply(${1:list}, ${2:function}, ${0:type})
+snippet mapply
+ mapply(${1:function}, ${0:...})
+snippet tapply
+ tapply(${1:vector}, ${2:index}, ${0:function})
+snippet rapply
+ rapply(${1:list}, ${0:function})
+
+# plyr functions
+snippet dd
+ ddply(${1:frame}, ${2:variables}, ${0:function})
+snippet dl
+ dlply(${1:frame}, ${2:variables}, ${0:function})
+snippet da
+ daply(${1:frame}, ${2:variables}, ${0:function})
+snippet d_
+ d_ply(${1:frame}, ${2:variables}, ${0:function})
+
+snippet ad
+ adply(${1:array}, ${2:margin}, ${0:function})
+snippet al
+ alply(${1:array}, ${2:margin}, ${0:function})
+snippet aa
+ aaply(${1:array}, ${2:margin}, ${0:function})
+snippet a_
+ a_ply(${1:array}, ${2:margin}, ${0:function})
+
+snippet ld
+ ldply(${1:list}, ${0:function})
+snippet ll
+ llply(${1:list}, ${0:function})
+snippet la
+ laply(${1:list}, ${0:function})
+snippet l_
+ l_ply(${1:list}, ${0:function})
+
+snippet md
+ mdply(${1:matrix}, ${0:function})
+snippet ml
+ mlply(${1:matrix}, ${0:function})
+snippet ma
+ maply(${1:matrix}, ${0:function})
+snippet m_
+ m_ply(${1:matrix}, ${0:function})
+
+# plot functions
+snippet pl
+ plot(${1:x}, ${0:y})
+snippet ggp
+ ggplot(${1:data}, aes(${0:aesthetics}))
+snippet img
+ ${1:(jpeg,bmp,png,tiff)}(filename = '${2:filename}', width = ${3}, height = ${4}, unit = '${5}')
+ ${0:plot}
+ dev.off()
+
+# statistical test functions
+snippet fis
+ fisher.test(${1:x}, ${0:y})
+snippet chi
+ chisq.test(${1:x}, ${0:y})
+snippet tt
+ t.test(${1:x}, ${0:y})
+snippet wil
+ wilcox.test(${1:x}, ${0:y})
+snippet cor
+ cor.test(${1:x}, ${0:y})
+snippet fte
+ var.test(${1:x}, ${0:y})
+snippet kvt
+ kv.test(${1:x}, ${0:y})
diff --git a/vim/bundle/vim-snippets/snippets/rails.snippets b/vim/bundle/vim-snippets/snippets/rails.snippets
new file mode 100644
index 0000000..e834222
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/rails.snippets
@@ -0,0 +1,490 @@
+snippet art
+ assert_redirected_to ${1:action}: '${2:index}'
+snippet artnp
+ assert_redirected_to ${1:parent}_${2:child}_path(${3:@$1}, ${0:@$2})
+snippet artnpp
+ assert_redirected_to ${1:parent}_${2:child}_path(${0:@$1})
+snippet artp
+ assert_redirected_to ${1:model}_path(${0:@$1})
+snippet artpp
+ assert_redirected_to ${0:model}s_path
+snippet asd
+ assert_difference '${1:Model}.${2:count}', ${3:1} do
+ ${0}
+ end
+snippet asnd
+ assert_no_difference '${1:Model}.${2:count}' do
+ ${0}
+ end
+snippet asre
+ assert_response :${1:success}, @response.body
+snippet asrj
+ assert_rjs :${1:replace}, '${0:dom id}'
+snippet ass assert_select(..)
+ assert_select '${1:path}', ${2:text}: '${3:inner_html}' ${4:do}
+ ${0}
+ end
+snippet ba
+ before_action :${0:method}
+snippet bf
+ before_filter :${0:method}
+snippet bt
+ belongs_to :${0:association}
+snippet btp
+ belongs_to :${1:association}, polymorphic: true
+snippet crw
+ cattr_accessor :${0:attr_names}
+snippet defcreate
+ def create
+ @${1:model_class_name} = ${2:ModelClassName}.new($1_params)
+
+ respond_to do |format|
+ if @$1.save
+ flash[:notice] = '$2 was successfully created.'
+ format.html { redirect_to(@$1) }
+ format.xml { render xml: @$1, status: :created, location: @$1 }
+ else
+ format.html { render action: 'new' }
+ format.xml { render xml: @$1.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+snippet defdestroy
+ def destroy
+ @${1:model_class_name} = ${2:ModelClassName}.find(params[:id])
+ @$1.destroy
+
+ respond_to do |format|
+ format.html { redirect_to($1s_url) }
+ format.xml { head :ok }
+ end
+ end
+snippet defedit
+ def edit
+ @${1:model_class_name} = ${0:ModelClassName}.find(params[:id])
+ end
+snippet defindex
+ def index
+ @${1:model_class_name} = ${2:ModelClassName}.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.xml { render xml: @$1s }
+ end
+ end
+snippet defnew
+ def new
+ @${1:model_class_name} = ${2:ModelClassName}.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render xml: @$1 }
+ end
+ end
+snippet defshow
+ def show
+ @${1:model_class_name} = ${2:ModelClassName}.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render xml: @$1 }
+ end
+ end
+snippet defupdate
+ def update
+ @${1:model_class_name} = ${2:ModelClassName}.find(params[:id])
+
+ respond_to do |format|
+ if @$1.update($1_params)
+ flash[:notice] = '$2 was successfully updated.'
+ format.html { redirect_to(@$1) }
+ format.xml { head :ok }
+ else
+ format.html { render action: 'edit' }
+ format.xml { render xml: @$1.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+snippet defparams
+ def ${1:model_class_name}_params
+ params.require(:$1).permit()
+ end
+snippet dele delegate .. to
+ delegate :${1:methods}, to: :${0:object}
+snippet dele delegate .. to .. prefix .. allow_nil
+ delegate :${1:methods}, to: :${2:object}, prefix: :${3:prefix}, allow_nil: ${0:allow_nil}
+snippet amc
+ alias_method_chain :${1:method_name}, :${0:feature}
+snippet flash
+ flash[:${1:notice}] = '${0}'
+snippet habtm
+ has_and_belongs_to_many :${1:object}, join_table: '${2:table_name}', foreign_key: '${3}_id'
+snippet hm
+ has_many :${0:object}
+snippet hmd
+ has_many :${1:other}s, class_name: '${2:$1}', foreign_key: '${3:$1}_id', dependent: :destroy
+snippet hmt
+ has_many :${1:object}, through: :${0:object}
+snippet ho
+ has_one :${0:object}
+snippet hod
+ has_one :${1:object}, dependent: :${0:destroy}
+snippet i18
+ I18n.t('${1:type.key}')
+snippet ist
+ <%= image_submit_tag('${1:agree.png}', id: '${2:id}'${0}) %>
+snippet log
+ Rails.logger.${1:debug} ${0}
+snippet log2
+ RAILS_DEFAULT_LOGGER.${1:debug} ${0}
+snippet logd
+ logger.debug { '${1:message}' }
+snippet loge
+ logger.error { '${1:message}' }
+snippet logf
+ logger.fatal { '${1:message}' }
+snippet logi
+ logger.info { '${1:message}' }
+snippet logw
+ logger.warn { '${1:message}' }
+snippet mapc
+ ${1:map}.${2:connect} '${0:controller/:action/:id}'
+snippet mapca
+ ${1:map}.catch_all '*${2:anything}', controller: '${3:default}', action: '${4:error}'
+snippet mapr
+ ${1:map}.resource :${0:resource}
+snippet maprs
+ ${1:map}.resources :${0:resource}
+snippet mapwo
+ ${1:map}.with_options ${2:controller}: '${3:thing}' do |$3|
+ ${0}
+ end
+
+###############################
+# model callback snippets #
+###############################
+
+# before callback
+snippet mbv
+ before_validation :${0:method}
+snippet mbc
+ before_create :${0:method}
+snippet mbu
+ before_update :${0:method}
+snippet mbs
+ before_save :${0:method}
+snippet mbd
+ before_destroy :${0:method}
+
+# after callback
+snippet mav
+ after_validation :${0:method}
+snippet maf
+ after_find :${0:method}
+snippet mat
+ after_touch :${0:method}
+snippet macr
+ after_create :${0:method}
+snippet mau
+ after_update :${0:method}
+snippet mas
+ after_save :${0:method}
+snippet mad
+ after_destroy :${0:method}
+
+# around callback
+snippet marc
+ around_create :${0:method}
+snippet maru
+ around_update :${0:method}
+snippet mars
+ around_save :${0:method}
+snippet mard
+ around_destroy :${0:method}
+
+snippet mcht
+ change_table :${1:table_name} do |t|
+ ${0}
+ end
+snippet mp
+ map(&:${0:id})
+snippet mrw
+ mattr_accessor :${0:attr_names}
+snippet oa
+ order('${0:field}')
+snippet od
+ order('${0:field} DESC')
+snippet pa
+ params[:${1:id}]
+snippet ra
+ render action: '${0:action}'
+snippet ral
+ render action: '${1:action}', layout: '${0:layoutname}'
+snippet rest
+ respond_to do |format|
+ format.${1:html} { ${0} }
+ end
+snippet rf
+ render file: '${0:filepath}'
+snippet rfu
+ render file: '${1:filepath}', use_full_path: ${0:false}
+snippet ri
+ render inline: "${0:<%= 'hello' %>}"
+snippet ril
+ render inline: "${1:<%= 'hello' %>}", locals: { ${2:name}: '${3:value}'${0} }
+snippet rit
+ render inline: "${1:<%= 'hello' %>}", type: ${0::rxml}
+snippet rjson
+ render json: '${0:text to render}'
+snippet rl
+ render layout: '${0:layoutname}'
+snippet rn
+ render nothing: ${0:true}
+snippet rns
+ render nothing: ${1:true}, status: ${0:401}
+snippet rp
+ render partial: '${0:item}'
+snippet rpc
+ render partial: '${1:item}', collection: ${0:@$1s}
+snippet rpl
+ render partial: '${1:item}', locals: { ${2:$1}: ${0:@$1} }
+snippet rpo
+ render partial: '${1:item}', object: ${0:@$1}
+snippet rps
+ render partial: '${1:item}', status: ${0:500}
+snippet rt
+ render text: '${0:text to render}'
+snippet rtl
+ render text: '${1:text to render}', layout: '${0:layoutname}'
+snippet rtlt
+ render text: '${1:text to render}', layout: ${0:true}
+snippet rts
+ render text: '${1:text to render}', status: ${0:401}
+snippet ru
+ render :update do |${1:page}|
+ $1.${0}
+ end
+snippet rxml
+ render xml: '${0:text to render}'
+snippet sc
+ scope :${1:name}, -> { where(${2:field}: ${0:value}) }
+snippet sl
+ scope :${1:name}, lambda do |${2:value}|
+ where('${3:field = ?}', ${0:value})
+ end
+snippet sha1
+ Digest::SHA1.hexdigest(${0:string})
+snippet sweeper
+ class ${1:ModelClassName}Sweeper < ActionController::Caching::Sweeper
+ observe $1
+
+ def after_save(${0:model_class_name})
+ expire_cache($2)
+ end
+
+ def after_destroy($2)
+ expire_cache($2)
+ end
+
+ def expire_cache($2)
+ expire_page
+ end
+ end
+snippet va validates_associated
+ validates_associated :${0:attribute}
+snippet va validates .., acceptance: true
+ validates :${0:terms}, acceptance: true
+snippet vc
+ validates :${0:attribute}, confirmation: true
+snippet ve
+ validates :${1:attribute}, exclusion: { in: ${0:%w( mov avi )} }
+snippet vf
+ validates :${1:attribute}, format: { with: /${0:regex}/ }
+snippet vi
+ validates :${1:attribute}, inclusion: { in: %w(${0: mov avi }) }
+snippet vl
+ validates :${1:attribute}, length: { in: ${2:3}..${0:20} }
+snippet vn
+ validates :${0:attribute}, numericality: true
+snippet vp
+ validates :${0:attribute}, presence: true
+snippet vu
+ validates :${0:attribute}, uniqueness: true
+snippet format
+ format.${1:js|xml|html} { ${0} }
+snippet wc
+ where(${1:'conditions'}${0:, bind_var})
+snippet wf
+ where(${1:field}: ${0:value})
+snippet xdelete
+ xhr :delete, :${1:destroy}, id: ${2:1}
+snippet xget
+ xhr :get, :${1:show}, id: ${2:1}
+snippet xpost
+ xhr :post, :${1:create}, ${2:object}: ${3:object}
+snippet xput
+ xhr :put, :${1:update}, id: ${2:1}, ${3:object}: ${4:object}
+snippet test
+ test 'should ${1:do something}' do
+ ${0}
+ end
+###########################
+# migrations snippets #
+###########################
+snippet mac
+ add_column :${1:table_name}, :${2:column_name}, :${0:data_type}
+snippet mai
+ add_index :${1:table_name}, :${0:column_name}
+snippet mrc
+ remove_column :${1:table_name}, :${0:column_name}
+snippet mrnc
+ rename_column :${1:table_name}, :${2:old_column_name}, :${0:new_column_name}
+snippet mcc
+ change_column :${1:table}, :${2:column}, :${0:type}
+snippet mnc
+ t.${1:string} :${2:title}${3:, null: false}
+snippet mct
+ create_table :${1:table_name} do |t|
+ ${0}
+ end
+snippet migration class .. < ActiveRecord::Migration .. def up .. def down .. end
+ class `substitute( substitute(vim_snippets#Filename(), '^\d\+_', '',''), '\(_\|^\)\(.\)', '\u\2', 'g')` < ActiveRecord::Migration
+ def up
+ ${0}
+ end
+
+ def down
+ end
+ end
+snippet migration class .. < ActiveRecord::Migration .. def change .. end
+ class `substitute( substitute(vim_snippets#Filename(), '^\d\+_', '',''), '\(_\|^\)\(.\)', '\u\2', 'g')` < ActiveRecord::Migration
+ def change
+ ${0}
+ end
+ end
+snippet trc
+ t.remove :${0:column}
+snippet tre
+ t.rename :${1:old_column_name}, :${2:new_column_name}
+ ${0}
+snippet tref
+ t.references :${0:model}
+snippet tcb
+ t.boolean :${1:title}
+ ${0}
+snippet tcbi
+ t.binary :${1:title}, limit: ${2:2}.megabytes
+ ${0}
+snippet tcd
+ t.decimal :${1:title}, precision: ${2:10}, scale: ${3:2}
+ ${0}
+snippet tcda
+ t.date :${1:title}
+ ${0}
+snippet tcdt
+ t.datetime :${1:title}
+ ${0}
+snippet tcf
+ t.float :${1:title}
+ ${0}
+snippet tch
+ t.change :${1:name}, :${2:string}, ${3:limit}: ${4:80}
+ ${0}
+snippet tci
+ t.integer :${1:title}
+ ${0}
+snippet tcl
+ t.integer :lock_version, null: false, default: 0
+ ${0}
+snippet tcr
+ t.references :${1:taggable}, polymorphic: { default: '${2:Photo}' }
+ ${0}
+snippet tcs
+ t.string :${1:title}
+ ${0}
+snippet tct
+ t.text :${1:title}
+ ${0}
+snippet tcti
+ t.time :${1:title}
+ ${0}
+snippet tcts
+ t.timestamp :${1:title}
+ ${0}
+snippet tctss
+ t.timestamps
+ ${0}
+##########################
+# Rspec snippets #
+##########################
+#ShouldaMatchers#ActionController
+snippet isfp
+ it { should filter_param :${0:key} }
+snippet isrt
+ it { should redirect_to ${0:url} }
+snippet isrtp
+ it { should render_template ${0} }
+snippet isrwl
+ it { should render_with_layout ${0} }
+snippet isrf
+ it { should rescue_from ${0:exception} }
+snippet isrw
+ it { should respond_with ${0:status} }
+snippet isr
+ it { should route(:${1:method}, '${0:path}') }
+snippet isss
+ it { should set_session :${0:key} }
+snippet issf
+ it { should set_the_flash('${0}') }
+#ShouldaMatchers#ActiveModel
+snippet isama
+ it { should allow_mass_assignment_of :${0} }
+snippet isav
+ it { should allow_value(${1}).for :${0} }
+snippet isee
+ it { should ensure_exclusion_of :${0} }
+snippet isei
+ it { should ensure_inclusion_of :${0} }
+snippet isel
+ it { should ensure_length_of :${0} }
+snippet isva
+ it { should validate_acceptance_of :${0} }
+snippet isvc
+ it { should validate_confirmation_of :${0} }
+snippet isvn
+ it { should validate_numericality_of :${0} }
+snippet isvp
+ it { should validate_presence_of :${0} }
+snippet isvu
+ it { should validate_uniqueness_of :${0} }
+#ShouldaMatchers#ActiveRecord
+snippet isana
+ it { should accept_nested_attributes_for :${0} }
+snippet isbt
+ it { should belong_to :${0} }
+snippet isbtcc
+ it { should belong_to(:${1}).counter_cache ${0:true} }
+snippet ishbtm
+ it { should have_and_belong_to_many :${0} }
+snippet isbv
+ it { should be_valid }
+snippet ishc
+ it { should have_db_column :${0} }
+snippet ishi
+ it { should have_db_index :${0} }
+snippet ishm
+ it { should have_many :${0} }
+snippet ishmt
+ it { should have_many(:${1}).through :${0} }
+snippet isho
+ it { should have_one :${0} }
+snippet ishro
+ it { should have_readonly_attribute :${0} }
+snippet iss
+ it { should serialize :${0} }
+snippet isres
+ it { should respond_to :${0} }
+snippet isresw
+ it { should respond_to(:${1}).with(${0}).arguments }
+snippet super_call
+ ${1:super_class}.instance_method(:${0:method}).bind(self).call
diff --git a/vim/bundle/vim-snippets/snippets/rst.snippets b/vim/bundle/vim-snippets/snippets/rst.snippets
new file mode 100644
index 0000000..b185245
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/rst.snippets
@@ -0,0 +1,98 @@
+# rst
+
+snippet :
+ :${1:field name}: ${0:field body}
+snippet *
+ *${1:Emphasis}* ${0}
+snippet **
+ **${1:Strong emphasis}** ${0}
+snippet _
+ \`${1:hyperlink-name}\`_
+ .. _\`$1\`: ${0:link-block}
+snippet =
+ ${1:Title}
+ =====${2:=}
+ ${0}
+snippet -
+ ${1:Title}
+ -----${2:-}
+ ${0}
+#some directive
+snippet img:
+ .. |${0:alias}| image:: ${1:img}
+snippet fig:
+ .. figure:: ${1:img}
+ :alt: ${0:alter text}
+
+ $2
+snippet cont:
+ .. contents::
+ ${0:content}
+snippet code:
+ .. code:: ${1:type}
+
+ ${0:write some code}
+snippet tip:
+ .. tip::
+ ${0:my tips}
+snippet not:
+ .. note::
+ ${0:my notes}
+snippet war:
+ .. warning::
+ ${0:attention!}
+snippet imp:
+ .. important::
+ ${0:this is importatnt}
+snippet att:
+ .. attention::
+ ${0:hey!}
+snippet dan:
+ .. danger::
+ ${0:ah!}
+snippet err:
+ .. error::
+ ${0:Error occur}
+snippet cau:
+ .. caution::
+ ${0:Watch out!}
+#Sphinx only
+snippet sid:
+ .. sidebar:: ${1:Title}
+
+ ${0}
+snippet tod:
+ .. todo::
+ ${0}
+snippet lis:
+ .. list-table:: ${0:Title}
+ :header-rows: 1
+ :stub-columns: 1
+
+ * - x1,y1
+ - x2,y1
+ - x3,y1
+ * - x1,y2
+ - x2,y2
+ - x3,y2
+ * - x1,y3
+ - x2,y3
+ - x3,y3
+
+snippet toc:
+ .. toctree::
+ :maxdepth: 2
+
+ ${0}
+snippet dow:
+ :download:`${0:text} <${1:path}>`
+snippet ref:
+ :ref:`${0:text} <${1:path}>`
+snippet doc:
+ :doc:`${0:text} <${1:path}>`
+# CJK optimize, CJK has no space between charaters
+snippet *c
+ \ *${1:Emphasis}*\ ${0}
+snippet **c
+ \ **${1:Strong emphasis}**\ ${0}
+
diff --git a/vim/bundle/vim-snippets/snippets/ruby.snippets b/vim/bundle/vim-snippets/snippets/ruby.snippets
new file mode 100644
index 0000000..772f464
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/ruby.snippets
@@ -0,0 +1,731 @@
+snippet enc
+ # encoding: utf-8
+snippet frozen
+ # frozen_string_literal: true
+snippet #!
+ #!/usr/bin/env ruby
+# New Block
+snippet =b
+ =begin rdoc
+ ${0}
+ =end
+snippet prot
+ protected
+
+ ${0}
+snippet priv
+ private
+
+ ${0}
+snippet y
+ :yields: ${0:arguments}
+snippet rb
+ #!/usr/bin/env ruby -wKU
+snippet beg
+ begin
+ ${0}
+ rescue ${1:Exception} => ${2:e}
+ end
+snippet req require
+ require '${1}'
+snippet reqr
+ require_relative '${1}'
+snippet #
+ # =>
+snippet case
+ case ${1:object}
+ when ${2:condition}
+ ${0}
+ end
+snippet when
+ when ${1:condition}
+ ${0}
+snippet def
+ def ${1:method_name}
+ ${0}
+ end
+snippet deft
+ def test_${1:case_name}
+ ${0}
+ end
+snippet descendants
+ class Class
+ def descendants
+ ObjectSpace.each_object(::Class).select { |klass| klass < self }
+ end
+ end
+snippet if
+ if ${1:condition}
+ ${0}
+ end
+snippet ife
+ if ${1:condition}
+ ${2}
+ else
+ ${0}
+ end
+snippet eif
+ elsif ${1:condition}
+ ${0}
+snippet ifee
+ if ${1:condition}
+ $2
+ elsif ${3:condition}
+ $4
+ else
+ $0
+ end
+snippet unless
+ unless ${1:condition}
+ ${0}
+ end
+snippet unlesse
+ unless ${1:condition}
+ $2
+ else
+ $0
+ end
+snippet unlesee
+ unless ${1:condition}
+ $2
+ elsif ${3:condition}
+ $4
+ else
+ $0
+ end
+snippet wh
+ while ${1:condition}
+ ${0}
+ end
+snippet for
+ for ${1:e} in ${2:c}
+ ${0}
+ end
+snippet until
+ until ${1:condition}
+ ${0}
+ end
+snippet cla class .. end
+ class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
+ ${0}
+ end
+snippet clai class .. initialize .. end
+ class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
+ def initialize(${2:args})
+ ${0}
+ end
+ end
+snippet cla< class .. < ParentClass .. initialize .. end
+ class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} < ${2:ParentClass}
+ def initialize(${3:args})
+ ${0}
+ end
+ end
+snippet blankslate class BlankSlate .. initialize .. end
+ class ${0:BlankSlate}
+ instance_methods.each { |meth| undef_method(meth) unless meth =~ /\A__/ }
+ end
+snippet claself class << self .. end
+ class << ${1:self}
+ ${0}
+ end
+# class .. < DelegateClass .. initialize .. end
+snippet cla-
+ class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} < DelegateClass(${2:ParentClass})
+ def initialize(${3:args})
+ super(${4:del_obj})
+
+ ${0}
+ end
+ end
+snippet mod module .. end
+ module ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
+ ${0}
+ end
+snippet mod module .. ClassMethods .. end
+ module ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}
+ module ClassMethods
+ ${0}
+ end
+
+ module InstanceMethods
+
+ end
+
+ def self.included(receiver)
+ receiver.extend ClassMethods
+ receiver.send :include, InstanceMethods
+ end
+ end
+# attr_reader
+snippet r
+ attr_reader :${0:attr_names}
+# attr_writer
+snippet w
+ attr_writer :${0:attr_names}
+# attr_accessor
+snippet rw
+ attr_accessor :${0:attr_names}
+snippet atp
+ attr_protected :${0:attr_names}
+snippet ata
+ attr_accessible :${0:attr_names}
+snippet ana
+ accepts_nested_attributes_for :${0:association}
+# ivc == instance variable cache
+snippet ivc
+ @${1:variable_name} ||= ${0:cached_value}
+# include Enumerable
+snippet Enum
+ include Enumerable
+
+ def each(&block)
+ ${0}
+ end
+# include Comparable
+snippet Comp
+ include Comparable
+
+ def <=>(other)
+ ${0}
+ end
+# extend Forwardable
+snippet Forw-
+ extend Forwardable
+# def self
+snippet defs
+ def self.${1:class_method_name}
+ ${0}
+ end
+# def initialize
+snippet definit
+ def initialize(${1:args})
+ ${0}
+ end
+# def method_missing
+snippet defmm
+ def method_missing(meth, *args, &blk)
+ ${0}
+ end
+snippet defd
+ def_delegator :${1:@del_obj}, :${2:del_meth}, :${0:new_name}
+snippet defds
+ def_delegators :${1:@del_obj}, :${0:del_methods}
+snippet am
+ alias_method :${1:new_name}, :${0:old_name}
+snippet app
+ if __FILE__ == $PROGRAM_NAME
+ ${0}
+ end
+# usage_if()
+snippet usai
+ if ARGV.${1}
+ abort "Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}"${0}
+ end
+# usage_unless()
+snippet usau
+ unless ARGV.${1}
+ abort "Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}"${0}
+ end
+snippet array
+ Array.new(${1:10}) { |${2:i}| ${0} }
+snippet hash
+ Hash.new { |${1:hash}, ${2:key}| $1[$2] = ${0} }
+snippet file File.foreach() { |line| .. }
+ File.foreach(${1:'path/to/file'}) { |${2:line}| ${0} }
+snippet file File.read()
+ File.read(${1:'path/to/file'})
+snippet Dir Dir.global() { |file| .. }
+ Dir.glob(${1:'dir/glob/*'}) { |${2:file}| ${0} }
+snippet Dir Dir[".."]
+ Dir[${1:'glob/**/*.rb'}]
+snippet dir
+ Filename.dirname(__FILE__)
+snippet deli
+ delete_if { |${1:e}| ${0} }
+snippet fil
+ fill(${1:range}) { |${2:i}| ${0} }
+# flatten_once()
+snippet flao
+ reduce(Array.new) { |${1:arr}, ${2:a}| $1.push(*$2) }
+snippet zip
+ zip(${1:enums}) { |${2:row}| ${0} }
+# downto(0) { |n| .. }
+snippet dow
+ downto(${1:0}) { |${2:n}| ${0} }
+snippet ste
+ step(${1:2}) { |${2:n}| ${0} }
+snippet tim
+ times { |${1:n}| ${0} }
+snippet upt
+ upto(${1:1.0/0.0}) { |${2:n}| ${0} }
+snippet loo
+ loop { ${0} }
+snippet ea
+ each { |${1:e}| ${0} }
+snippet ead
+ each do |${1:e}|
+ ${0}
+ end
+snippet eab
+ each_byte { |${1:byte}| ${0} }
+snippet eac- each_char { |chr| .. }
+ each_char { |${1:chr}| ${0} }
+snippet eac- each_cons(..) { |group| .. }
+ each_cons(${1:2}) { |${2:group}| ${0} }
+snippet eai
+ each_index { |${1:i}| ${0} }
+snippet eaid
+ each_index do |${1:i}|
+ ${0}
+ end
+snippet eak
+ each_key { |${1:key}| ${0} }
+snippet eakd
+ each_key do |${1:key}|
+ ${0}
+ end
+snippet eal
+ each_line { |${1:line}| ${0} }
+snippet eald
+ each_line do |${1:line}|
+ ${0}
+ end
+snippet eap
+ each_pair { |${1:name}, ${2:val}| ${0} }
+snippet eapd
+ each_pair do |${1:name}, ${2:val}|
+ ${0}
+ end
+snippet eas-
+ each_slice(${1:2}) { |${2:group}| ${0} }
+snippet easd-
+ each_slice(${1:2}) do |${2:group}|
+ ${0}
+ end
+snippet eav
+ each_value { |${1:val}| ${0} }
+snippet eavd
+ each_value do |${1:val}|
+ ${0}
+ end
+snippet eawi
+ each_with_index { |${1:e}, ${2:i}| ${0} }
+snippet eawid
+ each_with_index do |${1:e}, ${2:i}|
+ ${0}
+ end
+snippet eawo
+ each_with_object(${1:init}) { |${2:e}, ${3:var}| ${0} }
+snippet eawod
+ each_with_object(${1:init}) do |${2:e}, ${3:var}|
+ ${0}
+ end
+snippet reve
+ reverse_each { |${1:e}| ${0} }
+snippet reved
+ reverse_each do |${1:e}|
+ ${0}
+ end
+snippet inj
+ inject(${1:init}) { |${2:mem}, ${3:var}| ${0} }
+snippet injd
+ inject(${1:init}) do |${2:mem}, ${3:var}|
+ ${0}
+ end
+snippet red
+ reduce(${1:init}) { |${2:mem}, ${3:var}| ${0} }
+snippet redd
+ reduce(${1:init}) do |${2:mem}, ${3:var}|
+ ${0}
+ end
+snippet map
+ map { |${1:e}| ${0} }
+snippet mapd
+ map do |${1:e}|
+ ${0}
+ end
+snippet mapwi-
+ enum_with_index.map { |${1:e}, ${2:i}| ${0} }
+snippet sor
+ sort { |a, b| ${0} }
+snippet sorb
+ sort_by { |${1:e}| ${0} }
+snippet ran
+ sort_by { rand }
+snippet all
+ all? { |${1:e}| ${0} }
+snippet any
+ any? { |${1:e}| ${0} }
+snippet cl
+ classify { |${1:e}| ${0} }
+snippet col
+ collect { |${1:e}| ${0} }
+snippet cold
+ collect do |${1:e}|
+ ${0}
+ end
+snippet det
+ detect { |${1:e}| ${0} }
+snippet detd
+ detect do |${1:e}|
+ ${0}
+ end
+snippet fet
+ fetch(${1:name}) { |${2:key}| ${0} }
+snippet fin
+ find { |${1:e}| ${0} }
+snippet find
+ find do |${1:e}|
+ ${0}
+ end
+snippet fina
+ find_all { |${1:e}| ${0} }
+snippet finad
+ find_all do |${1:e}|
+ ${0}
+ end
+snippet gre
+ grep(${1:/pattern/}) { |${2:match}| ${0} }
+snippet sub
+ ${1:g}sub(${2:/pattern/}) { |${3:match}| ${0} }
+snippet sca
+ scan(${1:/pattern/}) { |${2:match}| ${0} }
+snippet scad
+ scan(${1:/pattern/}) do |${2:match}|
+ ${0}
+ end
+snippet max
+ max { |a, b| ${0} }
+snippet min
+ min { |a, b| ${0} }
+snippet par
+ partition { |${1:e}| ${0} }
+snippet pard
+ partition do |${1:e}|
+ ${0}
+ end
+snippet rej
+ reject { |${1:e}| ${0} }
+snippet rejd
+ reject do |${1:e}|
+ ${0}
+ end
+snippet sel
+ select { |${1:e}| ${0} }
+snippet seld
+ select do |${1:e}|
+ ${0}
+ end
+snippet lam
+ lambda { |${1:args}| ${0} }
+snippet ->
+ -> { ${0} }
+snippet ->a
+ ->(${1:args}) { ${0} }
+# I'm pretty sure that ruby users expect do to expand to do .. end
+snippet do
+ do
+ ${0}
+ end
+# this is for one or more variables. typing a ", " is that cheap that it may
+# not be worth adding another snippet. should 0/1 placeholders change order?
+# its a good idea to think about the var name, so use it first
+snippet dov
+ do |${1:v}|
+ ${2}
+ end
+snippet :
+ ${1:key}: ${2:'value'}
+snippet ope
+ open('${1:path/or/url/or/pipe}', '${2:w}') { |${3:io}| ${0} }
+# path_from_here()
+snippet fpath
+ File.join(File.dirname(__FILE__), *['${1:rel path here}'])
+# unix_filter {}
+snippet unif
+ ARGF.each_line${1} do |${2:line}|
+ ${0}
+ end
+# option_parse {}
+snippet optp
+ require 'optparse'
+
+ options = { ${0:default: 'args'} }
+
+ ARGV.options do |opts|
+ opts.banner = "Usage: #{File.basename($PROGRAM_NAME)}"
+ end
+snippet opt
+ opts.on('-${1:o}', '--${2:long-option-name}', ${3:String}, '${4:Option description.}') do |${5:opt}|
+ ${0}
+ end
+snippet tc
+ require 'test/unit'
+
+ require '${1:library_file_name}'
+
+ class Test${2:$1} < Test::Unit::TestCase
+ def test_${3:case_name}
+ ${0}
+ end
+ end
+snippet ts
+ require 'test/unit'
+
+ require 'tc_${1:test_case_file}'
+ require 'tc_${2:test_case_file}'
+snippet as
+ assert ${1:test}, '${2:Failure message.}'
+snippet ase
+ assert_equal ${1:expected}, ${2:actual}
+snippet asne
+ assert_not_equal ${1:unexpected}, ${2:actual}
+snippet asid
+ assert_in_delta ${1:expected_float}, ${2:actual_float}, ${3:2**-20}
+snippet asi
+ assert_includes ${1:collection}, ${2:object}
+snippet asio
+ assert_instance_of ${1:ExpectedClass}, ${2:actual_instance}
+snippet asko
+ assert_kind_of ${1:ExpectedKind}, ${2:actual_instance}
+snippet asn
+ assert_nil ${1:instance}
+snippet asnn
+ assert_not_nil ${1:instance}
+snippet asm
+ assert_match(/${1:expected_pattern}/, ${2:actual_string})
+snippet asnm
+ assert_no_match(/${1:unexpected_pattern}/, ${2:actual_string})
+snippet aso
+ assert_operator ${1:left}, :${2:operator}, ${3:right}
+snippet asr
+ assert_raise ${1:Exception} { ${0} }
+snippet asrd
+ assert_raise ${1:Exception} do
+ ${0}
+ end
+snippet asnr
+ assert_nothing_raised ${1:Exception} { ${0} }
+snippet asnrd
+ assert_nothing_raised ${1:Exception} do
+ ${0}
+ end
+snippet asrt
+ assert_respond_to ${1:object}, :${2:method}
+snippet ass assert_same(..)
+ assert_same ${1:expected}, ${2:actual}
+snippet ass assert_send(..)
+ assert_send [${1:object}, :${2:message}, ${3:args}]
+snippet asns
+ assert_not_same ${1:unexpected}, ${2:actual}
+snippet ast
+ assert_throws :${1:expected}, -> { ${0} }
+snippet astd
+ assert_throws :${1:expected} do
+ ${0}
+ end
+snippet asnt
+ assert_nothing_thrown { ${0} }
+snippet asntd
+ assert_nothing_thrown do
+ ${0}
+ end
+snippet fl
+ flunk '${1:Failure message.}'
+# Benchmark.bmbm do .. end
+snippet bm-
+ TESTS = ${1:10_000}
+ Benchmark.bmbm do |results|
+ ${0}
+ end
+snippet rep
+ results.report('${1:name}:') { TESTS.times { ${0} } }
+# Marshal.dump(.., file)
+snippet Md
+ File.open('${1:path/to/file.dump}', 'wb') { |${2:file}| Marshal.dump(${3:obj}, $2) }
+# Mashal.load(obj)
+snippet Ml
+ File.open('${1:path/to/file.dump}', 'rb') { |${2:file}| Marshal.load($2) }
+# deep_copy(..)
+snippet deec
+ Marshal.load(Marshal.dump(${1:obj_to_copy}))
+snippet Pn-
+ PStore.new('${1:file_name.pstore}')
+snippet tra
+ transaction(${1:true}) { ${0} }
+# xmlread(..)
+snippet xml-
+ REXML::Document.new(File.read('${1:path/to/file}'))
+# xpath(..) { .. }
+snippet xpa
+ elements.each('${1://Xpath}') do |${2:node}|
+ ${0}
+ end
+# class_from_name()
+snippet clafn
+ split('::').inject(Object) { |par, const| par.const_get(const) }
+# singleton_class()
+snippet sinc
+ class << self; self end
+snippet nam
+ namespace :${1:`vim_snippets#Filename()`} do
+ ${0}
+ end
+snippet tas
+ desc '${1:Task description}'
+ task ${2:task_name: [:dependent, :tasks]} do
+ ${0}
+ end
+# block
+snippet b
+ { |${1:var}| ${0} }
+snippet begin
+ begin
+ fail 'A test exception.'
+ rescue Exception => e
+ puts e.message
+ puts e.backtrace.inspect
+ else
+ # other exception
+ ensure
+ # always executed
+ end
+
+#debugging
+snippet debug
+ require 'byebug'; byebug
+snippet debug19
+ require 'debugger'; debugger
+snippet debug18
+ require 'ruby-debug'; debugger
+snippet pry
+ require 'pry'; binding.pry
+snippet strf
+ strftime('${1:%Y-%m-%d %H:%M:%S %z}')${0}
+#
+# Minitest snippets
+#
+snippet mb
+ must_be ${0}
+snippet wb
+ wont_be ${0}
+snippet mbe
+ must_be_empty
+snippet wbe
+ wont_be_empty
+snippet mbio
+ must_be_instance_of ${0:Class}
+snippet wbio
+ wont_be_instance_of ${0:Class}
+snippet mbko
+ must_be_kind_of ${0:Class}
+snippet wbko
+ wont_be_kind_of ${0:Class}
+snippet mbn
+ must_be_nil
+snippet wbn
+ wont_be_nil
+snippet mbsa
+ must_be_same_as ${0:other}
+snippet wbsa
+ wont_be_same_as ${0:other}
+snippet mbsi
+ -> { ${0} }.must_be_silent
+snippet mbwd
+ must_be_within_delta ${1:0.1}, ${2:0.1}
+snippet wbwd
+ wont_be_within_delta ${1:0.1}, ${2:0.1}
+snippet mbwe
+ must_be_within_epsilon ${1:0.1}, ${2:0.1}
+snippet wbwe
+ wont_be_within_epsilon ${1:0.1}, ${2:0.1}
+snippet me
+ must_equal ${0:other}
+snippet we
+ wont_equal ${0:other}
+snippet mi
+ must_include ${0:what}
+snippet wi
+ wont_include ${0:what}
+snippet mm
+ must_match /${0:regex}/
+snippet wm
+ wont_match /${0:regex}/
+snippet mout
+ -> { ${1} }.must_output '${0}'
+snippet mra
+ -> { ${1} }.must_raise ${0:Exception}
+snippet mrt
+ must_respond_to :${0:method}
+snippet wrt
+ wont_respond_to :${0:method}
+snippet msend
+ must_send [ ${1:what}, :${2:method}, ${3:args} ]
+snippet mthrow
+ -> { throw :${1:error} }.must_throw :${2:error}
+##########################
+# Rspec snippets #
+##########################
+snippet desc
+ describe ${1:`substitute(substitute(vim_snippets#Filename(), '_spec$', '', ''), '\(_\|^\)\(.\)', '\u\2', 'g')`} do
+ ${0}
+ end
+snippet descm
+ describe '${1:#method}' do
+ ${0:pending 'Not implemented'}
+ end
+snippet cont
+ context '${1:message}' do
+ ${0}
+ end
+snippet bef
+ before :${1:each} do
+ ${0}
+ end
+snippet aft
+ after :${1:each} do
+ ${0}
+ end
+snippet let
+ let(:${1:object}) { ${0} }
+snippet let!
+ let!(:${1:object}) { ${0} }
+snippet subj
+ subject { ${0} }
+snippet s.
+ subject.${0:method}
+snippet spec
+ specify { subject.${0} }
+snippet exp
+ expect(${1:object}).to ${0}
+snippet expb
+ expect { ${1:object} }.to ${0}
+snippet experr
+ expect { ${1:object} }.to raise_error ${2:StandardError}, /${0:message_regex}/
+snippet shared
+ shared_examples ${0:'shared examples name'}
+snippet ibl
+ it_behaves_like ${0:'shared examples name'}
+snippet it
+ it '${1:spec_name}' do
+ ${0}
+ end
+snippet its
+ its(:${1:method}) { should ${0} }
+snippet is
+ it { should ${0} }
+snippet isn
+ it { should_not ${0} }
+snippet iexp
+ it { expect(${1:object}).${1} ${0} }
+snippet iexpb
+ it { expect { ${1:object} }.${1} ${0} }
+snippet iiexp
+ it { is_expected.to ${0} }
+snippet iiexpn
+ it { is_expected.not_to ${0} }
+snippet agg
+ aggregate_failures '${1:message}' do
+ ${0}
+ end
diff --git a/vim/bundle/vim-snippets/snippets/rust.snippets b/vim/bundle/vim-snippets/snippets/rust.snippets
new file mode 100644
index 0000000..20532f7
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/rust.snippets
@@ -0,0 +1,186 @@
+#################
+# Rust Snippets #
+#################
+
+# Functions
+snippet fn "Function definition"
+ fn ${1:function_name}(${2})${3} {
+ ${0}
+ }
+snippet pfn "Function definition"
+ pub fn ${1:function_name}(${2})${3} {
+ ${0}
+ }
+snippet test "Unit test function"
+ #[test]
+ fn ${1:test_function_name}() {
+ ${0}
+ }
+snippet bench "Bench function" b
+ #[bench]
+ fn ${1:bench_function_name}(b: &mut test::Bencher) {
+ b.iter(|| {
+ ${0}
+ })
+ }
+snippet new "Constructor function"
+ pub fn new(${2}) -> ${1:Name} {
+ $1 { ${3} }
+ }
+snippet main "Main function"
+ pub fn main() {
+ ${0}
+ }
+snippet let "let variable declaration with type inference"
+ let ${1} = ${2};
+snippet lett "let variable declaration with explicit type annotation"
+ let ${1}: ${2} = ${3};
+snippet letm "let mut variable declaration with type inference"
+ let mut ${1} = ${2};
+snippet lettm "let mut variable declaration with explicit type annotation"
+ let mut ${1}: ${2} = ${3};
+snippet pln "println!"
+ println!("${1}");
+snippet pln, "println! with format param"
+ println!("${1}", ${2});
+# Modules
+snippet ec "extern crate"
+ extern crate ${1:sync};
+snippet ecl "extern crate log"
+ #[macro_use]
+ extern crate log;
+snippet mod
+ mod ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
+ ${0}
+ } /* $1 */
+snippet testmod "Test module" b
+ #[cfg(test)]
+ mod tests {
+ use super::${1:*};
+
+ test${0}
+ }
+# Attributes
+snippet allow "allow lint attribute" b
+ #[allow(${1:unused_variable})]
+snippet cfg "cfg attribute" b
+ #[cfg(${1:target_os = "linux"})]
+snippet feat "feature attribute" b
+ #![feature(${1:plugin})]
+snippet der "#[derive(..)]" b
+ #[derive(${1:Debug})]
+snippet attr "#[..]" b
+ #[${1:inline}]
+snippet crate "Define create meta attributes"
+ // Crate name
+ #![crate_name = "${1:crate_name}"]
+ // Additional metadata attributes
+ #![desc = "${2:Descrption.}"]
+ #![license = "${3:BSD}"]
+ #![comment = "${4:Comment.}"]
+ // Specify the output type
+ #![crate_type = "${5:lib}"]
+# Common types
+snippet opt "Option<T>"
+ Option<${1:i32}>
+snippet res "Result<T, E>"
+ Result<${1:~str}, ${2:()}>
+# Control structures
+snippet if
+ if ${1} {
+ ${0}
+ }
+snippet ife "if / else"
+ if ${1} {
+ ${2}
+ } else {
+ ${0}
+ }
+snippet el "else"
+ else {
+ ${0}
+ }
+snippet eli "else if"
+ else if ${1} {
+ ${0}
+ }
+snippet mat "match pattern"
+ match ${1} {
+ ${2} => ${3}
+ }
+snippet case "Case clause of pattern match"
+ ${1:_} => ${2:expression}
+snippet loop "loop {}" b
+ loop {
+ ${0}
+ }
+snippet wh "while loop"
+ while ${1:condition} {
+ ${0}
+ }
+snippet for "for ... in ... loop"
+ for ${1:i} in ${2} {
+ ${0}
+ }
+# TODO commenting
+snippet todo "TODO comment"
+ // [TODO]: ${0:Description}
+snippet fixme "FIXME comment"
+ // FIXME: $0
+# Struct
+snippet st "Struct definition"
+ struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
+ ${0}
+ }
+snippet impl "Struct/Trait implementation"
+ impl ${1:Type/Trait}${2: for ${3:Type}} {
+ ${0}
+ }
+snippet stn "Struct with new constructor"
+ pub struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
+ ${0}
+ }
+
+ impl $1 {
+ pub fn new(${2}) -> $1 {
+ $1 { ${3} }
+ }
+ }
+snippet type "Type alias"
+ type ${1:NewName} = $2;
+snippet enum "enum definition"
+ enum ${1:Name} {
+ ${2},
+ }
+# Traits
+snippet trait "Trait definition"
+ trait ${1:Name} {
+ ${0}
+ }
+snippet drop "Drop trait implementation (destructor)"
+ impl Drop for ${1:Name} {
+ fn drop(&mut self) {
+ ${0}
+ }
+ }
+# Statics
+snippet ss "static string declaration"
+ static ${1}: &'static str = "${0}";
+snippet stat "static item declaration"
+ static ${1}: ${2:usize} = ${0};
+# Concurrency
+snippet scoped "spawn a scoped thread"
+ thread::scoped(${1:move }|| {
+ ${0}
+ });
+snippet spawn "spawn a thread"
+ thread::spawn(${1:move }|| {
+ ${0}
+ });
+snippet chan "Declare (Sender, Receiver) pair of asynchronous channel()"
+ let (${1:tx}, ${2:rx}): (Sender<${3:i32}>, Receiver<${4:i32}>) = channel();
+# Testing
+snippet as "assert!"
+ assert!(${1:predicate})
+snippet ase "assert_eq!"
+ assert_eq!(${1:expected}, ${2:actual})
diff --git a/vim/bundle/vim-snippets/snippets/sass.snippets b/vim/bundle/vim-snippets/snippets/sass.snippets
new file mode 100644
index 0000000..7207360
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/sass.snippets
@@ -0,0 +1,36 @@
+extends css
+
+snippet $
+ $${1:variable}: ${0:value}
+snippet imp
+ @import '${0}'
+snippet mix
+ @mixin ${1:name}(${2})
+ ${0}
+snippet inc
+ @include ${1:mixin}(${2})
+snippet ext
+ @extend ${0}
+snippet fun
+ @function ${1:name}(${2:args})
+ ${0}
+snippet if
+ @if ${1:condition}
+ ${0}
+snippet ife
+ @if ${1:condition}
+ ${2}
+ @else
+ ${0}
+snippet eif
+ @else if ${1:condition}
+ ${0}
+snippet for
+ @for ${1:$i} from ${2:1} through ${3:3}
+ ${0}
+snippet each
+ @each ${1:$item} in ${2:items}
+ ${0}
+snippet while
+ @while ${1:$i} ${2:>} ${3:0}
+ ${0}
diff --git a/vim/bundle/vim-snippets/snippets/scala.snippets b/vim/bundle/vim-snippets/snippets/scala.snippets
new file mode 100644
index 0000000..003081e
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/scala.snippets
@@ -0,0 +1,360 @@
+################################################################
+# © Copyright 2011 Konstantin Gorodinskiy. All Rights Reserved.#
+# Do What The Fuck You Want To Public License, Version 2. #
+# See http://sam.zoy.org/wtfpl/COPYING for more details. #
+################################################################
+# Scala lang
+#if
+snippet if
+ if (${1})
+ ${0}
+#if not
+snippet ifn
+ if (!${1})
+ ${0}
+#if-else
+snippet ife
+ if (${1})
+ ${2}
+ else
+ ${0}
+#if-else-if
+snippet ifelif
+ if (${1})
+ ${2}
+ else if (${3})
+ ${0}
+snippet eif
+ else if (${3})
+ ${0}
+#while loop
+snippet wh
+ while (${1:obj}) {
+ ${0}
+ }
+#for loop(classic)
+snippet for
+ for (${1:item} <- ${2:obj}) {
+ ${0}
+ }
+#for loop(indexed)
+snippet fori
+ for (${1:i} <- ${2:0} to ${3:obj}.length) {
+ ${0}
+ }
+#for comprehension
+snippet fory
+ for {
+ ${1:item} <- ${2:obj}
+ } yield ${0}
+#exceptions
+snippet try
+ try {
+ ${1}
+ } catch {
+ case e: FileNotFoundException => ${2}
+ case e: IOException => ${3}
+ } finally {
+ ${0}
+ }
+#match
+snippet match
+ ${1: obj} match {
+ case ${2:e} => ${3}
+ case _ => ${0}
+ }
+#case
+snippet case
+ case ${1:value} => ${0}
+############################
+# methods and arguments
+#
+#arg
+snippet arg
+ ${1:a}: ${2:T}${0:, arg}
+#args
+snippet args
+ ${1:args}: ${0:T}*
+#def
+snippet def
+ def ${1:name}(${2:arg}) = ${0:}
+#private def
+snippet prdef
+ private def ${1:name}(${2:arg}) = ${0:}
+#override def
+snippet ovdef
+ override def ${1:name}(${2:arg}) = ${0:}
+#first class function(see scalabook p 188)
+snippet fcf
+ (${1:a}: ${2:T}) => $1 ${0}
+snippet =>
+ ${1:name} => ${0}
+#recursion
+snippet rec
+ def ${1:name}(${0:arg}) =
+ if($2) $2
+ else $1($2)
+#curried method
+snippet crdef
+ def ${1:name}(${2:arg})(${3:arg}) = ${0:}
+#main method
+#check validity of T
+snippet main
+ def main(args: Array[String]):${1:T} = ${0:}
+############################
+# basic types(general purpose)
+# you might want to use basic types snippets
+
+#1
+snippet T Double
+ dbl
+#2
+snippet T Int
+ int
+#3
+snippet T Long
+ lng
+#4
+snippet T Char
+ chr
+#5
+snippet T String
+ str
+#6
+snippet T Array
+ arr
+#7
+snippet T Buffer
+ buf
+#8
+snippet T List
+ list
+#9
+snippet T Tuple
+ tpl
+#10
+snippet T Set
+ set
+#11
+snippet T Map
+ map
+#12
+snippet T HashSet
+ hset
+#13
+snippet T HashMap
+ hmap
+#14
+snippet T Boolean
+ bool
+#end
+
+#named snippets for types
+snippet bool
+ Boolean
+snippet anyr
+ AnyRef
+snippet dbl
+ Double
+snippet int
+ Int
+snippet str
+ String
+snippet chr
+ Char
+snippet lng
+ Long
+snippet arr
+ Array${1:[T]}${0:()}
+snippet buf
+ Buffer${1:[T]}${0:()}
+snippet list
+ List${1:[T]}${0:()}
+snippet tpl
+ Tuple${1:2}[${2:T},${0:T}]
+snippet set
+ Set${1:[T]}${0:()}
+snippet hset
+ HashSet${1:[T]}${0:()}
+snippet mhset
+ mutable.HashSet${1:[T]}${0:()}
+#for maps
+snippet keyval
+ ${1:key}->${2:val}${0:, keyval}
+snippet map
+ Map[${1:T},${2:T}]${0:(keyval)}
+snippet hmap
+ HashMap[${1:T},${2:T}]${0:(keyval)}
+snippet mmap
+ mutable.Map[${1:T},${2:T}]${0:(keyval)}
+snippet mhmap
+ mutable.HashMap[${1:T},${2:T}]${0:(keyval)}
+#TODO add TreeMap and TreeSet
+#asInstanceOf[]
+snippet as
+ ${1:name}.asInstanceOf[${2:T}]
+#isInstanceOf[]
+snippet is
+ ${1:name}.isInstanceOf[${2:T}]
+
+#collections methods
+
+#scope() with one arg
+snippet (a
+ (${1:a} => ${0})
+#scope() with two args
+snippet {(
+ {(${1:a},${2:b}) =>
+ ${0}
+ }
+#filter
+snippet filter
+ ${0:name}.filter (a
+#map function
+snippet mapf
+ ${0:name}.map (a
+#flatmap
+snippet flatmap
+ ${1:name}.flatMap${0:[T]}(a
+#fold left
+snippet fldl
+ ${1:name}.foldLeft(${0:first}) {(
+#fold right
+snippet fldr
+ ${1:name}.foldRight(${0:first}) {(
+#fold left operator(if u wanna reduce readability of ur code)
+#use wildcard symbols
+snippet /:
+ (${1:first}/:${2:name})(${0})
+#fold right operator
+snippet :\
+ (${1:first}:\${2:name})(${0})
+#reduce left
+snippet redl
+ ${1:name}.reduceLeft[${0:T}] {(
+#reduce right
+snippet redr
+ ${1:name}.reduceRight[${0:T}] {(
+#zipWithIndex(safe way).
+#see http://daily-scala.blogspot.com/2010/05/zipwithindex.html
+snippet zipwi
+ ${0:name}.view.zipWithIndex
+#split
+snippet spl
+ ${1:name}.split("${0:,}")
+#end
+snippet val
+ val ${1:name}${2:: T} = ${0:value}
+snippet var
+ var ${1:name}${2:: T} = ${0:value}
+############################
+# classes
+#
+#extends
+snippet extends
+ extends ${0:what}
+#with
+snippet with
+ with ${1:what}${0: with}
+#auxiliary constructor(a. this)
+snippet athis
+ def this(arg) = this(arg)
+#abstract class
+snippet abstract
+ abstract class ${1:name}${2:(arg)}${3: extends }${4: with} {
+ ${5:override def toString = "$1"}
+ ${0}
+ }
+#class
+snippet class
+ class ${1:name}${2:(arg)}${3: extends }${4: with} {
+ ${5:override def toString = "$1"}
+ ${0}
+ }
+#object
+snippet object
+ object ${1:name}${2:(arg)}${3: extends }${4: with} ${0:}
+#trait
+snippet trait
+ trait ${1:name}${2: extends }${3: with} {
+ ${0:}
+ }
+#class with trait Ordered(page 265)
+snippet ordered
+ class ${1:name}${2:(arg)} extends Ordered[$1] ${3: with} {
+ ${4:override def toString = "$1"}
+ def compare(that: $1) = ${5:this - that}
+ ${0}
+ }
+#case class
+snippet casecl
+ case class ${1:name}${2:(arg)}${3: extends }${4: with} ${0:}
+############################
+# testing
+#
+#scalatest imports
+snippet scalatest
+ ${1:import org.scalatest.Suite}
+ ${0:import org.scalatest.FunSuite}
+#assert
+snippet assert
+ assert(${1:a} === ${0:b})
+#ensuring(p 296)
+snippet ensuring
+ ifel ensuring(${1:a}==${0:b})
+#expect
+snippet expect
+ expect(${1:what}) {
+ ${0}
+ }
+#intercept
+snippet intercept
+ intercept[${1:IllegalArgumentException}] {
+ ${0}
+ }
+#test
+snippet test
+ test("${1:description}") {
+ ${0}
+ }
+#suite
+snippet suite
+ class ${0:name} extends Suite {
+ def test() {
+ }
+#funsuite
+snippet fsuite
+ class ${1:name} extends FunSuite {
+ test("${0:description}") {
+ }
+############################
+# SBT
+#
+snippet webproject
+ import sbt._
+
+ class ${1:Name}(info: ProjectInfo) extends DefaultWebProject(info) {
+ val liftVersion = "${0:2.3}"
+
+ override def libraryDependencies = Set(
+
+ ) ++ super.libraryDependencies
+
+ val snapshots = ScalaToolsSnapshots
+ }
+#depencies
+snippet liftjar
+ "net.liftweb" %% "${0:lib}" % liftVersion % "compile->default",
+snippet jettyjar
+ "org.mortbay.jetty" % "jetty" % "${0:version}" % "test->default",
+############################
+# Lift
+#
+#lift imports
+snippet liftimports
+ import _root_.net.liftweb.http._
+ import S._
+ import _root_.net.liftweb.util._
+ import Helpers._
+ import _root_.scala.xml._
+#TODO LIFT,SBT,WEB.XML,HTML snippets
diff --git a/vim/bundle/vim-snippets/snippets/scheme.snippets b/vim/bundle/vim-snippets/snippets/scheme.snippets
new file mode 100644
index 0000000..035d534
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/scheme.snippets
@@ -0,0 +1,36 @@
+snippet +
+ (+ ${1}
+ ${0})
+
+snippet -
+ (- ${1}
+ ${0})
+
+snippet /
+ (/ ${1}
+ ${0})
+
+snippet *
+ (* ${1}
+ ${0})
+
+# Definition
+snippet def
+ (define (${1:name})
+ (${0:definition}))
+
+# Definition with lambda
+snippet defl
+ (define ${1:name}
+ (lambda (x)(${0:definition})))
+
+# Condition
+snippet cond
+ (cond ((${1:predicate}) (${2:action}))
+ ((${3:predicate}) (${0:action})))
+
+# If statement
+snippet if
+ (if (${1:predicate})
+ (${2:true-action})
+ (${0:false-action}))
diff --git a/vim/bundle/vim-snippets/snippets/scss.snippets b/vim/bundle/vim-snippets/snippets/scss.snippets
new file mode 100644
index 0000000..998a120
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/scss.snippets
@@ -0,0 +1,44 @@
+extends css
+
+snippet $
+ $${1:variable}: ${0:value};
+snippet imp
+ @import '${0}';
+snippet mix
+ @mixin ${1:name}(${2}) {
+ ${0}
+ }
+snippet inc
+ @include ${1:mixin}(${2});
+snippet ext
+ @extend ${0};
+snippet fun
+ @function ${1:name}(${2:args}) {
+ ${0}
+ }
+snippet if
+ @if ${1:condition} {
+ ${0}
+ }
+snippet ife
+ @if ${1:condition} {
+ ${2}
+ } @else {
+ ${0}
+ }
+snippet eif
+ @else if ${1:condition} {
+ ${0}
+ }
+snippet for
+ @for ${1:$i} from ${2:1} through ${3:3} {
+ ${0}
+ }
+snippet each
+ @each ${1:$item} in ${2:items} {
+ ${0}
+ }
+snippet while
+ @while ${1:$i} ${2:>} ${3:0} {
+ ${0}
+ }
diff --git a/vim/bundle/vim-snippets/snippets/sh.snippets b/vim/bundle/vim-snippets/snippets/sh.snippets
new file mode 100644
index 0000000..e470a2a
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/sh.snippets
@@ -0,0 +1,99 @@
+# Shebang. Executing bash via /usr/bin/env makes scripts more portable.
+snippet #!
+ #!/usr/bin/env sh
+
+snippet bash
+ #!/usr/bin/env bash
+
+snippet sbash
+ #!/usr/bin/env bash
+ set -euo pipefail
+ IFS=$'\n\t'
+
+snippet if
+ if [[ ${1:condition} ]]; then
+ ${0:#statements}
+ fi
+snippet elif
+ elif [[ ${1:condition} ]]; then
+ ${0:#statements}
+snippet for
+ for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do
+ ${0:#statements}
+ done
+snippet fori
+ for ${1:needle} in ${2:haystack} ; do
+ ${0:#statements}
+ done
+snippet wh
+ while [[ ${1:condition} ]]; do
+ ${0:#statements}
+ done
+snippet until
+ until [[ ${1:condition} ]]; do
+ ${0:#statements}
+ done
+snippet case
+ case ${1:word} in
+ ${2:pattern})
+ ${0};;
+ esac
+snippet go
+ while getopts '${1:o}' ${2:opts}
+ do
+ case $$2 in
+ ${3:o0})
+ ${0:#staments};;
+ esac
+ done
+# Set SCRIPT_DIR variable to directory script is located.
+snippet sdir
+ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+# getopt
+snippet getopt
+ __ScriptVersion="${1:version}"
+
+ #=== FUNCTION ================================================================
+ # NAME: usage
+ # DESCRIPTION: Display usage information.
+ #===============================================================================
+ function usage ()
+ {
+ echo "Usage : $${0:0} [options] [--]
+
+ Options:
+ -h|help Display this message
+ -v|version Display script version"
+
+ } # ---------- end of function usage ----------
+
+ #-----------------------------------------------------------------------
+ # Handle command line arguments
+ #-----------------------------------------------------------------------
+
+ while getopts ":hv" opt
+ do
+ case $opt in
+
+ h|help ) usage; exit 0 ;;
+
+ v|version ) echo "$${0:0} -- Version $__ScriptVersion"; exit 0 ;;
+
+ * ) echo -e "\n Option does not exist : $OPTARG\n"
+ usage; exit 1 ;;
+
+ esac # --- end of case ---
+ done
+ shift $(($OPTIND-1))
+snippet root
+ if [ \$(id -u) -ne 0 ]; then exec sudo \$0; fi
+
+snippet fun-sh
+ ${1:function_name}() {
+ ${0:#function_body}
+ }
+
+snippet fun
+ function ${1:function_name}() {
+ ${0:#function_body}
+ }
diff --git a/vim/bundle/vim-snippets/snippets/simplemvcf.snippets b/vim/bundle/vim-snippets/snippets/simplemvcf.snippets
new file mode 100644
index 0000000..2ef6a65
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/simplemvcf.snippets
@@ -0,0 +1,122 @@
+snippet sm_controller
+ <?php
+ namespace Controllers;
+ use Core\View;
+ use Core\Controller;
+
+ class ${1:class_name} extends Controller
+ {
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function index()
+ {
+ ${2:}
+ }
+ }
+snippet sm_model
+ <?php
+ namespace Models;
+
+ use Core\Model;
+
+ class ${1:class_name} extends Model
+ {
+ function __construct()
+ {
+ parent::__construct();
+ }
+ }
+snippet sm_model_crud
+ <?php
+ namespace Models;
+
+ use Core\Model;
+
+ class ${1:class_name} extends Model
+ {
+ private $${2:table};
+ function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function getRow($where)
+ {
+ return $this->db->select('SELECT * FROM '.$table.' WHERE ${3:where}', $data);
+ }
+
+ public function getRows($where)
+ {
+ return $this->db->select('SELECT * FROM '.$table.');
+ }
+
+ public function insert($data)
+ {
+ $this->db->insert($table, $data);
+ }
+
+ public function update($data, $where)
+ {
+ $this->db->update($table ,$data, $where);
+ }
+
+ public function delete($where)
+ {
+ $this->db->delete($table, $where);
+ }
+ }
+snippet sm_render
+ View::render('${1:view}', $${2:array});
+snippet sm_render_template
+ View::renderTemplate('${1:part}', $${2:array});
+
+# database
+snippet sm_db_select
+ $this->db->select(${1:sql}, ${2:where});
+
+snippet sm_db_insert
+ $this->db->insert(${1:table}, ${2:data});
+
+snippet sm_db_update
+ $this->db->update(${1:table}, ${2:data}, ${3:where});
+
+snippet sm_db_delete
+ $this->db->delete(${1:table}, ${2:where});
+
+snippet sm_db_truncate
+ $this->db->delete(${1:table});
+
+#session
+snippet sm_session_set
+ Session::set(${1:key}, ${2:value});
+
+snippet sm_session_get
+ Session::get(${1:key});
+
+snippet sm_session_pull
+ Session::pull(${1:key});
+
+snippet sm_session_id
+ Session::id();
+
+snippet sm_session_destroy
+ Session::set(${1:key});
+
+snippet sm_session_display
+ Session::display();
+
+#url
+snippet sm_url_redirect
+ Url:redirect('${1:path}');
+
+snippet sm_url_previous
+ Url:previous();
+
+snippet sm_url_templatepath
+ Url:templatePath();
+
+snippet sm_url_autolink
+ Url:autolink('${1:string}');
diff --git a/vim/bundle/vim-snippets/snippets/slim.snippets b/vim/bundle/vim-snippets/snippets/slim.snippets
new file mode 100644
index 0000000..885ca8d
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/slim.snippets
@@ -0,0 +1,63 @@
+snippet pry
+ - binding.pry
+snippet renp
+ = render partial: '${0}'
+# Forms
+# =====
+snippet fieldset
+ fieldset
+ legend ${1}
+snippet css
+ link rel="stylesheet" href="${1:style.css}" type="text/css" media="${2:all}"
+snippet script
+ script src="${1:script.js}" type="text/javascript"
+# Some useful Unicode entities
+# ============================
+# Non-Breaking Space
+snippet nbs
+ &nbsp;
+# ←
+snippet left
+ &#x2190;
+# →
+snippet right
+ &#x2192;
+# ↑
+snippet up
+ &#x2191;
+# ↓
+snippet down
+ &#x2193;
+# ↩
+snippet return
+ &#x21A9;
+# ⇤
+snippet backtab
+ &#x21E4;
+# ⇥
+snippet tab
+ &#x21E5;
+# ⇧
+snippet shift
+ &#x21E7;
+# ⌃
+snippet ctrl
+ &#x2303;
+# ⌅
+snippet enter
+ &#x2305;
+# ⌘
+snippet cmd
+ &#x2318;
+# ⌥
+snippet option
+ &#x2325;
+# ⌦
+snippet delete
+ &#x2326;
+# ⌫
+snippet backspace
+ &#x232B;
+# ⎋
+snippet esc
+ &#x238B;
diff --git a/vim/bundle/vim-snippets/snippets/snippets.snippets b/vim/bundle/vim-snippets/snippets/snippets.snippets
new file mode 100644
index 0000000..dc8de42
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/snippets.snippets
@@ -0,0 +1,11 @@
+# snippets for making snippets :)
+snippet snip
+ snippet ${1:trigger}
+ ${0}
+snippet msnip
+ snippet ${1:trigger} ${2:description}
+ ${0}
+snippet v
+ {VISUAL}
+snippet $
+ ${${1:1}:${0:text}}
diff --git a/vim/bundle/vim-snippets/snippets/sql.snippets b/vim/bundle/vim-snippets/snippets/sql.snippets
new file mode 100644
index 0000000..556fae0
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/sql.snippets
@@ -0,0 +1,26 @@
+snippet tbl
+ create table ${1:table} (
+ ${0:columns}
+ );
+snippet col
+ ${1:name} ${2:type} ${3:default ''} ${0:not null}
+snippet ccol
+ ${1:name} varchar2(${2:size}) ${3:default ''} ${0:not null}
+snippet ncol
+ ${1:name} number ${3:default 0} ${0:not null}
+snippet dcol
+ ${1:name} date ${3:default sysdate} ${0:not null}
+snippet ind
+ create index ${0:$1_$2} on ${1:table}(${2:column});
+snippet uind
+ create unique index ${1:name} on ${2:table}(${0:column});
+snippet tblcom
+ comment on table ${1:table} is '${0:comment}';
+snippet colcom
+ comment on column ${1:table}.${2:column} is '${0:comment}';
+snippet addcol
+ alter table ${1:table} add (${2:column} ${0:type});
+snippet seq
+ create sequence ${1:name} start with ${2:1} increment by ${3:1} minvalue ${0:1};
+snippet s*
+ select * from ${0:table}
diff --git a/vim/bundle/vim-snippets/snippets/stylus.snippets b/vim/bundle/vim-snippets/snippets/stylus.snippets
new file mode 100644
index 0000000..205f847
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/stylus.snippets
@@ -0,0 +1,993 @@
+snippet !
+ !important
+snippet bdi:m+
+ -moz-border-image url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch}
+snippet bdi:m
+ -moz-border-image ${0}
+snippet bdrz:m
+ -moz-border-radius ${0}
+snippet bxsh:m+
+ -moz-box-shadow ${1:0} ${2:0} ${3:0} ${0}
+snippet bxsh:m
+ -moz-box-shadow ${0}
+snippet bdi:w+
+ -webkit-border-image url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch}
+snippet bdi:w
+ -webkit-border-image ${0}
+snippet bdrz:w
+ -webkit-border-radius ${0}
+snippet bxsh:w+
+ -webkit-box-shadow ${1:0} ${2:0} ${3:0} ${0}
+snippet bxsh:w
+ -webkit-box-shadow ${0}
+snippet @f
+ @font-face ${0}
+snippet @i
+ @import '${0}'
+snippet @r
+ @require '${0}'
+snippet @m
+ @media ${1:screen}
+snippet @msmw
+ @media screen and (min-width: ${0}px)
+snippet @ext
+ @extend .${1}
+ ${0}
+snippet bg+
+ background ${1} url(${2}) ${3:0} ${4:0} ${0:no-repeat}
+snippet bga
+ background-attachment ${0}
+snippet bga:f
+ background-attachment fixed
+snippet bga:s
+ background-attachment scroll
+snippet bgbk
+ background-break ${0}
+snippet bgbk:bb
+ background-break bounding-box
+snippet bgbk:c
+ background-break continuous
+snippet bgbk:eb
+ background-break each-box
+snippet bgcp
+ background-clip ${0}
+snippet bgcp:bb
+ background-clip border-box
+snippet bgcp:cb
+ background-clip content-box
+snippet bgcp:nc
+ background-clip no-clip
+snippet bgcp:pb
+ background-clip padding-box
+snippet bgc
+ background-color ${0}
+snippet bgc:t
+ background-color transparent
+snippet bgi
+ background-image url(${0})
+snippet bgi:n
+ background-image none
+snippet bgo
+ background-origin ${0}
+snippet bgo:bb
+ background-origin border-box
+snippet bgo:cb
+ background-origin content-box
+snippet bgo:pb
+ background-origin padding-box
+snippet bgpx
+ background-position-x ${0}
+snippet bgpy
+ background-position-y ${0}
+snippet bgp
+ background-position ${1:0} ${0:0}
+snippet bgr
+ background-repeat ${0}
+snippet bgr:n
+ background-repeat no-repeat
+snippet bgr:x
+ background-repeat repeat-x
+snippet bgr:y
+ background-repeat repeat-y
+snippet bgr:r
+ background-repeat repeat
+snippet bgz
+ background-size ${0}
+snippet bgz:a
+ background-size auto
+snippet bgz:ct
+ background-size contain
+snippet bgz:cv
+ background-size cover
+snippet bg
+ background ${0}
+snippet bg:ie
+ filter progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1}',sizingMethod='${0:crop}')
+snippet bg:n
+ background none
+snippet bd+
+ border ${1:1px} ${2:solid} ${0}
+snippet bdb+
+ border-bottom ${1:1px} ${2:solid} ${0}
+snippet bdbc
+ border-bottom-color ${0}
+snippet bdbi
+ border-bottom-image url(${0})
+snippet bdbi:n
+ border-bottom-image none
+snippet bdbli
+ border-bottom-left-image url(${0})
+snippet bdbli:c
+ border-bottom-left-image continue
+snippet bdbli:n
+ border-bottom-left-image none
+snippet bdblrz
+ border-bottom-left-radius ${0}
+snippet bdbri
+ border-bottom-right-image url(${0})
+snippet bdbri:c
+ border-bottom-right-image continue
+snippet bdbri:n
+ border-bottom-right-image none
+snippet bdbrrz
+ border-bottom-right-radius ${0}
+snippet bdbs
+ border-bottom-style ${0}
+snippet bdbs:n
+ border-bottom-style none
+snippet bdbw
+ border-bottom-width ${0}
+snippet bdb
+ border-bottom ${0}
+snippet bdb:n
+ border-bottom none
+snippet bdbk
+ border-break ${0}
+snippet bdbk:c
+ border-break close
+snippet bdcl
+ border-collapse ${0}
+snippet bdcl:c
+ border-collapse collapse
+snippet bdcl:s
+ border-collapse separate
+snippet bdc
+ border-color ${0}
+snippet bdci
+ border-corner-image url(${0})
+snippet bdci:c
+ border-corner-image continue
+snippet bdci:n
+ border-corner-image none
+snippet bdf
+ border-fit ${0}
+snippet bdf:c
+ border-fit clip
+snippet bdf:of
+ border-fit overwrite
+snippet bdf:ow
+ border-fit overwrite
+snippet bdf:r
+ border-fit repeat
+snippet bdf:sc
+ border-fit scale
+snippet bdf:sp
+ border-fit space
+snippet bdf:st
+ border-fit stretch
+snippet bdi
+ border-image url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch}
+snippet bdi:n
+ border-image none
+snippet bdl+
+ border-left ${1:1px} ${2:solid} ${0}
+snippet bdlc
+ border-left-color ${0}
+snippet bdli
+ border-left-image url(${0})
+snippet bdli:n
+ border-left-image none
+snippet bdls
+ border-left-style ${0}
+snippet bdls:n
+ border-left-style none
+snippet bdlw
+ border-left-width ${0}
+snippet bdl
+ border-left ${0}
+snippet bdl:n
+ border-left none
+snippet bdlt
+ border-length ${0}
+snippet bdlt:a
+ border-length auto
+snippet bdrz
+ border-radius ${0}
+snippet bdr+
+ border-right ${1:1px} ${2:solid} ${0}
+snippet bdrc
+ border-right-color ${0}
+snippet bdri
+ border-right-image url(${0})
+snippet bdri:n
+ border-right-image none
+snippet bdrs
+ border-right-style ${0}
+snippet bdrs:n
+ border-right-style none
+snippet bdrw
+ border-right-width ${0}
+snippet bdr
+ border-right ${0}
+snippet bdr:n
+ border-right none
+snippet bdsp
+ border-spacing ${0}
+snippet bds
+ border-style ${0}
+snippet bds:ds
+ border-style dashed
+snippet bds:dtds
+ border-style dot-dash
+snippet bds:dtdtds
+ border-style dot-dot-dash
+snippet bds:dt
+ border-style dotted
+snippet bds:db
+ border-style double
+snippet bds:g
+ border-style groove
+snippet bds:h
+ border-style hidden
+snippet bds:i
+ border-style inset
+snippet bds:n
+ border-style none
+snippet bds:o
+ border-style outset
+snippet bds:r
+ border-style ridge
+snippet bds:s
+ border-style solid
+snippet bds:w
+ border-style wave
+snippet bdt+
+ border-top ${1:1px} ${2:solid} ${0}
+snippet bdtc
+ border-top-color ${0}
+snippet bdti
+ border-top-image url(${0})
+snippet bdti:n
+ border-top-image none
+snippet bdtli
+ border-top-left-image url(${0})
+snippet bdtli:c
+ border-corner-image continue
+snippet bdtli:n
+ border-corner-image none
+snippet bdtlrz
+ border-top-left-radius ${0}
+snippet bdtri
+ border-top-right-image url(${0})
+snippet bdtri:c
+ border-top-right-image continue
+snippet bdtri:n
+ border-top-right-image none
+snippet bdtrrz
+ border-top-right-radius ${0}
+snippet bdts
+ border-top-style ${0}
+snippet bdts:n
+ border-top-style none
+snippet bdtw
+ border-top-width ${0}
+snippet bdt
+ border-top ${0}
+snippet bdt:n
+ border-top none
+snippet bdw
+ border-width ${0}
+snippet bd
+ border ${0}
+snippet bd:n
+ border none
+snippet b
+ bottom ${0}
+snippet b:a
+ bottom auto
+snippet bxsh+
+ box-shadow ${1:0} ${2:0} ${3:0} ${0}
+snippet bxsh
+ box-shadow ${0}
+snippet bxsh:n
+ box-shadow none
+snippet bxz
+ box-sizing ${0}
+snippet bxz:bb
+ box-sizing border-box
+snippet bxz:cb
+ box-sizing content-box
+snippet cps
+ caption-side ${0}
+snippet cps:b
+ caption-side bottom
+snippet cps:t
+ caption-side top
+snippet cl
+ clear ${0}
+snippet cl:b
+ clear both
+snippet cl:l
+ clear left
+snippet cl:n
+ clear none
+snippet cl:r
+ clear right
+snippet cp
+ clip ${0}
+snippet cp:a
+ clip auto
+snippet cp:r
+ clip rect(${1:0} ${2:0} ${3:0} ${0:0})
+snippet c
+ color ${0}
+snippet ct
+ content ${0}
+snippet ct:a
+ content attr(${0})
+snippet ct:cq
+ content close-quote
+snippet ct:c
+ content counter(${0})
+snippet ct:cs
+ content counters(${0})
+snippet ct:ncq
+ content no-close-quote
+snippet ct:noq
+ content no-open-quote
+snippet ct:n
+ content normal
+snippet ct:oq
+ content open-quote
+snippet coi
+ counter-increment ${0}
+snippet cor
+ counter-reset ${0}
+snippet cur
+ cursor ${0}
+snippet cur:a
+ cursor auto
+snippet cur:c
+ cursor crosshair
+snippet cur:d
+ cursor default
+snippet cur:ha
+ cursor hand
+snippet cur:he
+ cursor help
+snippet cur:m
+ cursor move
+snippet cur:p
+ cursor pointer
+snippet cur:t
+ cursor text
+snippet d
+ display ${0}
+snippet d:mib
+ display -moz-inline-box
+snippet d:mis
+ display -moz-inline-stack
+snippet d:b
+ display block
+snippet d:cp
+ display compact
+snippet d:ib
+ display inline-block
+snippet d:itb
+ display inline-table
+snippet d:i
+ display inline
+snippet d:li
+ display list-item
+snippet d:n
+ display none
+snippet d:ri
+ display run-in
+snippet d:tbcp
+ display table-caption
+snippet d:tbc
+ display table-cell
+snippet d:tbclg
+ display table-column-group
+snippet d:tbcl
+ display table-column
+snippet d:tbfg
+ display table-footer-group
+snippet d:tbhg
+ display table-header-group
+snippet d:tbrg
+ display table-row-group
+snippet d:tbr
+ display table-row
+snippet d:tb
+ display table
+snippet ec
+ empty-cells ${0}
+snippet ec:h
+ empty-cells hide
+snippet ec:s
+ empty-cells show
+snippet exp
+ expression()
+snippet fl
+ float ${0}
+snippet fl:l
+ float left
+snippet fl:n
+ float none
+snippet fl:r
+ float right
+snippet f+
+ font ${1:1em} ${2:Arial},${0:sans-serif}
+snippet fef
+ font-effect ${0}
+snippet fef:eb
+ font-effect emboss
+snippet fef:eg
+ font-effect engrave
+snippet fef:n
+ font-effect none
+snippet fef:o
+ font-effect outline
+snippet femp
+ font-emphasize-position ${0}
+snippet femp:a
+ font-emphasize-position after
+snippet femp:b
+ font-emphasize-position before
+snippet fems
+ font-emphasize-style ${0}
+snippet fems:ac
+ font-emphasize-style accent
+snippet fems:c
+ font-emphasize-style circle
+snippet fems:ds
+ font-emphasize-style disc
+snippet fems:dt
+ font-emphasize-style dot
+snippet fems:n
+ font-emphasize-style none
+snippet fem
+ font-emphasize ${0}
+snippet ff
+ font-family ${0}
+snippet ff:c
+ font-family ${0:'Monotype Corsiva','Comic Sans MS'},cursive
+snippet ff:f
+ font-family ${0:Capitals,Impact},fantasy
+snippet ff:m
+ font-family ${0:Monaco,'Courier New'},monospace
+snippet ff:ss
+ font-family ${0:Helvetica,Arial},sans-serif
+snippet ff:s
+ font-family ${0:Georgia,'Times New Roman'},serif
+snippet fza
+ font-size-adjust ${0}
+snippet fza:n
+ font-size-adjust none
+snippet fz
+ font-size ${0}
+snippet fsm
+ font-smooth ${0}
+snippet fsm:aw
+ font-smooth always
+snippet fsm:a
+ font-smooth auto
+snippet fsm:n
+ font-smooth never
+snippet fst
+ font-stretch ${0}
+snippet fst:c
+ font-stretch condensed
+snippet fst:e
+ font-stretch expanded
+snippet fst:ec
+ font-stretch extra-condensed
+snippet fst:ee
+ font-stretch extra-expanded
+snippet fst:n
+ font-stretch normal
+snippet fst:sc
+ font-stretch semi-condensed
+snippet fst:se
+ font-stretch semi-expanded
+snippet fst:uc
+ font-stretch ultra-condensed
+snippet fst:ue
+ font-stretch ultra-expanded
+snippet fs
+ font-style ${0}
+snippet fs:i
+ font-style italic
+snippet fs:n
+ font-style normal
+snippet fs:o
+ font-style oblique
+snippet fv
+ font-variant ${0}
+snippet fv:n
+ font-variant normal
+snippet fv:sc
+ font-variant small-caps
+snippet fw
+ font-weight ${0}
+snippet fw:b
+ font-weight bold
+snippet fw:br
+ font-weight bolder
+snippet fw:lr
+ font-weight lighter
+snippet fw:n
+ font-weight normal
+snippet f
+ font ${0}
+snippet h
+ height ${0}
+snippet h:a
+ height auto
+snippet l
+ left ${0}
+snippet l:a
+ left auto
+snippet lts
+ letter-spacing ${0}
+snippet lh
+ line-height ${0}
+snippet lisi
+ list-style-image url(${0})
+snippet lisi:n
+ list-style-image none
+snippet lisp
+ list-style-position ${0}
+snippet lisp:i
+ list-style-position inside
+snippet lisp:o
+ list-style-position outside
+snippet list
+ list-style-type ${0}
+snippet list:c
+ list-style-type circle
+snippet list:dclz
+ list-style-type decimal-leading-zero
+snippet list:dc
+ list-style-type decimal
+snippet list:d
+ list-style-type disc
+snippet list:lr
+ list-style-type lower-roman
+snippet list:n
+ list-style-type none
+snippet list:s
+ list-style-type square
+snippet list:ur
+ list-style-type upper-roman
+snippet lis
+ list-style ${0}
+snippet lis:n
+ list-style none
+snippet mb
+ margin-bottom ${0}
+snippet mb:a
+ margin-bottom auto
+snippet ml
+ margin-left ${0}
+snippet ml:a
+ margin-left auto
+snippet mr
+ margin-right ${0}
+snippet mr:a
+ margin-right auto
+snippet mt
+ margin-top ${0}
+snippet mt:a
+ margin-top auto
+snippet m
+ margin ${0}
+snippet m:4
+ margin ${1:0} ${2:0} ${3:0} ${0:0}
+snippet m:3
+ margin ${1:0} ${2:0} ${0:0}
+snippet m:2
+ margin ${1:0} ${0:0}
+snippet m:0
+ margin 0
+snippet m:a
+ margin auto
+snippet mah
+ max-height ${0}
+snippet mah:n
+ max-height none
+snippet maw
+ max-width ${0}
+snippet maw:n
+ max-width none
+snippet mih
+ min-height ${0}
+snippet miw
+ min-width ${0}
+snippet op
+ opacity ${0}
+snippet op:ie
+ filter progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100})
+snippet op:ms
+ -ms-filter 'progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100})'
+snippet orp
+ orphans ${0}
+snippet o+
+ outline ${1:1px} ${2:solid} ${0}
+snippet oc
+ outline-color ${0}
+snippet oc:i
+ outline-color invert
+snippet oo
+ outline-offset ${0}
+snippet os
+ outline-style ${0}
+snippet ow
+ outline-width ${0}
+snippet o
+ outline ${0}
+snippet o:n
+ outline none
+snippet ovs
+ overflow-style ${0}
+snippet ovs:a
+ overflow-style auto
+snippet ovs:mq
+ overflow-style marquee
+snippet ovs:mv
+ overflow-style move
+snippet ovs:p
+ overflow-style panner
+snippet ovs:s
+ overflow-style scrollbar
+snippet ovx
+ overflow-x ${0}
+snippet ovx:a
+ overflow-x auto
+snippet ovx:h
+ overflow-x hidden
+snippet ovx:s
+ overflow-x scroll
+snippet ovx:v
+ overflow-x visible
+snippet ovy
+ overflow-y ${0}
+snippet ovy:a
+ overflow-y auto
+snippet ovy:h
+ overflow-y hidden
+snippet ovy:s
+ overflow-y scroll
+snippet ovy:v
+ overflow-y visible
+snippet ov
+ overflow ${0}
+snippet ov:a
+ overflow auto
+snippet ov:h
+ overflow hidden
+snippet ov:s
+ overflow scroll
+snippet ov:v
+ overflow visible
+snippet pb
+ padding-bottom ${0}
+snippet pl
+ padding-left ${0}
+snippet pr
+ padding-right ${0}
+snippet pt
+ padding-top ${0}
+snippet p
+ padding ${0}
+snippet p:4
+ padding ${1:0} ${2:0} ${3:0} ${0:0}
+snippet p:3
+ padding ${1:0} ${2:0} ${0:0}
+snippet p:2
+ padding ${1:0} ${0:0}
+snippet p:0
+ padding 0
+snippet pgba
+ page-break-after ${0}
+snippet pgba:aw
+ page-break-after always
+snippet pgba:a
+ page-break-after auto
+snippet pgba:l
+ page-break-after left
+snippet pgba:r
+ page-break-after right
+snippet pgbb
+ page-break-before ${0}
+snippet pgbb:aw
+ page-break-before always
+snippet pgbb:a
+ page-break-before auto
+snippet pgbb:l
+ page-break-before left
+snippet pgbb:r
+ page-break-before right
+snippet pgbi
+ page-break-inside ${0}
+snippet pgbi:a
+ page-break-inside auto
+snippet pgbi:av
+ page-break-inside avoid
+snippet pos
+ position ${0}
+snippet pos:a
+ position absolute
+snippet pos:f
+ position fixed
+snippet pos:r
+ position relative
+snippet pos:s
+ position static
+snippet q
+ quotes ${0}
+snippet q:en
+ quotes '\201C' '\201D' '\2018' '\2019'
+snippet q:n
+ quotes none
+snippet q:ru
+ quotes '\00AB' '\00BB' '\201E' '\201C'
+snippet rz
+ resize ${0}
+snippet rz:b
+ resize both
+snippet rz:h
+ resize horizontal
+snippet rz:n
+ resize none
+snippet rz:v
+ resize vertical
+snippet r
+ right ${0}
+snippet r:a
+ right auto
+snippet tbl
+ table-layout ${0}
+snippet tbl:a
+ table-layout auto
+snippet tbl:f
+ table-layout fixed
+snippet tal
+ text-align-last ${0}
+snippet tal:a
+ text-align-last auto
+snippet tal:c
+ text-align-last center
+snippet tal:l
+ text-align-last left
+snippet tal:r
+ text-align-last right
+snippet ta
+ text-align ${0}
+snippet ta:c
+ text-align center
+snippet ta:l
+ text-align left
+snippet ta:r
+ text-align right
+snippet td
+ text-decoration ${0}
+snippet td:l
+ text-decoration line-through
+snippet td:n
+ text-decoration none
+snippet td:o
+ text-decoration overline
+snippet td:u
+ text-decoration underline
+snippet te
+ text-emphasis ${0}
+snippet te:ac
+ text-emphasis accent
+snippet te:a
+ text-emphasis after
+snippet te:b
+ text-emphasis before
+snippet te:c
+ text-emphasis circle
+snippet te:ds
+ text-emphasis disc
+snippet te:dt
+ text-emphasis dot
+snippet te:n
+ text-emphasis none
+snippet th
+ text-height ${0}
+snippet th:a
+ text-height auto
+snippet th:f
+ text-height font-size
+snippet th:m
+ text-height max-size
+snippet th:t
+ text-height text-size
+snippet ti
+ text-indent ${0}
+snippet ti:-
+ text-indent -9999px
+snippet tj
+ text-justify ${0}
+snippet tj:a
+ text-justify auto
+snippet tj:d
+ text-justify distribute
+snippet tj:ic
+ text-justify inter-cluster
+snippet tj:ii
+ text-justify inter-ideograph
+snippet tj:iw
+ text-justify inter-word
+snippet tj:k
+ text-justify kashida
+snippet tj:t
+ text-justify tibetan
+snippet to+
+ text-outline ${1:0} ${2:0} ${0}
+snippet to
+ text-outline ${0}
+snippet to:n
+ text-outline none
+snippet tr
+ text-replace ${0}
+snippet tr:n
+ text-replace none
+snippet tsh+
+ text-shadow ${1:0} ${2:0} ${3:0} ${0}
+snippet tsh
+ text-shadow ${0}
+snippet tsh:n
+ text-shadow none
+snippet tt
+ text-transform ${0}
+snippet tt:c
+ text-transform capitalize
+snippet tt:l
+ text-transform lowercase
+snippet tt:n
+ text-transform none
+snippet tt:u
+ text-transform uppercase
+snippet tw
+ text-wrap ${0}
+snippet tw:no
+ text-wrap none
+snippet tw:n
+ text-wrap normal
+snippet tw:s
+ text-wrap suppress
+snippet tw:u
+ text-wrap unrestricted
+snippet t
+ top ${0}
+snippet t:a
+ top auto
+snippet va
+ vertical-align ${0}
+snippet va:bl
+ vertical-align baseline
+snippet va:b
+ vertical-align bottom
+snippet va:m
+ vertical-align middle
+snippet va:sub
+ vertical-align sub
+snippet va:sup
+ vertical-align super
+snippet va:tb
+ vertical-align text-bottom
+snippet va:tt
+ vertical-align text-top
+snippet va:t
+ vertical-align top
+snippet v
+ visibility ${0}
+snippet v:c
+ visibility collapse
+snippet v:h
+ visibility hidden
+snippet v:v
+ visibility visible
+snippet whsc
+ white-space-collapse ${0}
+snippet whsc:ba
+ white-space-collapse break-all
+snippet whsc:bs
+ white-space-collapse break-strict
+snippet whsc:k
+ white-space-collapse keep-all
+snippet whsc:l
+ white-space-collapse loose
+snippet whsc:n
+ white-space-collapse normal
+snippet whs
+ white-space ${0}
+snippet whs:n
+ white-space normal
+snippet whs:nw
+ white-space nowrap
+snippet whs:pl
+ white-space pre-line
+snippet whs:pw
+ white-space pre-wrap
+snippet whs:p
+ white-space pre
+snippet wid
+ widows ${0}
+snippet w
+ width ${0}
+snippet w:a
+ width auto
+snippet wob
+ word-break ${0}
+snippet wob:ba
+ word-break break-all
+snippet wob:bs
+ word-break break-strict
+snippet wob:k
+ word-break keep-all
+snippet wob:l
+ word-break loose
+snippet wob:n
+ word-break normal
+snippet wos
+ word-spacing ${0}
+snippet wow
+ word-wrap ${0}
+snippet wow:no
+ word-wrap none
+snippet wow:n
+ word-wrap normal
+snippet wow:s
+ word-wrap suppress
+snippet wow:u
+ word-wrap unrestricted
+snippet z
+ z-index ${0}
+snippet z:a
+ z-index auto
+snippet zoo
+ zoom 1
+snippet :h
+ :hover
+snippet :fc
+ :first-child
+snippet :lc
+ :last-child
+snippet :nc
+ :nth-child(${0})
+snippet :nlc
+ :nth-last-child(${0})
+snippet :oc
+ :only-child
+snippet :a
+ :after
+snippet :b
+ :before
+snippet ::a
+ ::after
+snippet ::b
+ ::before
+snippet if
+ if ${0}
+snippet mix
+ ${1}(${0})
+snippet for
+ for ${1:i} in ${0}
+snippet keyf
+ @keyframes ${0}
diff --git a/vim/bundle/vim-snippets/snippets/supercollider.snippets b/vim/bundle/vim-snippets/snippets/supercollider.snippets
new file mode 100644
index 0000000..afaefb6
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/supercollider.snippets
@@ -0,0 +1,22 @@
+snippet b
+ (
+ ${0}
+ )
+snippet if
+ if (${1}) {
+ ${0}
+ }
+snippet ife
+ if (${1}) {
+ ${2}
+ } {
+ ${0}
+ }
+snippet for
+ for (${1:1}, ${2:10}) { |i|
+ ${0}
+ }
+snippet sdef
+ SynthDef(\\${1:synthName}, {${2}
+ ${0}
+ }).add;
diff --git a/vim/bundle/vim-snippets/snippets/systemverilog.snippets b/vim/bundle/vim-snippets/snippets/systemverilog.snippets
new file mode 100644
index 0000000..70a9d2d
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/systemverilog.snippets
@@ -0,0 +1,73 @@
+extends verilog
+
+# Foreach Loop
+snippet fe
+ foreach (${1}) begin
+ ${0}
+ end
+# Do-while statement
+snippet dowh
+ do begin
+ ${0}
+ end while (${1});
+# Combinational always block
+snippet alc
+ always_comb begin ${1:: statement_label}
+ ${0}
+ end $1
+# Sequential logic
+snippet alff
+ always_ff @(posedge ${1:clk}) begin ${2:: statement_label}
+ ${0}
+ end $2
+# Latched logic
+snippet all
+ always_latch begin ${1:: statement_label}
+ ${0}
+ end $1
+# Class
+snippet cl
+ class ${1:class_name};
+ // data or class properties
+ ${0}
+
+ // initialization
+ function new();
+ endfunction : new
+
+ endclass : $1
+# Typedef structure
+snippet types
+ typedef struct {
+ ${0}
+ } ${1:name_t};
+# Program block
+snippet prog
+ program ${1:program_name} ();
+ ${0}
+ endprogram : $1
+# Interface block
+snippet intf
+ interface ${1:program_name} ();
+ // nets
+ ${0}
+ // clocking
+
+ // modports
+
+ endinterface : $1
+# Clocking Block
+snippet clock
+ clocking ${1:clocking_name} @(${2:posedge} ${3:clk});
+ ${0}
+ endclocking : $1
+# Covergroup construct
+snippet cg
+ covergroup ${1:group_name} @(${2:posedge} ${3:clk});
+ ${0}
+ endgroup : $1
+# Package declaration
+snippet pkg
+ package ${1:package_name};
+ ${0}
+ endpackage : $1
diff --git a/vim/bundle/vim-snippets/snippets/tcl.snippets b/vim/bundle/vim-snippets/snippets/tcl.snippets
new file mode 100644
index 0000000..9da703c
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/tcl.snippets
@@ -0,0 +1,96 @@
+# #!/usr/bin/env tclsh
+snippet #!
+ #!/usr/bin/env tclsh
+
+# Process
+snippet pro
+ proc ${1:function_name} {${2:args}} {
+ ${0}
+ }
+#xif
+snippet xif
+ ${1:expr}? ${2:true} : ${0:false}
+# Conditional
+snippet if
+ if {${1}} {
+ ${0}
+ }
+# Conditional if..else
+snippet ife
+ if {${1}} {
+ ${2}
+ } else {
+ ${0:# else...}
+ }
+snippet eif
+ elseif {${1}} {
+ ${0}
+ }
+# Conditional if..elsif..else
+snippet ifee
+ if {${1}} {
+ ${2}
+ } elseif {${3}} {
+ ${4:# elsif...}
+ } else {
+ ${0:# else...}
+ }
+# If catch then
+snippet ifc
+ if { [catch {${1:#do something...}} ${2:err}] } {
+ ${0:# handle failure...}
+ }
+# Catch
+snippet catch
+ catch {${1}} ${2:err} ${0:options}
+# While Loop
+snippet wh
+ while {${1}} {
+ ${0}
+ }
+# For Loop
+snippet for
+ for {set ${2:var} 0} {$$2 < ${1:count}} {${3:incr} $2} {
+ ${0}
+ }
+# Foreach Loop
+snippet fore
+ foreach ${1:x} {${2:#list}} {
+ ${0}
+ }
+# after ms script...
+snippet af
+ after ${1:ms} ${0:#do something}
+# after cancel id
+snippet afc
+ after cancel ${0:id or script}
+# after idle
+snippet afi
+ after idle ${0:script}
+# after info id
+snippet afin
+ after info ${0:id}
+# Expr
+snippet exp
+ expr {${0:#expression here}}
+# Switch
+snippet sw
+ switch ${1:var} {
+ ${3:pattern 1} {
+ ${0:#do something}
+ }
+ default {
+ ${2:#do something}
+ }
+ }
+# Case
+snippet ca
+ ${1:pattern} {
+ ${2:#do something}
+ }
+# Namespace eval
+snippet ns
+ namespace eval ${1:path} {${0:#script...}}
+# Namespace current
+snippet nsc
+ namespace current
diff --git a/vim/bundle/vim-snippets/snippets/tex.snippets b/vim/bundle/vim-snippets/snippets/tex.snippets
new file mode 100644
index 0000000..68ac5d0
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/tex.snippets
@@ -0,0 +1,317 @@
+#PREAMBLE
+#newcommand
+snippet nc \newcommand
+ \newcommand{\\${1:cmd}}[${2:opt}]{${3:realcmd}} ${0}
+#usepackage
+snippet up \usepackage
+ \usepackage[${1:options}]{${2:package}} ${0}
+#newunicodechar
+snippet nuc \newunicodechar
+ \newunicodechar{${1}}{${2:\ensuremath}${3:tex-substitute}}} ${0}
+#DeclareMathOperator
+snippet dmo \DeclareMathOperator
+ \DeclareMathOperator{${1}}{${2}} ${0}
+
+#DOCUMENT
+# \begin{}...\end{}
+snippet begin \begin{} ... \end{} block
+ \begin{${1:env}}
+ ${0:${VISUAL}}
+ \end{$1}
+# Tabular
+snippet tab tabular (or arbitrary) environment
+ \begin{${1:tabular}}{${2:c}}
+ ${0:${VISUAL}}
+ \end{$1}
+snippet thm thm (or arbitrary) environment with optional argument
+ \begin[${1:author}]{${2:thm}}
+ ${0:${VISUAL}}
+ \end{$2}
+snippet center center environment
+ \begin{center}
+ ${0:${VISUAL}}
+ \end{center}
+# Align(ed)
+snippet ali align(ed) environment
+ \begin{align${1:ed}}
+ \label{eq:${2}}
+ ${0:${VISUAL}}
+ \end{align$1}
+# Gather(ed)
+snippet gat gather(ed) environment
+ \begin{gather${1:ed}}
+ ${0:${VISUAL}}
+ \end{gather$1}
+# Equation
+snippet eq equation environment
+ \begin{equation}
+ ${0:${VISUAL}}
+ \end{equation}
+# Equation
+snippet eql Labeled equation environment
+ \begin{equation}
+ \label{eq:${2}}
+ ${0:${VISUAL}}
+ \end{equation}
+# Equation
+snippet eq* unnumbered equation environment
+ \begin{equation*}
+ ${0:${VISUAL}}
+ \end{equation*}
+# Unnumbered Equation
+snippet \ unnumbered equation: \[ ... \]
+ \[
+ ${0:${VISUAL}}
+ \]
+# Equation array
+snippet eqnarray eqnarray environment
+ \begin{eqnarray}
+ ${0:${VISUAL}}
+ \end{eqnarray}
+# Label
+snippet lab \label
+ \label{${1:eq:}${2:fig:}${3:tab:}${0}}
+# Enumerate
+snippet enum enumerate environment
+ \begin{enumerate}
+ \item ${0}
+ \end{enumerate}
+snippet enuma enumerate environment
+ \begin{enumerate}[(a)]
+ \item ${0}
+ \end{enumerate}
+snippet enumi enumerate environment
+ \begin{enumerate}[(i)]
+ \item ${0}
+ \end{enumerate}
+# Itemize
+snippet itemize itemize environment
+ \begin{itemize}
+ \item ${0}
+ \end{itemize}
+snippet item \item
+ \item ${1:${VISUAL}}
+# Description
+snippet desc description environment
+ \begin{description}
+ \item[${1}] ${0}
+ \end{description}
+# Endless new item
+snippet ]i \item (recursive)
+ \item ${1}
+ ${0:]i}
+# Matrix
+snippet mat smart matrix environment
+ \begin{${1:p/b/v/V/B/small}matrix}
+ ${0:${VISUAL}}
+ \end{$1matrix}
+# Cases
+snippet cas cases environment
+ \begin{cases}
+ ${1:equation}, &\text{ if }${2:case}\\
+ ${0:${VISUAL}}
+ \end{cases}
+# Split
+snippet spl split environment
+ \begin{split}
+ ${0:${VISUAL}}
+ \end{split}
+# Part
+snippet part document \part
+ \part{${1:part name}} % (fold)
+ \label{prt:${2:$1}}
+ ${0}
+ % part $2 (end)
+# Chapter
+snippet cha \chapter
+ \chapter{${1:chapter name}}
+ \label{cha:${2:$1}}
+ ${0}
+# Section
+snippet sec \section
+ \section{${1:section name}}
+ \label{sec:${2:$1}}
+ ${0}
+# Section without number
+snippet sec* \section*
+ \section*{${1:section name}}
+ \label{sec:${2:$1}}
+ ${0}
+# Sub Section
+snippet sub \subsection
+ \subsection{${1:subsection name}}
+ \label{sub:${2:$1}}
+ ${0}
+# Sub Section without number
+snippet sub* \subsection*
+ \subsection*{${1:subsection name}}
+ \label{sub:${2:$1}}
+ ${0}
+# Sub Sub Section
+snippet subs \subsubsection
+ \subsubsection{${1:subsubsection name}}
+ \label{ssub:${2:$1}}
+ ${0}
+# Sub Sub Section without number
+snippet subs* \subsubsection*
+ \subsubsection*{${1:subsubsection name}}
+ \label{ssub:${2:$1}}
+ ${0}
+# Paragraph
+snippet par \paragraph
+ \paragraph{${1:paragraph name}}
+ \label{par:${2:$1}}
+ ${0}
+# Sub Paragraph
+snippet subp \subparagraph
+ \subparagraph{${1:subparagraph name}}
+ \label{subp:${2:$1}}
+ ${0}
+snippet ni \noindent
+ \noindent
+ ${0}
+#References
+snippet itd description \item
+ \item[${1:description}] ${0:item}
+snippet figure reference to a figure
+ ${1:Figure}~\ref{${2:fig:}}
+snippet table reference to a table
+ ${1:Table}~\ref{${2:tab:}}
+snippet listing reference to a listing
+ ${1:Listing}~\ref{${2:list}}
+snippet section reference to a section
+ ${1:Section}~\ref{sec:${2}} ${0}
+snippet page reference to a page
+ ${1:page}~\pageref{${2}} ${0}
+snippet index \index
+ \index{${1:index}} ${0}
+#Citations
+snippet citen \citen
+ \citen{${1}} ${0}
+# natbib citations
+snippet citep \citep
+ \citep{${1}} ${0}
+snippet citet \citet
+ \citet{${1}} ${0}
+snippet cite \cite[]{}
+ \cite[${1}]{${2}} ${0}
+snippet citea \citeauthor
+ \citeauthor{${1}} ${0}
+snippet citey \citeyear
+ \citeyear{${1}} ${0}
+snippet fcite \footcite[]{}
+ \footcite[${1}]{${2}}${0}
+#Formating text: italic, bold, underline, small capital, emphase ..
+snippet it italic text
+ \textit{${0:${VISUAL:text}}}
+snippet bf bold face text
+ \textbf{${0:${VISUAL:text}}}
+snippet under underline text
+ \underline{${0:${VISUAL:text}}}
+snippet emp emphasize text
+ \emph{${0:${VISUAL:text}}}
+snippet sc small caps text
+ \textsc{${0:${VISUAL:text}}}
+#Choosing font
+snippet sf sans serife text
+ \textsf{${0:${VISUAL:text}}}
+snippet rm roman font text
+ \textrm{${0:${VISUAL:text}}}
+snippet tt typewriter (monospace) text
+ \texttt{${0:${VISUAL:text}}}
+#Math font
+snippet mf mathfrak
+ \mathfrak{${0:${VISUAL:text}}}
+snippet mc mathcal
+ \mathcal{${0:${VISUAL:text}}}
+snippet ms mathscr
+ \mathscr{${0:${VISUAL:text}}}
+#misc
+snippet ft \footnote
+ \footnote{${0:${VISUAL:text}}}
+snippet fig figure environment (includegraphics)
+ \begin{figure}
+ \begin{center}
+ \includegraphics[scale=${1}]{Figures/${2}}
+ \end{center}
+ \caption{${3}}
+ \label{fig:${4}}
+ \end{figure}
+ ${0}
+snippet tikz figure environment (tikzpicture)
+ \begin{figure}
+ \begin{center}
+ \begin{tikzpicture}[scale=${1:1}]
+ ${2}
+ \end{tikzpicture}
+ \end{center}
+ \caption{${3}}
+ \label{fig:${4}}
+ \end{figure}
+ ${0}
+#math
+snippet stackrel \stackrel{}{}
+ \stackrel{${1:above}}{${2:below}} ${0}
+snippet frac \frac{}{}
+ \frac{${1:num}}{${2:denom}} ${0}
+snippet sum \sum^{}_{}
+ \sum^{${1:n}}_{${2:i=1}} ${0}
+snippet lim \lim_{}
+ \lim_{${1:n \to \infty}} ${0}
+snippet frame frame environment
+ \begin{frame}[${1:t}]{${2:title}}
+ ${0:${VISUAL}}
+ \end{frame}
+snippet block block environment
+ \begin{block}{${1:title}}
+ ${0:${VISUAL}}
+ \end{block}
+snippet alert alertblock environment
+ \begin{alertblock}{${1:title}}
+ ${0:${VISUAL}}
+ \end{alertblock}
+snippet example exampleblock environment
+ \begin{exampleblock}{${1:title}}
+ ${0:${VISUAL}}
+ \end{exampleblock}
+snippet col2 two-column environment
+ \begin{columns}
+ \begin{column}{0.5\textwidth}
+ ${1}
+ \end{column}
+ \begin{column}{0.5\textwidth}
+ ${0}
+ \end{column}
+ \end{columns}
+snippet \{ \{ \}
+ \\{ ${0} \\}
+#delimiter
+snippet lr left right
+ \left${1} ${0} \right$1
+snippet lr( left( right)
+ \left( ${0} \right)
+snippet lr| left| right|
+ \left| ${0} \right|
+snippet lr{ left\{ right\}
+ \left\\{ ${0} \right\\}
+snippet lr[ left[ right]
+ \left[ ${0} \right]
+snippet lra langle rangle
+ \langle ${0} \rangle
+# Code listings
+snippet lst
+ \begin{listing}[language=${1:language}]
+ ${0:${VISUAL}}
+ \end{listing}
+snippet lsi
+ \lstinline|${1}| ${0}
+# Hyperlinks
+snippet url
+ \url{${1}} ${0}
+snippet href
+ \href{${1}}{${2}} ${0}
+# URL from Clipboard.
+snippet urlc
+ \url{`@+`} ${0}
+snippet hrefc
+ \href{`@+`}{${1}} ${0}
diff --git a/vim/bundle/vim-snippets/snippets/textile.snippets b/vim/bundle/vim-snippets/snippets/textile.snippets
new file mode 100644
index 0000000..1522bad
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/textile.snippets
@@ -0,0 +1,30 @@
+# Jekyll post header
+snippet header
+ ---
+ title: ${1:title}
+ layout: post
+ date: ${2:date} ${0:hour:minute:second} -05:00
+ ---
+
+# Image
+snippet img
+ !${1:url}(${2:title}):${0:link}!
+
+# Table
+snippet |
+ |${1}|
+
+# Link
+snippet link
+ "${1:link text}":${0:url}
+
+# Acronym
+snippet (
+ (${1:Expand acronym})
+
+# Footnote
+snippet fn
+ [${1:ref number}] ${0}
+
+ fn$1. ${2:footnote}
+
diff --git a/vim/bundle/vim-snippets/snippets/twig.snippets b/vim/bundle/vim-snippets/snippets/twig.snippets
new file mode 100644
index 0000000..47997c3
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/twig.snippets
@@ -0,0 +1,34 @@
+snippet bl "{% block xyz %} .. {% endblock xyz %}"
+ {% block ${1} %}
+ ${2}
+ {% endblock $1 %}
+snippet js "{% javascripts 'xyz' %} .. {% endjavascripts %}"
+ {% javascripts '${1}' %}
+ <script src="{{ asset_url }}"></script>
+ {% endjavascripts %}
+snippet css "{% stylesheets 'xyz' %} .. {% endstylesheets %}"
+ {% stylesheets '${1}' %}
+ <link rel="stylesheet" href="{{ asset_url }}">
+ {% endstylesheets %}
+snippet if "{% if %} .. {% endif %}"
+ {% if ${1} %}
+ ${2}
+ {% endif %}
+snippet ife "{% if %} .. {% else %} .. {% endif %}"
+ {% if ${1} %}
+ ${2}
+ {% else %}
+ ${0}
+ {% endif %}
+snippet el "{% else %}"
+ {% else %}
+ ${0}
+snippet eif "{% elseif %}"
+ {% elseif ${1} %}
+ ${0}
+snippet for "{% for x in y %} .. {% endfor %}"
+ {% for ${1} in ${2} %}
+ ${3}
+ {% endfor %}
+snippet ext "{% extends xyz %}"
+ {% extends ${1} %}
diff --git a/vim/bundle/vim-snippets/snippets/verilog.snippets b/vim/bundle/vim-snippets/snippets/verilog.snippets
new file mode 100644
index 0000000..5cd80f3
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/verilog.snippets
@@ -0,0 +1,63 @@
+# if statement
+snippet if
+ if (${1}) begin
+ ${0}
+ end
+# If/else statements
+snippet ife
+ if (${1}) begin
+ ${2}
+ end
+ else begin
+ ${1}
+ end
+# Else if statement
+snippet eif
+ else if (${1}) begin
+ ${0}
+ end
+#Else statement
+snippet el
+ else begin
+ ${0}
+ end
+# While statement
+snippet wh
+ while (${1}) begin
+ ${0}
+ end
+# Repeat Loop
+snippet rep
+ repeat (${1}) begin
+ ${0}
+ end
+# Case statement
+snippet case
+ case (${1:/* variable */})
+ ${2:/* value */}: begin
+ ${3}
+ end
+ default: begin
+ ${4}
+ end
+ endcase
+# CaseZ statement
+snippet casez
+ casez (${1:/* variable */})
+ ${2:/* value */}: begin
+ ${3}
+ end
+ default: begin
+ ${4}
+ end
+ endcase
+# Always block
+snippet al
+ always @(${1:/* sensitive list */}) begin
+ ${0}
+ end
+# Module block
+snippet mod
+ module ${1:module_name} (${2});
+ ${0}
+ endmodule
diff --git a/vim/bundle/vim-snippets/snippets/vim.snippets b/vim/bundle/vim-snippets/snippets/vim.snippets
new file mode 100644
index 0000000..b299f51
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/vim.snippets
@@ -0,0 +1,52 @@
+snippet header standard Vim script file header
+ " File: ${1:`expand('%:t')`}
+ " Author: ${2:`g:snips_author`}
+ " Description: ${3}
+ ${0:" Last Modified: `strftime("%B %d, %Y")`}
+snippet guard script reload guard
+ if exists('${1:did_`vim_snippets#Filename()`}') || &cp${2: || version < 700}
+ finish
+ endif
+ let $1 = 1${0}
+snippet f function
+ fun! ${1:`expand('%') =~ 'autoload' ? substitute(matchstr(expand('%:p'),'autoload/\zs.*\ze.vim'),'[/\\]','#','g').'#' : ''`}${2:function_name}(${3})
+ ${0}
+ endf
+snippet t try ... catch statement
+ try
+ ${1}
+ catch ${2}
+ ${0}
+ endtry
+snippet for for ... in loop
+ for ${1} in ${2}
+ ${0}
+ endfor
+snippet forkv for [key, value] in loop
+ for [${1},${2}] in items(${3})
+ ${0}
+ unlet $1 $2
+ endfor
+snippet wh while loop
+ while ${1}
+ ${0}
+ endw
+snippet if if statement
+ if ${1}
+ ${0}
+ endif
+snippet ife if ... else statement
+ if ${1}
+ ${2}
+ else
+ ${0}
+ endif
+snippet au augroup ... autocmd block
+ augroup ${1:AU_NAME}
+ " this one is which you're most likely to use?
+ autocmd ${2:BufRead,BufNewFile} ${3:*.ext,*.ext3|<buffer[=N]>} ${0}
+ augroup end
+snippet bun Vundle.vim Plugin definition
+ Plugin '${0}'
+snippet plug Vundle.vim Plugin definition
+ Plugin '${0}'
diff --git a/vim/bundle/vim-snippets/snippets/xml.snippets b/vim/bundle/vim-snippets/snippets/xml.snippets
new file mode 100644
index 0000000..0ab346b
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/xml.snippets
@@ -0,0 +1,12 @@
+# xml declaration
+snippet xml
+ <?xml version="1.0" encoding="UTF-8"?>
+# tag
+snippet t
+ <${1:}>
+ ${2}
+ </$1>
+# inline tag
+snippet ti
+ <${1:}>${2}</$1>
+
diff --git a/vim/bundle/vim-snippets/snippets/xslt.snippets b/vim/bundle/vim-snippets/snippets/xslt.snippets
new file mode 100644
index 0000000..700e77d
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/xslt.snippets
@@ -0,0 +1,97 @@
+snippet apply-templates with-param
+ <xsl:apply-templates select="${1:*}">
+ <xsl:with-param name="${2:param}">${3}</xsl:with-param>${4}
+ </xsl:apply-templates>
+
+snippet apply-templates sort-by
+ <xsl:apply-templates select="${1:*}">
+ <xsl:sort select="${2:node}" order="${3:ascending}" data-type="${4:text}">${5}
+ </xsl:apply-templates>
+
+snippet apply-templates plain
+ <xsl:apply-templates select="${1:*}" />
+
+snippet attribute blank
+ <xsl:attribute name="${1:name}">${2}</xsl:attribute>
+
+snippet attribute value-of
+ <xsl:attribute name="${1:name}">
+ <xsl:value-of select="${2:*}" />
+ </xsl:attribute>
+
+snippet call-template
+ <xsl:call-template name="${1:template}" />
+
+snippet call-template with-param
+ <xsl:call-template name="${1:template}">
+ <xsl:with-param name="${2:param}">${3}</xsl:with-param>${4}
+ </xsl:call-template>
+
+snippet choose
+ <xsl:choose>
+ <xsl:when test="${1:value}">
+ ${2}
+ </xsl:when>
+ </xsl:choose>
+
+snippet copy-of
+ <xsl:copy-of select="${1:*}" />
+
+snippet for-each
+ <xsl:for-each select="${1:*}">${2}
+ </xsl:for-each>
+
+snippet if
+ <xsl:if test="${1:test}">${2}
+ </xsl:if>
+
+snippet import
+ <xsl:import href="${1:stylesheet}" />
+
+snippet include
+ <xsl:include href="${1:stylesheet}" />
+
+snippet otherwise
+ <xsl:otherwise>${0}
+ </xsl:otherwise>
+
+snippet param
+ <xsl:param name="${1:name}">${2}
+ </xsl:param>
+
+snippet stylesheet
+ <xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">${0}
+ </xsl:stylesheet>
+
+snippet template
+ <xsl:template match="${1:*}">${0}
+ </xsl:template>
+
+snippet template named
+ <xsl:template name="${1:name}">${0}
+ </xsl:template>
+
+snippet text
+ <xsl:text>${0}</xsl:text>
+
+snippet value-of
+ <xsl:value-of select="${1:*}" />
+
+snippet variable blank
+ <xsl:variable name="${1:name}">${0}
+ </xsl:variable>
+
+snippet variable select
+ <xsl:variable select="${1:*}" />
+
+snippet when
+ <xsl:when test="${1:test}">${0}
+ </xsl:when>
+
+snippet with-param
+ <xsl:with-param name="${1:name}">${0}</xsl:with-param>
+
+snippet with-param select
+ <xsl:with-param name="${1:name}" select="${0:*}" />
+
diff --git a/vim/bundle/vim-snippets/snippets/yii-chtml.snippets b/vim/bundle/vim-snippets/snippets/yii-chtml.snippets
new file mode 100644
index 0000000..e827901
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/yii-chtml.snippets
@@ -0,0 +1,248 @@
+#--------------------Yii CHtml---------------------------------
+#Yii CHtml::radioButton
+snippet yhrb
+ echo CHtml::radioButton('${1:name}', ${2:false},array(${3:optionName}=>${0:optionValue} );
+
+#Yii CHtml::asset
+snippet yhass
+ echo CHtml::asset('${0:path}');
+
+#Yii CHtml::activeLabelEx
+snippet yhale
+ echo CHtml::activeLabelEx(${1:model}, '${2:attribute}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::encodeArray
+snippet yheca
+ echo CHtml::encodeArray(array(${0}));
+
+#Yii CHtml::normalizeUrl
+snippet yhnurl
+ echo CHtml::normalizeUrl(array('${0}'));
+
+#Yii CHtml::resetButton
+snippet yhsb
+ echo CHtml::submitButton('${1:label}',array('${2:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::linkButton
+snippet yhlinkb
+ echo CHtml::linkButton('${1:lable}',array('${2:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::activeTextArea
+snippet yhata
+ echo CHtml::activeTextArea(${1:model}, '${2:attribute}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::ajaxButton
+snippet yhajb
+ echo CHtml::ajaxButton('${1:label}', '${2:url}',array('${3:ajaxOptionName}'=>${4:ajaxOptionValue}),array('${5:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::activeId
+snippet yhai
+ echo CHtml::activeId(${1:model}, '${0:attribute}');
+
+#Yii CHtml::activeCheckBox
+snippet yhacb
+ echo CHtml::activeCheckBox(${1:model}, '${2:attribute}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::activeHiddenField
+snippet yhahf
+ echo CHtml::activeHiddenField(${1:model}, '${2:attribute}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::encode
+snippet yhec
+ echo CHtml::encode(${0:text});
+
+#Yii CHtml::metaTag
+snippet yhmtag
+ echo CHtml::metaTag('${1:content}', '${2:name}', '${3:httpEquiv}',array('${4:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::dropDownList
+snippet yhddl
+ echo CHtml::dropDownList('${1:name}', '${2:select}', array(${3}),array('${4:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::listBox
+snippet yhlb
+ echo CHtml::listBox('${1:name}', '${2:select}',array(${3}),array('${4:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::script
+snippet yhjs
+ echo CHtml::script('${0:test}');
+
+#Yii CHtml::ajax
+snippet yhaj
+ echo CHtml::ajax(array(${0}));
+
+#Yii CHtml::textField
+snippet yhtf
+ echo CHtml::textField('${1:name}', '${2:value}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::activePasswordField
+snippet yhapf
+ echo CHtml::activePasswordField(${1:model}, '${2:attribute}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::listData
+snippet yhld
+ echo CHtml::listData(array(${1}),'${2:valueField}', '${3:textField}','${0:groupField}');
+
+#Yii CHtml::mailto
+snippet yhmt
+ echo CHtml::mailto('${1:text}', '${2:email}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::image
+snippet yhimg
+ echo CHtml::image('${1:src}', '${2:alt}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::activeListBox
+snippet yhalb
+ echo CHtml::activeListBox(${1:model}, '${2:attribute}', array(${3}),array('${4:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::activeFileField
+snippet yhaff
+ echo CHtml::activeFileField(${1:model}, '${2:attribute}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::closeTag
+snippet yhct
+ echo CHtml::closeTag('${0:tag}');
+
+#Yii CHtml::activeInputField
+snippet yhaif
+ echo CHtml::activeInputField('${1:type}', ${2:model}, '${3:attribute}',array('${4:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::scriptFile
+snippet yhjsf
+ echo CHtml::scriptFile('${0:url}');
+
+#Yii CHtml::radioButtonList
+snippet yhrbl
+ echo CHtml::radioButtonList('${1:name}', ${2:select}, array(${3}),array('${4:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::cssFile
+snippet yhcssf
+ echo CHtml::cssFile('${1:url}','${0:media}');
+
+#Yii CHtml::error
+snippet yherr
+ echo CHtml::error(${1:model}, '${0:attribute}');
+
+#Yii CHtml::passwordField
+snippet yhpf
+ echo CHtml::passwordField('${1:name}', '${2:value}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::hiddenField
+snippet yhhf
+ echo CHtml::hiddenField('${1:name}', '${2:value}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::cdata
+snippet yhc
+ echo CHtml::cdata(${0:text});
+
+#Yii CHtml::link
+snippet yhlink
+ echo CHtml::link('${1:text}',array(${2}),array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::errorSummary
+snippet yherrs
+ echo CHtml::errorSummary(${1:model},'${2:headerHtml}','${0:footerHtml}');
+
+#Yii CHtml::tag
+snippet yht
+ echo CHtml::tag('${1:tag}',array('${2:optionName}'=>${3:optionValue}),${4:false},${0:true});
+
+#Yii CHtml::ajaxLink
+snippet yhajl
+ echo CHtml::ajaxLink('${1:label}', '${2:url}',array('${3:ajaxOptionName}'=>${4:ajaxOptionValue}),array('${5:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::label
+snippet yhlabel
+ echo CHtml::label('${1:label}', '${2:for}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::activeName
+snippet yhan
+ echo CHtml::activeName(${1:model}, '${0:attribute}');
+
+#Yii CHtml::statefulForm
+snippet yhsform
+ echo CHtml::statefulForm(array('${1}'), '${2:post}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::fileField
+snippet yhff
+ echo CHtml::fileField('${1:name}', '${2:value}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::activeTextField
+snippet yhatf
+ echo CHtml::activeTextField(${1:model}, '${2:attribute}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::css
+snippet yhcss
+ echo CHtml::css('${1:test}','${0:media}');
+
+#Yii CHtml::imageButton
+snippet yhimgb
+ echo CHtml::imageButton('${1:src}',array('${2:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::ajaxSubmitButton
+snippet yhajsb
+ echo CHtml::ajaxSubmitButton('${1:label}', '${2:url}',array('${3:ajaxOptionName}'=>${4:ajaxOptionValue}),array('${5:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::button
+snippet yhb
+ echo CHtml::button('${1:label}',array('${2:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::listOptions
+snippet yhlo
+ echo CHtml::listOptions('${1:selection}', array(${2}), array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::activeCheckBoxList
+snippet yhacbl
+ echo CHtml::activeCheckBoxList(${1:model}, '${2:attribute}', array(${3}),array('${4:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::openTag
+snippet yhot
+ echo CHtml::openTag('${1:tag}', array('${2:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::checkBox
+snippet yhcb
+ echo CHtml::checkBox('${1:name}', ${2:false}, array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::textArea
+snippet yhta
+ echo CHtml::textArea('${1:name}', '${2:value}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::linkTag
+snippet yhlinkt
+ echo CHtml::linkTag('${1:relation}', '${2:type}', '${3:href}', '${4:media}',array('${5:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::resetButton
+snippet yhrsb
+ echo CHtml::resetButton('${1:label}',array('${2:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::activeRadioButtonList
+snippet yharbl
+ echo CHtml::activeRadioButtonList(${1:model}, '${2:attribute}', array(${3}),array('${4:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::checkBoxList
+snippet yhcbl
+ echo CHtml::checkBoxList('${1:name}', ${2:select}, array(${3}),array('${4:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::form
+snippet yhform
+ echo CHtml::form(array('${1}'), '${2:post}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::beginForm
+snippet yhbeform
+ echo CHtml::beginForm(array('${1}'), '${2:post}',array('${3:optionName}'=>${4:optionValue}));
+ ${0}
+ echo CHtml::endForm();
+
+#Yii CHtml::activeDropDownList
+snippet yhaddl
+ echo CHtml::activeDropDownList(${1:model}, '${2:attribute}', array(${3}),array('${4:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::activeRadioButton
+snippet yharb
+ echo CHtml::activeRadioButton(${1:model}, '${2:attribute}',array('${3:optionName}'=>${0:optionValue}));
+
+#Yii CHtml::activeLabel
+snippet yhal
+ echo CHtml::activeLabel(${1:model}, '${2:attribute}',array('${3:optionName}'=>${0:optionValue}));
+
+
diff --git a/vim/bundle/vim-snippets/snippets/yii.snippets b/vim/bundle/vim-snippets/snippets/yii.snippets
new file mode 100644
index 0000000..1f9fc6f
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/yii.snippets
@@ -0,0 +1,300 @@
+#Yii session offset
+snippet yse
+ Yii::app()->session['${0}'];
+
+#Yii renderDynamic
+snippet yrd
+ $this->renderDynamic('${0:callback}');
+
+#Yii set cache
+snippet ycas
+ Yii::app()->cache->set('${1:key}', ${2:value}, ${3:expire}, new C${4:}CacheDependency(${0}));
+
+#Yii Add cache
+snippet ycad
+ Yii::app()->cache->add('${1:key}', ${2:value}, ${3:expire}, new C${4}CacheDependency(${0}));
+
+#Yii register CSS file
+snippet yregcf
+ Yii::app()->clientScript->registerCssFile('${0:file}');
+
+#Yii requestType
+snippet yreqtype
+ Yii::app()->request->requestType
+
+#Yii isAjaxRequest
+snippet yisajax
+ Yii::app()->request->isAjaxRequest
+
+#Yii translate
+snippet yt
+ Yii::t('${1:category}', '${2:message}',array(${0}));
+
+#Yii register CSS
+snippet yregc
+ Yii::app()->clientScript->registerCss('${1:id}', '${0}');
+
+#Yii log
+snippet ylog
+ Yii::log('${1:msg}', '${0:info}');
+
+#Yii userHostAddress
+snippet yuserip
+ YYii::app()->request->userHostAddress
+
+#Yii register script file
+snippet yregsf
+ Yii::app()->clientScript->registerScriptFile('${1:scriptUrl}', CClientScript::POS_${0:END});
+
+#Yii CLinkPager
+snippet ylinkpager
+ $this->widget('CLinkPager', array('pages'=>$pages,'header'=>'${0}'}))
+
+#Yii CJSON::encode
+snippet yjec
+ CJSON::encode(${0:text});
+
+#CActiveDataProvider
+snippet yadp
+ $dataProvider = new CActiveDataProvider('${1}', array(
+ 'criteria' => array(
+ 'condition' => '${2}',
+ 'order' => '${3}',
+ 'with' => array('${4}')
+ ),
+ //'pagination' => false,
+ 'pagination' => array(
+ 'pageSize'=>${5},
+ ),
+ ));
+ ${0}
+ // $dataProvider->getData() will return a list of Post objects
+
+#Yii renderDynamic internal
+snippet yrdi
+ $this->renderDynamic('${1:callback}', array('${2:key}'=>${0:value}));
+
+#Yii register script
+snippet yregs
+ Yii::app()->clientScript->registerScript('${1:id}', '${2}', CClientScript::POS_${0:READY});
+
+#Yii Flush cache
+snippet ycaf
+ Yii::app()->cache->flush();
+
+#Yii Yii::app()->request->cookies
+snippet yco
+ Yii::app()->request->cookies['${0}']
+
+#Yii user->
+snippet yuser
+ Yii::app()->user->
+
+#Yii refresh
+snippet yrf
+ $this->refresh();
+
+#Yii import
+snippet yimp
+ Yii::import('${0}');
+
+#Yii trace
+snippet ytrace
+ Yii::trace('${0:msg}');
+
+#Yii params
+snippet ypar
+ Yii::app()->params['${0}']
+
+#Yii isPostRequest
+snippet yispost
+ Yii::app()->request->isPostRequest
+
+#Yii IF isAjaxRequest
+snippet yifisajax
+ if(Yii::app()->request->isAjaxRequest == TRUE)
+ {
+ ${0}
+ }
+
+#Yii Yii::app()->cache->delete
+snippet ydelcache
+ Yii::app()->cache->delete('${0:key}');
+
+#Yii render view
+snippet yr
+ $this->render('${1:view}',array('${2:key}'=>${0:value}));
+
+#Yii redirect
+snippet yre
+ $this->redirect(array('${1:controller}/${0:action}'));
+
+#Yii Get cache
+snippet ycag
+ Yii::app()->cache->get('${0:key}');
+
+#Yii render text
+snippet yrt
+ $this->renderText('${0}');
+
+#Yii render partial
+snippet yrp
+ $this->renderPartial('${1:view}',array('${2:key}'=>${0:value}));
+
+#----------------Yii Model-----------------------------
+#Yii Model count
+snippet ycountm
+ ${1:ModelName}::model()->count(${2:condition}, array('${3:key}'=>${0:value}));
+
+#Yii Model countBySql
+snippet ycountbs
+ ${1:ModelName}::model()->countBySql(${2:sql},array('${3:key}'=>${0:value}));
+
+#Yii Model updateAll
+snippet yupdatea
+ ${1:ModelName}::model()->updateAll(${2:array('attributes')}, ${3:condition},array('${4:key}'=>${0:value}));
+
+#Yii Model updateByPk
+snippet yupdatebp
+ ${1:ModelName}::model()->updateByPk(${2:pk}, ${3:array('attributes')}, ${4:condition},array('${5:key}'=>${0:value}));
+
+#Yii Model deleteAll
+snippet ydela
+ ${1:ModelName}::model()->deleteAll(${2:condition},array('${3:key}'=>${0:value}));
+
+#Yii Model deleteByPk
+snippet ydelbp
+ ${1:ModelName}::model()->deleteByPk(${2:pk}, ${3:condition}, array('${4:key}'=>${0:value}));
+
+#Yii Model find
+snippet yfind
+ ${1:ModelName}::model()->find(${2:condition},array('${3:key}'=>${0:value}));
+
+#Yii Model findAll
+snippet yfinda
+ ${1:ModelName}::model()->findAll(${2:condition},array('${3:key}'=>${0:value}));
+
+#Yii Model findByPk
+snippet yfindbp
+ ${1:ModelName}::model()->findByPk(${2:pk}, ${3:condition}, array('${4:key}'=>${0:value}));
+
+#Yii Model findAllByPk
+snippet yfindabp
+ ${1:ModelName}::model()->findAllByPk(${2:pk}, ${3:condition},array('${4:key}'=>${0:value}));
+
+#Yii Model findBySql
+snippet yfindbs
+ ${1:ModelName}::model()->findBySql(${2:sql}, array('${3:key}'=>${0:value}));
+
+#Yii Model findAllByAttributes
+snippet yfindaba
+ ${1:ModelName}::model()->findAllByAttributes(array('${2:attributeName}'=>${3:attributeValue}), ${4:condition}, array('${5:key}'=>${0:value}));
+
+#Yii Model exists
+snippet yexists
+ ${1:ModelName}::model()->exists(${2:condition}, array('${3:key}'=>${0:value}));
+
+#Yii Create model class
+snippet ymodel
+ <?php
+
+ class ${1:ModelName} extends ${2:CActiveRecord}
+ {
+ /**
+ * Returns the static model of the specified AR class.
+ * @return CActiveRecord the static model class
+ */
+ public static function model($className=__CLASS__)
+ {
+ return parent::model($className);
+ }
+
+ /**
+ * @return string the associated database table name
+ */
+ public function tableName()
+ {
+ return '${0:table_name}';
+ }
+
+ /**
+ * @return array validation rules for model attributes.
+ */
+ public function rules()
+ {
+ return array(
+ );
+ }
+
+ /**
+ * @return array relational rules.
+ */
+ public function relations()
+ {
+ return array(
+ );
+ }
+
+ /**
+ * @return array customized attribute labels (name=&gt;label)
+ */
+ public function attributeLabels()
+ {
+ return array(
+ );
+ }
+ }
+
+#------------Yii Controller------------------------------------
+
+#Yii Create controller class
+snippet ycontroller
+ <?php
+
+ /**
+ * ${1:}
+ */
+ class ${2:Site}Controller extends ${3:CController}
+ {
+ public function action${4:Index}()
+ {
+ ${0}
+ }
+
+ // -----------------------------------------------------------
+ // Uncomment the following methods and override them if needed
+ /*
+ public function filters()
+ {
+ // return the filter configuration for this controller, e.g.:
+ return array(
+ 'inlineFilterName',
+ array(
+ 'class'=>'path.to.FilterClass',
+ 'propertyName'=>'propertyValue',
+ ),
+ );
+ }
+
+ public function actions()
+ {
+ // return external action classes, e.g.:
+ return array(
+ 'action1'=>'path.to.ActionClass',
+ 'action2'=>array(
+ 'class'=>'path.to.AnotherActionClass',
+ 'propertyName'=>'propertyValue',
+ ),
+ );
+ }
+ */
+ }
+
+#Yii Create controller action method
+snippet yact
+ public function action${1:Index}(${2:params})
+ {
+ ${0}
+ }
+
+
diff --git a/vim/bundle/vim-snippets/snippets/zsh.snippets b/vim/bundle/vim-snippets/snippets/zsh.snippets
new file mode 100644
index 0000000..fc1c837
--- /dev/null
+++ b/vim/bundle/vim-snippets/snippets/zsh.snippets
@@ -0,0 +1,66 @@
+# #!/bin/zsh
+snippet #!
+ #!/bin/zsh
+
+snippet if
+ if ${1:condition}; then
+ ${0:# statements}
+ fi
+snippet ife
+ if ${1:condition}; then
+ ${2:# statements}
+ else
+ ${0:# statements}
+ fi
+snippet eif
+ elif ${1:condition}; then
+ ${0:# statements}
+snippet for
+ for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do
+ ${0:# statements}
+ done
+snippet fori
+ for ${1:needle} in ${2:haystack}; do
+ ${0:#statements}
+ done
+snippet fore
+ for ${1:item} in ${2:list}; do
+ ${0:# statements}
+ done
+snippet wh
+ while ${1:condition}; do
+ ${0:# statements}
+ done
+snippet until
+ until ${1:condition}; do
+ ${0:# statements}
+ done
+snippet repeat
+ repeat ${1:integer}; do
+ ${0:# statements}
+ done
+snippet case
+ case ${1:word} in
+ ${2:pattern})
+ ${0};;
+ esac
+snippet select
+ select ${1:answer} in ${2:choices}; do
+ ${0:# statements}
+ done
+snippet (
+ ( ${0:#statements} )
+snippet {
+ { ${0:#statements} }
+snippet [
+ [[ ${0:test} ]]
+snippet always
+ { ${1:try} } always { ${0:always} }
+snippet fun
+ ${1:function_name}() {
+ ${0:# function_body}
+ }
+snippet ffun
+ function ${1:function_name}() {
+ ${0:# function_body}
+ }
diff --git a/vim/bundle/vim-snippets/tests.sh b/vim/bundle/vim-snippets/tests.sh
new file mode 100755
index 0000000..07f0ff3
--- /dev/null
+++ b/vim/bundle/vim-snippets/tests.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+SPACED=$(grep -REn '^ .+' --include '*.snippets' snippets)
+
+if [[ $? -ne 1 ]]; then
+ echo These snippet lines are indented with spaces:
+ echo
+ echo "$SPACED"
+ echo
+ echo Tests failed!
+ exit 1
+fi
+
+echo Tests passed!
+exit 0
diff --git a/vim/bundle/vim-table-mode/.gitignore b/vim/bundle/vim-table-mode/.gitignore
new file mode 100644
index 0000000..a9bc329
--- /dev/null
+++ b/vim/bundle/vim-table-mode/.gitignore
@@ -0,0 +1,2 @@
+tags
+.vim-flavor/
diff --git a/vim/bundle/vim-table-mode/.travis.yml b/vim/bundle/vim-table-mode/.travis.yml
new file mode 100644
index 0000000..8dcbc68
--- /dev/null
+++ b/vim/bundle/vim-table-mode/.travis.yml
@@ -0,0 +1,4 @@
+language: ruby
+rvm:
+ - 2.2.0
+script: rake ci
diff --git a/vim/bundle/vim-table-mode/CHANGELOG.md b/vim/bundle/vim-table-mode/CHANGELOG.md
new file mode 100644
index 0000000..da60457
--- /dev/null
+++ b/vim/bundle/vim-table-mode/CHANGELOG.md
@@ -0,0 +1,144 @@
+# Change Log
+
+## Version 4.6.4
+* Added support for center aligning columns
+
+## Version 4.6.3
+* Fixed tablemode#spreadsheet#LineNr()
+* Fixed tablemode#spreadsheet#cell#SetCell()
+
+## Version 4.6.2
+* Added custom User autocmd event for tablemode activation (enabled /
+ disabled)
+* Adding better header support for pandoc, headers can now have a different
+ fillchar configured with `g:table_mode_header_fillchar`
+
+## Version 4.6.1
+* Minor bug fixes
+
+## Version 4.6.0
+* Added better table header support. The first line of the table if separated
+ by a table border will be considered as the header. This also means that it
+ will not be considered / included when evaluating table formulas and that
+ the first line after the header would be considered the first line of the
+ table.
+
+## Version 4.5.0
+* Refactored toggled mappings
+* Table Syntax now gets toggled with Table Mode
+
+## Version 4.4.2
+* Updated mappings to be buffer local.
+* Updated mappings to toggle and function only when table mode is active.
+
+## Version 4.4.1
+* Added syntax for matching tables
+
+## Version 4.4.0
+* Minor bug fixes
+* Added feature to allow using negative indices within formulas to access rows,
+ columns relative to the last, -1 being the last.
+
+## Version 4.3.0
+* Refactored some more
+* Fixed issue #19, hiphens in the table broke alignment
+* Added feature #26, you can now define column alignments in the table header
+
+## Version 4.2.0
+* Refactored cells logic out to autoload/tablemode/spreadsheet/cell.vim
+* Refactored formula logic out to autoload/tablemode/spreadsheet/formula.vim
+
+## Version 4.1.0
+* Fixed bad references within plugin
+* Added fixtures
+
+## Version 4.0.0
+* Major refactoring of the codebase.
+* Improved modular tests.
+* Fixed long standing unicode character alignment issue.
+* Moved to providing \<Plug\> mappings rather than configuration based mappings
+ which can be more easily overriden by end user.
+
+## Version 3.3.2
+* Added new mapping \t? to echo a cells representation for use while defining
+ formulas.
+
+## Version 3.3.1
+* Improved logic to ignore table borders (add as many as you'd like), the
+ first row is not treated special, it is row # 1. Keep that in mind while
+ defining Formulas
+* Improved test coverage
+
+## Version 3.3
+* Dropped +- mapping to create table border instead now using ||
+* You can now have a top table border (before header) as well as a bottom
+ table border.
+
+## Version 3.2
+* Added tests to test various use cases using <a
+ href='https://github.com/kana/vim-vspec'>Vspec</a>..
+* Added travis integration for automated tests.
+
+## Version 3.1
+* Removed borders. You can now optionally create a table header by simply
+ adding a header border immidiately after the header line by using the
+ iabbrev trigger '+-'. Just type that on the line immidiately after the
+ header and press space / \<CR\> to complete the header border.
+* Some Bug Fixes
+
+## Version 3.0
+* Removed dependence on Tabular and added code borrowed from Tabular for
+ aligning the table rows.
+* Added feature to be able to define & evaluate formulas.
+
+## Version 2.4.0
+* Added Table Cell text object.
+* Added api to delete entire table row.
+* Added api to delete entire table column.
+
+## Version 2.3.0
+* Refactored realignment logic. Generating borders by hand.
+
+## Version 2.2.2
+* Added mapping for realigning table columns.
+* Added table motions to move around in the table.
+
+## Version 2.2.1
+* Added feature to allow Table-Mode to work within comments. Uses
+ 'commentstring' option of vim to identify comments, so it should work for
+ most filetypes as long as 'commentstring' option has been set. This is
+ usually done appropriately in filetype plugins.
+
+## Version 2.2
+* Improved :Tableize to now accept a {pattern} just like :Tabular to match the
+ delimiter.
+
+## Version 2.1.3 :
+* Bug Fix #1, added new option `g:table_mode_no_border_padding` which removes
+ padding from the border.
+
+## Version 2.1.2 :
+* Bug Fixes #2, #3 & #4
+
+## Version 2.1.1 :
+* Added option `g:table_mode_align` to allow setting Tabular format option for
+ more control on how Tabular aligns text.
+
+## Version 2.1 :
+* VIM loads plugins in alphabetical order and so table-mode would be loaded
+ before Tabularize which it depends on. Hence Moved plugin into an after
+ plugin. Checking if Tabularize is available and finish immidiately if it's
+ not.
+
+## Version 2.0 :
+* Moved bulk of code to autoload for vimscript optimisation.
+
+## Version 1.1 :
+* Added Tableize command and mapping to convert existing content into a table.
+
+## Version 1.0 :
+* First stable release, create tables as you type.
+
+<!--
+ vim: ft=markdown
+-->
diff --git a/vim/bundle/vim-table-mode/Gemfile b/vim/bundle/vim-table-mode/Gemfile
new file mode 100644
index 0000000..61c6fc7
--- /dev/null
+++ b/vim/bundle/vim-table-mode/Gemfile
@@ -0,0 +1,5 @@
+source 'https://rubygems.org'
+
+ruby '2.2.0'
+gem 'rake'
+gem 'vim-flavor', '~> 1.1'
diff --git a/vim/bundle/vim-table-mode/Gemfile.lock b/vim/bundle/vim-table-mode/Gemfile.lock
new file mode 100644
index 0000000..eb9fd06
--- /dev/null
+++ b/vim/bundle/vim-table-mode/Gemfile.lock
@@ -0,0 +1,18 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ blankslate (2.1.2.4)
+ parslet (1.5.0)
+ blankslate (~> 2.0)
+ rake (10.1.0)
+ thor (0.18.1)
+ vim-flavor (1.1.3)
+ parslet (~> 1.0)
+ thor (~> 0.14)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ rake
+ vim-flavor (~> 1.1)
diff --git a/vim/bundle/vim-table-mode/README.md b/vim/bundle/vim-table-mode/README.md
new file mode 100644
index 0000000..53ff10d
--- /dev/null
+++ b/vim/bundle/vim-table-mode/README.md
@@ -0,0 +1,248 @@
+# VIM Table Mode v4.6.4 [![Build Status](https://travis-ci.org/dhruvasagar/vim-table-mode.png?branch=master)](https://travis-ci.org/dhruvasagar/vim-table-mode)
+
+An awesome automatic table creator & formatter allowing one to create neat
+tables as you type.
+
+## Getting Started
+
+### Installation
+
+There are several ways to do this
+
+1. I recommend installing <a
+ href="https://github.com/Shougo/neobundle.vim">NeoBundle</a> and then just
+ add `NeoBundle 'dhruvasagar/vim-table-mode'` to your ~/.vimrc
+
+2. If you are using <a
+ href="https://github.com/tpope/vim-pathogen">pathogen.vim</a>, then
+ add a git submodule for your plugin:
+
+ ```sh
+$ cd ~/.vim
+$ git submodule add git@github.com:dhruvasagar/vim-table-mode.git bundle/table-mode
+ ```
+3. Copy all files under autoload/, plugin/, doc/ to respective
+ ~/.vim/autoload/, ~/.vim/plugin and ~/.vim/doc under UNIX or
+ vimfiles/autoload/, vimfiles/plugin/ and vimfiles/doc under WINDOWS and
+ restart VIM
+
+### Creating table on-the-fly
+
+To start using the plugin in the on-the-fly mode use `:TableModeToggle` mapped to <kbd>\<Leader\>tm</kbd> by default (which means <kbd>\\</kbd> <kbd>t</kbd> <kbd>m</kbd> if you didn't override the <Leader> by `:let mapleader = ","` to have <kbd>,</kbd> <kbd>t</kbd> <kbd>m</kbd>).
+
+Enter the first line, delimiting columns by the `|` symbol. The plugin reacts by inserting spaces between the text and the separator if you omit them:
+
+ | name | address | phone |
+
+In the second line (without leaving Insert mode), enter `|` twice. The plugin will write a properly formatted horizontal line:
+
+ | name | address | phone |
+ |------+---------+-------|
+
+When you enter the subsequent lines, the plugin will automatically adjust the formatting to match the text you’re entering every time you press `|`:
+
+ | name | address | phone |
+ |------------+---------+-------|
+ | John Adams |
+
+Go on until the table is ready:
+
+ | name | address | phone |
+ |-----------------+--------------------------+------------|
+ | John Adams | 1600 Pennsylvania Avenue | 0123456789 |
+ |-----------------+--------------------------+------------|
+ | Sherlock Holmes | 221B Baker Street | 0987654321 |
+ |-----------------+--------------------------+------------|
+
+Then you can return to the first line and above it enter `||`:
+
+ |-----------------+--------------------------+------------|
+ | name | address | phone |
+ |-----------------+--------------------------+------------|
+ | John Adams | 1600 Pennsylvania Avenue | 0123456789 |
+ |-----------------+--------------------------+------------|
+ | Sherlock Holmes | 221B Baker Street | 0987654321 |
+ |-----------------+--------------------------+------------|
+
+Corner separators are adjustable:
+
+For Markdown-compatible tables use
+
+ let g:table_mode_corner="|"
+
+
+ |-----------------|--------------------------|------------|
+ | name | address | phone |
+ |-----------------|--------------------------|------------|
+ | John Adams | 1600 Pennsylvania Avenue | 0123456789 |
+ |-----------------|--------------------------|------------|
+ | Sherlock Holmes | 221B Baker Street | 0987654321 |
+ |-----------------|--------------------------|------------|
+
+To get ReST-compatible tables use
+
+ let g:table_mode_corner_corner="+"
+ let g:table_mode_header_fillchar="="
+
+
+ +-----------------+--------------------------+------------+
+ | name | address | phone |
+ +=================+==========================+============+
+ | John Adams | 1600 Pennsylvania Avenue | 0123456789 |
+ +-----------------+--------------------------+------------+
+ | Sherlock Holmes | 221B Baker Street | 0987654321 |
+ +-----------------+--------------------------+------------+
+
+
+ You can also define in a table header border how it's content should be
+ aligned, whether center, right or left by using a `:` character defined by
+ `g:table_mode_align_char` option.
+
+### Formatting existing content into a table
+
+ Table Mode wouldn't justify it's name if it didn't allow formatting
+ existing content into a table. And it does as promised. Like table creation
+ on the fly as you type, formatting existing content into a table is equally
+ simple. You can visually select multiple lines and call `:Tableize` on it,
+ or alternatively use the mapping <kbd>\<Leader\>tt</kbd> defined by the
+ `g:table_mode_tableize_map` option which would convert CSV (Comma Separated
+ Value) data into a table and use `,` defined by `g:table_mode_delimiter`
+ option as the delimiter.
+
+ If however you wish to use a different delimiter, you can use the command
+ `:Tableize/{pattern}` in a similar fashion as you use tabular (eg.
+ `:Tableize/;` uses ';' as the delimiter) or use the mapping <kbd>\<Leader\>T</kbd>
+ defined by `g:table_mode_tableize_op_map` option which takes input in the
+ cmd-line and uses the `{pattern}` input as the delimiter.
+
+ `:Tableize` also accepts a range and so you can also call it by giving
+ lines manually like `:line1,line2Tableize`, but this is not very intuitive.
+ You can use the mapping <kbd>\<Leader\>T</kbd> with a `[count]` to apply it to the
+ next `[count]` lines in standard vim style.
+
+### Moving around
+
+ Now you can move between cells using table mode motions <kbd>[|</kbd>,
+ <kbd>]|</kbd>, <kbd>{|</kbd> & <kbd>}|</kbd> to move left | right | up |
+ down cells respectively. The left | right motions wrap around the table
+ and move to the next | previous row after the last | first cell in the
+ current row if one exists.
+
+### Manipulating Table
+
+ - **Cell Text Object** :
+
+ Tableize provides a text object for manipulating table cells. Following
+ the vim philosophy the you have <kbd>i|</kbd> & <kbd>a|</kbd> for the
+ inner and around (including the immidiate right table separator) the
+ table cell.
+
+ - **Delete Row** :
+
+ You can use the <kbd>\<Leader\>tdd</kbd> mapping defined by the option
+ `g:table_mode_delete_row_map` to delete the current table row (provided
+ you are within a table row), this can be preceeded with a [count] to
+ delete multiple rows just like you would with 'dd'.
+
+ - **Delete Column** :
+
+ You can use the <kbd>\<Leader\>tdc</kbd> mapping defined by the option
+ `g:table_mode_delete_column_map` to delete the entire current column
+ (provided you are within a table row), this can also be preceeded with a
+ [count] to delete multiple columns.
+
+## Advanced Usage: Spreadsheet Capabilities
+
+### Table Formulas
+
+ Table Mode now has support for formulas like a spreadsheet. There are 2 ways
+ of defining formulas :
+
+ - You can add formulas using `:TableAddFormula` or the mapping <kbd>\<Leader\>tfa</kbd>
+ defined by the option `g:table_mode_add_formula_map` from within a table
+ cell, which will ask for input on the cmd-line with a `f=` prompt. The
+ input formula will be appended to the formula line if one exists or a new
+ one will be created with the input formula taking the current cell as the
+ target cell. The formula line is evaluated immidiately to reflect the
+ results.
+
+ - You can directly add / manipulate formula expressions in the formula line.
+ The formula line is a commented line right after the table, beginning with
+ 'tmf:' (table mode formula). eg) `# tmf: $3=$2*$1`. You can add multiple
+ formulas on the line separated with a ';' eg) `# tmf: $3=$2*$1;$4=$3/3.14`
+
+ You can evaluate the formula line using `:TableEvalFormulaLine` or the
+ mapping <kbd>\<Leader\>tfe</kbd> defined by the option `g:table_mode_eval_expr_map`
+ from anywhere inside the table or while on the formula line.
+
+ NOTE: You can now use the mapping <kbd>\<Leader\>t?</kbd>
+
+### Formula Expressions
+
+ Expressions are of the format `$target = formula`.
+
+ - The `target` can be of 2 forms :
+
+ - `$n`: This matches the table column number `n`. So the `formula` would
+ be evaluated for each cell in that column and the result would be placed
+ in it. You can use negative indice to represent column relative to the
+ last, -1 being the last.
+
+ - `$n,m`: This matches the table cell n,m (row, column). So in this case
+ the formula would be evaluated and the result will be placed in this
+ cell. You can also use negative values to refer to cells relative to
+ the size, -1 being the last (row or column).
+
+ - The `formula` can be a simple mathematical expression involving cells
+ which are also defined by the same format as that of the target cell. You
+ can use all native vim functions within the formula. Apart from that table
+ mode also provides 2 special functions `Sum` and `Average`. Both these
+ functions take a range as input. A range can be of two forms :
+
+ - `r1:r2`: This represents cells in the current column from row `r1`
+ through `r2`. If `r2` is negative it represents `r2` rows above the
+ current row (of the target cell).
+
+ - `r1,c1:r2,c2`: This represents cells in the table from cell r1,c1
+ through cell r2,c2 (row, column).
+
+ - Examples :
+ - `$2 = $1 * $1`
+ - `$2 = pow($1, 5)` NOTE: Remember to put space between the $1, and 5
+ here otherwise it will be treated like a table cell.
+ - `$2 = $1 / $1,3`
+ - `$1,2 = $1,1 * $1,1`
+ - `$5,1 = Sum(1:-1)`
+ - `$5,1 = float2nr(Sum(1:-1))`
+ - `$5,3 = Sum(1,2:5,2)`
+ - `$5,3 = Sum(1,2:5,2)/$5,1`
+ - `$5,3 = Average(1,2:5,2)/$5,1`
+
+## Demo
+
+<a href="http://www.youtube.com/watch?v=9lVQ0VJY3ps"><img
+src="https://raw.github.com/axil/vim-table-mode/master/youtube.png"/></a>
+
+## Change Log
+See <a
+href="https://github.com/dhruvasagar/vim-table-mode/blob/master/CHANGELOG.md">
+CHANGELOG.md </a>
+
+## Contributing
+
+### Reporting an Issue :
+- Use <a href="https://github.com/dhruvasagar/vim-table-mode/issues">Github
+ Issue Tracker</a>
+
+### Contributing to code :
+- Fork it.
+- Commit your changes and give your commit message some love.
+- Push to your fork on github.
+- Open a Pull Request.
+
+## Credit
+I must thank Tim Pope for inspiration. The initial concept was created by him
+named <a href="https://gist.github.com/tpope/287147">cucumbertables.vim</a>.
+
+Also a shout out to godlygeek who developed the incredible <a
+href="http://github.com/godlygeek/tabular">Tabular</a> plugin.
diff --git a/vim/bundle/vim-table-mode/Rakefile b/vim/bundle/vim-table-mode/Rakefile
new file mode 100644
index 0000000..557fee1
--- /dev/null
+++ b/vim/bundle/vim-table-mode/Rakefile
@@ -0,0 +1,13 @@
+#!/usr/bin/env rake
+
+task :ci => [:dump, :test]
+
+task :dump do
+ sh 'vim --version'
+end
+
+task :test do
+ sh 'bundle exec vim-flavor test'
+end
+
+task :default => :test
diff --git a/vim/bundle/vim-table-mode/VimFlavor.lock b/vim/bundle/vim-table-mode/VimFlavor.lock
new file mode 100644
index 0000000..d021597
--- /dev/null
+++ b/vim/bundle/vim-table-mode/VimFlavor.lock
@@ -0,0 +1 @@
+kana/vim-vspec (1.1.2)
diff --git a/vim/bundle/vim-table-mode/autoload/tablemode.vim b/vim/bundle/vim-table-mode/autoload/tablemode.vim
new file mode 100644
index 0000000..defc3dd
--- /dev/null
+++ b/vim/bundle/vim-table-mode/autoload/tablemode.vim
@@ -0,0 +1,195 @@
+" Private Functions {{{1
+function! s:SetBufferOptDefault(opt, val) "{{{2
+ if !exists('b:' . a:opt)
+ let b:{a:opt} = a:val
+ endif
+endfunction
+
+function! s:Map(map, to, mode) "{{{2
+ if !empty(a:to) && !hasmapto(a:map, a:mode)
+ for l:mode in split(a:mode, '.\zs')
+ execute l:mode . 'map <buffer>' a:to a:map
+ endfor
+ endif
+endfunction
+
+function! s:UnMap(map, mode) "{{{2
+ if !empty(maparg(a:map, a:mode))
+ for mode in split(a:mode, '.\zs')
+ execute l:mode . 'unmap <buffer>' a:map
+ endfor
+ endif
+endfunction
+
+function! s:ToggleMapping() "{{{2
+ let separator_map = g:table_mode_separator
+ " '|' is a special character, we need to map <Bar> instead
+ if g:table_mode_separator ==# '|' | let separator_map = '<Bar>' | endif
+
+ if !g:table_mode_disable_mappings
+ if tablemode#IsActive()
+ call s:Map('<Plug>(table-mode-tableize)', separator_map, 'i')
+ call s:Map('<Plug>(table-mode-motion-up)', g:table_mode_motion_up_map, 'n')
+ call s:Map('<Plug>(table-mode-motion-down)', g:table_mode_motion_down_map, 'n')
+ call s:Map('<Plug>(table-mode-motion-left)', g:table_mode_motion_left_map, 'n')
+ call s:Map('<Plug>(table-mode-motion-right)', g:table_mode_motion_right_map, 'n')
+
+ call s:Map('<Plug>(table-mode-cell-text-object-a)', g:table_mode_cell_text_object_a_map, 'ox')
+ call s:Map('<Plug>(table-mode-cell-text-object-i)', g:table_mode_cell_text_object_i_map, 'ox')
+
+ call s:Map('<Plug>(table-mode-realign)', g:table_mode_realign_map, 'n')
+ call s:Map('<Plug>(table-mode-delete-row)', g:table_mode_delete_row_map, 'n')
+ call s:Map('<Plug>(table-mode-delete-column)', g:table_mode_delete_column_map, 'n')
+ call s:Map('<Plug>(table-mode-add-formula)', g:table_mode_add_formula_map, 'n')
+ call s:Map('<Plug>(table-mode-eval-formula)', g:table_mode_eval_formula_map, 'n')
+ call s:Map('<Plug>(table-mode-echo-cell)', g:table_mode_echo_cell_map, 'n')
+ call s:Map('<Plug>(table-mode-sort)', g:table_mode_sort_map, 'n')
+ else
+ call s:UnMap(separator_map, 'i')
+ call s:UnMap(g:table_mode_motion_up_map, 'n')
+ call s:UnMap(g:table_mode_motion_down_map, 'n')
+ call s:UnMap(g:table_mode_motion_left_map, 'n')
+ call s:UnMap(g:table_mode_motion_right_map, 'n')
+
+ call s:UnMap(g:table_mode_cell_text_object_a_map, 'ox')
+ call s:UnMap(g:table_mode_cell_text_object_i_map, 'ox')
+
+ call s:UnMap(g:table_mode_realign_map, 'n')
+ call s:UnMap(g:table_mode_delete_row_map, 'n')
+ call s:UnMap(g:table_mode_delete_column_map, 'n')
+ call s:UnMap(g:table_mode_add_formula_map, 'n')
+ call s:UnMap(g:table_mode_eval_formula_map, 'n')
+ call s:UnMap(g:table_mode_echo_cell_map, 'n')
+ call s:UnMap(g:table_mode_sort_map, 'n')
+ endif
+ endif
+endfunction
+
+function! tablemode#SyntaxEnable()
+ exec 'syntax match Table'
+ \ '/' . tablemode#table#StartExpr() . '\zs|.\+|\ze' . tablemode#table#EndExpr() . '/'
+ \ 'contains=TableBorder,TableSeparator,TableColumnAlign containedin=ALL'
+ syntax match TableSeparator /|/ contained
+ syntax match TableColumnAlign /:/ contained
+ syntax match TableBorder /[\-+]\+/ contained
+
+ hi! link TableBorder Delimiter
+ hi! link TableSeparator Delimiter
+ hi! link TableColumnAlign Type
+endfunction
+
+function! s:ToggleSyntax()
+ if tablemode#IsActive()
+ call tablemode#SyntaxEnable()
+ else
+ syntax clear Table
+ syntax clear TableBorder
+ syntax clear TableSeparator
+ syntax clear TableColumnAlign
+
+ hi! link TableBorder NONE
+ hi! link TableSeparator NONE
+ hi! link TableColumnAlign NONE
+ endif
+endfunction
+
+function! s:SetActive(bool) "{{{2
+ let b:table_mode_active = a:bool
+ call s:ToggleSyntax()
+ call s:ToggleMapping()
+ if tablemode#IsActive()
+ doautocmd User TableModeEnabled
+ else
+ doautocmd User TableModeDisabled
+ endif
+endfunction
+
+function! s:ConvertDelimiterToSeparator(line, ...) "{{{2
+ let old_gdefault = &gdefault
+ set nogdefault
+
+ let delim = g:table_mode_delimiter
+ if a:0 | let delim = a:1 | endif
+ if delim ==# ','
+ silent! execute a:line . 's/' . "[\'\"][^\'\"]*\\zs,\\ze[^\'\"]*[\'\"]/__COMMA__/g"
+ endif
+
+ let [cstart, cend] = [tablemode#table#GetCommentStart(), tablemode#table#GetCommentEnd()]
+ let [match_char_start, match_char_end] = ['.', '.']
+ if tablemode#utils#strlen(cend) > 0 | let match_char_end = '[^' . cend . ']' | endif
+ if tablemode#utils#strlen(cstart) > 0 | let match_char_start = '[^' . cstart . ']' | endif
+
+ silent! execute a:line . 's/' . tablemode#table#StartExpr() . '\zs\ze' . match_char_start .
+ \ '\|' . delim . '\|' . match_char_end . '\zs\ze' . tablemode#table#EndExpr() . '/' .
+ \ g:table_mode_separator . '/g'
+
+ if delim ==# ','
+ silent! execute a:line . 's/' . "[\'\"][^\'\"]*\\zs__COMMA__\\ze[^\'\"]*[\'\"]/,/g"
+ endif
+
+ let &gdefault=old_gdefault
+endfunction
+
+function! s:Tableizeline(line, ...) "{{{2
+ let delim = g:table_mode_delimiter
+ if a:0 && type(a:1) == type('') && !empty(a:1) | let delim = a:1[1:-1] | endif
+ call s:ConvertDelimiterToSeparator(a:line, delim)
+endfunction
+
+" Public API {{{1
+function! tablemode#IsActive() "{{{2
+ if g:table_mode_always_active | return 1 | endif
+
+ call s:SetBufferOptDefault('table_mode_active', 0)
+ return b:table_mode_active
+endfunction
+
+function! tablemode#TableizeInsertMode() "{{{2
+ if tablemode#IsActive() && getline('.') =~# (tablemode#table#StartExpr() . g:table_mode_separator . g:table_mode_separator)
+ call tablemode#table#AddBorder('.')
+ normal! A
+ elseif tablemode#IsActive() && getline('.') =~# (tablemode#table#StartExpr() . g:table_mode_separator)
+ let column = tablemode#utils#strlen(substitute(getline('.')[0:col('.')], '[^' . g:table_mode_separator . ']', '', 'g'))
+ let position = tablemode#utils#strlen(matchstr(getline('.')[0:col('.')], '.*' . g:table_mode_separator . '\s*\zs.*'))
+ call tablemode#table#Realign('.')
+ normal! 0
+ call search(repeat('[^' . g:table_mode_separator . ']*' . g:table_mode_separator, column) . '\s\{-\}' . repeat('.', position), 'ce', line('.'))
+ endif
+endfunction
+
+function! tablemode#Enable() "{{{2
+ call s:SetActive(1)
+endfunction
+
+function! tablemode#Disable() "{{{2
+ call s:SetActive(0)
+endfunction
+
+function! tablemode#Toggle() "{{{2
+ if g:table_mode_always_active
+ return 1
+ endif
+
+ call s:SetBufferOptDefault('table_mode_active', 0)
+ call s:SetActive(!b:table_mode_active)
+endfunction
+
+function! tablemode#TableizeRange(...) range "{{{2
+ let lnum = a:firstline
+ while lnum < (a:firstline + (a:lastline - a:firstline + 1))
+ call s:Tableizeline(lnum, a:1)
+ undojoin
+ let lnum += 1
+ endwhile
+
+ call tablemode#table#Realign(lnum - 1)
+endfunction
+
+function! tablemode#TableizeByDelimiter() "{{{2
+ let delim = input('/')
+ if delim =~# "\<Esc>" || delim =~# "\<C-C>" | return | endif
+ let vm = visualmode()
+ if vm ==? 'line' || vm ==? 'V'
+ exec line("'<") . ',' . line("'>") . "call tablemode#TableizeRange('/' . delim)"
+ endif
+endfunction
diff --git a/vim/bundle/vim-table-mode/autoload/tablemode/align.vim b/vim/bundle/vim-table-mode/autoload/tablemode/align.vim
new file mode 100644
index 0000000..9e6330c
--- /dev/null
+++ b/vim/bundle/vim-table-mode/autoload/tablemode/align.vim
@@ -0,0 +1,134 @@
+" Borrowed from Tabular
+" Private Functions {{{1
+" function! s:StripTrailingSpaces(string) - Remove all trailing spaces {{{2
+" from a string.
+function! s:StripTrailingSpaces(string)
+ return matchstr(a:string, '^.\{-}\ze\s*$')
+endfunction
+
+function! s:Padding(string, length, where) "{{{3
+ let gap_length = a:length - tablemode#utils#StrDisplayWidth(a:string)
+ if a:where =~# 'l'
+ return a:string . repeat(" ", gap_length)
+ elseif a:where =~# 'r'
+ return repeat(" ", gap_length) . a:string
+ elseif a:where =~# 'c'
+ let right = gap_length / 2
+ let left = right + (right * 2 != gap_length)
+ return repeat(" ", left) . a:string . repeat(" ", right)
+ endif
+endfunction
+
+" Public Functions {{{1
+" function! tablemode#align#Split() - Split a string into fields and delimiters {{{2
+" Like split(), but include the delimiters as elements
+" All odd numbered elements are delimiters
+" All even numbered elements are non-delimiters (including zero)
+function! tablemode#align#Split(string, delim)
+ let rv = []
+ let beg = 0
+
+ let len = len(a:string)
+ let searchoff = 0
+
+ while 1
+ let mid = match(a:string, a:delim, beg + searchoff, 1)
+ if mid == -1 || mid == len
+ break
+ endif
+
+ let matchstr = matchstr(a:string, a:delim, beg + searchoff, 1)
+ let length = strlen(matchstr)
+
+ if length == 0 && beg == mid
+ " Zero-length match for a zero-length delimiter - advance past it
+ let searchoff += 1
+ continue
+ endif
+
+ if beg == mid
+ let rv += [ "" ]
+ else
+ let rv += [ a:string[beg : mid-1] ]
+ endif
+
+ let rv += [ matchstr ]
+
+ let beg = mid + length
+ let searchoff = 0
+ endwhile
+
+ let rv += [ strpart(a:string, beg) ]
+
+ return rv
+endfunction
+
+function! tablemode#align#alignments(lnum, ncols) "{{{2
+ let achr = g:table_mode_align_char
+ let alignments = []
+ if tablemode#table#IsBorder(a:lnum+1)
+ let hcols = tablemode#align#Split(getline(a:lnum+1), '[' . g:table_mode_corner . g:table_mode_corner_corner . ']')
+ for idx in range(len(hcols))
+ " Right align if header
+ call add(alignments, 'l')
+ if hcols[idx] =~# achr . '[^'.achr.']\+' . achr
+ let alignments[idx] = 'c'
+ elseif hcols[idx] =~# achr . '$'
+ let alignments[idx] = 'r'
+ endif
+ " if hcols[idx] !~# '[^0-9\.]' | let alignments[idx] = 'r' | endif
+ endfor
+ end
+ return alignments
+endfunction
+
+function! tablemode#align#Align(lines) "{{{2
+ if empty(a:lines) | return [] | endif
+ let lines = map(a:lines, 'map(v:val, "v:key =~# \"text\" ? tablemode#align#Split(v:val, g:table_mode_separator) : v:val")')
+
+ for line in lines
+ let stext = line.text
+ if len(stext) <= 1 | continue | endif
+
+ if stext[0] !~ tablemode#table#StartExpr()
+ let stext[0] = s:StripTrailingSpaces(stext[0])
+ endif
+ if len(stext) >= 2
+ for i in range(1, len(stext)-1)
+ let stext[i] = tablemode#utils#strip(stext[i])
+ endfor
+ endif
+ endfor
+
+ let maxes = []
+ for line in lines
+ let stext = line.text
+ if len(stext) <= 1 | continue | endif
+ for i in range(len(stext))
+ if i == len(maxes)
+ let maxes += [ tablemode#utils#StrDisplayWidth(stext[i]) ]
+ else
+ let maxes[i] = max([ maxes[i], tablemode#utils#StrDisplayWidth(stext[i]) ])
+ endif
+ endfor
+ endfor
+
+ let alignments = tablemode#align#alignments(lines[0].lnum, len(lines[0].text))
+
+ for idx in range(len(lines))
+ let tlnum = lines[idx].lnum
+ let tline = lines[idx].text
+
+ if len(tline) <= 1 | continue | endif
+ for jdx in range(len(tline))
+ " Dealing with the header being the first line
+ if jdx >= len(alignments) | call add(alignments, 'l') | endif
+ let field = s:Padding(tline[jdx], maxes[jdx], alignments[jdx])
+ let tline[jdx] = field . (jdx == 0 || jdx == len(tline) ? '' : ' ')
+ endfor
+
+ let lines[idx].text = s:StripTrailingSpaces(join(tline, ''))
+ endfor
+
+ return lines
+endfunction
diff --git a/vim/bundle/vim-table-mode/autoload/tablemode/logger.vim b/vim/bundle/vim-table-mode/autoload/tablemode/logger.vim
new file mode 100644
index 0000000..ab3986d
--- /dev/null
+++ b/vim/bundle/vim-table-mode/autoload/tablemode/logger.vim
@@ -0,0 +1,5 @@
+function! tablemode#logger#log(message)
+ if g:table_mode_verbose
+ echom message
+ endif
+endfunction
diff --git a/vim/bundle/vim-table-mode/autoload/tablemode/spreadsheet.vim b/vim/bundle/vim-table-mode/autoload/tablemode/spreadsheet.vim
new file mode 100644
index 0000000..6f79d5c
--- /dev/null
+++ b/vim/bundle/vim-table-mode/autoload/tablemode/spreadsheet.vim
@@ -0,0 +1,189 @@
+" Private Functions {{{1
+function! s:Sum(list) "{{{2
+ let result = 0.0
+ for item in a:list
+ if type(item) == type(1) || type(item) == type(1.0)
+ let result += item
+ elseif type(item) == type('')
+ let result += str2float(item)
+ elseif type(item) == type([])
+ let result += s:Sum(item)
+ endif
+ endfor
+ return result
+endfunction
+
+function! s:Average(list) "{{{2
+ return s:Sum(a:list)/len(a:list)
+endfunction
+
+" Public Functions {{{1
+function! tablemode#spreadsheet#GetFirstRow(line) "{{{2
+ if tablemode#table#IsRow(a:line)
+ let line = tablemode#utils#line(a:line)
+
+ while !tablemode#table#IsHeader(line - 1) && (tablemode#table#IsRow(line - 1) || tablemode#table#IsBorder(line - 1))
+ let line -= 1
+ endwhile
+ if tablemode#table#IsBorder(line) | let line += 1 | endif
+
+ return line
+ endif
+endfunction
+
+function! tablemode#spreadsheet#MoveToFirstRow() "{{{2
+ if tablemode#table#IsRow('.')
+ call cursor(tablemode#spreadsheet#GetFirstRow('.'), col('.'))
+ endif
+endfunction
+
+function! tablemode#spreadsheet#GetLastRow(line) "{{{2
+ if tablemode#table#IsRow(a:line)
+ let line = tablemode#utils#line(a:line)
+
+ while tablemode#table#IsTable(line + 1)
+ let line += 1
+ endwhile
+ if tablemode#table#IsBorder(line) | let line -= 1 | endif
+
+ return line
+ endif
+endfunction
+
+function! tablemode#spreadsheet#MoveToLastRow() "{{{2
+ if tablemode#table#IsRow('.')
+ call cursor(tablemode#spreadsheet#GetLastRow('.'), col('.'))
+ endif
+endfunction
+
+function! tablemode#spreadsheet#LineNr(line, row) "{{{2
+ if tablemode#table#IsRow(a:line)
+ let line = tablemode#spreadsheet#GetFirstRow(a:line)
+ let row_nr = 0
+
+ while tablemode#table#IsTable(line + 1)
+ if tablemode#table#IsRow(line)
+ let row_nr += 1
+ if a:row ==# row_nr | break | endif
+ endif
+ let line += 1
+ endwhile
+
+ return line
+ endif
+endfunction
+
+function! tablemode#spreadsheet#RowNr(line) "{{{2
+ let line = tablemode#utils#line(a:line)
+
+ let rowNr = 0
+ while !tablemode#table#IsHeader(line) && tablemode#table#IsTable(line)
+ if tablemode#table#IsRow(line) | let rowNr += 1 | endif
+ let line -= 1
+ endwhile
+
+ return rowNr
+endfunction
+
+function! tablemode#spreadsheet#RowCount(line) "{{{2
+ let line = tablemode#utils#line(a:line)
+
+ let [tline, totalRowCount] = [line, 0]
+ while !tablemode#table#IsHeader(tline) && tablemode#table#IsTable(tline)
+ if tablemode#table#IsRow(tline) | let totalRowCount += 1 | endif
+ let tline -= 1
+ endwhile
+
+ let tline = line + 1
+ while !tablemode#table#IsHeader(tline) && tablemode#table#IsTable(tline)
+ if tablemode#table#IsRow(tline) | let totalRowCount += 1 | endif
+ let tline += 1
+ endwhile
+
+ return totalRowCount
+endfunction
+
+function! tablemode#spreadsheet#ColumnNr(pos) "{{{2
+ let pos = []
+ if type(a:pos) == type('')
+ let pos = [line(a:pos), col(a:pos)]
+ elseif type(a:pos) == type([])
+ let pos = a:pos
+ else
+ return 0
+ endif
+ let row_start = stridx(getline(pos[0]), g:table_mode_separator)
+ return tablemode#utils#strlen(substitute(getline(pos[0])[(row_start):pos[1]-2], '[^' . g:table_mode_separator . ']', '', 'g'))
+endfunction
+
+function! tablemode#spreadsheet#ColumnCount(line) "{{{2
+ let line = tablemode#utils#line(a:line)
+
+ return tablemode#utils#strlen(substitute(getline(line), '[^' . g:table_mode_separator . ']', '', 'g'))-1
+endfunction
+
+function! tablemode#spreadsheet#IsFirstCell() "{{{2
+ return tablemode#spreadsheet#ColumnNr('.') ==# 1
+endfunction
+
+function! tablemode#spreadsheet#IsLastCell() "{{{2
+ return tablemode#spreadsheet#ColumnNr('.') ==# tablemode#spreadsheet#ColumnCount('.')
+endfunction
+
+function! tablemode#spreadsheet#MoveToStartOfCell() "{{{2
+ if getline('.')[col('.')-1] ==# g:table_mode_separator && !tablemode#spreadsheet#IsLastCell()
+ normal! 2l
+ else
+ execute 'normal! F' . g:table_mode_separator . '2l'
+ endif
+endfunction
+
+function! tablemode#spreadsheet#DeleteColumn() "{{{2
+ if tablemode#table#IsRow('.')
+ for i in range(v:count1)
+ call tablemode#spreadsheet#MoveToStartOfCell()
+ call tablemode#spreadsheet#MoveToFirstRow()
+ silent! execute "normal! h\<C-V>f" . g:table_mode_separator
+ call tablemode#spreadsheet#MoveToLastRow()
+ normal! d
+ endfor
+
+ call tablemode#table#Realign('.')
+ endif
+endfunction
+
+function! tablemode#spreadsheet#DeleteRow() "{{{2
+ if tablemode#table#IsRow('.')
+ for i in range(v:count1)
+ if tablemode#table#IsRow('.')
+ normal! dd
+ endif
+
+ if !tablemode#table#IsRow('.')
+ normal! k
+ endif
+ endfor
+
+ call tablemode#table#Realign('.')
+ endif
+endfunction
+
+function! tablemode#spreadsheet#Sum(range, ...) abort "{{{2
+ let args = copy(a:000)
+ call insert(args, a:range)
+ return s:Sum(call('tablemode#spreadsheet#cell#GetCellRange', args))
+endfunction
+
+function! tablemode#spreadsheet#Average(range, ...) abort "{{{2
+ let args = copy(a:000)
+ call insert(args, a:range)
+ return s:Average(call('tablemode#spreadsheet#cell#GetCellRange', args))
+endfunction
+
+function! tablemode#spreadsheet#Sort(bang, ...) "{{{2
+ let opts = a:0 ? a:1 : ''
+ let bang = a:bang ? '!' : ''
+ let [firstRow, lastRow] = [tablemode#spreadsheet#GetFirstRow('.'), tablemode#spreadsheet#GetLastRow('.')]
+ call tablemode#spreadsheet#MoveToStartOfCell()
+ exec ':'.firstRow.','.lastRow . 'sort'.bang opts '/.*\%'.col('.').'v/'
+endfunction
diff --git a/vim/bundle/vim-table-mode/autoload/tablemode/spreadsheet/cell.vim b/vim/bundle/vim-table-mode/autoload/tablemode/spreadsheet/cell.vim
new file mode 100644
index 0000000..d1d912b
--- /dev/null
+++ b/vim/bundle/vim-table-mode/autoload/tablemode/spreadsheet/cell.vim
@@ -0,0 +1,258 @@
+" Private Functions {{{1
+" function! s:ParseRange(range, ...) {{{2
+" range: A string representing range of cells.
+" - Can be row1:row2 for values in the current columns in those rows.
+" - Can be row1,col1:row2,col2 for range between row1,col1 till
+" row2,col2.
+function! s:ParseRange(range, ...)
+ if a:0 < 1
+ let default_col = tablemode#spreadsheet#ColumnNr('.')
+ elseif a:0 < 2
+ let default_col = a:1
+ endif
+
+ if type(a:range) != type('')
+ let range = string(a:range)
+ else
+ let range = a:range
+ endif
+
+ let [rowcol1, rowcol2] = split(range, ':')
+ let [rcs1, rcs2] = [map(split(rowcol1, ','), 'str2nr(v:val)'), map(split(rowcol2, ','), 'str2nr(v:val)')]
+
+ if len(rcs1) == 2
+ let [row1, col1] = rcs1
+ else
+ let [row1, col1] = [rcs1[0], default_col]
+ endif
+
+ if len(rcs2) == 2
+ let [row2, col2] = rcs2
+ else
+ let [row2, col2] = [rcs2[0], default_col]
+ endif
+
+ return [row1, col1, row2, col2]
+endfunction
+
+
+" Public Functions {{{1
+" function! tablemode#spreadsheet#cell#GetCells() - Function to get values of cells in a table {{{2
+" tablemode#spreadsheet#GetCells(row) - Get values of all cells in a row as a List.
+" tablemode#spreadsheet#GetCells(0, col) - Get values of all cells in a column as a List.
+" tablemode#spreadsheet#GetCells(row, col) - Get the value of table cell by given row, col.
+function! tablemode#spreadsheet#cell#GetCells(line, ...) abort
+ let line = tablemode#utils#line(a:line)
+
+ if tablemode#table#IsRow(line)
+ if a:0 < 1
+ let [row, colm] = [line, 0]
+ elseif a:0 < 2
+ let [row, colm] = [a:1, 0]
+ elseif a:0 < 3
+ let [row, colm] = a:000
+ endif
+
+ let first_row = tablemode#spreadsheet#GetFirstRow(line)
+ let last_row = tablemode#spreadsheet#GetLastRow(line)
+ if row == 0
+ let values = []
+ let line = first_row
+ while tablemode#table#IsTable(line)
+ if tablemode#table#IsRow(line)
+ let row_line = getline(line)[stridx(getline(line), g:table_mode_separator):strridx(getline(line), g:table_mode_separator)]
+ call add(values, tablemode#utils#strip(get(split(row_line, g:table_mode_separator), colm>0?colm-1:colm, '')))
+ endif
+ let line += 1
+ endwhile
+ return values
+ else
+ let row_nr = 0
+ let row_diff = row > 0 ? 1 : -1
+ let line = row > 0 ? first_row : last_row
+ while tablemode#table#IsTable(line)
+ if tablemode#table#IsRow(line)
+ let row_nr += row_diff
+ if row ==# row_nr | break | endif
+ endif
+ let line += row_diff
+ endwhile
+
+ let row_line = getline(line)[stridx(getline(line), g:table_mode_separator):strridx(getline(line), g:table_mode_separator)]
+ if colm == 0
+ return map(split(row_line, g:table_mode_separator), 'tablemode#utils#strip(v:val)')
+ else
+ let split_line = split(row_line, g:table_mode_separator)
+ return tablemode#utils#strip(get(split(row_line, g:table_mode_separator), colm>0?colm-1:colm, ''))
+ endif
+ endif
+ endif
+endfunction
+
+function! tablemode#spreadsheet#cell#GetCell(...) "{{{2
+ if a:0 == 0
+ let [row, colm] = [tablemode#spreadsheet#RowNr('.'), tablemode#spreadsheet#ColumnNr('.')]
+ elseif a:0 == 2
+ let [row, colm] = [a:1, a:2]
+ endif
+
+ return tablemode#spreadsheet#cell#GetCells('.', row, colm)
+endfunction
+
+function! tablemode#spreadsheet#cell#GetRow(row, ...) abort "{{{2
+ let line = a:0 ? a:1 : '.'
+ return tablemode#spreadsheet#cell#GetCells(line, a:row)
+endfunction
+
+function! tablemode#spreadsheet#cell#GetRowColumn(col, ...) abort "{{{2
+ let line = a:0 ? a:1 : '.'
+ let row = tablemode#spreadsheet#RowNr('.')
+ return tablemode#spreadsheet#cell#GetCells(line, row, a:col)
+endfunction
+
+function! tablemode#spreadsheet#cell#GetColumn(col, ...) abort "{{{2
+ let line = a:0 ? a:1 : '.'
+ return tablemode#spreadsheet#cell#GetCells(line, 0, a:col)
+endfunction
+
+function! tablemode#spreadsheet#cell#GetColumnRow(row, ...) abort "{{{2
+ let line = a:0 ? a:1 : '.'
+ let col = tablemode#spreadsheet#ColumnNr('.')
+ return tablemode#spreadsheet#cell#GetCells(line, a:row, col)
+endfunction
+
+function! tablemode#spreadsheet#cell#GetCellRange(range, ...) abort "{{{2
+ if a:0 < 1
+ let [line, colm] = ['.', tablemode#spreadsheet#ColumnNr('.')]
+ elseif a:0 < 2
+ let [line, colm] = [a:1, tablemode#spreadsheet#ColumnNr('.')]
+ elseif a:0 < 3
+ let [line, colm] = [a:1, a:2]
+ else
+ call tablemode#utils#throw('Invalid Range')
+ endif
+
+ let values = []
+
+ if tablemode#table#IsRow(line)
+ let [row1, col1, row2, col2] = s:ParseRange(a:range, colm)
+
+ if row1 == row2
+ if col1 == col2
+ call add(values, tablemode#spreadsheet#cell#GetCells(line, row1, col1))
+ else
+ let values = tablemode#spreadsheet#cell#GetRow(row1, line)[(col1-1):(col2-1)]
+ endif
+ else
+ if col1 == col2
+ let values = tablemode#spreadsheet#cell#GetColumn(col1, line)[(row1-1):(row2-1)]
+ else
+ let tcol = col1
+ while tcol <= col2
+ call add(values, tablemode#spreadsheet#cell#GetColumn(tcol, line)[(row1-1):(row2-1)])
+ let tcol += 1
+ endwhile
+ endif
+ endif
+ endif
+
+ return values
+endfunction
+
+function! tablemode#spreadsheet#cell#SetCell(val, ...) "{{{2
+ if a:0 == 0
+ let [line, row, colm] = ['.', tablemode#spreadsheet#RowNr('.'), tablemode#spreadsheet#ColumnNr('.')]
+ elseif a:0 == 2
+ let [line, row, colm] = ['.', a:1, a:2]
+ elseif a:0 == 3
+ let [line, row, colm] = a:000
+ endif
+
+ " Account for negative values to reference from relatively from the last
+ if row < 0 | let row = tablemode#spreadsheet#RowCount(line) + row + 1 | endif
+ if colm < 0 | let colm = tablemode#spreadsheet#ColumnCount(line) + colm + 1 | endif
+
+ if tablemode#table#IsRow(line)
+ let line = tablemode#spreadsheet#LineNr(line, row)
+ let line_val = getline(line)
+ let cstartexpr = tablemode#table#StartCommentExpr()
+ let values = split(getline(line)[stridx(line_val, g:table_mode_separator):strridx(line_val, g:table_mode_separator)], g:table_mode_separator)
+ if len(values) < colm | return | endif
+ let values[colm-1] = a:val
+ let line_value = g:table_mode_separator . join(values, g:table_mode_separator) . g:table_mode_separator
+ if tablemode#utils#strlen(cstartexpr) > 0 && line_val =~# cstartexpr
+ let sce = matchstr(line_val, tablemode#table#StartCommentExpr())
+ let ece = matchstr(line_val, tablemode#table#EndCommentExpr())
+ let line_value = sce . line_value . ece
+ endif
+ call setline(line, line_value)
+ call tablemode#table#Realign(line)
+ endif
+endfunction
+function! tablemode#spreadsheet#cell#TextObject(inner) "{{{2
+ if tablemode#table#IsRow('.')
+ call tablemode#spreadsheet#MoveToStartOfCell()
+ if a:inner
+ normal! v
+ call search('[^' . g:table_mode_separator . ']\ze\s*' . g:table_mode_separator)
+ else
+ execute 'normal! vf' . g:table_mode_separator . 'l'
+ endif
+ endif
+endfunction
+function! tablemode#spreadsheet#cell#Motion(direction, ...) "{{{2
+ let l:count = a:0 ? a:1 : v:count1
+ if tablemode#table#IsRow('.')
+ for ii in range(l:count)
+ if a:direction ==# 'l'
+ if tablemode#spreadsheet#IsLastCell()
+ if !tablemode#table#IsRow(line('.') + 1) && (tablemode#table#IsBorder(line('.') + 1) && !tablemode#table#IsRow(line('.') + 2))
+ return
+ endif
+ call tablemode#spreadsheet#cell#Motion('j', 1)
+ normal! 0
+ endif
+
+ " If line starts with g:table_mode_separator
+ if getline('.')[col('.')-1] ==# g:table_mode_separator
+ normal! 2l
+ else
+ execute 'normal! f' . g:table_mode_separator . '2l'
+ endif
+ elseif a:direction ==# 'h'
+ if tablemode#spreadsheet#IsFirstCell()
+ if !tablemode#table#IsRow(line('.') - 1) && (tablemode#table#IsBorder(line('.') - 1) && !tablemode#table#IsRow(line('.') - 2))
+ return
+ endif
+ call tablemode#spreadsheet#cell#Motion('k', 1)
+ normal! $
+ endif
+
+ " If line ends with g:table_mode_separator
+ if getline('.')[col('.')-1] ==# g:table_mode_separator
+ execute 'normal! F' . g:table_mode_separator . '2l'
+ else
+ execute 'normal! 2F' . g:table_mode_separator . '2l'
+ endif
+ elseif a:direction ==# 'j'
+ if tablemode#table#IsRow(line('.') + 1)
+ " execute 'normal! ' . 1 . 'j'
+ normal! j
+ elseif tablemode#table#IsBorder(line('.') + 1) && tablemode#table#IsRow(line('.') + 2)
+ " execute 'normal! ' . 2 . 'j'
+ normal! 2j
+ endif
+ elseif a:direction ==# 'k'
+ if tablemode#table#IsRow(line('.') - 1)
+ " execute 'normal! ' . 1 . 'k'
+ normal! k
+ elseif tablemode#table#IsBorder(line('.') - 1) && tablemode#table#IsRow(line('.') - 2)
+ " execute 'normal! ' . (1 + 1) . 'k'
+ normal! 2k
+ endif
+ endif
+ endfor
+ endif
+endfunction
+
+" vim: sw=2 sts=2 fdl=0 fdm=marker
diff --git a/vim/bundle/vim-table-mode/autoload/tablemode/spreadsheet/formula.vim b/vim/bundle/vim-table-mode/autoload/tablemode/spreadsheet/formula.vim
new file mode 100644
index 0000000..8271b5d
--- /dev/null
+++ b/vim/bundle/vim-table-mode/autoload/tablemode/spreadsheet/formula.vim
@@ -0,0 +1,122 @@
+" Private Functions {{{1
+
+" Public Functions {{{1
+function! tablemode#spreadsheet#formula#Add(...) "{{{2
+ let fr = a:0 ? a:1 : input('f=')
+ let row = tablemode#spreadsheet#RowNr('.')
+ let colm = tablemode#spreadsheet#ColumnNr('.')
+ let indent = indent('.')
+ let indent_str = repeat(' ', indent)
+
+ if fr !=# ''
+ let fr = '$' . row . ',' . colm . '=' . fr
+ let fline = tablemode#spreadsheet#GetLastRow('.') + 1
+ if tablemode#table#IsBorder(fline) | let fline += 1 | endif
+ let cursor_pos = [line('.'), col('.')]
+ if getline(fline) =~# 'tmf: '
+ " Comment line correctly
+ let line_val = getline(fline)
+ let start_pos = match(line_val, tablemode#table#StartCommentExpr())
+ let end_pos = match(line_val, tablemode#table#EndCommentExpr())
+ if empty(end_pos) | let end_pos = len(line_val) | endif
+ let line_expr = strpart(line_val, start_pos, end_pos)
+ let sce = matchstr(line_val, tablemode#table#StartCommentExpr() . '\zs')
+ let ece = matchstr(line_val, tablemode#table#EndCommentExpr())
+ call setline(fline, sce . line_expr . '; ' . fr . ece)
+ else
+ let cstring = &commentstring
+ let [cmss, cmse] = ['', '']
+ if len(cstring) > 0
+ let cms = split(cstring, '%s')
+ if len(cms) == 2
+ let [cmss, cmse] = cms
+ else
+ let [cmss, cmse] = [cms[0], '']
+ endif
+ endif
+ let fr = indent_str . cmss . ' tmf: ' . fr . ' ' . cmse
+ call append(fline-1, fr)
+ call cursor(cursor_pos)
+ endif
+ call tablemode#spreadsheet#formula#EvaluateFormulaLine()
+ endif
+endfunction
+
+function! tablemode#spreadsheet#formula#EvaluateExpr(expr, line) abort "{{{2
+ let line = tablemode#utils#line(a:line)
+ let [target, expr] = map(split(a:expr, '='), 'tablemode#utils#strip(v:val)')
+ let cell = substitute(target, '\$', '', '')
+ if cell =~# ','
+ let [row, colm] = map(split(cell, ','), 'str2nr(v:val)')
+ else
+ let [row, colm] = [0, str2nr(cell)]
+ endif
+
+ if expr =~# 'Sum(.*)'
+ let expr = substitute(expr, 'Sum(\([^)]*\))', 'tablemode#spreadsheet#Sum("\1",'.line.','.colm.')', 'g')
+ endif
+
+ if expr =~# 'Average(.*)'
+ let expr = substitute(expr, 'Average(\([^)]*\))', 'tablemode#spreadsheet#Average("\1",'.line.','.colm.')', 'g')
+ endif
+
+ if expr =~# '\$\d\+,\d\+'
+ let expr = substitute(expr, '\$\(\d\+\),\(\d\+\)',
+ \ '\=str2float(tablemode#spreadsheet#cell#GetCells(line, submatch(1), submatch(2)))', 'g')
+ endif
+
+ if cell =~# ','
+ if expr =~# '\$'
+ let expr = substitute(expr, '\$\(\d\+\)',
+ \ '\=str2float(tablemode#spreadsheet#cell#GetCells(line, row, submatch(1)))', 'g')
+ endif
+ call tablemode#spreadsheet#cell#SetCell(eval(expr), line, row, colm)
+ else
+ let [row, line] = [1, tablemode#spreadsheet#GetFirstRow(line)]
+ while tablemode#table#IsRow(line)
+ let texpr = expr
+ if expr =~# '\$'
+ let texpr = substitute(texpr, '\$\(\d\+\)',
+ \ '\=str2float(tablemode#spreadsheet#cell#GetCells(line, row, submatch(1)))', 'g')
+ endif
+
+ call tablemode#spreadsheet#cell#SetCell(eval(texpr), line, row, colm)
+ let row += 1
+ let line += 1
+ endwhile
+ endif
+endfunction
+
+function! tablemode#spreadsheet#formula#EvaluateFormulaLine() abort "{{{2
+ let exprs = []
+ let cstring = &commentstring
+ let matchexpr = ''
+ if len(cstring) > 0
+ let cms = split(cstring, '%s')
+ if len(cms) == 2
+ let matchexpr = '^\s*' . escape(cms[0], '/*') . '\s*tmf: \zs.*\ze' . escape(cms[1], '/*') . '\s*$'
+ else
+ let matchexpr = '^\s*' . escape(cms[0], '/*') . '\s*tmf: \zs.*$'
+ endif
+ else
+ let matchexpr = '^\s* tmf: \zs.*$'
+ endif
+ if tablemode#table#IsRow('.') " We're inside the table
+ let line = tablemode#spreadsheet#GetLastRow('.')
+ let fline = line + 1
+ if tablemode#table#IsBorder(fline) | let fline += 1 | endif
+ if getline(fline) =~# 'tmf: '
+ let exprs = split(matchstr(getline(fline), matchexpr), ';')
+ endif
+ elseif getline('.') =~# 'tmf: ' " We're on the formula line
+ let line = line('.') - 1
+ if tablemode#table#IsBorder(line) | let line -= 1 | endif
+ if tablemode#table#IsRow(line)
+ let exprs = split(matchstr(getline('.'), matchexpr), ';')
+ endif
+ endif
+
+ for expr in exprs
+ call tablemode#spreadsheet#formula#EvaluateExpr(expr, line)
+ endfor
+endfunction
diff --git a/vim/bundle/vim-table-mode/autoload/tablemode/table.vim b/vim/bundle/vim-table-mode/autoload/tablemode/table.vim
new file mode 100644
index 0000000..82344b1
--- /dev/null
+++ b/vim/bundle/vim-table-mode/autoload/tablemode/table.vim
@@ -0,0 +1,198 @@
+" Private Functions {{{1
+function! s:BorderExpr() "{{{2
+ return tablemode#table#StartExpr() .
+ \ '[' . g:table_mode_corner . g:table_mode_corner_corner . ']' .
+ \ '[' . escape(g:table_mode_fillchar . g:table_mode_header_fillchar . g:table_mode_corner . g:table_mode_align_char, '-') . ']\+' .
+ \ '[' . g:table_mode_corner . g:table_mode_corner_corner . ']' .
+ \ tablemode#table#EndExpr()
+endfunction
+
+function! s:DefaultBorder() "{{{2
+ if tablemode#IsActive()
+ return g:table_mode_corner_corner . g:table_mode_fillchar . g:table_mode_corner . g:table_mode_fillchar . g:table_mode_corner_corner
+ else
+ return ''
+ endif
+endfunction
+
+function! s:GenerateHeaderBorder(line) "{{{2
+ let line = tablemode#utils#line(a:line)
+ if tablemode#table#IsRow(line - 1) || tablemode#table#IsRow(line + 1)
+ let line_val = ''
+ if tablemode#table#IsRow(line + 1)
+ let line_val = getline(line + 1)
+ endif
+ if tablemode#table#IsRow(line - 1) && tablemode#utils#strlen(line_val) < tablemode#utils#strlen(getline(line - 1))
+ let line_val = getline(line - 1)
+ endif
+ if tablemode#utils#strlen(line_val) <= 1 | return s:DefaultBorder() | endif
+
+ let border = substitute(line_val[stridx(line_val, g:table_mode_separator):strridx(line_val, g:table_mode_separator)], g:table_mode_separator, g:table_mode_corner, 'g')
+ " To accurately deal with unicode double width characters
+ if tablemode#table#IsHeader(line - 1)
+ let fill_columns = map(split(border, g:table_mode_corner), 'repeat(g:table_mode_header_fillchar, tablemode#utils#StrDisplayWidth(v:val))')
+ else
+ let fill_columns = map(split(border, g:table_mode_corner), 'repeat(g:table_mode_fillchar, tablemode#utils#StrDisplayWidth(v:val))')
+ endif
+ let border = g:table_mode_corner . join(fill_columns, g:table_mode_corner) . g:table_mode_corner
+ let border = substitute(border, '^' . g:table_mode_corner . '\(.*\)' . g:table_mode_corner . '$', g:table_mode_corner_corner . '\1' . g:table_mode_corner_corner, '')
+
+ " Incorporate header alignment chars
+ if getline(line) =~# g:table_mode_align_char
+ let pat = '[' . g:table_mode_corner_corner . g:table_mode_corner . ']'
+ let hcols = tablemode#align#Split(getline(line), pat)
+ let gcols = tablemode#align#Split(border, pat)
+
+ for idx in range(len(hcols))
+ if hcols[idx] =~# g:table_mode_align_char
+ " center align
+ if hcols[idx] =~# g:table_mode_align_char . '[^'.g:table_mode_align_char.']\+' . g:table_mode_align_char
+ let gcols[idx] = g:table_mode_align_char . gcols[idx][1:-2] . g:table_mode_align_char
+ elseif hcols[idx] =~# g:table_mode_align_char . '$'
+ let gcols[idx] = gcols[idx][:-2] . g:table_mode_align_char
+ else
+ let gcols[idx] = g:table_mode_align_char . gcols[idx][1:]
+ endif
+ endif
+ endfor
+ let border = join(gcols, '')
+ endif
+
+ let cstartexpr = tablemode#table#StartCommentExpr()
+ if tablemode#utils#strlen(cstartexpr) > 0 && getline(line) =~# cstartexpr
+ let sce = matchstr(line_val, tablemode#table#StartCommentExpr())
+ let ece = matchstr(line_val, tablemode#table#EndCommentExpr())
+ return sce . border . ece
+ elseif getline(line) =~# tablemode#table#StartExpr()
+ let indent = matchstr(line_val, tablemode#table#StartExpr())
+ return indent . border
+ else
+ return border
+ endif
+ else
+ return s:DefaultBorder()
+ endif
+endfunction
+
+" Public Functions {{{1
+function! tablemode#table#GetCommentStart() "{{{2
+ let cstring = &commentstring
+ if tablemode#utils#strlen(cstring) > 0
+ return substitute(split(cstring, '%s')[0], '[^()]', '\\\0', 'g')
+ else
+ return ''
+ endif
+endfunction
+
+function! tablemode#table#StartCommentExpr() "{{{2
+ let cstartexpr = tablemode#table#GetCommentStart()
+ if tablemode#utils#strlen(cstartexpr) > 0
+ return '^\s*' . cstartexpr . '\s*'
+ else
+ return ''
+ endif
+endfunction
+
+function! tablemode#table#GetCommentEnd() "{{{2
+ let cstring = &commentstring
+ if tablemode#utils#strlen(cstring) > 0
+ let cst = split(cstring, '%s')
+ if len(cst) == 2
+ return substitute(cst[1], '[^()]', '\\\0', 'g')
+ else
+ return ''
+ endif
+ else
+ return ''
+ endif
+endfunction
+
+function! tablemode#table#EndCommentExpr() "{{{2
+ let cendexpr = tablemode#table#GetCommentEnd()
+ if tablemode#utils#strlen(cendexpr) > 0
+ return '.*\zs\s\+' . cendexpr . '\s*$'
+ else
+ return ''
+ endif
+endfunction
+
+function! tablemode#table#StartExpr() "{{{2
+ let cstart = tablemode#table#GetCommentStart()
+ if tablemode#utils#strlen(cstart) > 0
+ return '^\s*\(' . cstart . '\)\?\s*'
+ else
+ return '^\s*'
+ endif
+endfunction
+
+function! tablemode#table#EndExpr() "{{{2
+ let cend = tablemode#table#GetCommentEnd()
+ if tablemode#utils#strlen(cend) > 0
+ return '\s*\(\s\+' . cend . '\)\?\s*$'
+ else
+ return '\s*$'
+ endif
+endfunction
+
+function! tablemode#table#IsBorder(line) "{{{2
+ return !empty(getline(a:line)) && getline(a:line) =~# s:BorderExpr()
+endfunction
+
+function! tablemode#table#IsHeader(line) "{{{2
+ let line = tablemode#utils#line(a:line)
+ " if line <= 0 || line > line('$') | return 0 | endif
+ return tablemode#table#IsRow(line)
+ \ && !tablemode#table#IsRow(line-1)
+ \ && !tablemode#table#IsRow(line-2)
+ \ && !tablemode#table#IsBorder(line-2)
+ \ && tablemode#table#IsBorder(line+1)
+endfunction
+
+function! tablemode#table#IsRow(line) "{{{2
+ return !tablemode#table#IsBorder(a:line) && getline(a:line) =~# (tablemode#table#StartExpr() . g:table_mode_separator) . '[^' . g:table_mode_separator . ']\+'
+endfunction
+
+function! tablemode#table#IsTable(line) "{{{2
+ return tablemode#table#IsRow(a:line) || tablemode#table#IsBorder(a:line)
+endfunction
+
+function! tablemode#table#AddBorder(line) "{{{2
+ call setline(a:line, s:GenerateHeaderBorder(a:line))
+endfunction
+
+function! tablemode#table#Realign(line) "{{{2
+ let line = tablemode#utils#line(a:line)
+
+ let lines = []
+ let [lnum, blines] = [line, []]
+ while tablemode#table#IsTable(lnum)
+ if tablemode#table#IsBorder(lnum)
+ call insert(blines, lnum)
+ let lnum -= 1
+ continue
+ endif
+ call insert(lines, {'lnum': lnum, 'text': getline(lnum)})
+ let lnum -= 1
+ endwhile
+
+ let lnum = line + 1
+ while tablemode#table#IsTable(lnum)
+ if tablemode#table#IsBorder(lnum)
+ call add(blines, lnum)
+ let lnum += 1
+ continue
+ endif
+ call add(lines, {'lnum': lnum, 'text': getline(lnum)})
+ let lnum += 1
+ endwhile
+
+ let lines = tablemode#align#Align(lines)
+
+ for aline in lines
+ call setline(aline.lnum, aline.text)
+ endfor
+
+ for bline in blines
+ call tablemode#table#AddBorder(bline)
+ endfor
+endfunction
diff --git a/vim/bundle/vim-table-mode/autoload/tablemode/utils.vim b/vim/bundle/vim-table-mode/autoload/tablemode/utils.vim
new file mode 100644
index 0000000..215da6c
--- /dev/null
+++ b/vim/bundle/vim-table-mode/autoload/tablemode/utils.vim
@@ -0,0 +1,49 @@
+" Private Functions {{{1
+
+" Public Functions {{{1
+function! tablemode#utils#throw(string) abort "{{{2
+ let v:errmsg = 'table-mode: ' . a:string
+ throw v:errmsg
+endfunction
+
+function! tablemode#utils#line(row) "{{{2
+ if type(a:row) == type('')
+ return line(a:row)
+ else
+ return a:row
+ endif
+endfunction
+
+function! tablemode#utils#strip(string) "{{{2
+ return matchstr(a:string, '^\s*\zs.\{-}\ze\s*$')
+endfunction
+
+" function! tablemode#utils#strlen {{{2
+" To count multibyte characters accurately
+function! tablemode#utils#strlen(text)
+ return strlen(substitute(a:text, '.', 'x', 'g'))
+endfunction
+
+function! tablemode#utils#StrDisplayWidth(string) "{{{2
+ if exists('*strdisplaywidth')
+ return strdisplaywidth(a:string)
+ else
+ " Implement the tab handling part of strdisplaywidth for vim 7.2 and
+ " earlier - not much that can be done about handling doublewidth
+ " characters.
+ let rv = 0
+ let i = 0
+
+ for char in split(a:string, '\zs')
+ if char == "\t"
+ let rv += &ts - i
+ let i = 0
+ else
+ let rv += 1
+ let i = (i + 1) % &ts
+ endif
+ endfor
+
+ return rv
+ endif
+endfunction
diff --git a/vim/bundle/vim-table-mode/doc/table-mode.txt b/vim/bundle/vim-table-mode/doc/table-mode.txt
new file mode 100644
index 0000000..b8e2754
--- /dev/null
+++ b/vim/bundle/vim-table-mode/doc/table-mode.txt
@@ -0,0 +1,444 @@
+*table-mode.txt* Table Mode for easy table formatting
+===============================================================================
+ Table Mode, THE AWESOME AUTOMATIC TABLE CREATOR & FORMATTER
+ VERSION 4.6.4
+
+ Author: Dhruva Sagar <http://dhruvasagar.com/>
+ License: MIT <http://opensource.org/licenses/MIT/>
+===============================================================================
+CONTENTS *table-mode-contents*
+
+ 1. Introduction .................... |table-mode-introduction|
+ 2. Getting Started ................. |table-mode-getting-started|
+ 3. Options ......................... |table-mode-options|
+ 4. Mappings ........................ |table-mode-mappings|
+ 5. Commands ........................ |table-mode-commands|
+ 6. Contributing .................... |table-mode-contributing|
+ 7. Report Issues ................... |table-mode-report-issues|
+
+===============================================================================
+INTRODUCTION *table-mode-introduction*
+
+Table Mode is simple plugin that makes building tables in vim a breeze. It is
+inspired from tpope's auto aligning script for creating tables in vim -
+https://gist.github.com/tpope/287147, which in turn utilizes the Tabular
+Plugin.
+
+===============================================================================
+GETTING STARTED *table-mode-getting-started*
+
+Create Table on the fly:
+ Using Table Mode is dead simple. You simply start typing on a new line
+ with the table separator - |table-mode-separator|, and you just type
+ away! The plugin does the rest automatically for you as you type. With
+ each additional separator you add, it aligns the table properly,
+ without having to do anything else.
+
+ Table Mode now supports gfm style tables and allows to define column
+ alignments with the aid of placing ':' (configured using
+ |g:table_mode_align_char|) on the table header border appropriately to
+ align content left or right.
+
+ The table mode is disabled by default and you can enter table mode
+ using |table-mode-toggle-map| or you can also enable it permanently
+ using |table-mode-always-active| if you wish though not recommended.
+
+ Table Mode allows for creation of tables within comments, it looks at
+ the 'commentstring' setting to identify whether the current line is
+ commented.
+
+Tableize content:
+ Table Mode enables conversion of delimited text into tables. Again
+ like table creation, this is also applicable within comments.
+
+Move between cells :
+ Now you can move between cells using table mode motions
+ '<Leader>t[hjkl]' to move left | down | up | right cells respectively.
+ You can use |table-mode-map-prefix| option to define the prefix
+ mapping to be used before 'hjkl'. The left | right motions wrap around
+ the table and move to the next | previous row after the last | first
+ cell in the current row if one exists.
+
+Manipulation of tables:
+ Tableize provides 3 easy ways to quickly manipulate tables.
+
+ 1. Cell Text Object : A text object for table cell
+ defined by |table-mode-cell-text-object|. You can use it with an
+ operator (d,c,y) to manipulate it easily. If you delete the cell using
+ this, it will delete the table separator along with it so if you type
+ out some new stuff, you will have to re-add it, which triggers a
+ re-alignment and the table would be formatted again.
+
+ 2. Delete Column : Delete an entire table column using
+ |table-mode-delete-column-map| .
+
+ 3. Delete Row : Delete an entire table row using
+ |table-mode-delete-row-map|
+
+Table Formulas:
+ Table Mode now has support for formulas like a spreadsheet. There
+ are 2 ways of defining formulas :
+
+ You can add formulas using |:TableAddFormula| or the mapping
+ |<Leader>tfa| defined by the option
+ |table-mode-add-formula-map| from within a table cell, which
+ will ask for input on the cmd-line with a 'f=' prompt. The
+ input formula will be appended to the formula line if one
+ exists or a new one will be created with the input formula
+ taking the current cell as the target cell. The formula line
+ is evaluated immediately to reflect the results.
+
+ You can directly also add / manipulate formula expressions in
+ the formula line. The formula line is a commented line right
+ after the table, beginning with 'tmf:' (table mode formula).
+ eg) '# tmf: $3=$2*$1'. You can add multiple formulas on the
+ line separated with a ';' eg) '# tmf: $3=$2*$1;$4=$3/3.14'
+
+ You can evaluate the formula line using |:TableEvalFormulaLine| or the
+ mapping |<Leader>tfe| defined by the option |table-mode-expr-calc-map|
+
+Formula Expressions :
+ Expressions are of the format '$target = formula'.
+
+ The target can be of 2 forms :
+
+ '$n': This matches the table column number 'n'. So the formula
+ would be evaluated for each cell in that column and the result
+ would be placed in it. You can use negative indice to
+ represent column relative to the last, -1 being the last.
+
+ '$n,m': This matches the table cell n,m (row, column). So in
+ this case the formula would be evaluated and the result will
+ be placed in this cell. You can also use negative values to
+ refer to cells relative to the size, -1 being the last (row or
+ column).
+
+ The formula can be a simple mathematical expression involving cells
+ which are also defined by the same format as that of the target cell.
+ Apart from basic mathematical expressions, table mode also provides
+ special functions 'Sum' and 'Average'. Both these functions take a
+ range as input. A range can be of two forms :
+
+ 'n:m': This represents cells in the current column from row
+ 'n' through 'm'. If 'm' is negative it represents 'm' row
+ above the current row (of the target cell).
+
+ 'r1,c1:r2,c2': This represents cells in the table from cell
+ r1,c1 through cell r2,c2 (row, column).
+
+ Examples :
+ $2 = $1 * $1
+ $2 = $1 / $1,3
+ $1,2 = $1,1 * $1,1
+ $5,1 = Sum(1:-1)
+ $5,3 = Sum(1,2:5,2)
+
+===============================================================================
+OPTIONS *table-mode-options*
+
+Overview:
+ |table-mode-loaded| ............. Disable the plugin.
+ |table-mode-corner| ............. Set corner character.
+ |table-mode-separator| .......... Set separator character.
+ |table-mode-fillchar| ........... Set table fillchar character.
+ |table-mode-map-prefix| ......... Set prefix for table mode commands.
+ |table-mode-toggle-map| ......... Set table mode toggle mapping.
+ |table-mode-always-active| ...... Set table mode to always enabled.
+ |table-mode-delimiter| .......... Set the delimiter for Tableize.
+ |table-mode-corner-corner| ...... Set the character to be used for
+ extreme corners of the table border.
+ |table-mode-align-char|.......... Set the alignment character which
+ can be added to the table header
+ border to control alignment of that
+ column.
+ |table-mode-motion-up-map| ...... Set the table motion up mapping
+ |table-mode-motion-down-map| .... Set the table motion down mapping
+ |table-mode-motion-left-map| .... Set the table motion left mapping
+ |table-mode-motion-right-map| ... Set the table motion right mapping
+ |table-mode-cell-text-object-a-map|
+ Set the 'a' cell text object
+ mapping
+ |table-mode-cell-text-object-i-map|
+ Set the 'i' cell text object
+ mapping
+ |table-mode-realign-map| ........ Set the realign mapping
+ |table-mode-delete-row-map| ..... Set the delete row mapping
+ |table-mode-delete-column-map| .. Set the delete column mapping
+ |table-mode-add-formula-map| .... Set the add formula mapping
+ |table-mode-eval-formula-map| ... Set the eval formula mapping
+ |table-mode-echo-cell-map| ...... Set the echo cell mapping
+ |table-mode-sort-map| ........... Set the table sort mapping
+
+g:loaded_table_mode *table-mode-loaded*
+ Use this option to disable the plugin: >
+ let g:loaded_table_mode = 1
+<
+g:table_mode_corner *table-mode-corner*
+ Use this option to define the table corner character: >
+ let g:table_mode_corner = '+'
+<
+g:table_mode_separator *table-mode-separator*
+ Use this option to define the table column separator character: >
+ let g:table_mode_separator = '|'
+<
+ This option also defines the trigger to be used to start creating a
+ table row in insert mode.
+
+g:table_mode_fillchar *table-mode-fillchar*
+ Use this option to define the table header border fill character: >
+ let g:table_mode_fillchar = '-'
+<
+
+g:table_mode_map_prefix *table-mode-map-prefix*
+ Use this option to define the table mode mapping prefix that will be
+ prefixed for all other table mode mappings. >
+ let g:table_mode_map_prefix = '<Leader>t'
+<
+
+g:table_mode_toggle_map *table-mode-toggle-map*
+ Use this option to define the mapping for toggling the table mode: >
+ let g:table_mode_toggle_map = 'm'
+<
+ Read |table-mode-mappings-toggle| for more info.
+
+ NOTE you will need to use the |table-mode-map-prefix| before this to
+ get the desired effect.
+
+g:table_mode_always_active *table-mode-always-active*
+ Use this option to permanently enable the table mode: >
+ let g:table_mode_always_active = 0
+<
+ This will trigger table creation once you type the
+ |table-mode-separator| as long as it's the first character on
+ the line, which can be annoying. I recommend you to instead use the
+ |table-mode-mappings-toggle| or |table-mode-commands-toggle| to toggle
+ the table mode or |table-mode-commands-enable| to enable and
+ |table-mode-commands-disable| to disable mode when needed.
+
+g:table_mode_delimiter *table-mode-delimiter*
+ Use this option to define the delimiter which used by
+ |table-mode-commands-tableize| >
+ let g:table_mode_delimiter = ','
+<
+g:table_mode_corner_corner *table-mode-corner-corner*
+ Use this option to define the character to be used for the extreme
+ corners of the table border. >
+ let g:table_mode_corner_corner = '|'
+<
+g:table_mode_align_char *table-mode-align-char*
+ Use this option to define the character to be used for defining
+ alignments for columns in the table header border. >
+ let g:table_mode_align_char = ':'
+<
+g:table_mode_disable_mappings *table-mode-disable-mappings*
+ Set this to true to disable all mappings. >
+ let g:table_mode_disable_mappings = 1
+<
+g:table_mode_motion_up_map *table-mode-motion-up-map*
+ Set this to configure the mapping to move up a cell vertically. >
+ let g:table_mode_motion_up_map = '{<Bar>'
+<
+g:table_mode_motion_down_map *table-mode-motion-down-map*
+ Set this to configure the mapping to move down a cell vertically. >
+ let g:table_mode_motion_down_map = '}<Bar>'
+>
+g:table_mode_motion_left_map *table-mode-motion-left-map*
+ Set this to configure the mapping to move to the left cell. >
+ let g:table_mode_motion_left_map = '[<Bar>'
+>
+g:table_mode_motion_right_map *table-mode-motion-right-map*
+ Set this to configure the mapping to move to the right cell. >
+ let g:table_mode_motion_right_map = ']<Bar>'
+>
+g:table_mode_cell_text_object_a_map *table-mode-cell-text-object-a-map*
+ Set this to configure the mapping to define the text object for around
+ cell object. >
+ let g:table_mode_cell_text_object_a_map = 'a<Bar>'
+>
+g:table_mode_cell_text_object_i_map *table-mode-cell-text-object-i-map*
+ Set this to configure the mapping to define the text object for inner
+ cell object. >
+ let g:table_mode_cell_text_object_i_map = 'i<Bar>'
+>
+g:table_mode_realign_map *table-mode-realign-map*
+ Set this to configure the mapping for table realign. >
+ let g:table_mode_realign_map = '<Leader>tr'
+>
+g:table_mode_delete_row_map *table-mode-delete-row-map*
+ Set this to configure the mapping for deleting a table row. >
+ let g:table_mode_delete_row_map = '<Leader>tdd'
+>
+g:table_mode_delete_column_map *table-mode-delete-column-map*
+ Set this to configure the mapping for deleting a table column. >
+ let g:table_mode_delete_column_map = '<Leader>tdc'
+>
+g:table_mode_add_formula_map *table-mode-add-formula-map*
+ Set this to configure the mapping for adding a formula for a table
+ cell. >
+ let g:table_mode_add_formula_map = '<Leader>tfa'
+>
+g:table_mode_eval_formula_map *table-mode-eval-formula-map*
+ Set this to configure the mapping for evaluating the formula line. >
+ let g:table_mode_eval_formula_map = '<Leader>tfe'
+>
+g:table_mode_echo_cell_map *table-mode-echo-cell-map*
+ Set this to configure the mapping for echoing the tablemode
+ representation of the current cell. >
+ let g:table_mode_echo_cell_map = '<Leader>t?'
+>
+g:table_mode_sort_map *table-mode-sort-map*
+ Set this to configure the mapping for sorting the table mode by
+ current column. >
+ let g:table_mode_sort_map = '<Leader>ts'
+>
+
+===============================================================================
+MAPPINGS *table-mode-mappings*
+
+ *table-mode-mappings-prefix*
+<Leader>t This is a prefix defined by the option |table-mode-map-prefix|
+ used before all other table mode commands.
+
+ *table-mode-mappings-toggle*
+<Leader>tm Toggle table mode for the current buffer. You can change this
+ using the |toggle-mode-options-toggle-map| option.
+
+ NOTE This is applicable only if |table-mode-always-active| is
+ not set.
+
+ *table-mode-mappings-trigger*
+| Trigger table creation in table mode. You can change this
+ using the |toggle-mode-options-separator| option.
+
+<Leader>tt Triggers |table-mode-commands-tableize| on the visually
+ selected content.
+
+ *table-mode-mappings-op-trigger*
+<Leader>T Triggers |table-mode-commands-tableize| on the visually
+ selected asking for user to input the delimiter.
+
+ *table-mode-mappings-realign*
+<Leader>tr Realigns table columns
+
+<Leader>t? Echo the current table cells representation for defining
+ formulas.
+
+ *table-mode-mappings-motions*
+[| Move to previous cell
+]| Move to next cell
+{| Move to the cell above
+}| Move to the cell below
+
+ *table-mode-mappings-delete-row*
+<Leader>tdd Delete the entire table row you are on or multiple rows using
+ a [count]. You can change this using |table-mode-delete-row-map|
+ option.
+
+ *table-mode-mappings-delete-column*
+<Leader>tdc Delete entire table column you are within. You can preceed it
+ with a [count] to delete multiple columns to the right. You
+ can change this using |table-mode-delete-column-map| option.
+
+ *table-mode-mappings-add-formula*
+<Leader>tfa Add a fomula for the current table cell. This invokes
+ |TableAddFormula| command.
+
+ *table-mode-mappings-evaluate-formula-line*
+<Leader>tfe Evaluate the formula line which is a commented line right
+ after the table beginning with 'tmf:'. If one exists this
+ would evaluate the formula line and update the table
+ accordingly. This invokes the |TableEvalFormulaLine| command.
+
+
+ *table-mode-mappings-sort-column*
+<Leader>ts Sort a column under the cursor. This invokes |TableSort|
+
+|| Expands to a header border. You can change this by changing
+ |table-mode-separator| option. You can change the character to
+ be used for te extreme corners of the border by changing
+ |table-mode-corner-corner| option.
+
+===============================================================================
+COMMANDS *table-mode-commands*
+
+ *:TableModeToggle*
+ *table-mode-:TableModeToggle*
+:TableModeToggle
+ Toggles the table mode. Same effect as |toggle-mode-mappings-toggle|.
+
+ NOTE this is applicable only if |table-mode-always-active| is
+ not set.
+
+ *:TableModeEnable*
+ *table-mode-:TableModeEnable*
+:TableModeEnable
+ Enables Table Mode.
+
+ NOTE this is applicable only if |table-mode-always-active| is
+ not set.
+
+ *:TableModeDisable*
+ *table-mode-:TableModeDisable*
+:TableModeDisable
+ Disables Table Mode.
+
+ NOTE this is applicable only if |table-mode-always-active| is
+ not set.
+
+ *:Tableize*
+ *table-mode-:Tableize*
+:Tableize
+ This converts the current line into a table if it consists of
+ |table-mode-delimiter|. This accepts a range, without which it
+ applies on the current line.
+
+ This accepts a {pattern} similar to Tabular which defines the
+ delimiter. eg.) >
+ :Tableize/;
+<
+ The above command will Tableize using ';' as the delimiter.
+
+ NOTE this is optional, by default without the expression it will
+ tableize the content using |table-mode-delimiter| as the delimiter.
+
+ *:TableModeRealign*
+ *table-mode-:TableModeRealign*
+:TableModeRealign
+ This command triggers |table-mode-mappings-realign|
+
+ *:TableAddFormula*
+ *table-mode-:TableAddFormula*
+:TableAddFormula
+ This command is for defining a formula for the current table cell. It
+ takes input on the cmd-line with a 'f=' prompt and appends it to the
+ formula line if it exists or adds a new formula line with the
+ expression using the current cell as the target and the input formula.
+
+ *:TableEvalFormulaLine*
+ *table-mode-:TableEvalFormulaLine*
+:TableEvalFormulaLine
+ This command when invoked from anywhere within the table or directly
+ on the formula line evaluates it and updates the table accordingly.
+
+ *:TableSort*
+ *table-mode-:TableSort*
+:TableSort[!] [i][u][r][n][x][o]
+ This command sorts column under the cursor and inherits the same flags
+ as the |:sort| command.
+
+ With [!] the order is reversed.
+
+===============================================================================
+CONTRIBUTING *table-mode-contributing*
+
+If you want to take a stab at it, by all means, send me a pull request on
+Github (http://github.com/dhruvasagar/table-mode) or get in touch with me
+directly via e-mail at dhruva 'dot' sagar 'at' gmail.com.
+
+===============================================================================
+REPORT ISSUES *table-mode-report-issues*
+
+If you discover any issues, please report them at
+http://github.com/dhruvasagar/table-mode/issues.
+
+ vim:tw=78:ts=8:ft=help:norl:ai:et
diff --git a/vim/bundle/vim-table-mode/plugin/table-mode.vim b/vim/bundle/vim-table-mode/plugin/table-mode.vim
new file mode 100644
index 0000000..3e78186
--- /dev/null
+++ b/vim/bundle/vim-table-mode/plugin/table-mode.vim
@@ -0,0 +1,132 @@
+" Finish if already loaded {{{1
+if exists('g:loaded_table_mode')
+ finish
+endif
+let g:loaded_table_mode = 1
+
+" Avoiding side effects {{{1
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! s:SetGlobalOptDefault(opt, val) "{{{1
+ if !exists('g:' . a:opt)
+ let g:{a:opt} = a:val
+ endif
+endfunction
+
+" Set Global Defaults {{{1
+call s:SetGlobalOptDefault('table_mode_corner', '+')
+call s:SetGlobalOptDefault('table_mode_verbose', 0)
+call s:SetGlobalOptDefault('table_mode_separator', '|')
+call s:SetGlobalOptDefault('table_mode_fillchar', '-')
+call s:SetGlobalOptDefault('table_mode_header_fillchar', '-')
+call s:SetGlobalOptDefault('table_mode_map_prefix', '<Leader>t')
+call s:SetGlobalOptDefault('table_mode_toggle_map', 'm')
+call s:SetGlobalOptDefault('table_mode_always_active', 0)
+call s:SetGlobalOptDefault('table_mode_delimiter', ',')
+call s:SetGlobalOptDefault('table_mode_corner_corner', '|')
+call s:SetGlobalOptDefault('table_mode_align_char', ':')
+call s:SetGlobalOptDefault('table_mode_disable_mappings', 0)
+
+call s:SetGlobalOptDefault('table_mode_motion_up_map', '{<Bar>')
+call s:SetGlobalOptDefault('table_mode_motion_down_map', '}<Bar>')
+call s:SetGlobalOptDefault('table_mode_motion_left_map', '[<Bar>')
+call s:SetGlobalOptDefault('table_mode_motion_right_map', ']<Bar>')
+
+call s:SetGlobalOptDefault('table_mode_cell_text_object_a_map', 'a<Bar>')
+call s:SetGlobalOptDefault('table_mode_cell_text_object_i_map', 'i<Bar>')
+
+call s:SetGlobalOptDefault('table_mode_realign_map', '<Leader>tr')
+call s:SetGlobalOptDefault('table_mode_delete_row_map', '<Leader>tdd')
+call s:SetGlobalOptDefault('table_mode_delete_column_map', '<Leader>tdc')
+call s:SetGlobalOptDefault('table_mode_add_formula_map', '<Leader>tfa')
+call s:SetGlobalOptDefault('table_mode_eval_formula_map', '<Leader>tfe')
+call s:SetGlobalOptDefault('table_mode_echo_cell_map', '<Leader>t?')
+call s:SetGlobalOptDefault('table_mode_sort_map', '<Leader>ts')
+
+function! s:TableEchoCell() "{{{1
+ if tablemode#table#IsRow('.')
+ echomsg '$' . tablemode#spreadsheet#RowNr('.') . ',' . tablemode#spreadsheet#ColumnNr('.')
+ endif
+endfunction
+
+augroup TableMode
+ au!
+
+ autocmd Syntax * if tablemode#IsActive() | call tablemode#SyntaxEnable() | endif
+augroup END
+
+" Define Commands & Mappings {{{1
+if !g:table_mode_always_active "{{{2
+ exec "nnoremap <silent> " . g:table_mode_map_prefix . g:table_mode_toggle_map .
+ \ " <Esc>:call tablemode#Toggle()<CR>"
+ command! -nargs=0 TableModeToggle call tablemode#Toggle()
+ command! -nargs=0 TableModeEnable call tablemode#Enable()
+ command! -nargs=0 TableModeDisable call tablemode#Disable()
+else
+ let table_mode_separator_map = g:table_mode_separator
+ " '|' is a special character, we need to map <Bar> instead
+ if g:table_mode_separator ==# '|' | let table_mode_separator_map = '<Bar>' | endif
+
+ execute "inoremap <silent> " . table_mode_separator_map . ' ' .
+ \ table_mode_separator_map . "<Esc>:call tablemode#TableizeInsertMode()<CR>a"
+ unlet table_mode_separator_map
+endif
+" }}}2
+
+command! -nargs=? -range Tableize <line1>,<line2>call tablemode#TableizeRange(<q-args>)
+command! -nargs=? -bang TableSort call tablemode#spreadsheet#Sort(<bang>0, <q-args>)
+command! TableAddFormula call tablemode#spreadsheet#formula#Add()
+command! TableModeRealign call tablemode#table#Realign('.')
+command! TableEvalFormulaLine call tablemode#spreadsheet#formula#EvaluateFormulaLine()
+
+" '|' is a special character, we need to map <Bar> instead
+if g:table_mode_separator ==# '|' | let separator_map = '<Bar>' | endif
+execute 'inoremap <silent> <Plug>(table-mode-tableize)' separator_map . '<Esc>:call tablemode#TableizeInsertMode()<CR>a'
+
+nnoremap <silent> <Plug>(table-mode-tableize) :Tableize<CR>
+xnoremap <silent> <Plug>(table-mode-tableize) :Tableize<CR>
+xnoremap <silent> <Plug>(table-mode-tableize-delimiter) :<C-U>call tablemode#TableizeByDelimiter()<CR>
+
+nnoremap <silent> <Plug>(table-mode-realign) :call tablemode#table#Realign('.')<CR>
+
+nnoremap <silent> <Plug>(table-mode-motion-up) :<C-U>call tablemode#spreadsheet#cell#Motion('k')<CR>
+nnoremap <silent> <Plug>(table-mode-motion-down) :<C-U>call tablemode#spreadsheet#cell#Motion('j')<CR>
+nnoremap <silent> <Plug>(table-mode-motion-left) :<C-U>call tablemode#spreadsheet#cell#Motion('h')<CR>
+nnoremap <silent> <Plug>(table-mode-motion-right) :<C-U>call tablemode#spreadsheet#cell#Motion('l')<CR>
+
+onoremap <silent> <Plug>(table-mode-cell-text-object-a) :<C-U>call tablemode#spreadsheet#cell#TextObject(0)<CR>
+onoremap <silent> <Plug>(table-mode-cell-text-object-i) :<C-U>call tablemode#spreadsheet#cell#TextObject(1)<CR>
+xnoremap <silent> <Plug>(table-mode-cell-text-object-a) :<C-U>call tablemode#spreadsheet#cell#TextObject(0)<CR>
+xnoremap <silent> <Plug>(table-mode-cell-text-object-i) :<C-U>call tablemode#spreadsheet#cell#TextObject(1)<CR>
+
+nnoremap <silent> <Plug>(table-mode-delete-row) :call tablemode#spreadsheet#DeleteRow()<CR>
+nnoremap <silent> <Plug>(table-mode-delete-column) :call tablemode#spreadsheet#DeleteColumn()<CR>
+
+nnoremap <silent> <Plug>(table-mode-add-formula) :call tablemode#spreadsheet#formula#Add()<CR>
+nnoremap <silent> <Plug>(table-mode-eval-formula) :call tablemode#spreadsheet#formula#EvaluateFormulaLine()<CR>
+
+nnoremap <silent> <Plug>(table-mode-echo-cell) :call <SID>TableEchoCell()<CR>
+
+nnoremap <silent> <Plug>(table-mode-sort) :call tablemode#spreadsheet#Sort('')<CR>
+
+if !hasmapto('<Plug>(table-mode-tableize)')
+ exec "nmap " . g:table_mode_map_prefix . "t <Plug>(table-mode-tableize)"
+ exec "xmap " . g:table_mode_map_prefix . "t <Plug>(table-mode-tableize)"
+endif
+
+if !hasmapto('<Plug>(table-mode-tableize-delimiter)')
+ xmap <Leader>T <Plug>(table-mode-tableize-delimiter)
+endif
+
+augroup TableMode "{{{1
+ au!
+
+ autocmd User TableModeEnabled call tablemode#logger#log('Table Mode Enabled')
+ autocmd User TableModeDisabled call tablemode#logger#log('Table Mode Disabled')
+augroup END
+" Avoiding side effects {{{1
+let &cpo = s:save_cpo
+
+" ModeLine {{{
+" vim: sw=2 sts=2 fdl=0 fdm=marker
diff --git a/vim/bundle/vim-table-mode/t/align.vim b/vim/bundle/vim-table-mode/t/align.vim
new file mode 100644
index 0000000..930504d
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/align.vim
@@ -0,0 +1,20 @@
+" vim: fdm=indent
+source t/config/options.vim
+
+function! ConvertLines2Dict(lines)
+ let lines = []
+ for idx in range(len(a:lines))
+ call insert(lines, {"lnum": idx+1, "text": a:lines[idx]})
+ endfor
+ return lines
+endfunction
+
+describe 'Align'
+ it 'should align table content correctly'
+ Expect tablemode#align#Align(ConvertLines2Dict(readfile('t/fixtures/align/simple_before.txt'))) == ConvertLines2Dict(readfile('t/fixtures/align/simple_after.txt'))
+ end
+
+ it 'should align table content with unicode characters correctly'
+ Expect tablemode#align#Align(ConvertLines2Dict(readfile('t/fixtures/align/unicode_before.txt'))) == ConvertLines2Dict(readfile('t/fixtures/align/unicode_after.txt'))
+ end
+end
diff --git a/vim/bundle/vim-table-mode/t/cell.vim b/vim/bundle/vim-table-mode/t/cell.vim
new file mode 100644
index 0000000..e3d03ed
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/cell.vim
@@ -0,0 +1,135 @@
+" vim: fdm=indent
+source t/config/options.vim
+
+describe 'cell'
+ describe 'API'
+ before
+ new
+ read t/fixtures/sample.txt
+ end
+
+ it 'should return the cells with GetCells'
+ Expect tablemode#spreadsheet#cell#GetCells(2, 1, 1) ==# 'test11'
+ " Get Rows
+ Expect tablemode#spreadsheet#cell#GetCells(2, 1) == ['test11', 'test12']
+ Expect tablemode#spreadsheet#cell#GetCells(2, 2) == ['test21', 'test22']
+ " Get Columns
+ Expect tablemode#spreadsheet#cell#GetCells(2, 0, 1) == ['test11', 'test21']
+ Expect tablemode#spreadsheet#cell#GetCells(2, 0, 2) == ['test12', 'test22']
+ end
+
+ it 'should return the row with GetRow'
+ Expect tablemode#spreadsheet#cell#GetRow(1, 2) == ['test11', 'test12']
+ Expect tablemode#spreadsheet#cell#GetRow(2, 2) == ['test21', 'test22']
+ end
+
+ it 'should return the column with GetColumn'
+ Expect tablemode#spreadsheet#cell#GetColumn(1, 2) == ['test11', 'test21']
+ Expect tablemode#spreadsheet#cell#GetColumn(2, 2) == ['test12', 'test22']
+ end
+
+ it 'should return the cells in a range with GetCellRange'
+ " Entire table as range
+ Expect tablemode#spreadsheet#cell#GetCellRange('1,1:2,2', 2, 1) == [['test11', 'test21'], ['test12', 'test22']]
+
+ " Get Rows given different seed lines and columns
+ Expect tablemode#spreadsheet#cell#GetCellRange('1,1:1,2', 2, 1) == ['test11', 'test12']
+ Expect tablemode#spreadsheet#cell#GetCellRange('1,1:1,2', 2, 2) == ['test11', 'test12']
+ Expect tablemode#spreadsheet#cell#GetCellRange('1,1:1,2', 3, 1) == ['test11', 'test12']
+ Expect tablemode#spreadsheet#cell#GetCellRange('1,1:1,2', 3, 2) == ['test11', 'test12']
+ Expect tablemode#spreadsheet#cell#GetCellRange('2,1:2,2', 2, 1) == ['test21', 'test22']
+ Expect tablemode#spreadsheet#cell#GetCellRange('2,1:2,2', 2, 2) == ['test21', 'test22']
+ Expect tablemode#spreadsheet#cell#GetCellRange('2,1:2,2', 3, 1) == ['test21', 'test22']
+ Expect tablemode#spreadsheet#cell#GetCellRange('2,1:2,2', 3, 2) == ['test21', 'test22']
+
+ " Get Columns given different seed lines and column
+ Expect tablemode#spreadsheet#cell#GetCellRange('1:2', 2, 1) == ['test11', 'test21']
+ Expect tablemode#spreadsheet#cell#GetCellRange('1:2', 2, 2) == ['test12', 'test22']
+ Expect tablemode#spreadsheet#cell#GetCellRange('1:2', 3, 1) == ['test11', 'test21']
+ Expect tablemode#spreadsheet#cell#GetCellRange('1:2', 3, 2) == ['test12', 'test22']
+
+ " Get Column given negative values in range for representing rows from
+ " the end, -1 being the second last row.
+ Expect tablemode#spreadsheet#cell#GetCellRange('1:-1', 2, 1) == ['test11']
+ Expect tablemode#spreadsheet#cell#GetCellRange('1:-1', 3, 1) == ['test11']
+ Expect tablemode#spreadsheet#cell#GetCellRange('1:-1', 2, 2) == ['test12']
+ Expect tablemode#spreadsheet#cell#GetCellRange('1:-1', 3, 2) == ['test12']
+ end
+ end
+
+ describe 'Motions'
+ describe 'left or right'
+ before
+ new
+ normal! ggdG
+ read t/fixtures/sample.txt
+ call cursor(2, 3)
+ end
+
+ it 'should move left when not on first column'
+ call cursor(2, 12)
+ Expect tablemode#spreadsheet#ColumnNr('.') == 2
+ call tablemode#spreadsheet#cell#Motion('h')
+ Expect tablemode#spreadsheet#ColumnNr('.') == 1
+ end
+
+ it 'should move to the previous row last column if it exists when on first column'
+ call cursor(3, 3)
+ Expect tablemode#spreadsheet#RowNr('.') == 2
+ Expect tablemode#spreadsheet#ColumnNr('.') == 1
+ call tablemode#spreadsheet#cell#Motion('h')
+ Expect tablemode#spreadsheet#RowNr('.') == 1
+ Expect tablemode#spreadsheet#ColumnNr('.') == 2
+ end
+
+ it 'should move right when not on last column'
+ Expect tablemode#spreadsheet#ColumnNr('.') == 1
+ call tablemode#spreadsheet#cell#Motion('l')
+ Expect tablemode#spreadsheet#ColumnNr('.') == 2
+ end
+
+ it 'should move to the next row first column if it exists when on last column'
+ call cursor(2, 12)
+ Expect tablemode#spreadsheet#RowNr('.') == 1
+ Expect tablemode#spreadsheet#ColumnNr('.') == 2
+ call tablemode#spreadsheet#cell#Motion('l')
+ Expect tablemode#spreadsheet#RowNr('.') == 2
+ Expect tablemode#spreadsheet#ColumnNr('.') == 1
+ end
+ end
+
+ describe 'up or down'
+ before
+ new
+ normal! ggdG
+ read t/fixtures/sample.txt
+ call cursor(2, 3)
+ end
+
+ it 'should move a row up unless on first row'
+ call cursor(3, 3)
+ Expect tablemode#spreadsheet#RowNr('.') == 2
+ call tablemode#spreadsheet#cell#Motion('k')
+ Expect tablemode#spreadsheet#RowNr('.') == 1
+ end
+
+ it 'should remain on first row when trying to move up'
+ Expect tablemode#spreadsheet#RowNr('.') == 1
+ call tablemode#spreadsheet#cell#Motion('k')
+ Expect tablemode#spreadsheet#RowNr('.') == 1
+ end
+
+ it 'should move a row down unless on last row'
+ Expect tablemode#spreadsheet#RowNr('.') == 1
+ call tablemode#spreadsheet#cell#Motion('j')
+ Expect tablemode#spreadsheet#RowNr('.') == 2
+ end
+
+ it 'should remain on last row when trying to move down'
+ Expect tablemode#spreadsheet#RowNr('.') == 1
+ call tablemode#spreadsheet#cell#Motion('k')
+ Expect tablemode#spreadsheet#RowNr('.') == 1
+ end
+ end
+ end
+end
diff --git a/vim/bundle/vim-table-mode/t/config/options.vim b/vim/bundle/vim-table-mode/t/config/options.vim
new file mode 100644
index 0000000..99b5098
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/config/options.vim
@@ -0,0 +1,27 @@
+let g:table_mode_corner = '+'
+let g:table_mode_separator = '|'
+let g:table_mode_fillchar = '-'
+let g:table_mode_header_fillchar = '-'
+let g:table_mode_map_prefix = '<Leader>t'
+let g:table_mode_toggle_map = 'm'
+let g:table_mode_always_active = 0
+let g:table_mode_delimiter = ','
+let g:table_mode_corner_corner = '|'
+let g:table_mode_align_char = ':'
+let g:table_mode_disable_mappings = 0
+
+let g:table_mode_motion_up_map = '{<Bar>'
+let g:table_mode_motion_down_map = '}<Bar>'
+let g:table_mode_motion_left_map = '[<Bar>'
+let g:table_mode_motion_right_map = ']<Bar>'
+
+let g:table_mode_cell_text_object_a_map = 'a<Bar>'
+let g:table_mode_cell_text_object_i_map = 'i<Bar>'
+
+let g:table_mode_realign_map = '<Leader>tr'
+let g:table_mode_delete_row_map = '<Leader>tdd'
+let g:table_mode_delete_column_map = '<Leader>tdc'
+let g:table_mode_add_formula_map = '<Leader>tfa'
+let g:table_mode_eval_formula_map = '<Leader>tfe'
+let g:table_mode_echo_cell_map = '<Leader>t?'
+let g:table_mode_sort_map = '<Leader>ts'
diff --git a/vim/bundle/vim-table-mode/t/fixtures/align/simple_after.txt b/vim/bundle/vim-table-mode/t/fixtures/align/simple_after.txt
new file mode 100644
index 0000000..ed96f07
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/align/simple_after.txt
@@ -0,0 +1,2 @@
+| This | is a | table |
+| This | is also | a table |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/align/simple_before.txt b/vim/bundle/vim-table-mode/t/fixtures/align/simple_before.txt
new file mode 100644
index 0000000..b483ea5
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/align/simple_before.txt
@@ -0,0 +1,2 @@
+|This|is a|table|
+|This|is also|a table|
diff --git a/vim/bundle/vim-table-mode/t/fixtures/align/unicode_after.txt b/vim/bundle/vim-table-mode/t/fixtures/align/unicode_after.txt
new file mode 100644
index 0000000..8778914
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/align/unicode_after.txt
@@ -0,0 +1,2 @@
+| This | is 測試 | table |
+| This | is also | a table |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/align/unicode_before.txt b/vim/bundle/vim-table-mode/t/fixtures/align/unicode_before.txt
new file mode 100644
index 0000000..3edd654
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/align/unicode_before.txt
@@ -0,0 +1,2 @@
+| This | is 測試 | table |
+| This | is also | a table |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/cell/sample.txt b/vim/bundle/vim-table-mode/t/fixtures/cell/sample.txt
new file mode 100644
index 0000000..9e670d5
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/cell/sample.txt
@@ -0,0 +1,2 @@
+| 1 | 2 |
+| 3 | 4 |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/formula/formula.txt b/vim/bundle/vim-table-mode/t/fixtures/formula/formula.txt
new file mode 100644
index 0000000..ab2df91
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/formula/formula.txt
@@ -0,0 +1,7 @@
+| Item | Cost |
+|----------+-------|
+| Bread | 20 |
+| Tomatoes | 5 |
+| Pasta | 100 |
+| Total | 0 |
+/* tmf: $4,2=Sum(1:-1) */
diff --git a/vim/bundle/vim-table-mode/t/fixtures/formula/sample.txt b/vim/bundle/vim-table-mode/t/fixtures/formula/sample.txt
new file mode 100644
index 0000000..2920bbc
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/formula/sample.txt
@@ -0,0 +1,7 @@
+| Item | Cost |
+|----------+------|
+| Bread | 20 |
+| Tomatoes | 5 |
+| Pasta | 100 |
+| Total | |
+| Test | |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/sample.txt b/vim/bundle/vim-table-mode/t/fixtures/sample.txt
new file mode 100644
index 0000000..e447226
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/sample.txt
@@ -0,0 +1,4 @@
+
+| test11 | test12 |
+| test21 | test22 |
+
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample.txt
new file mode 100644
index 0000000..e447226
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/table/sample.txt
@@ -0,0 +1,4 @@
+
+| test11 | test12 |
+| test21 | test22 |
+
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header.txt
new file mode 100644
index 0000000..75f8f25
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header.txt
@@ -0,0 +1,3 @@
+| test11 | test12 |
+
+| test21 | test22 |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header_unicode.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header_unicode.txt
new file mode 100644
index 0000000..7b4e02a
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/table/sample_for_header_unicode.txt
@@ -0,0 +1,9 @@
+
+| abc | 测试长度 | 长测试 |
+
+| 长 | 测试测试测试测试 | 测试测试 |
+
+| 测试测试 | 测试 | 测试测测试 |
+
+| 测试测试测试 | 测试测试 | 测试 |
+
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_after.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_after.txt
new file mode 100644
index 0000000..e4362a1
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_after.txt
@@ -0,0 +1,4 @@
+| S. No | Title | Message |
+|-------+:------+:-------:|
+| 1 | t1 | msg1 |
+| 2 | t2 | msg2 |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_before.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_before.txt
new file mode 100644
index 0000000..1f65bfd
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_before.txt
@@ -0,0 +1,4 @@
+|S. No|Title|Message|
+|-----+:----+:-----:|
+|1|t1|msg1|
+|2|t2|msg2|
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_after.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_after.txt
new file mode 100644
index 0000000..4c70b01
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_after.txt
@@ -0,0 +1,8 @@
+|--------------+------------------+------------|
+| 测试测试 | 测试长度 | 长测试 |
+|--------------+:----------------:+-----------:|
+| abc | 测试长度 | 长测试 |
+| 长 | 测试测试测试测试 | 测试测试 |
+| 测试测试 | 测试 | 测试测测试 |
+| 测试测试测试 | 测试测试 | 测试 |
+|--------------+------------------+------------|
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_before.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_before.txt
new file mode 100644
index 0000000..67bf1db
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/table/sample_header_realign_unicode_before.txt
@@ -0,0 +1,8 @@
+|--------+--------+------|
+|测试测试|测试长度|长测试|
+|--------+:------:+-----:|
+|abc|测试长度|长测试|
+|长|测试测试测试测试|测试测试|
+|测试测试|测试|测试测测试|
+|测试测试测试|测试测试|测试|
+|------------+--------+----|
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_after.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_after.txt
new file mode 100644
index 0000000..e7fd9e1
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_after.txt
@@ -0,0 +1,2 @@
+| test11 | test12 |
+| test21 | test22 |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_before.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_before.txt
new file mode 100644
index 0000000..d1b3499
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_before.txt
@@ -0,0 +1,2 @@
+|test11|test12|
+|test21|test22|
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_after.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_after.txt
new file mode 100644
index 0000000..b479b24
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_after.txt
@@ -0,0 +1,4 @@
+| abc | 测试长度 | 长测试 |
+| 长 | 测试测试测试测试 | 测试测试 |
+| 测试测试 | 测试 | 测试测测试 |
+| 测试测试测试 | 测试测试 | 测试 |
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_before.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_before.txt
new file mode 100644
index 0000000..8c3124f
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/table/sample_realign_unicode_before.txt
@@ -0,0 +1,4 @@
+|abc|测试长度|长测试|
+|长|测试测试测试测试|测试测试|
+|测试测试|测试|测试测测试|
+|测试测试测试|测试测试|测试|
diff --git a/vim/bundle/vim-table-mode/t/fixtures/table/sample_with_header.txt b/vim/bundle/vim-table-mode/t/fixtures/table/sample_with_header.txt
new file mode 100644
index 0000000..9213e7f
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/table/sample_with_header.txt
@@ -0,0 +1,7 @@
+|--------+---------|
+| Title | Message |
+|--------+---------|
+| test11 | test12 |
+| test21 | test22 |
+|--------+---------|
+
diff --git a/vim/bundle/vim-table-mode/t/fixtures/tableize.txt b/vim/bundle/vim-table-mode/t/fixtures/tableize.txt
new file mode 100644
index 0000000..ee1cc7a
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/fixtures/tableize.txt
@@ -0,0 +1,4 @@
+
+asd,asd;asd,asd
+asd,asd;asd,asd
+
diff --git a/vim/bundle/vim-table-mode/t/formula.vim b/vim/bundle/vim-table-mode/t/formula.vim
new file mode 100644
index 0000000..a052392
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/formula.vim
@@ -0,0 +1,39 @@
+" vim: fdm=indent
+source t/config/options.vim
+
+describe 'Formulas'
+ describe 'Add Formula'
+ before
+ new
+ read t/fixtures/formula/sample.txt
+ end
+
+ it 'should add a formula successfully'
+ call cursor(6, 15)
+ call tablemode#spreadsheet#formula#Add("Sum(1:3)")
+ Expect tablemode#spreadsheet#cell#GetCell() == '125.0'
+ call cursor(8, 15)
+ Expect getline('.') == '/* tmf: $4,2=Sum(1:3) */'
+
+ call cursor(7, 15)
+ call tablemode#spreadsheet#formula#Add("Sum(1:-1)")
+ Expect tablemode#spreadsheet#cell#GetCell() == '250.0'
+ call cursor(8, 15)
+ Expect getline('.') == '/* tmf: $4,2=Sum(1:3); $5,2=Sum(1:-1) */'
+ end
+ end
+
+ describe 'Evaluate Formula'
+ before
+ new
+ read t/fixtures/formula/formula.txt
+ end
+
+ it 'should evaluate the formula successfull'
+ call cursor(6, 15)
+ call tablemode#spreadsheet#formula#EvaluateFormulaLine()
+ Expect &modified == 1
+ Expect tablemode#spreadsheet#cell#GetCell() == '125.0'
+ end
+ end
+end
diff --git a/vim/bundle/vim-table-mode/t/spreadsheet.vim b/vim/bundle/vim-table-mode/t/spreadsheet.vim
new file mode 100644
index 0000000..093475c
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/spreadsheet.vim
@@ -0,0 +1,105 @@
+" vim: fdm=indent
+source t/config/options.vim
+
+describe 'spreadsheet'
+ describe 'API'
+ before
+ new
+ read t/fixtures/sample.txt
+ end
+
+ it 'should return the row count'
+ Expect tablemode#spreadsheet#RowCount(2) == 2
+ Expect tablemode#spreadsheet#RowCount(3) == 2
+ end
+
+ it 'should return the row number'
+ Expect tablemode#spreadsheet#RowNr(2) == 1
+ Expect tablemode#spreadsheet#RowNr(3) == 2
+ end
+
+ it 'should return the column count'
+ Expect tablemode#spreadsheet#ColumnCount(2) == 2
+ Expect tablemode#spreadsheet#ColumnCount(3) == 2
+ end
+
+ it 'should return the column number'
+ call cursor(2,3)
+ Expect tablemode#spreadsheet#ColumnNr('.') == 1
+ call cursor(2,12)
+ Expect tablemode#spreadsheet#ColumnNr('.') == 2
+ end
+
+ it 'should return true when in the first cell'
+ call cursor(2,3)
+ Expect tablemode#spreadsheet#IsFirstCell() to_be_true
+ call cursor(2,12)
+ Expect tablemode#spreadsheet#IsFirstCell() to_be_false
+ end
+
+ it 'should return true when in the last cell'
+ call cursor(2,3)
+ Expect tablemode#spreadsheet#IsLastCell() to_be_false
+ call cursor(2,12)
+ Expect tablemode#spreadsheet#IsLastCell() to_be_true
+ end
+
+ it 'should return the line number of the first row'
+ Expect tablemode#spreadsheet#GetFirstRow(2) == 2
+ Expect tablemode#spreadsheet#GetFirstRow(3) == 2
+ end
+
+ it 'should return the line nuber of the last row'
+ Expect tablemode#spreadsheet#GetLastRow(2) == 3
+ Expect tablemode#spreadsheet#GetLastRow(3) == 3
+ end
+
+ describe 'Math'
+ before
+ new
+ read t/fixtures/cell/sample.txt
+ end
+
+ it 'should return the sum of cell range'
+ call cursor(1,3)
+ Expect tablemode#spreadsheet#Sum('1:2') == 4.0
+ Expect tablemode#spreadsheet#Sum('1,1:1,2') == 3.0
+ Expect tablemode#spreadsheet#Sum('1,1:2,2') == 10.0
+ call cursor(2,7)
+ Expect tablemode#spreadsheet#Sum('1:2') == 6.0
+ Expect tablemode#spreadsheet#Sum('2,1:2,2') == 7.0
+ end
+
+ it 'should return the average of cell range'
+ call cursor(1,3)
+ Expect tablemode#spreadsheet#Average('1:2') == 2.0
+ Expect tablemode#spreadsheet#Average('1,1:1,2') == 1.5
+ Expect tablemode#spreadsheet#Average('1,1:2,2') == 5.0
+ call cursor(2,7)
+ Expect tablemode#spreadsheet#Average('1:2') == 3.0
+ Expect tablemode#spreadsheet#Average('2,1:2,2') == 3.5
+ end
+ end
+ end
+
+ describe 'Manipulations'
+ before
+ new
+ normal! ggdG
+ read t/fixtures/sample.txt
+ call cursor(2, 3)
+ end
+
+ it 'should delete a row successfully'
+ Expect tablemode#spreadsheet#RowCount('.') == 2
+ call tablemode#spreadsheet#DeleteRow()
+ Expect tablemode#spreadsheet#RowCount('.') == 1
+ end
+
+ it 'should successfully delete column'
+ Expect tablemode#spreadsheet#ColumnCount('.') == 2
+ call tablemode#spreadsheet#DeleteColumn()
+ Expect tablemode#spreadsheet#ColumnCount('.') == 1
+ end
+ end
+end
diff --git a/vim/bundle/vim-table-mode/t/table.vim b/vim/bundle/vim-table-mode/t/table.vim
new file mode 100644
index 0000000..516467c
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/table.vim
@@ -0,0 +1,184 @@
+" vim: fdm=indent
+source t/config/options.vim
+
+describe 'table'
+ describe 'IsRow'
+ before
+ new
+ normal! ggdG
+ read t/fixtures/table/sample.txt
+ end
+
+ it 'should be true when on a table row'
+ Expect tablemode#table#IsRow(2) to_be_true
+ Expect tablemode#table#IsRow(3) to_be_true
+ end
+
+ it 'should be false when not on a table row'
+ Expect tablemode#table#IsRow(1) to_be_false
+ Expect tablemode#table#IsRow(4) to_be_false
+ end
+ end
+
+ describe 'IsBorder'
+ before
+ new
+ normal! ggdG
+ read t/fixtures/table/sample_with_header.txt
+ end
+
+ it 'should be true on a table border'
+ Expect tablemode#table#IsBorder(1) to_be_true
+ Expect tablemode#table#IsBorder(3) to_be_true
+ Expect tablemode#table#IsBorder(6) to_be_true
+ end
+
+ it 'should be false when not on a table border'
+ Expect tablemode#table#IsBorder(2) to_be_false
+ Expect tablemode#table#IsBorder(4) to_be_false
+ Expect tablemode#table#IsBorder(5) to_be_false
+ end
+ end
+
+ describe 'IsTable'
+ before
+ new normal! ggdG
+ read t/fixtures/table/sample_with_header.txt
+ end
+
+ it 'should be true on a table row'
+ Expect tablemode#table#IsTable(2) to_be_true
+ Expect tablemode#table#IsTable(4) to_be_true
+ Expect tablemode#table#IsTable(5) to_be_true
+ end
+
+ it 'should be true when on a table border'
+ Expect tablemode#table#IsTable(1) to_be_true
+ Expect tablemode#table#IsTable(3) to_be_true
+ Expect tablemode#table#IsTable(6) to_be_true
+ end
+
+ it 'should not be true when not on a table'
+ Expect tablemode#table#IsTable(7) to_be_false
+ end
+ end
+
+ describe 'IsHeader'
+ before
+ new
+ normal! ggdG
+ read t/fixtures/table/sample_with_header.txt
+ end
+
+ it 'should be true on the table header'
+ Expect tablemode#table#IsHeader(2) to_be_true
+ end
+
+ it 'should be false anywhere else'
+ Expect tablemode#table#IsHeader(1) to_be_false
+ Expect tablemode#table#IsHeader(4) to_be_false
+ Expect tablemode#table#IsHeader(5) to_be_false
+ Expect tablemode#table#IsHeader(6) to_be_false
+ Expect tablemode#table#IsHeader(7) to_be_false
+ end
+ end
+
+ describe 'AddBorder'
+ before
+ new
+ normal! ggdG
+ read t/fixtures/table/sample_for_header.txt
+ end
+
+ it 'should add border to line'
+ call tablemode#table#AddBorder(2)
+ Expect tablemode#table#IsHeader(1) to_be_true
+ Expect tablemode#table#IsBorder(2) to_be_true
+ end
+
+ describe 'for unicode'
+ before
+ new
+ normal! ggdG
+ read t/fixtures/table/sample_for_header_unicode.txt
+ end
+
+ it 'should add border to line'
+ call tablemode#table#AddBorder(1)
+ call tablemode#table#AddBorder(3)
+ call tablemode#table#AddBorder(5)
+ call tablemode#table#AddBorder(7)
+ call tablemode#table#AddBorder(9)
+
+ Expect tablemode#table#IsBorder(1) to_be_true
+ Expect tablemode#utils#StrDisplayWidth(getline(1)) == tablemode#utils#StrDisplayWidth(getline(2))
+ Expect tablemode#table#IsBorder(3) to_be_true
+ Expect tablemode#utils#StrDisplayWidth(getline(3)) == tablemode#utils#StrDisplayWidth(getline(4))
+ Expect tablemode#table#IsBorder(5) to_be_true
+ Expect tablemode#utils#StrDisplayWidth(getline(5)) == tablemode#utils#StrDisplayWidth(getline(6))
+ Expect tablemode#table#IsBorder(7) to_be_true
+ Expect tablemode#utils#StrDisplayWidth(getline(7)) == tablemode#utils#StrDisplayWidth(getline(8))
+ Expect tablemode#table#IsBorder(9) to_be_true
+ Expect tablemode#utils#StrDisplayWidth(getline(9)) == tablemode#utils#StrDisplayWidth(getline(8))
+ end
+ end
+ end
+
+ describe 'Realign'
+ describe 'without header alignments'
+ describe 'for simple'
+ before
+ new
+ normal! ggdG
+ read t/fixtures/table/sample_realign_before.txt
+ end
+
+ it 'should be aligned properly'
+ call tablemode#table#Realign(1)
+ Expect getline(1,'$') == readfile('t/fixtures/table/sample_realign_after.txt')
+ end
+ end
+
+ describe 'for unicode'
+ before
+ new
+ normal! ggdG
+ read t/fixtures/table/sample_realign_unicode_before.txt
+ end
+
+ it 'should be aligned properly'
+ call tablemode#table#Realign(1)
+ Expect getline(1,'$') == readfile('t/fixtures/table/sample_realign_unicode_after.txt')
+ end
+ end
+ end
+
+ describe 'with header alignments'
+ describe 'for simple'
+ before
+ new
+ normal! ggdG
+ read t/fixtures/table/sample_header_realign_before.txt
+ end
+
+ it 'should be aligned properly'
+ call tablemode#table#Realign(1)
+ Expect getline(1,'$') == readfile('t/fixtures/table/sample_header_realign_after.txt')
+ end
+ end
+
+ describe 'for unicode'
+ before
+ new
+ normal! ggdG
+ read t/fixtures/table/sample_header_realign_unicode_before.txt
+ end
+
+ it 'should be aligned properly'
+ call tablemode#table#Realign(1)
+ Expect getline(1,'$') == readfile('t/fixtures/table/sample_header_realign_unicode_after.txt')
+ end
+ end
+ end
+ end
+end
diff --git a/vim/bundle/vim-table-mode/t/tablemode.vim b/vim/bundle/vim-table-mode/t/tablemode.vim
new file mode 100644
index 0000000..132c4bb
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/tablemode.vim
@@ -0,0 +1,56 @@
+" vim: fdm=indent
+source t/config/options.vim
+
+describe 'tablemode'
+ describe 'Activation'
+ describe 'tablemode#Enable()'
+ before
+ call tablemode#Enable()
+ end
+
+ it 'should enable table mode'
+ Expect b:table_mode_active to_be_true
+ end
+ end
+
+ describe 'tablemode#Disable()'
+ before
+ call tablemode#Disable()
+ end
+
+ it 'should disable table mode'
+ Expect b:table_mode_active to_be_false
+ end
+ end
+
+ describe 'tablemode#Toggle()'
+ it 'should toggle table mode'
+ call tablemode#Toggle()
+ Expect b:table_mode_active to_be_true
+ call tablemode#Toggle()
+ Expect b:table_mode_active to_be_false
+ end
+ end
+ end
+
+ describe 'Tableize'
+ before
+ new
+ read t/fixtures/tableize.txt
+ end
+
+ it 'should tableize with default delimiter'
+ :2,3call tablemode#TableizeRange('')
+ Expect tablemode#table#IsRow(2) to_be_true
+ Expect tablemode#spreadsheet#RowCount(2) == 2
+ Expect tablemode#spreadsheet#ColumnCount(2) == 3
+ end
+
+ it 'should tableize with given delimiter'
+ :2,3call tablemode#TableizeRange('/;')
+ Expect tablemode#table#IsRow(2) to_be_true
+ Expect tablemode#spreadsheet#RowCount(2) == 2
+ Expect tablemode#spreadsheet#ColumnCount(2) == 2
+ end
+ end
+end
diff --git a/vim/bundle/vim-table-mode/t/utils.vim b/vim/bundle/vim-table-mode/t/utils.vim
new file mode 100644
index 0000000..3bfff19
--- /dev/null
+++ b/vim/bundle/vim-table-mode/t/utils.vim
@@ -0,0 +1,45 @@
+" vim: fdm=indent
+source t/config/options.vim
+
+describe 'utils'
+ describe 'line'
+ it 'should return the current line number'
+ Expect tablemode#utils#line('.') == line('.')
+ end
+
+ it 'should return the line number itself if it is a number'
+ Expect tablemode#utils#line(1) == 1
+ end
+ end
+
+ describe 'strip'
+ it 'should strip all initial or trailing whitespace from a string'
+ let string = ' This is awesome '
+ Expect tablemode#utils#strip(string) == 'This is awesome'
+ end
+ end
+
+ describe 'strlen'
+ it 'should return the length of a string correctly'
+ let string = 'this is a test'
+ Expect tablemode#utils#strlen(string) == 14
+ end
+
+ it 'should return the length of a unicode string correctly'
+ let string = '測試 is good.'
+ Expect tablemode#utils#strlen(string) == 11
+ end
+ end
+
+ describe 'strdisplaywidth'
+ it 'should return the display width of a string correctly'
+ let string = 'this is a test'
+ Expect tablemode#utils#StrDisplayWidth(string) == 14
+ end
+
+ it 'should return the display width of a unicode string correctly'
+ let string = '測試 is good.'
+ Expect tablemode#utils#StrDisplayWidth(string) == 13
+ end
+ end
+end
diff --git a/vim/bundle/vim-table-mode/youtube.png b/vim/bundle/vim-table-mode/youtube.png
new file mode 100644
index 0000000..6654fd9
--- /dev/null
+++ b/vim/bundle/vim-table-mode/youtube.png
Binary files differ
diff --git a/vim/ftdetect/c-co.vim b/vim/ftdetect/c-co.vim
new file mode 100644
index 0000000..b96a197
--- /dev/null
+++ b/vim/ftdetect/c-co.vim
@@ -0,0 +1 @@
+au BufRead,BufNewFile *.c.co set filetype=c-co
diff --git a/vim/ftdetect/conffile.vim b/vim/ftdetect/conffile.vim
new file mode 100644
index 0000000..00feb56
--- /dev/null
+++ b/vim/ftdetect/conffile.vim
@@ -0,0 +1 @@
+au BufRead,BufNewFile *[cC]onffile,*.cf set filetype=conffile
diff --git a/vim/ftdetect/make-co.vim b/vim/ftdetect/make-co.vim
new file mode 100644
index 0000000..dbaf43d
--- /dev/null
+++ b/vim/ftdetect/make-co.vim
@@ -0,0 +1 @@
+au BufRead,BufNewFile *[mM]akefile.co,*.mk.co,*.mak.co,*.dsp.co set filetype=make-co
diff --git a/vim/syntax/c-co.vim b/vim/syntax/c-co.vim
new file mode 100644
index 0000000..0be5aa1
--- /dev/null
+++ b/vim/syntax/c-co.vim
@@ -0,0 +1,475 @@
+" Vim syntax file
+" Language: C
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2013 Jul 05
+
+" Quit when a (custom) syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+let s:ft = matchstr(&ft, '^\([^.]\)\+')
+
+" A bunch of useful C keywords
+syn keyword cStatement goto break return continue asm
+syn keyword cLabel case default
+syn keyword cConditional if else switch
+syn keyword cRepeat while for do
+
+syn keyword cTodo contained TODO FIXME XXX
+
+" It's easy to accidentally add a space after a backslash that was intended
+" for line continuation. Some compilers allow it, which makes it
+" unpredictable and should be avoided.
+syn match cBadContinuation contained "\\\s\+$"
+
+" cCommentGroup allows adding matches for special things in comments
+syn cluster cCommentGroup contains=cTodo,cBadContinuation
+
+" String and Character constants
+" Highlight special characters (those which have a backslash) differently
+syn match cSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
+if !exists("c_no_utf")
+ syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
+endif
+if exists("c_no_cformat")
+ syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
+ " cCppString: same as cString, but ends at end of line
+ if !exists("cpp_no_cpp11") " ISO C++11
+ syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
+ else
+ syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
+ endif
+ syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
+ syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
+else
+ if !exists("c_no_c99") " ISO C99
+ syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
+ else
+ syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
+ endif
+ syn match cFormat display "%%" contained
+ syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
+ " cCppString: same as cString, but ends at end of line
+ syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
+endif
+
+syn match cCharacter "L\='[^\\]'"
+syn match cCharacter "L'[^']*'" contains=cSpecial
+if exists("c_gnu")
+ syn match cSpecialError "L\='\\[^'\"?\\abefnrtv]'"
+ syn match cSpecialCharacter "L\='\\['\"?\\abefnrtv]'"
+else
+ syn match cSpecialError "L\='\\[^'\"?\\abfnrtv]'"
+ syn match cSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
+endif
+syn match cSpecialCharacter display "L\='\\\o\{1,3}'"
+syn match cSpecialCharacter display "'\\x\x\{1,2}'"
+syn match cSpecialCharacter display "L'\\x\x\+'"
+
+if !exists("c_no_c11") " ISO C11
+ if exists("c_no_cformat")
+ syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
+ else
+ syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
+ endif
+ syn match cCharacter "[Uu]'[^\\]'"
+ syn match cCharacter "[Uu]'[^']*'" contains=cSpecial
+ if exists("c_gnu")
+ syn match cSpecialError "[Uu]'\\[^'\"?\\abefnrtv]'"
+ syn match cSpecialCharacter "[Uu]'\\['\"?\\abefnrtv]'"
+ else
+ syn match cSpecialError "[Uu]'\\[^'\"?\\abfnrtv]'"
+ syn match cSpecialCharacter "[Uu]'\\['\"?\\abfnrtv]'"
+ endif
+ syn match cSpecialCharacter display "[Uu]'\\\o\{1,3}'"
+ syn match cSpecialCharacter display "[Uu]'\\x\x\+'"
+endif
+
+"when wanted, highlight trailing white space
+if exists("c_space_errors")
+ if !exists("c_no_trail_space_error")
+ syn match cSpaceError display excludenl "\s\+$"
+ endif
+ if !exists("c_no_tab_space_error")
+ syn match cSpaceError display " \+\t"me=e-1
+ endif
+endif
+
+" This should be before cErrInParen to avoid problems with #define ({ xxx })
+if exists("c_curly_error")
+ syn match cCurlyError "}"
+ syn region cBlock start="{" end="}" contains=ALLBUT,cBadBlock,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell fold
+else
+ syn region cBlock start="{" end="}" transparent fold
+endif
+
+"catch errors caused by wrong parenthesis and brackets
+" also accept <% for {, %> for }, <: for [ and :> for ] (C99)
+" But avoid matching <::.
+syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
+if exists("c_no_curly_error")
+ if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
+ syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
+ " cCppParen: same as cParen but ends at end-of-line; used in cDefine
+ syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
+ syn match cParenError display ")"
+ syn match cErrInParen display contained "^^<%\|^%>"
+ else
+ syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cCppString,@Spell
+ " cCppParen: same as cParen but ends at end-of-line; used in cDefine
+ syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
+ syn match cParenError display ")"
+ syn match cErrInParen display contained "^[{}]\|^<%\|^%>"
+ endif
+elseif exists("c_no_bracket_error")
+ if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
+ syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
+ " cCppParen: same as cParen but ends at end-of-line; used in cDefine
+ syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
+ syn match cParenError display ")"
+ syn match cErrInParen display contained "<%\|%>"
+ else
+ syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cCppString,@Spell
+ " cCppParen: same as cParen but ends at end-of-line; used in cDefine
+ syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
+ syn match cParenError display ")"
+ syn match cErrInParen display contained "[{}]\|<%\|%>"
+ endif
+else
+ if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
+ syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
+ " cCppParen: same as cParen but ends at end-of-line; used in cDefine
+ syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
+ syn match cParenError display "[\])]"
+ syn match cErrInParen display contained "<%\|%>"
+ syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
+ else
+ syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
+ " cCppParen: same as cParen but ends at end-of-line; used in cDefine
+ syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
+ syn match cParenError display "[\])]"
+ syn match cErrInParen display contained "[\]{}]\|<%\|%>"
+ syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
+ endif
+ " cCppBracket: same as cParen but ends at end-of-line; used in cDefine
+ syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
+ syn match cErrInBracket display contained "[);{}]\|<%\|%>"
+endif
+
+if s:ft ==# 'c' || exists("cpp_no_cpp11")
+ syn region cBadBlock keepend start="{" end="}" contained containedin=cParen,cBracket,cBadBlock transparent fold
+endif
+
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal
+" Same, but without octal error (for comments)
+syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctal
+syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
+"hex number
+syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
+" Flag the first zero of an octal number as something special
+syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
+syn match cOctalZero display contained "\<0"
+syn match cFloat display contained "\d\+f"
+"floating point number, with dot, optional exponent
+syn match cFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
+"floating point number, starting with a dot, optional exponent
+syn match cFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match cFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
+if !exists("c_no_c99")
+ "hexadecimal floating point number, optional leading digits, with dot, with exponent
+ syn match cFloat display contained "0x\x*\.\x\+p[-+]\=\d\+[fl]\=\>"
+ "hexadecimal floating point number, with leading digits, optional dot, with exponent
+ syn match cFloat display contained "0x\x\+\.\=p[-+]\=\d\+[fl]\=\>"
+endif
+
+" flag an octal number with wrong digits
+syn match cOctalError display contained "0\o*[89]\d*"
+syn case match
+
+if exists("c_comment_strings")
+ " A comment can contain cString, cCharacter and cNumber.
+ " But a "*/" inside a cString in a cComment DOES end the comment! So we
+ " need to use a special type of cString: cCommentString, which also ends on
+ " "*/", and sees a "*" at the start of the line as comment again.
+ " Unfortunately this doesn't very well work for // type of comments :-(
+ syn match cCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syn region cCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=cSpecial,cCommentSkip
+ syn region cComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=cSpecial
+ syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cComment2String,cCharacter,cNumbersCom,cSpaceError,@Spell
+ if exists("c_no_comment_fold")
+ " Use "extend" here to have preprocessor lines not terminate halfway a
+ " comment.
+ syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell extend
+ else
+ syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell fold extend
+ endif
+else
+ syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cSpaceError,@Spell
+ if exists("c_no_comment_fold")
+ syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell extend
+ else
+ syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell fold extend
+ endif
+endif
+" keep a // comment separately, it terminates a preproc. conditional
+syn match cCommentError display "\*/"
+syn match cCommentStartError display "/\*"me=e-1 contained
+
+syn keyword cOperator sizeof
+if exists("c_gnu")
+ syn keyword cStatement __asm__
+ syn keyword cOperator typeof __real__ __imag__
+endif
+syn keyword cType int long short char void
+syn keyword cType signed unsigned float double
+if !exists("c_no_ansi") || exists("c_ansi_typedefs")
+ syn keyword cType size_t ssize_t off_t wchar_t ptrdiff_t sig_atomic_t fpos_t
+ syn keyword cType clock_t time_t va_list jmp_buf FILE DIR div_t ldiv_t
+ syn keyword cType mbstate_t wctrans_t wint_t wctype_t
+endif
+if !exists("c_no_c99") " ISO C99
+ syn keyword cType _Bool bool _Complex complex _Imaginary imaginary
+ syn keyword cType int8_t int16_t int32_t int64_t
+ syn keyword cType uint8_t uint16_t uint32_t uint64_t
+ syn keyword cType int_least8_t int_least16_t int_least32_t int_least64_t
+ syn keyword cType uint_least8_t uint_least16_t uint_least32_t uint_least64_t
+ syn keyword cType int_fast8_t int_fast16_t int_fast32_t int_fast64_t
+ syn keyword cType uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t
+ syn keyword cType intptr_t uintptr_t
+ syn keyword cType intmax_t uintmax_t
+endif
+if exists("c_gnu")
+ syn keyword cType __label__ __complex__ __volatile__
+endif
+
+syn keyword cStructure struct union enum typedef
+syn keyword cStorageClass static register auto volatile extern const
+if exists("c_gnu")
+ syn keyword cStorageClass inline __attribute__
+endif
+if !exists("c_no_c99")
+ syn keyword cStorageClass inline restrict
+endif
+if !exists("c_no_c11")
+ syn keyword cStorageClass _Alignas alignas
+ syn keyword cOperator _Alignof alignof
+ syn keyword cStorageClass _Atomic
+ syn keyword cOperator _Generic
+ syn keyword cStorageClass _Noreturn noreturn
+ syn keyword cOperator _Static_assert static_assert
+ syn keyword cStorageClass _Thread_local thread_local
+ syn keyword cType char16_t char32_t
+endif
+
+if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
+ if exists("c_gnu")
+ syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__ __func__
+ endif
+ syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__
+ syn keyword cConstant __STDC_VERSION__
+ syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX
+ syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX
+ syn keyword cConstant CHAR_MIN INT_MIN LONG_MIN SHRT_MIN
+ syn keyword cConstant CHAR_MAX INT_MAX LONG_MAX SHRT_MAX
+ syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN
+ syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX
+ if !exists("c_no_c99")
+ syn keyword cConstant __func__
+ syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX
+ syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN
+ syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX
+ syn keyword cConstant UINT8_MAX UINT16_MAX UINT32_MAX UINT64_MAX
+ syn keyword cConstant INT_LEAST8_MIN INT_LEAST16_MIN INT_LEAST32_MIN INT_LEAST64_MIN
+ syn keyword cConstant INT_LEAST8_MAX INT_LEAST16_MAX INT_LEAST32_MAX INT_LEAST64_MAX
+ syn keyword cConstant UINT_LEAST8_MAX UINT_LEAST16_MAX UINT_LEAST32_MAX UINT_LEAST64_MAX
+ syn keyword cConstant INT_FAST8_MIN INT_FAST16_MIN INT_FAST32_MIN INT_FAST64_MIN
+ syn keyword cConstant INT_FAST8_MAX INT_FAST16_MAX INT_FAST32_MAX INT_FAST64_MAX
+ syn keyword cConstant UINT_FAST8_MAX UINT_FAST16_MAX UINT_FAST32_MAX UINT_FAST64_MAX
+ syn keyword cConstant INTPTR_MIN INTPTR_MAX UINTPTR_MAX
+ syn keyword cConstant INTMAX_MIN INTMAX_MAX UINTMAX_MAX
+ syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX
+ syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX
+ endif
+ syn keyword cConstant FLT_RADIX FLT_ROUNDS
+ syn keyword cConstant FLT_DIG FLT_MANT_DIG FLT_EPSILON
+ syn keyword cConstant DBL_DIG DBL_MANT_DIG DBL_EPSILON
+ syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON
+ syn keyword cConstant FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP
+ syn keyword cConstant FLT_MIN_10_EXP FLT_MAX_10_EXP
+ syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP
+ syn keyword cConstant DBL_MIN_10_EXP DBL_MAX_10_EXP
+ syn keyword cConstant LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
+ syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP
+ syn keyword cConstant HUGE_VAL CLOCKS_PER_SEC NULL
+ syn keyword cConstant LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
+ syn keyword cConstant LC_NUMERIC LC_TIME
+ syn keyword cConstant SIG_DFL SIG_ERR SIG_IGN
+ syn keyword cConstant SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
+ " Add POSIX signals as well...
+ syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP
+ syn keyword cConstant SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV
+ syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU
+ syn keyword cConstant SIGUSR1 SIGUSR2
+ syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF
+ syn keyword cConstant FOPEN_MAX FILENAME_MAX L_tmpnam
+ syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
+ syn keyword cConstant TMP_MAX stderr stdin stdout
+ syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
+ " Add POSIX errors as well
+ syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
+ syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
+ syn keyword cConstant EFBIG EILSEQ EINPROGRESS EINTR EINVAL EIO EISDIR
+ syn keyword cConstant EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENFILE ENODEV
+ syn keyword cConstant ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS
+ syn keyword cConstant ENOTDIR ENOTEMPTY ENOTSUP ENOTTY ENXIO EPERM
+ syn keyword cConstant EPIPE ERANGE EROFS ESPIPE ESRCH ETIMEDOUT EXDEV
+ " math.h
+ syn keyword cConstant M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI M_PI_2 M_PI_4
+ syn keyword cConstant M_1_PI M_2_PI M_2_SQRTPI M_SQRT2 M_SQRT1_2
+endif
+if !exists("c_no_c99") " ISO C99
+ syn keyword cConstant true false
+endif
+
+" Accept %: for # (C99)
+syn region cPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
+syn match cPreConditMatch display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
+if !exists("c_no_if0")
+ syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip
+ syn region cCppOutWrapper start="^\s*\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold
+ syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
+ if !exists("c_no_if0_fold")
+ syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold
+ else
+ syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
+ endif
+ syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
+ syn region cCppInWrapper start="^\s*\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold
+ syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
+ if !exists("c_no_if0_fold")
+ syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
+ else
+ syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
+ endif
+ syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
+ syn region cCppOutSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
+ syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc
+endif
+syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+syn match cIncluded display contained "<[^>]*>"
+syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
+"syn match cLineSkip "\\$"
+syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock
+syn region cDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
+syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
+
+" Highlight User Labels
+syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
+if s:ft ==# 'c' || exists("cpp_no_cpp11")
+ syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell
+endif
+" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
+syn cluster cLabelGroup contains=cUserLabel
+syn match cUserCont display "^\s*\I\i*\s*:$" contains=@cLabelGroup
+syn match cUserCont display ";\s*\I\i*\s*:$" contains=@cLabelGroup
+syn match cUserCont display "^\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
+syn match cUserCont display ";\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
+
+syn match cUserLabel display "\I\i*" contained
+
+" Avoid recognizing most bitfields as labels
+syn match cBitField display "^\s*\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
+syn match cBitField display ";\s*\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
+
+if exists("c_minlines")
+ let b:c_minlines = c_minlines
+else
+ if !exists("c_no_if0")
+ let b:c_minlines = 50 " #if 0 constructs can be long
+ else
+ let b:c_minlines = 15 " mostly for () constructs
+ endif
+endif
+if exists("c_curly_error")
+ syn sync fromstart
+else
+ exec "syn sync ccomment cComment minlines=" . b:c_minlines
+endif
+
+" config output file
+syn match covariable "\$\w\+"
+syn match cocommand "\$\(endif\|else\)"
+syn region None matchgroup=coifcommand start=+\$if(+ end=+)+ contains=covariable
+
+" Define the default highlighting.
+" Only used when an item doesn't have highlighting yet
+hi def link cFormat cSpecial
+hi def link cCppString cString
+hi def link cCommentL cComment
+hi def link cCommentStart cComment
+hi def link cLabel Label
+hi def link cUserLabel Label
+hi def link cConditional Conditional
+hi def link cRepeat Repeat
+hi def link cCharacter Character
+hi def link cSpecialCharacter cSpecial
+hi def link cNumber Number
+hi def link cOctal Number
+hi def link cOctalZero PreProc " link this to Error if you want
+hi def link cFloat Float
+hi def link cOctalError cError
+hi def link cParenError cError
+hi def link cErrInParen cError
+hi def link cErrInBracket cError
+hi def link cCommentError cError
+hi def link cCommentStartError cError
+hi def link cSpaceError cError
+hi def link cSpecialError cError
+hi def link cCurlyError cError
+hi def link cOperator Operator
+hi def link cStructure Structure
+hi def link cStorageClass StorageClass
+hi def link cInclude Include
+hi def link cPreProc PreProc
+hi def link cDefine Macro
+hi def link cIncluded cString
+hi def link cError Error
+hi def link cStatement Statement
+hi def link cCppInWrapper cCppOutWrapper
+hi def link cCppOutWrapper cPreCondit
+hi def link cPreConditMatch cPreCondit
+hi def link cPreCondit PreCondit
+hi def link cType Type
+hi def link cConstant Constant
+hi def link cCommentString cString
+hi def link cComment2String cString
+hi def link cCommentSkip cComment
+hi def link cString String
+hi def link cComment Comment
+hi def link cSpecial SpecialChar
+hi def link cTodo Todo
+hi def link cBadContinuation Error
+hi def link cCppOutSkip cCppOutIf2
+hi def link cCppInElse2 cCppOutIf2
+hi def link cCppOutIf2 cCppOut2 " Old syntax group for #if 0 body
+hi def link cCppOut2 cCppOut " Old syntax group for #if of #if 0
+hi def link cCppOut Comment
+
+hi def link cocommand Macro
+hi def link coifcommand Macro
+hi def link covariable Identifier
+
+let b:current_syntax = "c-co"
+
+unlet s:ft
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+" vim: ts=8
diff --git a/vim/syntax/conffile.vim b/vim/syntax/conffile.vim
new file mode 100644
index 0000000..342d8b4
--- /dev/null
+++ b/vim/syntax/conffile.vim
@@ -0,0 +1,37 @@
+" Vim syntax file
+" Language: C
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2013 Jul 05
+
+" Quit when a (custom) syntax file was already loaded
+if exists("b:current_syntax")
+ finish
+endif
+
+left s:ft = matchstr(&ft, '^\([^.]\)\+')
+
+syn match sComment "#.*$"
+syn keyword sKeywords typedef menu group endmenu endgroup type menu default menu visible nodefault
+syn keyword sKWCondition dependency default
+syn keyword sTypes int bool string hex float
+syn region sString start=+\"+ skip=+\\.+ end=+\"+
+
+syn keyword sKeywords output nextgroup=sOutput
+syn region sOutput start="\w\+ \+{" end="}" contains=covariable,cocommand,coifcommand,CoNone
+syn match sOutput "\w\+ \+\w\+"
+syn match covariable "\$\w\+" contained
+syn match cocommand "\$\(endif\|else\)" contained
+syn region CoNone matchgroup=coifcommand start=+\$\(if\|elif\|ifdep\)(+ end=+)+ contains=covariable,sKWCondition contained
+
+
+hi def link sComment Comment
+hi def link sKeywords Precondit
+hi def link sKWCondition sKeywords
+hi def link sTypes Statement
+hi def link sString String
+
+hi def link cocommand Macro
+hi def link coifcommand Macro
+hi def link covariable Identifier
+
+let b:current_syntax = "conffile"
diff --git a/vim/syntax/make-co.vim b/vim/syntax/make-co.vim
new file mode 100644
index 0000000..371944b
--- /dev/null
+++ b/vim/syntax/make-co.vim
@@ -0,0 +1,153 @@
+" Vim syntax file
+" Language: Makefile
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/make.vim
+" Last Change: 2012 Oct 05
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+
+" some special characters
+syn match makeSpecial "^\s*[@+-]\+"
+syn match makeNextLine "\\\n\s*"
+
+" some directives
+syn match makePreCondit "^ *\(ifeq\>\|else\>\|endif\>\|ifneq\>\|ifdef\>\|ifndef\>\)"
+syn match makeInclude "^ *[-s]\=include"
+syn match makeStatement "^ *vpath"
+syn match makeExport "^ *\(export\|unexport\)\>"
+syn match makeOverride "^ *override"
+hi link makeOverride makeStatement
+hi link makeExport makeStatement
+
+" catch unmatched define/endef keywords. endef only matches it is by itself on a line, possibly followed by a commend
+syn region makeDefine start="^\s*define\s" end="^\s*endef\s*\(#.*\)\?$" contains=makeStatement,makeIdent,makePreCondit,makeDefine
+
+" Microsoft Makefile specials
+syn case ignore
+syn match makeInclude "^! *include"
+syn match makePreCondit "! *\(cmdswitches\|error\|message\|include\|if\|ifdef\|ifndef\|else\|elseif\|else if\|else\s*ifdef\|else\s*ifndef\|endif\|undef\)\>"
+syn case match
+
+" identifiers
+syn region makeIdent start="\\\$(" skip="\\)\|\\\\" end=")" contains=makeStatement,makeIdent,makeSString,makeDString
+syn region makeIdent start="\\\${" skip="\\}\|\\\\" end="}" contains=makeStatement,makeIdent,makeSString,makeDString
+syn match makeIdent "\$\$\w*"
+syn match makeIdent "\$[^({]"
+syn match makeIdent "^ *\a\w*\s*[:+?!*]="me=e-2
+syn match makeIdent "^ *\a\w*\s*="me=e-1
+syn match makeIdent "%"
+
+" Makefile.in variables
+syn match makeConfig "@[A-Za-z0-9_]\+@"
+
+" make targets
+" syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>"
+syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-1 nextgroup=makeSource
+syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2 nextgroup=makeSource
+
+syn region makeTarget transparent matchgroup=makeTarget start="^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"rs=e-1 end=";"re=e-1,me=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine skipnl nextGroup=makeCommands
+syn match makeTarget "^[A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$" contains=makeIdent,makeSpecTarget skipnl nextgroup=makeCommands,makeCommandError
+
+syn region makeSpecTarget transparent matchgroup=makeSpecTarget start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*:\{1,2}[^:=]"rs=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine skipnl nextGroup=makeCommands
+syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*::\=\s*$" contains=makeIdent skipnl nextgroup=makeCommands,makeCommandError
+
+syn match makeCommandError "^\s\+\S.*" contained
+syn region makeCommands start=";"hs=s+1 start="^\t" end="^[^\t#]"me=e-1,re=e-1 end="^$" contained contains=makeCmdNextLine,makeSpecial,makeComment,makeIdent,makePreCondit,makeDefine,makeDString,makeSString nextgroup=makeCommandError
+syn match makeCmdNextLine "\\\n."he=e-1 contained
+
+
+" Statements / Functions (GNU make)
+syn match makeStatement contained "(\(subst\|abspath\|addprefix\|addsuffix\|and\|basename\|call\|dir\|error\|eval\|filter-out\|filter\|findstring\|firstword\|flavor\|foreach\|if\|info\|join\|lastword\|notdir\|or\|origin\|patsubst\|realpath\|shell\|sort\|strip\|suffix\|value\|warning\|wildcard\|word\|wordlist\|words\)\>"ms=s+1
+
+" Comment
+if exists("make_microsoft")
+ syn match makeComment "#.*" contains=@Spell,makeTodo
+elseif !exists("make_no_comments")
+ syn region makeComment start="#" end="^$" end="[^\\]$" keepend contains=@Spell,makeTodo
+ syn match makeComment "#$" contains=@Spell
+endif
+syn keyword makeTodo TODO FIXME XXX contained
+
+" match escaped quotes and any other escaped character
+" except for $, as a backslash in front of a $ does
+" not make it a standard character, but instead it will
+" still act as the beginning of a variable
+" The escaped char is not highlightet currently
+syn match makeEscapedChar "\\[^$]"
+
+
+syn region makeDString start=+\(\\\)\@<!"+ skip=+\\.+ end=+"+ contains=makeIdent
+syn region makeSString start=+\(\\\)\@<!'+ skip=+\\.+ end=+'+ contains=makeIdent
+syn region makeBString start=+\(\\\)\@<!`+ skip=+\\.+ end=+`+ contains=makeIdent,makeSString,makeDString,makeNextLine
+
+" Syncing
+syn sync minlines=20 maxlines=200
+
+" Sync on Make command block region: When searching backwards hits a line that
+" can't be a command or a comment, use makeCommands if it looks like a target,
+" NONE otherwise.
+syn sync match makeCommandSync groupthere NONE "^[^\t#]"
+syn sync match makeCommandSync groupthere makeCommands "^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"
+syn sync match makeCommandSync groupthere makeCommands "^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}\s*$"
+
+" config output file
+syn match covariable "\$\w\+"
+syn match cocommand "\$\(endif\|else\)"
+syn region None matchgroup=coifcommand start=+\$if(+ end=+)+ contains=covariable
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_make_syn_inits")
+ if version < 508
+ let did_make_syn_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ HiLink makeNextLine makeSpecial
+ HiLink makeCmdNextLine makeSpecial
+ HiLink makeSpecTarget Statement
+ if !exists("make_no_commands")
+ HiLink makeCommands Number
+ endif
+ HiLink makeImplicit Function
+ HiLink makeTarget Function
+ HiLink makeInclude Include
+ HiLink makePreCondit PreCondit
+ HiLink makeStatement Statement
+ HiLink makeIdent Identifier
+ HiLink makeSpecial Special
+ HiLink makeComment Comment
+ HiLink makeDString String
+ HiLink makeSString String
+ HiLink makeBString Function
+ HiLink makeError Error
+ HiLink makeTodo Todo
+ HiLink makeDefine Define
+ HiLink makeCommandError Error
+ HiLink makeConfig PreCondit
+
+ HiLink cocommand Macro
+ HiLink coifcommand Macro
+ HiLink covariable Identifier
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "make-co"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+" vim: ts=8
diff --git a/vimrc b/vimrc
new file mode 100644
index 0000000..d78d153
--- /dev/null
+++ b/vimrc
@@ -0,0 +1,134 @@
+" For git mergetool
+" :diffg RE " get from REMOTE
+" :diffg BA " get from BASE
+" :diffg LO " get from LOCAL
+execute pathogen#infect()
+syntax on
+filetype plugin indent on
+
+set exrc
+set secure
+set title
+
+function InitBase()
+ set tabstop=4
+ set softtabstop=4
+ set shiftwidth=4
+ set noexpandtab
+ set number
+ set hidden
+ set undofile
+ set undodir=.vimundo
+ set colorcolumn=82
+ set textwidth=82
+ highlight ColorColumn ctermbg=darkgray
+ set hlsearch
+
+ set foldmethod=syntax
+
+ execute 'GitGutterEnable'
+endfunction
+
+" Write as root
+cmap w!! w !sudo tee >/dev/null %
+
+cabbrev E Explore
+nnoremap <C-C><CR> :Explore<CR>
+nnoremap <C-C>l :bnext<CR>
+nnoremap <C-C>h :bprev<CR>
+nnoremap <C-C><C-C> :buffers<CR>:buffer<Space>
+let g:netrw_banner=0
+let g:netrw_liststyle=1
+let g:netrw_list_hide='\(^\|\s\s\)\zs\.\S\+'
+
+"let g:NERDTreeWinPos = "right"
+"let g:NERDTreeWinSize = 30
+
+let g:table_mode_corner="|"
+
+colorscheme elflord
+
+" Gitgutter colors change for dark theme match
+" autocmd VimEnter * hi clear SignColumn
+" autocmd VimEnter * hi GitGutterChangeDefault ctermfg=3 ctermbg=16 guifg=#bbbb00 guibg=Grey
+" autocmd VimEnter * hi GitGutterChangeDefault ctermfg=3 ctermbg=16 guifg=#bbbb00 guibg=Grey
+" autocmd VimEnter * hi GitGutterDeleteDefault ctermfg=1 ctermbg=16 guifg=#ff2222 guibg=Grey
+" autocmd VimEnter * hi GitGutterAddDefault ctermfg=2 ctermbg=16 guifg=#009900 guibg=Grey
+
+map <F2> :call InitBase()<cr>
+map <F10> :setlocal spell! spelllang=en_us<cr>
+
+function InitBash()
+ call InitBase()
+
+ " Format current file with indent
+ map <F2> gg=G2<c-o>
+
+ map <F3> :w<cr>
+ map <F4> :wa<cr>
+endfunction
+
+function InitPython()
+ call InitBase()
+ set colorcolumn=79
+ set textwidth=79
+
+ unmap <F2>
+ map <F3> :w<cr>
+ map <F4> :wa<cr>
+ nmap <F9> :TagbarOpen fc<cr>
+
+ "execute 'NERDTree'
+endfunction
+
+function InitC()
+ call InitBase()
+ set expandtab
+
+ "execute 'NERDTree'
+
+ map <F2> gggqG2<c-o>
+ map <F3> :w<cr>
+ map <F4> :wa<cr>
+ map <F5> :w<cr>:make<cr>
+ map <F6> :cp<cr>
+ map <F7> :cn<cr>
+ map <F8> :cl<cr>
+ nmap <F9> :TagbarOpen fc<cr>
+
+ autocmd BufNewFile,BufRead *.c set formatprg=indent\ -kr\ -cp1\ -cd1\ -ts4\ -nut\ -brf
+ autocmd BufNewFile,BufRead *.cpp set formatprg=indent\ -kr\ -cp1\ -cd1\ -ts4\ -nut\ -brf
+ autocmd BufNewFile,BufRead *.h set formatprg=indent\ -kr\ -cp0\ -cd1\ -ts4\ -nut\ -brf
+ autocmd BufNewFile,BufRead *.hpp set formatprg=indent\ -kr\ -cp1\ -cd1\ -ts4\ -nut\ -brf
+
+ execute ':silent !ctags -R -f .tags'
+ autocmd VimLeave * !rm .tags
+
+ execute ':silent !cscope -Rbq -f .cscope.out'
+ execute 'cscope add .cscope.out'
+ autocmd VimLeave * !rm .cscope*
+
+ " cscope maping
+ nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
+ nmap <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
+ nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@>s :vert scs find s <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@>g :vert scs find g <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@>c :vert scs find c <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@>t :vert scs find t <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@>e :vert scs find e <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@>f :vert scs find f <C-R>=expand("<cfile>")<CR><CR>
+ nmap <C-@>i :vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
+ nmap <C-@>d :vert scs find d <C-R>=expand("<cword>")<CR><CR>
+
+
+ execute ':redraw'
+endfunction
+
+let g:ycm_path_to_python_interpreter="/usr/bin/python3"
+let g:ycm_global_ycm_extra_conf = "~/.ycm_c_conf.py"
diff --git a/xinitrc b/xinitrc
new file mode 100644
index 0000000..4a9e5b5
--- /dev/null
+++ b/xinitrc
@@ -0,0 +1,9 @@
+xrdb -merge -I$HOME ~/.Xresources
+#xmodmap ~/.speedswapper
+
+#srandrd ~/.bin/mxrandr
+mxrandr
+
+#exec i3 -d all -V >> ~/i3log-$(date +'%F-%k-%M-%S') 2>&1
+exec i3
+#exec i3 --shmlog-size=26214400
diff --git a/xmod_swapper_not_used_any_more b/xmod_swapper_not_used_any_more
new file mode 100644
index 0000000..72c4957
--- /dev/null
+++ b/xmod_swapper_not_used_any_more
@@ -0,0 +1,5 @@
+! Swap caps lock and escape
+remove Lock = Caps_Lock
+keysym Escape = Caps_Lock
+keysym Caps_Lock = Escape
+add Lock = Caps_Lock
diff --git a/ycm_c_conf.py b/ycm_c_conf.py
new file mode 100644
index 0000000..0bfadd1
--- /dev/null
+++ b/ycm_c_conf.py
@@ -0,0 +1,136 @@
+import os
+import ycm_core
+
+# These are the compilation flags that will be used in case there's no
+# compilation database set (by default, one is not set).
+# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
+flags = [
+'-Wall',
+'-Wextra',
+'-pedantic',
+'-Wshadow',
+'-Wpointer-arith',
+'-Wcast-align',
+'-Wwrite-strings',
+'-Wmissing-prototypes',
+'-Wmissing-declarations',
+'-Winline',
+'-Wno-long-long',
+'-Wuninitialized',
+'-Wconversion',
+'-Wstrict-prototypes',
+'-Wno-long-long',
+'-Wno-variadic-macros',
+'-fexceptions',
+'-DNDEBUG',
+'-DUSE_CLANG_COMPLETER',
+'-std=c11',
+'-x', 'c',
+'-I', '.',
+'-isystem', '/usr/include',
+'-isystem', '/usr/local/include',
+]
+
+
+# Set this to the absolute path to the folder (NOT the file!) containing the
+# compile_commands.json file to use that instead of 'flags'. See here for
+# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
+#
+# You can get CMake to generate this file for you by adding:
+# set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
+# to your CMakeLists.txt file.
+#
+# Most projects will NOT need to set this to anything; you can just change the
+# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
+compilation_database_folder = ''
+
+if os.path.exists( compilation_database_folder ):
+ database = ycm_core.CompilationDatabase( compilation_database_folder )
+else:
+ database = None
+
+SOURCE_EXTENSIONS = [ '.c' ]
+
+def DirectoryOfThisScript():
+ return os.path.dirname( os.path.abspath( __file__ ) )
+
+
+def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
+ if not working_directory:
+ return list( flags )
+ new_flags = []
+ make_next_absolute = False
+ path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
+ for flag in flags:
+ new_flag = flag
+
+ if make_next_absolute:
+ make_next_absolute = False
+ if not flag.startswith( '/' ):
+ new_flag = os.path.join( working_directory, flag )
+
+ for path_flag in path_flags:
+ if flag == path_flag:
+ make_next_absolute = True
+ break
+
+ if flag.startswith( path_flag ):
+ path = flag[ len( path_flag ): ]
+ new_flag = path_flag + os.path.join( working_directory, path )
+ break
+
+ if new_flag:
+ new_flags.append( new_flag )
+ return new_flags
+
+
+def IsHeaderFile( filename ):
+ extension = os.path.splitext( filename )[ 1 ]
+ return extension in [ '.h' ]
+
+
+def GetCompilationInfoForFile( filename ):
+ # The compilation_commands.json file generated by CMake does not have entries
+ # for header files. So we do our best by asking the db for flags for a
+ # corresponding source file, if any. If one exists, the flags for that file
+ # should be good enough.
+ if IsHeaderFile( filename ):
+ basename = os.path.splitext( filename )[ 0 ]
+ for extension in SOURCE_EXTENSIONS:
+ replacement_file = basename + extension
+ if os.path.exists( replacement_file ):
+ compilation_info = database.GetCompilationInfoForFile(
+ replacement_file )
+ if compilation_info.compiler_flags_:
+ return compilation_info
+ return None
+ return database.GetCompilationInfoForFile( filename )
+
+
+def FlagsForFile( filename, **kwargs ):
+ if database:
+ # Bear in mind that compilation_info.compiler_flags_ does NOT return a
+ # python list, but a "list-like" StringVec object
+ compilation_info = GetCompilationInfoForFile( filename )
+ if not compilation_info:
+ return None
+
+ final_flags = MakeRelativePathsInFlagsAbsolute(
+ compilation_info.compiler_flags_,
+ compilation_info.compiler_working_dir_ )
+
+ # NOTE: This is just for YouCompleteMe; it's highly likely that your project
+ # does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
+ # ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT.
+ try:
+ final_flags.remove( '-stdlib=libc++' )
+ except ValueError:
+ pass
+ else:
+ relative_to = DirectoryOfThisScript()
+ final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
+
+ return {
+ 'flags': final_flags,
+ 'do_cache': True
+ }
diff --git a/ycm_cpp_conf.py b/ycm_cpp_conf.py
new file mode 100644
index 0000000..15c44c1
--- /dev/null
+++ b/ycm_cpp_conf.py
@@ -0,0 +1,196 @@
+# This file is NOT licensed under the GPLv3, which is the license for the rest
+# of YouCompleteMe.
+#
+# Here's the license text for this file:
+#
+# This is free and unencumbered software released into the public domain.
+#
+# Anyone is free to copy, modify, publish, use, compile, sell, or
+# distribute this software, either in source code form or as a compiled
+# binary, for any purpose, commercial or non-commercial, and by any
+# means.
+#
+# In jurisdictions that recognize copyright laws, the author or authors
+# of this software dedicate any and all copyright interest in the
+# software to the public domain. We make this dedication for the benefit
+# of the public at large and to the detriment of our heirs and
+# successors. We intend this dedication to be an overt act of
+# relinquishment in perpetuity of all present and future rights to this
+# software under copyright law.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+#
+# For more information, please refer to <http://unlicense.org/>
+
+import os
+import ycm_core
+
+# These are the compilation flags that will be used in case there's no
+# compilation database set (by default, one is not set).
+# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
+flags = [
+'-Wall',
+'-Wextra',
+'-Werror',
+'-Wc++98-compat',
+'-Wno-long-long',
+'-Wno-variadic-macros',
+'-fexceptions',
+'-DNDEBUG',
+# You 100% do NOT need -DUSE_CLANG_COMPLETER in your flags; only the YCM
+# source code needs it.
+'-DUSE_CLANG_COMPLETER',
+# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
+# language to use when compiling headers. So it will guess. Badly. So C++
+# headers will be compiled as C headers. You don't want that so ALWAYS specify
+# a "-std=<something>".
+# For a C project, you would set this to something like 'c99' instead of
+# 'c++11'.
+'-std=c++11',
+# ...and the same thing goes for the magic -x option which specifies the
+# language that the files to be compiled are written in. This is mostly
+# relevant for c++ headers.
+# For a C project, you would set this to 'c' instead of 'c++'.
+'-x',
+'c++',
+'-isystem',
+'../BoostParts',
+'-isystem',
+# This path will only work on OS X, but extra paths that don't exist are not
+# harmful
+'/System/Library/Frameworks/Python.framework/Headers',
+'-isystem',
+'../llvm/include',
+'-isystem',
+'../llvm/tools/clang/include',
+'-I',
+'.',
+'-I',
+'./ClangCompleter',
+'-isystem',
+'./tests/gmock/gtest',
+'-isystem',
+'./tests/gmock/gtest/include',
+'-isystem',
+'./tests/gmock',
+'-isystem',
+'./tests/gmock/include',
+'-isystem',
+'/usr/include',
+'-isystem',
+'/usr/local/include',
+'-isystem',
+'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1',
+'-isystem',
+'/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include',
+]
+
+
+# Set this to the absolute path to the folder (NOT the file!) containing the
+# compile_commands.json file to use that instead of 'flags'. See here for
+# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
+#
+# You can get CMake to generate this file for you by adding:
+# set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
+# to your CMakeLists.txt file.
+#
+# Most projects will NOT need to set this to anything; you can just change the
+# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
+compilation_database_folder = ''
+
+if os.path.exists( compilation_database_folder ):
+ database = ycm_core.CompilationDatabase( compilation_database_folder )
+else:
+ database = None
+
+SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
+
+def DirectoryOfThisScript():
+ return os.path.dirname( os.path.abspath( __file__ ) )
+
+
+def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
+ if not working_directory:
+ return list( flags )
+ new_flags = []
+ make_next_absolute = False
+ path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
+ for flag in flags:
+ new_flag = flag
+
+ if make_next_absolute:
+ make_next_absolute = False
+ if not flag.startswith( '/' ):
+ new_flag = os.path.join( working_directory, flag )
+
+ for path_flag in path_flags:
+ if flag == path_flag:
+ make_next_absolute = True
+ break
+
+ if flag.startswith( path_flag ):
+ path = flag[ len( path_flag ): ]
+ new_flag = path_flag + os.path.join( working_directory, path )
+ break
+
+ if new_flag:
+ new_flags.append( new_flag )
+ return new_flags
+
+
+def IsHeaderFile( filename ):
+ extension = os.path.splitext( filename )[ 1 ]
+ return extension in [ '.h', '.hxx', '.hpp', '.hh' ]
+
+
+def GetCompilationInfoForFile( filename ):
+ # The compilation_commands.json file generated by CMake does not have entries
+ # for header files. So we do our best by asking the db for flags for a
+ # corresponding source file, if any. If one exists, the flags for that file
+ # should be good enough.
+ if IsHeaderFile( filename ):
+ basename = os.path.splitext( filename )[ 0 ]
+ for extension in SOURCE_EXTENSIONS:
+ replacement_file = basename + extension
+ if os.path.exists( replacement_file ):
+ compilation_info = database.GetCompilationInfoForFile(
+ replacement_file )
+ if compilation_info.compiler_flags_:
+ return compilation_info
+ return None
+ return database.GetCompilationInfoForFile( filename )
+
+
+def FlagsForFile( filename, **kwargs ):
+ if database:
+ # Bear in mind that compilation_info.compiler_flags_ does NOT return a
+ # python list, but a "list-like" StringVec object
+ compilation_info = GetCompilationInfoForFile( filename )
+ if not compilation_info:
+ return None
+
+ final_flags = MakeRelativePathsInFlagsAbsolute(
+ compilation_info.compiler_flags_,
+ compilation_info.compiler_working_dir_ )
+
+ # NOTE: This is just for YouCompleteMe; it's highly likely that your project
+ # does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
+ # ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT.
+ try:
+ final_flags.remove( '-stdlib=libc++' )
+ except ValueError:
+ pass
+ else:
+ relative_to = DirectoryOfThisScript()
+ final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
+
+ return {
+ 'flags': final_flags,
+ 'do_cache': True
+ }