[
  {
    "path": ".editorconfig",
    "content": "; .editorconfig\n\nroot = true\n\n[*]\nend_of_line = lf\ninsert_final_newline = true\nindent_style = space\nindent_size = 4\ncharset = utf-8\ntrim_trailing_whitespace = true\n\n[**.json]\nindent_style = space\nindent_size = 2\n\n[**.html]\nbrace_style = expand\n"
  },
  {
    "path": ".gitignore",
    "content": "local.vim\nplugins/plugged/*\nnerdtree_plugin\nspell\n"
  },
  {
    "path": ".tern-project",
    "content": "{\n    \"libs\" : [\"ecma6\", \"browser\", \"requirejs\"],\n    \"plugins\": {\n        \"node\" : {},\n        \"es_modules\" : {},\n        \"requirejs\" : {}\n    },\n    \"ecmaVersion\": 6\n}\n"
  },
  {
    "path": ".vimrc",
    "content": "\"\n\" WebVim Configuration entry point\n\"\n\" author: Bertrand Chevrier <chevrier.bertrand@gmail.com>\n\" source: https://github.com/krampstudio/dotvim\n\" year  : 2015\n\"\n\n\n\n\" You won't find any configuration here directly,\n\" please look at files under the config folder for global config\n\" and under plugins for plugins configuration\n\n\nfiletype plugin on\n\nlet g:vimDir = $HOME.'/.vim'\n\nlet g:hardcoreMode = 1\n\nlet s:pluginDir  = g:vimDir.'/plugins/plugged'\nlet s:pluginDef  = g:vimDir.'/plugins/def.vim'\nlet s:pluginConf = g:vimDir.'/plugins/config.vim'\n\nlet s:configSetting = g:vimDir.'/config/setting.vim'\nlet s:configMapping = g:vimDir.'/config/mapping.vim'\nlet s:configAbbrev  = g:vimDir.'/config/abbrev.vim'\nlet s:configAutocmd  = g:vimDir.'/config/autocmd.vim'\n\nlet s:userConfig  = g:vimDir.'/local.vim'\n\nif !isdirectory(s:pluginDir)\n\n    \" Welcome message when plugins are not yet installed\n\n    echom \" \"\n    echom \"Welcome to WebVim\"\n    echom \" > the vim IDE for web dev <\"\n    echom \" \"\n    echom \"Checking dependencies :\"\n    if (!executable('node') && !executable('nodejs')) || !executable('npm')\n        echom \" [ERR] node.js and npm are required, please install them before continuing.\"\n    \techom \" \"\n    else\n\n        echom \"  - nodejs   : ok\"\n        echom \"  - npm      : ok\"\n        echom \"  - eslint   : \" . (executable('eslint')   ? \"ok\" : \"no (optional)\")\n        echom \"  - jsonlint : \" . (executable('jsonlint') ? \"ok\" : \"no (optional)\")\n        echom \"  - csslint  : \" . (executable('csslint')  ? \"ok\" : \"no (optional)\")\n        echom \" done.\"\n\n        echom \" \"\n        echom \"We are going to install the plugins : \"\n        echom \" 1. take a coffee\"\n        echom \" 2. reload vim\"\n        echom \" 3. Envoy WebVim\"\n        echom \" \"\n        echom \"Please note if you want to have the arrows keys and <esc>, disable the 'hardcoreMode' in the vimrc\"\n        echom \" \"\n\n        exec \":source \".s:pluginDef\n\n\t\"Install plugins on first run\n\tautocmd VimEnter * PlugInstall\n    endif\n\nelse\n\n    \" Loads the global config, mapping and settings\n    exec \":source \".s:configSetting\n    exec \":source \".s:configMapping\n    exec \":source \".s:configAbbrev\n    exec \":source \".s:configAutocmd\n\n    \" Loads plugins def and config\n    exec \":source \".s:pluginDef\n    exec \":source \".s:pluginConf\n\n\n    \" user configuration\n    if filereadable(s:userConfig)\n       exec \":source \".s:userConfig\n    endif\n\nendif\n\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\nhttp://www.gnu.org/licenses/gpl-3.0.txt\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "![WebVim](resources/WebVim.png?v=2 \"WebVim\")\n===============================\n\nWebVim is a Vim based distribution targeting JavaScript and Web development.\n\nIt targets :\n - JavaScript development (ES5, ES6, node.js)\n - HTML5\n - CSS3 and SCSS\n\nAnd contains the features you expect from a modern code editor :\n\n - syntax highlighting\n - syntax and error checking\n - autocompletion\n - multi cursor\n - git support\n - code format\n - support coding conventions (editorconfig)\n - hardcore mode (for real Vim users)\n - Emmet support\n - jsdoc generation (coming soon)\n - debugging (coming soon)\n - grunt/gulp support (coming soon)\n - all the awesomeness from Vim\n\n> The WebVim idea is to provide you a vim distribution: something that comes prepackaged, preconfigured, built on a kernel to serve a goal. WebVim is to vim what Debian is to Linux, a vim distribution for the web.\n\n## Install\n\n__Only tested on Linux__\n\n### Dependencies (the long story)\n\nOn Ubuntu (from 15.04)\n\n 1. A modern version of Vim\n\n```sh\napt-get install vim vim-runtime vim-gui-common\n```\n\nor compile a recent version with `xterm_clipboard` and `ruby` or `python` support.\n\n 2. Some tools to compile YouCompleteMe\n\n```sh\napt-get install build-essential cmake python-dev exuberant-ctags\n```\n\n 3. Node.js and npm\n\n```sh\ncurl -sL https://deb.nodesource.com/setup_0.12 | bash -\napt-get install -y nodejs\n```\n\n 4. Some npm packages\n\n```sh\nnpm install -g eslint csslint jshint jsonlint handlebars\n```\n\n### Dependencies (the short story)\n\n> Please report me what you did to make it work on your OS\n\n#### Fedora 23/24\n\n```sh\nsudo dnf install cmake python-devel npm vim\nnpm install -g npm eslint csslint jshint jsonlint handlebars\n```\n\n### Install it:\n\n```sh\ngit clone https://github.com/krampstudio/webvim.git ~/.vim\nln -s ~/.vim/.vimrc ~/.vimrc\nln -s ~/.vim/.tern-project ~/.tern-project\nvim\n```\n\nThe plugins install can take some times, especially since there's a compilation made by YouCompleteMe. If you've the feeling the install has frozen, you can finish the install after by entering the command `:PlugInstall`.\n\n## Hardcore mode\n\nThe hardcore mode remap some keys to force you use Vim in a productive way:\n - no arrow keys for moving instead use the common Vim movement commands.\n - in insert mode, use `jk` to switch back to normal mode instead of `<esc>`\n\nRestricting commands is the best way to make your fingers learn. After one or two days, you should be more productive and have learned lots of Vim commands.\n\nYou can disable the hardcore mode by setting the value of `g:hardcoreMode` to `0` in `.vimrc`. You can also change the mappings.\n\n## Usage\n\n### Vim\n\nWebVim is only a Vim distribution with plugins and configuration, so all common Vim commands and basic mapping are available. You must know how to use Vim before using this IDE. If you're not comfortable with Vim enough I suggest you to take the interactive Vim tutorial (run `vimtutor` in a terminal), and keep a [common usage cheat sheet](http://fprintf.net/vimCheatSheet.html) close to you until your fingers get all the mappings in memory.\n\n### WebVim\n\n|                                                  | Command               | Mode | Context          |\n|--------------------------------------------------|-----------------------|:----:|------------------|\n| __Plugins__                                                                                        |\n| Install Plugins                                  | `:PlugInstall`        | n    |                  |\n| Update Plugins                                   | `:PlugUpdate`         | n    |                  |\n|                                                                                                    |\n| __Config__                                                                                         |\n| Edit .vimrc                                      | `<leader>ev`           | n    |                  |\n| Reload .vimrc                                    | `<leader>sv`           | n    |                  |\n|                                                                                                    |\n| __File Tree (NERDTree)__                                                                           |\n| Toggle Tree                                      | `<c-n>`               | n    |                  |\n| Open a node in a new tab                         | `t`                   |      | Tree Node        |\n| Change Root                                      | `C`                   |      | Tree Node        |\n| Tree menu                                        | `m`                   |      | Tree Node        |\n| Add a file                                       | `a`                   |      | Tree Menu        |\n| Delete a file                                    | `d`                   |      | Tree Menu        |\n| Move a file                                      | `m`                   |      | Tree Menu        |\n| Copy a file                                      | `c`                   |      | Tree Menu        |\n| Search in files (grep)                           | `g`                   |      | Tree Menu        |\n| Next match in grep                               | `:cn`                 |      | Grep > Quickfix  |\n| Move to left tab                                 | `<s-left>`            | n    |                  |\n| Move to right tab                                | `<s-right>`           | n    |                  |\n| Change window (ie. tree to tab)                  | `<c-w><c-w>`          |      |                  |\n| Help                                             | `?`                   |      | Tree             |\n| Documentation                                    | `:help NERDTree`      |      |                  |\n|                                                                                                    |\n| __Comment__                                                                                        |\n| Toggle comments                                  | `<c-/>`               | nv   |                  |\n| Comments                                         | `<leader>cc`          | nv   |                  |\n| Sexy Comments                                    | `<leader>cs`          | nv   |                  |\n| UnComments                                       | `<leader>cu`          | nv   |                  |\n| Yank and Comments                                | `<leader>cy`          | nv   |                  |\n| Documentation                                    | `:help NERDCommenter` |      |                  |\n|                                                                                                    |\n| __Align__                                                                                          |\n| Start interactive alignment                      | `EasyAlign`           | v    | selection        |\n| Align next paragraph on =                        | `<leader>a=`          | n    |                  |\n| Align next paragraph on :                        | `<leader>a:`          | n    |                  |\n| Align next paragraph on delimiter _x_            | `<leader>ax`          | n    |                  |\n| Right align selection on =                       | `<leader>a=`          | v    |                  |\n| Right align selection on :                       | `<leader>a:`          | v    |                  |\n| Right align selection on _x_                     | `<leader>ax`          | v    |                  |\n| Documentation                                    | `:help :EasyAlign`    |      |                  |\n|                                                                                                    |\n| __Format__                                                                                         |\n| Format the file                                  | `<c-f>`               | n    | js,json,html,css |\n| Format the selection                             | `<c-f>`               | n    | js,json,html,css |\n|                                                                                                    |\n| __Multiple Cursor__                                                                                |\n| Start multiple cursor                            | `<c-m>`               | v    | Visual Block     |\n| Multiple cursor insert                           | `i`                   |      | multiple cursor  |\n| Multiple cursor remove                           | `x`                   |      | multiple cursor  |\n| Leave multiple cursor                            | `<esc>`               |      | multiple cursor  |\n|                                                                                                    |\n| __Paste__                                                                                          |\n| cycle backward through your history of yanks     | `<leader>p`           | nv   | after paste `p`  |\n| cycle forward through your history of yanks      | `<leader>P`           | nv   | after paste `p`  |\n|                                                                                                    |\n| __AutoCompletion__                                                                                 |\n| Select next proposal in menu                     | `<tab>`               | i    | complete menu    |\n| Select previous proposal in menu                 | `<shift><tab>`        | i    | complete menu    |\n|                                                                                                    |\n| __Syntax checking__                                                                                |\n| Checkers infos                                   | `:SyntasticInfo`      | n    |                  |\n| Check                                            | `:SyntasticCheck`     | n    |                  |\n| Toggle check                                     | `:SyntasticToggleMode`| n    |                  |\n| Error window                                     | `:Errors`             | n    |                  |\n| Jump next error                                  | `:lnext`              | n    |                  |\n| Jump previous error                              | `:lprev`              | n    |                  |\n|                                                                                                    |\n| __JavaScript__                                                                                     |\n| Get type                                         | `<leader>gt`          | n    | under cursor     |\n| Get documentation                                | `<leader>gd`          | n    | under cursor     |\n| Go to                                            | `<leader>go`          | n    | under cursor     |\n| Jump to definition                               | `<leader>gf`          | n    | under cursor     |\n| Go to references                                 | `<leader>gr`          | n    | under cursor     |\n| Rename                                           | `<leader>r`           | n    | under cursor     |\n| Jump to the source of a `require`                | `gf`                  | n    | node.js, cursor  |\n| Edit the main file of a CJS module               | `:Nedit module`       | n    | node.js          |\n| Edit a file of a CJS module                      | `:Nedit module/foo.js`| n    | node.js          |\n| Edit projects main (from package.json)           | `:Nedit`              | n    | node.js          |\n|                                                                                                    |\n| __Git__                                                                                            |\n| git diff                                         | `:Gdiff`              | n    |                  |\n| git status                                       | `:Gstatus`            | n    |                  |\n| git commit                                       | `:Gcommit`            | n    |                  |\n| git blame                                        | `:Gblame`             | n    |                  |\n| git mv                                           | `:Gmove`              | n    |                  |\n| git rm                                           | `:Gremove`            | n    |                  |\n| Open the current file in Github                  | `:Gbrowse`            | n    |                  |\n|                                                                                                    |\n| __Spell Check__                                                                                    |\n| Enable checking                                  | `set spell`            | n   |                  |\n| move to the next misspelled word                 | `]s`                   | n   |                  |\n| move to the previous misspelled word             | `[s`                   | n   |                  |\n| add a word to the dictionary                     | `zg`                   | n   |                  |\n| undo the addition of a word to the dictionary    | `zug`                  | n   |                  |\n| view spelling suggestions for a misspelled word  | `z=`                   | n   |                  |\n|                                                                                                    |\n| __Search__                                                                                         |\n| clear highlights                                 | `<c-l>`               | n    |                  |\n|                                                                                                    |\n| __Editing__                                                                                        |\n| Move line up                                     | `<leader>-`           | nv   |                  |\n| Move line down                                   | `<leader>_`           | nv   |                  |\n| Wrap in single quote                             | `<leader>'`           | nv   |                  |\n| Wrap in double quote                             | `<leader>\"`           | nv   |                  |\n|                                                                                                    |\n| __Emmet__                                                                                          |\n| Expand abbreviation                              | `<c-k>,`              | i    | html,css,scss    |\n|                                                                                                    |\n| _Next sections to come soon_                                                                       |\n|                                                                                                    |\n\n_Modes_ :\n - `n` normal\n - `i` insert\n - `v` visual\n\n_Commands_ :\n - `:command` a Vim command\n - `:set something` can also be replaced by `:setlocal something` to apply it to the current buffer only\n - `<c-m>a` or `a` a keyboard command\n   - `<c-/>` means `CTRL and `/` (this is the Vim notation)\n   - `<s-left>` means `Shift` and `left arrow`\n   - `<c-a>b` means `CTRL` and `a`, then `b`\n   - `<leader>` is mapped to `,`\n   - `<localleader>` is mapped to `\\`\n\n\n\n\n## Plugins\n\nWebVim is only a distribution that contains plugins. The plugin authors have made the hard work.\n\n_Plugin authors rocks!_\n\n### Plugin\n - [vim-plug](https://github.com/junegunn/vim-plug) Minimalist Vim Plugin Manager\n\n### User interface\n\n - [Mango](https://github.com/goatslacker/mango.vim) A nice color scheme\n - [VimAirline](https://github.com/bling/vim-airline) Lean and mean statusbars\n\n### Manage your project\n\n - [NERDTree](https://github.com/scrooloose/nerdtree) Manage your project files\n - [VimFugitive](https://github.com/tpope/vim-fugitive) Git integration\n - [VimGitGutter](https://github.com/airblade/vim-gitgutter) Git diff in the gutter\n - [EditorconfigVim](https://github.com/editorconfig/editorconfig-vim) Shared coding conventions\n\n### Code writing\n\n - [NERDCommenter](https://github.com/scrooloose/nerdcommenter) Comments made easy\n - [VimTrailingWhitespace](https://github.com/bronson/vim-trailing-whitespace) Highlight trailing spaces\n - [Syntastic](https://github.com/scrooloose/syntastic) Syntax check and validation\n - [VimEasyAlign](https://github.com/junegunn/vim-easy-align) Realign pieces of code\n - [VimMultipleCursors](https://github.com/terryma/vim-multiple-cursors) Write on multiple lines easily\n - [VimJsBeautify](https://github.com/maksimr/vim-jsbeautify) Reformat JavaScript, HTML and JSON files\n - [VimYankStack](https://github.com/maxbrunsfeld/vim-yankstack) Iterate over yanked stack on paste\n - [VimSurround](https://github.com/tpope/vim-surround) Quoting and parenthesizing\n - [YouCompleteMe](https://github.com/Valloric/YouCompleteMe) Autocompletion engine\n - [VimNode](https://github.com/moll/vim-node) Navigate through node.js code/modules\n - [VimLint](https://github.com/syngan/vim-vimlint) Linter used by syntastic for VimL\n - [VimLParser](https://github.com/ynkdir/vim-vimlparser) VimL parser (required by VimLint)\n - [Emmet-vim](https://github.com/mattn/emmet-vim) Expanding abbreviations similar to [emmet](http://emmet.io/)\n\n### Code reading\n\n - [VimJson](https://github.com/elzr/vim-json) JSON highlighting and quote concealing\n - [YaJS](https://github.com/othree/yajs.vim) JavaScript syntax (ES5 and ES6)\n - [JavaScriptLibrariesSyntax](https://github.com/othree/javascript-libraries-syntax.vim) Syntax highlighting for well-known JS libraries\n - [VimCSS3](https://github.com/hail2u/vim-css3-syntax) CSS3 syntax\n - [ScssSyntax](https://github.com/cakebaker/scss-syntax.vim) SCSS syntax\n - [HTML5](https://github.com/othree/html5.vim) HTML5 syntax\n\n## History\n - __1.3.0__ Fixed dependencies, tern via YCM, Emmet, new theme, nerdtree grep, use local linters\n - __1.2.0__ Fix #28, support new esint config files, update installe\n - __1.1.0__ Add user config, autocmd file, fix easyalign mapping, update Nerdtree config, better mouse support in insert mode\n - __1.0.0__ Becomes `webvim` with an install process, a better configuration system, better plugins neighborhood\n - __0.1.0__ A basic `dotvim` repository with my own Vim configuration\n\n## Contributing\n\nEvery contribution is more than welcomed. You can:\n - [report issues](https://github.com/krampstudio/webvim/issues)\n - Fix, improve the configuration, add new features. The best is to fork and submit a pull request\n - Test and adapt to other OS\n - Fix my English mistakes\n - Update the documentation\n - Create a better logo\n - [Offer me a coffee](https://liberapay.com/krampstudio/donate)\n\n\n\n[![Donate using Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/krampstudio/donate)\n\n## License\n\nThe content of this repository is licensed under the [GPLv3](http://www.gnu.org/licenses/gpl-3.0.txt)\n\n"
  },
  {
    "path": "autoload/plug.vim",
    "content": "\" vim-plug: Vim plugin manager\n\" ============================\n\"\n\" Download plug.vim and put it in ~/.vim/autoload\n\"\n\"   curl -fLo ~/.vim/autoload/plug.vim --create-dirs \\\n\"     https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim\n\"\n\" Edit your .vimrc\n\"\n\"   call plug#begin('~/.vim/plugged')\n\"\n\"   \" Make sure you use single quotes\n\"\n\"   \" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align\n\"   Plug 'junegunn/vim-easy-align'\n\"\n\"   \" Any valid git URL is allowed\n\"   Plug 'https://github.com/junegunn/vim-github-dashboard.git'\n\"\n\"   \" Group dependencies, vim-snippets depends on ultisnips\n\"   Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'\n\"\n\"   \" On-demand loading\n\"   Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }\n\"   Plug 'tpope/vim-fireplace', { 'for': 'clojure' }\n\"\n\"   \" Using a non-master branch\n\"   Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }\n\"\n\"   \" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)\n\"   Plug 'fatih/vim-go', { 'tag': '*' }\n\"\n\"   \" Plugin options\n\"   Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }\n\"\n\"   \" Plugin outside ~/.vim/plugged with post-update hook\n\"   Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }\n\"\n\"   \" Unmanaged plugin (manually installed and updated)\n\"   Plug '~/my-prototype-plugin'\n\"\n\"   \" Add plugins to &runtimepath\n\"   call plug#end()\n\"\n\" Then reload .vimrc and :PlugInstall to install plugins.\n\"\n\" Plug options:\n\"\n\"| Option                  | Description                                      |\n\"| ----------------------- | ------------------------------------------------ |\n\"| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use       |\n\"| `rtp`                   | Subdirectory that contains Vim plugin            |\n\"| `dir`                   | Custom directory for the plugin                  |\n\"| `as`                    | Use different name for the plugin                |\n\"| `do`                    | Post-update hook (string or funcref)             |\n\"| `on`                    | On-demand loading: Commands or `<Plug>`-mappings |\n\"| `for`                   | On-demand loading: File types                    |\n\"| `frozen`                | Do not update unless explicitly specified        |\n\"\n\" More information: https://github.com/junegunn/vim-plug\n\"\n\"\n\" Copyright (c) 2016 Junegunn Choi\n\"\n\" MIT License\n\"\n\" Permission is hereby granted, free of charge, to any person obtaining\n\" a copy of this software and associated documentation files (the\n\" \"Software\"), to deal in the Software without restriction, including\n\" without limitation the rights to use, copy, modify, merge, publish,\n\" distribute, sublicense, and/or sell copies of the Software, and to\n\" permit persons to whom the Software is furnished to do so, subject to\n\" the following conditions:\n\"\n\" The above copyright notice and this permission notice shall be\n\" included in all copies or substantial portions of the Software.\n\"\n\" THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n\" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n\" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n\" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n\" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nif exists('g:loaded_plug')\n  finish\nendif\nlet g:loaded_plug = 1\n\nlet s:cpo_save = &cpo\nset cpo&vim\n\nlet s:plug_src = 'https://github.com/junegunn/vim-plug.git'\nlet s:plug_tab = get(s:, 'plug_tab', -1)\nlet s:plug_buf = get(s:, 'plug_buf', -1)\nlet s:mac_gui = has('gui_macvim') && has('gui_running')\nlet s:is_win = has('win32') || has('win64')\nlet s:nvim = has('nvim') && exists('*jobwait') && !s:is_win\nlet s:me = resolve(expand('<sfile>:p'))\nlet s:base_spec = { 'branch': 'master', 'frozen': 0 }\nlet s:TYPE = {\n\\   'string':  type(''),\n\\   'list':    type([]),\n\\   'dict':    type({}),\n\\   'funcref': type(function('call'))\n\\ }\nlet s:loaded = get(s:, 'loaded', {})\nlet s:triggers = get(s:, 'triggers', {})\n\nfunction! plug#begin(...)\n  if a:0 > 0\n    let s:plug_home_org = a:1\n    let home = s:path(fnamemodify(expand(a:1), ':p'))\n  elseif exists('g:plug_home')\n    let home = s:path(g:plug_home)\n  elseif !empty(&rtp)\n    let home = s:path(split(&rtp, ',')[0]) . '/plugged'\n  else\n    return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.')\n  endif\n\n  let g:plug_home = home\n  let g:plugs = {}\n  let g:plugs_order = []\n  let s:triggers = {}\n\n  call s:define_commands()\n  return 1\nendfunction\n\nfunction! s:define_commands()\n  command! -nargs=+ -bar Plug call plug#(<args>)\n  if !executable('git')\n    return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.')\n  endif\n  command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install(<bang>0, [<f-args>])\n  command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate  call s:update(<bang>0, [<f-args>])\n  command! -nargs=0 -bar -bang PlugClean call s:clean(<bang>0)\n  command! -nargs=0 -bar PlugUpgrade if s:upgrade() | execute 'source' s:esc(s:me) | endif\n  command! -nargs=0 -bar PlugStatus  call s:status()\n  command! -nargs=0 -bar PlugDiff    call s:diff()\n  command! -nargs=? -bar -bang -complete=file PlugSnapshot call s:snapshot(<bang>0, <f-args>)\nendfunction\n\nfunction! s:to_a(v)\n  return type(a:v) == s:TYPE.list ? a:v : [a:v]\nendfunction\n\nfunction! s:to_s(v)\n  return type(a:v) == s:TYPE.string ? a:v : join(a:v, \"\\n\") . \"\\n\"\nendfunction\n\nfunction! s:glob(from, pattern)\n  return s:lines(globpath(a:from, a:pattern))\nendfunction\n\nfunction! s:source(from, ...)\n  let found = 0\n  for pattern in a:000\n    for vim in s:glob(a:from, pattern)\n      execute 'source' s:esc(vim)\n      let found = 1\n    endfor\n  endfor\n  return found\nendfunction\n\nfunction! s:assoc(dict, key, val)\n  let a:dict[a:key] = add(get(a:dict, a:key, []), a:val)\nendfunction\n\nfunction! s:ask(message, ...)\n  call inputsave()\n  echohl WarningMsg\n  let answer = input(a:message.(a:0 ? ' (y/N/a) ' : ' (y/N) '))\n  echohl None\n  call inputrestore()\n  echo \"\\r\"\n  return (a:0 && answer =~? '^a') ? 2 : (answer =~? '^y') ? 1 : 0\nendfunction\n\nfunction! s:ask_no_interrupt(...)\n  try\n    return call('s:ask', a:000)\n  catch\n    return 0\n  endtry\nendfunction\n\nfunction! plug#end()\n  if !exists('g:plugs')\n    return s:err('Call plug#begin() first')\n  endif\n\n  if exists('#PlugLOD')\n    augroup PlugLOD\n      autocmd!\n    augroup END\n    augroup! PlugLOD\n  endif\n  let lod = { 'ft': {}, 'map': {}, 'cmd': {} }\n\n  filetype off\n  for name in g:plugs_order\n    if !has_key(g:plugs, name)\n      continue\n    endif\n    let plug = g:plugs[name]\n    if get(s:loaded, name, 0) || !has_key(plug, 'on') && !has_key(plug, 'for')\n      let s:loaded[name] = 1\n      continue\n    endif\n\n    if has_key(plug, 'on')\n      let s:triggers[name] = { 'map': [], 'cmd': [] }\n      for cmd in s:to_a(plug.on)\n        if cmd =~? '^<Plug>.\\+'\n          if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i'))\n            call s:assoc(lod.map, cmd, name)\n          endif\n          call add(s:triggers[name].map, cmd)\n        elseif cmd =~# '^[A-Z]'\n          if exists(':'.cmd) != 2\n            call s:assoc(lod.cmd, cmd, name)\n          endif\n          call add(s:triggers[name].cmd, cmd)\n        else\n          call s:err('Invalid `on` option: '.cmd.\n          \\ '. Should start with an uppercase letter or `<Plug>`.')\n        endif\n      endfor\n    endif\n\n    if has_key(plug, 'for')\n      let types = s:to_a(plug.for)\n      if !empty(types)\n        augroup filetypedetect\n        call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim')\n        augroup END\n      endif\n      for type in types\n        call s:assoc(lod.ft, type, name)\n      endfor\n    endif\n  endfor\n\n  for [cmd, names] in items(lod.cmd)\n    execute printf(\n    \\ 'command! -nargs=* -range -bang %s call s:lod_cmd(%s, \"<bang>\", <line1>, <line2>, <q-args>, %s)',\n    \\ cmd, string(cmd), string(names))\n  endfor\n\n  for [map, names] in items(lod.map)\n    for [mode, map_prefix, key_prefix] in\n          \\ [['i', '<C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]\n      execute printf(\n      \\ '%snoremap <silent> %s %s:<C-U>call <SID>lod_map(%s, %s, \"%s\")<CR>',\n      \\ mode, map, map_prefix, string(map), string(names), key_prefix)\n    endfor\n  endfor\n\n  for [ft, names] in items(lod.ft)\n    augroup PlugLOD\n      execute printf('autocmd FileType %s call <SID>lod_ft(%s, %s)',\n            \\ ft, string(ft), string(names))\n    augroup END\n  endfor\n\n  call s:reorg_rtp()\n  filetype plugin indent on\n  if has('vim_starting')\n    if has('syntax') && !exists('g:syntax_on')\n      syntax enable\n    end\n  else\n    call s:reload_plugins()\n  endif\nendfunction\n\nfunction! s:loaded_names()\n  return filter(copy(g:plugs_order), 'get(s:loaded, v:val, 0)')\nendfunction\n\nfunction! s:load_plugin(spec)\n  call s:source(s:rtp(a:spec), 'plugin/**/*.vim', 'after/plugin/**/*.vim')\nendfunction\n\nfunction! s:reload_plugins()\n  for name in s:loaded_names()\n    call s:load_plugin(g:plugs[name])\n  endfor\nendfunction\n\nfunction! s:trim(str)\n  return substitute(a:str, '[\\/]\\+$', '', '')\nendfunction\n\nfunction! s:version_requirement(val, min)\n  for idx in range(0, len(a:min) - 1)\n    let v = get(a:val, idx, 0)\n    if     v < a:min[idx] | return 0\n    elseif v > a:min[idx] | return 1\n    endif\n  endfor\n  return 1\nendfunction\n\nfunction! s:git_version_requirement(...)\n  if !exists('s:git_version')\n    let s:git_version = map(split(split(s:system('git --version'))[-1], '\\.'), 'str2nr(v:val)')\n  endif\n  return s:version_requirement(s:git_version, a:000)\nendfunction\n\nfunction! s:progress_opt(base)\n  return a:base && !s:is_win &&\n        \\ s:git_version_requirement(1, 7, 1) ? '--progress' : ''\nendfunction\n\nif s:is_win\n  function! s:rtp(spec)\n    return s:path(a:spec.dir . get(a:spec, 'rtp', ''))\n  endfunction\n\n  function! s:path(path)\n    return s:trim(substitute(a:path, '/', '\\', 'g'))\n  endfunction\n\n  function! s:dirpath(path)\n    return s:path(a:path) . '\\'\n  endfunction\n\n  function! s:is_local_plug(repo)\n    return a:repo =~? '^[a-z]:\\|^[%~]'\n  endfunction\nelse\n  function! s:rtp(spec)\n    return s:dirpath(a:spec.dir . get(a:spec, 'rtp', ''))\n  endfunction\n\n  function! s:path(path)\n    return s:trim(a:path)\n  endfunction\n\n  function! s:dirpath(path)\n    return substitute(a:path, '[/\\\\]*$', '/', '')\n  endfunction\n\n  function! s:is_local_plug(repo)\n    return a:repo[0] =~ '[/$~]'\n  endfunction\nendif\n\nfunction! s:err(msg)\n  echohl ErrorMsg\n  echom '[vim-plug] '.a:msg\n  echohl None\nendfunction\n\nfunction! s:warn(cmd, msg)\n  echohl WarningMsg\n  execute a:cmd 'a:msg'\n  echohl None\nendfunction\n\nfunction! s:esc(path)\n  return escape(a:path, ' ')\nendfunction\n\nfunction! s:escrtp(path)\n  return escape(a:path, ' ,')\nendfunction\n\nfunction! s:remove_rtp()\n  for name in s:loaded_names()\n    let rtp = s:rtp(g:plugs[name])\n    execute 'set rtp-='.s:escrtp(rtp)\n    let after = globpath(rtp, 'after')\n    if isdirectory(after)\n      execute 'set rtp-='.s:escrtp(after)\n    endif\n  endfor\nendfunction\n\nfunction! s:reorg_rtp()\n  if !empty(s:first_rtp)\n    execute 'set rtp-='.s:first_rtp\n    execute 'set rtp-='.s:last_rtp\n  endif\n\n  \" &rtp is modified from outside\n  if exists('s:prtp') && s:prtp !=# &rtp\n    call s:remove_rtp()\n    unlet! s:middle\n  endif\n\n  let s:middle = get(s:, 'middle', &rtp)\n  let rtps     = map(s:loaded_names(), 's:rtp(g:plugs[v:val])')\n  let afters   = filter(map(copy(rtps), 'globpath(v:val, \"after\")'), 'isdirectory(v:val)')\n  let rtp      = join(map(rtps, 'escape(v:val, \",\")'), ',')\n                 \\ . ','.s:middle.','\n                 \\ . join(map(afters, 'escape(v:val, \",\")'), ',')\n  let &rtp     = substitute(substitute(rtp, ',,*', ',', 'g'), '^,\\|,$', '', 'g')\n  let s:prtp   = &rtp\n\n  if !empty(s:first_rtp)\n    execute 'set rtp^='.s:first_rtp\n    execute 'set rtp+='.s:last_rtp\n  endif\nendfunction\n\nfunction! s:doautocmd(...)\n  if exists('#'.join(a:000, '#'))\n    execute 'doautocmd' ((v:version > 703 || has('patch442')) ? '<nomodeline>' : '') join(a:000)\n  endif\nendfunction\n\nfunction! s:dobufread(names)\n  for name in a:names\n    let path = s:rtp(g:plugs[name]).'/**'\n    for dir in ['ftdetect', 'ftplugin']\n      if len(finddir(dir, path))\n        return s:doautocmd('BufRead')\n      endif\n    endfor\n  endfor\nendfunction\n\nfunction! plug#load(...)\n  if a:0 == 0\n    return s:err('Argument missing: plugin name(s) required')\n  endif\n  if !exists('g:plugs')\n    return s:err('plug#begin was not called')\n  endif\n  let unknowns = filter(copy(a:000), '!has_key(g:plugs, v:val)')\n  if !empty(unknowns)\n    let s = len(unknowns) > 1 ? 's' : ''\n    return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', ')))\n  end\n  for name in a:000\n    call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])\n  endfor\n  call s:dobufread(a:000)\n  return 1\nendfunction\n\nfunction! s:remove_triggers(name)\n  if !has_key(s:triggers, a:name)\n    return\n  endif\n  for cmd in s:triggers[a:name].cmd\n    execute 'silent! delc' cmd\n  endfor\n  for map in s:triggers[a:name].map\n    execute 'silent! unmap' map\n    execute 'silent! iunmap' map\n  endfor\n  call remove(s:triggers, a:name)\nendfunction\n\nfunction! s:lod(names, types, ...)\n  for name in a:names\n    call s:remove_triggers(name)\n    let s:loaded[name] = 1\n  endfor\n  call s:reorg_rtp()\n\n  for name in a:names\n    let rtp = s:rtp(g:plugs[name])\n    for dir in a:types\n      call s:source(rtp, dir.'/**/*.vim')\n    endfor\n    if a:0\n      if !s:source(rtp, a:1) && !empty(s:glob(rtp, a:2))\n        execute 'runtime' a:1\n      endif\n      call s:source(rtp, a:2)\n    endif\n    call s:doautocmd('User', name)\n  endfor\nendfunction\n\nfunction! s:lod_ft(pat, names)\n  let syn = 'syntax/'.a:pat.'.vim'\n  call s:lod(a:names, ['plugin', 'after/plugin'], syn, 'after/'.syn)\n  execute 'autocmd! PlugLOD FileType' a:pat\n  call s:doautocmd('filetypeplugin', 'FileType')\n  call s:doautocmd('filetypeindent', 'FileType')\nendfunction\n\nfunction! s:lod_cmd(cmd, bang, l1, l2, args, names)\n  call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])\n  call s:dobufread(a:names)\n  execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)\nendfunction\n\nfunction! s:lod_map(map, names, prefix)\n  call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])\n  call s:dobufread(a:names)\n  let extra = ''\n  while 1\n    let c = getchar(0)\n    if c == 0\n      break\n    endif\n    let extra .= nr2char(c)\n  endwhile\n  if v:count\n    call feedkeys(v:count, 'n')\n  endif\n  call feedkeys('\"'.v:register, 'n')\n  if mode(1) == 'no'\n    call feedkeys(v:operator)\n  endif\n  call feedkeys(a:prefix . substitute(a:map, '^<Plug>', \"\\<Plug>\", '') . extra)\nendfunction\n\nfunction! plug#(repo, ...)\n  if a:0 > 1\n    return s:err('Invalid number of arguments (1..2)')\n  endif\n\n  try\n    let repo = s:trim(a:repo)\n    let opts = a:0 == 1 ? s:parse_options(a:1) : s:base_spec\n    let name = get(opts, 'as', fnamemodify(repo, ':t:s?\\.git$??'))\n    let spec = extend(s:infer_properties(name, repo), opts)\n    if !has_key(g:plugs, name)\n      call add(g:plugs_order, name)\n    endif\n    let g:plugs[name] = spec\n    let s:loaded[name] = get(s:loaded, name, 0)\n  catch\n    return s:err(v:exception)\n  endtry\nendfunction\n\nfunction! s:parse_options(arg)\n  let opts = copy(s:base_spec)\n  let type = type(a:arg)\n  if type == s:TYPE.string\n    let opts.tag = a:arg\n  elseif type == s:TYPE.dict\n    call extend(opts, a:arg)\n    if has_key(opts, 'dir')\n      let opts.dir = s:dirpath(expand(opts.dir))\n    endif\n  else\n    throw 'Invalid argument type (expected: string or dictionary)'\n  endif\n  return opts\nendfunction\n\nfunction! s:infer_properties(name, repo)\n  let repo = a:repo\n  if s:is_local_plug(repo)\n    return { 'dir': s:dirpath(expand(repo)) }\n  else\n    if repo =~ ':'\n      let uri = repo\n    else\n      if repo !~ '/'\n        let repo = 'vim-scripts/'. repo\n      endif\n      let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git')\n      let uri = printf(fmt, repo)\n    endif\n    let dir = s:dirpath( fnamemodify(join([g:plug_home, a:name], '/'), ':p') )\n    return { 'dir': dir, 'uri': uri }\n  endif\nendfunction\n\nfunction! s:install(force, names)\n  call s:update_impl(0, a:force, a:names)\nendfunction\n\nfunction! s:update(force, names)\n  call s:update_impl(1, a:force, a:names)\nendfunction\n\nfunction! plug#helptags()\n  if !exists('g:plugs')\n    return s:err('plug#begin was not called')\n  endif\n  for spec in values(g:plugs)\n    let docd = join([spec.dir, 'doc'], '/')\n    if isdirectory(docd)\n      silent! execute 'helptags' s:esc(docd)\n    endif\n  endfor\n  return 1\nendfunction\n\nfunction! s:syntax()\n  syntax clear\n  syntax region plug1 start=/\\%1l/ end=/\\%2l/ contains=plugNumber\n  syntax region plug2 start=/\\%2l/ end=/\\%3l/ contains=plugBracket,plugX\n  syn match plugNumber /[0-9]\\+[0-9.]*/ contained\n  syn match plugBracket /[[\\]]/ contained\n  syn match plugX /x/ contained\n  syn match plugDash /^-/\n  syn match plugPlus /^+/\n  syn match plugStar /^*/\n  syn match plugMessage /\\(^- \\)\\@<=.*/\n  syn match plugName /\\(^- \\)\\@<=[^ ]*:/\n  syn match plugSha /\\%(: \\)\\@<=[0-9a-f]\\{4,}$/\n  syn match plugTag /(tag: [^)]\\+)/\n  syn match plugInstall /\\(^+ \\)\\@<=[^:]*/\n  syn match plugUpdate /\\(^* \\)\\@<=[^:]*/\n  syn match plugCommit /^  \\X*[0-9a-f]\\{7} .*/ contains=plugRelDate,plugEdge,plugTag\n  syn match plugEdge /^  \\X\\+$/\n  syn match plugEdge /^  \\X*/ contained nextgroup=plugSha\n  syn match plugSha /[0-9a-f]\\{7}/ contained\n  syn match plugRelDate /([^)]*)$/ contained\n  syn match plugNotLoaded /(not loaded)$/\n  syn match plugError /^x.*/\n  syn region plugDeleted start=/^\\~ .*/ end=/^\\ze\\S/\n  syn match plugH2 /^.*:\\n-\\+$/\n  syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean\n  hi def link plug1       Title\n  hi def link plug2       Repeat\n  hi def link plugH2      Type\n  hi def link plugX       Exception\n  hi def link plugBracket Structure\n  hi def link plugNumber  Number\n\n  hi def link plugDash    Special\n  hi def link plugPlus    Constant\n  hi def link plugStar    Boolean\n\n  hi def link plugMessage Function\n  hi def link plugName    Label\n  hi def link plugInstall Function\n  hi def link plugUpdate  Type\n\n  hi def link plugError   Error\n  hi def link plugDeleted Ignore\n  hi def link plugRelDate Comment\n  hi def link plugEdge    PreProc\n  hi def link plugSha     Identifier\n  hi def link plugTag     Constant\n\n  hi def link plugNotLoaded Comment\nendfunction\n\nfunction! s:lpad(str, len)\n  return a:str . repeat(' ', a:len - len(a:str))\nendfunction\n\nfunction! s:lines(msg)\n  return split(a:msg, \"[\\r\\n]\")\nendfunction\n\nfunction! s:lastline(msg)\n  return get(s:lines(a:msg), -1, '')\nendfunction\n\nfunction! s:new_window()\n  execute get(g:, 'plug_window', 'vertical topleft new')\nendfunction\n\nfunction! s:plug_window_exists()\n  let buflist = tabpagebuflist(s:plug_tab)\n  return !empty(buflist) && index(buflist, s:plug_buf) >= 0\nendfunction\n\nfunction! s:switch_in()\n  if !s:plug_window_exists()\n    return 0\n  endif\n\n  if winbufnr(0) != s:plug_buf\n    let s:pos = [tabpagenr(), winnr(), winsaveview()]\n    execute 'normal!' s:plug_tab.'gt'\n    let winnr = bufwinnr(s:plug_buf)\n    execute winnr.'wincmd w'\n    call add(s:pos, winsaveview())\n  else\n    let s:pos = [winsaveview()]\n  endif\n\n  setlocal modifiable\n  return 1\nendfunction\n\nfunction! s:switch_out(...)\n  call winrestview(s:pos[-1])\n  setlocal nomodifiable\n  if a:0 > 0\n    execute a:1\n  endif\n\n  if len(s:pos) > 1\n    execute 'normal!' s:pos[0].'gt'\n    execute s:pos[1] 'wincmd w'\n    call winrestview(s:pos[2])\n  endif\nendfunction\n\nfunction! s:finish_bindings()\n  nnoremap <silent> <buffer> R  :call <SID>retry()<cr>\n  nnoremap <silent> <buffer> D  :PlugDiff<cr>\n  nnoremap <silent> <buffer> S  :PlugStatus<cr>\n  nnoremap <silent> <buffer> U  :call <SID>status_update()<cr>\n  xnoremap <silent> <buffer> U  :call <SID>status_update()<cr>\n  nnoremap <silent> <buffer> ]] :silent! call <SID>section('')<cr>\n  nnoremap <silent> <buffer> [[ :silent! call <SID>section('b')<cr>\nendfunction\n\nfunction! s:prepare(...)\n  if empty(getcwd())\n    throw 'Invalid current working directory. Cannot proceed.'\n  endif\n\n  for evar in ['$GIT_DIR', '$GIT_WORK_TREE']\n    if exists(evar)\n      throw evar.' detected. Cannot proceed.'\n    endif\n  endfor\n\n  call s:job_abort()\n  if s:switch_in()\n    normal q\n  endif\n\n  call s:new_window()\n  nnoremap <silent> <buffer> q  :if b:plug_preview==1<bar>pc<bar>endif<bar>bd<cr>\n  if a:0 == 0\n    call s:finish_bindings()\n  endif\n  let b:plug_preview = -1\n  let s:plug_tab = tabpagenr()\n  let s:plug_buf = winbufnr(0)\n  call s:assign_name()\n\n  for k in ['<cr>', 'L', 'o', 'X', 'd', 'dd']\n    execute 'silent! unmap <buffer>' k\n  endfor\n  setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap cursorline modifiable\n  setf vim-plug\n  if exists('g:syntax_on')\n    call s:syntax()\n  endif\nendfunction\n\nfunction! s:assign_name()\n  \" Assign buffer name\n  let prefix = '[Plugins]'\n  let name   = prefix\n  let idx    = 2\n  while bufexists(name)\n    let name = printf('%s (%s)', prefix, idx)\n    let idx = idx + 1\n  endwhile\n  silent! execute 'f' fnameescape(name)\nendfunction\n\nfunction! s:chsh(swap)\n  let prev = [&shell, &shellredir]\n  if !s:is_win && a:swap\n    set shell=sh shellredir=>%s\\ 2>&1\n  endif\n  return prev\nendfunction\n\nfunction! s:bang(cmd, ...)\n  try\n    let [sh, shrd] = s:chsh(a:0)\n    \" FIXME: Escaping is incomplete. We could use shellescape with eval,\n    \"        but it won't work on Windows.\n    let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd\n    let g:_plug_bang = '!'.escape(cmd, '#!%')\n    execute \"normal! :execute g:_plug_bang\\<cr>\\<cr>\"\n  finally\n    unlet g:_plug_bang\n    let [&shell, &shellredir] = [sh, shrd]\n  endtry\n  return v:shell_error ? 'Exit status: ' . v:shell_error : ''\nendfunction\n\nfunction! s:regress_bar()\n  let bar = substitute(getline(2)[1:-2], '.*\\zs=', 'x', '')\n  call s:progress_bar(2, bar, len(bar))\nendfunction\n\nfunction! s:is_updated(dir)\n  return !empty(s:system_chomp('git log --pretty=format:\"%h\" \"HEAD...HEAD@{1}\"', a:dir))\nendfunction\n\nfunction! s:do(pull, force, todo)\n  for [name, spec] in items(a:todo)\n    if !isdirectory(spec.dir)\n      continue\n    endif\n    let installed = has_key(s:update.new, name)\n    let updated = installed ? 0 :\n      \\ (a:pull && index(s:update.errors, name) < 0 && s:is_updated(spec.dir))\n    if a:force || installed || updated\n      execute 'cd' s:esc(spec.dir)\n      call append(3, '- Post-update hook for '. name .' ... ')\n      let error = ''\n      let type = type(spec.do)\n      if type == s:TYPE.string\n        if spec.do[0] == ':'\n          call s:load_plugin(spec)\n          execute spec.do[1:]\n        else\n          let error = s:bang(spec.do)\n        endif\n      elseif type == s:TYPE.funcref\n        try\n          let status = installed ? 'installed' : (updated ? 'updated' : 'unchanged')\n          call spec.do({ 'name': name, 'status': status, 'force': a:force })\n        catch\n          let error = v:exception\n        endtry\n      else\n        let error = 'Invalid hook type'\n      endif\n      call s:switch_in()\n      call setline(4, empty(error) ? (getline(4) . 'OK')\n                                 \\ : ('x' . getline(4)[1:] . error))\n      if !empty(error)\n        call add(s:update.errors, name)\n        call s:regress_bar()\n      endif\n      cd -\n    endif\n  endfor\nendfunction\n\nfunction! s:hash_match(a, b)\n  return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0\nendfunction\n\nfunction! s:checkout(spec)\n  let sha = a:spec.commit\n  let output = s:system('git rev-parse HEAD', a:spec.dir)\n  if !v:shell_error && !s:hash_match(sha, s:lines(output)[0])\n    let output = s:system(\n          \\ 'git fetch --depth 999999 && git checkout '.s:esc(sha), a:spec.dir)\n  endif\n  return output\nendfunction\n\nfunction! s:finish(pull)\n  let new_frozen = len(filter(keys(s:update.new), 'g:plugs[v:val].frozen'))\n  if new_frozen\n    let s = new_frozen > 1 ? 's' : ''\n    call append(3, printf('- Installed %d frozen plugin%s', new_frozen, s))\n  endif\n  call append(3, '- Finishing ... ') | 4\n  redraw\n  call plug#helptags()\n  call plug#end()\n  call setline(4, getline(4) . 'Done!')\n  redraw\n  let msgs = []\n  if !empty(s:update.errors)\n    call add(msgs, \"Press 'R' to retry.\")\n  endif\n  if a:pull && len(s:update.new) < len(filter(getline(5, '$'),\n                \\ \"v:val =~ '^- ' && stridx(v:val, 'Already up-to-date') < 0\"))\n    call add(msgs, \"Press 'D' to see the updated changes.\")\n  endif\n  echo join(msgs, ' ')\n  call s:finish_bindings()\nendfunction\n\nfunction! s:retry()\n  if empty(s:update.errors)\n    return\n  endif\n  echo\n  call s:update_impl(s:update.pull, s:update.force,\n        \\ extend(copy(s:update.errors), [s:update.threads]))\nendfunction\n\nfunction! s:is_managed(name)\n  return has_key(g:plugs[a:name], 'uri')\nendfunction\n\nfunction! s:names(...)\n  return sort(filter(keys(g:plugs), 'stridx(v:val, a:1) == 0 && s:is_managed(v:val)'))\nendfunction\n\nfunction! s:check_ruby()\n  silent! ruby require 'thread'; VIM::command(\"let g:plug_ruby = '#{RUBY_VERSION}'\")\n  if !exists('g:plug_ruby')\n    redraw!\n    return s:warn('echom', 'Warning: Ruby interface is broken')\n  endif\n  let ruby_version = split(g:plug_ruby, '\\.')\n  unlet g:plug_ruby\n  return s:version_requirement(ruby_version, [1, 8, 7])\nendfunction\n\nfunction! s:update_impl(pull, force, args) abort\n  let args = copy(a:args)\n  let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ?\n                  \\ remove(args, -1) : get(g:, 'plug_threads', 16)\n\n  let managed = filter(copy(g:plugs), 's:is_managed(v:key)')\n  let todo = empty(args) ? filter(managed, '!v:val.frozen || !isdirectory(v:val.dir)') :\n                         \\ filter(managed, 'index(args, v:key) >= 0')\n\n  if empty(todo)\n    return s:warn('echo', 'No plugin to '. (a:pull ? 'update' : 'install'))\n  endif\n\n  if !s:is_win && s:git_version_requirement(2, 3)\n    let s:git_terminal_prompt = exists('$GIT_TERMINAL_PROMPT') ? $GIT_TERMINAL_PROMPT : ''\n    let $GIT_TERMINAL_PROMPT = 0\n    for plug in values(todo)\n      let plug.uri = substitute(plug.uri,\n            \\ '^https://git::@github\\.com', 'https://github.com', '')\n    endfor\n  endif\n\n  if !isdirectory(g:plug_home)\n    try\n      call mkdir(g:plug_home, 'p')\n    catch\n      return s:err(printf('Invalid plug directory: %s. '.\n              \\ 'Try to call plug#begin with a valid directory', g:plug_home))\n    endtry\n  endif\n\n  if has('nvim') && !exists('*jobwait') && threads > 1\n    call s:warn('echom', '[vim-plug] Update Neovim for parallel installer')\n  endif\n\n  let python = (has('python') || has('python3')) && (!s:nvim || has('vim_starting'))\n  let ruby = has('ruby') && !s:nvim && (v:version >= 703 || v:version == 702 && has('patch374')) && !(s:is_win && has('gui_running')) && s:check_ruby()\n\n  let s:update = {\n    \\ 'start':   reltime(),\n    \\ 'all':     todo,\n    \\ 'todo':    copy(todo),\n    \\ 'errors':  [],\n    \\ 'pull':    a:pull,\n    \\ 'force':   a:force,\n    \\ 'new':     {},\n    \\ 'threads': (python || ruby || s:nvim) ? min([len(todo), threads]) : 1,\n    \\ 'bar':     '',\n    \\ 'fin':     0\n  \\ }\n\n  call s:prepare(1)\n  call append(0, ['', ''])\n  normal! 2G\n  silent! redraw\n\n  let s:clone_opt = get(g:, 'plug_shallow', 1) ?\n        \\ '--depth 1' . (s:git_version_requirement(1, 7, 10) ? ' --no-single-branch' : '') : ''\n\n  \" Python version requirement (>= 2.7)\n  if python && !has('python3') && !ruby && !s:nvim && s:update.threads > 1\n    redir => pyv\n    silent python import platform; print platform.python_version()\n    redir END\n    let python = s:version_requirement(\n          \\ map(split(split(pyv)[0], '\\.'), 'str2nr(v:val)'), [2, 6])\n  endif\n\n  if (python || ruby) && s:update.threads > 1\n    try\n      let imd = &imd\n      if s:mac_gui\n        set noimd\n      endif\n      if ruby\n        call s:update_ruby()\n      else\n        call s:update_python()\n      endif\n    catch\n      let lines = getline(4, '$')\n      let printed = {}\n      silent! 4,$d _\n      for line in lines\n        let name = s:extract_name(line, '.', '')\n        if empty(name) || !has_key(printed, name)\n          call append('$', line)\n          if !empty(name)\n            let printed[name] = 1\n            if line[0] == 'x' && index(s:update.errors, name) < 0\n              call add(s:update.errors, name)\n            end\n          endif\n        endif\n      endfor\n    finally\n      let &imd = imd\n      call s:update_finish()\n    endtry\n  else\n    call s:update_vim()\n  endif\nendfunction\n\nfunction! s:log4(name, msg)\n  call setline(4, printf('- %s (%s)', a:msg, a:name))\n  redraw\nendfunction\n\nfunction! s:update_finish()\n  if exists('s:git_terminal_prompt')\n    let $GIT_TERMINAL_PROMPT = s:git_terminal_prompt\n  endif\n  if s:switch_in()\n    call append(3, '- Updating ...') | 4\n    for [name, spec] in items(filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && (s:update.force || s:update.pull || has_key(s:update.new, v:key))'))\n      let pos = s:logpos(name)\n      if !pos\n        continue\n      endif\n      if has_key(spec, 'commit')\n        call s:log4(name, 'Checking out '.spec.commit)\n        let out = s:checkout(spec)\n      elseif has_key(spec, 'tag')\n        let tag = spec.tag\n        if tag =~ '\\*'\n          let tags = s:lines(s:system('git tag --list '.string(tag).' --sort -version:refname 2>&1', spec.dir))\n          if !v:shell_error && !empty(tags)\n            let tag = tags[0]\n            call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag))\n            call append(3, '')\n          endif\n        endif\n        call s:log4(name, 'Checking out '.tag)\n        let out = s:system('git checkout -q '.s:esc(tag).' 2>&1', spec.dir)\n      else\n        let branch = s:esc(get(spec, 'branch', 'master'))\n        call s:log4(name, 'Merging origin/'.branch)\n        let out = s:system('git checkout -q '.branch.' 2>&1'\n              \\. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only origin/'.branch.' 2>&1')), spec.dir)\n      endif\n      if !v:shell_error && filereadable(spec.dir.'/.gitmodules') &&\n            \\ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir))\n        call s:log4(name, 'Updating submodules. This may take a while.')\n        let out .= s:bang('git submodule update --init --recursive 2>&1', spec.dir)\n      endif\n      let msg = printf('%s %s: %s', v:shell_error ? 'x': '-', name, s:lastline(out))\n      if v:shell_error\n        call add(s:update.errors, name)\n        call s:regress_bar()\n        silent execute pos 'd _'\n        call append(4, msg) | 4\n      elseif !empty(out)\n        call setline(pos, msg)\n      endif\n      redraw\n    endfor\n    silent 4 d _\n    call s:do(s:update.pull, s:update.force, filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && has_key(v:val, \"do\")'))\n    call s:finish(s:update.pull)\n    call setline(1, 'Updated. Elapsed time: ' . split(reltimestr(reltime(s:update.start)))[0] . ' sec.')\n    call s:switch_out('normal! gg')\n  endif\nendfunction\n\nfunction! s:job_abort()\n  if !s:nvim || !exists('s:jobs')\n    return\n  endif\n\n  for [name, j] in items(s:jobs)\n    silent! call jobstop(j.jobid)\n    if j.new\n      call s:system('rm -rf ' . s:shellesc(g:plugs[name].dir))\n    endif\n  endfor\n  let s:jobs = {}\nendfunction\n\n\" When a:event == 'stdout', data = list of strings\n\" When a:event == 'exit', data = returncode\nfunction! s:job_handler(job_id, data, event) abort\n  if !s:plug_window_exists() \" plug window closed\n    return s:job_abort()\n  endif\n\n  if a:event == 'stdout'\n    let complete = empty(a:data[-1])\n    let lines = map(filter(a:data, 'len(v:val) > 0'), 'split(v:val, \"[\\r\\n]\")[-1]')\n    call extend(self.lines, lines)\n    let self.result = join(self.lines, \"\\n\")\n    if !complete\n      call remove(self.lines, -1)\n    endif\n    \" To reduce the number of buffer updates\n    let self.tick = get(self, 'tick', -1) + 1\n    if self.tick % len(s:jobs) == 0\n      call s:log(self.new ? '+' : '*', self.name, self.result)\n    endif\n  elseif a:event == 'exit'\n    let self.running = 0\n    if a:data != 0\n      let self.error = 1\n    endif\n    call s:reap(self.name)\n    call s:tick()\n  endif\nendfunction\n\nfunction! s:spawn(name, cmd, opts)\n  let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [], 'result': '',\n            \\ 'new': get(a:opts, 'new', 0),\n            \\ 'on_stdout': function('s:job_handler'),\n            \\ 'on_exit' : function('s:job_handler'),\n            \\ }\n  let s:jobs[a:name] = job\n\n  if s:nvim\n    let argv = [ 'sh', '-c',\n               \\ (has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd) ]\n    let jid = jobstart(argv, job)\n    if jid > 0\n      let job.jobid = jid\n    else\n      let job.running = 0\n      let job.error   = 1\n      let job.result  = jid < 0 ? 'sh is not executable' :\n            \\ 'Invalid arguments (or job table is full)'\n    endif\n  else\n    let params = has_key(a:opts, 'dir') ? [a:cmd, a:opts.dir] : [a:cmd]\n    let job.result = call('s:system', params)\n    let job.error = v:shell_error != 0\n    let job.running = 0\n  endif\nendfunction\n\nfunction! s:reap(name)\n  let job = s:jobs[a:name]\n  if job.error\n    call add(s:update.errors, a:name)\n  elseif get(job, 'new', 0)\n    let s:update.new[a:name] = 1\n  endif\n  let s:update.bar .= job.error ? 'x' : '='\n\n  call s:log(job.error ? 'x' : '-', a:name, empty(job.result) ? 'OK' : job.result)\n  call s:bar()\n\n  call remove(s:jobs, a:name)\nendfunction\n\nfunction! s:bar()\n  if s:switch_in()\n    let total = len(s:update.all)\n    call setline(1, (s:update.pull ? 'Updating' : 'Installing').\n          \\ ' plugins ('.len(s:update.bar).'/'.total.')')\n    call s:progress_bar(2, s:update.bar, total)\n    call s:switch_out()\n  endif\nendfunction\n\nfunction! s:logpos(name)\n  for i in range(4, line('$'))\n    if getline(i) =~# '^[-+x*] '.a:name.':'\n      return i\n    endif\n  endfor\nendfunction\n\nfunction! s:log(bullet, name, lines)\n  if s:switch_in()\n    let pos = s:logpos(a:name)\n    if pos > 0\n      silent execute pos 'd _'\n      if pos > winheight('.')\n        let pos = 4\n      endif\n    else\n      let pos = 4\n    endif\n    call append(pos - 1, s:format_message(a:bullet, a:name, a:lines))\n    call s:switch_out()\n  endif\nendfunction\n\nfunction! s:update_vim()\n  let s:jobs = {}\n\n  call s:bar()\n  call s:tick()\nendfunction\n\nfunction! s:tick()\n  let pull = s:update.pull\n  let prog = s:progress_opt(s:nvim)\nwhile 1 \" Without TCO, Vim stack is bound to explode\n  if empty(s:update.todo)\n    if empty(s:jobs) && !s:update.fin\n      let s:update.fin = 1\n      call s:update_finish()\n    endif\n    return\n  endif\n\n  let name = keys(s:update.todo)[0]\n  let spec = remove(s:update.todo, name)\n  let new  = !isdirectory(spec.dir)\n\n  call s:log(new ? '+' : '*', name, pull ? 'Updating ...' : 'Installing ...')\n  redraw\n\n  let has_tag = has_key(spec, 'tag')\n  if !new\n    let [error, _] = s:git_validate(spec, 0)\n    if empty(error)\n      if pull\n        let fetch_opt = (has_tag && !empty(globpath(spec.dir, '.git/shallow'))) ? '--depth 99999999' : ''\n        call s:spawn(name, printf('git fetch %s %s 2>&1', fetch_opt, prog), { 'dir': spec.dir })\n      else\n        let s:jobs[name] = { 'running': 0, 'result': 'Already installed', 'error': 0 }\n      endif\n    else\n      let s:jobs[name] = { 'running': 0, 'result': error, 'error': 1 }\n    endif\n  else\n    call s:spawn(name,\n          \\ printf('git clone %s %s %s %s 2>&1',\n          \\ has_tag ? '' : s:clone_opt,\n          \\ prog,\n          \\ s:shellesc(spec.uri),\n          \\ s:shellesc(s:trim(spec.dir))), { 'new': 1 })\n  endif\n\n  if !s:jobs[name].running\n    call s:reap(name)\n  endif\n  if len(s:jobs) >= s:update.threads\n    break\n  endif\nendwhile\nendfunction\n\nfunction! s:update_python()\nlet py_exe = has('python') ? 'python' : 'python3'\nexecute py_exe \"<< EOF\"\nimport datetime\nimport functools\nimport os\ntry:\n  import queue\nexcept ImportError:\n  import Queue as queue\nimport random\nimport re\nimport shutil\nimport signal\nimport subprocess\nimport tempfile\nimport threading as thr\nimport time\nimport traceback\nimport vim\n\nG_NVIM = vim.eval(\"has('nvim')\") == '1'\nG_PULL = vim.eval('s:update.pull') == '1'\nG_RETRIES = int(vim.eval('get(g:, \"plug_retries\", 2)')) + 1\nG_TIMEOUT = int(vim.eval('get(g:, \"plug_timeout\", 60)'))\nG_CLONE_OPT = vim.eval('s:clone_opt')\nG_PROGRESS = vim.eval('s:progress_opt(1)')\nG_LOG_PROB = 1.0 / int(vim.eval('s:update.threads'))\nG_STOP = thr.Event()\nG_IS_WIN = vim.eval('s:is_win') == '1'\n\nclass PlugError(Exception):\n  def __init__(self, msg):\n    self.msg = msg\nclass CmdTimedOut(PlugError):\n  pass\nclass CmdFailed(PlugError):\n  pass\nclass InvalidURI(PlugError):\n  pass\nclass Action(object):\n  INSTALL, UPDATE, ERROR, DONE = ['+', '*', 'x', '-']\n\nclass Buffer(object):\n  def __init__(self, lock, num_plugs, is_pull):\n    self.bar = ''\n    self.event = 'Updating' if is_pull else 'Installing'\n    self.lock = lock\n    self.maxy = int(vim.eval('winheight(\".\")'))\n    self.num_plugs = num_plugs\n\n  def __where(self, name):\n    \"\"\" Find first line with name in current buffer. Return line num. \"\"\"\n    found, lnum = False, 0\n    matcher = re.compile('^[-+x*] {0}:'.format(name))\n    for line in vim.current.buffer:\n      if matcher.search(line) is not None:\n        found = True\n        break\n      lnum += 1\n\n    if not found:\n      lnum = -1\n    return lnum\n\n  def header(self):\n    curbuf = vim.current.buffer\n    curbuf[0] = self.event + ' plugins ({0}/{1})'.format(len(self.bar), self.num_plugs)\n\n    num_spaces = self.num_plugs - len(self.bar)\n    curbuf[1] = '[{0}{1}]'.format(self.bar, num_spaces * ' ')\n\n    with self.lock:\n      vim.command('normal! 2G')\n      vim.command('redraw')\n\n  def write(self, action, name, lines):\n    first, rest = lines[0], lines[1:]\n    msg = ['{0} {1}{2}{3}'.format(action, name, ': ' if first else '', first)]\n    msg.extend(['    ' + line for line in rest])\n\n    try:\n      if action == Action.ERROR:\n        self.bar += 'x'\n        vim.command(\"call add(s:update.errors, '{0}')\".format(name))\n      elif action == Action.DONE:\n        self.bar += '='\n\n      curbuf = vim.current.buffer\n      lnum = self.__where(name)\n      if lnum != -1: # Found matching line num\n        del curbuf[lnum]\n        if lnum > self.maxy and action in set([Action.INSTALL, Action.UPDATE]):\n          lnum = 3\n      else:\n        lnum = 3\n      curbuf.append(msg, lnum)\n\n      self.header()\n    except vim.error:\n      pass\n\nclass Command(object):\n  CD = 'cd /d' if G_IS_WIN else 'cd'\n\n  def __init__(self, cmd, cmd_dir=None, timeout=60, cb=None, clean=None):\n    self.cmd = cmd\n    if cmd_dir:\n      self.cmd = '{0} {1} && {2}'.format(Command.CD, cmd_dir, self.cmd)\n    self.timeout = timeout\n    self.callback = cb if cb else (lambda msg: None)\n    self.clean = clean if clean else (lambda: None)\n    self.proc = None\n\n  @property\n  def alive(self):\n    \"\"\" Returns true only if command still running. \"\"\"\n    return self.proc and self.proc.poll() is None\n\n  def execute(self, ntries=3):\n    \"\"\" Execute the command with ntries if CmdTimedOut.\n        Returns the output of the command if no Exception.\n    \"\"\"\n    attempt, finished, limit = 0, False, self.timeout\n\n    while not finished:\n      try:\n        attempt += 1\n        result = self.try_command()\n        finished = True\n        return result\n      except CmdTimedOut:\n        if attempt != ntries:\n          self.notify_retry()\n          self.timeout += limit\n        else:\n          raise\n\n  def notify_retry(self):\n    \"\"\" Retry required for command, notify user. \"\"\"\n    for count in range(3, 0, -1):\n      if G_STOP.is_set():\n        raise KeyboardInterrupt\n      msg = 'Timeout. Will retry in {0} second{1} ...'.format(\n            count, 's' if count != 1 else '')\n      self.callback([msg])\n      time.sleep(1)\n    self.callback(['Retrying ...'])\n\n  def try_command(self):\n    \"\"\" Execute a cmd & poll for callback. Returns list of output.\n        Raises CmdFailed   -> return code for Popen isn't 0\n        Raises CmdTimedOut -> command exceeded timeout without new output\n    \"\"\"\n    first_line = True\n\n    try:\n      tfile = tempfile.NamedTemporaryFile(mode='w+b')\n      preexec_fn = not G_IS_WIN and os.setsid or None\n      self.proc = subprocess.Popen(self.cmd, stdout=tfile,\n                                   stderr=subprocess.STDOUT,\n                                   stdin=subprocess.PIPE, shell=True,\n                                   preexec_fn=preexec_fn)\n      thrd = thr.Thread(target=(lambda proc: proc.wait()), args=(self.proc,))\n      thrd.start()\n\n      thread_not_started = True\n      while thread_not_started:\n        try:\n          thrd.join(0.1)\n          thread_not_started = False\n        except RuntimeError:\n          pass\n\n      while self.alive:\n        if G_STOP.is_set():\n          raise KeyboardInterrupt\n\n        if first_line or random.random() < G_LOG_PROB:\n          first_line = False\n          line = '' if G_IS_WIN else nonblock_read(tfile.name)\n          if line:\n            self.callback([line])\n\n        time_diff = time.time() - os.path.getmtime(tfile.name)\n        if time_diff > self.timeout:\n          raise CmdTimedOut(['Timeout!'])\n\n        thrd.join(0.5)\n\n      tfile.seek(0)\n      result = [line.decode('utf-8', 'replace').rstrip() for line in tfile]\n\n      if self.proc.returncode != 0:\n        raise CmdFailed([''] + result)\n\n      return result\n    except:\n      self.terminate()\n      raise\n\n  def terminate(self):\n    \"\"\" Terminate process and cleanup. \"\"\"\n    if self.alive:\n      if G_IS_WIN:\n        os.kill(self.proc.pid, signal.SIGINT)\n      else:\n        os.killpg(self.proc.pid, signal.SIGTERM)\n    self.clean()\n\nclass Plugin(object):\n  def __init__(self, name, args, buf_q, lock):\n    self.name = name\n    self.args = args\n    self.buf_q = buf_q\n    self.lock = lock\n    self.tag = args.get('tag', 0)\n\n  def manage(self):\n    try:\n      if os.path.exists(self.args['dir']):\n        self.update()\n      else:\n        self.install()\n        with self.lock:\n          thread_vim_command(\"let s:update.new['{0}'] = 1\".format(self.name))\n    except PlugError as exc:\n      self.write(Action.ERROR, self.name, exc.msg)\n    except KeyboardInterrupt:\n      G_STOP.set()\n      self.write(Action.ERROR, self.name, ['Interrupted!'])\n    except:\n      # Any exception except those above print stack trace\n      msg = 'Trace:\\n{0}'.format(traceback.format_exc().rstrip())\n      self.write(Action.ERROR, self.name, msg.split('\\n'))\n      raise\n\n  def install(self):\n    target = self.args['dir']\n    if target[-1] == '\\\\':\n      target = target[0:-1]\n\n    def clean(target):\n      def _clean():\n        try:\n          shutil.rmtree(target)\n        except OSError:\n          pass\n      return _clean\n\n    self.write(Action.INSTALL, self.name, ['Installing ...'])\n    callback = functools.partial(self.write, Action.INSTALL, self.name)\n    cmd = 'git clone {0} {1} {2} {3} 2>&1'.format(\n          '' if self.tag else G_CLONE_OPT, G_PROGRESS, self.args['uri'],\n          esc(target))\n    com = Command(cmd, None, G_TIMEOUT, callback, clean(target))\n    result = com.execute(G_RETRIES)\n    self.write(Action.DONE, self.name, result[-1:])\n\n  def repo_uri(self):\n    cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url'\n    command = Command(cmd, self.args['dir'], G_TIMEOUT,)\n    result = command.execute(G_RETRIES)\n    return result[-1]\n\n  def update(self):\n    match = re.compile(r'git::?@')\n    actual_uri = re.sub(match, '', self.repo_uri())\n    expect_uri = re.sub(match, '', self.args['uri'])\n    if actual_uri != expect_uri:\n      msg = ['',\n             'Invalid URI: {0}'.format(actual_uri),\n             'Expected     {0}'.format(expect_uri),\n             'PlugClean required.']\n      raise InvalidURI(msg)\n\n    if G_PULL:\n      self.write(Action.UPDATE, self.name, ['Updating ...'])\n      callback = functools.partial(self.write, Action.UPDATE, self.name)\n      fetch_opt = '--depth 99999999' if self.tag and os.path.isfile(os.path.join(self.args['dir'], '.git/shallow')) else ''\n      cmd = 'git fetch {0} {1} 2>&1'.format(fetch_opt, G_PROGRESS)\n      com = Command(cmd, self.args['dir'], G_TIMEOUT, callback)\n      result = com.execute(G_RETRIES)\n      self.write(Action.DONE, self.name, result[-1:])\n    else:\n      self.write(Action.DONE, self.name, ['Already installed'])\n\n  def write(self, action, name, msg):\n    self.buf_q.put((action, name, msg))\n\nclass PlugThread(thr.Thread):\n  def __init__(self, tname, args):\n    super(PlugThread, self).__init__()\n    self.tname = tname\n    self.args = args\n\n  def run(self):\n    thr.current_thread().name = self.tname\n    buf_q, work_q, lock = self.args\n\n    try:\n      while not G_STOP.is_set():\n        name, args = work_q.get_nowait()\n        plug = Plugin(name, args, buf_q, lock)\n        plug.manage()\n        work_q.task_done()\n    except queue.Empty:\n      pass\n\nclass RefreshThread(thr.Thread):\n  def __init__(self, lock):\n    super(RefreshThread, self).__init__()\n    self.lock = lock\n    self.running = True\n\n  def run(self):\n    while self.running:\n      with self.lock:\n        thread_vim_command('noautocmd normal! a')\n      time.sleep(0.33)\n\n  def stop(self):\n    self.running = False\n\nif G_NVIM:\n  def thread_vim_command(cmd):\n    vim.session.threadsafe_call(lambda: vim.command(cmd))\nelse:\n  def thread_vim_command(cmd):\n    vim.command(cmd)\n\ndef esc(name):\n  return '\"' + name.replace('\"', '\\\"') + '\"'\n\ndef nonblock_read(fname):\n  \"\"\" Read a file with nonblock flag. Return the last line. \"\"\"\n  fread = os.open(fname, os.O_RDONLY | os.O_NONBLOCK)\n  buf = os.read(fread, 100000).decode('utf-8', 'replace')\n  os.close(fread)\n\n  line = buf.rstrip('\\r\\n')\n  left = max(line.rfind('\\r'), line.rfind('\\n'))\n  if left != -1:\n    left += 1\n    line = line[left:]\n\n  return line\n\ndef main():\n  thr.current_thread().name = 'main'\n  nthreads = int(vim.eval('s:update.threads'))\n  plugs = vim.eval('s:update.todo')\n  mac_gui = vim.eval('s:mac_gui') == '1'\n\n  lock = thr.Lock()\n  buf = Buffer(lock, len(plugs), G_PULL)\n  buf_q, work_q = queue.Queue(), queue.Queue()\n  for work in plugs.items():\n    work_q.put(work)\n\n  start_cnt = thr.active_count()\n  for num in range(nthreads):\n    tname = 'PlugT-{0:02}'.format(num)\n    thread = PlugThread(tname, (buf_q, work_q, lock))\n    thread.start()\n  if mac_gui:\n    rthread = RefreshThread(lock)\n    rthread.start()\n\n  while not buf_q.empty() or thr.active_count() != start_cnt:\n    try:\n      action, name, msg = buf_q.get(True, 0.25)\n      buf.write(action, name, ['OK'] if not msg else msg)\n      buf_q.task_done()\n    except queue.Empty:\n      pass\n    except KeyboardInterrupt:\n      G_STOP.set()\n\n  if mac_gui:\n    rthread.stop()\n    rthread.join()\n\nmain()\nEOF\nendfunction\n\nfunction! s:update_ruby()\n  ruby << EOF\n  module PlugStream\n    SEP = [\"\\r\", \"\\n\", nil]\n    def get_line\n      buffer = ''\n      loop do\n        char = readchar rescue return\n        if SEP.include? char.chr\n          buffer << $/\n          break\n        else\n          buffer << char\n        end\n      end\n      buffer\n    end\n  end unless defined?(PlugStream)\n\n  def esc arg\n    %[\"#{arg.gsub('\"', '\\\"')}\"]\n  end\n\n  def killall pid\n    pids = [pid]\n    if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM\n      pids.each { |pid| Process.kill 'INT', pid.to_i rescue nil }\n    else\n      unless `which pgrep 2> /dev/null`.empty?\n        children = pids\n        until children.empty?\n          children = children.map { |pid|\n            `pgrep -P #{pid}`.lines.map { |l| l.chomp }\n          }.flatten\n          pids += children\n        end\n      end\n      pids.each { |pid| Process.kill 'TERM', pid.to_i rescue nil }\n    end\n  end\n\n  require 'thread'\n  require 'fileutils'\n  require 'timeout'\n  running = true\n  iswin = VIM::evaluate('s:is_win').to_i == 1\n  pull  = VIM::evaluate('s:update.pull').to_i == 1\n  base  = VIM::evaluate('g:plug_home')\n  all   = VIM::evaluate('s:update.todo')\n  limit = VIM::evaluate('get(g:, \"plug_timeout\", 60)')\n  tries = VIM::evaluate('get(g:, \"plug_retries\", 2)') + 1\n  nthr  = VIM::evaluate('s:update.threads').to_i\n  maxy  = VIM::evaluate('winheight(\".\")').to_i\n  cd    = iswin ? 'cd /d' : 'cd'\n  tot   = VIM::evaluate('len(s:update.todo)') || 0\n  bar   = ''\n  skip  = 'Already installed'\n  mtx   = Mutex.new\n  take1 = proc { mtx.synchronize { running && all.shift } }\n  logh  = proc {\n    cnt = bar.length\n    $curbuf[1] = \"#{pull ? 'Updating' : 'Installing'} plugins (#{cnt}/#{tot})\"\n    $curbuf[2] = '[' + bar.ljust(tot) + ']'\n    VIM::command('normal! 2G')\n    VIM::command('redraw')\n  }\n  where = proc { |name| (1..($curbuf.length)).find { |l| $curbuf[l] =~ /^[-+x*] #{name}:/ } }\n  log   = proc { |name, result, type|\n    mtx.synchronize do\n      ing  = ![true, false].include?(type)\n      bar += type ? '=' : 'x' unless ing\n      b = case type\n          when :install  then '+' when :update then '*'\n          when true, nil then '-' else\n            VIM::command(\"call add(s:update.errors, '#{name}')\")\n            'x'\n          end\n      result =\n        if type || type.nil?\n          [\"#{b} #{name}: #{result.lines.to_a.last || 'OK'}\"]\n        elsif result =~ /^Interrupted|^Timeout/\n          [\"#{b} #{name}: #{result}\"]\n        else\n          [\"#{b} #{name}\"] + result.lines.map { |l| \"    \" << l }\n        end\n      if lnum = where.call(name)\n        $curbuf.delete lnum\n        lnum = 4 if ing && lnum > maxy\n      end\n      result.each_with_index do |line, offset|\n        $curbuf.append((lnum || 4) - 1 + offset, line.gsub(/\\e\\[./, '').chomp)\n      end\n      logh.call\n    end\n  }\n  bt = proc { |cmd, name, type, cleanup|\n    tried = timeout = 0\n    begin\n      tried += 1\n      timeout += limit\n      fd = nil\n      data = ''\n      if iswin\n        Timeout::timeout(timeout) do\n          tmp = VIM::evaluate('tempname()')\n          system(\"(#{cmd}) > #{tmp}\")\n          data = File.read(tmp).chomp\n          File.unlink tmp rescue nil\n        end\n      else\n        fd = IO.popen(cmd).extend(PlugStream)\n        first_line = true\n        log_prob = 1.0 / nthr\n        while line = Timeout::timeout(timeout) { fd.get_line }\n          data << line\n          log.call name, line.chomp, type if name && (first_line || rand < log_prob)\n          first_line = false\n        end\n        fd.close\n      end\n      [$? == 0, data.chomp]\n    rescue Timeout::Error, Interrupt => e\n      if fd && !fd.closed?\n        killall fd.pid\n        fd.close\n      end\n      cleanup.call if cleanup\n      if e.is_a?(Timeout::Error) && tried < tries\n        3.downto(1) do |countdown|\n          s = countdown > 1 ? 's' : ''\n          log.call name, \"Timeout. Will retry in #{countdown} second#{s} ...\", type\n          sleep 1\n        end\n        log.call name, 'Retrying ...', type\n        retry\n      end\n      [false, e.is_a?(Interrupt) ? \"Interrupted!\" : \"Timeout!\"]\n    end\n  }\n  main = Thread.current\n  threads = []\n  watcher = Thread.new {\n    while VIM::evaluate('getchar(1)')\n      sleep 0.1\n    end\n    mtx.synchronize do\n      running = false\n      threads.each { |t| t.raise Interrupt }\n    end\n    threads.each { |t| t.join rescue nil }\n    main.kill\n  }\n  refresh = Thread.new {\n    while true\n      mtx.synchronize do\n        break unless running\n        VIM::command('noautocmd normal! a')\n      end\n      sleep 0.2\n    end\n  } if VIM::evaluate('s:mac_gui') == 1\n\n  clone_opt = VIM::evaluate('s:clone_opt')\n  progress = VIM::evaluate('s:progress_opt(1)')\n  nthr.times do\n    mtx.synchronize do\n      threads << Thread.new {\n        while pair = take1.call\n          name = pair.first\n          dir, uri, tag = pair.last.values_at *%w[dir uri tag]\n          exists = File.directory? dir\n          ok, result =\n            if exists\n              chdir = \"#{cd} #{iswin ? dir : esc(dir)}\"\n              ret, data = bt.call \"#{chdir} && git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url\", nil, nil, nil\n              current_uri = data.lines.to_a.last\n              if !ret\n                if data =~ /^Interrupted|^Timeout/\n                  [false, data]\n                else\n                  [false, [data.chomp, \"PlugClean required.\"].join($/)]\n                end\n              elsif current_uri.sub(/git::?@/, '') != uri.sub(/git::?@/, '')\n                [false, [\"Invalid URI: #{current_uri}\",\n                         \"Expected:    #{uri}\",\n                         \"PlugClean required.\"].join($/)]\n              else\n                if pull\n                  log.call name, 'Updating ...', :update\n                  fetch_opt = (tag && File.exist?(File.join(dir, '.git/shallow'))) ? '--depth 99999999' : ''\n                  bt.call \"#{chdir} && git fetch #{fetch_opt} #{progress} 2>&1\", name, :update, nil\n                else\n                  [true, skip]\n                end\n              end\n            else\n              d = esc dir.sub(%r{[\\\\/]+$}, '')\n              log.call name, 'Installing ...', :install\n              bt.call \"git clone #{clone_opt unless tag} #{progress} #{uri} #{d} 2>&1\", name, :install, proc {\n                FileUtils.rm_rf dir\n              }\n            end\n          mtx.synchronize { VIM::command(\"let s:update.new['#{name}'] = 1\") } if !exists && ok\n          log.call name, result, ok\n        end\n      } if running\n    end\n  end\n  threads.each { |t| t.join rescue nil }\n  logh.call\n  refresh.kill if refresh\n  watcher.kill\nEOF\nendfunction\n\nfunction! s:shellesc(arg)\n  return '\"'.escape(a:arg, '\"').'\"'\nendfunction\n\nfunction! s:glob_dir(path)\n  return map(filter(s:glob(a:path, '**'), 'isdirectory(v:val)'), 's:dirpath(v:val)')\nendfunction\n\nfunction! s:progress_bar(line, bar, total)\n  call setline(a:line, '[' . s:lpad(a:bar, a:total) . ']')\nendfunction\n\nfunction! s:compare_git_uri(a, b)\n  let a = substitute(a:a, 'git:\\{1,2}@', '', '')\n  let b = substitute(a:b, 'git:\\{1,2}@', '', '')\n  return a ==# b\nendfunction\n\nfunction! s:format_message(bullet, name, message)\n  if a:bullet != 'x'\n    return [printf('%s %s: %s', a:bullet, a:name, s:lastline(a:message))]\n  else\n    let lines = map(s:lines(a:message), '\"    \".v:val')\n    return extend([printf('x %s:', a:name)], lines)\n  endif\nendfunction\n\nfunction! s:with_cd(cmd, dir)\n  return printf('cd%s %s && %s', s:is_win ? ' /d' : '', s:shellesc(a:dir), a:cmd)\nendfunction\n\nfunction! s:system(cmd, ...)\n  try\n    let [sh, shrd] = s:chsh(1)\n    let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd\n    return system(s:is_win ? '('.cmd.')' : cmd)\n  finally\n    let [&shell, &shellredir] = [sh, shrd]\n  endtry\nendfunction\n\nfunction! s:system_chomp(...)\n  let ret = call('s:system', a:000)\n  return v:shell_error ? '' : substitute(ret, '\\n$', '', '')\nendfunction\n\nfunction! s:git_validate(spec, check_branch)\n  let err = ''\n  if isdirectory(a:spec.dir)\n    let result = s:lines(s:system('git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url', a:spec.dir))\n    let remote = result[-1]\n    if v:shell_error\n      let err = join([remote, 'PlugClean required.'], \"\\n\")\n    elseif !s:compare_git_uri(remote, a:spec.uri)\n      let err = join(['Invalid URI: '.remote,\n                    \\ 'Expected:    '.a:spec.uri,\n                    \\ 'PlugClean required.'], \"\\n\")\n    elseif a:check_branch && has_key(a:spec, 'commit')\n      let result = s:lines(s:system('git rev-parse HEAD 2>&1', a:spec.dir))\n      let sha = result[-1]\n      if v:shell_error\n        let err = join(add(result, 'PlugClean required.'), \"\\n\")\n      elseif !s:hash_match(sha, a:spec.commit)\n        let err = join([printf('Invalid HEAD (expected: %s, actual: %s)',\n                              \\ a:spec.commit[:6], sha[:6]),\n                      \\ 'PlugUpdate required.'], \"\\n\")\n      endif\n    elseif a:check_branch\n      let branch = result[0]\n      \" Check tag\n      if has_key(a:spec, 'tag')\n        let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir)\n        if a:spec.tag !=# tag\n          let err = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.',\n                \\ (empty(tag) ? 'N/A' : tag), a:spec.tag)\n        endif\n      \" Check branch\n      elseif a:spec.branch !=# branch\n        let err = printf('Invalid branch: %s (expected: %s). Try PlugUpdate.',\n              \\ branch, a:spec.branch)\n      endif\n      if empty(err)\n        let commits = len(s:lines(s:system(printf('git rev-list origin/%s..HEAD', a:spec.branch), a:spec.dir)))\n        if !v:shell_error && commits\n          let err = join([printf('Diverged from origin/%s by %d commit(s).', a:spec.branch, commits),\n                        \\ 'Reinstall after PlugClean.'], \"\\n\")\n        endif\n      endif\n    endif\n  else\n    let err = 'Not found'\n  endif\n  return [err, err =~# 'PlugClean']\nendfunction\n\nfunction! s:rm_rf(dir)\n  if isdirectory(a:dir)\n    call s:system((s:is_win ? 'rmdir /S /Q ' : 'rm -rf ') . s:shellesc(a:dir))\n  endif\nendfunction\n\nfunction! s:clean(force)\n  call s:prepare()\n  call append(0, 'Searching for invalid plugins in '.g:plug_home)\n  call append(1, '')\n\n  \" List of valid directories\n  let dirs = []\n  let errs = {}\n  let [cnt, total] = [0, len(g:plugs)]\n  for [name, spec] in items(g:plugs)\n    if !s:is_managed(name)\n      call add(dirs, spec.dir)\n    else\n      let [err, clean] = s:git_validate(spec, 1)\n      if clean\n        let errs[spec.dir] = s:lines(err)[0]\n      else\n        call add(dirs, spec.dir)\n      endif\n    endif\n    let cnt += 1\n    call s:progress_bar(2, repeat('=', cnt), total)\n    normal! 2G\n    redraw\n  endfor\n\n  let allowed = {}\n  for dir in dirs\n    let allowed[s:dirpath(fnamemodify(dir, ':h:h'))] = 1\n    let allowed[dir] = 1\n    for child in s:glob_dir(dir)\n      let allowed[child] = 1\n    endfor\n  endfor\n\n  let todo = []\n  let found = sort(s:glob_dir(g:plug_home))\n  while !empty(found)\n    let f = remove(found, 0)\n    if !has_key(allowed, f) && isdirectory(f)\n      call add(todo, f)\n      call append(line('$'), '- ' . f)\n      if has_key(errs, f)\n        call append(line('$'), '    ' . errs[f])\n      endif\n      let found = filter(found, 'stridx(v:val, f) != 0')\n    end\n  endwhile\n\n  4\n  redraw\n  if empty(todo)\n    call append(line('$'), 'Already clean.')\n  else\n    let s:clean_count = 0\n    call append(3, ['Directories to delete:', ''])\n    redraw!\n    if a:force || s:ask_no_interrupt('Delete all directories?')\n      call s:delete([6, line('$')], 1)\n    else\n      call setline(4, 'Cancelled.')\n      nnoremap <silent> <buffer> d :set opfunc=<sid>delete_op<cr>g@\n      nmap     <silent> <buffer> dd d_\n      xnoremap <silent> <buffer> d :<c-u>call <sid>delete_op(visualmode(), 1)<cr>\n      echo 'Delete the lines (d{motion}) to delete the corresponding directories'\n    endif\n  endif\n  4\n  setlocal nomodifiable\nendfunction\n\nfunction! s:delete_op(type, ...)\n  call s:delete(a:0 ? [line(\"'<\"), line(\"'>\")] : [line(\"'[\"), line(\"']\")], 0)\nendfunction\n\nfunction! s:delete(range, force)\n  let [l1, l2] = a:range\n  let force = a:force\n  while l1 <= l2\n    let line = getline(l1)\n    if line =~ '^- ' && isdirectory(line[2:])\n      execute l1\n      redraw!\n      let answer = force ? 1 : s:ask('Delete '.line[2:].'?', 1)\n      let force = force || answer > 1\n      if answer\n        call s:rm_rf(line[2:])\n        setlocal modifiable\n        call setline(l1, '~'.line[1:])\n        let s:clean_count += 1\n        call setline(4, printf('Removed %d directories.', s:clean_count))\n        setlocal nomodifiable\n      endif\n    endif\n    let l1 += 1\n  endwhile\nendfunction\n\nfunction! s:upgrade()\n  echo 'Downloading the latest version of vim-plug'\n  redraw\n  let tmp = tempname()\n  let new = tmp . '/plug.vim'\n\n  try\n    let out = s:system(printf('git clone --depth 1 %s %s', s:plug_src, tmp))\n    if v:shell_error\n      return s:err('Error upgrading vim-plug: '. out)\n    endif\n\n    if readfile(s:me) ==# readfile(new)\n      echo 'vim-plug is already up-to-date'\n      return 0\n    else\n      call rename(s:me, s:me . '.old')\n      call rename(new, s:me)\n      unlet g:loaded_plug\n      echo 'vim-plug has been upgraded'\n      return 1\n    endif\n  finally\n    silent! call s:rm_rf(tmp)\n  endtry\nendfunction\n\nfunction! s:upgrade_specs()\n  for spec in values(g:plugs)\n    let spec.frozen = get(spec, 'frozen', 0)\n  endfor\nendfunction\n\nfunction! s:status()\n  call s:prepare()\n  call append(0, 'Checking plugins')\n  call append(1, '')\n\n  let ecnt = 0\n  let unloaded = 0\n  let [cnt, total] = [0, len(g:plugs)]\n  for [name, spec] in items(g:plugs)\n    if has_key(spec, 'uri')\n      if isdirectory(spec.dir)\n        let [err, _] = s:git_validate(spec, 1)\n        let [valid, msg] = [empty(err), empty(err) ? 'OK' : err]\n      else\n        let [valid, msg] = [0, 'Not found. Try PlugInstall.']\n      endif\n    else\n      if isdirectory(spec.dir)\n        let [valid, msg] = [1, 'OK']\n      else\n        let [valid, msg] = [0, 'Not found.']\n      endif\n    endif\n    let cnt += 1\n    let ecnt += !valid\n    \" `s:loaded` entry can be missing if PlugUpgraded\n    if valid && get(s:loaded, name, -1) == 0\n      let unloaded = 1\n      let msg .= ' (not loaded)'\n    endif\n    call s:progress_bar(2, repeat('=', cnt), total)\n    call append(3, s:format_message(valid ? '-' : 'x', name, msg))\n    normal! 2G\n    redraw\n  endfor\n  call setline(1, 'Finished. '.ecnt.' error(s).')\n  normal! gg\n  setlocal nomodifiable\n  if unloaded\n    echo \"Press 'L' on each line to load plugin, or 'U' to update\"\n    nnoremap <silent> <buffer> L :call <SID>status_load(line('.'))<cr>\n    xnoremap <silent> <buffer> L :call <SID>status_load(line('.'))<cr>\n  end\nendfunction\n\nfunction! s:extract_name(str, prefix, suffix)\n  return matchstr(a:str, '^'.a:prefix.' \\zs[^:]\\+\\ze:.*'.a:suffix.'$')\nendfunction\n\nfunction! s:status_load(lnum)\n  let line = getline(a:lnum)\n  let name = s:extract_name(line, '-', '(not loaded)')\n  if !empty(name)\n    call plug#load(name)\n    setlocal modifiable\n    call setline(a:lnum, substitute(line, ' (not loaded)$', '', ''))\n    setlocal nomodifiable\n  endif\nendfunction\n\nfunction! s:status_update() range\n  let lines = getline(a:firstline, a:lastline)\n  let names = filter(map(lines, 's:extract_name(v:val, \"[x-]\", \"\")'), '!empty(v:val)')\n  if !empty(names)\n    echo\n    execute 'PlugUpdate' join(names)\n  endif\nendfunction\n\nfunction! s:is_preview_window_open()\n  silent! wincmd P\n  if &previewwindow\n    wincmd p\n    return 1\n  endif\nendfunction\n\nfunction! s:find_name(lnum)\n  for lnum in reverse(range(1, a:lnum))\n    let line = getline(lnum)\n    if empty(line)\n      return ''\n    endif\n    let name = s:extract_name(line, '-', '')\n    if !empty(name)\n      return name\n    endif\n  endfor\n  return ''\nendfunction\n\nfunction! s:preview_commit()\n  if b:plug_preview < 0\n    let b:plug_preview = !s:is_preview_window_open()\n  endif\n\n  let sha = matchstr(getline('.'), '^  \\X*\\zs[0-9a-f]\\{7}')\n  if empty(sha)\n    return\n  endif\n\n  let name = s:find_name(line('.'))\n  if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir)\n    return\n  endif\n\n  if exists('g:plug_pwindow') && !s:is_preview_window_open()\n    execute g:plug_pwindow\n    execute 'e' sha\n  else\n    execute 'pedit' sha\n    wincmd P\n  endif\n  setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable\n  execute 'silent %!cd' s:shellesc(g:plugs[name].dir) '&& git show --no-color --pretty=medium' sha\n  setlocal nomodifiable\n  nnoremap <silent> <buffer> q :q<cr>\n  wincmd p\nendfunction\n\nfunction! s:section(flags)\n  call search('\\(^[x-] \\)\\@<=[^:]\\+:', a:flags)\nendfunction\n\nfunction! s:format_git_log(line)\n  let indent = '  '\n  let tokens = split(a:line, nr2char(1))\n  if len(tokens) != 5\n    return indent.substitute(a:line, '\\s*$', '', '')\n  endif\n  let [graph, sha, refs, subject, date] = tokens\n  let tag = matchstr(refs, 'tag: [^,)]\\+')\n  let tag = empty(tag) ? ' ' : ' ('.tag.') '\n  return printf('%s%s%s%s%s (%s)', indent, graph, sha, tag, subject, date)\nendfunction\n\nfunction! s:append_ul(lnum, text)\n  call append(a:lnum, ['', a:text, repeat('-', len(a:text))])\nendfunction\n\nfunction! s:diff()\n  call s:prepare()\n  call append(0, ['Collecting changes ...', ''])\n  let cnts = [0, 0]\n  let bar = ''\n  let total = filter(copy(g:plugs), 's:is_managed(v:key) && isdirectory(v:val.dir)')\n  call s:progress_bar(2, bar, len(total))\n  for origin in [1, 0]\n    let plugs = reverse(sort(items(filter(copy(total), (origin ? '' : '!').'(has_key(v:val, \"commit\") || has_key(v:val, \"tag\"))'))))\n    if empty(plugs)\n      continue\n    endif\n    call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:')\n    for [k, v] in plugs\n      let range = origin ? '..origin/'.v.branch : 'HEAD@{1}..'\n      let diff = s:system_chomp('git log --graph --color=never --pretty=format:\"%x01%h%x01%d%x01%s%x01%cr\" '.s:shellesc(range), v.dir)\n      if !empty(diff)\n        let ref = has_key(v, 'tag') ? (' (tag: '.v.tag.')') : has_key(v, 'commit') ? (' '.v.commit) : ''\n        call append(5, extend(['', '- '.k.':'.ref], map(s:lines(diff), 's:format_git_log(v:val)')))\n        let cnts[origin] += 1\n      endif\n      let bar .= '='\n      call s:progress_bar(2, bar, len(total))\n      normal! 2G\n      redraw\n    endfor\n    if !cnts[origin]\n      call append(5, ['', 'N/A'])\n    endif\n  endfor\n  call setline(1, printf('%d plugin(s) updated.', cnts[0])\n        \\ . (cnts[1] ? printf(' %d plugin(s) have pending updates.', cnts[1]) : ''))\n\n  if cnts[0] || cnts[1]\n    nnoremap <silent> <buffer> <cr> :silent! call <SID>preview_commit()<cr>\n    nnoremap <silent> <buffer> o    :silent! call <SID>preview_commit()<cr>\n  endif\n  if cnts[0]\n    nnoremap <silent> <buffer> X :call <SID>revert()<cr>\n    echo \"Press 'X' on each block to revert the update\"\n  endif\n  normal! gg\n  setlocal nomodifiable\nendfunction\n\nfunction! s:revert()\n  if search('^Pending updates', 'bnW')\n    return\n  endif\n\n  let name = s:find_name(line('.'))\n  if empty(name) || !has_key(g:plugs, name) ||\n    \\ input(printf('Revert the update of %s? (y/N) ', name)) !~? '^y'\n    return\n  endif\n\n  call s:system('git reset --hard HEAD@{1} && git checkout '.s:esc(g:plugs[name].branch), g:plugs[name].dir)\n  setlocal modifiable\n  normal! \"_dap\n  setlocal nomodifiable\n  echo 'Reverted'\nendfunction\n\nfunction! s:snapshot(force, ...) abort\n  call s:prepare()\n  setf vim\n  call append(0, ['\" Generated by vim-plug',\n                \\ '\" '.strftime(\"%c\"),\n                \\ '\" :source this file in vim to restore the snapshot',\n                \\ '\" or execute: vim -S snapshot.vim',\n                \\ '', '', 'PlugUpdate!'])\n  1\n  let anchor = line('$') - 3\n  let names = sort(keys(filter(copy(g:plugs),\n        \\'has_key(v:val, \"uri\") && !has_key(v:val, \"commit\") && isdirectory(v:val.dir)')))\n  for name in reverse(names)\n    let sha = s:system_chomp('git rev-parse --short HEAD', g:plugs[name].dir)\n    if !empty(sha)\n      call append(anchor, printf(\"silent! let g:plugs['%s'].commit = '%s'\", name, sha))\n      redraw\n    endif\n  endfor\n\n  if a:0 > 0\n    let fn = expand(a:1)\n    if filereadable(fn) && !(a:force || s:ask(a:1.' already exists. Overwrite?'))\n      return\n    endif\n    call writefile(getline(1, '$'), fn)\n    echo 'Saved as '.a:1\n    silent execute 'e' s:esc(fn)\n    setf vim\n  endif\nendfunction\n\nfunction! s:split_rtp()\n  return split(&rtp, '\\\\\\@<!,')\nendfunction\n\nlet s:first_rtp = s:escrtp(get(s:split_rtp(), 0, ''))\nlet s:last_rtp  = s:escrtp(get(s:split_rtp(), -1, ''))\n\nif exists('g:plugs')\n  let g:plugs_order = get(g:, 'plugs_order', keys(g:plugs))\n  call s:upgrade_specs()\n  call s:define_commands()\nendif\n\nlet &cpo = s:cpo_save\nunlet s:cpo_save\n"
  },
  {
    "path": "config/abbrev.vim",
    "content": "\"\n\" WebVim Configuration : global abbreviations\n\"  \n\" author: Bertrand Chevrier <chevrier.bertrand@gmail.com>\n\" source: https://github.com/krampstudio/dotvim\n\" year  : 2015\n\" \n\n\" nothing yet, you can suggest yours via PR\n"
  },
  {
    "path": "config/autocmd.vim",
    "content": "\"\n\" WebVim Configuration : autocommands\n\"\n\" author: Bertrand Chevrier <chevrier.bertrand@gmail.com>\n\" source: https://github.com/krampstudio/dotvim\n\" year  : 2015\n\"\n\n\n\" Force filetype\n\nautocmd BufRead,BufNewFile .eslintrc setfiletype json\nautocmd BufRead,BufNewFile .jshintrc setfiletype json\n\n\n\" Omni-Completion tip window to close when a selection is\n\" made, these lines close it on movement in insert mode or when leaving\n\" insert mode\n\"autocmd CursorMovedI * if pumvisible() == 0|pclose|endif\nautocmd InsertLeave * if pumvisible() == 0|pclose|endif\n\n\n"
  },
  {
    "path": "config/mapping.vim",
    "content": "\"\n\" WebVim Configuration : global mapping\n\"\n\" author: Bertrand Chevrier <chevrier.bertrand@gmail.com>\n\"\n\n\" leader\nlet g:mapleader = \",\"\nlet g:localmapleader = \"\\\\\"\n\n\" move the current line below\nnnoremap <leader>- ddp\n\n\" move the current line above\nnnoremap <leader>_ ddkP\n\n\" switch tab\nnnoremap <S-right> :tabn<CR>\nnnoremap <S-left> :tabp<CR>\n\n\" insert mode uppercase the current word\n\"  <esc> : go to normal mode\n\"  v \t : visual mode\n\"  iw \t : select the current word\n\"  U \t : uppercase selection\n\"  i \t : back to insert mode\ninoremap <c-u> <esc>viwUi\n\n\" remove last search highlight\nnnoremap <C-l> :nohlsearch<CR><C-l>\n\n\" Wrap a word in double quotes\nnnoremap <leader>\" viw<esc>a\"<esc>hbi\"<esc>lel\n\n\" Wrap a word in single quotes\nnnoremap <leader>' viw<esc>a'<esc>hbi'<esc>lel\n\n\" select inside parents\nonoremap in( :<c-u>normal! f(vi(<cr>\n\n\" select inside braces\nonoremap in{ :<c-u>normal! f{vi{<cr>\n\n\" select inside brackets\nonoremap in[ :<c-u>normal! f[vi[<cr>\n\n\" Open MYVIMRC in a vsplit\nnnoremap <leader>ev :split $MYVIMRC<cr>\n\n\" Source MYVIMRC\nnnoremap <leader>sv :source $MYVIMRC<cr>\n\n\nif g:hardcoreMode == 1\n\n    \" Leave insert mode (like <esc>) and disable <esc>\n    inoremap jk <esc>\n    inoremap <special> <esc> <nop>\n    inoremap <esc>^[ <esc>^[\n\n    \" Disable arrow keys\n\n    nnoremap <up> <nop>\n    nnoremap <down> <nop>\n    nnoremap <left> <nop>\n    nnoremap <right> <nop>\n\n    inoremap <up> <nop>\n    inoremap <down> <nop>\n    inoremap <left> <nop>\n    inoremap <right> <nop>\nendif\n\n\n"
  },
  {
    "path": "config/setting.vim",
    "content": "\"\n\" WebVim Configuration : global settings\n\"\n\" author: Bertrand Chevrier <chevrier.bertrand@gmail.com>\n\" source: https://github.com/krampstudio/dotvim\n\" year  : 2015\n\"\n\n\" wrap end of line\nset wrap\n\n\" show line numbers\nset number\n\n\" syntax highlighting\nsyntax on\nset background=dark\nset t_Co=256\ncolorscheme PaperColor\n\n\n\"indent\nset smartindent\nset autoindent\nset copyindent\nset shiftwidth=4\nset shiftround\nset backspace=indent,eol,start\nset smarttab\nset expandtab\n\n\"search\nset showmatch\nset smartcase\n\nset hlsearch\nset incsearch\n\n\n\" copy/paste\n\"set paste\nset clipboard=unnamedplus\n\n\" folding manual\nset foldmethod=manual\n\n\" mouse\nset mouse=a\n\n\" spell check, to be activated manually\nset spelllang=en_us\nset nospell\n"
  },
  {
    "path": "fonts/10-powerline-symbols.conf",
    "content": "<?xml version=\"1.0\"?>\n<!DOCTYPE fontconfig SYSTEM \"fonts.dtd\">\n\n<fontconfig>\n\t<alias>\n\t\t<family>monospace</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Droid Sans Mono</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Droid Sans Mono Slashed</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Droid Sans Mono Dotted</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>DejaVu Sans Mono</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>DejaVu Sans Mono</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Envy Code R</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Inconsolata</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Lucida Console</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Monaco</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Pragmata</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>PragmataPro</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Menlo</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Source Code Pro</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Consolas</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Anonymous pro</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Bitstream Vera Sans Mono</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Liberation Mono</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Ubuntu Mono</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Meslo LG L</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Meslo LG L DZ</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Meslo LG M</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Meslo LG M DZ</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Meslo LG S</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n\t<alias>\n\t\t<family>Meslo LG S DZ</family>\n\t\t<prefer><family>PowerlineSymbols</family></prefer>\n\t</alias>\n</fontconfig>\n"
  },
  {
    "path": "fonts/install",
    "content": "#!/bin/sh\n\ncurrent=$(dirname \"$0\")\nfontDir=\"$HOME/.fonts\"\nfontFile=\"$current/PowerlineSymbols.otf\"\nfontConfDir=\"$HOME/.fonts.conf.d\"\nfontConfFile=\"$current/10-powerline-symbols.conf\"\n\necho \"Installing Powerline Font for Airline plugin into user space $HOME\"\n\n#Check fc-cache is installed\ncommand -v fc-cache >/dev/null 2>&1 || { echo >&2 \"This script requires fc-cache to install the font, but it's not installed. Quiting\"; exit 1; }\n\n[ -d \"$fontDir\" ] || mkdir \"$fontDir\"\ncp \"$fontFile\" \"$fontDir\" \n\n\n[ -d \"$fontiConfDir\" ] || mkdir \"$fontConfDir\"\ncp \"$fontConfFile\" \"$fontConfDir\"\n\nfc-cache -vf \"$fontDir\"\n\nexit 0\n"
  },
  {
    "path": "plugins/config.vim",
    "content": "\"\n\" WebVim Configuration : Plugins configuration\n\"\n\" author: Bertrand Chevrier <chevrier.bertrand@gmail.com>\n\" source: https://github.com/krampstudio/dotvim\n\" year  : 2015-2019\n\"\n\n\" TODO split by plugin ?\n\n\n\" [> NERDTree <]\n\n\" on vim enter opens nerd tree\nfunction! OpenNerdTree()\n    let s:exclude = ['COMMIT_EDITMSG', 'MERGE_MSG']\n    if index(s:exclude, expand('%:t')) < 0\n        NERDTreeFind\n        exec \"normal! \\<c-w>\\<c-w>\"\n    endif\nendfunction\nautocmd VimEnter * call OpenNerdTree()\n\n\n\" nerdtree window resize\nlet g:NERDTreeWinSize = 35\n\n\" show hidden files\nlet g:NERDTreeShowHidden=1\n\n\" single click to open nodes\n\" let g:NERDTreeMouseMode=3\n\n\" ignored files\nlet g:NERDTreeIgnore=['\\.swp$', '\\~$']\nnnoremap <c-n> :NERDTreeToggle<cr>\n\n\" helps quiting when there's no buffers left but NerdTree\nfunction! CheckLeftBuffers()\n  if tabpagenr('$') == 1\n    let i = 1\n    while i <= winnr('$')\n      if getbufvar(winbufnr(i), '&buftype') == 'help' ||\n          \\ getbufvar(winbufnr(i), '&buftype') == 'quickfix' ||\n          \\ exists('t:NERDTreeBufName') &&\n          \\   bufname(winbufnr(i)) == t:NERDTreeBufName ||\n          \\ bufname(winbufnr(i)) == '__Tag_List__'\n        let i += 1\n      else\n        break\n      endif\n    endwhile\n    if i == winnr('$') + 1\n      qall\n    endif\n    unlet i\n  endif\nendfunction\nautocmd BufEnter * call CheckLeftBuffers()\n\n\" git indicator in tree\nlet g:NERDTreeIndicatorMapCustom = {\n    \\ \"Modified\"  : \"✹\",\n    \\ \"Staged\"    : \"✚\",\n    \\ \"Untracked\" : \"✭\",\n    \\ \"Renamed\"   : \"➜\",\n    \\ \"Unmerged\"  : \"═\",\n    \\ \"Deleted\"   : \"✖\",\n    \\ \"Dirty\"     : \"✗\",\n    \\ \"Clean\"     : \"✔︎\",\n    \\ 'Ignored'   : '☒',\n    \\ \"Unknown\"   : \"?\"\n    \\ }\n\n\" [> NERDCommenter <]\n\nnoremap <c-_> :call NERDComment(0, \"Toggle\")<cr>\n\n\n\" [> Airline <]\n\n\" status line always opened\nset laststatus=2\n\nlet g:airline#extensions#tabline#enabled = 1\n\n\"  powerline font\nlet g:airline_powerline_fonts=1\n\nlet g:airline_theme='papercolor'\n\n\" [> EditorConfig <]\n\n\" to avoid issues with fugitive\nlet g:EditorConfig_exclude_patterns = ['fugitive://.*']\n\n\n\" [> Syntastic <]\n\n\"\" Syntax checkers\n\nlet g:syntastic_check_on_open=1\nlet g:syntastic_enable_signs=1\nlet g:syntastic_php_checkers=['php', 'phpcs', 'phpmd']\nlet g:syntastic_html_checkers=['tidy']\nlet g:syntastic_vim_checkers=['vimlint']\nlet g:syntastic_json_checkers=['jsonlint']\nlet g:syntastic_yaml_checkers=['js-yaml']\nlet g:syntastic_sass_checkers=[\"sasslint\"]\nlet g:syntastic_scss_checkers=[\"sasslint\"]\nlet g:syntastic_css_checkers=['csslint']\nlet g:syntastic_handlebars_checkers=['handlebars']\nlet g:syntastic_tpl_checkers=['handlebars']\n\n\" get available js linters\n\" it returns the mapping between a linter and the config files\nfunction! GetJslinters()\n    return {\n    \\    'eslint' : [ '.eslintrc',  '.eslintrc.json',  '.eslintrc.js', '.eslint.yml' ],\n    \\    'jshint' : [ '.jshintrc']\n    \\ }\nendfunction\n\n\" check if the path to see if a linter config is present\nfunction! Jslinter(path, linters)\n    let l:dir = fnamemodify(a:path, ':p:h')\n\n    if(l:dir == '/')\n        return ['']\n    endif\n\n    for l:linter in keys(a:linters)\n        for l:linterConfig in a:linters[l:linter]\n            if filereadable(l:dir . '/' . l:linterConfig)\n                let l:localLinter = l:dir . '/node_modules/.bin/' . l:linter\n                if executable(l:localLinter)\n                    return [l:linter, l:localLinter]\n                endif\n                return [l:linter, l:linter]\n            endif\n        endfor\n    endfor\n\n    return Jslinter(fnamemodify(l:dir, ':h'), a:linters)\nendfunction\n\n\" set the jslinter into Syntastic\nfunction! SyntasticSetJsLinter()\n\n    let l:availableLinters = GetJslinters()\n\n    \" look for linter config in the current folder\n    let l:jslinter = Jslinter(expand('%:p'), l:availableLinters)\n    if l:jslinter[0] == ''\n        \" otherwise look into the home dir\n        let l:jslinter = Jslinter($HOME, l:availableLinters)\n    endif\n\n    \" configure the linter\n    if l:jslinter[0] != ''\n        let g:syntastic_javascript_checkers=[l:jslinter[0]]\n        if l:jslinter[0] != l:jslinter[1]\n            exec 'let g:syntastic_javascript_' . l:jslinter[0] . '_exec = \"' . l:jslinter[1] . '\"'\n        endif\n        let g:syntastic_javascript_checkers=[l:jslinter[0]]\n    endif\nendfunction\n\ncall SyntasticSetJsLinter()\n\n\" [> EasyAlign <]\n\n\" select paragraph and start easyalign on the left\nnnoremap <leader>a vip<Plug>(EasyAlign)<cr>\n\n\" Start interactive align to the right\nvmap <leader>a <Plug>(EasyAlign)<cr><right>\n\nlet g:easy_align_ignore_groups = ['Comment']\n\nlet s:easy_align_delimiters_default = {\n\\  ' ': { 'pattern': ' ',  'left_margin': 0, 'right_margin': 0, 'stick_to_left': 0 },\n\\  '=': { 'pattern': '===\\|<=>\\|\\(&&\\|||\\|<<\\|>>\\)=\\|=\\~[#?]\\?\\|=>\\|[:+/*!%^=><&|.-]\\?=[#?]\\?',\n\\                          'left_margin': 1, 'right_margin': 1, 'stick_to_left': 0 },\n\\  ':': { 'pattern': ':',  'left_margin': 1, 'right_margin': 1, 'stick_to_left': 0 },\n\\  ',': { 'pattern': ',',  'left_margin': 0, 'right_margin': 1, 'stick_to_left': 1 },\n\\  '|': { 'pattern': '|',  'left_margin': 1, 'right_margin': 1, 'stick_to_left': 0 },\n\\  '.': { 'pattern': '\\.', 'left_margin': 0, 'right_margin': 0, 'stick_to_left': 0 },\n\\  '#': { 'pattern': '#\\+', 'delimiter_align': 'l', 'ignore_groups': ['!Comment']  },\n\\  '&': { 'pattern': '\\\\\\@<!&\\|\\\\\\\\',\n\\                          'left_margin': 1, 'right_margin': 1, 'stick_to_left': 0 },\n\\  '{': { 'pattern': '(\\@<!{',\n\\                          'left_margin': 1, 'right_margin': 1, 'stick_to_left': 0 },\n\\  '}': { 'pattern': '}',  'left_margin': 1, 'right_margin': 0, 'stick_to_left': 0 }\n\\ }\n\n\n\" [> multiple cursor <]\n\nlet g:multi_cursor_use_default_mapping=0\nlet g:multi_cursor_next_key='<C-m>'\nlet g:multi_cursor_prev_key='<C-p>'\nlet g:multi_cursor_skip_key='<C-x>'\nlet g:multi_cursor_quit_key='<esc>'\n\n\n\" [> JsBeautify <]\n\n\" format selection\nautocmd FileType javascript vnoremap <buffer>  <c-f> :call RangeJsBeautify()<cr>\nautocmd FileType json vnoremap <buffer>  <c-f> :call RangeJsonBeautify()<cr>\nautocmd FileType html vnoremap <buffer> <c-f> :call RangeHtmlBeautify()<cr>\nautocmd FileType css vnoremap <buffer> <c-f> :call RangeCSSBeautify()<cr>\n\n\" format the whole file\nautocmd FileType javascript nnoremap <buffer>  <c-f> :call JsBeautify()<cr>\nautocmd FileType json nnoremap <buffer>  <c-f> :call JsonBeautify()<cr>\nautocmd FileType html nnoremap <buffer> <c-f> :call HtmlBeautify()<cr>\nautocmd FileType css nnoremap <buffer> <c-f> :call CSSBeautify()<cr>\n\n\" [> YankStack <]\n\nnmap <leader>p <Plug>yankstack_substitute_older_paste\nnmap <leader>P <Plug>yankstack_substitute_newer_paste\n\n\n\" [> Javascript libraries syntax <]\n\nlet g:used_javascript_libs = 'jquery,underscore,requirejs,chai,handlebars,d3,tape,react,vue,ramda'\n\n\" [> JSON <]\n\nlet g:vim_json_syntax_conceal = 0\n\n\n\" [> YCM shortcuts <]\n\"\nfunction! Refactor()\n    call inputsave()\n    let g:newName = input(\"Enter the new variable name : \")\n    call inputrestore()\n    exec \":YcmCompleter RefactorRename \" . g:newName\nendfunction\n\nnnoremap <leader>gt :YcmCompleter GetType<cr>\nnnoremap <leader>gd :YcmCompleter GetDoc<cr>\nnnoremap <leader>go :YcmCompleter GoTo<cr>\nnnoremap <leader>gf :YcmCompleter GoToDefinition<cr>\nnnoremap <leader>gr :YcmCompleter GoToReferences<cr>\nnnoremap <leader>r :call Refactor()<cr>\n\n\" [> Emmet shortcuts <]\n\"\nlet g:user_emmet_install_global = 0\nautocmd FileType html,tpl,hbs,css,scss EmmetInstall\nlet g:user_emmet_leader_key='<C-k>'\n\n\n"
  },
  {
    "path": "plugins/def.vim",
    "content": "\nfunction! InstallYCM(info)\n  if a:info.status == 'installed' || a:info.force\n    !./install.py\n    !cd ./third_party/ycmd/third_party/tern_runtime && npm install\n  endif\nendfunction\n\n\" Start plugins definition\ncall plug#begin($HOME.'/.vim/plugins/plugged')\n\nPlug 'scrooloose/nerdtree', { 'commit' : '84737f2ebe533ffac9ebc21da8d1f57216962641' } | Plug 'https://gist.github.com/1f40e70e615f2fa2212bf5423662277d.git', { 'dir' : g:vimDir . '/nerdtree_plugin' } | Plug 'Xuyuanp/nerdtree-git-plugin', { 'commit' : '325a1298b0c9d8a4c61388a2f9956a534a9068cd' } | Plug 'MarSoft/nerdtree-grep-plugin', { 'commit' : '09e446ebe4770687a6283905d5ff461ea268bc14' }\n\nPlug 'scrooloose/nerdcommenter',                  { 'commit' : '9a32fd2534427f7a1dcfe22e9c0ea6b67b6dbe78' }\nPlug 'NLKNguyen/papercolor-theme',                { 'commit' : 'c4a4dfdc21c14f58c12d077242ae33b729c894b2' }\nPlug 'bling/vim-airline',                         { 'commit' : '1c3ae6077af76927f82f87e05a7b9fdfba47ce2c', 'do' : $HOME.'/.vim/fonts/install' }\nPlug 'vim-airline/vim-airline-themes',            { 'commit' : '3bfe1d00d48f7c35b7c0dd7af86229c9e63e14a9' }\nPlug 'tpope/vim-fugitive',                        { 'commit' : '2564c37d0a2ade327d6381fef42d84d9fad1d057' }\nPlug 'tpope/vim-rhubarb',                         { 'commit' : '57a350e6327af0074c4bc0d30b62662dfdb993af' }\nPlug 'airblade/vim-gitgutter',                    { 'commit' : '7eeea63e62b1cc088a75c7a7c244fc774d82e5bb' }\nPlug 'editorconfig/editorconfig-vim',             { 'commit' : '68f8136d2b018bfa9b23403e87d3d65bc942cbc3' }\nPlug 'bronson/vim-trailing-whitespace',           { 'commit' : '733fb64337b6da4a51c85a43450cd620d8b617b5' }\nPlug 'scrooloose/syntastic',                      { 'commit' : '6ffba7395c562e152cb84bc8f7906de2b1ed0b8a' }\nPlug 'gcorne/vim-sass-lint',                      { 'commit' : 'b9ff33141294c7af143f12687e9b1cf9a3a54e0f' }\nPlug 'junegunn/vim-easy-align',                   { 'commit' : '0cb6b98fc155717b0a56c110551ac57d1d951ddb' }\nPlug 'terryma/vim-multiple-cursors',              { 'commit' : '51d0717f63cc231f11b4b63ee5b611f589dce1b3' }\nPlug 'maksimr/vim-jsbeautify',                    { 'commit' : 'caffda66a2a8852ee132f95291115af67370c5e7', 'do' : 'git submodule update --init --recursive && npm install' }\nPlug 'maxbrunsfeld/vim-yankstack',                { 'commit' : '157a659c1b101c899935d961774fb5c8f0775370' }\nPlug 'tpope/vim-surround',                        { 'commit' : 'e49d6c2459e0f5569ff2d533b4df995dd7f98313'}\nPlug 'elzr/vim-json',                             { 'commit' : '3727f089410e23ae113be6222e8a08dd2613ecf2'}\nPlug 'othree/yajs.vim',                           { 'commit' : '437be4ccf0e78fe54cb482657091cff9e8479488'}\nPlug 'othree/es.next.syntax.vim',                 { 'commit' : 'ad2d6a27073e43e41b8041b3655f2444a251c444'}\nPlug 'othree/javascript-libraries-syntax.vim',    { 'commit' : '5ef435d8c28ebc3c9b52fb865f4c06db629857f7'}\nPlug 'hail2u/vim-css3-syntax',                    { 'commit' : '3e40dde46c6a3bc4f0339248b000bbe96e39dc2d'}\nPlug 'cakebaker/scss-syntax.vim',                 { 'commit' : '4461789d02f81fd328afbdf27d6404b6c763c25f'}\nPlug 'othree/html5.vim',                          { 'commit' : 'bc7faabe7a4dfc0d963d6d8a406c3b7284e2866f'}\nPlug 'Valloric/YouCompleteMe',                    { 'commit' : 'ddf18cc6ec3bb0108bb89ac366fd74394815f2c6', 'do': function('InstallYCM') }\nPlug 'moll/vim-node',                             { 'commit' : 'ede047791792b9530ba1ae73ed86e9671cdd96b8'}\nPlug 'syngan/vim-vimlint',                        { 'commit' : 'c8b9cd9d8a0fb6dc69667d32819aeef503cff55c'}\nPlug 'ynkdir/vim-vimlparser',                     { 'commit' : '2fff43c58968a18bc01bc8304df68bde01af04d9'}\nPlug 'mattn/emmet-vim',                           { 'commit' : 'd698f1658770ca5fa58c87e80421c8d65bbe9065'}\nPlug 'martinda/Jenkinsfile-vim-syntax'\n\ncall plug#end()\n"
  }
]