From 9a83cf01c8851a5bed589fe14f15ee99cd303d66 Mon Sep 17 00:00:00 2001 From: Tiande Date: Thu, 3 Aug 2017 23:21:37 +0800 Subject: [PATCH] merge --- README.md | 178 ++- install_awesome_vimrc.sh | 3 + install_basic_vimrc.sh | 3 + my_configs.vim | 6 +- my_plugins/.gitkeep | 0 sources_non_forked/ack.vim/README.md | 28 +- sources_non_forked/ag.vim/.gitignore | 2 - sources_non_forked/ag.vim/README.md | 81 -- sources_non_forked/ag.vim/Rakefile | 3 - sources_non_forked/ag.vim/autoload/ag.vim | 234 ---- sources_non_forked/ag.vim/doc/ag.txt | 174 --- sources_non_forked/ag.vim/plugin/ag.vim | 11 - .../ctrlp.vim/autoload/ctrlp.vim | 39 +- .../ctrlp.vim/autoload/ctrlp/buffertag.vim | 2 +- .../ctrlp.vim/autoload/ctrlp/line.vim | 15 +- .../ctrlp.vim/autoload/ctrlp/tag.vim | 4 +- sources_non_forked/ctrlp.vim/doc/ctrlp.cnx | 57 +- sources_non_forked/ctrlp.vim/doc/ctrlp.txt | 6 +- sources_non_forked/ctrlp.vim/doc/tags-cn | 3 + sources_non_forked/ctrlp.vim/plugin/ctrlp.vim | 4 +- sources_non_forked/goyo.vim/autoload/goyo.vim | 6 +- sources_non_forked/goyo.vim/doc/goyo.txt | 170 +++ sources_non_forked/gruvbox/CHANGELOG.md | 117 ++ sources_non_forked/gruvbox/README.md | 110 ++ .../autoload/airline/themes/gruvbox.vim | 79 ++ .../gruvbox/autoload/gruvbox.vim | 41 + .../lightline/colorscheme/gruvbox.vim | 53 + sources_non_forked/gruvbox/colors/gruvbox.vim | 1239 +++++++++++++++++ .../gruvbox/gruvbox_256palette.sh | 118 ++ .../gruvbox/gruvbox_256palette_osx.sh | 116 ++ sources_non_forked/lightline.vim/.travis.yml | 27 +- sources_non_forked/lightline.vim/LICENSE | 2 +- sources_non_forked/lightline.vim/README.md | 942 ++++--------- .../lightline/colorscheme/darcula.vim | 37 + .../lightline.vim/doc/lightline.txt | 93 +- .../mru => sources_non_forked/mru.vim}/README | 40 +- .../mru.vim}/plugin/mru.vim | 158 ++- .../nerdtree/.github/ISSUE_TEMPLATE.md | 37 + sources_non_forked/nerdtree/CHANGELOG | 9 + sources_non_forked/nerdtree/README.markdown | 6 +- .../nerdtree/autoload/nerdtree.vim | 39 +- .../nerdtree/autoload/nerdtree/ui_glue.vim | 62 +- .../doc/{NERD_tree.txt => NERDTree.txt} | 86 +- .../nerdtree/lib/nerdtree/bookmark.vim | 117 +- .../nerdtree/lib/nerdtree/creator.vim | 2 +- .../nerdtree/lib/nerdtree/path.vim | 37 +- .../nerdtree/lib/nerdtree/tree_dir_node.vim | 494 ++++--- .../nerdtree/lib/nerdtree/ui.vim | 170 ++- .../nerdtree/plugin/NERD_tree.vim | 2 + sources_non_forked/syntastic/README.markdown | 24 +- .../autoload/syntastic/preprocess.vim | 77 +- .../syntastic/autoload/syntastic/util.vim | 27 +- .../syntastic/doc/syntastic-checkers.txt | 497 +++++-- .../syntastic/doc/syntastic.txt | 2 +- .../syntastic/plugin/syntastic.vim | 21 +- .../syntastic/plugin/syntastic/registry.vim | 2 + .../syntastic/syntax_checkers/asm/gcc.vim | 7 +- .../syntastic/syntax_checkers/c/cppclean.vim | 40 + .../syntax_checkers/c/flawfinder.vim | 61 + .../syntastic/syntax_checkers/c/pc_lint.vim | 3 +- .../syntastic/syntax_checkers/cabal/cabal.vim | 5 +- .../syntax_checkers/cmake/cmakelint.vim | 40 + .../syntax_checkers/coffee/coffee_jshint.vim | 44 + .../syntax_checkers/cpp/cppclean.vim | 22 + .../syntax_checkers/cpp/flawfinder.vim | 26 + .../syntastic/syntax_checkers/css/csslint.vim | 1 + .../syntastic/syntax_checkers/cuda/nvcc.vim | 22 +- .../syntastic/syntax_checkers/d/dmd.vim | 3 +- .../syntastic/syntax_checkers/d/dscanner.vim | 48 + .../syntax_checkers/dart/dartanalyzer.vim | 5 +- .../syntax_checkers/dockerfile/hadolint.vim | 41 + .../syntax_checkers/elixir/elixir.vim | 3 +- .../erlang/erlang_check_file.erl | 213 ++- .../syntax_checkers/erlang/escript.vim | 8 +- .../syntastic/syntax_checkers/eruby/ruby.vim | 5 +- .../syntastic/syntax_checkers/glsl/cgc.vim | 29 +- .../syntastic/syntax_checkers/go/go.vim | 17 +- .../syntax_checkers/go/gometalinter.vim | 3 +- .../syntastic/syntax_checkers/go/gotype.vim | 21 +- .../syntastic/syntax_checkers/go/govet.vim | 3 +- .../syntax_checkers/haskell/hdevtools.vim | 3 +- .../syntax_checkers/haskell/hlint.vim | 3 +- .../syntastic/syntax_checkers/haxe/haxe.vim | 17 +- .../syntax_checkers/html/validator.vim | 3 +- .../syntastic/syntax_checkers/html/w3.vim | 3 +- .../syntax_checkers/java/checkstyle.vim | 4 +- .../syntastic/syntax_checkers/java/javac.vim | 4 +- .../javascript/closurecompiler.vim | 5 +- .../syntax_checkers/javascript/flow.vim | 9 +- .../syntastic/syntax_checkers/julia/lint.vim | 51 + .../syntastic/syntax_checkers/limbo/limbo.vim | 3 +- .../syntastic/syntax_checkers/lisp/clisp.vim | 6 +- .../syntastic/syntax_checkers/nasm/nasm.vim | 3 +- .../syntax_checkers/ocaml/camlp4o.vim | 30 +- .../syntastic/syntax_checkers/perl/perl.vim | 5 +- .../syntastic/syntax_checkers/php/php.vim | 4 +- .../syntastic/syntax_checkers/php/phpstan.vim | 49 + .../syntastic/syntax_checkers/po/dennis.vim | 43 + .../syntax_checkers/python/bandit.vim | 54 + .../syntastic/syntax_checkers/r/lint.vim | 4 +- .../syntastic/syntax_checkers/r/lintr.vim | 6 +- .../syntastic/syntax_checkers/r/svtools.vim | 4 +- .../syntastic/syntax_checkers/rst/sphinx.vim | 13 +- .../syntastic/syntax_checkers/sass/sass.vim | 11 +- .../syntastic/syntax_checkers/scala/fsc.vim | 3 +- .../syntastic/syntax_checkers/sh/sh.vim | 36 +- .../syntax_checkers/sh/shellcheck.vim | 13 +- .../syntax_checkers/solidity/solium.vim | 43 + .../syntax_checkers/typescript/tslint.vim | 6 +- .../syntastic/syntax_checkers/vala/valac.vim | 52 +- .../syntastic/syntax_checkers/vim/vimlint.vim | 24 +- .../syntax_checkers/xquery/basex.vim | 3 +- .../syntastic/syntax_checkers/yaml/yamlxs.vim | 16 +- .../tpope-vim-abolish/.gitignore | 1 + .../tpope-vim-abolish/CONTRIBUTING.markdown | 1 + .../tpope-vim-abolish/README.markdown | 150 ++ .../tpope-vim-abolish/doc/abolish.txt | 181 +++ .../tpope-vim-abolish/plugin/abolish.vim | 631 +++++++++ .../vim-bundle-mako/indent/mako.vim | 5 +- .../vim-coffee-script/Copying.md | 39 + .../vim-coffee-script/Readme.md | 24 +- .../vim-coffee-script/after/indent/html.vim | 2 +- .../vim-coffee-script/after/syntax/html.vim | 2 +- .../ftdetect/vim-literate-coffeescript.vim | 8 + .../vim-coffee-script/ftplugin/litcoffee.vim | 1 + .../vim-coffee-script/indent/litcoffee.vim | 22 + .../vim-coffee-script/syntax/coffee.vim | 2 +- .../vim-coffee-script/syntax/litcoffee.vim | 23 + .../vim-coffee-script/test/test.coffee.md | 117 ++ .../vim-coffee-script/test/test.html | 10 + .../vim-coffee-script/test/test.litcoffee | 117 ++ sources_non_forked/vim-colorschemes | 1 - .../vim-commentary/plugin/commentary.vim | 4 +- .../vim-fugitive/README.markdown | 14 +- .../vim-fugitive/doc/fugitive.txt | 16 +- .../vim-fugitive/plugin/fugitive.vim | 270 ++-- sources_non_forked/vim-gitgutter/.gitignore | 5 + sources_non_forked/vim-gitgutter/LICENCE | 22 + sources_non_forked/vim-gitgutter/README.mkd | 556 ++++++++ .../vim-gitgutter/autoload/gitgutter.vim | 259 ++++ .../autoload/gitgutter/async.vim | 207 +++ .../autoload/gitgutter/debug.vim | 119 ++ .../vim-gitgutter/autoload/gitgutter/diff.vim | 345 +++++ .../autoload/gitgutter/highlight.vim | 115 ++ .../vim-gitgutter/autoload/gitgutter/hunk.vim | 143 ++ .../vim-gitgutter/autoload/gitgutter/sign.vim | 179 +++ .../autoload/gitgutter/utility.vim | 225 +++ .../vim-gitgutter/doc/gitgutter.txt | 341 +++++ .../vim-gitgutter/plugin/gitgutter.vim | 228 +++ .../vim-gitgutter/screenshot.png | Bin 0 -> 16191 bytes .../vim-gitgutter/test/fixture.txt | 11 + .../vim-gitgutter/test/runner.vim | 162 +++ sources_non_forked/vim-gitgutter/test/test | 19 + .../vim-gitgutter/test/test_gitgutter.vim | 400 ++++++ .../vim-go/.github/CONTRIBUTING.md | 4 +- .../vim-go/.github/ISSUE_TEMPLATE.md | 9 +- sources_non_forked/vim-go/.gitignore | 5 + sources_non_forked/vim-go/.travis.yml | 21 + sources_non_forked/vim-go/CHANGELOG.md | 182 ++- sources_non_forked/vim-go/LICENSE | 2 +- sources_non_forked/vim-go/Makefile | 7 + sources_non_forked/vim-go/README.md | 321 +---- sources_non_forked/vim-go/Rakefile | 13 - .../vim-go/autoload/ctrlp/decls.vim | 6 +- .../vim-go/autoload/go/asmfmt.vim | 2 +- sources_non_forked/vim-go/autoload/go/cmd.vim | 208 +-- .../vim-go/autoload/go/complete.vim | 26 +- .../vim-go/autoload/go/coverage.vim | 40 +- sources_non_forked/vim-go/autoload/go/def.vim | 21 +- .../vim-go/autoload/go/def_test.vim | 32 + sources_non_forked/vim-go/autoload/go/doc.vim | 31 +- sources_non_forked/vim-go/autoload/go/fmt.vim | 305 ++-- .../vim-go/autoload/go/fmt_test.vim | 47 + .../vim-go/autoload/go/guru.vim | 91 +- .../vim-go/autoload/go/impl.vim | 8 +- sources_non_forked/vim-go/autoload/go/job.vim | 27 +- .../vim-go/autoload/go/jobcontrol.vim | 46 +- .../vim-go/autoload/go/keyify.vim | 58 + .../vim-go/autoload/go/lint.vim | 87 +- .../vim-go/autoload/go/list.vim | 4 +- .../vim-go/autoload/go/package.vim | 32 +- .../vim-go/autoload/go/path.vim | 149 +- .../vim-go/autoload/go/play.vim | 4 +- .../vim-go/autoload/go/rename.vim | 19 +- .../vim-go/autoload/go/statusline.vim | 6 +- .../vim-go/autoload/go/tags.vim | 208 +++ .../vim-go/autoload/go/tags_test.vim | 28 + .../vim-go/autoload/go/template.vim | 11 +- .../vim-go/autoload/go/term.vim | 5 + .../autoload/go/test-fixtures/def/jump.go | 7 + .../autoload/go/test-fixtures/fmt/hello.go | 7 + .../go/test-fixtures/fmt/hello_golden.go | 7 + .../go/test-fixtures/fmt/imports/goimports.go | 13 + .../fmt/imports/goimports_golden.go | 15 + .../vendor/gh.com/gi/foo-logging/logger.go | 12 + .../autoload/go/test-fixtures/fmt/src/imports | 1 + .../vim-go/autoload/go/test.vim | 287 ++++ .../vim-go/autoload/go/textobj.vim | 20 +- .../vim-go/autoload/go/tool.vim | 2 +- .../vim-go/autoload/go/util.vim | 88 +- sources_non_forked/vim-go/doc/vim-go.txt | 343 +++-- sources_non_forked/vim-go/ftplugin/go.vim | 6 +- .../vim-go/ftplugin/go/commands.vim | 27 +- .../vim-go/ftplugin/go/mappings.vim | 6 +- .../vim-go/ftplugin/go/tagbar.vim | 6 +- .../vim-go/gosnippets/UltiSnips/go.snippets | 17 +- .../vim-go/gosnippets/snippets/go.snip | 15 + sources_non_forked/vim-go/plugin/go.vim | 14 +- sources_non_forked/vim-go/scripts/runtest.vim | 81 ++ sources_non_forked/vim-go/scripts/test.sh | 99 +- sources_non_forked/vim-go/syntax/go.vim | 18 +- .../vim-go/syntax/gotexttmpl.vim | 4 +- sources_non_forked/vim-go/t/coverlay.vim | 191 --- .../vim-go/t/fixtures/src/buildfail/sample.go | 13 - .../t/fixtures/src/buildfail/sample_test.go | 7 - .../t/fixtures/src/buildtestfail/sample.go | 7 - .../fixtures/src/buildtestfail/sample_test.go | 15 - .../vim-go/t/fixtures/src/failtest/sample.go | 12 - .../t/fixtures/src/failtest/sample_test.go | 8 - .../vim-go/t/fixtures/src/parsefail/sample.go | 14 - .../t/fixtures/src/parsefail/sample_test.go | 7 - .../vim-go/t/fixtures/src/pkg1/sample.go | 12 - .../vim-go/t/fixtures/src/pkg1/sample.out | 6 - .../vim-go/t/fixtures/src/pkg1/sample_test.go | 7 - .../vim-go/templates/hello_world_test.go | 7 + .../vim-indent-object/doc/indent-object.txt | 16 +- .../vim-markdown/README.markdown | 8 + .../vim-markdown/ftplugin/markdown.vim | 27 +- .../vim-markdown/syntax/markdown.vim | 9 +- .../vim-multiple-cursors/README.md | 5 +- .../autoload/multiple_cursors.vim | 14 +- sources_non_forked/vim-pug/README.markdown | 2 + sources_non_forked/vim-pug/syntax/pug.vim | 20 +- .../vim-repeat/autoload/repeat.vim | 2 +- sources_non_forked/vim-snipmate/README.md | 14 + .../vim-snipmate/autoload/snipMate.vim | 19 +- .../vim-snipmate/autoload/snipmate/parse.vim | 20 +- .../vim-snipmate/doc/snipMate.txt | 63 +- .../vim-snipmate/plugin/snipMate.vim | 3 +- sources_non_forked/vim-snipmate/t/parser.vim | 10 + sources_non_forked/vim-snippets/.gitignore | 1 + sources_non_forked/vim-snippets/README.md | 6 +- .../vim-snippets/UltiSnips/all.snippets | 14 +- .../vim-snippets/UltiSnips/blade.snippets | 139 ++ .../vim-snippets/UltiSnips/c.snippets | 20 +- .../UltiSnips/coffee-react.snippets | 24 +- .../vim-snippets/UltiSnips/cpp.snippets | 41 +- .../vim-snippets/UltiSnips/crystal.snippets | 13 + .../vim-snippets/UltiSnips/cs.snippets | 58 +- .../vim-snippets/UltiSnips/css.snippets | 6 - .../vim-snippets/UltiSnips/d.snippets | 110 +- .../vim-snippets/UltiSnips/django.snippets | 36 +- .../vim-snippets/UltiSnips/eruby.snippets | 14 +- .../vim-snippets/UltiSnips/go.snippets | 2 +- .../vim-snippets/UltiSnips/html.snippets | 646 ++++++--- .../UltiSnips/html_minimal.snippets | 12 +- .../UltiSnips/htmldjango.snippets | 112 +- .../vim-snippets/UltiSnips/java.snippets | 6 +- .../UltiSnips/javascript-angular.snippets | 14 +- .../javascript-jasmine-arrow.snippets | 48 + .../UltiSnips/javascript-jasmine.snippets | 218 --- .../UltiSnips/javascript-node.snippets | 24 +- .../UltiSnips/javascript-openui5.snippets | 272 ++-- .../UltiSnips/javascript.snippets | 151 +- .../vim-snippets/UltiSnips/matlab.snippets | 24 + .../UltiSnips/php-laravel.snippets | 18 +- .../UltiSnips/php-phpspec.snippets | 28 +- .../UltiSnips/php-symfony2.snippets | 48 +- .../vim-snippets/UltiSnips/php.snippets | 2 +- .../vim-snippets/UltiSnips/proto.snippets | 6 +- .../vim-snippets/UltiSnips/puppet.snippets | 50 +- .../vim-snippets/UltiSnips/python.snippets | 2 +- .../vim-snippets/UltiSnips/r.snippets | 32 +- .../vim-snippets/UltiSnips/rails.snippets | 36 +- .../vim-snippets/UltiSnips/rst.snippets | 20 +- .../vim-snippets/UltiSnips/ruby.snippets | 68 +- .../vim-snippets/UltiSnips/rust.snippets | 78 +- .../vim-snippets/UltiSnips/sh.snippets | 6 +- .../vim-snippets/UltiSnips/snippets.snippets | 6 +- .../UltiSnips/supercollider.snippets | 2 +- .../vim-snippets/UltiSnips/tcl.snippets | 14 +- .../vim-snippets/UltiSnips/tex.snippets | 42 +- .../vim-snippets/UltiSnips/vim.snippets | 4 +- .../vim-snippets/UltiSnips/vue.snippets | 1 + .../pythonx/javascript_snippets.py | 48 + .../vim-snippets/snippets/_.snippets | 3 +- .../snippets/actionscript.snippets | 6 +- .../vim-snippets/snippets/ada.snippets | 10 +- .../vim-snippets/snippets/apache.snippets | 8 +- .../vim-snippets/snippets/arduino.snippets | 2 +- .../vim-snippets/snippets/awk.snippets | 4 +- .../vim-snippets/snippets/c.snippets | 123 +- .../snippets/coffee/coffee.snippets | 8 +- .../vim-snippets/snippets/cpp.snippets | 57 +- .../vim-snippets/snippets/crystal.snippets | 82 ++ .../vim-snippets/snippets/cs.snippets | 219 +-- .../vim-snippets/snippets/css.snippets | 10 +- .../vim-snippets/snippets/d.snippets | 6 +- .../vim-snippets/snippets/dart.snippets | 4 +- .../vim-snippets/snippets/eelixir.snippets | 4 +- .../vim-snippets/snippets/elixir.snippets | 60 +- .../vim-snippets/snippets/elm.snippets | 5 +- .../vim-snippets/snippets/erlang.snippets | 32 +- .../vim-snippets/snippets/eruby.snippets | 2 +- .../vim-snippets/snippets/fortran.snippets | 5 + .../vim-snippets/snippets/go.snippets | 53 +- .../vim-snippets/snippets/haml.snippets | 6 +- .../vim-snippets/snippets/handlebars.snippets | 6 +- .../vim-snippets/snippets/html.snippets | 4 +- .../snippets/htmltornado.snippets | 2 +- .../vim-snippets/snippets/idris.snippets | 46 + .../vim-snippets/snippets/java.snippets | 4 +- .../snippets/javascript-mocha.snippets | 34 +- .../snippets/javascript.es6.react.snippets | 7 +- .../javascript/javascript-jasmine.snippets | 175 +++ .../javascript/javascript.es6.snippets | 16 +- .../snippets/javascript/javascript.snippets | 127 +- .../vim-snippets/snippets/jinja.snippets | 2 +- .../vim-snippets/snippets/julia.snippets | 2 +- .../vim-snippets/snippets/ls.snippets | 2 +- .../vim-snippets/snippets/make.snippets | 8 +- .../vim-snippets/snippets/mako.snippets | 2 +- .../vim-snippets/snippets/markdown.snippets | 5 +- .../vim-snippets/snippets/matlab.snippets | 64 + .../vim-snippets/snippets/mustache.snippets | 6 +- .../vim-snippets/snippets/php.snippets | 127 +- .../vim-snippets/snippets/processing.snippets | 4 +- .../vim-snippets/snippets/purescript.snippets | 9 +- .../vim-snippets/snippets/python.snippets | 34 +- .../vim-snippets/snippets/rst.snippets | 4 +- .../vim-snippets/snippets/ruby.snippets | 33 +- .../vim-snippets/snippets/rust.snippets | 33 +- .../vim-snippets/snippets/sass.snippets | 993 ++++++++++++- .../vim-snippets/snippets/scala.snippets | 16 +- .../vim-snippets/snippets/sh.snippets | 21 +- .../vim-snippets/snippets/snippets.snippets | 7 +- .../vim-snippets/snippets/tex.snippets | 48 +- .../vim-snippets/snippets/twig.snippets | 8 +- .../vim-snippets/snippets/typescript.snippets | 1 + .../vim-snippets/snippets/vim.snippets | 10 +- .../vim-snippets/snippets/vue.snippets | 183 +++ .../vim-snippets/snippets/zsh.snippets | 20 +- update_plugins.py | 3 +- vimrcs/basic.vim | 102 +- vimrcs/extended.vim | 37 +- vimrcs/filetypes.vim | 12 +- vimrcs/plugins_config.vim | 10 +- 347 files changed, 15761 insertions(+), 5487 deletions(-) create mode 100644 my_plugins/.gitkeep delete mode 100644 sources_non_forked/ag.vim/.gitignore delete mode 100644 sources_non_forked/ag.vim/README.md delete mode 100644 sources_non_forked/ag.vim/Rakefile delete mode 100644 sources_non_forked/ag.vim/autoload/ag.vim delete mode 100644 sources_non_forked/ag.vim/doc/ag.txt delete mode 100644 sources_non_forked/ag.vim/plugin/ag.vim create mode 100644 sources_non_forked/goyo.vim/doc/goyo.txt create mode 100644 sources_non_forked/gruvbox/CHANGELOG.md create mode 100644 sources_non_forked/gruvbox/README.md create mode 100644 sources_non_forked/gruvbox/autoload/airline/themes/gruvbox.vim create mode 100644 sources_non_forked/gruvbox/autoload/gruvbox.vim create mode 100644 sources_non_forked/gruvbox/autoload/lightline/colorscheme/gruvbox.vim create mode 100644 sources_non_forked/gruvbox/colors/gruvbox.vim create mode 100644 sources_non_forked/gruvbox/gruvbox_256palette.sh create mode 100644 sources_non_forked/gruvbox/gruvbox_256palette_osx.sh create mode 100644 sources_non_forked/lightline.vim/autoload/lightline/colorscheme/darcula.vim rename {sources_forked/mru => sources_non_forked/mru.vim}/README (82%) rename {sources_forked/mru => sources_non_forked/mru.vim}/plugin/mru.vim (87%) create mode 100644 sources_non_forked/nerdtree/.github/ISSUE_TEMPLATE.md rename sources_non_forked/nerdtree/doc/{NERD_tree.txt => NERDTree.txt} (94%) create mode 100644 sources_non_forked/syntastic/syntax_checkers/c/cppclean.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/c/flawfinder.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/cmake/cmakelint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/coffee/coffee_jshint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/cpp/cppclean.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/cpp/flawfinder.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/d/dscanner.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/dockerfile/hadolint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/julia/lint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/php/phpstan.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/po/dennis.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/python/bandit.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/solidity/solium.vim create mode 100644 sources_non_forked/tpope-vim-abolish/.gitignore create mode 100644 sources_non_forked/tpope-vim-abolish/CONTRIBUTING.markdown create mode 100644 sources_non_forked/tpope-vim-abolish/README.markdown create mode 100644 sources_non_forked/tpope-vim-abolish/doc/abolish.txt create mode 100644 sources_non_forked/tpope-vim-abolish/plugin/abolish.vim create mode 100644 sources_non_forked/vim-coffee-script/ftdetect/vim-literate-coffeescript.vim create mode 100644 sources_non_forked/vim-coffee-script/ftplugin/litcoffee.vim create mode 100644 sources_non_forked/vim-coffee-script/indent/litcoffee.vim create mode 100644 sources_non_forked/vim-coffee-script/syntax/litcoffee.vim create mode 100644 sources_non_forked/vim-coffee-script/test/test.coffee.md create mode 100644 sources_non_forked/vim-coffee-script/test/test.litcoffee delete mode 160000 sources_non_forked/vim-colorschemes create mode 100644 sources_non_forked/vim-gitgutter/.gitignore create mode 100644 sources_non_forked/vim-gitgutter/LICENCE create mode 100644 sources_non_forked/vim-gitgutter/README.mkd create mode 100644 sources_non_forked/vim-gitgutter/autoload/gitgutter.vim create mode 100644 sources_non_forked/vim-gitgutter/autoload/gitgutter/async.vim create mode 100644 sources_non_forked/vim-gitgutter/autoload/gitgutter/debug.vim create mode 100644 sources_non_forked/vim-gitgutter/autoload/gitgutter/diff.vim create mode 100644 sources_non_forked/vim-gitgutter/autoload/gitgutter/highlight.vim create mode 100644 sources_non_forked/vim-gitgutter/autoload/gitgutter/hunk.vim create mode 100644 sources_non_forked/vim-gitgutter/autoload/gitgutter/sign.vim create mode 100644 sources_non_forked/vim-gitgutter/autoload/gitgutter/utility.vim create mode 100644 sources_non_forked/vim-gitgutter/doc/gitgutter.txt create mode 100644 sources_non_forked/vim-gitgutter/plugin/gitgutter.vim create mode 100644 sources_non_forked/vim-gitgutter/screenshot.png create mode 100644 sources_non_forked/vim-gitgutter/test/fixture.txt create mode 100644 sources_non_forked/vim-gitgutter/test/runner.vim create mode 100644 sources_non_forked/vim-gitgutter/test/test create mode 100644 sources_non_forked/vim-gitgutter/test/test_gitgutter.vim create mode 100644 sources_non_forked/vim-go/.travis.yml create mode 100644 sources_non_forked/vim-go/Makefile delete mode 100644 sources_non_forked/vim-go/Rakefile create mode 100644 sources_non_forked/vim-go/autoload/go/def_test.vim create mode 100644 sources_non_forked/vim-go/autoload/go/fmt_test.vim create mode 100644 sources_non_forked/vim-go/autoload/go/keyify.vim create mode 100644 sources_non_forked/vim-go/autoload/go/tags.vim create mode 100644 sources_non_forked/vim-go/autoload/go/tags_test.vim create mode 100644 sources_non_forked/vim-go/autoload/go/test-fixtures/def/jump.go create mode 100644 sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/hello.go create mode 100644 sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/hello_golden.go create mode 100644 sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/imports/goimports.go create mode 100644 sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/imports/goimports_golden.go create mode 100644 sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/imports/vendor/gh.com/gi/foo-logging/logger.go create mode 100644 sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/src/imports create mode 100644 sources_non_forked/vim-go/autoload/go/test.vim create mode 100644 sources_non_forked/vim-go/scripts/runtest.vim delete mode 100644 sources_non_forked/vim-go/t/coverlay.vim delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/buildfail/sample.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/buildfail/sample_test.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/buildtestfail/sample.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/buildtestfail/sample_test.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/failtest/sample.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/failtest/sample_test.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/parsefail/sample.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/parsefail/sample_test.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/pkg1/sample.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/pkg1/sample.out delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/pkg1/sample_test.go create mode 100644 sources_non_forked/vim-go/templates/hello_world_test.go create mode 100644 sources_non_forked/vim-snippets/UltiSnips/blade.snippets create mode 100644 sources_non_forked/vim-snippets/UltiSnips/crystal.snippets create mode 100644 sources_non_forked/vim-snippets/UltiSnips/javascript-jasmine-arrow.snippets delete mode 100644 sources_non_forked/vim-snippets/UltiSnips/javascript-jasmine.snippets create mode 100644 sources_non_forked/vim-snippets/UltiSnips/matlab.snippets create mode 100644 sources_non_forked/vim-snippets/UltiSnips/vue.snippets create mode 100644 sources_non_forked/vim-snippets/pythonx/javascript_snippets.py create mode 100644 sources_non_forked/vim-snippets/snippets/crystal.snippets create mode 100644 sources_non_forked/vim-snippets/snippets/idris.snippets create mode 100644 sources_non_forked/vim-snippets/snippets/javascript/javascript-jasmine.snippets create mode 100644 sources_non_forked/vim-snippets/snippets/matlab.snippets create mode 100644 sources_non_forked/vim-snippets/snippets/typescript.snippets create mode 100644 sources_non_forked/vim-snippets/snippets/vue.snippets diff --git a/README.md b/README.md index ff02c1d3..11ac3e3e 100644 --- a/README.md +++ b/README.md @@ -24,32 +24,33 @@ bash ~/.vim_runtime/install_awesome_vimrc.sh +![VIM](https://dnp4pehkvoo6n.cloudfront.net/43c5af597bd5c1a64eb1829f011c208f/as/Ultimate%20Vimrc.svg) # The Ultimate vimrc -Over the last 8 years I have used and tweaked Vim. This is my Ultimate vimrc. +Over the last 10 years, I have used and tweaked Vim. This configuration is the ultimate vimrc (or at least my version of it). There are two versions: -* **Basic**: If you want something small just copy [basic.vim](https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim) into your ~/.vimrc and you will have a great basic setup -* **Awesome**: This includes a ton of useful plugins, color schemes and configurations +* **The Basic**: If you want something small just copy [basic.vim](https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim) into your ~/.vimrc and you will have a good basic setup +* **The Awesome**: Includes a ton of useful plugins, color schemes, and configurations -I would of course recommend using the awesome version.c +I would, of course, recommend using the awesome version. ## How to install the Awesome version? -The awesome version includes a lot of great plugins, configurations and color schemes that make Vim a lot better. To install it simply do following: +The awesome version includes a lot of great plugins, configurations and color schemes that make Vim a lot better. To install it simply do following from your terminal: - git clone https://github.com/amix/vimrc.git ~/.vim_runtime + git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime sh ~/.vim_runtime/install_awesome_vimrc.sh -I also recommend using [Source Code Pro font from Adobe](http://store1.adobe.com/cfusion/store/html/index.cfm?event=displayFontPackage&code=1960) (it's free and awesome font for writing and programming). The Awesome vimrc is already setup to try to use it +I also recommend using [the Hack font](http://sourcefoundry.org/hack/) (it's a free and awesome font designed for source code). The Awesome vimrc is already setup to try to use it. ## How to install the Basic version? -The basic version is basically just one file and no plugins. You can check out [basic.vim](https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim). +The basic version is just one file and no plugins. Just copy [basic.vim](https://github.com/amix/vimrc/blob/master/vimrcs/basic.vim) and paste it into your vimrc. -This is useful to install on remote servers where you don't need many plugins and you don't do many edits. +The basic version is useful to install on remote servers where you don't need many plugins, and you don't do many edits. - git clone git://github.com/amix/vimrc.git ~/.vim_runtime + git clone --depth=1 git://github.com/amix/vimrc.git ~/.vim_runtime sh ~/.vim_runtime/install_basic_vimrc.sh @@ -64,7 +65,7 @@ If you have vim aliased as `vi` instead of `vim`, make sure to either alias it: ## How to update to latest version? -Simply just do a git rebase! +Just do a git rebase! cd ~/.vim_runtime git pull --rebase @@ -73,49 +74,47 @@ Simply just do a git rebase! ## Some screenshots Colors when editing a Python file: -![Screenshot 1](http://files1.wedoist.com/e952fdb343b1e617b90d256e474d0370/as/screenshot_1.png) -Opening recently opened files [mru.vim](https://github.com/vim-scripts/mru.vim): -![Screenshot 2](http://files1.wedoist.com/1967b0e48af40e513d1a464e08196990/as/screenshot_2.png) +![Screenshot 1](https://dnp4pehkvoo6n.cloudfront.net/07583008e4da885801657e8781777844/as/Python%20editing.png) + +Opening recently opened files with the [mru.vim](https://github.com/vim-scripts/mru.vim) plugin: + +![Screenshot 2](https://dnp4pehkvoo6n.cloudfront.net/1d49a88f9bd5d013c025bb1e1272a7d8/as/MRU%20plugin.png) [NERD Tree](https://github.com/scrooloose/nerdtree) plugin in a terminal window: -![Screenshot 3](http://files1.wedoist.com/b1509d7ed9e9f357e8d04797f9fad67b/as/screenshot3.png) - -This vimrc even works on Windows! -![Screenshot 4](http://files1.wedoist.com/4e85163d97b81422240c822c82022f2f/as/screenshot_4.png) +![Screenshot 3](https://dnp4pehkvoo6n.cloudfront.net/ae719203166585d64728f28398f4b1b7/as/Terminal%20usage.png) Distraction free mode using [goyo.vim](https://github.com/junegunn/goyo.vim) and [vim-zenroom2](https://github.com/amix/vim-zenroom2): -![Screenshot 5](https://d2dq6e731uoz0t.cloudfront.net/a5182977c3d6c2a6cd3f9e97398ca8ca/as/zen_mode.jpg) +![Screenshot 4](https://dnp4pehkvoo6n.cloudfront.net/f0dcc4c9739148c56cbf8285a910ac41/as/Zen%20mode.png) ## Included Plugins -I recommend reading the docs of these plugins to understand them better. Each of them provide a much better Vim experience! +I recommend reading the docs of these plugins to understand them better. Each plugin provides a much better Vim experience! -* [pathogen.vim](https://github.com/tpope/vim-pathogen): Manages the runtime path of the plugins -* [snipMate.vim](https://github.com/garbas/vim-snipmate): snipMate.vim aims to be a concise vim script that implements some of TextMate's snippets features in Vim -* [bufexplorer.zip](https://github.com/vim-scripts/bufexplorer.zip): Buffer Explorer / Browser. This plugin can be opened with `` +* [ack.vim](https://github.com/mileszs/ack.vim): Vim plugin for `the_silver_searcher` (ag) or ack -- a wicked fast grep +* [bufexplorer.zip](https://github.com/vim-scripts/bufexplorer.zip): Quickly and easily switch between buffers. This plugin can be opened with `` +* [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim): Fuzzy file, buffer, mru and tag finder. It's mapped to `` +* [goyo.vim](https://github.com/junegunn/goyo.vim) and [vim-zenroom2](https://github.com/amix/vim-zenroom2): +* [lightline.vim](https://github.com/itchyny/lightline.vim): A light and configurable statusline/tabline for Vim * [NERD Tree](https://github.com/scrooloose/nerdtree): A tree explorer plugin for vim -* [ack.vim](https://github.com/mileszs/ack.vim): Vim plugin for the Perl module / CLI script 'ack' -* [ag.vim](https://github.com/rking/ag.vim): A much faster Ack -* [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim): Fuzzy file, buffer, mru and tag finder. In my config it's mapped to ``, because `` is used by YankRing -* [mru.vim](https://github.com/vim-scripts/mru.vim): Plugin to manage Most Recently Used (MRU) files. Includes my own fork which adds syntax highlighting to MRU. This plugin can be opened with `` +* [mru.vim](https://github.com/vim-scripts/mru.vim): Plugin to manage Most Recently Used (MRU) files. This plugin can be opened with `` * [open_file_under_cursor.vim](https://github.com/amix/open_file_under_cursor.vim): Open file under cursor when pressing `gf` +* [pathogen.vim](https://github.com/tpope/vim-pathogen): Manage your vim runtimepath +* [snipmate.vim](https://github.com/garbas/vim-snipmate): snipmate.vim aims to be a concise vim script that implements some of TextMate's snippets features in Vim +* [syntastic](https://github.com/scrooloose/syntastic): Syntax checking hacks for vim +* [vim-commentary](https://github.com/tpope/vim-commentary): Comment stuff out. Use `gcc` to comment out a line (takes a count), `gc` to comment out the target of a motion. `gcu` uncomments a set of adjacent commented lines. +* [vim-expand-region](https://github.com/terryma/vim-expand-region): Allows you to visually select increasingly larger regions of text using the same key combination +* [vim-fugitive](https://github.com/tpope/vim-fugitive): A Git wrapper so awesome, it should be illegal * [vim-indent-object](https://github.com/michaeljsmith/vim-indent-object): Defines a new text object representing lines of code at the same indent level. Useful for python/vim scripts * [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors): Sublime Text style multiple selections for Vim, CTRL+N is remapped to CTRL+S (due to YankRing) -* [vim-expand-region](https://github.com/terryma/vim-expand-region): Allows you to visually select increasingly larger regions of text using the same key combination. -* [vim-fugitive](https://github.com/tpope/vim-fugitive): A Git wrapper so awesome, it should be illegal -* [goyo.vim](https://github.com/junegunn/goyo.vim) and [vim-zenroom2](https://github.com/amix/vim-zenroom2): -Remove all clutter and focus only on the essential. Similar to iA Writer or Write Room [Read more here](http://amix.dk/blog/post/19744) -* [vim-commentary](https://github.com/tpope/vim-commentary): Comment stuff out. Use `gcc` to comment out a line (takes a count), `gc` to comment out the target of a motion. `gcu` uncomments a set of adjacent commented lines. -* [syntastic](https://github.com/scrooloose/syntastic): Syntax checking hacks for vim * [vim-yankstack](https://github.com/maxbrunsfeld/vim-yankstack): Maintains a history of previous yanks, changes and deletes -* [lightline.vim](https://github.com/itchyny/lightline.vim): A light and configurable statusline/tabline for Vim +Remove all clutter and focus only on the essential. Similar to iA Writer or Write Room [Read more here](http://amix.dk/blog/post/19744) ## Included color schemes -* [peaksea](https://github.com/vim-scripts/peaksea): My favorite! +* [peaksea](https://github.com/vim-scripts/peaksea): The default * [vim-colors-solarized](https://github.com/altercation/vim-colors-solarized) * [vim-irblack](https://github.com/wgibbs/vim-irblack) * [mayansmoke](https://github.com/vim-scripts/mayansmoke) @@ -134,37 +133,38 @@ Remove all clutter and focus only on the essential. Similar to iA Writer or Writ ## How to include your own stuff? -After you have installed the setup you can create **~/.vim_runtime/my_configs.vim** to fill in any configurations that are important for you. For instance, my **my_configs.vim** looks like this: +After you have installed the setup, you can create **~/.vim_runtime/my_configs.vim** to fill in any configurations that are important for you. For instance, my **my_configs.vim** looks like this: ~/.vim_runtime (master)> cat my_configs.vim map ct :cd ~/Desktop/Todoist/todoist map cw :cd ~/Desktop/Wedoist/wedoist -You can also install your own plugins, for instance, via pathogen we can install [vim-rails](https://github.com/tpope/vim-rails): +You can also install your plugins, for instance, via pathogen you can install [vim-rails](https://github.com/tpope/vim-rails): cd ~/.vim_runtime git clone git://github.com/tpope/vim-rails.git sources_non_forked/vim-rails - -Now you have vim-rails installed ;-) ## Key Mappings +The [leader](http://learnvimscriptthehardway.stevelosh.com/chapters/06.html#leader) is `,`, so whenever you see `` it means `,`. + + ### Plugin related mappings -Open [bufexplorer](https://github.com/vim-scripts/bufexplorer.zip) and see and manage the current buffers (`o`): +Open [bufexplorer](https://github.com/vim-scripts/bufexplorer.zip) to see and manage the current buffers (`o`): map o :BufExplorer -Open [MRU.vim](https://github.com/vim-scripts/mru.vim) and see the recently open files (`f`): +Open [MRU.vim](https://github.com/vim-scripts/mru.vim) to see the recently open files (`f`): map f :MRU -Open [ctrlp.vim](https://github.com/kien/ctrlp.vim) plugin (`j` or `f`): +Open [ctrlp.vim](https://github.com/kien/ctrlp.vim) plugin to quickly find a file or a buffer (`j` or `f`): let g:ctrlp_map = '' -Managing the [NERD Tree](https://github.com/scrooloose/nerdtree) plugin: +[NERD Tree](https://github.com/scrooloose/nerdtree) mappings: map nn :NERDTreeToggle map nb :NERDTreeFromBookmark @@ -174,6 +174,7 @@ Managing the [NERD Tree](https://github.com/scrooloose/nerdtree) plugin: map z :Goyo + ### Normal mode mappings Fast saving of a buffer (`w`): @@ -186,7 +187,7 @@ Map `` to `/` (search) and `+` to `?` (backwards search): map ? map :noh -Disable highlight when `` is pressed: +Disable highlights when you press ``: map :noh @@ -197,7 +198,7 @@ Smart way to move between windows (`j` etc.): map h map l -Closing of current buffer(s) (`bd` and (`ba`)): +Closing of the current buffer(s) (`bd` and (`ba`)): " Close current buffer map bd :Bclose @@ -216,22 +217,14 @@ Useful mappings for managing tabs: " Super useful when editing files in the same directory map te :tabedit =expand("%:p:h")/ -Switch CWD to the directory of the open buffer: +Switch [CWD](http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file) to the directory of the open buffer: map cd :cd %:p:h:pwd -Open vimgrep and put the cursor in the right position: +Open `ack.vim` for fast search: - map g :vimgrep // **/*. + map g :Ack -Vimgreps in the current file: - - map :vimgrep // % - -Remove the Windows ^M - when the encodings gets messed up: - - noremap m mmHmt:%s///ge'tzt'm - Quickly open a buffer for scripbble: map q :e ~/buffer @@ -241,6 +234,31 @@ Toggle paste mode on and off: map pp :setlocal paste! +### Visual mode mappings + +Visual mode pressing `*` or `#` searches for the current selection: + + vnoremap * :call VisualSelection('f') + vnoremap # :call VisualSelection('b') + +When you press gv you `Ack.vim` after the selected text: + + vnoremap gv :call VisualSelection('gv', '') + +When you press `r` you can search and replace the selected text: + + vnoremap r :call VisualSelection('replace') + +Surround the visual selection in parenthesis/brackets/etc.: + + vnoremap $1 `>a)` + vnoremap $2 `>a]` + vnoremap $3 `>a}` + vnoremap $$ `>a"` + vnoremap $q `>a'` + vnoremap $e `>a"` + + ### Insert mode mappings Quickly insert parenthesis/brackets/etc.: @@ -258,31 +276,6 @@ Insert the current date and time (useful for timestamps): iab xdate =strftime("%d/%m/%y %H:%M:%S") -### Visual mode mappings - -Visual mode pressing `*` or `#` searches for the current selection: - - vnoremap * :call VisualSelection('f') - vnoremap # :call VisualSelection('b') - -When you press gv you vimgrep after the selected text: - - vnoremap gv :call VisualSelection('gv') - -When you press `r` you can search and replace the selected text: - - vnoremap r :call VisualSelection('replace') - -Surround the visual selection in parenthesis/brackets/etc.: - - vnoremap $1 `>a)` - vnoremap $2 `>a]` - vnoremap $3 `>a}` - vnoremap $$ `>a"` - vnoremap $q `>a'` - vnoremap $e `>a"` - - ### Command line mappings $q is super useful when browsing on the command line. It deletes everything until the last slash: @@ -298,27 +291,28 @@ Bash like keys for the command line: cnoremap cnoremap -Write the file as sudo (only on Unix). Super useful when you open a file and you don't have permissions to save your changes. [Vim tip](http://vim.wikia.com/wiki/Su-write): +Write the file as sudo (works only on Unix). Super useful when you open a file and you don't have permissions to save your changes. [Vim tip](http://vim.wikia.com/wiki/Su-write): :W ### Spell checking -Pressing `ss` will toggle and untoggle spell checking +Pressing `ss` will toggle spell checking: map ss :setlocal spell! -Shortcuts using `` instead of special chars +Shortcuts using `` instead of special characters: map sn ]s map sp [s map sa zg map s? z= -### Cope -Do :help cope if you are unsure what cope is. It's super useful! -When you search with vimgrep, display your results in cope by doing: +### Cope +Query `:help cope` if you are unsure what cope is. It's super useful! + +When you search with `Ack.vim`, display your results in cope by doing: `cc` To go to the next search result do: @@ -327,15 +321,15 @@ To go to the next search result do: To go to the previous search results do: `p` -Vimscript mappings: +Cope mappings: map cc :botright cope map co ggVGy:tabnew:set syntax=qfpgg map n :cn map p :cp -## How to uninstall -Do following: -* Remove `~/.vim_runtime` -* Remove any lines that refernce `.vim_runtime` in your `~/.vimrc` +## How to uninstall +Just do following: +* Remove `~/.vim_runtime` +* Remove any lines that reference `.vim_runtime` in your `~/.vimrc` diff --git a/install_awesome_vimrc.sh b/install_awesome_vimrc.sh index 3a67c6ee..57bf5af1 100644 --- a/install_awesome_vimrc.sh +++ b/install_awesome_vimrc.sh @@ -1,3 +1,6 @@ +#!/bin/sh +set -e + cd ~/.vim_runtime echo 'set runtimepath+=~/.vim_runtime diff --git a/install_basic_vimrc.sh b/install_basic_vimrc.sh index 3478144d..6b3142d1 100644 --- a/install_basic_vimrc.sh +++ b/install_basic_vimrc.sh @@ -1,3 +1,6 @@ +#!/bin/sh +set -e + cd ~/.vim_runtime cat ~/.vim_runtime/vimrcs/basic.vim > ~/.vimrc echo "Installed the Basic Vim configuration successfully! Enjoy :-)" diff --git a/my_configs.vim b/my_configs.vim index 18182ffd..51c09956 100644 --- a/my_configs.vim +++ b/my_configs.vim @@ -45,6 +45,7 @@ let g:syntastic_python_checkers = ['flake8'] " 修改检查器的地方 " let g:syntastic_python_python_exec = 'path/to/python3' " display all of the errors from all of the checkers together let g:syntastic_aggregate_errors = 1 +let g:syntastic_html_checkers=[''] " mapping move focus to tab* use: ,t1 ,t2 ... map t1 :tabnext 1 @@ -108,10 +109,13 @@ augroup END " if use gvim then change guifont if has('gui_running') - set guifont=Lucida_Console:h12 + set guifont=Source\ Code\ Pro\ for\ Powerline:h12 endif " map $t to <> vnoremap $t `>a>` inoremap $t <>i +set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936,big5,euc-jp,euc-kr,latin1 +set encoding=utf-8 + diff --git a/my_plugins/.gitkeep b/my_plugins/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/sources_non_forked/ack.vim/README.md b/sources_non_forked/ack.vim/README.md index af8f522d..fca907fa 100644 --- a/sources_non_forked/ack.vim/README.md +++ b/sources_non_forked/ack.vim/README.md @@ -2,22 +2,22 @@ Run your favorite search tool from Vim, with an enhanced results list. -This plugin was designed as a Vim frontend for the Perl module [App::Ack]. Ack -can be used as a replacement for 99% of the uses of _grep_. The plugin allows -you to run ack from Vim, and shows the results in a split window. +This plugin was designed as a Vim frontend for the programmer's search tool +[ack]. ack can be used as a replacement for 99% of the uses of `grep`. The +plugin allows you to search with ack from within Vim and shows the results in a +split window. But here's a little secret for the Vim-seasoned: it's just a light wrapper for Vim's [grepprg] and the [quickfix] window for match results. This makes it easy to integrate with your own Vim configuration and use existing knowledge of core features. It also means the plugin is flexible to use with other search tools. -[App::Ack]: http://search.cpan.org/~petdance/ack/ack [grepprg]: http://vimdoc.sourceforge.net/htmldoc/options.html#'grepprg' [quickfix]: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#quickfix ## Installation -### Ack +### ack You will need ack (>= 2.0), of course. To install it follow the [manual](http://beyondgrep.com/install/). @@ -49,8 +49,6 @@ NeoBundle 'mileszs/ack.vim' [Download][releases] the plugin and extract it in `~/.vim/` (or `%PROGRAMFILES%/Vim/vimfiles` on Windows). -[zipball]: https://github.com/mileszs/ack.vim/archive/master.zip - ## Usage :Ack [options] {pattern} [{directories}] @@ -60,7 +58,7 @@ for the `{pattern}`. Files containing the search term will be listed in the quickfix window, along with the line number of the occurrence, once for each occurrence. `` on -a line in this window will open the file, and place the cursor on the matching +a line in this window will open the file and place the cursor on the matching line. Just like where you use `:grep`, `:grepadd`, `:lgrep`, and :`lgrepadd`, you can @@ -78,9 +76,9 @@ The quickfix results window is augmented with these convenience mappings: ? a quick summary of these keys, repeat to close o to open (same as Enter) O to open and close the quickfix window - go to preview file, open but maintain focus on ack.vim results + go to preview file, keeping focus on the results t to open in new tab - T to open in new tab without moving to it + T to open in new tab, keeping focus on the results h to open in horizontal split H to open in horizontal split, keeping focus on the results v to open in vertical split @@ -140,22 +138,22 @@ the convention of Vim's built-in `:grep` and `:make` commands. ## Changelog -Please see [the Github releases page][releases]. +Please see [the GitHub releases page][releases]. ## Credits -This plugin is derived from Antoine Imbert's blog post [Ack and Vim +This plugin is derived from Antoine Imbert's blog post [ack and Vim Integration][] (in particular, the function in the update to the post). [Miles Sterrett][mileszs] packaged it up as a plugin and documented it in Vim's help format, and since then [many contributors][contributors] have submitted enhancements and fixes. -And of course, where would we be without [Ack]. And, you know, Vim. +And of course, where would we be without [ack]. And, you know, Vim. -[Ack and Vim Integration]: http://blog.ant0ine.com/typepad/2007/03/ack-and-vim-integration.html +[ack and Vim Integration]: http://blog.ant0ine.com/typepad/2007/03/ack-and-vim-integration.html [mileszs]: https://github.com/mileszs [contributors]: https://github.com/mileszs/ack.vim/graphs/contributors -[Ack]: http://beyondgrep.com/ +[ack]: http://beyondgrep.com/ [vim-dispatch]: https://github.com/tpope/vim-dispatch [releases]: https://github.com/mileszs/ack.vim/releases diff --git a/sources_non_forked/ag.vim/.gitignore b/sources_non_forked/ag.vim/.gitignore deleted file mode 100644 index e350eccf..00000000 --- a/sources_non_forked/ag.vim/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -tags -ag-vim.tgz diff --git a/sources_non_forked/ag.vim/README.md b/sources_non_forked/ag.vim/README.md deleted file mode 100644 index e02a4d3e..00000000 --- a/sources_non_forked/ag.vim/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# ag.vim # - -## Deprecated: See [this comment](https://github.com/rking/ag.vim/issues/124#issuecomment-227038003) for more info. Maybe try [ack.vim](https://github.com/mileszs/ack.vim#can-i-use-ag-the-silver-searcher-with-this) as an alternative. ## - -This plugin is a front for ag, A.K.A. -[the_silver_searcher](https://github.com/ggreer/the_silver_searcher). Ag can -be used as a replacement for 153% of the uses of `ack`. This plugin will allow -you to run ag from vim, and shows the results in a split window. - -## Installation ## - -See [the_silver_searcher's README](https://github.com/ggreer/the_silver_searcher#installing) for its installation instructions (if you haven't installed it already). - -You have to first install [ag](https://github.com/ggreer/the_silver_searcher), itself. On Mac+Homebrew, Gentoo Linux, several others, there's package named `the_silver_searcher`, but if your OS/distro don't have one, the GitHub repo installs fine: - -Vim has various ways of installing plugins, the standard way is in [the documentation](http://vimdoc.sourceforge.net/htmldoc/usr_05.html#plugin), but most people use a plugin to manage their plugins. If you don't already have a preferred plugin manager plugin, why not try one of the following? -- [vim-plug](https://github.com/junegunn/vim-plug#readme) -- [vim-pathogen](https://github.com/tpope/vim-pathogen#readme) -- [Vundle.vim](https://github.com/gmarik/Vundle.vim#readme) -- Or, if you don't use any sort of Vim plugin management: - - ```sh - cd ~/.vim/bundle && git clone https://github.com/rking/ag.vim ag && echo "set runtimepath^=~/.vim/bundle/ag" >> ~/.vimrc - ``` - - Then open vim and run `:helptags ~/.vim/bundle/ag/doc`. - -### Configuration ### - -You can specify a custom ag name and path in your .vimrc like so: - - let g:ag_prg=" --vimgrep" - -You can configure ag.vim to always start searching from your project root -instead of the cwd - - let g:ag_working_path_mode="r" - -## Usage ## - - :Ag [options] {pattern} [{directory}] - -Search recursively in {directory} (which defaults to the current directory) for the {pattern}. - -Files containing the search term will be listed in the split window, along with -the line number of the occurrence, once for each occurrence. [Enter] on a line -in this window will open the file, and place the cursor on the matching line. - -Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use `:Ag`, `:AgAdd`, `:LAg`, and `:LAgAdd` respectively. (See `doc/ag.txt`, or install and `:h Ag` for more information.) - -### Gotchas ### - -Some characters have special meaning, and need to be escaped your search pattern. For instance, '#'. You have to escape it like this `:Ag '\\\#define foo'` to search for `#define foo`. (From [blueyed in issue #5](https://github.com/mileszs/ack.vim/issues/5).) - -Sometimes `git grep` is even faster, though in my experience it's not noticeably so. - -### Keyboard Shortcuts ### - -In the quickfix window, you can use: - - e to open file and close the quickfix window - o to open (same as enter) - go to preview file (open but maintain focus on ag.vim results) - t to open in new tab - T to open in new tab silently - h to open in horizontal split - H to open in horizontal split silently - v to open in vertical split - gv to open in vertical split silently - q to close the quickfix window - -### Related Plugin ### -[vim-ag-anything](https://github.com/Chun-Yang/vim-ag-anything) adds an 'ga' action to search any text object. - -### Acknowledgements ### - -This Vim plugin is derived (and by derived, I mean copied, almost entirely) -from [milesz's ack.vim](https://github.com/mileszs/ack.vim), which I also -recommend installing since you might be in a situation where you have ack but -not ag, and don't want to stop to install ag. Also, ack supports `--type`, and -a few other features. diff --git a/sources_non_forked/ag.vim/Rakefile b/sources_non_forked/ag.vim/Rakefile deleted file mode 100644 index e6bb6da7..00000000 --- a/sources_non_forked/ag.vim/Rakefile +++ /dev/null @@ -1,3 +0,0 @@ -task :tgz do - sh 'cd ..; tar czvf ag/ag-vim.tgz ag/{plugin,autoload,doc}' -end diff --git a/sources_non_forked/ag.vim/autoload/ag.vim b/sources_non_forked/ag.vim/autoload/ag.vim deleted file mode 100644 index 432ef444..00000000 --- a/sources_non_forked/ag.vim/autoload/ag.vim +++ /dev/null @@ -1,234 +0,0 @@ -" NOTE: You must, of course, install ag / the_silver_searcher - -" FIXME: Delete deprecated options below on or after 2016-4 (6 months from when the deprecation warning was added) {{{ - -if exists("g:agprg") - let g:ag_prg = g:agprg - echohl WarningMsg - call input('g:agprg is deprecated and will be removed. Please use g:ag_prg') - echohl None -endif - -if exists("g:aghighlight") - let g:ag_highlight = g:aghighlight - echohl WarningMsg - call input('g:aghighlight is deprecated and will be removed. Please use g:ag_highlight') - echohl None -endif - -if exists("g:agformat") - let g:ag_format = g:agformat - echohl WarningMsg - call input('g:agformat is deprecated and will be removed. Please use g:ag_format') - echohl None -endif - -" }}} FIXME: Delete the deprecated options above on or after 15-7 (6 months from when they were changed) - -" Location of the ag utility -if !exists("g:ag_prg") - " --vimgrep (consistent output we can parse) is available from version 0.25.0+ - if split(system("ag --version"), "[ \n\r\t]")[2] =~ '\d\+.\(\(2[5-9]\)\|\([3-9][0-9]\)\)\(.\d\+\)\?' - let g:ag_prg="ag --vimgrep" - else - " --noheading seems odd here, but see https://github.com/ggreer/the_silver_searcher/issues/361 - let g:ag_prg="ag --column --nogroup --noheading" - endif -endif - -if !exists("g:ag_apply_qmappings") - let g:ag_apply_qmappings=1 -endif - -if !exists("g:ag_apply_lmappings") - let g:ag_apply_lmappings=1 -endif - -if !exists("g:ag_qhandler") - let g:ag_qhandler="botright copen" -endif - -if !exists("g:ag_lhandler") - let g:ag_lhandler="botright lopen" -endif - -if !exists("g:ag_mapping_message") - let g:ag_mapping_message=1 -endif - -if !exists("g:ag_working_path_mode") - let g:ag_working_path_mode = 'c' -endif - -function! ag#AgBuffer(cmd, args) - let l:bufs = filter(range(1, bufnr('$')), 'buflisted(v:val)') - let l:files = [] - for buf in l:bufs - let l:file = fnamemodify(bufname(buf), ':p') - if !isdirectory(l:file) - call add(l:files, l:file) - endif - endfor - call ag#Ag(a:cmd, a:args . ' ' . join(l:files, ' ')) -endfunction - -function! ag#Ag(cmd, args) - let l:ag_executable = get(split(g:ag_prg, " "), 0) - - " Ensure that `ag` is installed - if !executable(l:ag_executable) - echoe "Ag command '" . l:ag_executable . "' was not found. Is the silver searcher installed and on your $PATH?" - return - endif - - " If no pattern is provided, search for the word under the cursor - if empty(a:args) - let l:grepargs = expand("") - else - let l:grepargs = a:args . join(a:000, ' ') - end - - if empty(l:grepargs) - echo "Usage: ':Ag {pattern}' (or just :Ag to search for the word under the cursor). See ':help :Ag' for more information." - return - endif - - " Format, used to manage column jump - if a:cmd =~# '-g$' - let s:ag_format_backup=g:ag_format - let g:ag_format="%f" - elseif exists("s:ag_format_backup") - let g:ag_format=s:ag_format_backup - elseif !exists("g:ag_format") - let g:ag_format="%f:%l:%c:%m" - endif - - let l:grepprg_bak=&grepprg - let l:grepformat_bak=&grepformat - let l:t_ti_bak=&t_ti - let l:t_te_bak=&t_te - try - let &grepprg=g:ag_prg - let &grepformat=g:ag_format - set t_ti= - set t_te= - if g:ag_working_path_mode ==? 'r' " Try to find the projectroot for current buffer - let l:cwd_back = getcwd() - let l:cwd = s:guessProjectRoot() - try - exe "lcd ".l:cwd - catch - echom 'Failed to change directory to:'.l:cwd - finally - silent! execute a:cmd . " " . escape(l:grepargs, '|') - exe "lcd ".l:cwd_back - endtry - else " Someone chose an undefined value or 'c' so we revert to the default - silent! execute a:cmd . " " . escape(l:grepargs, '|') - endif - finally - let &grepprg=l:grepprg_bak - let &grepformat=l:grepformat_bak - let &t_ti=l:t_ti_bak - let &t_te=l:t_te_bak - endtry - - if a:cmd =~# '^l' - let l:match_count = len(getloclist(winnr())) - else - let l:match_count = len(getqflist()) - endif - - if a:cmd =~# '^l' && l:match_count - exe g:ag_lhandler - let l:apply_mappings = g:ag_apply_lmappings - let l:matches_window_prefix = 'l' " we're using the location list - elseif l:match_count - exe g:ag_qhandler - let l:apply_mappings = g:ag_apply_qmappings - let l:matches_window_prefix = 'c' " we're using the quickfix window - endif - - " If highlighting is on, highlight the search keyword. - if exists('g:ag_highlight') - let @/ = matchstr(a:args, "\\v(-)\@", 'n') - end - - redraw! - - if l:match_count - if l:apply_mappings - nnoremap h K - nnoremap H Kb - nnoremap o - nnoremap t T - nnoremap T TgT - nnoremap v HbJt - - exe 'nnoremap e :' . l:matches_window_prefix .'close' - exe 'nnoremap go :' . l:matches_window_prefix . 'open' - exe 'nnoremap q :' . l:matches_window_prefix . 'close' - - exe 'nnoremap gv :let b:height=winheight(0)H:' . l:matches_window_prefix . 'openJ:exe printf(":normal %d\c-w>_", b:height)' - " Interpretation: - " :let b:height=winheight(0) Get the height of the quickfix/location list window - " Open the current item in a new split - " H Slam the newly opened window against the left edge - " :copen -or- :lopen Open either the quickfix window or the location list (whichever we were using) - " J Slam the quickfix/location list window against the bottom edge - " :exe printf(":normal %d\c-w>_", b:height) Restore the quickfix/location list window's height from before we opened the match - - if g:ag_mapping_message && l:apply_mappings - echom "ag.vim keys: q=quit /e/t/h/v=enter/edit/tab/split/vsplit go/T/H/gv=preview versions of same" - endif - endif - else " Close the split window automatically: - cclose - lclose - echohl WarningMsg - echom 'No matches for "'.a:args.'"' - echohl None - endif -endfunction - -function! ag#AgFromSearch(cmd, args) - let search = getreg('/') - " translate vim regular expression to perl regular expression. - let search = substitute(search,'\(\\<\|\\>\)','\\b','g') - call ag#Ag(a:cmd, '"' . search .'" '. a:args) -endfunction - -function! ag#GetDocLocations() - let dp = '' - for p in split(&runtimepath,',') - let p = p.'doc/' - if isdirectory(p) - let dp = p.'*.txt '.dp - endif - endfor - return dp -endfunction - -function! ag#AgHelp(cmd,args) - let args = a:args.' '.ag#GetDocLocations() - call ag#Ag(a:cmd,args) -endfunction - -function! s:guessProjectRoot() - let l:splitsearchdir = split(getcwd(), "/") - - while len(l:splitsearchdir) > 2 - let l:searchdir = '/'.join(l:splitsearchdir, '/').'/' - for l:marker in ['.rootdir', '.git', '.hg', '.svn', 'bzr', '_darcs', 'build.xml'] - " found it! Return the dir - if filereadable(l:searchdir.l:marker) || isdirectory(l:searchdir.l:marker) - return l:searchdir - endif - endfor - let l:splitsearchdir = l:splitsearchdir[0:-2] " Splice the list to get rid of the tail directory - endwhile - - " Nothing found, fallback to current working dir - return getcwd() -endfunction diff --git a/sources_non_forked/ag.vim/doc/ag.txt b/sources_non_forked/ag.vim/doc/ag.txt deleted file mode 100644 index e702c291..00000000 --- a/sources_non_forked/ag.vim/doc/ag.txt +++ /dev/null @@ -1,174 +0,0 @@ -*ag.txt* Plugin that integrates ag with Vim - -============================================================================== -INTRODUCTION *ag* - -This plugin is a front for the_silver_searcher: ag. Ag can be used as a -replacement for ack. This plugin will allow you to run ag from vim, and shows -the results in a split window. - -:Ag[!] [options] {pattern} [{directory}] *:Ag* - - Search recursively in {directory} (which defaults to the current - directory) for the {pattern}. Behaves just like the |:grep| command, but - will open the |Quickfix| window for you. If [!] is not given the first - error is jumped to. - -:AgBuffer[!] [options] {pattern} *:AgBuffer* - - Search for {pattern} in all open buffers. Behaves just like the |:grep| - command, but will open the |Quickfix| window for you. If [!] is not given - the first error is jumped to. - - Note: this will not find changes in modified buffers, since ag can only - find what is on disk! You can save buffers automatically when searching - with the 'autowrite' option. A buffer will be ignored if it is a directory - (an explorer, like netrw). - -:AgAdd [options] {pattern} [{directory}] *:AgAdd* - - Just like |:Ag|, but instead of making a new list, the matches are - appended to the current |quickfix| list. - -:AgFromSearch [{directory}] *:AgFromSearch* - - Just like |:Ag| but the pattern is from previous search. - -:LAg [options] {pattern} [{directory}] *:LAg* - - Just like |:Ag| but instead of the |quickfix| list, matches are placed in - the current |location-list|. - -:LAgBuffer [options] {pattern} *:LAgBuffer* - - Just like |:AgBuffer| but instead of the |quickfix| list, matches are - placed in the current |location-list|. - -:LAgAdd [options] {pattern} [{directory}] *:LAgAdd* - - Just like |:AgAdd| but instead of the |quickfix| list, matches are added - to the current |location-list| - -:AgFile [options] {pattern} [{directory}] *:AgFile* - - Search recursively in {directory} (which defaults to the current - directory) for filenames matching the {pattern}. Behaves just like the - |:grep| command, but will open the |Quickfix| window for you. - -:AgHelp[!] [options] {pattern} *:AgHelp* - - Search vim documentation files for the {pattern}. Behaves just like the - |:Ag| command, but searches only vim documentation .txt files - -:LAgHelp [options] {pattern} *:LAgHelp* - - Just like |:AgHelp| but instead of the |quickfix| list, matches are placed - in the current |location-list|. - -Files containing the search term will be listed in the split window, along -with the line number of the occurrence, once for each occurrence. on a -line in this window will open the file, and place the cursor on the matching -line. - -See http://geoff.greer.fm/2011/12/27/the-silver-searcher-better-than-ack/ for -more information. - -============================================================================== -OPTIONS *ag-options* - - *g:ag_prg* -The location of the Ag program, and any options you want passed to it before -searching. Default: "ag --vimgrep" (for parsable output). Example: > - let g:ag_prg="ag --vimgrep --smart-case" -< -Note: the `--vimgrep` option was added in Ag 0.25.0. If ag.vim detects that -you're using a lower version, the following default will be used instead: > - let g:ag_prg="ag --column --nogroup --noheading" -< -This works around inconsistent behaviors in earlier Ag versions, but it is -recommended that you upgrade if possible for a better experience. `--vimgrep` -supports multiple matches on the same line of text, for example. - -For background, see: https://github.com/rking/ag.vim/pull/88 - - *g:ag_working_path_mode* -A mapping that describes where ag will be run. Default is the current working -directory. Specifying 'r' as the argument will tell it to run from the project -rootdirectory. For now any other mapping will result to the default. -Example: - let g:ag_working_path_mode='r' - - *g:ag_highlight* -If 1, highlight the search terms after searching. Default: 0. Example: > - let g:ag_highlight=1 -< - - *g:ag_format* -Format to recognize the matches. See 'errorformat' for more info. Default: -"%f" when searching for files, "%f:%l:%c:%m" if not otherwise set. For -example, if your `g:ag_prg` is set to just "ag" (no column numbers in the -output, so when you jump to a match your cursor will be on the start of the -line): > - let g:ag_format="%f:%l:%m" -< - - *g:ag_apply_lmappings* -Whether or not to add custom mappings to location list windows opened by this -plugin. Only applies if you're using the location list. Default 1. Example: > - let g:ag_apply_lmappings=0 -< - - *g:ag_apply_qmappings* -Whether or not to add custom mappings to quickfix windows opened by this -plugin. Only applies if you're using the error list. Default 1. Example: > - let g:ag_apply_qmappings=0 -< - - *g:ag_lhandler* -A custom command used to open the location list after it's populated. -Default: "botright lopen". You might want to set this to change where the -location list is opened, or what size it is. Example: > - let g:ag_lhandler="topleft lopen" -< - - *g:ag_qhandler* -A custom command used to open the error list after it's populated. Default: -"botright copen". You might want to set this to change where the quickfix -window is opened, or what size it is. Example: > - let g:ag_qhandler="copen 20" -< - - *g:ag_mapping_message* -Whether or not to show the message explaining the extra mappings that are -added to the results list this plugin populates. This message is not shown if -the mappings are not applied (see |g:ag_apply_qmappings| and -|g:ag_apply_lmappings| for more info. Default 1. Example: > - let g:ag_mapping_message=0 -< - -============================================================================== -MAPPINGS *ag-mappings* - -The following keyboard shortcuts are available in the quickfix window: - -e open file and close the quickfix window. - -o open file (same as enter). - -go preview file (open but maintain focus on ag.vim results). - -t open in a new tab. - -T open in new tab silently. - -h open in horizontal split. - -H open in horizontal split silently. - -v open in vertical split. - -gv open in vertical split silently. - -q close the quickfix window. - - vim:tw=78:fo=tcq2:ft=help:norl: diff --git a/sources_non_forked/ag.vim/plugin/ag.vim b/sources_non_forked/ag.vim/plugin/ag.vim deleted file mode 100644 index 053f213c..00000000 --- a/sources_non_forked/ag.vim/plugin/ag.vim +++ /dev/null @@ -1,11 +0,0 @@ -" NOTE: You must, of course, install ag / the_silver_searcher -command! -bang -nargs=* -complete=file Ag call ag#Ag('grep',) -command! -bang -nargs=* -complete=file AgBuffer call ag#AgBuffer('grep',) -command! -bang -nargs=* -complete=file AgAdd call ag#Ag('grepadd', ) -command! -bang -nargs=* -complete=file AgFromSearch call ag#AgFromSearch('grep', ) -command! -bang -nargs=* -complete=file LAg call ag#Ag('lgrep', ) -command! -bang -nargs=* -complete=file LAgBuffer call ag#AgBuffer('lgrep',) -command! -bang -nargs=* -complete=file LAgAdd call ag#Ag('lgrepadd', ) -command! -bang -nargs=* -complete=file AgFile call ag#Ag('grep -g', ) -command! -bang -nargs=* -complete=help AgHelp call ag#AgHelp('grep',) -command! -bang -nargs=* -complete=help LAgHelp call ag#AgHelp('lgrep',) diff --git a/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim b/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim index fc8b8830..de60d77a 100644 --- a/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim +++ b/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim @@ -303,7 +303,6 @@ fu! s:match_window_opts() let s:mw_res = \ s:mw =~ 'results:[^,]\+' ? str2nr(matchstr(s:mw, 'results:\zs\d\+')) \ : min([s:mw_max, &lines]) - let s:mw_res = max([s:mw_res, 1]) endf "}}}1 " * Open & Close {{{1 @@ -570,9 +569,14 @@ endf fu! s:MatchedItems(items, pat, limit) let exc = exists('s:crfilerel') ? s:crfilerel : '' let items = s:narrowable() ? s:matched + s:mdata[3] : a:items - if s:matcher != {} + let matcher = s:getextvar('matcher') + if empty(matcher) || type(matcher) != 4 || !has_key(matcher, 'match') + unlet matcher + let matcher = s:matcher + en + if matcher != {} let argms = - \ has_key(s:matcher, 'arg_type') && s:matcher['arg_type'] == 'dict' ? [{ + \ has_key(matcher, 'arg_type') && matcher['arg_type'] == 'dict' ? [{ \ 'items': items, \ 'str': a:pat, \ 'limit': a:limit, @@ -581,7 +585,7 @@ fu! s:MatchedItems(items, pat, limit) \ 'crfile': exc, \ 'regex': s:regexp, \ }] : [items, a:pat, a:limit, s:mmode(), s:ispath, exc, s:regexp] - let lines = call(s:matcher['match'], argms, s:matcher) + let lines = call(matcher['match'], argms, matcher) el let lines = s:MatchIt(items, a:pat, a:limit, exc) en @@ -1197,7 +1201,7 @@ fu! s:AcceptSelection(action) let type = exttype == 'dict' ? exttype : 'list' en en - let actargs = type == 'dict' ? [{ 'action': md, 'line': line, 'icr': icr }] + let actargs = type == 'dict' ? [{ 'action': md, 'line': line, 'icr': icr, 'input': str}] \ : [md, line] cal call(actfunc, actargs) endf @@ -1764,6 +1768,7 @@ fu! ctrlp#setpathmode(pmode, ...) let spath = a:0 ? a:1 : s:crfpath let markers = ['.git', '.hg', '.svn', '.bzr', '_darcs'] if type(s:rmarkers) == 3 && !empty(s:rmarkers) + if s:findroot(spath, s:rmarkers, 0, 0) != [] | retu 1 | en cal filter(markers, 'index(s:rmarkers, v:val) < 0') let markers = s:rmarkers + markers en @@ -1873,6 +1878,11 @@ fu! s:highlight(pat, grp) en cal matchadd('CtrlPLinePre', '^>') + elseif !empty(a:pat) && s:regexp && + \ exists('g:ctrlp_regex_always_higlight') && + \ g:ctrlp_regex_always_higlight + let pat = substitute(a:pat, '\\\@ \\zs', 'g') + cal matchadd(a:grp, ( s:martcs == '' ? '\c' : '\C').pat) en endf @@ -1995,9 +2005,14 @@ fu! s:bufnrfilpath(line) en let filpath = fnamemodify(filpath, ':p') let bufnr = bufnr('^'.filpath.'$') - if (a:line =~ '[\/]\?\[\d\+\*No Name\]$' && !filereadable(filpath) && bufnr < 1) - let bufnr = str2nr(matchstr(a:line, '[\/]\?\[\zs\d\+\ze\*No Name\]$')) - let filpath = bufnr + if (!filereadable(filpath) && bufnr < 1) + if (a:line =~ '[\/]\?\[\d\+\*No Name\]$') + let bufnr = str2nr(matchstr(a:line, '[\/]\?\[\zs\d\+\ze\*No Name\]$')) + let filpath = bufnr + else + let bufnr = bufnr(a:line) + retu [bufnr, a:line] + en en retu [bufnr, filpath] endf @@ -2300,7 +2315,7 @@ fu! s:lastvisual() let cview = winsaveview() let [ovreg, ovtype] = [getreg('v'), getregtype('v')] let [oureg, outype] = [getreg('"'), getregtype('"')] - sil! norm! gv"vy + sil! norm! gV"vy let selected = s:regisfilter('v') cal setreg('v', ovreg, ovtype) cal setreg('"', oureg, outype) @@ -2380,7 +2395,7 @@ endf fu! s:matchbuf(item, pat) let bufnr = s:bufnrfilpath(a:item)[0] let parts = s:bufparts(bufnr) - let item = bufnr.parts[0].parts[2].s:lash().parts[3] + let item = s:byfname ? parts[2] : bufnr.parts[0].parts[2].s:lash().parts[3] retu match(item, a:pat) endf @@ -2489,7 +2504,9 @@ endf fu! s:getextvar(key) if s:itemtype >= len(s:coretypes) && len(g:ctrlp_ext_vars) > 0 let vars = g:ctrlp_ext_vars[s:itemtype - len(s:coretypes)] - retu has_key(vars, a:key) ? vars[a:key] : -1 + if has_key(vars, a:key) + retu vars[a:key] + en en retu get(g:, 'ctrlp_' . s:matchtype . '_' . a:key, -1) endf diff --git a/sources_non_forked/ctrlp.vim/autoload/ctrlp/buffertag.vim b/sources_non_forked/ctrlp.vim/autoload/ctrlp/buffertag.vim index 7894f3f2..f36a5cfc 100644 --- a/sources_non_forked/ctrlp.vim/autoload/ctrlp/buffertag.vim +++ b/sources_non_forked/ctrlp.vim/autoload/ctrlp/buffertag.vim @@ -139,7 +139,7 @@ fu! s:exectags(cmd) endf fu! s:exectagsonfile(fname, ftype) - let [ags, ft] = ['-f - --sort=no --excmd=pattern --fields=nKs --extra= ', a:ftype] + let [ags, ft] = ['-f - --sort=no --excmd=pattern --fields=nKs --extra= --file-scope=yes ', a:ftype] if type(s:types[ft]) == 1 let ags .= s:types[ft] let bin = s:bin diff --git a/sources_non_forked/ctrlp.vim/autoload/ctrlp/line.vim b/sources_non_forked/ctrlp.vim/autoload/ctrlp/line.vim index 5bec47ee..b6bbe013 100644 --- a/sources_non_forked/ctrlp.vim/autoload/ctrlp/line.vim +++ b/sources_non_forked/ctrlp.vim/autoload/ctrlp/line.vim @@ -13,6 +13,7 @@ let g:loaded_ctrlp_line = 1 cal add(g:ctrlp_ext_vars, { \ 'init': 'ctrlp#line#init(s:crbufnr)', \ 'accept': 'ctrlp#line#accept', + \ 'act_farg' : 'dict', \ 'lname': 'lines', \ 'sname': 'lns', \ 'type': 'tabe', @@ -31,7 +32,7 @@ endf " Public {{{1 fu! ctrlp#line#init(bufnr) let [lines, bufnr] = [[], exists('s:bufnr') ? s:bufnr : a:bufnr] - let bufs = exists('s:lnmode') && s:lnmode ? ctrlp#buffers('id') : [bufnr] + let bufs = exists('s:lnmode') && !empty(s:lnmode) ? ctrlp#buffers('id') : [bufnr] for bufnr in bufs let [lfb, bufn] = [getbufline(bufnr, 1, '$'), bufname(bufnr)] if lfb == [] && bufn != '' @@ -50,11 +51,17 @@ fu! ctrlp#line#init(bufnr) retu lines endf -fu! ctrlp#line#accept(mode, str) - let info = matchlist(a:str, '\t|[^|]\+|\(\d\+\):\(\d\+\)|$') +fu! ctrlp#line#accept(dict) + let mode = a:dict['action'] + let str = a:dict['line'] + let input = a:dict['input'] + let info = matchlist(str, '\t|[^|]\+|\(\d\+\):\(\d\+\)|$') let bufnr = str2nr(get(info, 1)) if bufnr - cal ctrlp#acceptfile(a:mode, bufnr, get(info, 2)) + cal ctrlp#acceptfile(mode, bufnr, get(info, 2)) + let @/ = input + call search(input, 'c') + call histadd("search", input) en endf diff --git a/sources_non_forked/ctrlp.vim/autoload/ctrlp/tag.vim b/sources_non_forked/ctrlp.vim/autoload/ctrlp/tag.vim index 31504dcc..c2294805 100644 --- a/sources_non_forked/ctrlp.vim/autoload/ctrlp/tag.vim +++ b/sources_non_forked/ctrlp.vim/autoload/ctrlp/tag.vim @@ -137,8 +137,8 @@ fu! ctrlp#tag#id() endf fu! ctrlp#tag#enter() - let tfs = tagfiles() - let s:tagfiles = tfs != [] ? filter(map(tfs, 'fnamemodify(v:val, ":p")'), + let tfs = get(g:, 'ctrlp_custom_tag_files', tagfiles()) + let s:tagfiles = type(tfs) == 3 && tfs != [] ? filter(map(tfs, 'fnamemodify(v:val, ":p")'), \ 'filereadable(v:val)') : [] endf "}}} diff --git a/sources_non_forked/ctrlp.vim/doc/ctrlp.cnx b/sources_non_forked/ctrlp.vim/doc/ctrlp.cnx index c2d69729..1f8a2ee6 100644 --- a/sources_non_forked/ctrlp.vim/doc/ctrlp.cnx +++ b/sources_non_forked/ctrlp.vim/doc/ctrlp.cnx @@ -1,4 +1,4 @@ -*ctrlp.txt* 模糊的 文件, 缓冲区, 最近最多使用, 标签, ... 检索. v1.79 +*ctrlp.txt* 支持模糊匹配的 文件, 缓冲区, 最近最多使用, 标签, ... 检索. v1.79 *CtrlP* *ControlP* *'ctrlp'* *'ctrl-p'* =============================================================================== # # @@ -68,7 +68,7 @@ OPTIONS *ctrlp-options* |ctrlp_arg_map|...............是否拦截 命令。 |ctrlp_follow_symlinks|.......是否跟随链接。 |ctrlp_lazy_update|...........停止输入时才更新。 - |ctrlp_default_input|.........为提示符面板提供一个种子。 + |ctrlp_default_input|.........为提示符面板提供一个初始字符串。 |ctrlp_abbrev|................输入缩写。 |ctrlp_key_loop|..............为多字节输入开启输入事件循环。 |ctrlp_prompt_mappings|.......改变提示符面板内部的按键绑定。 @@ -76,6 +76,7 @@ OPTIONS *ctrlp-options* |ctrlp_open_single_match|.....当只有一个候选时自动接受。 |ctrlp_brief_prompt|..........提示符为空的时候使用退出 CtrlP。 |ctrlp_match_current_file|....在匹配条目中包含当前文件。 + |ctrlp_types|.................內建类型的名称。 最近最多使用模式: |ctrlp_mruf_max|..............记录的最近最多使用的最大数据。 @@ -154,6 +155,7 @@ OPTIONS *ctrlp-options* 结果集的最大数目: results:{n} - 列出最多 {n} 条结果 (默认: 和最大高度同步). + 0代表没有限制。 注意: 当一个设置项没有被设置时,将会使用默认值。 @@ -254,7 +256,7 @@ OPTIONS *ctrlp-options* 考虑清楚。 *'g:ctrlp_custom_ignore'* -作为对 |'wildignore'| 的补充,用来设置你只是想在CtrlP中隐藏的文件和目录。使用正 +作为对 |'wildignore'| 和 |g:ctrlp_show_hidden| 的补充,用来设置你只是想在CtrlP中隐藏的文件和目录。使用正 则表达式来指定匹配模式: > let g:ctrlp_custom_ignore = '' < @@ -439,13 +441,19 @@ OPTIONS *ctrlp-options* *'g:ctrlp_match_current_file'* -在匹配条目中包含当前文件: +在匹配条目中包含当前文件: > let g:ctrlp_match_current_file = 1 默认情况下,当前文件不包含在列表中。 注意: 当使用 |g:ctrlp_match_func| 时不会应用这个选项。 + *'g:ctrlp_types'* +通过设置这个列表变量的值来定制核心类型: > + let g:ctrlp_types = ['mru', 'fil'] + +类型默认为: > + let g:ctrlp_types = ['fil', 'buf', 'mru']. *'g:ctrlp_abbrev'* 定义可以在提示面包内被扩展(内部的或者可见的)的输入缩写: > @@ -817,7 +825,8 @@ MRU mode options:~ :CtrlP [起始目录] 用文件搜索模式打开CtrlP。 - 如果没有给定参数,|g:ctrlp_working_path_mode| 会被用来决定起始目录。 + 如果没有给定参数,|g:ctrlp_working_path_mode| 会被用来决定起始目录。临时覆盖 + 这个参数 的方法见 |:CtrlPCurFile| 和 |:CtrlPCurWD| 。 在输入时你可以使用 自动补全[起始目录]。 @@ -825,6 +834,16 @@ MRU mode options:~ :CtrlPBuffer 用缓冲区搜索模式打开CtrlP。 + *:CtrlPCurFile* +:CtrlPCurFile + 行为类似变量 |g:ctrlp_working_path_mode| = '' 时执行 |:CtrlP| ,忽略这个变量 + 现在的值。 + + *:CtrlPCurWD* +:CtrlPCurWD + 行为类似变量 |g:ctrlp_working_path_mode| = '' 时执行 |:CtrlP| ,忽略这个变量 + 现在的值。 + *:CtrlPMRU* :CtrlPMRU 用最近最多使用模式打开CtrlP。 @@ -1259,7 +1278,8 @@ h) 使用?打开帮助文件。 缓冲标签模式选项:~ *'g:ctrlp_buftag_ctags_bin'* -如果ctags没有在环境变量中配置,使用该选项来指定它的位置: > +如果ctags没有在环境变量中配置,或者一个二进制ctags文件存在于 +/opt/local/bin 或 /usr/local/bin,使用该选项来指定它的位置: > let g:ctrlp_buftag_ctags_bin = '' < @@ -1411,6 +1431,31 @@ Git 仓库: https://github.com/ctrlpvim/ctrlp.vim =============================================================================== 更新日志 *ctrlp-changelog* + * 新选项 |g:ctrlp_custom_tag_files| 用来指定自定义的标签文件。 + * 设置 g:ctrlp_match_window 为0来不限制窗口大小 + +Before 2016/11/28~ + + + 新命令: |YankLine()| 来复制整个文件。 + + 新选项: |g:ctrlp_types| 来选择內建类型。 + + 新特性: 异步在新线程中调用 |g:ctrlp_user_command| 。 设置 + |g:user_command_async| 为1来启用。 + + 为 delphi, rust 和 golang提供buffertag支持。 + + 新选项: |g:ctrlp_brief_prompt|, + |g:match_current_file|, + |g:ctrlp_compare_lim|. + + 新功能: 自动忽略扩展。 + + 为 ant, tex, dosbatch, matlab 和 vhdl提供buffertag支持。 + + 新选项 |g:ctrlp_line_prefix| 来结合第三方插件。 + + 新选项 |g:open_single_match| 在 matches 中打开单个文件。 + + 添加启动方式 (ctrlp) 。 + + 接受 bang for CtrlPBookmarkDirAdd 来避免确认。 + + 处理像 "g:ctrlp_TYPE_MODE" 大小写混合的变量名。 + 例如: let g:ctrlp_path_sort + + 新选项: |g:ctrlp_custom_ancestors| + +在2014/08/08之前~ + + 新的支持高亮的缓冲区浏览模式 (建议 |+conceal|) + 新选项: |g:ctrlp_bufname_mod|, |g:ctrlp_bufpath_mod| diff --git a/sources_non_forked/ctrlp.vim/doc/ctrlp.txt b/sources_non_forked/ctrlp.vim/doc/ctrlp.txt index 1107497b..455e368c 100644 --- a/sources_non_forked/ctrlp.vim/doc/ctrlp.txt +++ b/sources_non_forked/ctrlp.vim/doc/ctrlp.txt @@ -148,6 +148,7 @@ The minimum and maximum heights: The maximum number of results: results:{n} - list maximum {n} results (default: sync with max height). + 0 mean no-limit. Note: When a setting isn't set, its default value will be used. @@ -847,7 +848,7 @@ Example: > When this is set to 1, the on empty prompt exit CtrlP. *ctrlp-default-value* -Otherwize, you can use below to change default value. +Otherwise, you can use below to change default value. Example: > let g:ctrlp_path_nolim = 1 @@ -1497,6 +1498,9 @@ Special thanks:~ =============================================================================== CHANGELOG *ctrlp-changelog* + * New option |g:ctrlp_custom_tag_files| to specify custom tag files. + * Accept 0 for g:ctrlp_match_window no-limited window size. + Before 2016/11/28~ + New command: |YankLine()| to yank current line. diff --git a/sources_non_forked/ctrlp.vim/doc/tags-cn b/sources_non_forked/ctrlp.vim/doc/tags-cn index 4ec0e5f9..9fb859fd 100644 --- a/sources_non_forked/ctrlp.vim/doc/tags-cn +++ b/sources_non_forked/ctrlp.vim/doc/tags-cn @@ -52,6 +52,7 @@ 'g:ctrlp_switch_buffer' ctrlp.cnx /*'g:ctrlp_switch_buffer'* 'g:ctrlp_tabpage_position' ctrlp.cnx /*'g:ctrlp_tabpage_position'* 'g:ctrlp_tilde_homedir' ctrlp.cnx /*'g:ctrlp_tilde_homedir'* +'g:ctrlp_types' ctrlp.cnx /*'g:ctrlp_types'* 'g:ctrlp_use_caching' ctrlp.cnx /*'g:ctrlp_use_caching'* 'g:ctrlp_user_command' ctrlp.cnx /*'g:ctrlp_user_command'* 'g:ctrlp_working_path_mode' ctrlp.cnx /*'g:ctrlp_working_path_mode'* @@ -66,6 +67,8 @@ :CtrlPChangeAll ctrlp.cnx /*:CtrlPChangeAll* :CtrlPClearAllCaches ctrlp.cnx /*:CtrlPClearAllCaches* :CtrlPClearCache ctrlp.cnx /*:CtrlPClearCache* +:CtrlPCurFile ctrlp.cnx /*:CtrlPCurFile* +:CtrlPCurWD ctrlp.cnx /*:CtrlPCurWD* :CtrlPDir ctrlp.cnx /*:CtrlPDir* :CtrlPLastMode ctrlp.cnx /*:CtrlPLastMode* :CtrlPLine ctrlp.cnx /*:CtrlPLine* diff --git a/sources_non_forked/ctrlp.vim/plugin/ctrlp.vim b/sources_non_forked/ctrlp.vim/plugin/ctrlp.vim index f31b64a2..1e56ecaf 100644 --- a/sources_non_forked/ctrlp.vim/plugin/ctrlp.vim +++ b/sources_non_forked/ctrlp.vim/plugin/ctrlp.vim @@ -39,7 +39,9 @@ if g:ctrlp_map != '' && !hasmapto('(ctrlp)') exe 'map' g:ctrlp_map '(ctrlp)' en -cal ctrlp#mrufiles#init() +if !exists('g:ctrlp_types') || index(g:ctrlp_types, 'mru') >= 0 + cal ctrlp#mrufiles#init() +en com! -bar CtrlPTag cal ctrlp#init(ctrlp#tag#id()) com! -bar CtrlPQuickfix cal ctrlp#init(ctrlp#quickfix#id()) diff --git a/sources_non_forked/goyo.vim/autoload/goyo.vim b/sources_non_forked/goyo.vim/autoload/goyo.vim index 3e014667..94216d1a 100644 --- a/sources_non_forked/goyo.vim/autoload/goyo.vim +++ b/sources_non_forked/goyo.vim/autoload/goyo.vim @@ -33,7 +33,7 @@ function! s:get_color(group, attr) endfunction function! s:set_color(group, attr, color) - let gui = a:color =~ '^#' + let gui = has('gui_running') || has('termguicolors') && &termguicolors execute printf('hi %s %s%s=%s', a:group, gui ? 'gui' : 'cterm', a:attr, a:color) endfunction @@ -122,7 +122,7 @@ function! s:tranquilize() endfunction function! s:hide_statusline() - let &l:statusline = repeat(' ', winwidth(0)) + setlocal statusline=\ endfunction function! s:hide_linenr() @@ -239,7 +239,7 @@ function! s:goyo_on(dim) set showtabline=0 set noruler set fillchars+=vert:\ - set fillchars+=stl:. + set fillchars+=stl:\ set fillchars+=stlnc:\ set sidescroll=1 set sidescrolloff=0 diff --git a/sources_non_forked/goyo.vim/doc/goyo.txt b/sources_non_forked/goyo.vim/doc/goyo.txt new file mode 100644 index 00000000..0af9e6b3 --- /dev/null +++ b/sources_non_forked/goyo.vim/doc/goyo.txt @@ -0,0 +1,170 @@ +goyo.txt goyo Last change: April 2 2017 +GOYO - TABLE OF CONTENTS *goyo* *goyo-toc* +============================================================================== + + goyo.vim (고요) + Installation + Usage + Dimension expression + Configuration + Callbacks + Inspiration + Pros. + License + +GOYO.VIM (고요) *goyo-vim* +============================================================================== + +Distraction-free writing in Vim. + +https://raw.github.com/junegunn/i/master/goyo.png + +(Color scheme: {seoul256}{1}) + +Best served with {limelight.vim}{2}. + + {1} https://github.com/junegunn/seoul256.vim + {2} https://github.com/junegunn/limelight.vim + + +INSTALLATION *goyo-installation* +============================================================================== + +Use your favorite plugin manager. + + *:PlugInstall* + + - {vim-plug}{3} + 1. Add `Plug 'junegunn/goyo.vim'` to .vimrc + 2. Run `:PlugInstall` + + {3} https://github.com/junegunn/vim-plug + + +USAGE *goyo-usage* +============================================================================== + + *:Goyo* + + - `:Goyo` + - Toggle Goyo + - `:Goyo [dimension]` + - Turn on or resize Goyo + - `:Goyo!` + - Turn Goyo off + +The window can be resized with the usual count]`, `<`, `+`, `-` +keys. + + +< Dimension expression >______________________________________________________~ + *goyo-dimension-expression* + +The expected format of a dimension expression is +`[WIDTH][XOFFSET][x[HEIGHT][YOFFSET]]`. `XOFFSET` and `YOFFSET` should be +prefixed by `+` or `-`. Each component can be given in percentage. +> + " Width + Goyo 120 + + " Height + Goyo x30 + + " Both + Goyo 120x30 + + " In percentage + Goyo 120x50% + + " With offsets + Goyo 50%+25%x50%-25% +< + +CONFIGURATION *goyo-configuration* +============================================================================== + + *g:goyo_width* *g:goyo_height* *g:goyo_linenr* + + - `g:goyo_width` (default: 80) + - `g:goyo_height` (default: 85%) + - `g:goyo_linenr` (default: 0) + + +< Callbacks >_________________________________________________________________~ + *goyo-callbacks* + +By default, {vim-airline}{4}, {vim-powerline}{5}, {powerline}{6}, +{lightline.vim}{7}, {vim-signify}{8}, and {vim-gitgutter}{9} are temporarily +disabled while in Goyo mode. + +If you have other plugins that you want to disable/enable, or if you want to +change the default settings of Goyo window, you can set up custom routines to +be triggered on `GoyoEnter` and `GoyoLeave` events. +> + function! s:goyo_enter() + silent !tmux set status off + silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z + set noshowmode + set noshowcmd + set scrolloff=999 + Limelight + " ... + endfunction + + function! s:goyo_leave() + silent !tmux set status on + silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z + set showmode + set showcmd + set scrolloff=5 + Limelight! + " ... + endfunction + + autocmd! User GoyoEnter nested call goyo_enter() + autocmd! User GoyoLeave nested call goyo_leave() +< +More examples can be found here: {Customization}{10} + + {4} https://github.com/bling/vim-airline + {5} https://github.com/Lokaltog/vim-powerline + {6} https://github.com/Lokaltog/powerline + {7} https://github.com/itchyny/lightline.vim + {8} https://github.com/mhinz/vim-signify + {9} https://github.com/airblade/vim-gitgutter + {10} https://github.com/junegunn/goyo.vim/wiki/Customization + + +INSPIRATION *goyo-inspiration* +============================================================================== + + - {LiteDFM}{11} + - {VimRoom}{12} + + {11} https://github.com/bilalq/lite-dfm + {12} http://projects.mikewest.org/vimroom/ + + +PROS. *goyo-pros* +============================================================================== + + 1. Works well with splits. Doesn't mess up with the current window arrangement + 2. Works well with popular statusline plugins + 3. Prevents accessing the empty windows around the central buffer + 4. Can be closed with any of `:q[uit]`, `:clo[se]`, `:tabc[lose]`, or `:Goyo` + 5. Can dynamically change the width of the window + 6. Adjusts its colors when color scheme is changed + 7. Realigns the window when the terminal (or window) is resized or when the size + of the font is changed + 8. Correctly hides colorcolumns and Emojis in statusline + 9. Highly customizable with callbacks + + +LICENSE *goyo-license* +============================================================================== + +MIT + + +============================================================================== +vim:tw=78:sw=2:ts=2:ft=help:norl:nowrap: diff --git a/sources_non_forked/gruvbox/CHANGELOG.md b/sources_non_forked/gruvbox/CHANGELOG.md new file mode 100644 index 00000000..90fd3a29 --- /dev/null +++ b/sources_non_forked/gruvbox/CHANGELOG.md @@ -0,0 +1,117 @@ +# Change Log + +## [Unreleased](https://github.com/morhetz/gruvbox/tree/HEAD) + +[Full Changelog](https://github.com/morhetz/gruvbox/compare/v1.3.5...HEAD) + +**Fixed bugs:** + +- Lighter background on terminal [\#8](https://github.com/morhetz/gruvbox/issues/8) + +**Closed issues:** + +- Installation issue. [\#54](https://github.com/morhetz/gruvbox/issues/54) + +- Italic font in terminal\(urxvt\) [\#49](https://github.com/morhetz/gruvbox/issues/49) + +- Unable to log in when sourcing the palette shellscript [\#48](https://github.com/morhetz/gruvbox/issues/48) + +- How can i modify multiple comment scheme [\#46](https://github.com/morhetz/gruvbox/issues/46) + +- Remove comment highlight in iterm [\#44](https://github.com/morhetz/gruvbox/issues/44) + +- Comments looking strange withing tmux [\#43](https://github.com/morhetz/gruvbox/issues/43) + +- comments are reverse-video in xterm [\#41](https://github.com/morhetz/gruvbox/issues/41) + +- What font are you using in the screenshots? [\#39](https://github.com/morhetz/gruvbox/issues/39) + +- vim-signature crashes when I use gruvbox [\#38](https://github.com/morhetz/gruvbox/issues/38) + +- Color of statusbar in inactive windows [\#37](https://github.com/morhetz/gruvbox/issues/37) + +- Go method and struct highlighting missing [\#36](https://github.com/morhetz/gruvbox/issues/36) + +- gruvbox\_256palette.sh doesn't work for Konsole [\#35](https://github.com/morhetz/gruvbox/issues/35) + +- Contrast in jekyll markdown files [\#33](https://github.com/morhetz/gruvbox/issues/33) + +- Pentadactyl Gruvbox Theme [\#32](https://github.com/morhetz/gruvbox/issues/32) + +- make vertsplit better [\#31](https://github.com/morhetz/gruvbox/issues/31) + +- Console support. [\#30](https://github.com/morhetz/gruvbox/issues/30) + +- How can I change the background color? [\#29](https://github.com/morhetz/gruvbox/issues/29) + +- Some words are not bold [\#28](https://github.com/morhetz/gruvbox/issues/28) + +- Terminal theme on base gruvbox [\#25](https://github.com/morhetz/gruvbox/issues/25) + +- Markdown has inverted colors when using \* [\#24](https://github.com/morhetz/gruvbox/issues/24) + +- how install it on mac osx [\#23](https://github.com/morhetz/gruvbox/issues/23) + +- Comments color for Terminal Vim [\#22](https://github.com/morhetz/gruvbox/issues/22) + +- Move palette files to gruvbox-generalized [\#20](https://github.com/morhetz/gruvbox/issues/20) + +- Maybe add Gruvbox Airline theme? [\#19](https://github.com/morhetz/gruvbox/issues/19) + +- For Sublime text [\#18](https://github.com/morhetz/gruvbox/issues/18) + +**Merged pull requests:** + +- Fix the 256 palette script failed login issue [\#53](https://github.com/morhetz/gruvbox/pull/53) ([jonasmalacofilho](https://github.com/jonasmalacofilho)) + +- add minimal coloring for gitcommit highlighting [\#52](https://github.com/morhetz/gruvbox/pull/52) ([daniely](https://github.com/daniely)) + +- For terminals, turn off italics by default. [\#47](https://github.com/morhetz/gruvbox/pull/47) ([ryanmjacobs](https://github.com/ryanmjacobs)) + +- Change color of vertical/horizontal seperators between split windows [\#45](https://github.com/morhetz/gruvbox/pull/45) ([deshtop](https://github.com/deshtop)) + +- Improve gruvbox with C code [\#34](https://github.com/morhetz/gruvbox/pull/34) ([gladiac](https://github.com/gladiac)) + +- Fix for linux console [\#27](https://github.com/morhetz/gruvbox/pull/27) ([vyp](https://github.com/vyp)) + +- Colors for plugin vimshell.vim [\#21](https://github.com/morhetz/gruvbox/pull/21) ([joelmo](https://github.com/joelmo)) + +## [v1.3.5](https://github.com/morhetz/gruvbox/tree/v1.3.5) (2014-03-19) + +[Full Changelog](https://github.com/morhetz/gruvbox/compare/v0.0.8...v1.3.5) + +**Implemented enhancements:** + +- Better selection colors [\#15](https://github.com/morhetz/gruvbox/issues/15) + +- When hlsearch is on, the cursor inverts the search color and not visible [\#2](https://github.com/morhetz/gruvbox/issues/2) + +**Fixed bugs:** + +- Problem with changing between dark and light on 256 color terminal [\#7](https://github.com/morhetz/gruvbox/issues/7) + +- IndentGuides coloring doesn't show up [\#1](https://github.com/morhetz/gruvbox/issues/1) + +**Closed issues:** + +- Requesting rxvt-unicode theme [\#17](https://github.com/morhetz/gruvbox/issues/17) + +- gruvbox\_256palette.sh gets reset \(gnome-terminal on Ubuntu\) [\#13](https://github.com/morhetz/gruvbox/issues/13) + +- Powerline colors [\#12](https://github.com/morhetz/gruvbox/issues/12) + +- Info necessary for making a port of this colorscheme [\#10](https://github.com/morhetz/gruvbox/issues/10) + +**Merged pull requests:** + +- Fix GNU screen detection for \*-bce [\#16](https://github.com/morhetz/gruvbox/pull/16) ([blueyed](https://github.com/blueyed)) + +- Added iTerm2 dark theme [\#11](https://github.com/morhetz/gruvbox/pull/11) ([Greduan](https://github.com/Greduan)) + +- Fix typo in Readme [\#5](https://github.com/morhetz/gruvbox/pull/5) ([ViViDboarder](https://github.com/ViViDboarder)) + +## [v0.0.8](https://github.com/morhetz/gruvbox/tree/v0.0.8) (2012-12-08) + + + +\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/sources_non_forked/gruvbox/README.md b/sources_non_forked/gruvbox/README.md new file mode 100644 index 00000000..917abdb9 --- /dev/null +++ b/sources_non_forked/gruvbox/README.md @@ -0,0 +1,110 @@ +

+ +gruvbox is heavily inspired by [badwolf][], [jellybeans][] and [solarized][]. + +Designed as a bright theme with pastel 'retro groove' colors and light/dark mode switching in the way of [solarized][]. The main focus when developing gruvbox is to keep colors easily distinguishable, contrast enough and still pleasant for the eyes. + + [badwolf]: https://github.com/sjl/badwolf + [jellybeans]: https://github.com/nanotech/jellybeans.vim + [solarized]: http://ethanschoonover.com/solarized + +Attention +--------- + +1. [Read this first](https://github.com/morhetz/gruvbox/wiki/Terminal-specific) +2. Typeface from gallery is [Fantasque Sans Mono](https://github.com/belluzj/fantasque-sans) +3. Typeface from screenshots below is [Fira Mono](http://www.carrois.com/fira-4-1/) + +Screenshots +----------- + +Refer [Gallery][] for more syntax-specific screenshots. + + [Gallery]: https://github.com/morhetz/gruvbox/wiki/Gallery + +### Dark mode + +![Screenshot Dark](http://i.imgur.com/GkIl8Fn.png) + +### Light mode + +![Screenshot Light](http://i.imgur.com/X75niEa.png) + +### Airline theme + +![Screenshot Airline](http://i.imgur.com/wRQceUR.png) + +Palette +------- + +### Dark mode + +![Palette Dark](http://i.imgur.com/wa666xg.png) + +### Light mode + +![Palette Light](http://i.imgur.com/49qKyYW.png) + +Contrast options +---------------- + +Refer [wiki section][] for contrast configuration and other options. + + [wiki section]: https://github.com/morhetz/gruvbox/wiki/Configuration#ggruvbox_contrast_dark + +![Contrast Options](http://i.imgur.com/5MSbe6T.png) + +Documentation +------------- + +Please check [wiki][] for installation details, terminal-specific setup, troubleshooting, configuration options and others. + + [wiki]: https://github.com/morhetz/gruvbox/wiki + +Features +-------- + +* Lots of style-customization options (contrast, color invertion, italics usage etc.) +* Extended filetype highlighting: Html, Xml, Vim (and ES6 with [yajs.vim](https://github.com/othree/yajs.vim)), Clojure, C, Python, JavaScript, CoffeeScript, Ruby, Objective-C, Go, Lua, MoonScript, Java, Markdown, Haskell +* Supported plugins: [EasyMotion][], [vim-sneak][], [Indent Guides][], [indentLine][], [Rainbow Parentheses][], [Airline][], [Lightline][], [GitGutter][], [Signify][], [ShowMarks][], [Signature][], [Syntastic][], [CtrlP][], [Startify][] + + [EasyMotion]: https://github.com/Lokaltog/vim-easymotion + [vim-sneak]: https://github.com/justinmk/vim-sneak + [Indent Guides]: https://github.com/nathanaelkane/vim-indent-guides + [indentLine]: https://github.com/Yggdroot/indentLine + [Rainbow Parentheses]: https://github.com/kien/rainbow_parentheses.vim + [Airline]: https://github.com/bling/vim-airline + [Lightline]: https://github.com/itchyny/lightline.vim + [GitGutter]: https://github.com/airblade/vim-gitgutter + [Signify]: https://github.com/mhinz/vim-signify + [ShowMarks]: http://www.vim.org/scripts/script.php?script_id=152 + [Signature]: https://github.com/kshenoy/vim-signature + [Syntastic]: https://github.com/scrooloose/syntastic + [CtrlP]: https://github.com/kien/ctrlp.vim + [Startify]: https://github.com/mhinz/vim-startify + +Contributions +------------- + +See [gruvbox-contrib][] repo for contributions, ports and extras. + +[gruvbox-contrib]: https://github.com/morhetz/gruvbox-contrib + +ToDo +---- + +* Filetype syntax highlighting (R, TeX, Swift, Erlang, Purescript and I'm still dissatisfied with CSS) +* Plugin support (MiniBufExplorer, Tagbar, Netrw, VimPLug) + +Self-Promotion +-------------- + +If you like gruvbox follow the repository on +[GitHub](https://github.com/morhetz/gruvbox) and vote for it on +[vim.org](http://www.vim.org/scripts/script.php?script_id=4349). + +License +------- +[MIT/X11][] + + [MIT/X11]: https://en.wikipedia.org/wiki/MIT_License diff --git a/sources_non_forked/gruvbox/autoload/airline/themes/gruvbox.vim b/sources_non_forked/gruvbox/autoload/airline/themes/gruvbox.vim new file mode 100644 index 00000000..84793190 --- /dev/null +++ b/sources_non_forked/gruvbox/autoload/airline/themes/gruvbox.vim @@ -0,0 +1,79 @@ +" ----------------------------------------------------------------------------- +" File: gruvbox.vim +" Description: Retro groove color scheme for Airline +" Author: morhetz +" Source: https://github.com/morhetz/gruvbox +" Last Modified: 22 Aug 2014 +" ----------------------------------------------------------------------------- + +let g:airline#themes#gruvbox#palette = {} + +function! airline#themes#gruvbox#refresh() + + let M0 = airline#themes#get_highlight('Identifier') + let accents_group = airline#themes#get_highlight('Special') + let modified_group = [M0[0], '', M0[2], '', ''] + let warning_group = airline#themes#get_highlight2(['Normal', 'bg'], ['Question', 'fg']) + let error_group = airline#themes#get_highlight2(['Normal', 'bg'], ['WarningMsg', 'fg']) + + let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['StatusLineNC', 'bg']) + let s:N2 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['StatusLineNC', 'fg']) + let s:N3 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['CursorLine', 'bg']) + let g:airline#themes#gruvbox#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) + let g:airline#themes#gruvbox#palette.normal_modified = { 'airline_c': modified_group } + let g:airline#themes#gruvbox#palette.normal.airline_warning = warning_group + let g:airline#themes#gruvbox#palette.normal_modified.airline_warning = warning_group + let g:airline#themes#gruvbox#palette.normal.airline_error = error_group + let g:airline#themes#gruvbox#palette.normal_modified.airline_error = error_group + + let s:I1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Identifier', 'fg']) + let s:I2 = s:N2 + let s:I3 = airline#themes#get_highlight2(['Normal', 'fg'], ['StatusLineNC', 'fg']) + let g:airline#themes#gruvbox#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) + let g:airline#themes#gruvbox#palette.insert_modified = g:airline#themes#gruvbox#palette.normal_modified + let g:airline#themes#gruvbox#palette.insert.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning + let g:airline#themes#gruvbox#palette.insert_modified.airline_warning = g:airline#themes#gruvbox#palette.normal_modified.airline_warning + let g:airline#themes#gruvbox#palette.insert.airline_error = g:airline#themes#gruvbox#palette.normal.airline_error + let g:airline#themes#gruvbox#palette.insert_modified.airline_error = g:airline#themes#gruvbox#palette.normal_modified.airline_error + + let s:R1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Structure', 'fg']) + let s:R2 = s:I2 + let s:R3 = s:I3 + let g:airline#themes#gruvbox#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) + let g:airline#themes#gruvbox#palette.replace_modified = g:airline#themes#gruvbox#palette.normal_modified + let g:airline#themes#gruvbox#palette.replace.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning + let g:airline#themes#gruvbox#palette.replace_modified.airline_warning = g:airline#themes#gruvbox#palette.normal_modified.airline_warning + let g:airline#themes#gruvbox#palette.replace.airline_error = g:airline#themes#gruvbox#palette.normal.airline_error + let g:airline#themes#gruvbox#palette.replace_modified.airline_error = g:airline#themes#gruvbox#palette.normal_modified.airline_error + + let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['ModeMsg', 'fg']) + let s:V2 = s:N2 + let s:V3 = airline#themes#get_highlight2(['Normal', 'bg'], ['TabLine', 'fg']) + let g:airline#themes#gruvbox#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) + let g:airline#themes#gruvbox#palette.visual_modified = { 'airline_c': [ s:V3[0], '', s:V3[2], '', '' ] } + let g:airline#themes#gruvbox#palette.visual.airline_warning = g:airline#themes#gruvbox#palette.normal.airline_warning + let g:airline#themes#gruvbox#palette.visual_modified.airline_warning = g:airline#themes#gruvbox#palette.normal_modified.airline_warning + let g:airline#themes#gruvbox#palette.visual.airline_error = g:airline#themes#gruvbox#palette.normal.airline_error + let g:airline#themes#gruvbox#palette.visual_modified.airline_error = g:airline#themes#gruvbox#palette.normal_modified.airline_error + + let s:IA = airline#themes#get_highlight2(['TabLine', 'fg'], ['CursorLine', 'bg']) + let g:airline#themes#gruvbox#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) + let g:airline#themes#gruvbox#palette.inactive_modified = { 'airline_c': modified_group } + + let g:airline#themes#gruvbox#palette.accents = { 'red': accents_group } + + let s:TF = airline#themes#get_highlight2(['Normal', 'bg'], ['Normal', 'bg']) + let g:airline#themes#gruvbox#palette.tabline = { + \ 'airline_tab': s:N2, + \ 'airline_tabsel': s:N1, + \ 'airline_tabtype': s:V1, + \ 'airline_tabfill': s:TF, + \ 'airline_tabhid': s:IA, + \ 'airline_tabmod': s:I1 + \ } + +endfunction + +call airline#themes#gruvbox#refresh() + +" vim: set sw=2 ts=2 sts=2 et tw=80 ft=vim fdm=marker: diff --git a/sources_non_forked/gruvbox/autoload/gruvbox.vim b/sources_non_forked/gruvbox/autoload/gruvbox.vim new file mode 100644 index 00000000..44bec6e1 --- /dev/null +++ b/sources_non_forked/gruvbox/autoload/gruvbox.vim @@ -0,0 +1,41 @@ +" ----------------------------------------------------------------------------- +" File: gruvbox.vim +" Description: Retro groove color scheme for Vim +" Author: morhetz +" Source: https://github.com/morhetz/gruvbox +" Last Modified: 09 Apr 2014 +" ----------------------------------------------------------------------------- + +function! gruvbox#invert_signs_toggle() + if g:gruvbox_invert_signs == 0 + let g:gruvbox_invert_signs=1 + else + let g:gruvbox_invert_signs=0 + endif + + colorscheme gruvbox +endfunction + +" Search Highlighting {{{ + +function! gruvbox#hls_show() + set hlsearch + call GruvboxHlsShowCursor() +endfunction + +function! gruvbox#hls_hide() + set nohlsearch + call GruvboxHlsHideCursor() +endfunction + +function! gruvbox#hls_toggle() + if &hlsearch + call gruvbox#hls_hide() + else + call gruvbox#hls_show() + endif +endfunction + +" }}} + +" vim: set sw=2 ts=2 sts=2 et tw=80 ft=vim fdm=marker: diff --git a/sources_non_forked/gruvbox/autoload/lightline/colorscheme/gruvbox.vim b/sources_non_forked/gruvbox/autoload/lightline/colorscheme/gruvbox.vim new file mode 100644 index 00000000..78babce5 --- /dev/null +++ b/sources_non_forked/gruvbox/autoload/lightline/colorscheme/gruvbox.vim @@ -0,0 +1,53 @@ +" ----------------------------------------------------------------------------- +" File: gruvbox.vim +" Description: Gruvbox colorscheme for Lightline (itchyny/lightline.vim) +" Author: gmoe +" Source: https://github.com/morhetz/gruvbox +" Last Modified: 31 Oct 2015 +" ----------------------------------------------------------------------------- + +function! s:getGruvColor(group) + let guiColor = synIDattr(hlID(a:group), "fg", "gui") + let termColor = synIDattr(hlID(a:group), "fg", "cterm") + return [ guiColor, termColor ] +endfunction + +if exists('g:lightline') + + let s:bg0 = s:getGruvColor('GruvboxBg0') + let s:bg1 = s:getGruvColor('GruvboxBg1') + let s:bg2 = s:getGruvColor('GruvboxBg2') + let s:bg4 = s:getGruvColor('GruvboxBg4') + let s:fg1 = s:getGruvColor('GruvboxFg1') + let s:fg4 = s:getGruvColor('GruvboxFg4') + + let s:yellow = s:getGruvColor('GruvboxYellow') + let s:blue = s:getGruvColor('GruvboxBlue') + let s:aqua = s:getGruvColor('GruvboxAqua') + let s:orange = s:getGruvColor('GruvboxOrange') + + let s:p = {'normal':{}, 'inactive':{}, 'insert':{}, 'replace':{}, 'visual':{}, 'tabline':{}} + let s:p.normal.left = [ [ s:bg0, s:fg4 ], [ s:fg4, s:bg2 ] ] + let s:p.normal.right = [ [ s:bg0, s:fg4 ], [ s:fg4, s:bg2 ] ] + let s:p.normal.middle = [ [ s:fg4, s:bg1 ] ] + let s:p.inactive.right = [ [ s:bg4, s:bg1 ], [ s:bg4, s:bg1 ] ] + let s:p.inactive.left = [ [ s:bg4, s:bg1 ], [ s:bg4, s:bg1 ] ] + let s:p.inactive.middle = [ [ s:bg4, s:bg1 ] ] + let s:p.insert.left = [ [ s:bg0, s:blue ], [ s:fg1, s:bg2 ] ] + let s:p.insert.right = [ [ s:bg0, s:blue ], [ s:fg1, s:bg2 ] ] + let s:p.insert.middle = [ [ s:fg4, s:bg2 ] ] + let s:p.replace.left = [ [ s:bg0, s:aqua ], [ s:fg1, s:bg2 ] ] + let s:p.replace.right = [ [ s:bg0, s:aqua ], [ s:fg1, s:bg2 ] ] + let s:p.replace.middle = [ [ s:fg4, s:bg2 ] ] + let s:p.visual.left = [ [ s:bg0, s:orange ], [ s:bg0, s:bg4 ] ] + let s:p.visual.right = [ [ s:bg0, s:orange ], [ s:bg0, s:bg4 ] ] + let s:p.visual.middle = [ [ s:fg4, s:bg1 ] ] + let s:p.tabline.left = [ [ s:fg4, s:bg2 ] ] + let s:p.tabline.tabsel = [ [ s:bg0, s:fg4 ] ] + let s:p.tabline.middle = [ [ s:bg0, s:bg0 ] ] + let s:p.tabline.right = [ [ s:bg0, s:orange ] ] + let s:p.normal.error = [ [ s:bg0, s:orange ] ] + let s:p.normal.warning = [ [ s:bg2, s:yellow ] ] + + let g:lightline#colorscheme#gruvbox#palette = lightline#colorscheme#flatten(s:p) +endif diff --git a/sources_non_forked/gruvbox/colors/gruvbox.vim b/sources_non_forked/gruvbox/colors/gruvbox.vim new file mode 100644 index 00000000..ebc9efff --- /dev/null +++ b/sources_non_forked/gruvbox/colors/gruvbox.vim @@ -0,0 +1,1239 @@ +" ----------------------------------------------------------------------------- +" File: gruvbox.vim +" Description: Retro groove color scheme for Vim +" Author: morhetz +" Source: https://github.com/morhetz/gruvbox +" Last Modified: 04 Sep 2015 +" ----------------------------------------------------------------------------- + +" Supporting code ------------------------------------------------------------- +" Initialisation: {{{ + +if version > 580 + hi clear + if exists("syntax_on") + syntax reset + endif +endif + +let g:colors_name='gruvbox' + +if !has('gui_running') && &t_Co != 256 + finish +endif + +" }}} +" Global Settings: {{{ + +if !exists('g:gruvbox_bold') + let g:gruvbox_bold=1 +endif +if !exists('g:gruvbox_italic') + if has('gui_running') || $TERM_ITALICS == 'true' + let g:gruvbox_italic=1 + else + let g:gruvbox_italic=0 + endif +endif +if !exists('g:gruvbox_undercurl') + let g:gruvbox_undercurl=1 +endif +if !exists('g:gruvbox_underline') + let g:gruvbox_underline=1 +endif +if !exists('g:gruvbox_inverse') + let g:gruvbox_inverse=1 +endif + +if !exists('g:gruvbox_guisp_fallback') || index(['fg', 'bg'], g:gruvbox_guisp_fallback) == -1 + let g:gruvbox_guisp_fallback='NONE' +endif + +if !exists('g:gruvbox_improved_strings') + let g:gruvbox_improved_strings=0 +endif + +if !exists('g:gruvbox_improved_warnings') + let g:gruvbox_improved_warnings=0 +endif + +if !exists('g:gruvbox_termcolors') + let g:gruvbox_termcolors=256 +endif + +if !exists('g:gruvbox_invert_indent_guides') + let g:gruvbox_invert_indent_guides=0 +endif + +if exists('g:gruvbox_contrast') + echo 'g:gruvbox_contrast is deprecated; use g:gruvbox_contrast_light and g:gruvbox_contrast_dark instead' +endif + +if !exists('g:gruvbox_contrast_dark') + let g:gruvbox_contrast_dark='medium' +endif + +if !exists('g:gruvbox_contrast_light') + let g:gruvbox_contrast_light='medium' +endif + +let s:is_dark=(&background == 'dark') + +" }}} +" Palette: {{{ + +" setup palette dictionary +let s:gb = {} + +" fill it with absolute colors +let s:gb.dark0_hard = ['#1d2021', 234] " 29-32-33 +let s:gb.dark0 = ['#282828', 235] " 40-40-40 +let s:gb.dark0_soft = ['#32302f', 236] " 50-48-47 +let s:gb.dark1 = ['#3c3836', 237] " 60-56-54 +let s:gb.dark2 = ['#504945', 239] " 80-73-69 +let s:gb.dark3 = ['#665c54', 241] " 102-92-84 +let s:gb.dark4 = ['#7c6f64', 243] " 124-111-100 +let s:gb.dark4_256 = ['#7c6f64', 243] " 124-111-100 + +let s:gb.gray_245 = ['#928374', 245] " 146-131-116 +let s:gb.gray_244 = ['#928374', 244] " 146-131-116 + +let s:gb.light0_hard = ['#f9f5d7', 230] " 249-245-215 +let s:gb.light0 = ['#fbf1c7', 229] " 253-244-193 +let s:gb.light0_soft = ['#f2e5bc', 228] " 242-229-188 +let s:gb.light1 = ['#ebdbb2', 223] " 235-219-178 +let s:gb.light2 = ['#d5c4a1', 250] " 213-196-161 +let s:gb.light3 = ['#bdae93', 248] " 189-174-147 +let s:gb.light4 = ['#a89984', 246] " 168-153-132 +let s:gb.light4_256 = ['#a89984', 246] " 168-153-132 + +let s:gb.bright_red = ['#fb4934', 167] " 251-73-52 +let s:gb.bright_green = ['#b8bb26', 142] " 184-187-38 +let s:gb.bright_yellow = ['#fabd2f', 214] " 250-189-47 +let s:gb.bright_blue = ['#83a598', 109] " 131-165-152 +let s:gb.bright_purple = ['#d3869b', 175] " 211-134-155 +let s:gb.bright_aqua = ['#8ec07c', 108] " 142-192-124 +let s:gb.bright_orange = ['#fe8019', 208] " 254-128-25 + +let s:gb.neutral_red = ['#cc241d', 124] " 204-36-29 +let s:gb.neutral_green = ['#98971a', 106] " 152-151-26 +let s:gb.neutral_yellow = ['#d79921', 172] " 215-153-33 +let s:gb.neutral_blue = ['#458588', 66] " 69-133-136 +let s:gb.neutral_purple = ['#b16286', 132] " 177-98-134 +let s:gb.neutral_aqua = ['#689d6a', 72] " 104-157-106 +let s:gb.neutral_orange = ['#d65d0e', 166] " 214-93-14 + +let s:gb.faded_red = ['#9d0006', 88] " 157-0-6 +let s:gb.faded_green = ['#79740e', 100] " 121-116-14 +let s:gb.faded_yellow = ['#b57614', 136] " 181-118-20 +let s:gb.faded_blue = ['#076678', 24] " 7-102-120 +let s:gb.faded_purple = ['#8f3f71', 96] " 143-63-113 +let s:gb.faded_aqua = ['#427b58', 66] " 66-123-88 +let s:gb.faded_orange = ['#af3a03', 130] " 175-58-3 + +" }}} +" Setup Emphasis: {{{ + +let s:bold = 'bold,' +if g:gruvbox_bold == 0 + let s:bold = '' +endif + +let s:italic = 'italic,' +if g:gruvbox_italic == 0 + let s:italic = '' +endif + +let s:underline = 'underline,' +if g:gruvbox_underline == 0 + let s:underline = '' +endif + +let s:undercurl = 'undercurl,' +if g:gruvbox_undercurl == 0 + let s:undercurl = '' +endif + +let s:inverse = 'inverse,' +if g:gruvbox_inverse == 0 + let s:inverse = '' +endif + +" }}} +" Setup Colors: {{{ + +let s:vim_bg = ['bg', 'bg'] +let s:vim_fg = ['fg', 'fg'] +let s:none = ['NONE', 'NONE'] + +" determine relative colors +if s:is_dark + let s:bg0 = s:gb.dark0 + if g:gruvbox_contrast_dark == 'soft' + let s:bg0 = s:gb.dark0_soft + elseif g:gruvbox_contrast_dark == 'hard' + let s:bg0 = s:gb.dark0_hard + endif + + let s:bg1 = s:gb.dark1 + let s:bg2 = s:gb.dark2 + let s:bg3 = s:gb.dark3 + let s:bg4 = s:gb.dark4 + + let s:gray = s:gb.gray_245 + + let s:fg0 = s:gb.light0 + let s:fg1 = s:gb.light1 + let s:fg2 = s:gb.light2 + let s:fg3 = s:gb.light3 + let s:fg4 = s:gb.light4 + + let s:fg4_256 = s:gb.light4_256 + + let s:red = s:gb.bright_red + let s:green = s:gb.bright_green + let s:yellow = s:gb.bright_yellow + let s:blue = s:gb.bright_blue + let s:purple = s:gb.bright_purple + let s:aqua = s:gb.bright_aqua + let s:orange = s:gb.bright_orange +else + let s:bg0 = s:gb.light0 + if g:gruvbox_contrast_light == 'soft' + let s:bg0 = s:gb.light0_soft + elseif g:gruvbox_contrast_light == 'hard' + let s:bg0 = s:gb.light0_hard + endif + + let s:bg1 = s:gb.light1 + let s:bg2 = s:gb.light2 + let s:bg3 = s:gb.light3 + let s:bg4 = s:gb.light4 + + let s:gray = s:gb.gray_244 + + let s:fg0 = s:gb.dark0 + let s:fg1 = s:gb.dark1 + let s:fg2 = s:gb.dark2 + let s:fg3 = s:gb.dark3 + let s:fg4 = s:gb.dark4 + + let s:fg4_256 = s:gb.dark4_256 + + let s:red = s:gb.faded_red + let s:green = s:gb.faded_green + let s:yellow = s:gb.faded_yellow + let s:blue = s:gb.faded_blue + let s:purple = s:gb.faded_purple + let s:aqua = s:gb.faded_aqua + let s:orange = s:gb.faded_orange +endif + +" reset to 16 colors fallback +if g:gruvbox_termcolors == 16 + let s:bg0[1] = 0 + let s:fg4[1] = 7 + let s:gray[1] = 8 + let s:red[1] = 9 + let s:green[1] = 10 + let s:yellow[1] = 11 + let s:blue[1] = 12 + let s:purple[1] = 13 + let s:aqua[1] = 14 + let s:fg1[1] = 15 +endif + +" save current relative colors back to palette dictionary +let s:gb.bg0 = s:bg0 +let s:gb.bg1 = s:bg1 +let s:gb.bg2 = s:bg2 +let s:gb.bg3 = s:bg3 +let s:gb.bg4 = s:bg4 + +let s:gb.gray = s:gray + +let s:gb.fg0 = s:fg0 +let s:gb.fg1 = s:fg1 +let s:gb.fg2 = s:fg2 +let s:gb.fg3 = s:fg3 +let s:gb.fg4 = s:fg4 + +let s:gb.fg4_256 = s:fg4_256 + +let s:gb.red = s:red +let s:gb.green = s:green +let s:gb.yellow = s:yellow +let s:gb.blue = s:blue +let s:gb.purple = s:purple +let s:gb.aqua = s:aqua +let s:gb.orange = s:orange + +" }}} + +" Overload Setting: {{{ + +let s:hls_cursor = s:orange +if exists('g:gruvbox_hls_cursor') + let s:hls_cursor = get(s:gb, g:gruvbox_hls_cursor) +endif + +let s:number_column = s:none +if exists('g:gruvbox_number_column') + let s:number_column = get(s:gb, g:gruvbox_number_column) +endif + +let s:sign_column = s:bg1 + +if exists('g:gitgutter_override_sign_column_highlight') && + \ g:gitgutter_override_sign_column_highlight == 1 + let s:sign_column = s:number_column +else + let g:gitgutter_override_sign_column_highlight = 0 + + if exists('g:gruvbox_sign_column') + let s:sign_column = get(s:gb, g:gruvbox_sign_column) + endif +endif + +let s:color_column = s:bg1 +if exists('g:gruvbox_color_column') + let s:color_column = get(s:gb, g:gruvbox_color_column) +endif + +let s:vert_split = s:bg2 +if exists('g:gruvbox_vert_split') + let s:vert_split = get(s:gb, g:gruvbox_vert_split) +endif + +let s:invert_signs = '' +if exists('g:gruvbox_invert_signs') + if g:gruvbox_invert_signs == 1 + let s:invert_signs = s:inverse + endif +endif + +let s:invert_selection = s:inverse +if exists('g:gruvbox_invert_selection') + if g:gruvbox_invert_selection == 0 + let s:invert_selection = '' + endif +endif + +let s:invert_tabline = '' +if exists('g:gruvbox_invert_tabline') + if g:gruvbox_invert_tabline == 1 + let s:invert_tabline = s:inverse + endif +endif + +let s:italicize_comments = s:italic +if exists('g:gruvbox_italicize_comments') + if g:gruvbox_italicize_comments == 0 + let s:italicize_comments = '' + endif +endif + +let s:italicize_strings = '' +if exists('g:gruvbox_italicize_strings') + if g:gruvbox_italicize_strings == 1 + let s:italicize_strings = s:italic + endif +endif + +" }}} +" Highlighting Function: {{{ + +function! s:HL(group, fg, ...) + " Arguments: group, guifg, guibg, gui, guisp + + " foreground + let fg = a:fg + + " background + if a:0 >= 1 + let bg = a:1 + else + let bg = s:none + endif + + " emphasis + if a:0 >= 2 && strlen(a:2) + let emstr = a:2 + else + let emstr = 'NONE,' + endif + + " special fallback + if a:0 >= 3 + if g:gruvbox_guisp_fallback != 'NONE' + let fg = a:3 + endif + + " bg fallback mode should invert higlighting + if g:gruvbox_guisp_fallback == 'bg' + let emstr .= 'inverse,' + endif + endif + + let histring = [ 'hi', a:group, + \ 'guifg=' . fg[0], 'ctermfg=' . fg[1], + \ 'guibg=' . bg[0], 'ctermbg=' . bg[1], + \ 'gui=' . emstr[:-2], 'cterm=' . emstr[:-2] + \ ] + + " special + if a:0 >= 3 + call add(histring, 'guisp=' . a:3[0]) + endif + + execute join(histring, ' ') +endfunction + +" }}} +" Gruvbox Hi Groups: {{{ + +" memoize common hi groups +call s:HL('GruvboxFg0', s:fg0) +call s:HL('GruvboxFg1', s:fg1) +call s:HL('GruvboxFg2', s:fg2) +call s:HL('GruvboxFg3', s:fg3) +call s:HL('GruvboxFg4', s:fg4) +call s:HL('GruvboxGray', s:gray) +call s:HL('GruvboxBg0', s:bg0) +call s:HL('GruvboxBg1', s:bg1) +call s:HL('GruvboxBg2', s:bg2) +call s:HL('GruvboxBg3', s:bg3) +call s:HL('GruvboxBg4', s:bg4) + +call s:HL('GruvboxRed', s:red) +call s:HL('GruvboxRedBold', s:red, s:none, s:bold) +call s:HL('GruvboxGreen', s:green) +call s:HL('GruvboxGreenBold', s:green, s:none, s:bold) +call s:HL('GruvboxYellow', s:yellow) +call s:HL('GruvboxYellowBold', s:yellow, s:none, s:bold) +call s:HL('GruvboxBlue', s:blue) +call s:HL('GruvboxBlueBold', s:blue, s:none, s:bold) +call s:HL('GruvboxPurple', s:purple) +call s:HL('GruvboxPurpleBold', s:purple, s:none, s:bold) +call s:HL('GruvboxAqua', s:aqua) +call s:HL('GruvboxAquaBold', s:aqua, s:none, s:bold) +call s:HL('GruvboxOrange', s:orange) +call s:HL('GruvboxOrangeBold', s:orange, s:none, s:bold) + +call s:HL('GruvboxRedSign', s:red, s:sign_column, s:invert_signs) +call s:HL('GruvboxGreenSign', s:green, s:sign_column, s:invert_signs) +call s:HL('GruvboxYellowSign', s:yellow, s:sign_column, s:invert_signs) +call s:HL('GruvboxBlueSign', s:blue, s:sign_column, s:invert_signs) +call s:HL('GruvboxPurpleSign', s:purple, s:sign_column, s:invert_signs) +call s:HL('GruvboxAquaSign', s:aqua, s:sign_column, s:invert_signs) + +" }}} + +" Vanilla colorscheme --------------------------------------------------------- +" General UI: {{{ + +" Normal text +call s:HL('Normal', s:fg1, s:bg0) + +" Correct background (see issue #7): +" --- Problem with changing between dark and light on 256 color terminal +" --- https://github.com/morhetz/gruvbox/issues/7 +if s:is_dark + set background=dark +else + set background=light +endif + +if version >= 700 + " Screen line that the cursor is + call s:HL('CursorLine', s:none, s:bg1) + " Screen column that the cursor is + hi! link CursorColumn CursorLine + + " Tab pages line filler + call s:HL('TabLineFill', s:bg4, s:vim_bg, s:invert_tabline) + " Active tab page label + call s:HL('TabLineSel', s:vim_bg, s:bg4, s:bold . s:invert_tabline) + " Not active tab page label + hi! link TabLine TabLineFill + + " Match paired bracket under the cursor + call s:HL('MatchParen', s:none, s:bg3, s:bold) +endif + +if version >= 703 + " Highlighted screen columns + call s:HL('ColorColumn', s:none, s:color_column) + + " Concealed element: \lambda → λ + call s:HL('Conceal', s:blue, s:none) + + " Line number of CursorLine + call s:HL('CursorLineNr', s:yellow, s:bg1) +endif + +hi! link NonText GruvboxBg2 +hi! link SpecialKey GruvboxBg2 + +call s:HL('Visual', s:none, s:bg3, s:invert_selection) +hi! link VisualNOS Visual + +call s:HL('Search', s:yellow, s:bg0, s:inverse) +call s:HL('IncSearch', s:hls_cursor, s:bg0, s:inverse) + +call s:HL('Underlined', s:blue, s:none, s:underline) + +call s:HL('StatusLine', s:bg4, s:bg0, s:bold . s:inverse) +call s:HL('StatusLineNC', s:bg2, s:fg4, s:bold . s:inverse) + +" The column separating vertically split windows +call s:HL('VertSplit', s:fg4, s:vert_split) + +" Current match in wildmenu completion +call s:HL('WildMenu', s:blue, s:bg2, s:bold) + +" Directory names, special names in listing +hi! link Directory GruvboxGreenBold + +" Titles for output from :set all, :autocmd, etc. +hi! link Title GruvboxGreenBold + +" Error messages on the command line +call s:HL('ErrorMsg', s:bg0, s:red, s:bold) +" More prompt: -- More -- +hi! link MoreMsg GruvboxYellowBold +" Current mode message: -- INSERT -- +hi! link ModeMsg GruvboxYellowBold +" 'Press enter' prompt and yes/no questions +hi! link Question GruvboxOrangeBold +" Warning messages +hi! link WarningMsg GruvboxRedBold + +" }}} +" Gutter: {{{ + +" Line number for :number and :# commands +call s:HL('LineNr', s:bg4, s:number_column) + +" Column where signs are displayed +call s:HL('SignColumn', s:none, s:sign_column) + +" Line used for closed folds +call s:HL('Folded', s:gray, s:bg1, s:italic) +" Column where folds are displayed +call s:HL('FoldColumn', s:gray, s:bg1) + +" }}} +" Cursor: {{{ + +" Character under cursor +call s:HL('Cursor', s:none, s:none, s:inverse) +" Visual mode cursor, selection +hi! link vCursor Cursor +" Input moder cursor +hi! link iCursor Cursor +" Language mapping cursor +hi! link lCursor Cursor + +" }}} +" Syntax Highlighting: {{{ + +if g:gruvbox_improved_strings == 0 + hi! link Special GruvboxOrange +else + call s:HL('Special', s:bg1, s:orange, s:italic) +endif + +call s:HL('Comment', s:gray, s:none, s:italicize_comments) +call s:HL('Todo', s:vim_fg, s:vim_bg, s:bold . s:italic) +call s:HL('Error', s:red, s:vim_bg, s:bold . s:inverse) + +" Generic statement +hi! link Statement GruvboxRed +" if, then, else, endif, swicth, etc. +hi! link Conditional GruvboxRed +" for, do, while, etc. +hi! link Repeat GruvboxRed +" case, default, etc. +hi! link Label GruvboxRed +" try, catch, throw +hi! link Exception GruvboxRed +" sizeof, "+", "*", etc. +hi! link Operator Normal +" Any other keyword +hi! link Keyword GruvboxRed + +" Variable name +hi! link Identifier GruvboxBlue +" Function name +hi! link Function GruvboxGreenBold + +" Generic preprocessor +hi! link PreProc GruvboxAqua +" Preprocessor #include +hi! link Include GruvboxAqua +" Preprocessor #define +hi! link Define GruvboxAqua +" Same as Define +hi! link Macro GruvboxAqua +" Preprocessor #if, #else, #endif, etc. +hi! link PreCondit GruvboxAqua + +" Generic constant +hi! link Constant GruvboxPurple +" Character constant: 'c', '/n' +hi! link Character GruvboxPurple +" String constant: "this is a string" +if g:gruvbox_improved_strings == 0 + call s:HL('String', s:green, s:none, s:italicize_strings) +else + call s:HL('String', s:bg1, s:fg1, s:italicize_strings) +endif +" Boolean constant: TRUE, false +hi! link Boolean GruvboxPurple +" Number constant: 234, 0xff +hi! link Number GruvboxPurple +" Floating point constant: 2.3e10 +hi! link Float GruvboxPurple + +" Generic type +hi! link Type GruvboxYellow +" static, register, volatile, etc +hi! link StorageClass GruvboxOrange +" struct, union, enum, etc. +hi! link Structure GruvboxAqua +" typedef +hi! link Typedef GruvboxYellow + +" }}} +" Completion Menu: {{{ + +if version >= 700 + " Popup menu: normal item + call s:HL('Pmenu', s:fg1, s:bg2) + " Popup menu: selected item + call s:HL('PmenuSel', s:bg2, s:blue, s:bold) + " Popup menu: scrollbar + call s:HL('PmenuSbar', s:none, s:bg2) + " Popup menu: scrollbar thumb + call s:HL('PmenuThumb', s:none, s:bg4) +endif + +" }}} +" Diffs: {{{ + +call s:HL('DiffDelete', s:red, s:bg0, s:inverse) +call s:HL('DiffAdd', s:green, s:bg0, s:inverse) +"call s:HL('DiffChange', s:bg0, s:blue) +"call s:HL('DiffText', s:bg0, s:yellow) + +" Alternative setting +call s:HL('DiffChange', s:aqua, s:bg0, s:inverse) +call s:HL('DiffText', s:yellow, s:bg0, s:inverse) + +" }}} +" Spelling: {{{ + +if has("spell") + " Not capitalised word, or compile warnings + if g:gruvbox_improved_warnings == 0 + call s:HL('SpellCap', s:none, s:none, s:undercurl, s:red) + else + call s:HL('SpellCap', s:green, s:none, s:bold . s:italic) + endif + " Not recognized word + call s:HL('SpellBad', s:none, s:none, s:undercurl, s:blue) + " Wrong spelling for selected region + call s:HL('SpellLocal', s:none, s:none, s:undercurl, s:aqua) + " Rare word + call s:HL('SpellRare', s:none, s:none, s:undercurl, s:purple) +endif + +" }}} + +" Plugin specific ------------------------------------------------------------- +" EasyMotion: {{{ + +hi! link EasyMotionTarget Search +hi! link EasyMotionShade Comment + +" }}} +" Sneak: {{{ + +hi! link SneakPluginTarget Search +hi! link SneakStreakTarget Search +call s:HL('SneakStreakMask', s:yellow, s:yellow) +hi! link SneakStreakStatusLine Search + +" }}} +" Indent Guides: {{{ + +if !exists('g:indent_guides_auto_colors') + let g:indent_guides_auto_colors = 0 +endif + +if g:indent_guides_auto_colors == 0 + if g:gruvbox_invert_indent_guides == 0 + call s:HL('IndentGuidesOdd', s:vim_bg, s:bg2) + call s:HL('IndentGuidesEven', s:vim_bg, s:bg1) + else + call s:HL('IndentGuidesOdd', s:vim_bg, s:bg2, s:inverse) + call s:HL('IndentGuidesEven', s:vim_bg, s:bg3, s:inverse) + endif +endif + +" }}} +" IndentLine: {{{ + +if !exists('g:indentLine_color_term') + let g:indentLine_color_term = s:bg2[1] +endif +if !exists('g:indentLine_color_gui') + let g:indentLine_color_gui = s:bg2[0] +endif + +" }}} +" Rainbow Parentheses: {{{ + +if !exists('g:rbpt_colorpairs') + let g:rbpt_colorpairs = + \ [ + \ ['blue', '#458588'], ['magenta', '#b16286'], + \ ['red', '#cc241d'], ['166', '#d65d0e'] + \ ] +endif + +let g:rainbow_guifgs = [ '#d65d0e', '#cc241d', '#b16286', '#458588' ] +let g:rainbow_ctermfgs = [ '166', 'red', 'magenta', 'blue' ] + +if !exists('g:rainbow_conf') + let g:rainbow_conf = {} +endif +if !has_key(g:rainbow_conf, 'guifgs') + let g:rainbow_conf['guifgs'] = g:rainbow_guifgs +endif +if !has_key(g:rainbow_conf, 'ctermfgs') + let g:rainbow_conf['ctermfgs'] = g:rainbow_ctermfgs +endif + +let g:niji_dark_colours = g:rbpt_colorpairs +let g:niji_light_colours = g:rbpt_colorpairs + +"}}} +" GitGutter: {{{ + +hi! link GitGutterAdd GruvboxGreenSign +hi! link GitGutterChange GruvboxAquaSign +hi! link GitGutterDelete GruvboxRedSign +hi! link GitGutterChangeDelete GruvboxAquaSign + +" }}} +" GitCommit: "{{{ + +hi! link gitcommitSelectedFile GruvboxGreen +hi! link gitcommitDiscardedFile GruvboxRed + +" }}} +" Signify: {{{ + +hi! link SignifySignAdd GruvboxGreenSign +hi! link SignifySignChange GruvboxAquaSign +hi! link SignifySignDelete GruvboxRedSign + +" }}} +" Syntastic: {{{ + +call s:HL('SyntasticError', s:none, s:none, s:undercurl, s:red) +call s:HL('SyntasticWarning', s:none, s:none, s:undercurl, s:yellow) + +hi! link SyntasticErrorSign GruvboxRedSign +hi! link SyntasticWarningSign GruvboxYellowSign + +" }}} +" Signature: {{{ +hi! link SignatureMarkText GruvboxBlueSign +hi! link SignatureMarkerText GruvboxPurpleSign + +" }}} +" ShowMarks: {{{ + +hi! link ShowMarksHLl GruvboxBlueSign +hi! link ShowMarksHLu GruvboxBlueSign +hi! link ShowMarksHLo GruvboxBlueSign +hi! link ShowMarksHLm GruvboxBlueSign + +" }}} +" CtrlP: {{{ + +hi! link CtrlPMatch GruvboxYellow +hi! link CtrlPNoEntries GruvboxRed +hi! link CtrlPPrtBase GruvboxBg2 +hi! link CtrlPPrtCursor GruvboxBlue +hi! link CtrlPLinePre GruvboxBg2 + +call s:HL('CtrlPMode1', s:blue, s:bg2, s:bold) +call s:HL('CtrlPMode2', s:bg0, s:blue, s:bold) +call s:HL('CtrlPStats', s:fg4, s:bg2, s:bold) + +" }}} +" Startify: {{{ + +hi! link StartifyBracket GruvboxFg3 +hi! link StartifyFile GruvboxFg0 +hi! link StartifyNumber GruvboxBlue +hi! link StartifyPath GruvboxGray +hi! link StartifySlash GruvboxGray +hi! link StartifySection GruvboxYellow +hi! link StartifySpecial GruvboxBg2 +hi! link StartifyHeader GruvboxOrange +hi! link StartifyFooter GruvboxBg2 + +" }}} +" Vimshell: {{{ + +let g:vimshell_escape_colors = [ + \ s:bg4[0], s:red[0], s:green[0], s:yellow[0], + \ s:blue[0], s:purple[0], s:aqua[0], s:fg4[0], + \ s:bg0[0], s:red[0], s:green[0], s:orange[0], + \ s:blue[0], s:purple[0], s:aqua[0], s:fg0[0] + \ ] + +" }}} +" BufTabLine: {{{ + +call s:HL('BufTabLineCurrent', s:bg0, s:fg4) +call s:HL('BufTabLineActive', s:fg4, s:bg2) +call s:HL('BufTabLineHidden', s:bg4, s:bg1) +call s:HL('BufTabLineFill', s:bg0, s:bg0) + +" }}} + +" Filetype specific ----------------------------------------------------------- +" Diff: {{{ + +hi! link diffAdded GruvboxGreen +hi! link diffRemoved GruvboxRed +hi! link diffChanged GruvboxAqua + +hi! link diffFile GruvboxOrange +hi! link diffNewFile GruvboxYellow + +hi! link diffLine GruvboxBlue + +" }}} +" Html: {{{ + +hi! link htmlTag GruvboxBlue +hi! link htmlEndTag GruvboxBlue + +hi! link htmlTagName GruvboxAquaBold +hi! link htmlArg GruvboxAqua + +hi! link htmlScriptTag GruvboxPurple +hi! link htmlTagN GruvboxFg1 +hi! link htmlSpecialTagName GruvboxAquaBold + +call s:HL('htmlLink', s:fg4, s:none, s:underline) + +hi! link htmlSpecialChar GruvboxOrange + +call s:HL('htmlBold', s:vim_fg, s:vim_bg, s:bold) +call s:HL('htmlBoldUnderline', s:vim_fg, s:vim_bg, s:bold . s:underline) +call s:HL('htmlBoldItalic', s:vim_fg, s:vim_bg, s:bold . s:italic) +call s:HL('htmlBoldUnderlineItalic', s:vim_fg, s:vim_bg, s:bold . s:underline . s:italic) + +call s:HL('htmlUnderline', s:vim_fg, s:vim_bg, s:underline) +call s:HL('htmlUnderlineItalic', s:vim_fg, s:vim_bg, s:underline . s:italic) +call s:HL('htmlItalic', s:vim_fg, s:vim_bg, s:italic) + +" }}} +" Xml: {{{ + +hi! link xmlTag GruvboxBlue +hi! link xmlEndTag GruvboxBlue +hi! link xmlTagName GruvboxBlue +hi! link xmlEqual GruvboxBlue +hi! link docbkKeyword GruvboxAquaBold + +hi! link xmlDocTypeDecl GruvboxGray +hi! link xmlDocTypeKeyword GruvboxPurple +hi! link xmlCdataStart GruvboxGray +hi! link xmlCdataCdata GruvboxPurple +hi! link dtdFunction GruvboxGray +hi! link dtdTagName GruvboxPurple + +hi! link xmlAttrib GruvboxAqua +hi! link xmlProcessingDelim GruvboxGray +hi! link dtdParamEntityPunct GruvboxGray +hi! link dtdParamEntityDPunct GruvboxGray +hi! link xmlAttribPunct GruvboxGray + +hi! link xmlEntity GruvboxOrange +hi! link xmlEntityPunct GruvboxOrange +" }}} +" Vim: {{{ + +call s:HL('vimCommentTitle', s:fg4_256, s:none, s:bold . s:italicize_comments) + +hi! link vimNotation GruvboxOrange +hi! link vimBracket GruvboxOrange +hi! link vimMapModKey GruvboxOrange +hi! link vimFuncSID GruvboxFg3 +hi! link vimSetSep GruvboxFg3 +hi! link vimSep GruvboxFg3 +hi! link vimContinue GruvboxFg3 + +" }}} +" Clojure: {{{ + +hi! link clojureKeyword GruvboxBlue +hi! link clojureCond GruvboxOrange +hi! link clojureSpecial GruvboxOrange +hi! link clojureDefine GruvboxOrange + +hi! link clojureFunc GruvboxYellow +hi! link clojureRepeat GruvboxYellow +hi! link clojureCharacter GruvboxAqua +hi! link clojureStringEscape GruvboxAqua +hi! link clojureException GruvboxRed + +hi! link clojureRegexp GruvboxAqua +hi! link clojureRegexpEscape GruvboxAqua +call s:HL('clojureRegexpCharClass', s:fg3, s:none, s:bold) +hi! link clojureRegexpMod clojureRegexpCharClass +hi! link clojureRegexpQuantifier clojureRegexpCharClass + +hi! link clojureParen GruvboxFg3 +hi! link clojureAnonArg GruvboxYellow +hi! link clojureVariable GruvboxBlue +hi! link clojureMacro GruvboxOrange + +hi! link clojureMeta GruvboxYellow +hi! link clojureDeref GruvboxYellow +hi! link clojureQuote GruvboxYellow +hi! link clojureUnquote GruvboxYellow + +" }}} +" C: {{{ + +hi! link cOperator GruvboxPurple +hi! link cStructure GruvboxOrange + +" }}} +" Python: {{{ + +hi! link pythonBuiltin GruvboxOrange +hi! link pythonBuiltinObj GruvboxOrange +hi! link pythonBuiltinFunc GruvboxOrange +hi! link pythonFunction GruvboxAqua +hi! link pythonDecorator GruvboxRed +hi! link pythonInclude GruvboxBlue +hi! link pythonImport GruvboxBlue +hi! link pythonRun GruvboxBlue +hi! link pythonCoding GruvboxBlue +hi! link pythonOperator GruvboxRed +hi! link pythonExceptions GruvboxPurple +hi! link pythonBoolean GruvboxPurple +hi! link pythonDot GruvboxFg3 + +" }}} +" CSS: {{{ + +hi! link cssBraces GruvboxBlue +hi! link cssFunctionName GruvboxYellow +hi! link cssIdentifier GruvboxOrange +hi! link cssClassName GruvboxGreen +hi! link cssColor GruvboxBlue +hi! link cssSelectorOp GruvboxBlue +hi! link cssSelectorOp2 GruvboxBlue +hi! link cssImportant GruvboxGreen +hi! link cssVendor GruvboxFg1 + +hi! link cssTextProp GruvboxAqua +hi! link cssAnimationProp GruvboxAqua +hi! link cssUIProp GruvboxYellow +hi! link cssTransformProp GruvboxAqua +hi! link cssTransitionProp GruvboxAqua +hi! link cssPrintProp GruvboxAqua +hi! link cssPositioningProp GruvboxYellow +hi! link cssBoxProp GruvboxAqua +hi! link cssFontDescriptorProp GruvboxAqua +hi! link cssFlexibleBoxProp GruvboxAqua +hi! link cssBorderOutlineProp GruvboxAqua +hi! link cssBackgroundProp GruvboxAqua +hi! link cssMarginProp GruvboxAqua +hi! link cssListProp GruvboxAqua +hi! link cssTableProp GruvboxAqua +hi! link cssFontProp GruvboxAqua +hi! link cssPaddingProp GruvboxAqua +hi! link cssDimensionProp GruvboxAqua +hi! link cssRenderProp GruvboxAqua +hi! link cssColorProp GruvboxAqua +hi! link cssGeneratedContentProp GruvboxAqua + +" }}} +" JavaScript: {{{ + +hi! link javaScriptBraces GruvboxFg1 +hi! link javaScriptFunction GruvboxAqua +hi! link javaScriptIdentifier GruvboxRed +hi! link javaScriptMember GruvboxBlue +hi! link javaScriptNumber GruvboxPurple +hi! link javaScriptNull GruvboxPurple +hi! link javaScriptParens GruvboxFg3 + +" }}} +" YAJS: {{{ + +hi! link javascriptImport GruvboxAqua +hi! link javascriptExport GruvboxAqua +hi! link javascriptClassKeyword GruvboxAqua +hi! link javascriptClassExtends GruvboxAqua +hi! link javascriptDefault GruvboxAqua + +hi! link javascriptClassName GruvboxYellow +hi! link javascriptClassSuperName GruvboxYellow +hi! link javascriptGlobal GruvboxYellow + +hi! link javascriptEndColons GruvboxFg1 +hi! link javascriptFuncArg GruvboxFg1 +hi! link javascriptGlobalMethod GruvboxFg1 +hi! link javascriptNodeGlobal GruvboxFg1 + +" hi! link javascriptVariable GruvboxOrange +hi! link javascriptVariable GruvboxRed +" hi! link javascriptIdentifier GruvboxOrange +" hi! link javascriptClassSuper GruvboxOrange +hi! link javascriptIdentifier GruvboxOrange +hi! link javascriptClassSuper GruvboxOrange + +" hi! link javascriptFuncKeyword GruvboxOrange +" hi! link javascriptAsyncFunc GruvboxOrange +hi! link javascriptFuncKeyword GruvboxAqua +hi! link javascriptAsyncFunc GruvboxAqua +hi! link javascriptClassStatic GruvboxOrange + +hi! link javascriptOperator GruvboxRed +hi! link javascriptForOperator GruvboxRed +hi! link javascriptYield GruvboxRed +hi! link javascriptExceptions GruvboxRed +hi! link javascriptMessage GruvboxRed + +hi! link javascriptTemplateSB GruvboxAqua +hi! link javascriptTemplateSubstitution GruvboxFg1 + +" hi! link javascriptLabel GruvboxBlue +" hi! link javascriptObjectLabel GruvboxBlue +" hi! link javascriptPropertyName GruvboxBlue +hi! link javascriptLabel GruvboxFg1 +hi! link javascriptObjectLabel GruvboxFg1 +hi! link javascriptPropertyName GruvboxFg1 + +hi! link javascriptLogicSymbols GruvboxFg1 +hi! link javascriptArrowFunc GruvboxFg1 + +hi! link javascriptDocParamName GruvboxFg4 +hi! link javascriptDocTags GruvboxFg4 +hi! link javascriptDocNotation GruvboxFg4 +hi! link javascriptDocParamType GruvboxFg4 +hi! link javascriptDocNamedParamType GruvboxFg4 + +" }}} +" TypeScript: {{{ + +hi! link typeScriptReserved GruvboxAqua +hi! link typeScriptLabel GruvboxAqua +hi! link typeScriptIdentifier GruvboxOrange +hi! link typeScriptBraces GruvboxFg1 +hi! link typeScriptEndColons GruvboxFg1 +hi! link typeScriptDOMObjects GruvboxFg1 +hi! link typeScriptAjaxMethods GruvboxFg1 +hi! link typeScriptLogicSymbols GruvboxFg1 +hi! link typeScriptDocSeeTag Comment +hi! link typeScriptDocParam Comment +hi! link typeScriptDocTags vimCommentTitle + +" }}} +" CoffeeScript: {{{ + +hi! link coffeeExtendedOp GruvboxFg3 +hi! link coffeeSpecialOp GruvboxFg3 +hi! link coffeeCurly GruvboxOrange +hi! link coffeeParen GruvboxFg3 +hi! link coffeeBracket GruvboxOrange + +" }}} +" Ruby: {{{ + +hi! link rubyStringDelimiter GruvboxGreen +hi! link rubyInterpolationDelimiter GruvboxAqua + +" }}} +" ObjectiveC: {{{ + +hi! link objcTypeModifier GruvboxRed +hi! link objcDirective GruvboxBlue + +" }}} +" Go: {{{ + +hi! link goDirective GruvboxAqua +hi! link goConstants GruvboxPurple +hi! link goDeclaration GruvboxRed +hi! link goDeclType GruvboxBlue +hi! link goBuiltins GruvboxOrange + +" }}} +" Lua: {{{ + +hi! link luaIn GruvboxRed +hi! link luaFunction GruvboxAqua +hi! link luaTable GruvboxOrange + +" }}} +" MoonScript: {{{ + +hi! link moonSpecialOp GruvboxFg3 +hi! link moonExtendedOp GruvboxFg3 +hi! link moonFunction GruvboxFg3 +hi! link moonObject GruvboxYellow + +" }}} +" Java: {{{ + +hi! link javaAnnotation GruvboxBlue +hi! link javaDocTags GruvboxAqua +hi! link javaCommentTitle vimCommentTitle +hi! link javaParen GruvboxFg3 +hi! link javaParen1 GruvboxFg3 +hi! link javaParen2 GruvboxFg3 +hi! link javaParen3 GruvboxFg3 +hi! link javaParen4 GruvboxFg3 +hi! link javaParen5 GruvboxFg3 +hi! link javaOperator GruvboxOrange + +hi! link javaVarArg GruvboxGreen + +" }}} +" Elixir: {{{ + +hi! link elixirDocString Comment + +hi! link elixirStringDelimiter GruvboxGreen +hi! link elixirInterpolationDelimiter GruvboxAqua + +hi! link elixirModuleDeclaration GruvboxYellow + +" }}} +" Scala: {{{ + +" NB: scala vim syntax file is kinda horrible +hi! link scalaNameDefinition GruvboxFg1 +hi! link scalaCaseFollowing GruvboxFg1 +hi! link scalaCapitalWord GruvboxFg1 +hi! link scalaTypeExtension GruvboxFg1 + +hi! link scalaKeyword GruvboxRed +hi! link scalaKeywordModifier GruvboxRed + +hi! link scalaSpecial GruvboxAqua +hi! link scalaOperator GruvboxFg1 + +hi! link scalaTypeDeclaration GruvboxYellow +hi! link scalaTypeTypePostDeclaration GruvboxYellow + +hi! link scalaInstanceDeclaration GruvboxFg1 +hi! link scalaInterpolation GruvboxAqua + +" }}} +" Markdown: {{{ + +call s:HL('markdownItalic', s:fg3, s:none, s:italic) + +hi! link markdownH1 GruvboxGreenBold +hi! link markdownH2 GruvboxGreenBold +hi! link markdownH3 GruvboxYellowBold +hi! link markdownH4 GruvboxYellowBold +hi! link markdownH5 GruvboxYellow +hi! link markdownH6 GruvboxYellow + +hi! link markdownCode GruvboxAqua +hi! link markdownCodeBlock GruvboxAqua +hi! link markdownCodeDelimiter GruvboxAqua + +hi! link markdownBlockquote GruvboxGray +hi! link markdownListMarker GruvboxGray +hi! link markdownOrderedListMarker GruvboxGray +hi! link markdownRule GruvboxGray +hi! link markdownHeadingRule GruvboxGray + +hi! link markdownUrlDelimiter GruvboxFg3 +hi! link markdownLinkDelimiter GruvboxFg3 +hi! link markdownLinkTextDelimiter GruvboxFg3 + +hi! link markdownHeadingDelimiter GruvboxOrange +hi! link markdownUrl GruvboxPurple +hi! link markdownUrlTitleDelimiter GruvboxGreen + +call s:HL('markdownLinkText', s:gray, s:none, s:underline) +hi! link markdownIdDeclaration markdownLinkText + +" }}} +" Haskell: {{{ + +" hi! link haskellType GruvboxYellow +" hi! link haskellOperators GruvboxOrange +" hi! link haskellConditional GruvboxAqua +" hi! link haskellLet GruvboxOrange +" +hi! link haskellType GruvboxFg1 +hi! link haskellIdentifier GruvboxFg1 +hi! link haskellSeparator GruvboxFg1 +hi! link haskellDelimiter GruvboxFg4 +hi! link haskellOperators GruvboxBlue +" +hi! link haskellBacktick GruvboxOrange +hi! link haskellStatement GruvboxOrange +hi! link haskellConditional GruvboxOrange + +hi! link haskellLet GruvboxAqua +hi! link haskellDefault GruvboxAqua +hi! link haskellWhere GruvboxAqua +hi! link haskellBottom GruvboxAqua +hi! link haskellBlockKeywords GruvboxAqua +hi! link haskellImportKeywords GruvboxAqua +hi! link haskellDeclKeyword GruvboxAqua +hi! link haskellDeriving GruvboxAqua +hi! link haskellAssocType GruvboxAqua + +hi! link haskellNumber GruvboxPurple +hi! link haskellPragma GruvboxPurple + +hi! link haskellString GruvboxGreen +hi! link haskellChar GruvboxGreen + +" }}} +" Json: {{{ + +hi! link jsonKeyword GruvboxGreen +hi! link jsonQuote GruvboxGreen +hi! link jsonBraces GruvboxFg1 +hi! link jsonString GruvboxFg1 + +" }}} + + +" Functions ------------------------------------------------------------------- +" Search Highlighting Cursor {{{ + +function! GruvboxHlsShowCursor() + call s:HL('Cursor', s:bg0, s:hls_cursor) +endfunction + +function! GruvboxHlsHideCursor() + call s:HL('Cursor', s:none, s:none, s:inverse) +endfunction + +" }}} + +" vim: set sw=2 ts=2 sts=2 et tw=80 ft=vim fdm=marker: diff --git a/sources_non_forked/gruvbox/gruvbox_256palette.sh b/sources_non_forked/gruvbox/gruvbox_256palette.sh new file mode 100644 index 00000000..c7fd190e --- /dev/null +++ b/sources_non_forked/gruvbox/gruvbox_256palette.sh @@ -0,0 +1,118 @@ +#!/bin/sh + +if [ "${TERM%%-*}" = "screen" ]; then + if [ -n "$TMUX" ]; then + printf "\033Ptmux;\033\033]4;236;rgb:32/30/2f\007\033\\" + printf "\033Ptmux;\033\033]4;234;rgb:1d/20/21\007\033\\" + + printf "\033Ptmux;\033\033]4;235;rgb:28/28/28\007\033\\" + printf "\033Ptmux;\033\033]4;237;rgb:3c/38/36\007\033\\" + printf "\033Ptmux;\033\033]4;239;rgb:50/49/45\007\033\\" + printf "\033Ptmux;\033\033]4;241;rgb:66/5c/54\007\033\\" + printf "\033Ptmux;\033\033]4;243;rgb:7c/6f/64\007\033\\" + + printf "\033Ptmux;\033\033]4;244;rgb:92/83/74\007\033\\" + printf "\033Ptmux;\033\033]4;245;rgb:92/83/74\007\033\\" + + printf "\033Ptmux;\033\033]4;228;rgb:f2/e5/bc\007\033\\" + printf "\033Ptmux;\033\033]4;230;rgb:f9/f5/d7\007\033\\" + + printf "\033Ptmux;\033\033]4;229;rgb:fb/f1/c7\007\033\\" + printf "\033Ptmux;\033\033]4;223;rgb:eb/db/b2\007\033\\" + printf "\033Ptmux;\033\033]4;250;rgb:d5/c4/a1\007\033\\" + printf "\033Ptmux;\033\033]4;248;rgb:bd/ae/93\007\033\\" + printf "\033Ptmux;\033\033]4;246;rgb:a8/99/84\007\033\\" + + printf "\033Ptmux;\033\033]4;167;rgb:fb/49/34\007\033\\" + printf "\033Ptmux;\033\033]4;142;rgb:b8/bb/26\007\033\\" + printf "\033Ptmux;\033\033]4;214;rgb:fa/bd/2f\007\033\\" + printf "\033Ptmux;\033\033]4;109;rgb:83/a5/98\007\033\\" + printf "\033Ptmux;\033\033]4;175;rgb:d3/86/9b\007\033\\" + printf "\033Ptmux;\033\033]4;108;rgb:8e/c0/7c\007\033\\" + printf "\033Ptmux;\033\033]4;208;rgb:fe/80/19\007\033\\" + + printf "\033Ptmux;\033\033]4;88;rgb:9d/00/06\007\033\\" + printf "\033Ptmux;\033\033]4;100;rgb:79/74/0e\007\033\\" + printf "\033Ptmux;\033\033]4;136;rgb:b5/76/14\007\033\\" + printf "\033Ptmux;\033\033]4;24;rgb:07/66/78\007\033\\" + printf "\033Ptmux;\033\033]4;96;rgb:8f/3f/71\007\033\\" + printf "\033Ptmux;\033\033]4;66;rgb:42/7b/58\007\033\\" + printf "\033Ptmux;\033\033]4;130;rgb:af/3a/03\007\033\\" + else + printf "\033P\033]4;236;rgb:32/30/2f\007\033\\" + printf "\033P\033]4;234;rgb:1d/20/21\007\033\\" + + printf "\033P\033]4;235;rgb:28/28/28\007\033\\" + printf "\033P\033]4;237;rgb:3c/38/36\007\033\\" + printf "\033P\033]4;239;rgb:50/49/45\007\033\\" + printf "\033P\033]4;241;rgb:66/5c/54\007\033\\" + printf "\033P\033]4;243;rgb:7c/6f/64\007\033\\" + + printf "\033P\033]4;244;rgb:92/83/74\007\033\\" + printf "\033P\033]4;245;rgb:92/83/74\007\033\\" + + printf "\033P\033]4;228;rgb:f2/e5/bc\007\033\\" + printf "\033P\033]4;230;rgb:f9/f5/d7\007\033\\" + + printf "\033P\033]4;229;rgb:fb/f1/c7\007\033\\" + printf "\033P\033]4;223;rgb:eb/db/b2\007\033\\" + printf "\033P\033]4;250;rgb:d5/c4/a1\007\033\\" + printf "\033P\033]4;248;rgb:bd/ae/93\007\033\\" + printf "\033P\033]4;246;rgb:a8/99/84\007\033\\" + + printf "\033P\033]4;167;rgb:fb/49/34\007\033\\" + printf "\033P\033]4;142;rgb:b8/bb/26\007\033\\" + printf "\033P\033]4;214;rgb:fa/bd/2f\007\033\\" + printf "\033P\033]4;109;rgb:83/a5/98\007\033\\" + printf "\033P\033]4;175;rgb:d3/86/9b\007\033\\" + printf "\033P\033]4;108;rgb:8e/c0/7c\007\033\\" + printf "\033P\033]4;208;rgb:fe/80/19\007\033\\" + + printf "\033P\033]4;88;rgb:9d/00/06\007\033\\" + printf "\033P\033]4;100;rgb:79/74/0e\007\033\\" + printf "\033P\033]4;136;rgb:b5/76/14\007\033\\" + printf "\033P\033]4;24;rgb:07/66/78\007\033\\" + printf "\033P\033]4;96;rgb:8f/3f/71\007\033\\" + printf "\033P\033]4;66;rgb:42/7b/58\007\033\\" + printf "\033P\033]4;130;rgb:af/3a/03\007\033\\" + fi + +elif [ "$TERM" != "linux" ] && [ "$TERM" != "vt100" ] && [ "$TERM" != "vt220" ]; then + + printf "\033]4;236;rgb:32/30/2f\033\\" + printf "\033]4;234;rgb:1d/20/21\033\\" + + printf "\033]4;235;rgb:28/28/28\033\\" + printf "\033]4;237;rgb:3c/38/36\033\\" + printf "\033]4;239;rgb:50/49/45\033\\" + printf "\033]4;241;rgb:66/5c/54\033\\" + printf "\033]4;243;rgb:7c/6f/64\033\\" + + printf "\033]4;244;rgb:92/83/74\033\\" + printf "\033]4;245;rgb:92/83/74\033\\" + + printf "\033]4;228;rgb:f2/e5/bc\033\\" + printf "\033]4;230;rgb:f9/f5/d7\033\\" + + printf "\033]4;229;rgb:fb/f1/c7\033\\" + printf "\033]4;223;rgb:eb/db/b2\033\\" + printf "\033]4;250;rgb:d5/c4/a1\033\\" + printf "\033]4;248;rgb:bd/ae/93\033\\" + printf "\033]4;246;rgb:a8/99/84\033\\" + + printf "\033]4;167;rgb:fb/49/34\033\\" + printf "\033]4;142;rgb:b8/bb/26\033\\" + printf "\033]4;214;rgb:fa/bd/2f\033\\" + printf "\033]4;109;rgb:83/a5/98\033\\" + printf "\033]4;175;rgb:d3/86/9b\033\\" + printf "\033]4;108;rgb:8e/c0/7c\033\\" + printf "\033]4;208;rgb:fe/80/19\033\\" + + printf "\033]4;88;rgb:9d/00/06\033\\" + printf "\033]4;100;rgb:79/74/0e\033\\" + printf "\033]4;136;rgb:b5/76/14\033\\" + printf "\033]4;24;rgb:07/66/78\033\\" + printf "\033]4;96;rgb:8f/3f/71\033\\" + printf "\033]4;66;rgb:42/7b/58\033\\" + printf "\033]4;130;rgb:af/3a/03\033\\" +fi diff --git a/sources_non_forked/gruvbox/gruvbox_256palette_osx.sh b/sources_non_forked/gruvbox/gruvbox_256palette_osx.sh new file mode 100644 index 00000000..ad5111a1 --- /dev/null +++ b/sources_non_forked/gruvbox/gruvbox_256palette_osx.sh @@ -0,0 +1,116 @@ +#!/bin/sh + +if [ "${TERM%%-*}" = "screen" ]; then + if [ -n "$TMUX" ]; then + printf "\033Ptmux;\033\033]4;236;rgb:26/24/23\007\033\\" + printf "\033Ptmux;\033\033]4;234;rgb:16/18/19\007\033\\" + + printf "\033Ptmux;\033\033]4;235;rgb:1e/1e/1e\007\033\\" + printf "\033Ptmux;\033\033]4;237;rgb:2e/2a/29\007\033\\" + printf "\033Ptmux;\033\033]4;239;rgb:3f/39/35\007\033\\" + printf "\033Ptmux;\033\033]4;241;rgb:53/4a/42\007\033\\" + printf "\033Ptmux;\033\033]4;243;rgb:68/5c/51\007\033\\" + + printf "\033Ptmux;\033\033]4;244;rgb:7f/70/61\007\033\\" + printf "\033Ptmux;\033\033]4;245;rgb:7f/70/61\007\033\\" + + printf "\033Ptmux;\033\033]4;228;rgb:ef/df/ae\007\033\\" + printf "\033Ptmux;\033\033]4;230;rgb:f8/f4/cd\007\033\\" + + printf "\033Ptmux;\033\033]4;229;rgb:fa/ee/bb\007\033\\" + printf "\033Ptmux;\033\033]4;223;rgb:e6/d4/a3\007\033\\" + printf "\033Ptmux;\033\033]4;250;rgb:cb/b8/90\007\033\\" + printf "\033Ptmux;\033\033]4;248;rgb:af/9f/81\007\033\\" + printf "\033Ptmux;\033\033]4;246;rgb:97/87/71\007\033\\" + + printf "\033Ptmux;\033\033]4;167;rgb:f7/30/28\007\033\\" + printf "\033Ptmux;\033\033]4;142;rgb:aa/b0/1e\007\033\\" + printf "\033Ptmux;\033\033]4;214;rgb:f7/b1/25\007\033\\" + printf "\033Ptmux;\033\033]4;109;rgb:71/95/86\007\033\\" + printf "\033Ptmux;\033\033]4;175;rgb:c7/70/89\007\033\\" + printf "\033Ptmux;\033\033]4;108;rgb:7d/b6/69\007\033\\" + printf "\033Ptmux;\033\033]4;208;rgb:fb/6a/16\007\033\\" + + printf "\033Ptmux;\033\033]4;88;rgb:89/00/09\007\033\\" + printf "\033Ptmux;\033\033]4;100;rgb:66/62/0d\007\033\\" + printf "\033Ptmux;\033\033]4;136;rgb:a5/63/11\007\033\\" + printf "\033Ptmux;\033\033]4;24;rgb:0e/53/65\007\033\\" + printf "\033Ptmux;\033\033]4;96;rgb:7b/2b/5e\007\033\\" + printf "\033Ptmux;\033\033]4;66;rgb:35/6a/46\007\033\\" + printf "\033Ptmux;\033\033]4;130;rgb:9d/28/07\007\033\\" + else + printf "\033P\033]4;236;rgb:26/24/23\007\033\\" + printf "\033P\033]4;234;rgb:16/18/19\007\033\\" + + printf "\033P\033]4;235;rgb:1e/1e/1e\007\033\\" + printf "\033P\033]4;237;rgb:2e/2a/29\007\033\\" + printf "\033P\033]4;239;rgb:3f/39/35\007\033\\" + printf "\033P\033]4;241;rgb:53/4a/42\007\033\\" + printf "\033P\033]4;243;rgb:68/5c/51\007\033\\" + + printf "\033P\033]4;244;rgb:7f/70/61\007\033\\" + printf "\033P\033]4;245;rgb:7f/70/61\007\033\\" + + printf "\033P\033]4;228;rgb:ef/df/ae\007\033\\" + printf "\033P\033]4;230;rgb:f8/f4/cd\007\033\\" + + printf "\033P\033]4;229;rgb:fa/ee/bb\007\033\\" + printf "\033P\033]4;223;rgb:e6/d4/a3\007\033\\" + printf "\033P\033]4;250;rgb:cb/b8/90\007\033\\" + printf "\033P\033]4;248;rgb:af/9f/81\007\033\\" + printf "\033P\033]4;246;rgb:97/87/71\007\033\\" + + printf "\033P\033]4;167;rgb:f7/30/28\007\033\\" + printf "\033P\033]4;142;rgb:aa/b0/1e\007\033\\" + printf "\033P\033]4;214;rgb:f7/b1/25\007\033\\" + printf "\033P\033]4;109;rgb:71/95/86\007\033\\" + printf "\033P\033]4;175;rgb:c7/70/89\007\033\\" + printf "\033P\033]4;108;rgb:7d/b6/69\007\033\\" + printf "\033P\033]4;208;rgb:fb/6a/16\007\033\\" + + printf "\033P\033]4;88;rgb:89/00/09\007\033\\" + printf "\033P\033]4;100;rgb:66/62/0d\007\033\\" + printf "\033P\033]4;136;rgb:a5/63/11\007\033\\" + printf "\033P\033]4;24;rgb:0e/53/65\007\033\\" + printf "\033P\033]4;96;rgb:7b/2b/5e\007\033\\" + printf "\033P\033]4;66;rgb:35/6a/46\007\033\\" + printf "\033P\033]4;130;rgb:9d/28/07\007\033\\" + fi +else + printf "\033]4;236;rgb:26/24/23\033\\" + printf "\033]4;234;rgb:16/18/19\033\\" + + printf "\033]4;235;rgb:1e/1e/1e\033\\" + printf "\033]4;237;rgb:2e/2a/29\033\\" + printf "\033]4;239;rgb:3f/39/35\033\\" + printf "\033]4;241;rgb:53/4a/42\033\\" + printf "\033]4;243;rgb:68/5c/51\033\\" + + printf "\033]4;244;rgb:7f/70/61\033\\" + printf "\033]4;245;rgb:7f/70/61\033\\" + + printf "\033]4;228;rgb:ef/df/ae\033\\" + printf "\033]4;230;rgb:f8/f4/cd\033\\" + + printf "\033]4;229;rgb:fa/ee/bb\033\\" + printf "\033]4;223;rgb:e6/d4/a3\033\\" + printf "\033]4;250;rgb:cb/b8/90\033\\" + printf "\033]4;248;rgb:af/9f/81\033\\" + printf "\033]4;246;rgb:97/87/71\033\\" + + printf "\033]4;167;rgb:f7/30/28\033\\" + printf "\033]4;142;rgb:aa/b0/1e\033\\" + printf "\033]4;214;rgb:f7/b1/25\033\\" + printf "\033]4;109;rgb:71/95/86\033\\" + printf "\033]4;175;rgb:c7/70/89\033\\" + printf "\033]4;108;rgb:7d/b6/69\033\\" + printf "\033]4;208;rgb:fb/6a/16\033\\" + + printf "\033]4;88;rgb:89/00/09\033\\" + printf "\033]4;100;rgb:66/62/0d\033\\" + printf "\033]4;136;rgb:a5/63/11\033\\" + printf "\033]4;24;rgb:0e/53/65\033\\" + printf "\033]4;96;rgb:7b/2b/5e\033\\" + printf "\033]4;66;rgb:35/6a/46\033\\" + printf "\033]4;130;rgb:9d/28/07\033\\" +fi diff --git a/sources_non_forked/lightline.vim/.travis.yml b/sources_non_forked/lightline.vim/.travis.yml index ae4b73fb..3767d735 100644 --- a/sources_non_forked/lightline.vim/.travis.yml +++ b/sources_non_forked/lightline.vim/.travis.yml @@ -4,19 +4,26 @@ 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) + - (if ! test -d $HOME/vim-$VIM_VERSION/bin; then + git clone https://github.com/vim/vim $HOME/vim && + cd $HOME/vim && + git checkout v$VIM_VERSION && + ./configure --prefix=$HOME/vim-$VIM_VERSION && + make && + make install; + fi) cache: directories: - - $HOME/vim-7.4 - - $HOME/vim-7.3 - - $HOME/vim-7.2.051 + - $HOME/vim-$VIM_VERSION + +env: + - VIM_VERSION=8.0.0000 + - VIM_VERSION=7.4 + - VIM_VERSION=7.3 + - VIM_VERSION=7.2.051 script: + - export PATH=$HOME/vim-$VIM_VERSION/bin:$PATH + - vim --version - /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/sources_non_forked/lightline.vim/LICENSE b/sources_non_forked/lightline.vim/LICENSE index 3000b844..2b0f7e18 100644 --- a/sources_non_forked/lightline.vim/LICENSE +++ b/sources_non_forked/lightline.vim/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013-2016 itchyny +Copyright (c) 2013-2017 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 diff --git a/sources_non_forked/lightline.vim/README.md b/sources_non_forked/lightline.vim/README.md index 2b80f35b..b9c1a1ae 100644 --- a/sources_non_forked/lightline.vim/README.md +++ b/sources_non_forked/lightline.vim/README.md @@ -1,42 +1,47 @@ # lightline.vim -A light and configurable statusline/tabline for Vim +A light and configurable statusline/tabline plugin for Vim https://github.com/itchyny/lightline.vim -### powerline theme (default) +### powerline (default) -![lightline.vim - powerline](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/powerline/0.png) +![lightline.vim - powerline](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/powerline.png) -### wombat (with the patched font) +### wombat -![lightline.vim - wombat](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/wombat/0.png) +![lightline.vim - wombat](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/wombat.png) -### jellybeans (with the patched font) +### jellybeans -![lightline.vim - jellybeans](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/jellybeans/0.png) +![lightline.vim - jellybeans](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/jellybeans.png) -### solarized theme (dark) +### solarized dark -![lightline.vim - solarized_dark](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_dark/0.png) +![lightline.vim - solarized_dark](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_dark.png) -### solarized theme (light) +### solarized light -![lightline.vim - solarized_light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_light/0.png) +![lightline.vim - solarized_light](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/solarized_light.png) -### PaperColor theme (light) +### PaperColor light -![lightline.vim - PaperColor](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/PaperColor/0.png) +![lightline.vim - PaperColor](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/PaperColor.png) -### seoul256 theme +### seoul256 -![lightline.vim - seoul256](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/seoul256/0.png) +![lightline.vim - seoul256](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/seoul256.png) -### landscape theme (with the patched font) +### Dracula -![lightline.vim - landscape](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/landscape/0.png) +![lightline.vim - Dracula](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/Dracula.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) +### one + +![lightline.vim - one](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/one.png) + +### landscape + +![lightline.vim - landscape](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/landscape.png) landscape is my colorscheme, which is a high-contrast cui-supported colorscheme, available at https://github.com/itchyny/landscape.vim @@ -46,724 +51,328 @@ landscape is my colorscheme, which is a high-contrast cui-supported colorscheme, + [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. ++ Minimalism. The core script is very small to achive enough functions as a statusline plugin. ++ Configurability. You can create your own component and easily add to the statusline and the tabline. ++ Orthogonality. The plugin does not rely on the implementation of other plugins. Such plugin crossing settings should be configured by users. ## Installation -### Manually -1. Put all files under $VIM. - -### Pathogen +### [Pathogen](https://github.com/tpope/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) +### [Vundle](https://github.com/VundleVim/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) +### [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) +### [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: +## Introduction +After installing this plugin, you restart the editor and will get a cool statusline. ![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: +The color of the statusline changes due to the mode of Vim. Try typing something, selecting in visual mode and replacing some texts. -![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/2.png) - - -If your statusline looks like +If the 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 +add the following configuration to your `.vimrc`. ```vim set laststatus=2 ``` -to your `.vimrc`. - -If you have problem like +If the statusline does not be coloured like ![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/20.png) -then add +then modify `TERM` in your shell configuration (`.zshrc` for example) ```sh export TERM=xterm-256color ``` -to your `.*shrc` and add +and then add the following configure to your `.vimrc`. ```vim if !has('gui_running') set t_Co=256 endif ``` -to your `.vimrc`. +Your statusline appears to work correctly? If yes, great, thanks for choosing lightline.vim! If no, please file a issue report to the [issue tracker](https://github.com/itchyny/lightline.vim/issues). -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 <bf> 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) +By the way, `-- INSERT --` is unnecessary anymore because the mode information is displayed in the statusline. +![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/13.png) +If you want to get rid of it, configure as follows. ```vim set noshowmode ``` +## Colorscheme configuration +The lightline.vim plugin provides multiple colorschemes to meet your editor colorscheme. +Do not be confused, editor colorscheme rules how codes look like in buffers and lightline.vim has independent colorscheme feature, which rules how the statusline looks like. -Now, let's 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. +If you are using wombat colorscheme, add the following setting to your `.vimrc`, ```vim let g:lightline = { \ 'colorscheme': 'wombat', - \ 'component': { - \ 'readonly': '%{&filetype=="help"?"":&readonly?"⭤":""}', - \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}' - \ }, - \ 'separator': { 'left': '⮀', 'right': '⮂' }, - \ 'subseparator': { 'left': '⮁', 'right': '⮃' } \ } ``` +restart Vim and the statusline looks like: + +![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/2.png) + +If the colors of the statusline do not change, move the settings of `g:lightline` before setting the editor colorscheme. + +There are many lightline colorschemes available as screenshots shown above. See `:h g:lightline.colorscheme` for the complete list. + +## Advanced configuration +The default appearance of lightline.vim is carefully designed that the tutorial is enough here for most people. +So please read this section if you really want to configure and enjoy the configurability of lightline.vim. + +Sometimes people want to display information of other plugins. +For example git branch information, syntax check errors and some statuses of plugins. + +The lightline.vim plugin does not provide any plugin integration by default. +This plugin considers orthogonality to be one of the important ideas, which means that the plugin does not rely on implementation of other plugins. +Once a plugin starts to integrate with some famous plugins, it should be kept updated to follow the changes of the plugins, and should accept integration requests with new plugins and it will suffer from performance regression due to plugin availability checks. + +Instead, lightline.vim provides a simple API that user can easily integrate with other plugins. +Once you understand how to configure and how it will be displayed in the statusline, you can also tell how to integrate with your favorite plugins. + +Let's start to configure the appearance. +The statusline is composed by multiple components. +It shows the current mode, filename, modified status on the left, and file format, encoding, filetype and cursor positions on the right. +So in order to add something in the statusline, you firstly create a new component and specify the place. + +This is the hello world of lightline.vim component. +```vim +let g:lightline = { + \ 'colorscheme': 'wombat', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'readonly', 'filename', 'modified', 'helloworld' ] ] + \ }, + \ 'component': { + \ 'helloworld': 'Hello, world!' + \ }, + \ } +``` +The statusline will look like: +![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/3.png) + +You have succeeded in displaying `Hello, world!` in the statusline. +The `helloworld` component is added to `g:lightline.active.left` and its content is configured in `g:lightline.component`. +The component contents are simply added to `&statusline`. +Try `:echo &statusline`, it might be a little bit complicated, but you will find `Hello, world!` somewhere. + +You can use `'statusline'` syntax for lightline.vim components. +Consult `:h 'statusline'` to see what's available here. +For example, if you want to print the value of character under the cursor in hexadecimal, configure as +```vim +let g:lightline = { + \ 'colorscheme': 'wombat', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'readonly', 'filename', 'modified', 'charvaluehex' ] ] + \ }, + \ 'component': { + \ 'charvaluehex': '0x%B' + \ }, + \ } +``` +![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/4.png) + +You want the character value information on the right hand side? OK, configure as +```vim +let g:lightline = { + \ 'colorscheme': 'wombat', + \ 'active': { + \ 'right': [ [ 'lineinfo' ], + \ [ 'percent' ], + \ [ 'fileformat', 'fileencoding', 'filetype', 'charvaluehex' ] ] + \ }, + \ 'component': { + \ 'charvaluehex': '0x%B' + \ }, + \ } +``` +![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/5.png) + +We have learned how to add a simple component. + +- See `:h 'statusline'` to check the statusline flags. +- Add a new component to `g:lightline.component`. +- Add the component name to `g:lightline.active.left` or `g:lightline.active.right`. + +You can also configure the statusline of inactive buffers by adding the component to `g:lightline.inactive.left` or `g:lightline.inactive.right`. + + +Now let's add some integrations with other plugin. +The name of the git branch is important these days. +But lightline.vim does not provide this information by default because it is also one of plugin crossing configurations, and not all people want the integration. + +In order to show the branch name in the statusline, install some plugins which provides the branch information. +The [vim-fugitive](https://github.com/tpope/vim-fugitive) plugin is a famous plugin so let's integrate lightline.vim with it. +If you don't like to install full git integration but just want to display the branch name in the statusline, you can use the [vim-gitbranch](https://github.com/itchyny/vim-gitbranch) plugin which provides `gitbranch#name` function. +```vim +let g:lightline = { + \ 'colorscheme': 'wombat', + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ] + \ }, + \ 'component_function': { + \ 'gitbranch': 'fugitive#head' + \ }, + \ } +``` +![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/6.png) + +Okay, now the statusline shows that we are coding at the master branch. +What do we learn from this example? + +- Find out the function which is suitable to use in the statusline. +- Create a function component. The previous `charvaluehex` component has `'statusline'` item configuration and registered in `g:lightline.component`. In the current example, we register the name of the function in `g:lightline.component_function`. It should return the string to be displayed in the statusline. +- Add the component name `gitbranch` to `g:lightline.active.left` or `g:lightline.active.right`. + + +Here we have leaned two kinds of components. + +- component: it has a `%`-prefixed item which you can find the meaning at `:h 'statusline'`. All the default components of lightline.vim are components in this style. See the default components at `:h g:lightline.component`. +- function component: the name of functions are registered. The function is called again and again so be careful not to register a heavy function. See the help with `:h g:lightline.component_function`. + + +The function component is an important design for the configurability of lightline.vim. +By providing the configuration interface via functions, you can adjust the statusline information as you wish. +For the proof, let's look into some configuration examples in Q&A style. + +### Can I hide the readonly component in the help buffer? +Yes, create a function component for `readonly`. +The configuration of function component has priority over the default component. +```vim +let g:lightline = { + \ 'component_function': { + \ 'readonly': 'LightlineReadonly', + \ }, + \ } + +function! LightlineReadonly() + return &readonly && &filetype !=# 'help' ? 'RO' : '' +endfunction +``` ![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/7.png) -Huh? Weird! -The subseparators are visible even if the components are empty. -In order to hide the subseparators, you can set expressions to `g:lightline.component_visible_condition`, which should be 1 only when the corresponding component is not empty. +### Can I hide the readonly component in other plugins buffer? +Yes, modify the `LightlineReadonly` function as you wish. ```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': '⮃' } - \ } +function! LightlineReadonly() + return &readonly && &filetype !~# '\v(help|vimfiler|unite)' ? 'RO' : '' +endfunction + +let g:unite_force_overwrite_statusline = 0 +let g:vimfiler_force_overwrite_statusline = 0 ``` ![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/8.png) -Okay. It works nice. -The configuration `component_visible_condition` is used to control the visibility of the subseparators. -You cannot use this variable to control the visibility of the components themselves. - -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`. +### Can I display the plugin information at the filename component? +Yes, overwrite the filename component. ```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) - -Again look into `g:lightline.active.left`. -```vim -let g:lightline = { - \ 'active': { - \ 'left': [ [ 'mode', 'paste' ], - \ [ 'readonly', 'filename', 'modified' ] ] ... -``` - -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 configurations in `.vimrc` have priority over the default settings in lightline. - - - -Git 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) | '⭡' (\u2b61) - -### 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() + return &filetype ==# 'vimfiler' ? vimfiler#get_status_string() : + \ &filetype ==# 'unite' ? unite#get_status_string() : + \ &filetype ==# 'vimshell' ? vimshell#get_status_string() : + \ expand('%:t') !=# '' ? expand('%:t') : '[No Name]' endfunction let g:unite_force_overwrite_statusline = 0 let g:vimfiler_force_overwrite_statusline = 0 let g:vimshell_force_overwrite_statusline = 0 ``` +![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/9.png) -### Note for developers of other plugins +### Can I display the plugin name at the mode component? +Yes, overwrite the mode component. +```vim +let g:lightline = { + \ 'component_function': { + \ 'mode': 'LightlineMode', + \ }, + \ } + +function! LightlineMode() + return expand('%:t') ==# '__Tagbar__' ? 'Tagbar': + \ expand('%:t') ==# 'ControlP' ? 'CtrlP' : + \ &filetype ==# 'unite' ? 'Unite' : + \ &filetype ==# 'vimfiler' ? 'VimFiler' : + \ &filetype ==# 'vimshell' ? 'VimShell' : + \ lightline#mode() +endfunction +``` +![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/10.png) + +### Can I trim the file format and encoding information on narrow windows? +Yes, check `winwidth(0)` and return empty string with some threshold. +```vim +let g:lightline = { + \ 'component_function': { + \ 'fileformat': 'LightlineFileformat', + \ 'filetype': 'LightlineFiletype', + \ }, + \ } + +function! LightlineFileformat() + return winwidth(0) > 70 ? &fileformat : '' +endfunction + +function! LightlineFiletype() + return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : '' +endfunction +``` +![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/11.png) + +### Can I trim the bar between the filename and modified sign? +Yes, by joining the two components. +```vim +let g:lightline = { + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'readonly', 'filename' ] ], + \ }, + \ 'component_function': { + \ 'filename': 'LightlineFilename', + \ }, + \ } + +function! LightlineFilename() + let filename = expand('%:t') !=# '' ? expand('%:t') : '[No Name]' + let modified = &modified ? ' +' : '' + return filename . modified +endfunction +``` +![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/12.png) + +You can control the visibility and contents by writing simple functions. +Now you notice how much function component is important for the configurability of lightline.vim. + +## Note for developers of other plugins Appearance consistency matters. The statusline is an important space for Vim users. @@ -771,9 +380,14 @@ 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. +A good design is as follows. 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. +Lastly, for advanced users, set important information in buffer variables so that the users can obtain the condition of the plugin easily. + +## Author +itchyny (https://github.com/itchyny) + +## License +This software is released under the MIT License, see LICENSE. diff --git a/sources_non_forked/lightline.vim/autoload/lightline/colorscheme/darcula.vim b/sources_non_forked/lightline.vim/autoload/lightline/colorscheme/darcula.vim new file mode 100644 index 00000000..928e8b76 --- /dev/null +++ b/sources_non_forked/lightline.vim/autoload/lightline/colorscheme/darcula.vim @@ -0,0 +1,37 @@ +" ============================================================================= +" Filename: autoload/lightline/colorscheme/darcula.vim +" Author: kkopec +" License: MIT License +" Last Change: 2017/02/11 21:18:54. +" ============================================================================= + +let s:black = [ '#2b2b2b', 235 ] +let s:gray = [ '#323232', 236 ] +let s:white = [ '#a9b7c6', 250 ] +let s:blue = [ '#6897bb' , 67 ] +let s:green = [ '#629755', 71 ] +let s:purple = [ '#9876aa', 104 ] +let s:red = [ '#ff6b68', 204 ] +let s:yellow = [ '#ffc66d', 222 ] + +let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}} +let s:p.normal.left = [ [ s:black, s:purple ], [ s:purple, s:gray ] ] +let s:p.normal.right = [ [ s:black, s:purple ], [ s:purple, s:gray ] ] +let s:p.inactive.left = [ [ s:black, s:blue ], [ s:blue, s:gray ] ] +let s:p.inactive.right = [ [ s:black, s:blue ], [ s:blue, s:gray ] ] +let s:p.insert.left = [ [ s:black, s:green ], [ s:green, s:gray ] ] +let s:p.insert.right = [ [ s:black, s:green ], [ s:green, s:gray ] ] +let s:p.replace.left = [ [ s:black, s:red ], [ s:red, s:gray ] ] +let s:p.replace.right = [ [ s:black, s:red ], [ s:red, s:gray ] ] +let s:p.visual.left = [ [ s:black, s:yellow ], [ s:yellow, s:gray ] ] +let s:p.visual.right = [ [ s:black, s:yellow ], [ s:yellow, s:gray ] ] +let s:p.normal.middle = [ [ s:white, s:gray ] ] +let s:p.inactive.middle = [ [ s:white, s:gray ] ] +let s:p.tabline.left = [ [ s:blue, s:gray ] ] +let s:p.tabline.tabsel = [ [ s:black, s:blue ] ] +let s:p.tabline.middle = [ [ s:blue, s:gray ] ] +let s:p.tabline.right = [ [ s:black, s:blue ] ] +let s:p.normal.error = [ [ s:red, s:black ] ] +let s:p.normal.warning = [ [ s:yellow, s:black ] ] + +let g:lightline#colorscheme#darcula#palette = lightline#colorscheme#flatten(s:p) diff --git a/sources_non_forked/lightline.vim/doc/lightline.txt b/sources_non_forked/lightline.vim/doc/lightline.txt index 8b0a580d..0b41c12a 100644 --- a/sources_non_forked/lightline.vim/doc/lightline.txt +++ b/sources_non_forked/lightline.vim/doc/lightline.txt @@ -4,7 +4,7 @@ Version: 0.1 Author: itchyny (https://github.com/itchyny) License: MIT License Repository: https://github.com/itchyny/lightline.vim -Last Change: 2016/10/24 08:12:28. +Last Change: 2017/05/28 01:07:02. CONTENTS *lightline-contents* @@ -29,39 +29,40 @@ The *lightline* plugin is a light and configurable statusline/tabline for Vim. SPIRIT *lightline-spirit* Minimalism - The core script is very small. + The core script is very small to achive enough functions as a + statusline plugin. Configurability - You can create your own component and easily add to the - statusline/tabline. + You can create your own component and easily add to the statusline + and the tabline. Orthogonality - Any plugin should not change the settings of another plugin. - Such plugin-crossing settings should be written by users in - .vimrc. + The plugin does not rely on the implementation of other plugins. + Such plugin crossing settings should be configured by users. - 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. + You find this plugin does not integrate with other plugins by default. + This plugin does not provide branch information, which is a basic + component in existing statusline plugins. It is a design of + lightline.vim that such plugin crossing configuration should be + written by users. Once a plugin starts to integrate with some famous + plugins, it should be kept updated to follow the changes of the + plugins and should accept integration requests with new plugins. + Instead, lightline.vim is designed very carefully so that users can + easily integrate with other plugins. Good APIs keep a plugin clean. ------------------------------------------------------------------------------ OPTIONS *lightline-option* g:lightline *g:lightline* - All the options are stored into this global variable. + All the configurations are stored in 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|. + Dictionaries to store the statusline/tabline components. Note that right groups of components are stored from right to - left. The default values are: + left. + The default values are: > let g:lightline.active = { \ 'left': [ [ 'mode', 'paste' ], @@ -78,10 +79,7 @@ OPTIONS *lightline-option* \ '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|. + A dictionary to store the tab components in each tabs. The default values are: > let g:lightline.tab = { @@ -89,7 +87,7 @@ OPTIONS *lightline-option* \ 'inactive': [ 'tabnum', 'filename', 'modified' ] } < g:lightline.component *g:lightline.component* - Dictionary for statusline/tabline components. + A dictionary for statusline/tabline components. The default value is: > let g:lightline.component = { @@ -116,11 +114,11 @@ OPTIONS *lightline-option* < g:lightline.component_visible_condition *g:lightline.component_visible_condition* - Dictionary to store the visible condition of the components. - Each expression should correspond to the condition each - component is not empty. This configuration is used to control - the visibility of the subseparators. You cannot use this - configuration to control the visibility of the components. + A dictionary to store the visible condition of the components. + Note that this configuration is used to control the visibility + of the subseparators, not to control the visibility of the + components themselves. Each expression should correspond to + the condition on which each component is not empty. The default value is: > let g:lightline.component_visible_condition = { @@ -129,52 +127,47 @@ OPTIONS *lightline-option* \ '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. + A dictionary to store the function components. + This is useful to write a complex component configuration and + to integrate with other plugins. If a component set in both + component and component_function, the configuration of + component_function has priority. The default value is: > let g:lightline.component_function = {} < - For example, if you want a component for read-only mark, which - disappears in help windows: + For example, if you want to display the name of the git branch, + install |vim-fugitive| plugin and then configure as: > let g:lightline = { \ 'active': { \ 'left': [ [ 'mode', 'paste' ], - \ [ 'myreadonly', 'filename', 'modified' ] ], + \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ] \ }, \ 'component_function': { - \ 'myreadonly': 'LightlineReadonly' + \ 'gitbranch': 'fugitive#head' \ }, \ } - function! LightlineReadonly() - return &ft !~? 'help' && &readonly ? 'RO' : '' - endfunction < g:lightline.component_function_visible_condition *g:lightline.component_function_visible_condition* - Dictionary to store the visible conditions of the function + A dictionary to store the visible conditions of the function components. Each expression should correspond to the condition each component is not empty. This configuration is used to control the visibility of the subseparators. You can use this configuration to reduce the number of function calls for - function components by setting the value 1 (to tell lightline + performance improvement by setting the value 1 (to tell lightline that the component is always visible). The default value is: > let g:lightline.component_function_visible_condition = {} < 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 dictionary to store expanding components. You can create + warning and critical components. The values should be the name + of functions should return either one of: + a string + an array of three elements: [[ left ], [ middle ], [ right ]] @@ -223,7 +216,8 @@ OPTIONS *lightline-option* The colorscheme for lightline.vim. Currently, wombat, solarized, powerline, jellybeans, Tomorrow, Tomorrow_Night, Tomorrow_Night_Blue, Tomorrow_Night_Eighties, - PaperColor, seoul256, landscape, one, Dracula, Molokai and 16color are available. + PaperColor, seoul256, landscape, one, Dracula, darcula, + Molokai and 16color are available. The default value is: > let g:lightline.colorscheme = 'default' @@ -280,7 +274,6 @@ OPTIONS *lightline-option* \ 'tabline': 1 \ } < - ============================================================================== FONT *lightline-font* You can use the patched font you used for |vim-powerline| and |powerline|. diff --git a/sources_forked/mru/README b/sources_non_forked/mru.vim/README similarity index 82% rename from sources_forked/mru/README rename to sources_non_forked/mru.vim/README index 4d8b9b0b..04c3a748 100644 --- a/sources_forked/mru/README +++ b/sources_non_forked/mru.vim/README @@ -14,6 +14,10 @@ Vim, then you should use an older version of the MRU plugin. The recently used filenames are stored in a file specified by the Vim MRU_File variable. +The Github repository for the MRU plugin is available at: + + http://github.com/yegappan/mru + Usage To list and edit files from the MRU list, you can use the ":MRU" command. @@ -36,7 +40,8 @@ previous window has a modified buffer or is the preview window or is used by some other plugin, then the file is opened in a new window. You can press the 'o' key to open the file name under the cursor in the -MRU window in a new window. +MRU window in a new window. You can also press instead of 'o' +to open the file in a new window. To open a file from the MRU window in read-only mode (view), press the 'v' key. @@ -46,19 +51,20 @@ file is already opened in a window in the current or in another tab, then the cursor is moved to that tab. Otherwise, a new tab is opened. You can open multiple files from the MRU window by specifying a count before -pressing '' or 'v' or 'o' or 't'. You can also visually select -multiple filenames and invoke the commands to open the files. Each selected -file will be opened in a separate window or tab. +pressing '' or 'v' or 'o' or 't'. You can also visually (using +linewise visual mode) select multiple filenames and invoke the commands to +open the files. Each selected file will be opened in a separate window or +tab. You can press the 'u' key in the MRU window to update the file list. This is useful if you keep the MRU window open always. -You can close the MRU window by pressing the 'q' key or using one of the Vim -window commands. +You can close the MRU window by pressing the 'q' key or the key or +using one of the Vim window commands. To display only files matching a pattern from the MRU list in the MRU window, you can specify a pattern to the ":MRU" command. For example, to -display only file names containing "vim" in them, you can use the following +display only file names matching "vim" in them, you can use the following command ":MRU vim". When you specify a partial file name and only one matching filename is found, then the ":MRU" command will edit that file. @@ -79,6 +85,16 @@ Whenever the MRU list changes, the MRU file is updated with the latest MRU list. When you have multiple instances of Vim running at the same time, the latest MRU list will show up in all the instances of Vim. +The MRUFilename syntax group is used to highlight the file names in the MRU +window. By default, this syntax group is linked to the Identifier highlight +group. You can change the highlight group by adding the following line in +your .vimrc: + + highlight link MRUFileName LineNr + +The MRU buffer uses the 'mru file type. You can use this file type to add +custom auto commands, syntax highlighting, etc. + Configuration By changing the following variables you can configure the behavior of this @@ -164,3 +180,13 @@ number of file names displayed in a single sub-menu: let MRU_Max_Submenu_Entries = 15 +In the MRU window, the filenames are displayed in two parts. The first part +contains the file name without the path and the second part contains the +full path to the file in parenthesis. This format is controlled by the +MRU_Filename_Format variable. If you prefer to change this to some other +format, then you can modify the MRU_Filename_Format variable. For example, +to display the full path without splitting it, you can set this variable +as shown below: + + let MRU_Filename_Format={'formatter':'v:val', 'parser':'.*'} + diff --git a/sources_forked/mru/plugin/mru.vim b/sources_non_forked/mru.vim/plugin/mru.vim similarity index 87% rename from sources_forked/mru/plugin/mru.vim rename to sources_non_forked/mru.vim/plugin/mru.vim index 3bcd5007..5cf7015d 100644 --- a/sources_forked/mru/plugin/mru.vim +++ b/sources_non_forked/mru.vim/plugin/mru.vim @@ -1,14 +1,14 @@ " File: mru.vim " Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com) -" Version: 3.4 -" Last Modified: April 13, 2012 -" Copyright: Copyright (C) 2003-2012 Yegappan Lakshmanan -" Permission is hereby granted to use and distribute this code, +" Version: 3.9 +" Last Modified: Feb 3, 2015 +" Copyright: Copyright (C) 2003-2015 Yegappan Lakshmanan +" License: 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, " mru.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 +" holder be liable for any damages resulting from the use of this " software. " " Overview @@ -25,27 +25,19 @@ " The recently used filenames are stored in a file specified by the Vim " MRU_File variable. " +" The Github repository for the MRU plugin is available at: +" +" http://github.com/yegappan/mru +" " Installation " ------------ " 1. Copy the mru.vim file to one of the following directories: -" " $HOME/.vim/plugin - Unix like systems " $HOME/vimfiles/plugin - MS-Windows " $VIM:vimfiles:plugin - Macintosh " $VIM/vimfiles/plugin - All -" -" Refer to the following Vim help topics for more information about Vim -" plugins: -" -" :help add-plugin -" :help add-global-plugin -" :help runtimepath -" -" 2. Set the MRU_File Vim variable in the .vimrc file to the location of a -" file to store the most recently edited file names. This step is needed -" only if you want to change the default MRU filename. -" 3. Restart Vim. -" 4. You can use the ":MRU" command to list and edit the recently used files. +" 2. Restart Vim. +" 3. You can use the ":MRU" command to list and edit the recently used files. " In GUI Vim, you can use the 'File->Recent Files' menu to access the " recently used files. " @@ -75,7 +67,8 @@ " some other plugin, then the file is opened in a new window. " " You can press the 'o' key to open the file name under the cursor in the -" MRU window in a new window. +" MRU window in a new window. You can also press instead of 'o' +" to open the file in a new window. " " To open a file from the MRU window in read-only mode (view), press the 'v' " key. @@ -85,15 +78,16 @@ " the cursor is moved to that tab. Otherwise, a new tab is opened. " " You can open multiple files from the MRU window by specifying a count before -" pressing '' or 'v' or 'o' or 't'. You can also visually select -" multiple filenames and invoke the commands to open the files. Each selected -" file will be opened in a separate window or tab. +" pressing '' or 'v' or 'o' or 't'. You can also visually (using +" linewise visual mode) select multiple filenames and invoke the commands to +" open the files. Each selected file will be opened in a separate window or +" tab. " " You can press the 'u' key in the MRU window to update the file list. This is " useful if you keep the MRU window open always. " -" You can close the MRU window by pressing the 'q' key or using one of the Vim -" window commands. +" You can close the MRU window by pressing the 'q' key or the key or +" using one of the Vim window commands. " " To display only files matching a pattern from the MRU list in the MRU " window, you can specify a pattern to the ":MRU" command. For example, to @@ -118,6 +112,16 @@ " list. When you have multiple instances of Vim running at the same time, the " latest MRU list will show up in all the instances of Vim. " +" The MRUFilename syntax group is used to highlight the file names in the MRU +" window. By default, this syntax group is linked to the Identifier highlight +" group. You can change the highlight group by adding the following line in +" your .vimrc: +" +" highlight link MRUFileName LineNr +" +" The MRU buffer uses the 'mru file type. You can use this file type to add +" custom auto commands, syntax highlighting, etc. +" " Configuration " ------------- " By changing the following variables you can configure the behavior of this @@ -203,6 +207,17 @@ " " let MRU_Max_Submenu_Entries = 15 " +" In the MRU window, the filenames are displayed in two parts. The first part +" contains the file name without the path and the second part contains the +" full path to the file in parenthesis. This format is controlled by the +" MRU_Filename_Format variable. If you prefer to change this to some other +" format, then you can modify the MRU_Filename_Format variable. For example, +" to display the full path without splitting it, you can set this variable +" as shown below: +" +" let MRU_Filename_Format = +" \ {'formatter':'v:val', 'parser':'.*', 'syntax': '[^/\\]\+$'} +" " ****************** Do not modify after this line ************************ if exists('loaded_mru') finish @@ -296,6 +311,21 @@ if !exists('MRU_Open_File_Use_Tabs') let MRU_Open_File_Use_Tabs = 0 endif +" Format of the file names displayed in the MRU window. +" The default is to display the filename followed by the complete path to the +" file in parenthesis. This variable controls the expressions used to format +" and parse the path. This can be changed to display the filenames in a +" different format. The 'formatter' specifies how to split/format the filename +" and 'parser' specifies how to read the filename back; 'syntax' matches the +" part to be highlighted. +if !exists('MRU_Filename_Format') + let MRU_Filename_Format = { + \ 'formatter': 'fnamemodify(v:val, ":t") . " (" . v:val . ")"', + \ 'parser': '(\zs.*\ze)', + \ 'syntax': '^.\{-}\ze(' + \} +endif + " Control to temporarily lock the MRU list. Used to prevent files from " getting added to the MRU list when the ':vimgrep' command is executed. let s:mru_list_locked = 0 @@ -419,7 +449,11 @@ endfunction " that should be escaped (for security reasons) let s:esc_filename_chars = ' *?[{`$%#"|!<>();&' . "'\t\n" function! s:MRU_escape_filename(fname) - return escape(a:fname, s:esc_filename_chars) + if exists("*fnameescape") + return fnameescape(a:fname) + else + return escape(a:fname, s:esc_filename_chars) + endif endfunction " MRU_Edit_File {{{1 @@ -449,11 +483,13 @@ function! s:MRU_Edit_File(filename, sanitized) exe winnum . 'wincmd w' endif else - if &modified || &buftype != '' || &previewwindow + if !&hidden && (&modified || &buftype != '' || &previewwindow) " Current buffer has unsaved changes or is a special buffer or is - " the preview window. So open the file in a new window + " the preview window. The 'hidden' option is also not set. + " So open the file in a new window. exe 'split ' . esc_fname else + " The current file can be replaced with the selected file. exe 'edit ' . esc_fname endif endif @@ -484,7 +520,7 @@ function! s:MRU_Open_File_In_Tab(fname, esc_fname) exe 'tabnext ' . i else " Open a new tab as the last tab page - exe '999tabnew ' . a:esc_fname + exe '$tabnew ' . a:esc_fname endif endif @@ -503,8 +539,7 @@ endfunction " 'edit' - Edit the file as a regular file " multi : Specifies whether a single file or multiple files need to be " opened. -" open_type : Specifies where to open the file. Can be one of 'useopen' or -" 'newwin' or 'newtab'. +" open_type : Specifies where to open the file. " useopen - If the file is already present in a window, then " jump to that window. Otherwise, open the file in " the previous window. @@ -512,21 +547,25 @@ endfunction " newwin_vert - Open the file in a new vertical window. " newtab - Open the file in a new tab. If the file is already " opened in a tab, then jump to that tab. +" preview - Open the file in the preview window function! s:MRU_Window_Edit_File(fname, multi, edit_type, open_type) let esc_fname = s:MRU_escape_filename(a:fname) - if a:open_type == 'newwin_horiz' + if a:open_type ==# 'newwin_horiz' " Edit the file in a new horizontally split window above the previous " window wincmd p exe 'belowright new ' . esc_fname - elseif a:open_type == 'newwin_vert' + elseif a:open_type ==# 'newwin_vert' " Edit the file in a new vertically split window above the previous " window wincmd p exe 'belowright vnew ' . esc_fname - elseif a:open_type == 'newtab' || g:MRU_Open_File_Use_Tabs + elseif a:open_type ==# 'newtab' || g:MRU_Open_File_Use_Tabs call s:MRU_Open_File_In_Tab(a:fname, esc_fname) + elseif a:open_type ==# 'preview' + " Edit the file in the preview window + exe 'topleft pedit ' . esc_fname else " If the selected file is already open in one of the windows, " jump to it @@ -553,7 +592,7 @@ function! s:MRU_Window_Edit_File(fname, multi, edit_type, open_type) let split_window = 0 - if &modified || &previewwindow || a:multi + if (!&hidden && (&modified || &previewwindow)) || a:multi " Current buffer has unsaved changes or is the preview window " or the user is opening multiple files " So open the file in a new window @@ -572,13 +611,13 @@ function! s:MRU_Window_Edit_File(fname, multi, edit_type, open_type) if split_window " Current buffer has unsaved changes or is a special buffer or " is the preview window. So open the file in a new window - if a:edit_type == 'edit' + if a:edit_type ==# 'edit' exe 'split ' . esc_fname else exe 'sview ' . esc_fname endif else - if a:edit_type == 'edit' + if a:edit_type ==# 'edit' exe 'edit ' . esc_fname else exe 'view ' . esc_fname @@ -619,7 +658,7 @@ function! s:MRU_Select_File_Cmd(opt) range endif " The text in the MRU window contains the filename in parenthesis - let file = matchstr(f, '(\zs.*\ze)') + let file = matchstr(f, g:MRU_Filename_Format.parser) call s:MRU_Window_Edit_File(file, multi, edit_type, open_type) @@ -707,17 +746,20 @@ function! s:MRU_Open_Window(...) endif endif + setlocal modifiable + " Mark the buffer as scratch setlocal buftype=nofile setlocal bufhidden=delete setlocal noswapfile setlocal nowrap setlocal nobuflisted + " Set the 'filetype' to 'mru'. This allows the user to apply custom + " syntax highlighting or other changes to the MRU bufer. + setlocal filetype=mru " Use fixed height for the MRU window setlocal winfixheight - call MRU_SetupSyntax() - " Setup the cpoptions properly for the maps to work let old_cpoptions = &cpoptions set cpoptions&vim @@ -731,6 +773,10 @@ function! s:MRU_Open_Window(...) \ :call MRU_Select_File_Cmd('edit,newwin_horiz') vnoremap o \ :call MRU_Select_File_Cmd('edit,newwin_horiz') + nnoremap + \ :call MRU_Select_File_Cmd('edit,newwin_horiz') + vnoremap + \ :call MRU_Select_File_Cmd('edit,newwin_horiz') nnoremap O \ :call MRU_Select_File_Cmd('edit,newwin_vert') vnoremap O @@ -741,6 +787,14 @@ function! s:MRU_Open_Window(...) \ :call MRU_Select_File_Cmd('edit,newtab') nnoremap v \ :call MRU_Select_File_Cmd('view,useopen') + nnoremap p + \ :call MRU_Select_File_Cmd('view,preview') + vnoremap p + \ :if line("'<") == line("'>") + \ call MRU_Select_File_Cmd('open,preview') + \ else + \ echoerr "Only a single file can be previewed" + \ endif nnoremap u :MRU nnoremap <2-LeftMouse> \ :call MRU_Select_File_Cmd('edit,useopen') @@ -764,16 +818,22 @@ function! s:MRU_Open_Window(...) endif " Get the tail part of the file name (without the directory) and display - " it along with the full path - let output = map(m, 'fnamemodify(v:val, ":t") . " (" . v:val . ")"') + " it along with the full path in parenthesis. + let output = map(m, g:MRU_Filename_Format.formatter) silent! 0put =output " Delete the empty line at the end of the buffer - $delete + silent! $delete _ " Move the cursor to the beginning of the file normal! gg + " Add syntax highlighting for the file names + if has_key(g:MRU_Filename_Format, 'syntax') + exe "syntax match MRUFileName '" . g:MRU_Filename_Format.syntax . "'" + highlight default link MRUFileName Identifier + endif + setlocal nomodifiable endfunction @@ -921,7 +981,7 @@ function! s:MRU_Refresh_Menu() let entry_cnt = len(s:MRU_files) if entry_cnt > g:MRU_Max_Menu_Entries " Show only MRU_Max_Menu_Entries file names in the menu - let mru_list = s:MRU_files[1 : g:MRU_Max_Menu_Entries] + let mru_list = s:MRU_files[0 : g:MRU_Max_Menu_Entries - 1] let entry_cnt = g:MRU_Max_Menu_Entries else let mru_list = s:MRU_files @@ -949,16 +1009,6 @@ function! s:MRU_Refresh_Menu() let &cpoptions = old_cpoptions endfunction -" Setup syntax highlight -function! MRU_SetupSyntax() - if has("syntax") - syn match mruName /.\+\s/ - syn match mruDir /(.\+)/ - hi def link mruDir Folded - hi def link mruName String - endif -endfunction - " Load the MRU list on plugin startup call s:MRU_LoadList() diff --git a/sources_non_forked/nerdtree/.github/ISSUE_TEMPLATE.md b/sources_non_forked/nerdtree/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..69aa7d9b --- /dev/null +++ b/sources_non_forked/nerdtree/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,37 @@ +_To assist in resolving your issue, provide as much information as possible, in place of the ellipses (`…`) below._ + +--- +**Environment:** _Describe your Vim/NERDTree setup._ + +>* Operating System: … +>* Vim version `:version`: … +>* NERDTree version `git rev-parse --short HEAD`: … +>* NERDTree settings applied in your vimrc, if any: +> +> ``` +> … +> ``` + +**Process:** _List the steps that will recreate the issue._ + +>1. … + +**Current Result:** _Describe what you you currently experience from this process._ + +>… + +**Expected Result:** _Describe what you would expect to have resulted from this process._ + +>… + +--- +**Optional** + +**Screenshot(s):** + +>… + +**Possible Fix:** _(Have you poked around in the code?)_ + +>… + diff --git a/sources_non_forked/nerdtree/CHANGELOG b/sources_non_forked/nerdtree/CHANGELOG index a23884a9..3d377ab2 100644 --- a/sources_non_forked/nerdtree/CHANGELOG +++ b/sources_non_forked/nerdtree/CHANGELOG @@ -1,4 +1,13 @@ Next + - Update doc with already existing mapping variables (asnr) #699 + - Fix the broken g:NERDTreeBookmarksSort setting (lifecrisis) #696 + - Correct NERDTreeIgnore pattern in doc (cntoplolicon) #648 + - Remove empty segments when splitting path (sooth-sayer) #574 + - Suppress autocmds less agressively (wincent) #578 #691 + - Add an Issues template to ask for more info initially. + - Fix markdown headers in readme (josephfrazier) #676 + - Don't touch @o and @h registers when rendering + - Fix bug with files and directories with dollar signs (alegen) #649 - Reuse/reopen existing window trees where possible #244 - Remove NERDTree.previousBuf() - Change color of arrow (Leeiio) #630 diff --git a/sources_non_forked/nerdtree/README.markdown b/sources_non_forked/nerdtree/README.markdown index 4f5133a2..48d216b9 100644 --- a/sources_non_forked/nerdtree/README.markdown +++ b/sources_non_forked/nerdtree/README.markdown @@ -55,14 +55,14 @@ The following features and functionality are provided by the NERD tree: Installation ------------ -####[pathogen.vim](https://github.com/tpope/vim-pathogen) +#### [pathogen.vim](https://github.com/tpope/vim-pathogen) git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree -Then reload vim, run `:helptags ~/.vim/bundle/nerdtree/doc/`, and check out `:help NERD_tree.txt`. +Then reload Vim, run `:helptags ~/.vim/bundle/nerdtree/doc/`, and check out `:help NERDTree.txt`. -####[apt-vim](https://github.com/egalpin/apt-vim) +#### [apt-vim](https://github.com/egalpin/apt-vim) apt-vim install -y https://github.com/scrooloose/nerdtree.git diff --git a/sources_non_forked/nerdtree/autoload/nerdtree.vim b/sources_non_forked/nerdtree/autoload/nerdtree.vim index e0d86efa..1d2595b0 100644 --- a/sources_non_forked/nerdtree/autoload/nerdtree.vim +++ b/sources_non_forked/nerdtree/autoload/nerdtree.vim @@ -52,11 +52,6 @@ function! nerdtree#completeBookmarks(A,L,P) return filter(g:NERDTreeBookmark.BookmarkNames(), 'v:val =~# "^' . a:A . '"') endfunction -"FUNCTION: nerdtree#compareBookmarks(dir) {{{2 -function! nerdtree#compareBookmarks(first, second) - return a:first.compareTo(a:second) -endfunction - "FUNCTION: nerdtree#compareNodes(dir) {{{2 function! nerdtree#compareNodes(n1, n2) return a:n1.path.compareTo(a:n2.path) @@ -64,9 +59,33 @@ endfunction "FUNCTION: nerdtree#compareNodesBySortKey(n1, n2) {{{2 function! nerdtree#compareNodesBySortKey(n1, n2) - if a:n1.path.getSortKey() <# a:n2.path.getSortKey() + let sortKey1 = a:n1.path.getSortKey() + let sortKey2 = a:n2.path.getSortKey() + + let i = 0 + while i < min([len(sortKey1), len(sortKey2)]) + " Compare chunks upto common length. + " If chunks have different type, the one which has + " integer type is the lesser. + if type(sortKey1[i]) == type(sortKey2[i]) + if sortKey1[i] <# sortKey2[i] + return - 1 + elseif sortKey1[i] ># sortKey2[i] + return 1 + endif + elseif sortKey1[i] == type(0) + return -1 + elseif sortKey2[i] == type(0) + return 1 + endif + let i = i + 1 + endwhile + + " Keys are identical upto common length. + " The key which has smaller chunks is the lesser one. + if len(sortKey1) < len(sortKey2) return -1 - elseif a:n1.path.getSortKey() ># a:n2.path.getSortKey() + elseif len(sortKey1) > len(sortKey2) return 1 else return 0 @@ -89,10 +108,12 @@ function! nerdtree#deprecated(func, ...) endfunction " FUNCTION: nerdtree#exec(cmd) {{{2 -" same as :exec cmd but eventignore=all is set for the duration +" Same as :exec cmd but with eventignore set for the duration +" to disable the autocommands used by NERDTree (BufEnter, +" BufLeave and VimEnter) function! nerdtree#exec(cmd) let old_ei = &ei - set ei=all + set ei=BufEnter,BufLeave,VimEnter exec a:cmd let &ei = old_ei endfunction diff --git a/sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim b/sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim index 2aa3bece..2d94fd9a 100644 --- a/sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim +++ b/sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim @@ -7,7 +7,7 @@ let g:loaded_nerdtree_ui_glue_autoload = 1 function! nerdtree#ui_glue#createDefaultBindings() let s = '' . s:SID() . '_' - call NERDTreeAddKeyMap({ 'key': '', 'scope': "all", 'callback': s."handleMiddleMouse" }) + call NERDTreeAddKeyMap({ 'key': '', 'scope': 'all', 'callback': s . 'handleMiddleMouse' }) call NERDTreeAddKeyMap({ 'key': '', 'scope': "all", 'callback': s."handleLeftClick" }) call NERDTreeAddKeyMap({ 'key': '<2-LeftMouse>', 'scope': "DirNode", 'callback': s."activateDirNode" }) call NERDTreeAddKeyMap({ 'key': '<2-LeftMouse>', 'scope': "FileNode", 'callback': s."activateFileNode" }) @@ -336,16 +336,22 @@ endfunction " FUNCTION: s:handleMiddleMouse() {{{1 function! s:handleMiddleMouse() - let curNode = g:NERDTreeFileNode.GetSelected() - if curNode ==# {} - call nerdtree#echo("Put the cursor on a node first" ) + + " A middle mouse click does not automatically position the cursor as one + " would expect. Forcing the execution of a regular left mouse click here + " fixes this problem. + execute "normal! \" + + let l:currentNode = g:NERDTreeFileNode.GetSelected() + if empty(l:currentNode) + call nerdtree#echoError('use the pointer to select a node') return endif - if curNode.path.isDirectory - call nerdtree#openExplorer(curNode) + if l:currentNode.path.isDirectory + call l:currentNode.openExplorer() else - call curNode.open({'where': 'h'}) + call l:currentNode.open({'where': 'h'}) endif endfunction @@ -398,13 +404,27 @@ function! s:jumpToLastChild(node) endfunction " FUNCTION: s:jumpToParent(node) {{{1 -" moves the cursor to the parent of the current node +" Move the cursor to the parent of the specified node. For a cascade, move to +" the parent of the cascade's highest node. At the root, do nothing. function! s:jumpToParent(node) - if !empty(a:node.parent) - call a:node.parent.putCursorHere(1, 0) + let l:parent = a:node.parent + + " If "a:node" represents a directory, back out of its cascade. + if a:node.path.isDirectory + while !empty(l:parent) && !l:parent.isRoot() + if index(l:parent.getCascade(), a:node) >= 0 + let l:parent = l:parent.parent + else + break + endif + endwhile + endif + + if !empty(l:parent) + call l:parent.putCursorHere(1, 0) call b:NERDTree.ui.centerView() else - call nerdtree#echo("cannot jump to parent") + call nerdtree#echo('could not jump to parent node') endif endfunction @@ -441,21 +461,19 @@ function! s:jumpToSibling(currentNode, forward) endfunction " FUNCTION: nerdtree#ui_glue#openBookmark(name) {{{1 -" put the cursor on the given bookmark and, if its a file, open it +" Open the Bookmark that has the specified name. This function provides the +" implementation for the ":OpenBookmark" command. function! nerdtree#ui_glue#openBookmark(name) try - let targetNode = g:NERDTreeBookmark.GetNodeForName(a:name, 0, b:NERDTree) - call targetNode.putCursorHere(0, 1) - redraw! - catch /^NERDTree.BookmarkedNodeNotFoundError/ - call nerdtree#echo("note - target node is not cached") - let bookmark = g:NERDTreeBookmark.BookmarkFor(a:name) - let targetNode = g:NERDTreeFileNode.New(bookmark.path, b:NERDTree) + let l:bookmark = g:NERDTreeBookmark.BookmarkFor(a:name) + catch /^NERDTree.BookmarkNotFoundError/ + call nerdtree#echoError('bookmark "' . a:name . '" not found') + return endtry - if targetNode.path.isDirectory - call targetNode.openExplorer() + if l:bookmark.path.isDirectory + call l:bookmark.open(b:NERDTree) else - call targetNode.open({'where': 'p'}) + call l:bookmark.open(b:NERDTree, {'where': 'p'}) endif endfunction diff --git a/sources_non_forked/nerdtree/doc/NERD_tree.txt b/sources_non_forked/nerdtree/doc/NERDTree.txt similarity index 94% rename from sources_non_forked/nerdtree/doc/NERD_tree.txt rename to sources_non_forked/nerdtree/doc/NERDTree.txt index d0af4a82..f68880cd 100644 --- a/sources_non_forked/nerdtree/doc/NERD_tree.txt +++ b/sources_non_forked/nerdtree/doc/NERDTree.txt @@ -1,4 +1,4 @@ -*NERD_tree.txt* A tree explorer plugin that owns your momma! +*NERDTree.txt* A tree explorer plugin that owns your momma! @@ -117,6 +117,10 @@ The following features and functionality are provided by the NERD tree: again. If no NERD tree exists for this tab then this command acts the same as the |:NERDTree| command. +:NERDTreeFocus *:NERDTreeFocus* + Opens (or reopens) the NERD Tree if it is not currently visible; + otherwise, the cursor is moved to the already-open NERD Tree. + :NERDTreeMirror *:NERDTreeMirror* Shares an existing NERD tree, from another tab, in the current tab. Changes made to one tree are reflected in both as they are actually the @@ -158,7 +162,7 @@ click bookmarks or use the |NERDTree-o| mapping to activate them. See also, ------------------------------------------------------------------------------ 2.2.2. Bookmark commands *NERDTreeBookmarkCommands* -Note that the following commands are only available in the NERD tree buffer. +Note: The following commands are only available within the NERDTree buffer. :Bookmark [] Bookmark the current node as . If there is already a @@ -178,10 +182,11 @@ Note that the following commands are only available in the NERD tree buffer. (i.e. directory nodes above it will be opened) and the cursor will be placed on it. -:OpenBookmark - must point to a file. The file is opened as though |NERDTree-o| - was applied. If the node is cached under the current root then it will be - revealed and the cursor will be placed on it. +:OpenBookmark + The Bookmark named is opened as if |NERDTree-o| was applied to + its entry in the Bookmark table. If the Bookmark points to a directory, + it is made the new root of the current NERDTree. If the Bookmark points + to a file, that file is opened for editing in another window. :ClearBookmarks [] Remove all the given bookmarks. If no bookmarks are given then remove all @@ -282,13 +287,13 @@ previous window. ------------------------------------------------------------------------------ *NERDTree-go* Default key: go -Map option: None +Map option: NERDTreeMapPreview Applies to: files. If a file node is selected, it is opened in the previous window, but the cursor does not move. -The key combo for this mapping is always "g" + NERDTreeMapActivateNode (see +The default key combo for this mapping is "g" + NERDTreeMapActivateNode (see |NERDTree-o|). ------------------------------------------------------------------------------ @@ -324,12 +329,12 @@ window. ------------------------------------------------------------------------------ *NERDTree-gi* Default key: gi -Map option: None +Map option: NERDTreeMapPreviewSplit Applies to: files. The same as |NERDTree-i| except that the cursor is not moved. -The key combo for this mapping is always "g" + NERDTreeMapOpenSplit (see +The default key combo for this mapping is "g" + NERDTreeMapOpenSplit (see |NERDTree-i|). ------------------------------------------------------------------------------ @@ -344,12 +349,12 @@ the new window. ------------------------------------------------------------------------------ *NERDTree-gs* Default key: gs -Map option: None +Map option: NERDTreeMapPreviewVSplit Applies to: files. The same as |NERDTree-s| except that the cursor is not moved. -The key combo for this mapping is always "g" + NERDTreeMapOpenVSplit (see +The default key combo for this mapping is "g" + NERDTreeMapOpenVSplit (see |NERDTree-s|). ------------------------------------------------------------------------------ @@ -618,6 +623,9 @@ NERD tree. These options should be set in your vimrc. |'NERDTreeCaseSensitiveSort'| Tells the NERD tree whether to be case sensitive or not when sorting nodes. +|'NERDTreeNaturalSort'| Tells the NERD tree whether to use + natural sort order or not when sorting nodes. + |'NERDTreeSortHiddenFirst'| Tells the NERD tree whether to take the dot at the beginning of the hidden file names into account when sorting nodes. @@ -637,11 +645,11 @@ NERD tree. These options should be set in your vimrc. |'NERDTreeBookmarksFile'| Where the bookmarks are stored. -|'NERDTreeBookmarksSort'| Whether the bookmarks list is sorted on - display. +|'NERDTreeBookmarksSort'| Control how the Bookmark table is sorted. -|'NERDTreeMouseMode'| Tells the NERD tree how to handle mouse - clicks. +|'NERDTreeMarkBookmarks'| Render bookmarked nodes with markers. + +|'NERDTreeMouseMode'| Manage the interpretation of mouse clicks. |'NERDTreeQuitOnOpen'| Closes the tree window after opening a file. @@ -741,6 +749,33 @@ account. The above nodes would then be sorted like this: > blarg.c boner.c < +------------------------------------------------------------------------------ + *'NERDTreeNaturalSort'* +Values: 0 or 1. +Default: 0. + +By default the NERD tree does not sort nodes in natural sort order, i.e. nodes +could appear like this: > + z1.txt + z10.txt + z100.txt + z11.txt + z110.txt + z2.txt + z20.txt + z3.txt +< +But if you set this option to 1 then the natural sort order will be used. The +above nodes would then be sorted like this: > + z1.txt + z2.txt + z3.txt + z10.txt + z11.txt + z20.txt + z100.txt + z110.txt +< ------------------------------------------------------------------------------ *'NERDTreeChDirMode'* @@ -806,7 +841,7 @@ then all files ending in .vim or ~ will be ignored. There are 2 magic flags that can be appended to the end of each regular expression to specify that the regex should match only files or only dirs. These flags are "[[dir]]" and "[[file]]". Example: > - let NERDTreeIgnore=['.d$[[dir]]', '.o$[[file]]'] + let NERDTreeIgnore=['\.d$[[dir]]', '\.o$[[file]]'] < This will cause all dirs ending in ".d" to be ignored and all files ending in ".o" to be ignored. @@ -835,11 +870,24 @@ This is where bookmarks are saved. See |NERDTreeBookmarkCommands|. ------------------------------------------------------------------------------ *'NERDTreeBookmarksSort'* +Values: 0, 1, or 2 +Default: 1 + +This option controls the method by which the list of user bookmarks is +sorted. When sorted, bookmarks will render in alphabetical order by name. + +If set to 0, the bookmarks list is not sorted. +If set to 1, the bookmarks list is sorted in a case-insensitive manner. +If set to 2, the bookmarks list is sorted in a case-sensitive manner. + +------------------------------------------------------------------------------ + *'NERDTreeMarkBookmarks'* Values: 0 or 1 Default: 1 -If set to 0 then the bookmarks list is not sorted. -If set to 1 the bookmarks list is sorted. +If set to 1, Bookmarks will be specially marked whenever the NERDTree is +rendered. Users of the |'NERDTreeMinimalUI'| setting may prefer to disable +this setting for even less visual clutter. ------------------------------------------------------------------------------ *'NERDTreeMouseMode'* diff --git a/sources_non_forked/nerdtree/lib/nerdtree/bookmark.vim b/sources_non_forked/nerdtree/lib/nerdtree/bookmark.vim index 81242605..f8606ee6 100644 --- a/sources_non_forked/nerdtree/lib/nerdtree/bookmark.vim +++ b/sources_non_forked/nerdtree/lib/nerdtree/bookmark.vim @@ -1,5 +1,13 @@ -"CLASS: Bookmark -"============================================================ +" ============================================================================ +" CLASS: Bookmark +" +" The Bookmark class serves two purposes: +" (1) It is the top-level prototype for new, concrete Bookmark objects. +" (2) It provides an interface for client code to query and manipulate the +" global list of Bookmark objects within the current Vim session. +" ============================================================================ + + let s:Bookmark = {} let g:NERDTreeBookmark = s:Bookmark @@ -19,12 +27,9 @@ function! s:Bookmark.AddBookmark(name, path) endif endfor call add(s:Bookmark.Bookmarks(), s:Bookmark.New(a:name, a:path)) - if g:NERDTreeBookmarksSort ==# 1 - call s:Bookmark.Sort() - endif endfunction -" FUNCTION: Bookmark.Bookmarks() {{{1 +" FUNCTION: Bookmark.Bookmarks() {{{1 " Class method to get all bookmarks. Lazily initializes the bookmarks global " variable function! s:Bookmark.Bookmarks() @@ -34,7 +39,7 @@ function! s:Bookmark.Bookmarks() return g:NERDTreeBookmarks endfunction -" FUNCTION: Bookmark.BookmarkExistsFor(name) {{{1 +" FUNCTION: Bookmark.BookmarkExistsFor(name) {{{1 " class method that returns 1 if a bookmark with the given name is found, 0 " otherwise function! s:Bookmark.BookmarkExistsFor(name) @@ -46,19 +51,24 @@ function! s:Bookmark.BookmarkExistsFor(name) endtry endfunction -" FUNCTION: Bookmark.BookmarkFor(name) {{{1 -" Class method to get the bookmark that has the given name. {} is return if no -" bookmark is found +" FUNCTION: Bookmark.BookmarkFor(name) {{{1 +" Class method that returns the Bookmark object having the specified name. +" Throws "NERDTree.BookmarkNotFoundError" if no Bookmark is found. function! s:Bookmark.BookmarkFor(name) - for i in s:Bookmark.Bookmarks() - if i.name ==# a:name - return i + let l:result = {} + for l:bookmark in s:Bookmark.Bookmarks() + if l:bookmark.name ==# a:name + let l:result = l:bookmark + break endif endfor - throw "NERDTree.BookmarkNotFoundError: no bookmark found for name: \"". a:name .'"' + if empty(l:result) + throw 'NERDTree.BookmarkNotFoundError: "' . a:name . '" not found' + endif + return l:result endfunction -" FUNCTION: Bookmark.BookmarkNames() {{{1 +" FUNCTION: Bookmark.BookmarkNames() {{{1 " Class method to return an array of all bookmark names function! s:Bookmark.BookmarkNames() let names = [] @@ -104,17 +114,31 @@ function! s:Bookmark.CacheBookmarks(silent) call nerdtree#echo(invalidBookmarksFound . " invalid bookmarks were read. See :help NERDTreeInvalidBookmarks for info.") endif endif - if g:NERDTreeBookmarksSort ==# 1 - call s:Bookmark.Sort() - endif endif endfunction -" FUNCTION: Bookmark.compareTo(otherbookmark) {{{1 -" Compare these two bookmarks for sorting purposes -function! s:Bookmark.compareTo(otherbookmark) - return a:otherbookmark.name < self.name +" FUNCTION: Bookmark.CompareBookmarksByName(firstBookmark, secondBookmark) {{{1 +" Class method that indicates the relative position of two bookmarks when +" placed in alphabetical order by name. Case-sensitivity is determined by an +" option. Supports the "s:Bookmark.SortBookmarksList()" method. +function! s:Bookmark.CompareBookmarksByName(firstBookmark, secondBookmark) + let l:result = 0 + if g:NERDTreeBookmarksSort == 1 + if a:firstBookmark.name ? a:secondBookmark.name + let l:result = 1 + endif + elseif g:NERDTreeBookmarksSort == 2 + if a:firstBookmark.name <# a:secondBookmark.name + let l:result = -1 + elseif a:firstBookmark.name ># a:secondBookmark.name + let l:result = 1 + endif + endif + return l:result endfunction + " FUNCTION: Bookmark.ClearAll() {{{1 " Class method to delete all bookmarks. function! s:Bookmark.ClearAll() @@ -133,26 +157,33 @@ function! s:Bookmark.delete() endfunction " FUNCTION: Bookmark.getNode(nerdtree, searchFromAbsoluteRoot) {{{1 -" Gets the treenode for this bookmark +" Returns the tree node object associated with this Bookmark. +" Throws "NERDTree.BookmarkedNodeNotFoundError" if the node is not found. " " Args: -" searchFromAbsoluteRoot: specifies whether we should search from the current -" tree root, or the highest cached node +" searchFromAbsoluteRoot: boolean flag, search from the highest cached node +" if true and from the current tree root if false function! s:Bookmark.getNode(nerdtree, searchFromAbsoluteRoot) - let searchRoot = a:searchFromAbsoluteRoot ? a:nerdtree.root.AbsoluteTreeRoot() : a:nerdtree.root - let targetNode = searchRoot.findNode(self.path) - if empty(targetNode) - throw "NERDTree.BookmarkedNodeNotFoundError: no node was found for bookmark: " . self.name + if a:searchFromAbsoluteRoot + let l:searchRoot = a:nerdtree.root.AbsoluteTreeRoot() + else + let l:searchRoot = a:nerdtree.root endif - return targetNode + let l:targetNode = l:searchRoot.findNode(self.path) + if empty(l:targetNode) + throw 'NERDTree.BookmarkedNodeNotFoundError: node for bookmark "' . self.name . '" not found' + endif + return l:targetNode endfunction " FUNCTION: Bookmark.GetNodeForName(name, searchFromAbsoluteRoot, nerdtree) {{{1 -" Class method that finds the bookmark with the given name and returns the -" treenode for it. +" Class method that returns the tree node object for the Bookmark with the +" given name. Throws "NERDTree.BookmarkNotFoundError" if a Bookmark with the +" name does not exist. Throws "NERDTree.BookmarkedNodeNotFoundError" if a +" tree node for the named Bookmark could not be found. function! s:Bookmark.GetNodeForName(name, searchFromAbsoluteRoot, nerdtree) - let bookmark = s:Bookmark.BookmarkFor(a:name) - return bookmark.getNode(nerdtree, a:searchFromAbsoluteRoot) + let l:bookmark = s:Bookmark.BookmarkFor(a:name) + return l:bookmark.getNode(a:nerdtree, a:searchFromAbsoluteRoot) endfunction " FUNCTION: Bookmark.GetSelected() {{{1 @@ -170,7 +201,7 @@ function! s:Bookmark.GetSelected() return {} endfunction -" FUNCTION: Bookmark.InvalidBookmarks() {{{1 +" FUNCTION: Bookmark.InvalidBookmarks() {{{1 " Class method to get all invalid bookmark strings read from the bookmarks " file function! s:Bookmark.InvalidBookmarks() @@ -233,20 +264,20 @@ function! s:Bookmark.openInNewTab(options) call self.open(a:options) endfunction -" FUNCTION: Bookmark.setPath(path) {{{1 +" FUNCTION: Bookmark.setPath(path) {{{1 " makes this bookmark point to the given path function! s:Bookmark.setPath(path) let self.path = a:path endfunction -" FUNCTION: Bookmark.Sort() {{{1 -" Class method that sorts all bookmarks -function! s:Bookmark.Sort() - let CompareFunc = function("nerdtree#compareBookmarks") - call sort(s:Bookmark.Bookmarks(), CompareFunc) +" FUNCTION: Bookmark.SortBookmarksList() {{{1 +" Class method that sorts the global list of bookmarks alphabetically by name. +" Note that case-sensitivity is determined by a user option. +function! s:Bookmark.SortBookmarksList() + call sort(s:Bookmark.Bookmarks(), s:Bookmark.CompareBookmarksByName, s:Bookmark) endfunction -" FUNCTION: Bookmark.str() {{{1 +" FUNCTION: Bookmark.str() {{{1 " Get the string that should be rendered in the view for this bookmark function! s:Bookmark.str() let pathStrMaxLen = winwidth(g:NERDTree.GetWinNum()) - 4 - len(self.name) @@ -292,7 +323,7 @@ function! s:Bookmark.validate() endif endfunction -" FUNCTION: Bookmark.Write() {{{1 +" FUNCTION: Bookmark.Write() {{{1 " Class method to write all bookmarks to the bookmarks file function! s:Bookmark.Write() let bookmarkStrings = [] diff --git a/sources_non_forked/nerdtree/lib/nerdtree/creator.vim b/sources_non_forked/nerdtree/lib/nerdtree/creator.vim index 952811c1..92e1abeb 100644 --- a/sources_non_forked/nerdtree/lib/nerdtree/creator.vim +++ b/sources_non_forked/nerdtree/lib/nerdtree/creator.vim @@ -14,7 +14,7 @@ function! s:Creator._bindMappings() command! -buffer -nargs=? Bookmark :call nerdtree#ui_glue#bookmarkNode('') command! -buffer -complete=customlist,nerdtree#completeBookmarks -nargs=1 RevealBookmark :call nerdtree#ui_glue#revealBookmark('') - command! -buffer -complete=customlist,nerdtree#completeBookmarks -nargs=1 OpenBookmark :call nerdtree#ui_glue#openBookmark('') + command! -buffer -complete=customlist,nerdtree#completeBookmarks -nargs=1 OpenBookmark call nerdtree#ui_glue#openBookmark('') command! -buffer -complete=customlist,nerdtree#completeBookmarks -nargs=* ClearBookmarks call nerdtree#ui_glue#clearBookmarks('') command! -buffer -complete=customlist,nerdtree#completeBookmarks -nargs=+ BookmarkToRoot call g:NERDTreeBookmark.ToRoot('', b:NERDTree) command! -buffer -nargs=0 ClearAllBookmarks call g:NERDTreeBookmark.ClearAll() call b:NERDTree.render() diff --git a/sources_non_forked/nerdtree/lib/nerdtree/path.vim b/sources_non_forked/nerdtree/lib/nerdtree/path.vim index 5f3b16ad..b884ec60 100644 --- a/sources_non_forked/nerdtree/lib/nerdtree/path.vim +++ b/sources_non_forked/nerdtree/lib/nerdtree/path.vim @@ -1,12 +1,6 @@ "we need to use this number many times for sorting... so we calculate it only "once here let s:NERDTreeSortStarIndex = index(g:NERDTreeSortOrder, '*') -" used in formating sortKey, e.g. '%04d' -if exists("log10") - let s:sortKeyFormat = "%0" . float2nr(ceil(log10(len(g:NERDTreeSortOrder)))) . "d" -else - let s:sortKeyFormat = "%04d" -endif "CLASS: Path "============================================================ @@ -52,7 +46,7 @@ function! s:Path.cacheDisplayString() abort call add(self._bookmarkNames, i.name) endif endfor - if !empty(self._bookmarkNames) + if !empty(self._bookmarkNames) && g:NERDTreeMarkBookmarks == 1 let self.cachedDisplayString .= ' {' . join(self._bookmarkNames) . '}' endif @@ -301,10 +295,10 @@ endfunction "FUNCTION: Path._escChars() {{{1 function! s:Path._escChars() if nerdtree#runningWindows() - return " `\|\"#%&,?()\*^<>" + return " `\|\"#%&,?()\*^<>$" endif - return " \\`\|\"#%&,?()\*^<>[]" + return " \\`\|\"#%&,?()\*^<>[]$" endfunction "FUNCTION: Path.getDir() {{{1 @@ -368,8 +362,23 @@ function! s:Path.getSortOrderIndex() return s:NERDTreeSortStarIndex endfunction +"FUNCTION: Path._splitChunks(path) {{{1 +"returns a list of path chunks +function! s:Path._splitChunks(path) + let chunks = split(a:path, '\(\D\+\|\d\+\)\zs') + let i = 0 + while i < len(chunks) + "convert number literals to numbers + if match(chunks[i], '^\d\+$') == 0 + let chunks[i] = str2nr(chunks[i]) + endif + let i = i + 1 + endwhile + return chunks +endfunction + "FUNCTION: Path.getSortKey() {{{1 -"returns a string used in compare function for sorting +"returns a key used in compare function for sorting function! s:Path.getSortKey() if !exists("self._sortKey") let path = self.getLastPathComponent(1) @@ -379,7 +388,11 @@ function! s:Path.getSortKey() if !g:NERDTreeCaseSensitiveSort let path = tolower(path) endif - let self._sortKey = printf(s:sortKeyFormat, self.getSortOrderIndex()) . path + if !g:NERDTreeNaturalSort + let self._sortKey = [self.getSortOrderIndex(), path] + else + let self._sortKey = [self.getSortOrderIndex()] + self._splitChunks(path) + endif endif return self._sortKey @@ -544,7 +557,7 @@ function! s:Path.readInfoFromDisk(fullpath) throw "NERDTree.InvalidFiletypeError: Cant handle FIFO files: " . a:fullpath endif - let self.pathSegments = split(fullpath, '/') + let self.pathSegments = filter(split(fullpath, '/'), '!empty(v:val)') let self.isReadOnly = 0 if isdirectory(a:fullpath) diff --git a/sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim b/sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim index c41077df..5ca94d4f 100644 --- a/sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim +++ b/sources_non_forked/nerdtree/lib/nerdtree/tree_dir_node.vim @@ -1,13 +1,17 @@ -"CLASS: TreeDirNode -"A subclass of NERDTreeFileNode. +" ============================================================================ +" CLASS: TreeDirNode " -"The 'composite' part of the file/dir composite. -"============================================================ +" A subclass of NERDTreeFileNode. +" +" The 'composite' part of the file/dir composite. +" ============================================================================ + + let s:TreeDirNode = copy(g:NERDTreeFileNode) let g:NERDTreeDirNode = s:TreeDirNode -"FUNCTION: TreeDirNode.AbsoluteTreeRoot(){{{1 -"class method that returns the highest cached ancestor of the current root +" FUNCTION: TreeDirNode.AbsoluteTreeRoot(){{{1 +" Class method that returns the highest cached ancestor of the current root. function! s:TreeDirNode.AbsoluteTreeRoot() let currentNode = b:NERDTree.root while currentNode.parent != {} @@ -16,7 +20,7 @@ function! s:TreeDirNode.AbsoluteTreeRoot() return currentNode endfunction -"FUNCTION: TreeDirNode.activate([options]) {{{1 +" FUNCTION: TreeDirNode.activate([options]) {{{1 unlet s:TreeDirNode.activate function! s:TreeDirNode.activate(...) let opts = a:0 ? a:1 : {} @@ -25,12 +29,12 @@ function! s:TreeDirNode.activate(...) call self.putCursorHere(0, 0) endfunction -"FUNCTION: TreeDirNode.addChild(treenode, inOrder) {{{1 -"Adds the given treenode to the list of children for this node +" FUNCTION: TreeDirNode.addChild(treenode, inOrder) {{{1 +" Adds the given treenode to the list of children for this node " -"Args: -"-treenode: the node to add -"-inOrder: 1 if the new node should be inserted in sorted order +" Args: +" -treenode: the node to add +" -inOrder: 1 if the new node should be inserted in sorted order function! s:TreeDirNode.addChild(treenode, inOrder) call add(self.children, a:treenode) let a:treenode.parent = self @@ -40,14 +44,19 @@ function! s:TreeDirNode.addChild(treenode, inOrder) endif endfunction -"FUNCTION: TreeDirNode.close() {{{1 -"Closes this directory +" FUNCTION: TreeDirNode.close() {{{1 +" Mark this TreeDirNode as closed. function! s:TreeDirNode.close() - let self.isOpen = 0 + + " Close all directories in this directory node's cascade. This is + " necessary to ensure consistency when cascades are rendered. + for l:dirNode in self.getCascade() + let l:dirNode.isOpen = 0 + endfor endfunction -"FUNCTION: TreeDirNode.closeChildren() {{{1 -"Closes all the child dir nodes of this node +" FUNCTION: TreeDirNode.closeChildren() {{{1 +" Closes all the child dir nodes of this node function! s:TreeDirNode.closeChildren() for i in self.children if i.path.isDirectory @@ -57,43 +66,53 @@ function! s:TreeDirNode.closeChildren() endfor endfunction -"FUNCTION: TreeDirNode.createChild(path, inOrder) {{{1 -"Instantiates a new child node for this node with the given path. The new -"nodes parent is set to this node. +" FUNCTION: TreeDirNode.createChild(path, inOrder) {{{1 +" Instantiates a new child node for this node with the given path. The new +" nodes parent is set to this node. " -"Args: -"path: a Path object that this node will represent/contain -"inOrder: 1 if the new node should be inserted in sorted order +" Args: +" path: a Path object that this node will represent/contain +" inOrder: 1 if the new node should be inserted in sorted order " -"Returns: -"the newly created node +" Returns: +" the newly created node function! s:TreeDirNode.createChild(path, inOrder) let newTreeNode = g:NERDTreeFileNode.New(a:path, self.getNerdtree()) call self.addChild(newTreeNode, a:inOrder) return newTreeNode endfunction -"FUNCTION: TreeDirNode.displayString() {{{1 -unlet s:TreeDirNode.displayString +" FUNCTION: TreeDirNode.displayString() {{{1 +" Assemble and return a string that can represent this TreeDirNode object in +" the NERDTree window. function! s:TreeDirNode.displayString() - let cascade = self.getCascade() - let rv = "" - for node in cascade - let rv = rv . node.path.displayString() + let l:result = '' + + " Build a label that identifies this TreeDirNode. + let l:label = '' + let l:cascade = self.getCascade() + for l:dirNode in l:cascade + let l:label .= l:dirNode.path.displayString() endfor - let sym = cascade[-1].isOpen ? g:NERDTreeDirArrowCollapsible : g:NERDTreeDirArrowExpandable + " Select the appropriate open/closed status indicator symbol. + if l:cascade[-1].isOpen + let l:symbol = g:NERDTreeDirArrowCollapsible + else + let l:symbol = g:NERDTreeDirArrowExpandable + endif - let flags = cascade[-1].path.flagSet.renderToString() + let l:flags = l:cascade[-1].path.flagSet.renderToString() - return sym . ' ' . flags . rv + let l:result = l:symbol . ' ' . l:flags . l:label + return l:result endfunction -"FUNCTION: TreeDirNode.findNode(path) {{{1 -"Will find one of the children (recursively) that has the given path +" FUNCTION: TreeDirNode.findNode(path) {{{1 +" Will find one of the children (recursively) that has the given path " -"Args: -"path: a path object +" Args: +" path: a path object unlet s:TreeDirNode.findNode function! s:TreeDirNode.findNode(path) if a:path.equals(self.path) @@ -114,8 +133,8 @@ function! s:TreeDirNode.findNode(path) return {} endfunction -"FUNCTION: TreeDirNode.getCascade() {{{1 -"Return an array of dir nodes (starting from self) that can be cascade opened. +" FUNCTION: TreeDirNode.getCascade() {{{1 +" Return an array of dir nodes (starting from self) that can be cascade opened. function! s:TreeDirNode.getCascade() if !self.isCascadable() return [self] @@ -127,20 +146,20 @@ function! s:TreeDirNode.getCascade() return [self] + visChild.getCascade() endfunction -"FUNCTION: TreeDirNode.getChildCount() {{{1 -"Returns the number of children this node has +" FUNCTION: TreeDirNode.getChildCount() {{{1 +" Returns the number of children this node has function! s:TreeDirNode.getChildCount() return len(self.children) endfunction -"FUNCTION: TreeDirNode.getChild(path) {{{1 -"Returns child node of this node that has the given path or {} if no such node -"exists. +" FUNCTION: TreeDirNode.getChild(path) {{{1 +" Returns child node of this node that has the given path or {} if no such node +" exists. " -"This function doesnt not recurse into child dir nodes +" This function doesnt not recurse into child dir nodes " -"Args: -"path: a path object +" Args: +" path: a path object function! s:TreeDirNode.getChild(path) if stridx(a:path.str(), self.path.str(), 0) ==# -1 return {} @@ -155,12 +174,13 @@ function! s:TreeDirNode.getChild(path) endfunction -"FUNCTION: TreeDirNode.getChildByIndex(indx, visible) {{{1 -"returns the child at the given index -"Args: -"indx: the index to get the child from -"visible: 1 if only the visible children array should be used, 0 if all the -"children should be searched. +" FUNCTION: TreeDirNode.getChildByIndex(indx, visible) {{{1 +" returns the child at the given index +" +" Args: +" indx: the index to get the child from +" visible: 1 if only the visible children array should be used, 0 if all the +" children should be searched. function! s:TreeDirNode.getChildByIndex(indx, visible) let array_to_search = a:visible? self.getVisibleChildren() : self.children if a:indx > len(array_to_search) @@ -169,14 +189,14 @@ function! s:TreeDirNode.getChildByIndex(indx, visible) return array_to_search[a:indx] endfunction -"FUNCTION: TreeDirNode.getChildIndex(path) {{{1 -"Returns the index of the child node of this node that has the given path or -"-1 if no such node exists. +" FUNCTION: TreeDirNode.getChildIndex(path) {{{1 +" Returns the index of the child node of this node that has the given path or +" -1 if no such node exists. " -"This function doesnt not recurse into child dir nodes +" This function doesnt not recurse into child dir nodes " -"Args: -"path: a path object +" Args: +" path: a path object function! s:TreeDirNode.getChildIndex(path) if stridx(a:path.str(), self.path.str(), 0) ==# -1 return -1 @@ -200,15 +220,88 @@ function! s:TreeDirNode.getChildIndex(path) return -1 endfunction -"FUNCTION: TreeDirNode.getDirChildren() {{{1 -"Get all children that are directories +" FUNCTION: TreeDirNode.getDirChildren() {{{1 +" Return a list of all child nodes from "self.children" that are of type +" TreeDirNode. function! s:TreeDirNode.getDirChildren() return filter(self.children, 'v:val.path.isDirectory == 1') endfunction -"FUNCTION: TreeDirNode.GetSelected() {{{1 -"Returns the current node if it is a dir node, or else returns the current -"nodes parent +" FUNCTION: TreeDirNode._glob(pattern, all) {{{1 +" Return a list of strings naming the descendants of the directory in this +" TreeDirNode object that match the specified glob pattern. +" +" Args: +" pattern: (string) the glob pattern to apply +" all: (0 or 1) if 1, include "." and ".." if they match "pattern"; if 0, +" always exclude them +" +" Note: If the pathnames in the result list are below the working directory, +" they are returned as pathnames relative to that directory. This is because +" this function, internally, attempts to obey 'wildignore' rules that use +" relative paths. +function! s:TreeDirNode._glob(pattern, all) + + " Construct a path specification such that "globpath()" will return + " relative pathnames, if possible. + if self.path.str() == getcwd() + let l:pathSpec = ',' + else + let l:pathSpec = fnamemodify(self.path.str({'format': 'Glob'}), ':.') + + " On Windows, the drive letter may be removed by "fnamemodify()". + if nerdtree#runningWindows() && l:pathSpec[0] == '\' + let l:pathSpec = self.path.drive . l:pathSpec + endif + endif + + let l:globList = [] + + " See ":h version7.txt" and ":h version8.txt" for details on the + " development of the "glob()" and "globpath()" functions. + if v:version > 704 || (v:version == 704 && has('patch654')) + let l:globList = globpath(l:pathSpec, a:pattern, !g:NERDTreeRespectWildIgnore, 1, 0) + elseif v:version == 704 && has('patch279') + let l:globList = globpath(l:pathSpec, a:pattern, !g:NERDTreeRespectWildIgnore, 1) + elseif v:version > 702 || (v:version == 702 && has('patch051')) + let l:globString = globpath(l:pathSpec, a:pattern, !g:NERDTreeRespectWildIgnore) + let l:globList = split(l:globString, "\n") + else + let l:globString = globpath(l:pathSpec, a:pattern) + let l:globList = split(l:globString, "\n") + endif + + " If "a:all" is false, filter "." and ".." from the output. + if !a:all + let l:toRemove = [] + + for l:file in l:globList + let l:tail = fnamemodify(l:file, ':t') + + " Double the modifier if only a separator was stripped. + if l:tail == '' + let l:tail = fnamemodify(l:file, ':t:t') + endif + + if l:tail == '.' || l:tail == '..' + call add(l:toRemove, l:file) + if len(l:toRemove) == 2 + break + endif + endif + endfor + + for l:file in l:toRemove + call remove(l:globList, index(l:globList, l:file)) + endfor + endif + + return l:globList +endfunction + +" FUNCTION: TreeDirNode.GetSelected() {{{1 +" Returns the current node if it is a dir node, or else returns the current +" nodes parent unlet s:TreeDirNode.GetSelected function! s:TreeDirNode.GetSelected() let currentDir = g:NERDTreeFileNode.GetSelected() @@ -220,17 +313,17 @@ function! s:TreeDirNode.GetSelected() return currentDir endfunction -"FUNCTION: TreeDirNode.getVisibleChildCount() {{{1 -"Returns the number of visible children this node has +" FUNCTION: TreeDirNode.getVisibleChildCount() {{{1 +" Returns the number of visible children this node has function! s:TreeDirNode.getVisibleChildCount() return len(self.getVisibleChildren()) endfunction -"FUNCTION: TreeDirNode.getVisibleChildren() {{{1 -"Returns a list of children to display for this node, in the correct order +" FUNCTION: TreeDirNode.getVisibleChildren() {{{1 +" Returns a list of children to display for this node, in the correct order " -"Return: -"an array of treenodes +" Return: +" an array of treenodes function! s:TreeDirNode.getVisibleChildren() let toReturn = [] for i in self.children @@ -241,14 +334,14 @@ function! s:TreeDirNode.getVisibleChildren() return toReturn endfunction -"FUNCTION: TreeDirNode.hasVisibleChildren() {{{1 -"returns 1 if this node has any childre, 0 otherwise.. +" FUNCTION: TreeDirNode.hasVisibleChildren() {{{1 +" returns 1 if this node has any childre, 0 otherwise.. function! s:TreeDirNode.hasVisibleChildren() return self.getVisibleChildCount() != 0 endfunction -"FUNCTION: TreeDirNode.isCascadable() {{{1 -"true if this dir has only one visible child - which is also a dir +" FUNCTION: TreeDirNode.isCascadable() {{{1 +" true if this dir has only one visible child - which is also a dir function! s:TreeDirNode.isCascadable() if g:NERDTreeCascadeSingleChildDir == 0 return 0 @@ -258,29 +351,19 @@ function! s:TreeDirNode.isCascadable() return len(c) == 1 && c[0].path.isDirectory endfunction -"FUNCTION: TreeDirNode._initChildren() {{{1 -"Removes all childen from this node and re-reads them +" FUNCTION: TreeDirNode._initChildren() {{{1 +" Removes all childen from this node and re-reads them " -"Args: -"silent: 1 if the function should not echo any "please wait" messages for -"large directories +" Args: +" silent: 1 if the function should not echo any "please wait" messages for +" large directories " -"Return: the number of child nodes read +" Return: the number of child nodes read function! s:TreeDirNode._initChildren(silent) "remove all the current child nodes let self.children = [] - "get an array of all the files in the nodes dir - let dir = self.path - let globDir = dir.str({'format': 'Glob'}) - - if version >= 703 - let filesStr = globpath(globDir, '*', !g:NERDTreeRespectWildIgnore) . "\n" . globpath(globDir, '.*', !g:NERDTreeRespectWildIgnore) - else - let filesStr = globpath(globDir, '*') . "\n" . globpath(globDir, '.*') - endif - - let files = split(filesStr, "\n") + let files = self._glob('*', 1) + self._glob('.*', 0) if !a:silent && len(files) > g:NERDTreeNotificationThreshold call nerdtree#echo("Please wait, caching a large dir ...") @@ -288,21 +371,13 @@ function! s:TreeDirNode._initChildren(silent) let invalidFilesFound = 0 for i in files - - "filter out the .. and . directories - "Note: we must match .. AND ../ since sometimes the globpath returns - "../ for path with strange chars (eg $) - if i[len(i)-3:2] != ".." && i[len(i)-2:2] != ".." && - \ i[len(i)-2:1] != "." && i[len(i)-1] != "." - "put the next file in a new node and attach it - try - let path = g:NERDTreePath.New(i) - call self.createChild(path, 0) - call g:NERDTreePathNotifier.NotifyListeners('init', path, self.getNerdtree(), {}) - catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/ - let invalidFilesFound += 1 - endtry - endif + try + let path = g:NERDTreePath.New(i) + call self.createChild(path, 0) + call g:NERDTreePathNotifier.NotifyListeners('init', path, self.getNerdtree(), {}) + catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/ + let invalidFilesFound += 1 + endtry endfor call self.sortChildren() @@ -317,12 +392,12 @@ function! s:TreeDirNode._initChildren(silent) return self.getChildCount() endfunction -"FUNCTION: TreeDirNode.New(path, nerdtree) {{{1 -"Returns a new TreeNode object with the given path and parent +" FUNCTION: TreeDirNode.New(path, nerdtree) {{{1 +" Return a new TreeDirNode object with the given path and parent. " -"Args: -"path: dir that the node represents -"nerdtree: the tree the node belongs to +" Args: +" path: dir that the node represents +" nerdtree: the tree the node belongs to function! s:TreeDirNode.New(path, nerdtree) if a:path.isDirectory != 1 throw "NERDTree.InvalidArgumentsError: A TreeDirNode object must be instantiated with a directory Path object." @@ -340,31 +415,45 @@ function! s:TreeDirNode.New(path, nerdtree) return newTreeNode endfunction -"FUNCTION: TreeDirNode.open([opts]) {{{1 -"Open the dir in the current tree or in a new tree elsewhere. -" -"If opening in the current tree, return the number of cached nodes. -unlet s:TreeDirNode.open +" FUNCTION: TreeDirNode.open([options]) {{{1 +" Open this directory node in the current tree or elsewhere if special options +" are provided. Return 0 if options were processed. Otherwise, return the +" number of new cached nodes. function! s:TreeDirNode.open(...) - let opts = a:0 ? a:1 : {} + let l:options = a:0 ? a:1 : {} - if has_key(opts, 'where') && !empty(opts['where']) - let opener = g:NERDTreeOpener.New(self.path, opts) - call opener.open(self) - else - let self.isOpen = 1 - if self.children ==# [] - return self._initChildren(0) - else - return 0 - endif + " If special options were specified, process them and return. + if has_key(l:options, 'where') && !empty(l:options['where']) + let l:opener = g:NERDTreeOpener.New(self.path, l:options) + call l:opener.open(self) + return 0 endif + + " Open any ancestors of this node that render within the same cascade. + let l:parent = self.parent + while !empty(l:parent) && !l:parent.isRoot() + if index(l:parent.getCascade(), self) >= 0 + let l:parent.isOpen = 1 + let l:parent = l:parent.parent + else + break + endif + endwhile + + let self.isOpen = 1 + + let l:numChildrenCached = 0 + if empty(self.children) + let l:numChildrenCached = self._initChildren(0) + endif + + return l:numChildrenCached endfunction -"FUNCTION: TreeDirNode.openAlong([opts]) {{{1 -"recursive open the dir if it has only one directory child. +" FUNCTION: TreeDirNode.openAlong([opts]) {{{1 +" recursive open the dir if it has only one directory child. " -"return the level of opened directories. +" return the level of opened directories. function! s:TreeDirNode.openAlong(...) let opts = a:0 ? a:1 : {} let level = 0 @@ -383,101 +472,65 @@ function! s:TreeDirNode.openAlong(...) endfunction " FUNCTION: TreeDirNode.openExplorer() {{{1 -" opens an explorer window for this node in the previous window (could be a -" nerd tree or a netrw) +" Open an explorer window for this node in the previous window. The explorer +" can be a NERDTree window or a netrw window. function! s:TreeDirNode.openExplorer() call self.open({'where': 'p'}) endfunction -"FUNCTION: TreeDirNode.openInNewTab(options) {{{1 +" FUNCTION: TreeDirNode.openInNewTab(options) {{{1 unlet s:TreeDirNode.openInNewTab function! s:TreeDirNode.openInNewTab(options) call nerdtree#deprecated('TreeDirNode.openInNewTab', 'is deprecated, use open() instead') call self.open({'where': 't'}) endfunction -"FUNCTION: TreeDirNode._openInNewTab() {{{1 +" FUNCTION: TreeDirNode._openInNewTab() {{{1 function! s:TreeDirNode._openInNewTab() tabnew call g:NERDTreeCreator.CreateTabTree(self.path.str()) endfunction -"FUNCTION: TreeDirNode.openRecursively() {{{1 -"Opens this treenode and all of its children whose paths arent 'ignored' -"because of the file filters. -" -"This method is actually a wrapper for the OpenRecursively2 method which does -"the work. +" FUNCTION: TreeDirNode.openRecursively() {{{1 +" Open this directory node and any descendant directory nodes whose pathnames +" are not ignored. function! s:TreeDirNode.openRecursively() - call self._openRecursively2(1) -endfunction + silent call self.open() -"FUNCTION: TreeDirNode._openRecursively2() {{{1 -"Opens this all children of this treenode recursively if either: -" *they arent filtered by file filters -" *a:forceOpen is 1 -" -"Args: -"forceOpen: 1 if this node should be opened regardless of file filters -function! s:TreeDirNode._openRecursively2(forceOpen) - if self.path.ignore(self.getNerdtree()) ==# 0 || a:forceOpen - let self.isOpen = 1 - if self.children ==# [] - call self._initChildren(1) + for l:child in self.children + if l:child.path.isDirectory && !l:child.path.ignore(l:child.getNerdtree()) + call l:child.openRecursively() endif - - for i in self.children - if i.path.isDirectory ==# 1 - call i._openRecursively2(0) - endif - endfor - endif + endfor endfunction -"FUNCTION: TreeDirNode.refresh() {{{1 -unlet s:TreeDirNode.refresh +" FUNCTION: TreeDirNode.refresh() {{{1 function! s:TreeDirNode.refresh() call self.path.refresh(self.getNerdtree()) "if this node was ever opened, refresh its children if self.isOpen || !empty(self.children) - "go thru all the files/dirs under this node + let files = self._glob('*', 1) + self._glob('.*', 0) let newChildNodes = [] let invalidFilesFound = 0 - let dir = self.path - let globDir = dir.str({'format': 'Glob'}) - let filesStr = globpath(globDir, '*') . "\n" . globpath(globDir, '.*') - let files = split(filesStr, "\n") for i in files - "filter out the .. and . directories - "Note: we must match .. AND ../ cos sometimes the globpath returns - "../ for path with strange chars (eg $) - "if i !~# '\/\.\.\/\?$' && i !~# '\/\.\/\?$' + try + "create a new path and see if it exists in this nodes children + let path = g:NERDTreePath.New(i) + let newNode = self.getChild(path) + if newNode != {} + call newNode.refresh() + call add(newChildNodes, newNode) - " Regular expression is too expensive. Use simply string comparison - " instead - if i[len(i)-3:2] != ".." && i[len(i)-2:2] != ".." && - \ i[len(i)-2:1] != "." && i[len(i)-1] != "." - try - "create a new path and see if it exists in this nodes children - let path = g:NERDTreePath.New(i) - let newNode = self.getChild(path) - if newNode != {} - call newNode.refresh() - call add(newChildNodes, newNode) - - "the node doesnt exist so create it - else - let newNode = g:NERDTreeFileNode.New(path, self.getNerdtree()) - let newNode.parent = self - call add(newChildNodes, newNode) - endif - - - catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/ - let invalidFilesFound = 1 - endtry - endif + "the node doesnt exist so create it + else + let newNode = g:NERDTreeFileNode.New(path, self.getNerdtree()) + let newNode.parent = self + call add(newChildNodes, newNode) + endif + catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/ + let invalidFilesFound = 1 + endtry endfor "swap this nodes children out for the children we just read/refreshed @@ -490,7 +543,7 @@ function! s:TreeDirNode.refresh() endif endfunction -"FUNCTION: TreeDirNode.refreshFlags() {{{1 +" FUNCTION: TreeDirNode.refreshFlags() {{{1 unlet s:TreeDirNode.refreshFlags function! s:TreeDirNode.refreshFlags() call self.path.refreshFlags(self.getNerdtree()) @@ -499,15 +552,15 @@ function! s:TreeDirNode.refreshFlags() endfor endfunction -"FUNCTION: TreeDirNode.refreshDirFlags() {{{1 +" FUNCTION: TreeDirNode.refreshDirFlags() {{{1 function! s:TreeDirNode.refreshDirFlags() call self.path.refreshFlags(self.getNerdtree()) endfunction -"FUNCTION: TreeDirNode.reveal(path) {{{1 -"reveal the given path, i.e. cache and open all treenodes needed to display it -"in the UI -"Returns the revealed node +" FUNCTION: TreeDirNode.reveal(path) {{{1 +" reveal the given path, i.e. cache and open all treenodes needed to display it +" in the UI +" Returns the revealed node function! s:TreeDirNode.reveal(path, ...) let opts = a:0 ? a:1 : {} @@ -534,14 +587,12 @@ function! s:TreeDirNode.reveal(path, ...) return n.reveal(a:path, opts) endfunction -"FUNCTION: TreeDirNode.removeChild(treenode) {{{1 +" FUNCTION: TreeDirNode.removeChild(treenode) {{{1 +" Remove the given treenode from "self.children". +" Throws "NERDTree.ChildNotFoundError" if the node is not found. " -"Removes the given treenode from this nodes set of children -" -"Args: -"treenode: the node to remove -" -"Throws a NERDTree.ChildNotFoundError if the given treenode is not found +" Args: +" treenode: the node object to remove function! s:TreeDirNode.removeChild(treenode) for i in range(0, self.getChildCount()-1) if self.children[i].equals(a:treenode) @@ -553,18 +604,15 @@ function! s:TreeDirNode.removeChild(treenode) throw "NERDTree.ChildNotFoundError: child node was not found" endfunction -"FUNCTION: TreeDirNode.sortChildren() {{{1 -" -"Sorts the children of this node according to alphabetical order and the -"directory priority. -" +" FUNCTION: TreeDirNode.sortChildren() {{{1 +" Sort "self.children" by alphabetical order and directory priority. function! s:TreeDirNode.sortChildren() let CompareFunc = function("nerdtree#compareNodesBySortKey") call sort(self.children, CompareFunc) endfunction -"FUNCTION: TreeDirNode.toggleOpen([options]) {{{1 -"Opens this directory if it is closed and vice versa +" FUNCTION: TreeDirNode.toggleOpen([options]) {{{1 +" Opens this directory if it is closed and vice versa function! s:TreeDirNode.toggleOpen(...) let opts = a:0 ? a:1 : {} if self.isOpen ==# 1 @@ -578,13 +626,13 @@ function! s:TreeDirNode.toggleOpen(...) endif endfunction -"FUNCTION: TreeDirNode.transplantChild(newNode) {{{1 -"Replaces the child of this with the given node (where the child node's full -"path matches a:newNode's fullpath). The search for the matching node is -"non-recursive +" FUNCTION: TreeDirNode.transplantChild(newNode) {{{1 +" Replaces the child of this with the given node (where the child node's full +" path matches a:newNode's fullpath). The search for the matching node is +" non-recursive " -"Arg: -"newNode: the node to graft into the tree +" Arg: +" newNode: the node to graft into the tree function! s:TreeDirNode.transplantChild(newNode) for i in range(0, self.getChildCount()-1) if self.children[i].equals(a:newNode) diff --git a/sources_non_forked/nerdtree/lib/nerdtree/ui.vim b/sources_non_forked/nerdtree/lib/nerdtree/ui.vim index d107814c..e169dbbf 100644 --- a/sources_non_forked/nerdtree/lib/nerdtree/ui.vim +++ b/sources_non_forked/nerdtree/lib/nerdtree/ui.vim @@ -20,108 +20,105 @@ endfunction "FUNCTION: s:UI._dumpHelp {{{1 "prints out the quick help function! s:UI._dumpHelp() - let old_h = @h if self.getShowHelp() - let @h= "\" NERD tree (" . nerdtree#version() . ") quickhelp~\n" - let @h=@h."\" ============================\n" - let @h=@h."\" File node mappings~\n" - let @h=@h."\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n" - let @h=@h."\" ,\n" + let help = "\" NERD tree (" . nerdtree#version() . ") quickhelp~\n" + let help .= "\" ============================\n" + let help .= "\" File node mappings~\n" + let help .= "\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n" + let help .= "\" ,\n" if self.nerdtree.isTabTree() - let @h=@h."\" ". g:NERDTreeMapActivateNode .": open in prev window\n" + let help .= "\" ". g:NERDTreeMapActivateNode .": open in prev window\n" else - let @h=@h."\" ". g:NERDTreeMapActivateNode .": open in current window\n" + let help .= "\" ". g:NERDTreeMapActivateNode .": open in current window\n" endif if self.nerdtree.isTabTree() - let @h=@h."\" ". g:NERDTreeMapPreview .": preview\n" + let help .= "\" ". g:NERDTreeMapPreview .": preview\n" endif - let @h=@h."\" ". g:NERDTreeMapOpenInTab.": open in new tab\n" - let @h=@h."\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n" - let @h=@h."\" middle-click,\n" - let @h=@h."\" ". g:NERDTreeMapOpenSplit .": open split\n" - let @h=@h."\" ". g:NERDTreeMapPreviewSplit .": preview split\n" - let @h=@h."\" ". g:NERDTreeMapOpenVSplit .": open vsplit\n" - let @h=@h."\" ". g:NERDTreeMapPreviewVSplit .": preview vsplit\n" + let help .= "\" ". g:NERDTreeMapOpenInTab.": open in new tab\n" + let help .= "\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n" + let help .= "\" middle-click,\n" + let help .= "\" ". g:NERDTreeMapOpenSplit .": open split\n" + let help .= "\" ". g:NERDTreeMapPreviewSplit .": preview split\n" + let help .= "\" ". g:NERDTreeMapOpenVSplit .": open vsplit\n" + let help .= "\" ". g:NERDTreeMapPreviewVSplit .": preview vsplit\n" - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Directory node mappings~\n" - let @h=@h."\" ". (g:NERDTreeMouseMode ==# 1 ? "double" : "single") ."-click,\n" - let @h=@h."\" ". g:NERDTreeMapActivateNode .": open & close node\n" - let @h=@h."\" ". g:NERDTreeMapOpenRecursively .": recursively open node\n" - let @h=@h."\" ". g:NERDTreeMapCloseDir .": close parent of node\n" - let @h=@h."\" ". g:NERDTreeMapCloseChildren .": close all child nodes of\n" - let @h=@h."\" current node recursively\n" - let @h=@h."\" middle-click,\n" - let @h=@h."\" ". g:NERDTreeMapOpenExpl.": explore selected dir\n" + let help .= "\"\n\" ----------------------------\n" + let help .= "\" Directory node mappings~\n" + let help .= "\" ". (g:NERDTreeMouseMode ==# 1 ? "double" : "single") ."-click,\n" + let help .= "\" ". g:NERDTreeMapActivateNode .": open & close node\n" + let help .= "\" ". g:NERDTreeMapOpenRecursively .": recursively open node\n" + let help .= "\" ". g:NERDTreeMapCloseDir .": close parent of node\n" + let help .= "\" ". g:NERDTreeMapCloseChildren .": close all child nodes of\n" + let help .= "\" current node recursively\n" + let help .= "\" middle-click,\n" + let help .= "\" ". g:NERDTreeMapOpenExpl.": explore selected dir\n" - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Bookmark table mappings~\n" - let @h=@h."\" double-click,\n" - let @h=@h."\" ". g:NERDTreeMapActivateNode .": open bookmark\n" - let @h=@h."\" ". g:NERDTreeMapOpenInTab.": open in new tab\n" - let @h=@h."\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n" - let @h=@h."\" ". g:NERDTreeMapDeleteBookmark .": delete bookmark\n" + let help .= "\"\n\" ----------------------------\n" + let help .= "\" Bookmark table mappings~\n" + let help .= "\" double-click,\n" + let help .= "\" ". g:NERDTreeMapActivateNode .": open bookmark\n" + let help .= "\" ". g:NERDTreeMapOpenInTab.": open in new tab\n" + let help .= "\" ". g:NERDTreeMapOpenInTabSilent .": open in new tab silently\n" + let help .= "\" ". g:NERDTreeMapDeleteBookmark .": delete bookmark\n" - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Tree navigation mappings~\n" - let @h=@h."\" ". g:NERDTreeMapJumpRoot .": go to root\n" - let @h=@h."\" ". g:NERDTreeMapJumpParent .": go to parent\n" - let @h=@h."\" ". g:NERDTreeMapJumpFirstChild .": go to first child\n" - let @h=@h."\" ". g:NERDTreeMapJumpLastChild .": go to last child\n" - let @h=@h."\" ". g:NERDTreeMapJumpNextSibling .": go to next sibling\n" - let @h=@h."\" ". g:NERDTreeMapJumpPrevSibling .": go to prev sibling\n" + let help .= "\"\n\" ----------------------------\n" + let help .= "\" Tree navigation mappings~\n" + let help .= "\" ". g:NERDTreeMapJumpRoot .": go to root\n" + let help .= "\" ". g:NERDTreeMapJumpParent .": go to parent\n" + let help .= "\" ". g:NERDTreeMapJumpFirstChild .": go to first child\n" + let help .= "\" ". g:NERDTreeMapJumpLastChild .": go to last child\n" + let help .= "\" ". g:NERDTreeMapJumpNextSibling .": go to next sibling\n" + let help .= "\" ". g:NERDTreeMapJumpPrevSibling .": go to prev sibling\n" - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Filesystem mappings~\n" - let @h=@h."\" ". g:NERDTreeMapChangeRoot .": change tree root to the\n" - let @h=@h."\" selected dir\n" - let @h=@h."\" ". g:NERDTreeMapUpdir .": move tree root up a dir\n" - let @h=@h."\" ". g:NERDTreeMapUpdirKeepOpen .": move tree root up a dir\n" - let @h=@h."\" but leave old root open\n" - let @h=@h."\" ". g:NERDTreeMapRefresh .": refresh cursor dir\n" - let @h=@h."\" ". g:NERDTreeMapRefreshRoot .": refresh current root\n" - let @h=@h."\" ". g:NERDTreeMapMenu .": Show menu\n" - let @h=@h."\" ". g:NERDTreeMapChdir .":change the CWD to the\n" - let @h=@h."\" selected dir\n" - let @h=@h."\" ". g:NERDTreeMapCWD .":change tree root to CWD\n" + let help .= "\"\n\" ----------------------------\n" + let help .= "\" Filesystem mappings~\n" + let help .= "\" ". g:NERDTreeMapChangeRoot .": change tree root to the\n" + let help .= "\" selected dir\n" + let help .= "\" ". g:NERDTreeMapUpdir .": move tree root up a dir\n" + let help .= "\" ". g:NERDTreeMapUpdirKeepOpen .": move tree root up a dir\n" + let help .= "\" but leave old root open\n" + let help .= "\" ". g:NERDTreeMapRefresh .": refresh cursor dir\n" + let help .= "\" ". g:NERDTreeMapRefreshRoot .": refresh current root\n" + let help .= "\" ". g:NERDTreeMapMenu .": Show menu\n" + let help .= "\" ". g:NERDTreeMapChdir .":change the CWD to the\n" + let help .= "\" selected dir\n" + let help .= "\" ". g:NERDTreeMapCWD .":change tree root to CWD\n" - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Tree filtering mappings~\n" - let @h=@h."\" ". g:NERDTreeMapToggleHidden .": hidden files (" . (self.getShowHidden() ? "on" : "off") . ")\n" - let @h=@h."\" ". g:NERDTreeMapToggleFilters .": file filters (" . (self.isIgnoreFilterEnabled() ? "on" : "off") . ")\n" - let @h=@h."\" ". g:NERDTreeMapToggleFiles .": files (" . (self.getShowFiles() ? "on" : "off") . ")\n" - let @h=@h."\" ". g:NERDTreeMapToggleBookmarks .": bookmarks (" . (self.getShowBookmarks() ? "on" : "off") . ")\n" + let help .= "\"\n\" ----------------------------\n" + let help .= "\" Tree filtering mappings~\n" + let help .= "\" ". g:NERDTreeMapToggleHidden .": hidden files (" . (self.getShowHidden() ? "on" : "off") . ")\n" + let help .= "\" ". g:NERDTreeMapToggleFilters .": file filters (" . (self.isIgnoreFilterEnabled() ? "on" : "off") . ")\n" + let help .= "\" ". g:NERDTreeMapToggleFiles .": files (" . (self.getShowFiles() ? "on" : "off") . ")\n" + let help .= "\" ". g:NERDTreeMapToggleBookmarks .": bookmarks (" . (self.getShowBookmarks() ? "on" : "off") . ")\n" "add quickhelp entries for each custom key map - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Custom mappings~\n" + let help .= "\"\n\" ----------------------------\n" + let help .= "\" Custom mappings~\n" for i in g:NERDTreeKeyMap.All() if !empty(i.quickhelpText) - let @h=@h."\" ". i.key .": ". i.quickhelpText ."\n" + let help .= "\" ". i.key .": ". i.quickhelpText ."\n" endif endfor - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Other mappings~\n" - let @h=@h."\" ". g:NERDTreeMapQuit .": Close the NERDTree window\n" - let @h=@h."\" ". g:NERDTreeMapToggleZoom .": Zoom (maximize-minimize)\n" - let @h=@h."\" the NERDTree window\n" - let @h=@h."\" ". g:NERDTreeMapHelp .": toggle help\n" - let @h=@h."\"\n\" ----------------------------\n" - let @h=@h."\" Bookmark commands~\n" - let @h=@h."\" :Bookmark []\n" - let @h=@h."\" :BookmarkToRoot \n" - let @h=@h."\" :RevealBookmark \n" - let @h=@h."\" :OpenBookmark \n" - let @h=@h."\" :ClearBookmarks []\n" - let @h=@h."\" :ClearAllBookmarks\n" - silent! put h + let help .= "\"\n\" ----------------------------\n" + let help .= "\" Other mappings~\n" + let help .= "\" ". g:NERDTreeMapQuit .": Close the NERDTree window\n" + let help .= "\" ". g:NERDTreeMapToggleZoom .": Zoom (maximize-minimize)\n" + let help .= "\" the NERDTree window\n" + let help .= "\" ". g:NERDTreeMapHelp .": toggle help\n" + let help .= "\"\n\" ----------------------------\n" + let help .= "\" Bookmark commands~\n" + let help .= "\" :Bookmark []\n" + let help .= "\" :BookmarkToRoot \n" + let help .= "\" :RevealBookmark \n" + let help .= "\" :OpenBookmark \n" + let help .= "\" :ClearBookmarks []\n" + let help .= "\" :ClearAllBookmarks\n" + silent! put =help elseif !self.isMinimal() - let @h="\" Press ". g:NERDTreeMapHelp ." for help\n" - silent! put h + let help ="\" Press ". g:NERDTreeMapHelp ." for help\n" + silent! put =help endif - - let @h = old_h endfunction @@ -316,6 +313,10 @@ function! s:UI._renderBookmarks() call cursor(line(".")+1, col(".")) endif + if g:NERDTreeBookmarksSort == 1 || g:NERDTreeBookmarksSort == 2 + call g:NERDTreeBookmark.SortBookmarksList() + endif + for i in g:NERDTreeBookmark.Bookmarks() call setline(line(".")+1, i.str()) call cursor(line(".")+1, col(".")) @@ -440,10 +441,7 @@ function! s:UI.render() call cursor(line(".")+1, col(".")) "draw the tree - let old_o = @o - let @o = self.nerdtree.root.renderToString() - silent put o - let @o = old_o + silent put =self.nerdtree.root.renderToString() "delete the blank line at the top of the buffer silent 1,1delete _ diff --git a/sources_non_forked/nerdtree/plugin/NERD_tree.vim b/sources_non_forked/nerdtree/plugin/NERD_tree.vim index 451b431b..7eeb682c 100644 --- a/sources_non_forked/nerdtree/plugin/NERD_tree.vim +++ b/sources_non_forked/nerdtree/plugin/NERD_tree.vim @@ -46,6 +46,7 @@ endfunction call s:initVariable("g:NERDTreeAutoCenter", 1) call s:initVariable("g:NERDTreeAutoCenterThreshold", 3) call s:initVariable("g:NERDTreeCaseSensitiveSort", 0) +call s:initVariable("g:NERDTreeNaturalSort", 0) call s:initVariable("g:NERDTreeSortHiddenFirst", 1) call s:initVariable("g:NERDTreeChDirMode", 0) call s:initVariable("g:NERDTreeCreatePrefix", "silent") @@ -57,6 +58,7 @@ call s:initVariable("g:NERDTreeBookmarksFile", expand('$HOME') . '/.NERDTreeBook call s:initVariable("g:NERDTreeBookmarksSort", 1) call s:initVariable("g:NERDTreeHighlightCursorline", 1) call s:initVariable("g:NERDTreeHijackNetrw", 1) +call s:initVariable('g:NERDTreeMarkBookmarks', 1) call s:initVariable("g:NERDTreeMouseMode", 1) call s:initVariable("g:NERDTreeNotificationThreshold", 100) call s:initVariable("g:NERDTreeQuitOnOpen", 0) diff --git a/sources_non_forked/syntastic/README.markdown b/sources_non_forked/syntastic/README.markdown index 7ed8cc87..8f0e4607 100644 --- a/sources_non_forked/syntastic/README.markdown +++ b/sources_non_forked/syntastic/README.markdown @@ -58,15 +58,15 @@ their script to find them. At the time of this writing, syntastic has checking plugins for ACPI Source Language, 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, +AppleScript, AsciiDoc, Assembly languages, BEMHTML, Bro, Bourne shell, C, C++, +C#, Cabal, Chef, CMake, 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, Solidity, +GLSL, Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, +JSON, JSX, Julia, 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, Solidity, Sphinx, SQL, Stylus, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, Vim help, VimL, xHtml, XML, XSLT, XQuery, YACC, YAML, YANG data models, z80, Zope page templates, and Zsh. See the [manual][checkers] for details about the @@ -101,10 +101,10 @@ enabled. 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. +`reltime`, `statusline`, 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], diff --git a/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim b/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim index 9d25b849..43a1b9ac 100644 --- a/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim +++ b/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim @@ -8,6 +8,37 @@ set cpo&vim " Public functions {{{1 +function! syntastic#preprocess#bandit(errors) abort " {{{2 + let out = [] + let json = s:_decode_JSON(join(a:errors, '')) + + if type(json) == type({}) && has_key(json, 'results') && type(json['results']) == type([]) + for issue in json['results'] + if type(issue) == type({}) + try + call add(out, + \ issue['filename'] . ':' . + \ issue['line_number'] . ':' . + \ { 'LOW': 'I', 'MEDIUM': 'W', 'HIGH': 'E' }[issue['issue_severity']] . ':' . + \ issue['test_id'][1:] . ':' . + \ issue['issue_text'] . + \ ' [' . issue['test_name'] . '] (confidence: ' . issue['issue_confidence'] . ')') + catch /\m^Vim\%((\a\+)\)\=:E716/ + call syntastic#log#warn('checker python/bandit: unrecognized error item ' . string(issue)) + let out = [] + break + endtry + else + call syntastic#log#warn('checker python/bandit: unrecognized error item ' . string(issue)) + endif + endfor + else + call syntastic#log#warn('checker python/bandit: unrecognized error format (crashed checker?)') + endif + + return out +endfunction " }}}2 + function! syntastic#preprocess#cabal(errors) abort " {{{2 let out = [] let star = 0 @@ -98,6 +129,35 @@ function! syntastic#preprocess#dockerfile_lint(errors) abort " {{{2 return out endfunction " }}}2 +function! syntastic#preprocess#dscanner(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, 'issues') && type(errs['issues']) == type([]) + for issue in errs['issues'] + try + call add(out, + \ issue['fileName'] . ':' . + \ issue['line'] . ':' . + \ issue['column'] . ':' . + \ issue['message'] . ' [' . issue['key'] . ']') + catch /\m^Vim\%((\a\+)\)\=:E716/ + call syntastic#log#warn('checker d/dscanner: unrecognized error item ' . string(issue)) + let out = [] + break + endtry + endfor + else + call syntastic#log#warn('checker d/dscanner: unrecognized error format (crashed checker?)') + endif + + return out +endfunction " }}}2 + function! syntastic#preprocess#flow(errors) abort " {{{2 let idx = 0 while idx < len(a:errors) && a:errors[idx][0] !=# '{' @@ -205,12 +265,17 @@ function! syntastic#preprocess#perl(errors) abort " {{{2 endfunction " }}}2 function! syntastic#preprocess#prospector(errors) abort " {{{2 - let errs = s:_decode_JSON(join(a:errors, '')) + let errs = join(a:errors, '') + if errs ==# '' + return [] + endif + + let json = s:_decode_JSON(errs) let out = [] - if type(errs) == type({}) && has_key(errs, 'messages') - if type(errs['messages']) == type([]) - for e in errs['messages'] + if type(json) == type({}) && has_key(json, 'messages') + if type(json['messages']) == type([]) + for e in json['messages'] if type(e) == type({}) try if e['source'] ==# 'pylint' @@ -240,6 +305,8 @@ function! syntastic#preprocess#prospector(errors) abort " {{{2 else call syntastic#log#warn('checker python/prospector: unrecognized error format (crashed checker?)') endif + else + call syntastic#log#warn('checker python/prospector: unrecognized error format (crashed checker?)') endif return out @@ -406,7 +473,7 @@ echomsg string(out) endfunction " }}}2 function! syntastic#preprocess#tslint(errors) abort " {{{2 - return map(copy(a:errors), 'substitute(v:val, ''\m^\(([^)]\+)\)\s\(.\+\)$'', ''\2 \1'', "")') + return map(copy(a:errors), 'substitute(v:val, ''\v^((ERROR|WARNING): )?\zs(\([^)]+\))\s(.+)$'', ''\4 \3'', "")') endfunction " }}}2 function! syntastic#preprocess#validator(errors) abort " {{{2 diff --git a/sources_non_forked/syntastic/autoload/syntastic/util.vim b/sources_non_forked/syntastic/autoload/syntastic/util.vim index deeb0f1f..3f0f70fb 100644 --- a/sources_non_forked/syntastic/autoload/syntastic/util.vim +++ b/sources_non_forked/syntastic/autoload/syntastic/util.vim @@ -76,7 +76,7 @@ function! syntastic#util#tmpdir() abort " {{{2 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") + let out = split(syntastic#util#system('mktemp -q -d ' . tmp . '/vim-syntastic-' . s:_fuzz() . '-XXXXXXXX'), "\n") if v:shell_error == 0 && len(out) == 1 let tempdir = out[0] endif @@ -84,13 +84,13 @@ function! syntastic#util#tmpdir() abort " {{{2 if tempdir ==# '' if has('win32') || has('win64') - let tempdir = $TEMP . syntastic#util#Slash() . 'vim-syntastic-' . getpid() + let tempdir = $TEMP . syntastic#util#Slash() . 'vim-syntastic-' . s:_fuzz() elseif has('win32unix') - let tempdir = syntastic#util#CygwinPath('/tmp/vim-syntastic-' . getpid()) + let tempdir = syntastic#util#CygwinPath('/tmp/vim-syntastic-' . s:_fuzz()) elseif $TMPDIR !=# '' - let tempdir = $TMPDIR . '/vim-syntastic-' . getpid() + let tempdir = $TMPDIR . '/vim-syntastic-' . s:_fuzz() else - let tempdir = '/tmp/vim-syntastic-' . getpid() + let tempdir = '/tmp/vim-syntastic-' . s:_fuzz() endif try @@ -132,9 +132,9 @@ endfunction " }}}2 " returns " " {'exe': '/usr/bin/perl', 'args': ['-f', '-bar']} -function! syntastic#util#parseShebang() abort " {{{2 +function! syntastic#util#parseShebang(buf) abort " {{{2 for lnum in range(1, 5) - let line = getline(lnum) + let line = get(getbufline(a:buf, lnum), 0, '') if line =~# '^#!' let line = substitute(line, '\v^#!\s*(\S+/env(\s+-\S+)*\s+)?', '', '') let exe = matchstr(line, '\m^\S*\ze') @@ -401,9 +401,6 @@ function! syntastic#util#setLastTick(buf) abort " {{{2 call setbufvar(a:buf, 'syntastic_lasttick', getbufvar(a:buf, '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('$')) @@ -614,8 +611,18 @@ endfunction "}}}2 let s:_getbufvar = function(v:version > 703 || (v:version == 703 && has('patch831')) ? 'getbufvar' : 's:_getbufvar_dumb') lockvar s:_getbufvar +function! s:_fuzz_dumb() abort " {{{2 + return 'tmp' +endfunction " }}}2 + +let s:_fuzz = function(exists('*getpid') ? 'getpid' : 's:_fuzz_dumb') +lockvar s:_fuzz + " }}}1 +let s:_wid_base = 'syntastic_' . s:_fuzz() . '_' . reltimestr(g:_SYNTASTIC_START) . '_' +let s:_wid_pool = 0 + let &cpo = s:save_cpo unlet s:save_cpo diff --git a/sources_non_forked/syntastic/doc/syntastic-checkers.txt b/sources_non_forked/syntastic/doc/syntastic-checkers.txt index d8fb584d..c8fac05e 100644 --- a/sources_non_forked/syntastic/doc/syntastic-checkers.txt +++ b/sources_non_forked/syntastic/doc/syntastic-checkers.txt @@ -23,6 +23,7 @@ SYNTAX CHECKERS BY LANGUAGE *syntastic-checkers-lang* C++......................................|syntastic-checkers-cpp| Cabal....................................|syntastic-checkers-cabal| Chef.....................................|syntastic-checkers-chef| + CMake....................................|syntastic-checkers-cmake| COBOL....................................|syntastic-checkers-cobol| Coco.....................................|syntastic-checkers-co| CoffeeScript.............................|syntastic-checkers-coffee| @@ -58,6 +59,7 @@ SYNTAX CHECKERS BY LANGUAGE *syntastic-checkers-lang* Java.....................................|syntastic-checkers-java| JavaScript...............................|syntastic-checkers-javascript| JSON.....................................|syntastic-checkers-json| + Julia....................................|syntastic-checkers-julia| LESS.....................................|syntastic-checkers-less| Lex......................................|syntastic-checkers-lex| @@ -530,12 +532,14 @@ The following checkers are available for C (filetype "c"): 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| + 6. cppclean.................|syntastic-c-cppclean| + 7. Flawfinder...............|syntastic-c-flawfinder| + 8. GCC......................|syntastic-c-gcc| + 9. make.....................|syntastic-c-make| + 10. OClint..................|syntastic-c-oclint| + 11. PC-Lint.................|syntastic-c-pc_lint| + 12. Sparse..................|syntastic-c-sparse| + 13. Splint..................|syntastic-c-splint| ------------------------------------------------------------------------------ 1. AVR-GCC *syntastic-c-avrgcc* @@ -693,7 +697,57 @@ one option per line (cf. |syntastic-config-files|). See also: |syntastic-cpp-cppcheck|. ------------------------------------------------------------------------------ -6. GCC *syntastic-c-gcc* +6. cppclean *syntastic-c-cppclean* + +Name: cppclean +Maintainer: LCD 47 + +"cppclean" attempts to find problems in C++ source that slow development in +large code bases, for example various forms of unused code. See the project's +page at GitHub for more information: + + https://github.com/myint/cppclean + +Installation~ + +Install it with "pip": > + pip install cppclean +< +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-cpp-cppclean|. + +------------------------------------------------------------------------------ +7. Flawfinder *syntastic-c-flawfinder* + +Name: flawfinder +Maintainer: LCD 47 + +"Flawfinder" scans C/C++ source code for possible security weaknesses. See the +project's page for more information: + + https://www.dwheeler.com/flawfinder + +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_c_flawfinder_thres'* +Type: integer +Default: 3 +Error threshold. Policy violations with a severity above this value are +highlighted as errors, the others are considered warnings by syntastic. + +See also: |syntastic-cpp-flawfinder|. + +------------------------------------------------------------------------------ +8. GCC *syntastic-c-gcc* Name: gcc Maintainer: Gregor Uhlenheuer @@ -790,7 +844,7 @@ executable. See also: |syntastic-cpp-gcc|. ------------------------------------------------------------------------------ -7. make *syntastic-c-make* +9. make *syntastic-c-make* Name: make Maintainer: Gregor Uhlenheuer @@ -801,7 +855,7 @@ 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* +10. OClint *syntastic-c-oclint* Name: oclint Maintainer: "UnCO" Lin @@ -840,7 +894,7 @@ 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* +11. PC-Lint *syntastic-c-pc_lint* Name: pc_lint Maintainer: Steve Bragg @@ -867,7 +921,7 @@ current directory and in parent directories; first such file found is used. See also: |syntastic-cpp-pc_lint|. ------------------------------------------------------------------------------ -10. Sparse *syntastic-c-sparse* +12. Sparse *syntastic-c-sparse* Name: sparse Maintainer: Daniel Walker @@ -899,7 +953,7 @@ your vimrc: > This allows "Sparse" to read "GCC"'s private include files. ------------------------------------------------------------------------------ -11. Splint *syntastic-c-splint* +13. Splint *syntastic-c-splint* Name: splint Maintainer: LCD 47 @@ -955,11 +1009,13 @@ The following checkers are available for C++ (filetype "cpp"): 2. ClangCheck...............|syntastic-cpp-clang_check| 3. Clang-Tidy...............|syntastic-cpp-clang_tidy| 4. Cppcheck.................|syntastic-cpp-cppcheck| - 5. Cpplint..................|syntastic-cpp-cpplint| - 6. GCC......................|syntastic-cpp-gcc| - 7. OClint...................|syntastic-cpp-oclint| - 8. PC-Lint..................|syntastic-cpp-pc_lint| - 9. Vera++...................|syntastic-cpp-verapp| + 5. cppclean.................|syntastic-cpp-cppclean| + 6. Cpplint..................|syntastic-cpp-cpplint| + 7. Flawfinder...............|syntastic-cpp-flawfinder| + 8. GCC......................|syntastic-cpp-gcc| + 9. OClint...................|syntastic-cpp-oclint| + 10. PC-Lint.................|syntastic-cpp-pc_lint| + 11. Vera++..................|syntastic-cpp-verapp| ------------------------------------------------------------------------------ 1. AVR-GCC *syntastic-cpp-avrgcc* @@ -1103,7 +1159,31 @@ one option per line (cf. |syntastic-config-files|). See also: |syntastic-c-cppcheck|. ------------------------------------------------------------------------------ -5. Cpplint *syntastic-cpp-cpplint* +5. cppclean *syntastic-cpp-cppclean* + +Name: cppclean +Maintainer: LCD 47 + +"cppclean" attempts to find problems in C++ source that slow development in +large code bases, for example various forms of unused code. See the project's +page at GitHub for more information: + + https://github.com/myint/cppclean + +Installation~ + +Install it with "pip": > + pip install cppclean +< +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-c-cppclean|. + +------------------------------------------------------------------------------ +6. Cpplint *syntastic-cpp-cpplint* Name: cpplint Maintainer: LCD 47 @@ -1139,7 +1219,33 @@ However, if your "cpplint" was installed with "pip", the script's name is let g:syntastic_cpp_cpplint_exec = "cpplint" < ------------------------------------------------------------------------------ -6. GCC *syntastic-cpp-gcc* +7. Flawfinder *syntastic-cpp-flawfinder* + +Name: flawfinder +Maintainer: LCD 47 + +"Flawfinder" scans C/C++ source code for possible security weaknesses. See the +project's page for more information: + + https://www.dwheeler.com/flawfinder + +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_flawfinder_thres'* +Type: integer +Default: 3 +Error threshold. Policy violations with a severity above this value are +highlighted as errors, the others are considered warnings by syntastic. + +See also: |syntastic-c-flawfinder|. + +------------------------------------------------------------------------------ +8. GCC *syntastic-cpp-gcc* Name: gcc Maintainer: Gregor Uhlenheuer @@ -1236,7 +1342,7 @@ executable. See also: |syntastic-c-gcc|. ------------------------------------------------------------------------------ -7. OClint *syntastic-cpp-oclint* +9. OClint *syntastic-cpp-oclint* Name: oclint Maintainer: "UnCO" Lin @@ -1276,7 +1382,7 @@ Config files pointed to by 'g:syntastic_oclint_config_file' are then ignored. See also: |syntastic-c-oclint|. ------------------------------------------------------------------------------ -8. PC-Lint *syntastic-cpp-pc_lint* +10. PC-Lint *syntastic-cpp-pc_lint* Name: pc_lint Maintainer: Steve Bragg @@ -1303,7 +1409,7 @@ current directory and in parent directories; first such file found is used. See also: |syntastic-c-pc_lint|. ------------------------------------------------------------------------------ -9. Vera++ *syntastic-cpp-verapp* +11. Vera++ *syntastic-cpp-verapp* Name: verapp Maintainer: Lucas Verney @@ -1381,6 +1487,34 @@ You probably also need a plugin to set |filetype| for Chef files, such as https://github.com/dougireton/vim-chef +============================================================================== +SYNTAX CHECKERS FOR CMAKE *syntastic-checkers-cmake* + +The following checkers are available for CMake (filetype "cmake"): + + 1. cmakelint................|syntastic-cmake-cmakelint| + +------------------------------------------------------------------------------ +1. cmakelint *syntastic-cmake-cmakelint* + +Name: cmakelint +Maintainer: LCD 47 + +"cmakelint" is a style checker for "CMake" files (https://cmake.org/). +See the project's page at GitHub more information: + + https://github.com/richq/cmake-lint + +Installation~ + +Install it with "pip": > + pip install cmakelint +< +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 COBOL *syntastic-checkers-cobol* @@ -1480,7 +1614,8 @@ 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| + 2. Coffee->JSHint...........|syntastic-coffee-coffee_jshint| + 3. CoffeeLint...............|syntastic-coffee-coffeelint| ------------------------------------------------------------------------------ 1. Coffee *syntastic-coffee-coffee* @@ -1500,7 +1635,28 @@ 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* +2. Coffee->JSHint *syntastic-coffee-coffee_jshint* + +Name: coffee_jshint +Maintainer: John Krauss + +"Coffee->JSHint" is a JSHint validator for CoffeeScript. See the project's +page at GitHub for details: + + https://github.com/marviq/coffee-jshint + +Installation~ + +Install it with "npm": > + npm install -g coffee-jshint +< +Checker options~ + +This checker is initialised using the "makeprgBuild()" function and thus it +Accepts the standard options described at |syntastic-config-makeprg|. + +------------------------------------------------------------------------------ +3. CoffeeLint *syntastic-coffee-coffeelint* Name: coffeelint Maintainer: Lincoln Stoll @@ -1755,6 +1911,7 @@ SYNTAX CHECKERS FOR D *syntastic-checkers-d* The following checkers are available for D (filetype "d"): 1. DMD......................|syntastic-d-dmd| + 2. D-Scanner................|syntastic-d-dscanner| ------------------------------------------------------------------------------ 1. DMD *syntastic-d-dmd* @@ -1834,6 +1991,22 @@ the usual 'g:syntastic_d_dmd_