diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1199916 --- /dev/null +++ b/LICENSE @@ -0,0 +1,15 @@ + MS dotfiles + Copyright (C) 2016 Mayank Suman + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . diff --git a/README.md b/README.md new file mode 100644 index 0000000..dca9ce2 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# MS dotfile - My configuration + +Version 1! Inspired by mutewinter, spf13, nicknishi dotfile. + +## Installation +Only tested on Debian based systems. + +1. `git clone http://github.com/mayanksuman/dotfile.git ~/.dotfile` && cd ~/.dotfile +1. `./install.sh`. + +## Customized VIM Mappings + +* Typing `jk` insert mode is equivalent to `Escape`. + +And many more. See [`mappings.vim`](mappings.vim) for more. + +## Installing Custom VIM Plugins + +Create a new `.vim` file with the same name as the plugin you'd like to install +in [`nvim/vim_plugs/custom`](nvim/vim_plugins/custom). Then add the installation +block. For example: + +`nvim/vim_plugs/custom/vim-move.vim` + +```viml +if exists('g:vim_plug_installing_plugins') + Plug 'matze/vim-move.vim' + finish +endif + +let g:move_key_modifier = 'C' +``` + +This example installs [`vim-move`](https://github.com/matze/vim-move). + diff --git a/fonts/RobotoMono_nerd/Roboto Mono Bold Italic Nerd Font Complete Mono Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Bold Italic Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..907bb1b Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Bold Italic Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Bold Italic Nerd Font Complete Mono.ttf b/fonts/RobotoMono_nerd/Roboto Mono Bold Italic Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..5986008 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Bold Italic Nerd Font Complete Mono.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Bold Italic Nerd Font Complete Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Bold Italic Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..bd01e06 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Bold Italic Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Bold Italic Nerd Font Complete.ttf b/fonts/RobotoMono_nerd/Roboto Mono Bold Italic Nerd Font Complete.ttf new file mode 100644 index 0000000..4b883bb Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Bold Italic Nerd Font Complete.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Bold Nerd Font Complete Mono Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Bold Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..1c59762 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Bold Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Bold Nerd Font Complete Mono.ttf b/fonts/RobotoMono_nerd/Roboto Mono Bold Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..b6c0ec3 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Bold Nerd Font Complete Mono.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Bold Nerd Font Complete Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Bold Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..7bed5bf Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Bold Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Bold Nerd Font Complete.ttf b/fonts/RobotoMono_nerd/Roboto Mono Bold Nerd Font Complete.ttf new file mode 100644 index 0000000..12e2e38 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Bold Nerd Font Complete.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Italic Nerd Font Complete Mono Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Italic Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..31783a0 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Italic Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Italic Nerd Font Complete Mono.ttf b/fonts/RobotoMono_nerd/Roboto Mono Italic Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..f5d4df5 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Italic Nerd Font Complete Mono.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Italic Nerd Font Complete Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Italic Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..01ccfa2 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Italic Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Italic Nerd Font Complete.ttf b/fonts/RobotoMono_nerd/Roboto Mono Italic Nerd Font Complete.ttf new file mode 100644 index 0000000..7944b33 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Italic Nerd Font Complete.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Light Italic Nerd Font Complete Mono Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Light Italic Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..8efab88 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Light Italic Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Light Italic Nerd Font Complete Mono.ttf b/fonts/RobotoMono_nerd/Roboto Mono Light Italic Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..c46178a Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Light Italic Nerd Font Complete Mono.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Light Italic Nerd Font Complete Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Light Italic Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..43beb64 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Light Italic Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Light Italic Nerd Font Complete.ttf b/fonts/RobotoMono_nerd/Roboto Mono Light Italic Nerd Font Complete.ttf new file mode 100644 index 0000000..6b38a3c Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Light Italic Nerd Font Complete.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Light Nerd Font Complete Mono Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Light Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..251e0ff Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Light Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Light Nerd Font Complete Mono.ttf b/fonts/RobotoMono_nerd/Roboto Mono Light Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..2c7688e Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Light Nerd Font Complete Mono.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Light Nerd Font Complete Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Light Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..9e5c8a1 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Light Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Light Nerd Font Complete.ttf b/fonts/RobotoMono_nerd/Roboto Mono Light Nerd Font Complete.ttf new file mode 100644 index 0000000..45b9cc1 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Light Nerd Font Complete.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Medium Italic Nerd Font Complete Mono Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Medium Italic Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..875ac97 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Medium Italic Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Medium Italic Nerd Font Complete Mono.ttf b/fonts/RobotoMono_nerd/Roboto Mono Medium Italic Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..bf88027 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Medium Italic Nerd Font Complete Mono.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Medium Italic Nerd Font Complete Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Medium Italic Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..505896b Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Medium Italic Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Medium Italic Nerd Font Complete.ttf b/fonts/RobotoMono_nerd/Roboto Mono Medium Italic Nerd Font Complete.ttf new file mode 100644 index 0000000..7a57a9c Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Medium Italic Nerd Font Complete.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Medium Nerd Font Complete Mono Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Medium Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..992c1d8 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Medium Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Medium Nerd Font Complete Mono.ttf b/fonts/RobotoMono_nerd/Roboto Mono Medium Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..811bea7 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Medium Nerd Font Complete Mono.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Medium Nerd Font Complete Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Medium Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..7f3aa59 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Medium Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Medium Nerd Font Complete.ttf b/fonts/RobotoMono_nerd/Roboto Mono Medium Nerd Font Complete.ttf new file mode 100644 index 0000000..a681e07 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Medium Nerd Font Complete.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Nerd Font Complete Mono Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..1308c12 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Nerd Font Complete Mono.ttf b/fonts/RobotoMono_nerd/Roboto Mono Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..b2376bf Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Nerd Font Complete Mono.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Nerd Font Complete Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..22c2a56 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Nerd Font Complete.ttf b/fonts/RobotoMono_nerd/Roboto Mono Nerd Font Complete.ttf new file mode 100644 index 0000000..bafde9c Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Nerd Font Complete.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Thin Italic Nerd Font Complete Mono Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Thin Italic Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..7772c5d Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Thin Italic Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Thin Italic Nerd Font Complete Mono.ttf b/fonts/RobotoMono_nerd/Roboto Mono Thin Italic Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..9934ec4 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Thin Italic Nerd Font Complete Mono.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Thin Italic Nerd Font Complete Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Thin Italic Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..da51d3c Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Thin Italic Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Thin Italic Nerd Font Complete.ttf b/fonts/RobotoMono_nerd/Roboto Mono Thin Italic Nerd Font Complete.ttf new file mode 100644 index 0000000..010f5cf Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Thin Italic Nerd Font Complete.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Thin Nerd Font Complete Mono Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Thin Nerd Font Complete Mono Windows Compatible.ttf new file mode 100644 index 0000000..8ec9c17 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Thin Nerd Font Complete Mono Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Thin Nerd Font Complete Mono.ttf b/fonts/RobotoMono_nerd/Roboto Mono Thin Nerd Font Complete Mono.ttf new file mode 100644 index 0000000..881b329 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Thin Nerd Font Complete Mono.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Thin Nerd Font Complete Windows Compatible.ttf b/fonts/RobotoMono_nerd/Roboto Mono Thin Nerd Font Complete Windows Compatible.ttf new file mode 100644 index 0000000..d6d60d7 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Thin Nerd Font Complete Windows Compatible.ttf differ diff --git a/fonts/RobotoMono_nerd/Roboto Mono Thin Nerd Font Complete.ttf b/fonts/RobotoMono_nerd/Roboto Mono Thin Nerd Font Complete.ttf new file mode 100644 index 0000000..eb5adf2 Binary files /dev/null and b/fonts/RobotoMono_nerd/Roboto Mono Thin Nerd Font Complete.ttf differ diff --git a/fonts/RobotoMono_powerline/LICENSE.txt b/fonts/RobotoMono_powerline/LICENSE.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/fonts/RobotoMono_powerline/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/fonts/RobotoMono_powerline/README.rst b/fonts/RobotoMono_powerline/README.rst new file mode 100644 index 0000000..c068ac5 --- /dev/null +++ b/fonts/RobotoMono_powerline/README.rst @@ -0,0 +1,24 @@ +Roboto Mono is a monospaced addition to the +`Roboto `__ type family. +Like the other members of the Roboto family, the fonts are optimized for +readability on screens across a wide variety of devices and reading +environments. While the monospaced version is related to its variable +width cousin, it doesn’t hesitate to change forms to better fit the +constraints of a monospaced environment. For example, narrow glyphs like +‘I’, ‘l’ and ‘i’ have added serifs for more even texture while wider +glyphs are adjusted for weight. Curved caps like ‘C’ and ‘O’ take on the +straighter sides from Roboto Condensed. + +Special consideration is given to glyphs important for reading and +writing software source code. Letters with similar shapes are easy to +tell apart. Digit ‘1’, lowercase ‘l’ and capital ‘I’ are easily +differentiated as are zero and the letter ‘O’. Punctuation important for +code has also been considered. For example, the curly braces ‘{ }’ have +exaggerated points to clearly differentiate them from parenthesis ‘( )’ +and braces ‘[ ]’. Periods and commas are also exaggerated to identify +them more quickly. The scale and weight of symbols commonly used as +operators have also been optimized. + +:Font creator: Google +:Source: https://github.com/google/fonts/tree/master/apache/robotomono +:Patched by: `Evan McClain `_ diff --git a/fonts/RobotoMono_powerline/Roboto Mono Bold Italic for Powerline.ttf b/fonts/RobotoMono_powerline/Roboto Mono Bold Italic for Powerline.ttf new file mode 100644 index 0000000..b5fee07 Binary files /dev/null and b/fonts/RobotoMono_powerline/Roboto Mono Bold Italic for Powerline.ttf differ diff --git a/fonts/RobotoMono_powerline/Roboto Mono Bold for Powerline.ttf b/fonts/RobotoMono_powerline/Roboto Mono Bold for Powerline.ttf new file mode 100644 index 0000000..b927485 Binary files /dev/null and b/fonts/RobotoMono_powerline/Roboto Mono Bold for Powerline.ttf differ diff --git a/fonts/RobotoMono_powerline/Roboto Mono Italic for Powerline.ttf b/fonts/RobotoMono_powerline/Roboto Mono Italic for Powerline.ttf new file mode 100644 index 0000000..1bdada0 Binary files /dev/null and b/fonts/RobotoMono_powerline/Roboto Mono Italic for Powerline.ttf differ diff --git a/fonts/RobotoMono_powerline/Roboto Mono Light Italic for Powerline.ttf b/fonts/RobotoMono_powerline/Roboto Mono Light Italic for Powerline.ttf new file mode 100644 index 0000000..807e490 Binary files /dev/null and b/fonts/RobotoMono_powerline/Roboto Mono Light Italic for Powerline.ttf differ diff --git a/fonts/RobotoMono_powerline/Roboto Mono Light for Powerline.ttf b/fonts/RobotoMono_powerline/Roboto Mono Light for Powerline.ttf new file mode 100644 index 0000000..b7995f9 Binary files /dev/null and b/fonts/RobotoMono_powerline/Roboto Mono Light for Powerline.ttf differ diff --git a/fonts/RobotoMono_powerline/Roboto Mono Medium Italic for Powerline.ttf b/fonts/RobotoMono_powerline/Roboto Mono Medium Italic for Powerline.ttf new file mode 100644 index 0000000..c899eef Binary files /dev/null and b/fonts/RobotoMono_powerline/Roboto Mono Medium Italic for Powerline.ttf differ diff --git a/fonts/RobotoMono_powerline/Roboto Mono Medium for Powerline.ttf b/fonts/RobotoMono_powerline/Roboto Mono Medium for Powerline.ttf new file mode 100644 index 0000000..5297fae Binary files /dev/null and b/fonts/RobotoMono_powerline/Roboto Mono Medium for Powerline.ttf differ diff --git a/fonts/RobotoMono_powerline/Roboto Mono Thin Italic for Powerline.ttf b/fonts/RobotoMono_powerline/Roboto Mono Thin Italic for Powerline.ttf new file mode 100644 index 0000000..4f43d55 Binary files /dev/null and b/fonts/RobotoMono_powerline/Roboto Mono Thin Italic for Powerline.ttf differ diff --git a/fonts/RobotoMono_powerline/Roboto Mono Thin for Powerline.ttf b/fonts/RobotoMono_powerline/Roboto Mono Thin for Powerline.ttf new file mode 100644 index 0000000..375aaab Binary files /dev/null and b/fonts/RobotoMono_powerline/Roboto Mono Thin for Powerline.ttf differ diff --git a/fonts/RobotoMono_powerline/Roboto Mono for Powerline.ttf b/fonts/RobotoMono_powerline/Roboto Mono for Powerline.ttf new file mode 100644 index 0000000..580460b Binary files /dev/null and b/fonts/RobotoMono_powerline/Roboto Mono for Powerline.ttf differ diff --git a/fonts/RobotoMono_powerline/fonts.dir b/fonts/RobotoMono_powerline/fonts.dir new file mode 100644 index 0000000..2629ba5 --- /dev/null +++ b/fonts/RobotoMono_powerline/fonts.dir @@ -0,0 +1,141 @@ +140 +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-ascii-0 +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-iso8859-13 +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-iso8859-7 +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Bold for Powerline.ttf -misc-Roboto Mono for Powerline-bold-r-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-ascii-0 +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-iso8859-13 +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-iso8859-7 +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Bold Italic for Powerline.ttf -misc-Roboto Mono for Powerline-bold-i-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-ascii-0 +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-13 +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-7 +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-koi8-r +Roboto Mono for Powerline.ttf -misc-Roboto Mono for Powerline-medium-r-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-ascii-0 +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-13 +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-7 +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Italic for Powerline.ttf -misc-Roboto Mono for Powerline-medium-i-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-ascii-0 +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-iso8859-13 +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-iso8859-7 +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Light for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-r-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-ascii-0 +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-iso8859-13 +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-iso8859-7 +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Light Italic for Powerline.ttf -misc-Roboto Mono Light for Powerline-light-i-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-ascii-0 +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-13 +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-7 +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Medium for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-r-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-ascii-0 +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-13 +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-7 +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Medium Italic for Powerline.ttf -misc-Roboto Mono Medium for Powerline-medium-i-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-ascii-0 +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-13 +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-7 +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Thin for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-r-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-ascii-0 +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-13 +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-7 +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Thin Italic for Powerline.ttf -misc-Roboto Mono Thin for Powerline-medium-i-normal--0-0-0-0-p-0-koi8-ru diff --git a/fonts/RobotoMono_powerline/fonts.scale b/fonts/RobotoMono_powerline/fonts.scale new file mode 100644 index 0000000..388c67e --- /dev/null +++ b/fonts/RobotoMono_powerline/fonts.scale @@ -0,0 +1,141 @@ +140 +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-koi8-e +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-koi8-u +Roboto Mono Bold Italic for Powerline.ttf -misc-roboto mono for powerline-bold-i-normal--0-0-0-0-p-0-koi8-uni +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-koi8-e +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-koi8-u +Roboto Mono Bold for Powerline.ttf -misc-roboto mono for powerline-bold-r-normal--0-0-0-0-p-0-koi8-uni +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-koi8-e +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-koi8-u +Roboto Mono Italic for Powerline.ttf -misc-roboto mono for powerline-medium-i-normal--0-0-0-0-p-0-koi8-uni +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-koi8-e +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-koi8-u +Roboto Mono Light Italic for Powerline.ttf -misc-roboto mono light for powerline-light-i-normal--0-0-0-0-p-0-koi8-uni +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-koi8-e +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-koi8-u +Roboto Mono Light for Powerline.ttf -misc-roboto mono light for powerline-light-r-normal--0-0-0-0-p-0-koi8-uni +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-koi8-e +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-koi8-u +Roboto Mono Medium Italic for Powerline.ttf -misc-roboto mono medium for powerline-medium-i-normal--0-0-0-0-p-0-koi8-uni +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-koi8-e +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-koi8-u +Roboto Mono Medium for Powerline.ttf -misc-roboto mono medium for powerline-medium-r-normal--0-0-0-0-p-0-koi8-uni +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-koi8-e +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-koi8-u +Roboto Mono Thin Italic for Powerline.ttf -misc-roboto mono thin for powerline-light-i-normal--0-0-0-0-p-0-koi8-uni +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-koi8-e +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-koi8-r +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-koi8-u +Roboto Mono Thin for Powerline.ttf -misc-roboto mono thin for powerline-light-r-normal--0-0-0-0-p-0-koi8-uni +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-iso10646-1 +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-1 +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-10 +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-15 +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-2 +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-3 +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-4 +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-5 +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-iso8859-9 +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-koi8-e +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-koi8-r +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-koi8-ru +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-koi8-u +Roboto Mono for Powerline.ttf -misc-roboto mono for powerline-medium-r-normal--0-0-0-0-p-0-koi8-uni diff --git a/git/gitconfig.symlink b/git/gitconfig.symlink new file mode 100644 index 0000000..0e4bf01 --- /dev/null +++ b/git/gitconfig.symlink @@ -0,0 +1,159 @@ +# gitconfig +[user] + name = Mayank Suman + email = mayanksuman@live.com +[github] + user = mayanksuman +[init] +# templatedir = ~/.my_config/git/templates +[alias] + # list all aliases + la = "!git config -l | grep alias | cut -c 7-" + delete-merged-branches = "!f() { git checkout --quiet master && git branch --merged | grep --invert-match '\\*' | xargs -n 1 git branch --delete; git checkout --quiet @{-1}; }; f" + diff = diff --ignore-space-at-eol -b -w --ignore-blank-lines + cnv = commit --no-verify + pnv = push --no-verify + co = checkout + cob = checkout -b + s = status --short + ss = status + br = branch -v + + # rebase commands + cont = rebase --continue + conf = "!git s | grep ^U" + + l = log --graph --pretty=format:'%Cred%h%Creset %C(bold blue)%an%C(reset) - %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative + + # show what I did today + day = "!sh -c 'git log --reverse --no-merges --branches=* --date=local --after=\"yesterday 11:59PM\" --author=\"`git config --get user.name`\"'" + + # order files by number of commits, ascending + # Written by Corey Haines + # Scriptified by Gary Bernhardt + # Show churn for a time range: + # $ git churn --since='1 month ago' + churn = "!f() { git log --all -M -C --name-only --format='format:' \"$@\" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print \"count\tfile\"} {print $1 \"\t\" $2}' | sort -g; }; f" + + # show all deleted files in the repo + deleted = "!git log --diff-filter=D --summary | grep delete" + + # create an empty commit + empty = commit --allow-empty + + # current branch + cbr = rev-parse --abbrev-ref HEAD + + # submodule shortcuts + si = submodule init + su = submodule update + sub = "!git submodule sync && git submodule update" + + # show number of commits per contributer, sorted + count = shortlog -sn + + undo = reset --soft HEAD~1 + amend = commit -a --amend + + cleanup = "!git remote prune origin && git gc && git clean -df && git stash clear" + + # rebase the current branch with changes from upstream remote + update = !git fetch upstream && git rebase upstream/`git rev-parse --abbrev-ref HEAD` + + # tag aliases + # show the last tag + lt = describe --tags --abbrev=0 + + # assume aliases + assume = update-index --assume-unchanged + unassume = update-index --no-assume-unchanged + assumed = "!git ls-files -v | grep ^h | cut -c 3-" + unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged" + + # show the most recently touched branches + recent = "!git for-each-ref --sort='-committerdate' --format='%(color:red)%(refname)%(color:reset)%09%(committerdate)' refs/heads | sed -e 's-refs/heads/--' | less -XFR" + latest = "!git for-each-ref --sort='-committerdate' --format='%(color:red)%(refname)%(color:reset)%09%(committerdate)' refs/remotes | sed -e 's-refs/remotes/origin/--' | less -XFR" + + # grep commands + + # 'diff grep' + dg = "!sh -c 'git ls-files -m | grep $1 | xargs git diff' -" + # diff grep changes between two commits + dgc = "!sh -c 'git ls-files | grep $1 | xargs git diff $2 $3 -- ' -" + # 'checkout grep' + cg = "!sh -c 'git ls-files -m | grep $1 | xargs git checkout ' -" + # add grep + ag = "!sh -c 'git ls-files -m -o --exclude-standard | grep $1 | xargs git add --all' -" + # add all + aa = !git ls-files -d | xargs git rm && git ls-files -m -o --exclude-standard | xargs git add + # remove grep - Remove found files that are NOT under version control + rg = "!sh -c 'git ls-files --others --exclude-standard | grep $1 | xargs rm' -" + + # Kaleidoscope commands + dkal = difftool -y -t Kaleidoscope + mkal = mergetool -y -t Kaleidoscope + remotes = remote -v + + # check out a local copy of a PR. https://gist.github.com/gnarf/5406589 + pr = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f" + pr-clean = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done" +[color] + diff = auto + status = auto + branch = auto + interactive = auto + ui = auto +[color "branch"] + current = green bold + local = green + remote = red bold +[color "diff"] + meta = yellow bold + frag = magenta bold + old = red bold + new = green bold +[color "status"] + added = green bold + changed = yellow bold + untracked = red +[color "sh"] + branch = yellow +[push] + # push will only do the current branch, not all branches + default = current +[branch] + # set up 'git pull' to rebase instead of merge + # autosetuprebase = always +[diff] + renames = copies + mnemonicprefix = true + compactionHeuristic = true +[difftool] + prompt = false +[apply] + # do not warn about missing whitespace at EOF + whitespace = nowarn +[core] + excludesfile = ~/.gitignore_global + pager = less -FXRS -x2 + editor = vim + whitespace = cr-at-eol +[rerere] + enabled = true +[gitsh] + defaultCommand = s +[grep] + extendRegexp = true + lineNumber = true +[credential] + helper = osxkeychain +[difftool "Kaleidoscope"] + cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\" +[mergetool "Kaleidoscope"] + cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot + trustexitcode = true +[rebase] + instructionFormat = "[%an - %ar] %s" +[pager] + diff = "diff-so-fancy | less --tabs=4 -RFX" + show = "diff-so-fancy | less --tabs=4 -RFX" diff --git a/git/gitignore_global.symlink b/git/gitignore_global.symlink new file mode 100644 index 0000000..5aa25f4 --- /dev/null +++ b/git/gitignore_global.symlink @@ -0,0 +1,22 @@ +.DS_Store +Thumbs.db +*~ +*.swp +.AppleDouble +.LSOverride + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# project-specific vim configurations +.vimrc.local + +# typescript command garbage +tscommand*.txt + +# nvm - the Node Version Manager +.nvmrc diff --git a/git/hooks/jscs.pre-commit b/git/hooks/jscs.pre-commit new file mode 100755 index 0000000..ffb46ce --- /dev/null +++ b/git/hooks/jscs.pre-commit @@ -0,0 +1,37 @@ +#!/bin/sh +# JSCS Pre-Commit +# If a JavaScript file is trying to be committed and it fails style checking +# then fail the commit + +EXIT_CODE=0 +COLOR_RED="\x1B[31m" +COLOR_YELLOW="\x1B[1;33m" +COLOR_GREEN="\x1B[32m" +COLOR_NONE="\x1B[0m" + +if ! jscs > /dev/null 2>&1; then + echo "${COLOR_YELLOW}JSCS is not installed. Exiting.${COLOR_NONE}" + exit 0 +fi + +repo=$( git rev-parse --show-toplevel ) + +for file in $( exec git diff-index --cached --name-only HEAD ); do + if [ ${file: -3} == ".js" ]; then + status=$( exec git status --porcelain $file ) + + if [[ $status != D* ]]; then + jscs ${repo}/${file} + EXIT_CODE=$((${EXIT_CODE} + $?)) + fi + fi +done + +echo "" +if [[ ${EXIT_CODE} -ne 0 ]]; then + echo "${COLOR_RED}✘ JSCS detected syntax problems.${COLOR_NONE}" +else + echo "${COLOR_GREEN}✔ JSCS detected no errors.${COLOR_NONE}" +fi + +exit $((${EXIT_CODE})) diff --git a/git/hooks/jshint.pre-commit b/git/hooks/jshint.pre-commit new file mode 100755 index 0000000..8e4590d --- /dev/null +++ b/git/hooks/jshint.pre-commit @@ -0,0 +1,37 @@ +#!/bin/sh +# JSHint Pre-Commit +# If a JavaScript file is trying to be committed and it fails linting +# then fail the commit + +EXIT_CODE=0 +COLOR_RED="\x1B[31m" +COLOR_YELLOW="\x1B[1;33m" +COLOR_GREEN="\x1B[32m" +COLOR_NONE="\x1B[0m" + +if ! jshint > /dev/null 2>&1; then + echo "${COLOR_YELLOW}JSHint is not installed. Exiting.${COLOR_NONE}" + exit 0 +fi + +repo=$( git rev-parse --show-toplevel ) + +for file in $( exec git diff-index --cached --name-only HEAD ); do + if [ ${file: -3} == ".js" ]; then + status=$( exec git status --porcelain $file ) + + if [[ $status != D* ]]; then + jshint ${repo}/${file} + EXIT_CODE=$((${EXIT_CODE} + $?)) + fi + fi +done + +echo "" +if [[ ${EXIT_CODE} -ne 0 ]]; then + echo "${COLOR_RED}✘ JSHINT detected syntax problems.${COLOR_NONE}" +else + echo "${COLOR_GREEN}✔ JSHINT detected no errors.${COLOR_NONE}" +fi + +exit $((${EXIT_CODE})) diff --git a/git/hooks/recent.post-checkout b/git/hooks/recent.post-checkout new file mode 120000 index 0000000..3e9bd2c --- /dev/null +++ b/git/hooks/recent.post-checkout @@ -0,0 +1 @@ +recent.post-merge \ No newline at end of file diff --git a/git/hooks/recent.post-merge b/git/hooks/recent.post-merge new file mode 100755 index 0000000..77961f9 --- /dev/null +++ b/git/hooks/recent.post-merge @@ -0,0 +1,8 @@ +#!/bin/bash + +echo "" +echo "" +echo -e "\033[1m RECENT COMMITS \033[0m" +git --no-pager log -n5 --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative +echo "" +echo "" diff --git a/git/templates/hooks/post-checkout b/git/templates/hooks/post-checkout new file mode 120000 index 0000000..975266c --- /dev/null +++ b/git/templates/hooks/post-checkout @@ -0,0 +1 @@ +./run-hooks.sh \ No newline at end of file diff --git a/git/templates/hooks/post-merge b/git/templates/hooks/post-merge new file mode 120000 index 0000000..975266c --- /dev/null +++ b/git/templates/hooks/post-merge @@ -0,0 +1 @@ +./run-hooks.sh \ No newline at end of file diff --git a/git/templates/hooks/pre-commit b/git/templates/hooks/pre-commit new file mode 120000 index 0000000..975266c --- /dev/null +++ b/git/templates/hooks/pre-commit @@ -0,0 +1 @@ +./run-hooks.sh \ No newline at end of file diff --git a/git/templates/hooks/run-hooks.sh b/git/templates/hooks/run-hooks.sh new file mode 100755 index 0000000..30f6615 --- /dev/null +++ b/git/templates/hooks/run-hooks.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +EXIT_CODE=0 + +repo=$( git rev-parse --show-toplevel ) +hook_type=$( basename $0 ) +hooks=~/.dotfiles/git/hooks + +echo "Executing $hook_type hook(s)" + +for hook in $hooks/*.$hook_type; do + echo "" + echo "${COLOR_LIGHTPURPLE}Executing ${hook}${COLOR_NONE}" + ${hook} + EXIT_CODE=$((${EXIT_CODE} + $?)) +done + +if [[ ${EXIT_CODE} -ne 0 ]]; then + echo "" + echo "${COLOR_RED}Commit Failed.${COLOR_NONE}" +fi + +exit $((${EXIT_CODE})) diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..c23c297 --- /dev/null +++ b/install.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +echo "Installing dotfiles" + +echo "Initializing submodule(s)" +git submodule update --init --recursive + +echo "Installing required packages" +sudo -E apt update +sudo -E apt install zsh tmux neovim markdown xsel silversearcher-ag exuberant-ctags git gcc g++ sed python-pip python3-pip npm nodejs pandoc + +echo "Installing fonts" +cp -R /fonts/ ~/.local/share/fonts/ + +echo "Installing configuration" +cd scripts +./oh_my_zsh_install.sh +./base16-shell.sh +./tmux.sh +./nvim.sh +./git.sh diff --git a/jscsrc.symlink b/jscsrc.symlink new file mode 100644 index 0000000..f6d0a80 --- /dev/null +++ b/jscsrc.symlink @@ -0,0 +1,68 @@ +{ + "requireCurlyBraces": [ + "if", "else", "for", "while", "do", "try", + "catch" + ], + "requireSpaceAfterKeywords": [ + "if", "else", "for", "while", "do", "switch", + "return", "try", "catch" + ], + "requireSpaceBeforeBlockStatements": true, + "requireParenthesesAroundIIFE": true, + "requireSpacesInConditionalExpression": true, + "requireSpacesInAnonymousFunctionExpression": { + "beforeOpeningRoundBrace": true, + "beforeOpeningCurlyBrace": true + }, + "requireSpacesInNamedFunctionExpression": { + "beforeOpeningCurlyBrace": true + }, + "disallowSpacesInNamedFunctionExpression": { + "beforeOpeningRoundBrace": true + }, + "requireSpacesInFunctionDeclaration": { + "beforeOpeningCurlyBrace": true + }, + "disallowSpacesInFunctionDeclaration": { + "beforeOpeningRoundBrace": true + }, + "disallowMultipleVarDecl": true, + "requireBlocksOnNewline": true, + "disallowEmptyBlocks": true, + "requireSpacesInsideObjectBrackets": "allButNested", + "requireSpacesInsideArrayBrackets": "allButNested", + "disallowQuotedKeysInObjects": "allButReserved", + "disallowSpaceAfterObjectKeys": true, + "requireCommaBeforeLineBreak": true, + "requireOperatorBeforeLineBreak": true, + "disallowSpaceAfterPrefixUnaryOperators": true, + "disallowSpaceBeforePostfixUnaryOperators": true, + "requireSpaceBeforeBinaryOperators": true, + "requireSpaceAfterBinaryOperators": true, + "disallowImplicitTypeConversion": [ + "binary" + ], + "requireCamelCaseOrUpperCaseIdentifiers": true, + "disallowKeywords": [ + "with" + ], + "disallowMultipleLineStrings": true, + "disallowMultipleLineBreaks": true, + "validateQuoteMarks": { + "mark": "'", + "escape": true + }, + "validateIndentation": "\t", + "disallowMixedSpacesAndTabs": "smart", + "disallowTrailingWhitespace": true, + "disallowTrailingComma": true, + "requireKeywordsOnNewLine": [ + "else" + ], + "requireLineFeedAtFileEnd": true, + "maximumLineLength": 120, + "requireCapitalizedConstructors": true, + "requireDotNotation": true, + "disallowYodaConditions": true, + "requireSpaceAfterLineComment": true +} \ No newline at end of file diff --git a/jshintrc.symlink b/jshintrc.symlink new file mode 100644 index 0000000..248076c --- /dev/null +++ b/jshintrc.symlink @@ -0,0 +1,68 @@ +{ + "asi": false, + "bitwise": false, + "boss": false, + "browser": true, + "camelcase": true, + "couch": false, + "curly": true, + "debug": false, + "devel": true, + "dojo": false, + "eqeqeq": true, + "eqnull": true, + "esversion": 6, + "evil": false, + "expr": true, + "forin": false, + "funcscope": true, + "globalstrict": false, + "immed": true, + "iterator": false, + "jquery": false, + "lastsemic": false, + "latedef": false, + "laxbreak": true, + "laxcomma": false, + "loopfunc": true, + "mootools": false, + "multistr": false, + "newcap": true, + "noarg": true, + "node": false, + "noempty": false, + "nonew": true, + "nonstandard": false, + "nomen": false, + "onecase": false, + "onevar": false, + "passfail": false, + "plusplus": false, + "proto": false, + "prototypejs": false, + "regexdash": true, + "regexp": false, + "rhino": false, + "undef": true, + "unused": true, + "scripturl": true, + "shadow": false, + "smarttabs": true, + "strict": false, + "sub": false, + "supernew": false, + "trailing": true, + "validthis": true, + "withstmt": false, + "white": true, + "worker": false, + "wsh": false, + "yui": false, + "indent": 4, + "globals": { + "require": true, + "define": true + }, + "quotmark": true, + "maxcomplexity": 10 +} diff --git a/nvim/after/plugin/autoreadwatch.vim b/nvim/after/plugin/autoreadwatch.vim new file mode 100644 index 0000000..b85693e --- /dev/null +++ b/nvim/after/plugin/autoreadwatch.vim @@ -0,0 +1,5 @@ +" ----------------- +" vim-autoreadwatch +" ----------------- + +:silent! WatchForChangesAllFile diff --git a/nvim/after/plugin/tabular_extra.vim b/nvim/after/plugin/tabular_extra.vim new file mode 100644 index 0000000..a5c0501 --- /dev/null +++ b/nvim/after/plugin/tabular_extra.vim @@ -0,0 +1,19 @@ +if exists(':Tabularize') +" Make line wrapping possible by resetting the 'cpo' option, first saving it +let s:save_cpo = &cpo +set cpo&vim + +" Patterns from +" http://git.io/tCXofg +" http://vimcasts.org/episodes/aligning-text-with-tabular-vim/ +AddTabularPattern hash /:\zs +AddTabularPattern hash_rocket /=> +AddTabularPattern json /: +AddTabularPattern symbol /:/l1c0 +AddTabularPattern equals /= +AddTabularPattern comma /,\zs + +" Restore the saved value of 'cpo' +let &cpo = s:save_cpo +unlet s:save_cpo +endif diff --git a/nvim/autocmds.vim b/nvim/autocmds.vim new file mode 100644 index 0000000..af53b06 --- /dev/null +++ b/nvim/autocmds.vim @@ -0,0 +1,80 @@ +" ---------------------------------------- +" Auto Commands +" ---------------------------------------- + +if has('autocmd') + augroup MyAutoCommands + " Clear the auto command group so we don't define it multiple times + " Idea from http://learnvimscriptthehardway.stevelosh.com/chapters/14.html + autocmd! + " No formatting on o key newlines + autocmd BufNewFile,BufEnter * set formatoptions-=o + + " No more complaining about untitled documents + autocmd FocusLost silent! :wa + + " When editing a file, always jump to the last cursor position. + " This must be after the uncompress commands. + autocmd BufReadPost * + \ if line("'\"") > 1 && line ("'\"") <= line("$") | + \ exe "normal! g`\"" | + \ endif + + " Fix trailing whitespace in my most used programming langauges + autocmd BufWritePre *.py,*.coffee,*.rb,*.erb,*.md,*.scss,*.vim,Cakefile, + \*.hbs + \ silent! :StripTrailingWhiteSpace + + " Help mode bindings + " to follow tag, to go back, and q to quit. + " From http://ctoomey.com/posts/an-incremental-approach-to-vim/ + autocmd filetype help nnoremap + autocmd filetype help nnoremap + autocmd filetype help nnoremap q :q + + " Fix accidental indentation in html files + " from http://morearty.com/blog/2013/01/22/fixing-vims-indenting-of-html-files.html + autocmd FileType html setlocal indentkeys-=* + + " Leave the return key alone when in command line windows, since it's used + " to run commands there. + autocmd! CmdwinEnter * :unmap + autocmd! CmdwinLeave * :call MapCR() + + " Resize splits when the window is resized + " from https://bitbucket.org/sjl/dotfiles/src/tip/vim/vimrc + au VimResized * :wincmd = + + + + " Remove trailing whitespaces and ^M chars + " To disable the stripping of whitespace, add the following to your + " .vimrc.before.local file: + " let g:ms_vim_keep_trailing_whitespace = 1 + autocmd FileType c,cpp,java,go,php,javascript,puppet,python,rust,twig,xml,yml,perl,sql,html,css autocmd BufWritePre if !exists('g:ms_vim_keep_trailing_whitespace') | call StripTrailingWhitespace() | endif + + + autocmd BufNewFile,BufRead *.coffee set filetype=coffee + + " Workaround vim-commentary for Haskell + autocmd FileType haskell setlocal commentstring=--\ %s + " Workaround broken colour highlighting in Haskell + autocmd FileType haskell,rust setlocal nospell + + " Close Vim if NERDTree is the last buffer + autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") + \&& b:NERDTreeType == "primary") | q | endif + + autocmd BufWinLeave *.* mkview! + autocmd BufWinEnter *.* silent loadview + autocmd BufWritePost * :silent! :syntax sync fromstart:redraw! + autocmd GUIEnter * set visualbell t_vb= + augroup END + + if !exists('g:ms_vim_no_restore_cursor') + augroup resCur + autocmd! + autocmd BufWinEnter * call ResCur() + augroup END + endif +endif diff --git a/nvim/autoload/plug.vim b/nvim/autoload/plug.vim new file mode 100644 index 0000000..b245aa7 --- /dev/null +++ b/nvim/autoload/plug.vim @@ -0,0 +1,2426 @@ +" vim-plug: Vim plugin manager +" ============================ +" +" Download plug.vim and put it in ~/.vim/autoload +" +" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ +" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +" +" Edit your .vimrc +" +" call plug#begin('~/.vim/plugged') +" +" " Make sure you use single quotes +" +" " Shorthand notation; fetches https://github.com/junegunn/vim-easy-align +" Plug 'junegunn/vim-easy-align' +" +" " Any valid git URL is allowed +" Plug 'https://github.com/junegunn/vim-github-dashboard.git' +" +" " Multiple Plug commands can be written in a single line using | separators +" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' +" +" " On-demand loading +" Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } +" Plug 'tpope/vim-fireplace', { 'for': 'clojure' } +" +" " Using a non-master branch +" Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' } +" +" " Using a tagged release; wildcard allowed (requires git 1.9.2 or above) +" Plug 'fatih/vim-go', { 'tag': '*' } +" +" " Plugin options +" Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' } +" +" " Plugin outside ~/.vim/plugged with post-update hook +" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } +" +" " Unmanaged plugin (manually installed and updated) +" Plug '~/my-prototype-plugin' +" +" " Initialize plugin system +" call plug#end() +" +" Then reload .vimrc and :PlugInstall to install plugins. +" +" Plug options: +" +"| Option | Description | +"| ----------------------- | ------------------------------------------------ | +"| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use | +"| `rtp` | Subdirectory that contains Vim plugin | +"| `dir` | Custom directory for the plugin | +"| `as` | Use different name for the plugin | +"| `do` | Post-update hook (string or funcref) | +"| `on` | On-demand loading: Commands or ``-mappings | +"| `for` | On-demand loading: File types | +"| `frozen` | Do not update unless explicitly specified | +" +" More information: https://github.com/junegunn/vim-plug +" +" +" Copyright (c) 2016 Junegunn Choi +" +" MIT License +" +" Permission is hereby granted, free of charge, to any person obtaining +" a copy of this software and associated documentation files (the +" "Software"), to deal in the Software without restriction, including +" without limitation the rights to use, copy, modify, merge, publish, +" distribute, sublicense, and/or sell copies of the Software, and to +" permit persons to whom the Software is furnished to do so, subject to +" the following conditions: +" +" The above copyright notice and this permission notice shall be +" included in all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +if exists('g:loaded_plug') + finish +endif +let g:loaded_plug = 1 + +let s:cpo_save = &cpo +set cpo&vim + +let s:plug_src = 'https://github.com/junegunn/vim-plug.git' +let s:plug_tab = get(s:, 'plug_tab', -1) +let s:plug_buf = get(s:, 'plug_buf', -1) +let s:mac_gui = has('gui_macvim') && has('gui_running') +let s:is_win = has('win32') || has('win64') +let s:nvim = has('nvim') && exists('*jobwait') && !s:is_win +let s:vim8 = has('patch-8.0.0039') && exists('*job_start') +let s:me = resolve(expand(':p')) +let s:base_spec = { 'branch': 'master', 'frozen': 0 } +let s:TYPE = { +\ 'string': type(''), +\ 'list': type([]), +\ 'dict': type({}), +\ 'funcref': type(function('call')) +\ } +let s:loaded = get(s:, 'loaded', {}) +let s:triggers = get(s:, 'triggers', {}) + +function! plug#begin(...) + if a:0 > 0 + let s:plug_home_org = a:1 + let home = s:path(fnamemodify(expand(a:1), ':p')) + elseif exists('g:plug_home') + let home = s:path(g:plug_home) + elseif !empty(&rtp) + let home = s:path(split(&rtp, ',')[0]) . '/plugged' + else + return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.') + endif + + let g:plug_home = home + let g:plugs = {} + let g:plugs_order = [] + let s:triggers = {} + + call s:define_commands() + return 1 +endfunction + +function! s:define_commands() + command! -nargs=+ -bar Plug call plug#() + if !executable('git') + return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.') + endif + command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install(0, []) + command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update(0, []) + command! -nargs=0 -bar -bang PlugClean call s:clean(0) + command! -nargs=0 -bar PlugUpgrade if s:upgrade() | execute 'source' s:esc(s:me) | endif + command! -nargs=0 -bar PlugStatus call s:status() + command! -nargs=0 -bar PlugDiff call s:diff() + command! -nargs=? -bar -bang -complete=file PlugSnapshot call s:snapshot(0, ) +endfunction + +function! s:to_a(v) + return type(a:v) == s:TYPE.list ? a:v : [a:v] +endfunction + +function! s:to_s(v) + return type(a:v) == s:TYPE.string ? a:v : join(a:v, "\n") . "\n" +endfunction + +function! s:glob(from, pattern) + return s:lines(globpath(a:from, a:pattern)) +endfunction + +function! s:source(from, ...) + let found = 0 + for pattern in a:000 + for vim in s:glob(a:from, pattern) + execute 'source' s:esc(vim) + let found = 1 + endfor + endfor + return found +endfunction + +function! s:assoc(dict, key, val) + let a:dict[a:key] = add(get(a:dict, a:key, []), a:val) +endfunction + +function! s:ask(message, ...) + call inputsave() + echohl WarningMsg + let answer = input(a:message.(a:0 ? ' (y/N/a) ' : ' (y/N) ')) + echohl None + call inputrestore() + echo "\r" + return (a:0 && answer =~? '^a') ? 2 : (answer =~? '^y') ? 1 : 0 +endfunction + +function! s:ask_no_interrupt(...) + try + return call('s:ask', a:000) + catch + return 0 + endtry +endfunction + +function! plug#end() + if !exists('g:plugs') + return s:err('Call plug#begin() first') + endif + + if exists('#PlugLOD') + augroup PlugLOD + autocmd! + augroup END + augroup! PlugLOD + endif + let lod = { 'ft': {}, 'map': {}, 'cmd': {} } + + if exists('g:did_load_filetypes') + filetype off + endif + for name in g:plugs_order + if !has_key(g:plugs, name) + continue + endif + let plug = g:plugs[name] + if get(s:loaded, name, 0) || !has_key(plug, 'on') && !has_key(plug, 'for') + let s:loaded[name] = 1 + continue + endif + + if has_key(plug, 'on') + let s:triggers[name] = { 'map': [], 'cmd': [] } + for cmd in s:to_a(plug.on) + if cmd =~? '^.\+' + if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i')) + call s:assoc(lod.map, cmd, name) + endif + call add(s:triggers[name].map, cmd) + elseif cmd =~# '^[A-Z]' + let cmd = substitute(cmd, '!*$', '', '') + if exists(':'.cmd) != 2 + call s:assoc(lod.cmd, cmd, name) + endif + call add(s:triggers[name].cmd, cmd) + else + call s:err('Invalid `on` option: '.cmd. + \ '. Should start with an uppercase letter or ``.') + endif + endfor + endif + + if has_key(plug, 'for') + let types = s:to_a(plug.for) + if !empty(types) + augroup filetypedetect + call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim') + augroup END + endif + for type in types + call s:assoc(lod.ft, type, name) + endfor + endif + endfor + + for [cmd, names] in items(lod.cmd) + execute printf( + \ 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "", , , , %s)', + \ cmd, string(cmd), string(names)) + endfor + + for [map, names] in items(lod.map) + for [mode, map_prefix, key_prefix] in + \ [['i', '', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']] + execute printf( + \ '%snoremap %s %s:call lod_map(%s, %s, %s, "%s")', + \ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix) + endfor + endfor + + for [ft, names] in items(lod.ft) + augroup PlugLOD + execute printf('autocmd FileType %s call lod_ft(%s, %s)', + \ ft, string(ft), string(names)) + augroup END + endfor + + call s:reorg_rtp() + filetype plugin indent on + if has('vim_starting') + if has('syntax') && !exists('g:syntax_on') + syntax enable + end + else + call s:reload_plugins() + endif +endfunction + +function! s:loaded_names() + return filter(copy(g:plugs_order), 'get(s:loaded, v:val, 0)') +endfunction + +function! s:load_plugin(spec) + call s:source(s:rtp(a:spec), 'plugin/**/*.vim', 'after/plugin/**/*.vim') +endfunction + +function! s:reload_plugins() + for name in s:loaded_names() + call s:load_plugin(g:plugs[name]) + endfor +endfunction + +function! s:trim(str) + return substitute(a:str, '[\/]\+$', '', '') +endfunction + +function! s:version_requirement(val, min) + for idx in range(0, len(a:min) - 1) + let v = get(a:val, idx, 0) + if v < a:min[idx] | return 0 + elseif v > a:min[idx] | return 1 + endif + endfor + return 1 +endfunction + +function! s:git_version_requirement(...) + if !exists('s:git_version') + let s:git_version = map(split(split(s:system('git --version'))[2], '\.'), 'str2nr(v:val)') + endif + return s:version_requirement(s:git_version, a:000) +endfunction + +function! s:progress_opt(base) + return a:base && !s:is_win && + \ s:git_version_requirement(1, 7, 1) ? '--progress' : '' +endfunction + +if s:is_win + function! s:rtp(spec) + return s:path(a:spec.dir . get(a:spec, 'rtp', '')) + endfunction + + function! s:path(path) + return s:trim(substitute(a:path, '/', '\', 'g')) + endfunction + + function! s:dirpath(path) + return s:path(a:path) . '\' + endfunction + + function! s:is_local_plug(repo) + return a:repo =~? '^[a-z]:\|^[%~]' + endfunction +else + function! s:rtp(spec) + return s:dirpath(a:spec.dir . get(a:spec, 'rtp', '')) + endfunction + + function! s:path(path) + return s:trim(a:path) + endfunction + + function! s:dirpath(path) + return substitute(a:path, '[/\\]*$', '/', '') + endfunction + + function! s:is_local_plug(repo) + return a:repo[0] =~ '[/$~]' + endfunction +endif + +function! s:err(msg) + echohl ErrorMsg + echom '[vim-plug] '.a:msg + echohl None +endfunction + +function! s:warn(cmd, msg) + echohl WarningMsg + execute a:cmd 'a:msg' + echohl None +endfunction + +function! s:esc(path) + return escape(a:path, ' ') +endfunction + +function! s:escrtp(path) + return escape(a:path, ' ,') +endfunction + +function! s:remove_rtp() + for name in s:loaded_names() + let rtp = s:rtp(g:plugs[name]) + execute 'set rtp-='.s:escrtp(rtp) + let after = globpath(rtp, 'after') + if isdirectory(after) + execute 'set rtp-='.s:escrtp(after) + endif + endfor +endfunction + +function! s:reorg_rtp() + if !empty(s:first_rtp) + execute 'set rtp-='.s:first_rtp + execute 'set rtp-='.s:last_rtp + endif + + " &rtp is modified from outside + if exists('s:prtp') && s:prtp !=# &rtp + call s:remove_rtp() + unlet! s:middle + endif + + let s:middle = get(s:, 'middle', &rtp) + let rtps = map(s:loaded_names(), 's:rtp(g:plugs[v:val])') + let afters = filter(map(copy(rtps), 'globpath(v:val, "after")'), '!empty(v:val)') + let rtp = join(map(rtps, 'escape(v:val, ",")'), ',') + \ . ','.s:middle.',' + \ . join(map(afters, 'escape(v:val, ",")'), ',') + let &rtp = substitute(substitute(rtp, ',,*', ',', 'g'), '^,\|,$', '', 'g') + let s:prtp = &rtp + + if !empty(s:first_rtp) + execute 'set rtp^='.s:first_rtp + execute 'set rtp+='.s:last_rtp + endif +endfunction + +function! s:doautocmd(...) + if exists('#'.join(a:000, '#')) + execute 'doautocmd' ((v:version > 703 || has('patch442')) ? '' : '') join(a:000) + endif +endfunction + +function! s:dobufread(names) + for name in a:names + let path = s:rtp(g:plugs[name]).'/**' + for dir in ['ftdetect', 'ftplugin'] + if len(finddir(dir, path)) + return s:doautocmd('BufRead') + endif + endfor + endfor +endfunction + +function! plug#load(...) + if a:0 == 0 + return s:err('Argument missing: plugin name(s) required') + endif + if !exists('g:plugs') + return s:err('plug#begin was not called') + endif + let unknowns = filter(copy(a:000), '!has_key(g:plugs, v:val)') + if !empty(unknowns) + let s = len(unknowns) > 1 ? 's' : '' + return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', '))) + end + for name in a:000 + call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) + endfor + call s:dobufread(a:000) + return 1 +endfunction + +function! s:remove_triggers(name) + if !has_key(s:triggers, a:name) + return + endif + for cmd in s:triggers[a:name].cmd + execute 'silent! delc' cmd + endfor + for map in s:triggers[a:name].map + execute 'silent! unmap' map + execute 'silent! iunmap' map + endfor + call remove(s:triggers, a:name) +endfunction + +function! s:lod(names, types, ...) + for name in a:names + call s:remove_triggers(name) + let s:loaded[name] = 1 + endfor + call s:reorg_rtp() + + for name in a:names + let rtp = s:rtp(g:plugs[name]) + for dir in a:types + call s:source(rtp, dir.'/**/*.vim') + endfor + if a:0 + if !s:source(rtp, a:1) && !empty(s:glob(rtp, a:2)) + execute 'runtime' a:1 + endif + call s:source(rtp, a:2) + endif + call s:doautocmd('User', name) + endfor +endfunction + +function! s:lod_ft(pat, names) + let syn = 'syntax/'.a:pat.'.vim' + call s:lod(a:names, ['plugin', 'after/plugin'], syn, 'after/'.syn) + execute 'autocmd! PlugLOD FileType' a:pat + call s:doautocmd('filetypeplugin', 'FileType') + call s:doautocmd('filetypeindent', 'FileType') +endfunction + +function! s:lod_cmd(cmd, bang, l1, l2, args, names) + call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) + call s:dobufread(a:names) + execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) +endfunction + +function! s:lod_map(map, names, with_prefix, prefix) + call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) + call s:dobufread(a:names) + let extra = '' + while 1 + let c = getchar(0) + if c == 0 + break + endif + let extra .= nr2char(c) + endwhile + + if a:with_prefix + let prefix = v:count ? v:count : '' + let prefix .= '"'.v:register.a:prefix + if mode(1) == 'no' + if v:operator == 'c' + let prefix = "\" . prefix + endif + let prefix .= v:operator + endif + call feedkeys(prefix, 'n') + endif + call feedkeys(substitute(a:map, '^', "\", '') . extra) +endfunction + +function! plug#(repo, ...) + if a:0 > 1 + return s:err('Invalid number of arguments (1..2)') + endif + + try + let repo = s:trim(a:repo) + let opts = a:0 == 1 ? s:parse_options(a:1) : s:base_spec + let name = get(opts, 'as', fnamemodify(repo, ':t:s?\.git$??')) + let spec = extend(s:infer_properties(name, repo), opts) + if !has_key(g:plugs, name) + call add(g:plugs_order, name) + endif + let g:plugs[name] = spec + let s:loaded[name] = get(s:loaded, name, 0) + catch + return s:err(v:exception) + endtry +endfunction + +function! s:parse_options(arg) + let opts = copy(s:base_spec) + let type = type(a:arg) + if type == s:TYPE.string + let opts.tag = a:arg + elseif type == s:TYPE.dict + call extend(opts, a:arg) + if has_key(opts, 'dir') + let opts.dir = s:dirpath(expand(opts.dir)) + endif + else + throw 'Invalid argument type (expected: string or dictionary)' + endif + return opts +endfunction + +function! s:infer_properties(name, repo) + let repo = a:repo + if s:is_local_plug(repo) + return { 'dir': s:dirpath(expand(repo)) } + else + if repo =~ ':' + let uri = repo + else + if repo !~ '/' + let repo = 'vim-scripts/'. repo + endif + let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git') + let uri = printf(fmt, repo) + endif + return { 'dir': s:dirpath(g:plug_home.'/'.a:name), 'uri': uri } + endif +endfunction + +function! s:install(force, names) + call s:update_impl(0, a:force, a:names) +endfunction + +function! s:update(force, names) + call s:update_impl(1, a:force, a:names) +endfunction + +function! plug#helptags() + if !exists('g:plugs') + return s:err('plug#begin was not called') + endif + for spec in values(g:plugs) + let docd = join([spec.dir, 'doc'], '/') + if isdirectory(docd) + silent! execute 'helptags' s:esc(docd) + endif + endfor + return 1 +endfunction + +function! s:syntax() + syntax clear + syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber + syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX + syn match plugNumber /[0-9]\+[0-9.]*/ contained + syn match plugBracket /[[\]]/ contained + syn match plugX /x/ contained + syn match plugDash /^-/ + syn match plugPlus /^+/ + syn match plugStar /^*/ + syn match plugMessage /\(^- \)\@<=.*/ + syn match plugName /\(^- \)\@<=[^ ]*:/ + syn match plugSha /\%(: \)\@<=[0-9a-f]\{4,}$/ + syn match plugTag /(tag: [^)]\+)/ + syn match plugInstall /\(^+ \)\@<=[^:]*/ + syn match plugUpdate /\(^* \)\@<=[^:]*/ + syn match plugCommit /^ \X*[0-9a-f]\{7} .*/ contains=plugRelDate,plugEdge,plugTag + syn match plugEdge /^ \X\+$/ + syn match plugEdge /^ \X*/ contained nextgroup=plugSha + syn match plugSha /[0-9a-f]\{7}/ contained + syn match plugRelDate /([^)]*)$/ contained + syn match plugNotLoaded /(not loaded)$/ + syn match plugError /^x.*/ + syn region plugDeleted start=/^\~ .*/ end=/^\ze\S/ + syn match plugH2 /^.*:\n-\+$/ + syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean + hi def link plug1 Title + hi def link plug2 Repeat + hi def link plugH2 Type + hi def link plugX Exception + hi def link plugBracket Structure + hi def link plugNumber Number + + hi def link plugDash Special + hi def link plugPlus Constant + hi def link plugStar Boolean + + hi def link plugMessage Function + hi def link plugName Label + hi def link plugInstall Function + hi def link plugUpdate Type + + hi def link plugError Error + hi def link plugDeleted Ignore + hi def link plugRelDate Comment + hi def link plugEdge PreProc + hi def link plugSha Identifier + hi def link plugTag Constant + + hi def link plugNotLoaded Comment +endfunction + +function! s:lpad(str, len) + return a:str . repeat(' ', a:len - len(a:str)) +endfunction + +function! s:lines(msg) + return split(a:msg, "[\r\n]") +endfunction + +function! s:lastline(msg) + return get(s:lines(a:msg), -1, '') +endfunction + +function! s:new_window() + execute get(g:, 'plug_window', 'vertical topleft new') +endfunction + +function! s:plug_window_exists() + let buflist = tabpagebuflist(s:plug_tab) + return !empty(buflist) && index(buflist, s:plug_buf) >= 0 +endfunction + +function! s:switch_in() + if !s:plug_window_exists() + return 0 + endif + + if winbufnr(0) != s:plug_buf + let s:pos = [tabpagenr(), winnr(), winsaveview()] + execute 'normal!' s:plug_tab.'gt' + let winnr = bufwinnr(s:plug_buf) + execute winnr.'wincmd w' + call add(s:pos, winsaveview()) + else + let s:pos = [winsaveview()] + endif + + setlocal modifiable + return 1 +endfunction + +function! s:switch_out(...) + call winrestview(s:pos[-1]) + setlocal nomodifiable + if a:0 > 0 + execute a:1 + endif + + if len(s:pos) > 1 + execute 'normal!' s:pos[0].'gt' + execute s:pos[1] 'wincmd w' + call winrestview(s:pos[2]) + endif +endfunction + +function! s:finish_bindings() + nnoremap R :call retry() + nnoremap D :PlugDiff + nnoremap S :PlugStatus + nnoremap U :call status_update() + xnoremap U :call status_update() + nnoremap ]] :silent! call section('') + nnoremap [[ :silent! call section('b') +endfunction + +function! s:prepare(...) + if empty(getcwd()) + throw 'Invalid current working directory. Cannot proceed.' + endif + + for evar in ['$GIT_DIR', '$GIT_WORK_TREE'] + if exists(evar) + throw evar.' detected. Cannot proceed.' + endif + endfor + + call s:job_abort() + if s:switch_in() + if b:plug_preview == 1 + pc + endif + enew + else + call s:new_window() + endif + + nnoremap q :if b:plug_preview==1pcendifbd + if a:0 == 0 + call s:finish_bindings() + endif + let b:plug_preview = -1 + let s:plug_tab = tabpagenr() + let s:plug_buf = winbufnr(0) + call s:assign_name() + + for k in ['', 'L', 'o', 'X', 'd', 'dd'] + execute 'silent! unmap ' k + endfor + setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline modifiable nospell + setf vim-plug + if exists('g:syntax_on') + call s:syntax() + endif +endfunction + +function! s:assign_name() + " Assign buffer name + let prefix = '[Plugins]' + let name = prefix + let idx = 2 + while bufexists(name) + let name = printf('%s (%s)', prefix, idx) + let idx = idx + 1 + endwhile + silent! execute 'f' fnameescape(name) +endfunction + +function! s:chsh(swap) + let prev = [&shell, &shellredir] + if !s:is_win && a:swap + set shell=sh shellredir=>%s\ 2>&1 + endif + return prev +endfunction + +function! s:bang(cmd, ...) + try + let [sh, shrd] = s:chsh(a:0) + " FIXME: Escaping is incomplete. We could use shellescape with eval, + " but it won't work on Windows. + let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd + let g:_plug_bang = '!'.escape(cmd, '#!%') + execute "normal! :execute g:_plug_bang\\" + finally + unlet g:_plug_bang + let [&shell, &shellredir] = [sh, shrd] + endtry + return v:shell_error ? 'Exit status: ' . v:shell_error : '' +endfunction + +function! s:regress_bar() + let bar = substitute(getline(2)[1:-2], '.*\zs=', 'x', '') + call s:progress_bar(2, bar, len(bar)) +endfunction + +function! s:is_updated(dir) + return !empty(s:system_chomp('git log --pretty=format:"%h" "HEAD...HEAD@{1}"', a:dir)) +endfunction + +function! s:do(pull, force, todo) + for [name, spec] in items(a:todo) + if !isdirectory(spec.dir) + continue + endif + let installed = has_key(s:update.new, name) + let updated = installed ? 0 : + \ (a:pull && index(s:update.errors, name) < 0 && s:is_updated(spec.dir)) + if a:force || installed || updated + execute 'cd' s:esc(spec.dir) + call append(3, '- Post-update hook for '. name .' ... ') + let error = '' + let type = type(spec.do) + if type == s:TYPE.string + if spec.do[0] == ':' + call s:load_plugin(spec) + try + execute spec.do[1:] + catch + let error = v:exception + endtry + if !s:plug_window_exists() + cd - + throw 'Warning: vim-plug was terminated by the post-update hook of '.name + endif + else + let error = s:bang(spec.do) + endif + elseif type == s:TYPE.funcref + try + let status = installed ? 'installed' : (updated ? 'updated' : 'unchanged') + call spec.do({ 'name': name, 'status': status, 'force': a:force }) + catch + let error = v:exception + endtry + else + let error = 'Invalid hook type' + endif + call s:switch_in() + call setline(4, empty(error) ? (getline(4) . 'OK') + \ : ('x' . getline(4)[1:] . error)) + if !empty(error) + call add(s:update.errors, name) + call s:regress_bar() + endif + cd - + endif + endfor +endfunction + +function! s:hash_match(a, b) + return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0 +endfunction + +function! s:checkout(spec) + let sha = a:spec.commit + let output = s:system('git rev-parse HEAD', a:spec.dir) + if !v:shell_error && !s:hash_match(sha, s:lines(output)[0]) + let output = s:system( + \ 'git fetch --depth 999999 && git checkout '.s:esc(sha), a:spec.dir) + endif + return output +endfunction + +function! s:finish(pull) + let new_frozen = len(filter(keys(s:update.new), 'g:plugs[v:val].frozen')) + if new_frozen + let s = new_frozen > 1 ? 's' : '' + call append(3, printf('- Installed %d frozen plugin%s', new_frozen, s)) + endif + call append(3, '- Finishing ... ') | 4 + redraw + call plug#helptags() + call plug#end() + call setline(4, getline(4) . 'Done!') + redraw + let msgs = [] + if !empty(s:update.errors) + call add(msgs, "Press 'R' to retry.") + endif + if a:pull && len(s:update.new) < len(filter(getline(5, '$'), + \ "v:val =~ '^- ' && stridx(v:val, 'Already up-to-date') < 0")) + call add(msgs, "Press 'D' to see the updated changes.") + endif + echo join(msgs, ' ') + call s:finish_bindings() +endfunction + +function! s:retry() + if empty(s:update.errors) + return + endif + echo + call s:update_impl(s:update.pull, s:update.force, + \ extend(copy(s:update.errors), [s:update.threads])) +endfunction + +function! s:is_managed(name) + return has_key(g:plugs[a:name], 'uri') +endfunction + +function! s:names(...) + return sort(filter(keys(g:plugs), 'stridx(v:val, a:1) == 0 && s:is_managed(v:val)')) +endfunction + +function! s:check_ruby() + silent! ruby require 'thread'; VIM::command("let g:plug_ruby = '#{RUBY_VERSION}'") + if !exists('g:plug_ruby') + redraw! + return s:warn('echom', 'Warning: Ruby interface is broken') + endif + let ruby_version = split(g:plug_ruby, '\.') + unlet g:plug_ruby + return s:version_requirement(ruby_version, [1, 8, 7]) +endfunction + +function! s:update_impl(pull, force, args) abort + let args = copy(a:args) + let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ? + \ remove(args, -1) : get(g:, 'plug_threads', 16) + + let managed = filter(copy(g:plugs), 's:is_managed(v:key)') + let todo = empty(args) ? filter(managed, '!v:val.frozen || !isdirectory(v:val.dir)') : + \ filter(managed, 'index(args, v:key) >= 0') + + if empty(todo) + return s:warn('echo', 'No plugin to '. (a:pull ? 'update' : 'install')) + endif + + if !s:is_win && s:git_version_requirement(2, 3) + let s:git_terminal_prompt = exists('$GIT_TERMINAL_PROMPT') ? $GIT_TERMINAL_PROMPT : '' + let $GIT_TERMINAL_PROMPT = 0 + for plug in values(todo) + let plug.uri = substitute(plug.uri, + \ '^https://git::@github\.com', 'https://github.com', '') + endfor + endif + + if !isdirectory(g:plug_home) + try + call mkdir(g:plug_home, 'p') + catch + return s:err(printf('Invalid plug directory: %s. '. + \ 'Try to call plug#begin with a valid directory', g:plug_home)) + endtry + endif + + if has('nvim') && !exists('*jobwait') && threads > 1 + call s:warn('echom', '[vim-plug] Update Neovim for parallel installer') + endif + + let use_job = s:nvim || s:vim8 + let python = (has('python') || has('python3')) && !use_job + let ruby = has('ruby') && !use_job && (v:version >= 703 || v:version == 702 && has('patch374')) && !(s:is_win && has('gui_running')) && threads > 1 && s:check_ruby() + + let s:update = { + \ 'start': reltime(), + \ 'all': todo, + \ 'todo': copy(todo), + \ 'errors': [], + \ 'pull': a:pull, + \ 'force': a:force, + \ 'new': {}, + \ 'threads': (python || ruby || use_job) ? min([len(todo), threads]) : 1, + \ 'bar': '', + \ 'fin': 0 + \ } + + call s:prepare(1) + call append(0, ['', '']) + normal! 2G + silent! redraw + + let s:clone_opt = get(g:, 'plug_shallow', 1) ? + \ '--depth 1' . (s:git_version_requirement(1, 7, 10) ? ' --no-single-branch' : '') : '' + + " Python version requirement (>= 2.7) + if python && !has('python3') && !ruby && !use_job && s:update.threads > 1 + redir => pyv + silent python import platform; print platform.python_version() + redir END + let python = s:version_requirement( + \ map(split(split(pyv)[0], '\.'), 'str2nr(v:val)'), [2, 6]) + endif + + if (python || ruby) && s:update.threads > 1 + try + let imd = &imd + if s:mac_gui + set noimd + endif + if ruby + call s:update_ruby() + else + call s:update_python() + endif + catch + let lines = getline(4, '$') + let printed = {} + silent! 4,$d _ + for line in lines + let name = s:extract_name(line, '.', '') + if empty(name) || !has_key(printed, name) + call append('$', line) + if !empty(name) + let printed[name] = 1 + if line[0] == 'x' && index(s:update.errors, name) < 0 + call add(s:update.errors, name) + end + endif + endif + endfor + finally + let &imd = imd + call s:update_finish() + endtry + else + call s:update_vim() + while use_job && has('vim_starting') + sleep 100m + if s:update.fin + break + endif + endwhile + endif +endfunction + +function! s:log4(name, msg) + call setline(4, printf('- %s (%s)', a:msg, a:name)) + redraw +endfunction + +function! s:update_finish() + if exists('s:git_terminal_prompt') + let $GIT_TERMINAL_PROMPT = s:git_terminal_prompt + endif + if s:switch_in() + call append(3, '- Updating ...') | 4 + 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))')) + let [pos, _] = s:logpos(name) + if !pos + continue + endif + if has_key(spec, 'commit') + call s:log4(name, 'Checking out '.spec.commit) + let out = s:checkout(spec) + elseif has_key(spec, 'tag') + let tag = spec.tag + if tag =~ '\*' + let tags = s:lines(s:system('git tag --list '.string(tag).' --sort -version:refname 2>&1', spec.dir)) + if !v:shell_error && !empty(tags) + let tag = tags[0] + call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag)) + call append(3, '') + endif + endif + call s:log4(name, 'Checking out '.tag) + let out = s:system('git checkout -q '.s:esc(tag).' 2>&1', spec.dir) + else + let branch = s:esc(get(spec, 'branch', 'master')) + call s:log4(name, 'Merging origin/'.branch) + let out = s:system('git checkout -q '.branch.' 2>&1' + \. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only origin/'.branch.' 2>&1')), spec.dir) + endif + if !v:shell_error && filereadable(spec.dir.'/.gitmodules') && + \ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir)) + call s:log4(name, 'Updating submodules. This may take a while.') + let out .= s:bang('git submodule update --init --recursive 2>&1', spec.dir) + endif + let msg = s:format_message(v:shell_error ? 'x': '-', name, out) + if v:shell_error + call add(s:update.errors, name) + call s:regress_bar() + silent execute pos 'd _' + call append(4, msg) | 4 + elseif !empty(out) + call setline(pos, msg[0]) + endif + redraw + endfor + silent 4 d _ + try + 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")')) + catch + call s:warn('echom', v:exception) + call s:warn('echo', '') + return + endtry + call s:finish(s:update.pull) + call setline(1, 'Updated. Elapsed time: ' . split(reltimestr(reltime(s:update.start)))[0] . ' sec.') + call s:switch_out('normal! gg') + endif +endfunction + +function! s:job_abort() + if (!s:nvim && !s:vim8) || !exists('s:jobs') + return + endif + + for [name, j] in items(s:jobs) + if s:nvim + silent! call jobstop(j.jobid) + elseif s:vim8 + silent! call job_stop(j.jobid) + endif + if j.new + call s:system('rm -rf ' . s:shellesc(g:plugs[name].dir)) + endif + endfor + let s:jobs = {} +endfunction + +function! s:last_non_empty_line(lines) + let len = len(a:lines) + for idx in range(len) + let line = a:lines[len-idx-1] + if !empty(line) + return line + endif + endfor + return '' +endfunction + +function! s:job_out_cb(self, data) abort + let self = a:self + let data = remove(self.lines, -1) . a:data + let lines = map(split(data, "\n", 1), 'split(v:val, "\r", 1)[-1]') + call extend(self.lines, lines) + " To reduce the number of buffer updates + let self.tick = get(self, 'tick', -1) + 1 + if !self.running || self.tick % len(s:jobs) == 0 + let bullet = self.running ? (self.new ? '+' : '*') : (self.error ? 'x' : '-') + let result = self.error ? join(self.lines, "\n") : s:last_non_empty_line(self.lines) + call s:log(bullet, self.name, result) + endif +endfunction + +function! s:job_exit_cb(self, data) abort + let a:self.running = 0 + let a:self.error = a:data != 0 + call s:reap(a:self.name) + call s:tick() +endfunction + +function! s:job_cb(fn, job, ch, data) + if !s:plug_window_exists() " plug window closed + return s:job_abort() + endif + call call(a:fn, [a:job, a:data]) +endfunction + +function! s:nvim_cb(job_id, data, event) dict abort + return a:event == 'stdout' ? + \ s:job_cb('s:job_out_cb', self, 0, join(a:data, "\n")) : + \ s:job_cb('s:job_exit_cb', self, 0, a:data) +endfunction + +function! s:spawn(name, cmd, opts) + let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [''], + \ 'new': get(a:opts, 'new', 0) } + let s:jobs[a:name] = job + let argv = add(s:is_win ? ['cmd', '/c'] : ['sh', '-c'], + \ has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd) + + if s:nvim + call extend(job, { + \ 'on_stdout': function('s:nvim_cb'), + \ 'on_exit': function('s:nvim_cb'), + \ }) + let jid = jobstart(argv, job) + if jid > 0 + let job.jobid = jid + else + let job.running = 0 + let job.error = 1 + let job.lines = [jid < 0 ? argv[0].' is not executable' : + \ 'Invalid arguments (or job table is full)'] + endif + elseif s:vim8 + let jid = job_start(argv, { + \ 'out_cb': function('s:job_cb', ['s:job_out_cb', job]), + \ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]), + \ 'out_mode': 'raw' + \}) + if job_status(jid) == 'run' + let job.jobid = jid + else + let job.running = 0 + let job.error = 1 + let job.lines = ['Failed to start job'] + endif + else + let params = has_key(a:opts, 'dir') ? [a:cmd, a:opts.dir] : [a:cmd] + let job.lines = s:lines(call('s:system', params)) + let job.error = v:shell_error != 0 + let job.running = 0 + endif +endfunction + +function! s:reap(name) + let job = s:jobs[a:name] + if job.error + call add(s:update.errors, a:name) + elseif get(job, 'new', 0) + let s:update.new[a:name] = 1 + endif + let s:update.bar .= job.error ? 'x' : '=' + + let bullet = job.error ? 'x' : '-' + let result = job.error ? join(job.lines, "\n") : s:last_non_empty_line(job.lines) + call s:log(bullet, a:name, empty(result) ? 'OK' : result) + call s:bar() + + call remove(s:jobs, a:name) +endfunction + +function! s:bar() + if s:switch_in() + let total = len(s:update.all) + call setline(1, (s:update.pull ? 'Updating' : 'Installing'). + \ ' plugins ('.len(s:update.bar).'/'.total.')') + call s:progress_bar(2, s:update.bar, total) + call s:switch_out() + endif +endfunction + +function! s:logpos(name) + for i in range(4, line('$')) + if getline(i) =~# '^[-+x*] '.a:name.':' + for j in range(i + 1, line('$')) + if getline(j) !~ '^ ' + return [i, j - 1] + endif + endfor + return [i, i] + endif + endfor + return [0, 0] +endfunction + +function! s:log(bullet, name, lines) + if s:switch_in() + let [b, e] = s:logpos(a:name) + if b > 0 + silent execute printf('%d,%d d _', b, e) + if b > winheight('.') + let b = 4 + endif + else + let b = 4 + endif + " FIXME For some reason, nomodifiable is set after :d in vim8 + setlocal modifiable + call append(b - 1, s:format_message(a:bullet, a:name, a:lines)) + call s:switch_out() + endif +endfunction + +function! s:update_vim() + let s:jobs = {} + + call s:bar() + call s:tick() +endfunction + +function! s:tick() + let pull = s:update.pull + let prog = s:progress_opt(s:nvim || s:vim8) +while 1 " Without TCO, Vim stack is bound to explode + if empty(s:update.todo) + if empty(s:jobs) && !s:update.fin + call s:update_finish() + let s:update.fin = 1 + endif + return + endif + + let name = keys(s:update.todo)[0] + let spec = remove(s:update.todo, name) + let new = !isdirectory(spec.dir) + + call s:log(new ? '+' : '*', name, pull ? 'Updating ...' : 'Installing ...') + redraw + + let has_tag = has_key(spec, 'tag') + if !new + let [error, _] = s:git_validate(spec, 0) + if empty(error) + if pull + let fetch_opt = (has_tag && !empty(globpath(spec.dir, '.git/shallow'))) ? '--depth 99999999' : '' + call s:spawn(name, printf('git fetch %s %s 2>&1', fetch_opt, prog), { 'dir': spec.dir }) + else + let s:jobs[name] = { 'running': 0, 'lines': ['Already installed'], 'error': 0 } + endif + else + let s:jobs[name] = { 'running': 0, 'lines': s:lines(error), 'error': 1 } + endif + else + call s:spawn(name, + \ printf('git clone %s %s %s %s 2>&1', + \ has_tag ? '' : s:clone_opt, + \ prog, + \ s:shellesc(spec.uri), + \ s:shellesc(s:trim(spec.dir))), { 'new': 1 }) + endif + + if !s:jobs[name].running + call s:reap(name) + endif + if len(s:jobs) >= s:update.threads + break + endif +endwhile +endfunction + +function! s:update_python() +let py_exe = has('python') ? 'python' : 'python3' +execute py_exe "<< EOF" +import datetime +import functools +import os +try: + import queue +except ImportError: + import Queue as queue +import random +import re +import shutil +import signal +import subprocess +import tempfile +import threading as thr +import time +import traceback +import vim + +G_NVIM = vim.eval("has('nvim')") == '1' +G_PULL = vim.eval('s:update.pull') == '1' +G_RETRIES = int(vim.eval('get(g:, "plug_retries", 2)')) + 1 +G_TIMEOUT = int(vim.eval('get(g:, "plug_timeout", 60)')) +G_CLONE_OPT = vim.eval('s:clone_opt') +G_PROGRESS = vim.eval('s:progress_opt(1)') +G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads')) +G_STOP = thr.Event() +G_IS_WIN = vim.eval('s:is_win') == '1' + +class PlugError(Exception): + def __init__(self, msg): + self.msg = msg +class CmdTimedOut(PlugError): + pass +class CmdFailed(PlugError): + pass +class InvalidURI(PlugError): + pass +class Action(object): + INSTALL, UPDATE, ERROR, DONE = ['+', '*', 'x', '-'] + +class Buffer(object): + def __init__(self, lock, num_plugs, is_pull): + self.bar = '' + self.event = 'Updating' if is_pull else 'Installing' + self.lock = lock + self.maxy = int(vim.eval('winheight(".")')) + self.num_plugs = num_plugs + + def __where(self, name): + """ Find first line with name in current buffer. Return line num. """ + found, lnum = False, 0 + matcher = re.compile('^[-+x*] {0}:'.format(name)) + for line in vim.current.buffer: + if matcher.search(line) is not None: + found = True + break + lnum += 1 + + if not found: + lnum = -1 + return lnum + + def header(self): + curbuf = vim.current.buffer + curbuf[0] = self.event + ' plugins ({0}/{1})'.format(len(self.bar), self.num_plugs) + + num_spaces = self.num_plugs - len(self.bar) + curbuf[1] = '[{0}{1}]'.format(self.bar, num_spaces * ' ') + + with self.lock: + vim.command('normal! 2G') + vim.command('redraw') + + def write(self, action, name, lines): + first, rest = lines[0], lines[1:] + msg = ['{0} {1}{2}{3}'.format(action, name, ': ' if first else '', first)] + msg.extend([' ' + line for line in rest]) + + try: + if action == Action.ERROR: + self.bar += 'x' + vim.command("call add(s:update.errors, '{0}')".format(name)) + elif action == Action.DONE: + self.bar += '=' + + curbuf = vim.current.buffer + lnum = self.__where(name) + if lnum != -1: # Found matching line num + del curbuf[lnum] + if lnum > self.maxy and action in set([Action.INSTALL, Action.UPDATE]): + lnum = 3 + else: + lnum = 3 + curbuf.append(msg, lnum) + + self.header() + except vim.error: + pass + +class Command(object): + CD = 'cd /d' if G_IS_WIN else 'cd' + + def __init__(self, cmd, cmd_dir=None, timeout=60, cb=None, clean=None): + self.cmd = cmd + if cmd_dir: + self.cmd = '{0} {1} && {2}'.format(Command.CD, cmd_dir, self.cmd) + self.timeout = timeout + self.callback = cb if cb else (lambda msg: None) + self.clean = clean if clean else (lambda: None) + self.proc = None + + @property + def alive(self): + """ Returns true only if command still running. """ + return self.proc and self.proc.poll() is None + + def execute(self, ntries=3): + """ Execute the command with ntries if CmdTimedOut. + Returns the output of the command if no Exception. + """ + attempt, finished, limit = 0, False, self.timeout + + while not finished: + try: + attempt += 1 + result = self.try_command() + finished = True + return result + except CmdTimedOut: + if attempt != ntries: + self.notify_retry() + self.timeout += limit + else: + raise + + def notify_retry(self): + """ Retry required for command, notify user. """ + for count in range(3, 0, -1): + if G_STOP.is_set(): + raise KeyboardInterrupt + msg = 'Timeout. Will retry in {0} second{1} ...'.format( + count, 's' if count != 1 else '') + self.callback([msg]) + time.sleep(1) + self.callback(['Retrying ...']) + + def try_command(self): + """ Execute a cmd & poll for callback. Returns list of output. + Raises CmdFailed -> return code for Popen isn't 0 + Raises CmdTimedOut -> command exceeded timeout without new output + """ + first_line = True + + try: + tfile = tempfile.NamedTemporaryFile(mode='w+b') + preexec_fn = not G_IS_WIN and os.setsid or None + self.proc = subprocess.Popen(self.cmd, stdout=tfile, + stderr=subprocess.STDOUT, + stdin=subprocess.PIPE, shell=True, + preexec_fn=preexec_fn) + thrd = thr.Thread(target=(lambda proc: proc.wait()), args=(self.proc,)) + thrd.start() + + thread_not_started = True + while thread_not_started: + try: + thrd.join(0.1) + thread_not_started = False + except RuntimeError: + pass + + while self.alive: + if G_STOP.is_set(): + raise KeyboardInterrupt + + if first_line or random.random() < G_LOG_PROB: + first_line = False + line = '' if G_IS_WIN else nonblock_read(tfile.name) + if line: + self.callback([line]) + + time_diff = time.time() - os.path.getmtime(tfile.name) + if time_diff > self.timeout: + raise CmdTimedOut(['Timeout!']) + + thrd.join(0.5) + + tfile.seek(0) + result = [line.decode('utf-8', 'replace').rstrip() for line in tfile] + + if self.proc.returncode != 0: + raise CmdFailed([''] + result) + + return result + except: + self.terminate() + raise + + def terminate(self): + """ Terminate process and cleanup. """ + if self.alive: + if G_IS_WIN: + os.kill(self.proc.pid, signal.SIGINT) + else: + os.killpg(self.proc.pid, signal.SIGTERM) + self.clean() + +class Plugin(object): + def __init__(self, name, args, buf_q, lock): + self.name = name + self.args = args + self.buf_q = buf_q + self.lock = lock + self.tag = args.get('tag', 0) + + def manage(self): + try: + if os.path.exists(self.args['dir']): + self.update() + else: + self.install() + with self.lock: + thread_vim_command("let s:update.new['{0}'] = 1".format(self.name)) + except PlugError as exc: + self.write(Action.ERROR, self.name, exc.msg) + except KeyboardInterrupt: + G_STOP.set() + self.write(Action.ERROR, self.name, ['Interrupted!']) + except: + # Any exception except those above print stack trace + msg = 'Trace:\n{0}'.format(traceback.format_exc().rstrip()) + self.write(Action.ERROR, self.name, msg.split('\n')) + raise + + def install(self): + target = self.args['dir'] + if target[-1] == '\\': + target = target[0:-1] + + def clean(target): + def _clean(): + try: + shutil.rmtree(target) + except OSError: + pass + return _clean + + self.write(Action.INSTALL, self.name, ['Installing ...']) + callback = functools.partial(self.write, Action.INSTALL, self.name) + cmd = 'git clone {0} {1} {2} {3} 2>&1'.format( + '' if self.tag else G_CLONE_OPT, G_PROGRESS, self.args['uri'], + esc(target)) + com = Command(cmd, None, G_TIMEOUT, callback, clean(target)) + result = com.execute(G_RETRIES) + self.write(Action.DONE, self.name, result[-1:]) + + def repo_uri(self): + cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url' + command = Command(cmd, self.args['dir'], G_TIMEOUT,) + result = command.execute(G_RETRIES) + return result[-1] + + def update(self): + actual_uri = self.repo_uri() + expect_uri = self.args['uri'] + regex = re.compile(r'^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$') + ma = regex.match(actual_uri) + mb = regex.match(expect_uri) + if ma is None or mb is None or ma.groups() != mb.groups(): + msg = ['', + 'Invalid URI: {0}'.format(actual_uri), + 'Expected {0}'.format(expect_uri), + 'PlugClean required.'] + raise InvalidURI(msg) + + if G_PULL: + self.write(Action.UPDATE, self.name, ['Updating ...']) + callback = functools.partial(self.write, Action.UPDATE, self.name) + fetch_opt = '--depth 99999999' if self.tag and os.path.isfile(os.path.join(self.args['dir'], '.git/shallow')) else '' + cmd = 'git fetch {0} {1} 2>&1'.format(fetch_opt, G_PROGRESS) + com = Command(cmd, self.args['dir'], G_TIMEOUT, callback) + result = com.execute(G_RETRIES) + self.write(Action.DONE, self.name, result[-1:]) + else: + self.write(Action.DONE, self.name, ['Already installed']) + + def write(self, action, name, msg): + self.buf_q.put((action, name, msg)) + +class PlugThread(thr.Thread): + def __init__(self, tname, args): + super(PlugThread, self).__init__() + self.tname = tname + self.args = args + + def run(self): + thr.current_thread().name = self.tname + buf_q, work_q, lock = self.args + + try: + while not G_STOP.is_set(): + name, args = work_q.get_nowait() + plug = Plugin(name, args, buf_q, lock) + plug.manage() + work_q.task_done() + except queue.Empty: + pass + +class RefreshThread(thr.Thread): + def __init__(self, lock): + super(RefreshThread, self).__init__() + self.lock = lock + self.running = True + + def run(self): + while self.running: + with self.lock: + thread_vim_command('noautocmd normal! a') + time.sleep(0.33) + + def stop(self): + self.running = False + +if G_NVIM: + def thread_vim_command(cmd): + vim.session.threadsafe_call(lambda: vim.command(cmd)) +else: + def thread_vim_command(cmd): + vim.command(cmd) + +def esc(name): + return '"' + name.replace('"', '\"') + '"' + +def nonblock_read(fname): + """ Read a file with nonblock flag. Return the last line. """ + fread = os.open(fname, os.O_RDONLY | os.O_NONBLOCK) + buf = os.read(fread, 100000).decode('utf-8', 'replace') + os.close(fread) + + line = buf.rstrip('\r\n') + left = max(line.rfind('\r'), line.rfind('\n')) + if left != -1: + left += 1 + line = line[left:] + + return line + +def main(): + thr.current_thread().name = 'main' + nthreads = int(vim.eval('s:update.threads')) + plugs = vim.eval('s:update.todo') + mac_gui = vim.eval('s:mac_gui') == '1' + + lock = thr.Lock() + buf = Buffer(lock, len(plugs), G_PULL) + buf_q, work_q = queue.Queue(), queue.Queue() + for work in plugs.items(): + work_q.put(work) + + start_cnt = thr.active_count() + for num in range(nthreads): + tname = 'PlugT-{0:02}'.format(num) + thread = PlugThread(tname, (buf_q, work_q, lock)) + thread.start() + if mac_gui: + rthread = RefreshThread(lock) + rthread.start() + + while not buf_q.empty() or thr.active_count() != start_cnt: + try: + action, name, msg = buf_q.get(True, 0.25) + buf.write(action, name, ['OK'] if not msg else msg) + buf_q.task_done() + except queue.Empty: + pass + except KeyboardInterrupt: + G_STOP.set() + + if mac_gui: + rthread.stop() + rthread.join() + +main() +EOF +endfunction + +function! s:update_ruby() + ruby << EOF + module PlugStream + SEP = ["\r", "\n", nil] + def get_line + buffer = '' + loop do + char = readchar rescue return + if SEP.include? char.chr + buffer << $/ + break + else + buffer << char + end + end + buffer + end + end unless defined?(PlugStream) + + def esc arg + %["#{arg.gsub('"', '\"')}"] + end + + def killall pid + pids = [pid] + if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM + pids.each { |pid| Process.kill 'INT', pid.to_i rescue nil } + else + unless `which pgrep 2> /dev/null`.empty? + children = pids + until children.empty? + children = children.map { |pid| + `pgrep -P #{pid}`.lines.map { |l| l.chomp } + }.flatten + pids += children + end + end + pids.each { |pid| Process.kill 'TERM', pid.to_i rescue nil } + end + end + + def compare_git_uri a, b + regex = %r{^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$} + regex.match(a).to_a.drop(1) == regex.match(b).to_a.drop(1) + end + + require 'thread' + require 'fileutils' + require 'timeout' + running = true + iswin = VIM::evaluate('s:is_win').to_i == 1 + pull = VIM::evaluate('s:update.pull').to_i == 1 + base = VIM::evaluate('g:plug_home') + all = VIM::evaluate('s:update.todo') + limit = VIM::evaluate('get(g:, "plug_timeout", 60)') + tries = VIM::evaluate('get(g:, "plug_retries", 2)') + 1 + nthr = VIM::evaluate('s:update.threads').to_i + maxy = VIM::evaluate('winheight(".")').to_i + cd = iswin ? 'cd /d' : 'cd' + tot = VIM::evaluate('len(s:update.todo)') || 0 + bar = '' + skip = 'Already installed' + mtx = Mutex.new + take1 = proc { mtx.synchronize { running && all.shift } } + logh = proc { + cnt = bar.length + $curbuf[1] = "#{pull ? 'Updating' : 'Installing'} plugins (#{cnt}/#{tot})" + $curbuf[2] = '[' + bar.ljust(tot) + ']' + VIM::command('normal! 2G') + VIM::command('redraw') + } + where = proc { |name| (1..($curbuf.length)).find { |l| $curbuf[l] =~ /^[-+x*] #{name}:/ } } + log = proc { |name, result, type| + mtx.synchronize do + ing = ![true, false].include?(type) + bar += type ? '=' : 'x' unless ing + b = case type + when :install then '+' when :update then '*' + when true, nil then '-' else + VIM::command("call add(s:update.errors, '#{name}')") + 'x' + end + result = + if type || type.nil? + ["#{b} #{name}: #{result.lines.to_a.last || 'OK'}"] + elsif result =~ /^Interrupted|^Timeout/ + ["#{b} #{name}: #{result}"] + else + ["#{b} #{name}"] + result.lines.map { |l| " " << l } + end + if lnum = where.call(name) + $curbuf.delete lnum + lnum = 4 if ing && lnum > maxy + end + result.each_with_index do |line, offset| + $curbuf.append((lnum || 4) - 1 + offset, line.gsub(/\e\[./, '').chomp) + end + logh.call + end + } + bt = proc { |cmd, name, type, cleanup| + tried = timeout = 0 + begin + tried += 1 + timeout += limit + fd = nil + data = '' + if iswin + Timeout::timeout(timeout) do + tmp = VIM::evaluate('tempname()') + system("(#{cmd}) > #{tmp}") + data = File.read(tmp).chomp + File.unlink tmp rescue nil + end + else + fd = IO.popen(cmd).extend(PlugStream) + first_line = true + log_prob = 1.0 / nthr + while line = Timeout::timeout(timeout) { fd.get_line } + data << line + log.call name, line.chomp, type if name && (first_line || rand < log_prob) + first_line = false + end + fd.close + end + [$? == 0, data.chomp] + rescue Timeout::Error, Interrupt => e + if fd && !fd.closed? + killall fd.pid + fd.close + end + cleanup.call if cleanup + if e.is_a?(Timeout::Error) && tried < tries + 3.downto(1) do |countdown| + s = countdown > 1 ? 's' : '' + log.call name, "Timeout. Will retry in #{countdown} second#{s} ...", type + sleep 1 + end + log.call name, 'Retrying ...', type + retry + end + [false, e.is_a?(Interrupt) ? "Interrupted!" : "Timeout!"] + end + } + main = Thread.current + threads = [] + watcher = Thread.new { + require 'io/console' # >= Ruby 1.9 + nil until IO.console.getch == 3.chr + mtx.synchronize do + running = false + threads.each { |t| t.raise Interrupt } + end + threads.each { |t| t.join rescue nil } + main.kill + } + refresh = Thread.new { + while true + mtx.synchronize do + break unless running + VIM::command('noautocmd normal! a') + end + sleep 0.2 + end + } if VIM::evaluate('s:mac_gui') == 1 + + clone_opt = VIM::evaluate('s:clone_opt') + progress = VIM::evaluate('s:progress_opt(1)') + nthr.times do + mtx.synchronize do + threads << Thread.new { + while pair = take1.call + name = pair.first + dir, uri, tag = pair.last.values_at *%w[dir uri tag] + exists = File.directory? dir + ok, result = + if exists + chdir = "#{cd} #{iswin ? dir : esc(dir)}" + ret, data = bt.call "#{chdir} && git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url", nil, nil, nil + current_uri = data.lines.to_a.last + if !ret + if data =~ /^Interrupted|^Timeout/ + [false, data] + else + [false, [data.chomp, "PlugClean required."].join($/)] + end + elsif !compare_git_uri(current_uri, uri) + [false, ["Invalid URI: #{current_uri}", + "Expected: #{uri}", + "PlugClean required."].join($/)] + else + if pull + log.call name, 'Updating ...', :update + fetch_opt = (tag && File.exist?(File.join(dir, '.git/shallow'))) ? '--depth 99999999' : '' + bt.call "#{chdir} && git fetch #{fetch_opt} #{progress} 2>&1", name, :update, nil + else + [true, skip] + end + end + else + d = esc dir.sub(%r{[\\/]+$}, '') + log.call name, 'Installing ...', :install + bt.call "git clone #{clone_opt unless tag} #{progress} #{uri} #{d} 2>&1", name, :install, proc { + FileUtils.rm_rf dir + } + end + mtx.synchronize { VIM::command("let s:update.new['#{name}'] = 1") } if !exists && ok + log.call name, result, ok + end + } if running + end + end + threads.each { |t| t.join rescue nil } + logh.call + refresh.kill if refresh + watcher.kill +EOF +endfunction + +function! s:shellesc(arg) + return '"'.escape(a:arg, '"').'"' +endfunction + +function! s:glob_dir(path) + return map(filter(s:glob(a:path, '**'), 'isdirectory(v:val)'), 's:dirpath(v:val)') +endfunction + +function! s:progress_bar(line, bar, total) + call setline(a:line, '[' . s:lpad(a:bar, a:total) . ']') +endfunction + +function! s:compare_git_uri(a, b) + " See `git help clone' + " https:// [user@] github.com[:port] / junegunn/vim-plug [.git] + " [git@] github.com[:port] : junegunn/vim-plug [.git] + " file:// / junegunn/vim-plug [/] + " / junegunn/vim-plug [/] + let pat = '^\%(\w\+://\)\='.'\%([^@/]*@\)\='.'\([^:/]*\%(:[0-9]*\)\=\)'.'[:/]'.'\(.\{-}\)'.'\%(\.git\)\=/\?$' + let ma = matchlist(a:a, pat) + let mb = matchlist(a:b, pat) + return ma[1:2] ==# mb[1:2] +endfunction + +function! s:format_message(bullet, name, message) + if a:bullet != 'x' + return [printf('%s %s: %s', a:bullet, a:name, s:lastline(a:message))] + else + let lines = map(s:lines(a:message), '" ".v:val') + return extend([printf('x %s:', a:name)], lines) + endif +endfunction + +function! s:with_cd(cmd, dir) + return printf('cd%s %s && %s', s:is_win ? ' /d' : '', s:shellesc(a:dir), a:cmd) +endfunction + +function! s:system(cmd, ...) + try + let [sh, shrd] = s:chsh(1) + let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd + return system(s:is_win ? '('.cmd.')' : cmd) + finally + let [&shell, &shellredir] = [sh, shrd] + endtry +endfunction + +function! s:system_chomp(...) + let ret = call('s:system', a:000) + return v:shell_error ? '' : substitute(ret, '\n$', '', '') +endfunction + +function! s:git_validate(spec, check_branch) + let err = '' + if isdirectory(a:spec.dir) + 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)) + let remote = result[-1] + if v:shell_error + let err = join([remote, 'PlugClean required.'], "\n") + elseif !s:compare_git_uri(remote, a:spec.uri) + let err = join(['Invalid URI: '.remote, + \ 'Expected: '.a:spec.uri, + \ 'PlugClean required.'], "\n") + elseif a:check_branch && has_key(a:spec, 'commit') + let result = s:lines(s:system('git rev-parse HEAD 2>&1', a:spec.dir)) + let sha = result[-1] + if v:shell_error + let err = join(add(result, 'PlugClean required.'), "\n") + elseif !s:hash_match(sha, a:spec.commit) + let err = join([printf('Invalid HEAD (expected: %s, actual: %s)', + \ a:spec.commit[:6], sha[:6]), + \ 'PlugUpdate required.'], "\n") + endif + elseif a:check_branch + let branch = result[0] + " Check tag + if has_key(a:spec, 'tag') + let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir) + if a:spec.tag !=# tag + let err = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.', + \ (empty(tag) ? 'N/A' : tag), a:spec.tag) + endif + " Check branch + elseif a:spec.branch !=# branch + let err = printf('Invalid branch: %s (expected: %s). Try PlugUpdate.', + \ branch, a:spec.branch) + endif + if empty(err) + let [ahead, behind] = split(s:lastline(s:system(printf( + \ 'git rev-list --count --left-right HEAD...origin/%s', + \ a:spec.branch), a:spec.dir)), '\t') + if !v:shell_error && ahead + if behind + " Only mention PlugClean if diverged, otherwise it's likely to be + " pushable (and probably not that messed up). + let err = printf( + \ "Diverged from origin/%s (%d commit(s) ahead and %d commit(s) behind!\n" + \ .'Backup local changes and run PlugClean and PlugUpdate to reinstall it.', a:spec.branch, ahead, behind) + else + let err = printf("Ahead of origin/%s by %d commit(s).\n" + \ .'Cannot update until local changes are pushed.', + \ a:spec.branch, ahead) + endif + endif + endif + endif + else + let err = 'Not found' + endif + return [err, err =~# 'PlugClean'] +endfunction + +function! s:rm_rf(dir) + if isdirectory(a:dir) + call s:system((s:is_win ? 'rmdir /S /Q ' : 'rm -rf ') . s:shellesc(a:dir)) + endif +endfunction + +function! s:clean(force) + call s:prepare() + call append(0, 'Searching for invalid plugins in '.g:plug_home) + call append(1, '') + + " List of valid directories + let dirs = [] + let errs = {} + let [cnt, total] = [0, len(g:plugs)] + for [name, spec] in items(g:plugs) + if !s:is_managed(name) + call add(dirs, spec.dir) + else + let [err, clean] = s:git_validate(spec, 1) + if clean + let errs[spec.dir] = s:lines(err)[0] + else + call add(dirs, spec.dir) + endif + endif + let cnt += 1 + call s:progress_bar(2, repeat('=', cnt), total) + normal! 2G + redraw + endfor + + let allowed = {} + for dir in dirs + let allowed[s:dirpath(fnamemodify(dir, ':h:h'))] = 1 + let allowed[dir] = 1 + for child in s:glob_dir(dir) + let allowed[child] = 1 + endfor + endfor + + let todo = [] + let found = sort(s:glob_dir(g:plug_home)) + while !empty(found) + let f = remove(found, 0) + if !has_key(allowed, f) && isdirectory(f) + call add(todo, f) + call append(line('$'), '- ' . f) + if has_key(errs, f) + call append(line('$'), ' ' . errs[f]) + endif + let found = filter(found, 'stridx(v:val, f) != 0') + end + endwhile + + 4 + redraw + if empty(todo) + call append(line('$'), 'Already clean.') + else + let s:clean_count = 0 + call append(3, ['Directories to delete:', '']) + redraw! + if a:force || s:ask_no_interrupt('Delete all directories?') + call s:delete([6, line('$')], 1) + else + call setline(4, 'Cancelled.') + nnoremap d :set opfunc=delete_opg@ + nmap dd d_ + xnoremap d :call delete_op(visualmode(), 1) + echo 'Delete the lines (d{motion}) to delete the corresponding directories' + endif + endif + 4 + setlocal nomodifiable +endfunction + +function! s:delete_op(type, ...) + call s:delete(a:0 ? [line("'<"), line("'>")] : [line("'["), line("']")], 0) +endfunction + +function! s:delete(range, force) + let [l1, l2] = a:range + let force = a:force + while l1 <= l2 + let line = getline(l1) + if line =~ '^- ' && isdirectory(line[2:]) + execute l1 + redraw! + let answer = force ? 1 : s:ask('Delete '.line[2:].'?', 1) + let force = force || answer > 1 + if answer + call s:rm_rf(line[2:]) + setlocal modifiable + call setline(l1, '~'.line[1:]) + let s:clean_count += 1 + call setline(4, printf('Removed %d directories.', s:clean_count)) + setlocal nomodifiable + endif + endif + let l1 += 1 + endwhile +endfunction + +function! s:upgrade() + echo 'Downloading the latest version of vim-plug' + redraw + let tmp = tempname() + let new = tmp . '/plug.vim' + + try + let out = s:system(printf('git clone --depth 1 %s %s', s:plug_src, tmp)) + if v:shell_error + return s:err('Error upgrading vim-plug: '. out) + endif + + if readfile(s:me) ==# readfile(new) + echo 'vim-plug is already up-to-date' + return 0 + else + call rename(s:me, s:me . '.old') + call rename(new, s:me) + unlet g:loaded_plug + echo 'vim-plug has been upgraded' + return 1 + endif + finally + silent! call s:rm_rf(tmp) + endtry +endfunction + +function! s:upgrade_specs() + for spec in values(g:plugs) + let spec.frozen = get(spec, 'frozen', 0) + endfor +endfunction + +function! s:status() + call s:prepare() + call append(0, 'Checking plugins') + call append(1, '') + + let ecnt = 0 + let unloaded = 0 + let [cnt, total] = [0, len(g:plugs)] + for [name, spec] in items(g:plugs) + if has_key(spec, 'uri') + if isdirectory(spec.dir) + let [err, _] = s:git_validate(spec, 1) + let [valid, msg] = [empty(err), empty(err) ? 'OK' : err] + else + let [valid, msg] = [0, 'Not found. Try PlugInstall.'] + endif + else + if isdirectory(spec.dir) + let [valid, msg] = [1, 'OK'] + else + let [valid, msg] = [0, 'Not found.'] + endif + endif + let cnt += 1 + let ecnt += !valid + " `s:loaded` entry can be missing if PlugUpgraded + if valid && get(s:loaded, name, -1) == 0 + let unloaded = 1 + let msg .= ' (not loaded)' + endif + call s:progress_bar(2, repeat('=', cnt), total) + call append(3, s:format_message(valid ? '-' : 'x', name, msg)) + normal! 2G + redraw + endfor + call setline(1, 'Finished. '.ecnt.' error(s).') + normal! gg + setlocal nomodifiable + if unloaded + echo "Press 'L' on each line to load plugin, or 'U' to update" + nnoremap L :call status_load(line('.')) + xnoremap L :call status_load(line('.')) + end +endfunction + +function! s:extract_name(str, prefix, suffix) + return matchstr(a:str, '^'.a:prefix.' \zs[^:]\+\ze:.*'.a:suffix.'$') +endfunction + +function! s:status_load(lnum) + let line = getline(a:lnum) + let name = s:extract_name(line, '-', '(not loaded)') + if !empty(name) + call plug#load(name) + setlocal modifiable + call setline(a:lnum, substitute(line, ' (not loaded)$', '', '')) + setlocal nomodifiable + endif +endfunction + +function! s:status_update() range + let lines = getline(a:firstline, a:lastline) + let names = filter(map(lines, 's:extract_name(v:val, "[x-]", "")'), '!empty(v:val)') + if !empty(names) + echo + execute 'PlugUpdate' join(names) + endif +endfunction + +function! s:is_preview_window_open() + silent! wincmd P + if &previewwindow + wincmd p + return 1 + endif +endfunction + +function! s:find_name(lnum) + for lnum in reverse(range(1, a:lnum)) + let line = getline(lnum) + if empty(line) + return '' + endif + let name = s:extract_name(line, '-', '') + if !empty(name) + return name + endif + endfor + return '' +endfunction + +function! s:preview_commit() + if b:plug_preview < 0 + let b:plug_preview = !s:is_preview_window_open() + endif + + let sha = matchstr(getline('.'), '^ \X*\zs[0-9a-f]\{7}') + if empty(sha) + return + endif + + let name = s:find_name(line('.')) + if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir) + return + endif + + if exists('g:plug_pwindow') && !s:is_preview_window_open() + execute g:plug_pwindow + execute 'e' sha + else + execute 'pedit' sha + wincmd P + endif + setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable + execute 'silent %!cd' s:shellesc(g:plugs[name].dir) '&& git show --no-color --pretty=medium' sha + setlocal nomodifiable + nnoremap q :q + wincmd p +endfunction + +function! s:section(flags) + call search('\(^[x-] \)\@<=[^:]\+:', a:flags) +endfunction + +function! s:format_git_log(line) + let indent = ' ' + let tokens = split(a:line, nr2char(1)) + if len(tokens) != 5 + return indent.substitute(a:line, '\s*$', '', '') + endif + let [graph, sha, refs, subject, date] = tokens + let tag = matchstr(refs, 'tag: [^,)]\+') + let tag = empty(tag) ? ' ' : ' ('.tag.') ' + return printf('%s%s%s%s%s (%s)', indent, graph, sha, tag, subject, date) +endfunction + +function! s:append_ul(lnum, text) + call append(a:lnum, ['', a:text, repeat('-', len(a:text))]) +endfunction + +function! s:diff() + call s:prepare() + call append(0, ['Collecting changes ...', '']) + let cnts = [0, 0] + let bar = '' + let total = filter(copy(g:plugs), 's:is_managed(v:key) && isdirectory(v:val.dir)') + call s:progress_bar(2, bar, len(total)) + for origin in [1, 0] + let plugs = reverse(sort(items(filter(copy(total), (origin ? '' : '!').'(has_key(v:val, "commit") || has_key(v:val, "tag"))')))) + if empty(plugs) + continue + endif + call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:') + for [k, v] in plugs + let range = origin ? '..origin/'.v.branch : 'HEAD@{1}..' + 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) + if !empty(diff) + let ref = has_key(v, 'tag') ? (' (tag: '.v.tag.')') : has_key(v, 'commit') ? (' '.v.commit) : '' + call append(5, extend(['', '- '.k.':'.ref], map(s:lines(diff), 's:format_git_log(v:val)'))) + let cnts[origin] += 1 + endif + let bar .= '=' + call s:progress_bar(2, bar, len(total)) + normal! 2G + redraw + endfor + if !cnts[origin] + call append(5, ['', 'N/A']) + endif + endfor + call setline(1, printf('%d plugin(s) updated.', cnts[0]) + \ . (cnts[1] ? printf(' %d plugin(s) have pending updates.', cnts[1]) : '')) + + if cnts[0] || cnts[1] + nnoremap :silent! call preview_commit() + nnoremap o :silent! call preview_commit() + endif + if cnts[0] + nnoremap X :call revert() + echo "Press 'X' on each block to revert the update" + endif + normal! gg + setlocal nomodifiable +endfunction + +function! s:revert() + if search('^Pending updates', 'bnW') + return + endif + + let name = s:find_name(line('.')) + if empty(name) || !has_key(g:plugs, name) || + \ input(printf('Revert the update of %s? (y/N) ', name)) !~? '^y' + return + endif + + call s:system('git reset --hard HEAD@{1} && git checkout '.s:esc(g:plugs[name].branch), g:plugs[name].dir) + setlocal modifiable + normal! "_dap + setlocal nomodifiable + echo 'Reverted' +endfunction + +function! s:snapshot(force, ...) abort + call s:prepare() + setf vim + call append(0, ['" Generated by vim-plug', + \ '" '.strftime("%c"), + \ '" :source this file in vim to restore the snapshot', + \ '" or execute: vim -S snapshot.vim', + \ '', '', 'PlugUpdate!']) + 1 + let anchor = line('$') - 3 + let names = sort(keys(filter(copy(g:plugs), + \'has_key(v:val, "uri") && !has_key(v:val, "commit") && isdirectory(v:val.dir)'))) + for name in reverse(names) + let sha = s:system_chomp('git rev-parse --short HEAD', g:plugs[name].dir) + if !empty(sha) + call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha)) + redraw + endif + endfor + + if a:0 > 0 + let fn = expand(a:1) + if filereadable(fn) && !(a:force || s:ask(a:1.' already exists. Overwrite?')) + return + endif + call writefile(getline(1, '$'), fn) + echo 'Saved as '.a:1 + silent execute 'e' s:esc(fn) + setf vim + endif +endfunction + +function! s:split_rtp() + return split(&rtp, '\\\@ + \ | execute ':redraw!' + +command! MakeTags !ctags -R . + +" Fixes common typos +command! W w +command! Q q diff --git a/nvim/config.vim b/nvim/config.vim new file mode 100644 index 0000000..17949b4 --- /dev/null +++ b/nvim/config.vim @@ -0,0 +1,160 @@ +" --------------------------------------------- +" Regular Vim Configuration (No Plugins Needed) +" --------------------------------------------- + +" --------------- +" Color +" --------------- +" Force 256 color mode if available +if $TERM =~ '-256color' + set t_Co=256 + set t_ut= +endif + +set background=dark + +" ----------------------------- +" File Locations +" ----------------------------- +set backup +exe 'set backupdir=.,'. g:runtime_data_location. 'backup' +exe 'set directory='. g:runtime_data_location. 'swap' +exe 'set viewdir='. g:runtime_data_location. 'view' +" Persistent Undo +if has('persistent_undo') + set undofile + exe 'set undodir='. g:runtime_data_location. 'undo' + set undolevels=1000 " Maximum number of changes that can be undone + set undoreload=10000 " Maximum number lines to save for undo on a buffer reload +endif + +" --------------- +" UI +" --------------- +set ruler " Ruler on +set showcmd " Show partial commands in status line and +" Selected characters/lines in visual mode +set number " Line numbers on +set wrap " Line wrapping on +set breakindent " Line Wrap with indent +set breakindentopt=shift:5 " Put five character space before the indented wrap +set laststatus=2 " Always show the statusline +set cmdheight=2 " Make the command area two lines high +set cursorline " Highlight current line +set encoding=utf-8 +set noshowmode " Don't show the mode since Powerline shows it +set title " Set the title of the window in the terminal to the file +highlight clear SignColumn " SignColumn should match background +highlight clear LineNr " Current line number row will have +" same background color in relative mode +if exists('+colorcolumn') + set colorcolumn=80 " Color the 80th column differently as a wrapping guide. +endif +" Disable tooltips for hovering keywords in Vim +if exists('+ballooneval') + " This doesn't seem to stop tooltips for Ruby files + set noballooneval + " 100 second delay seems to be the only way to disable the tooltips + set balloondelay=100000 +endif + +" --------------- +" Behaviors +" --------------- +" set path+=** +syntax enable +set backup " Turn on backups +set autoread " Automatically reload changes if detected +set wildmenu " Turn on Wild menu +" Command completion, list matches, then longest common part, then all. +set wildmode=list:longest,full +set hidden " Change buffer - without saving +set history=1000 " Number of things to remember in history. +set confirm " Enable error files & error jumping. +" clipboard settings inspired by spf13 +if has('clipboard') + if has('unnamedplus') " When possible use + register for copy-paste + set clipboard=unnamed,unnamedplus + else " On mac and Windows, use * register for copy-paste + set clipboard=unnamed + endif +endif +set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter') +set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility +set virtualedit=onemore " Allow for cursor beyond last character +set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too +set pastetoggle= " pastetoggle (sane indentation on pastes) + +set autowrite " Writes on make/shell commands +set timeoutlen=1000 " Time to wait for a command (after leader for example). +set ttimeout +set ttimeoutlen=100 " Time to wait for a key sequence. +set nofoldenable " Disable folding entirely. +set foldlevelstart=99 " I really don't like folds. +set formatoptions=crql +set iskeyword+=\$,- " Add extra characters that are valid parts of variables +set nostartofline " Don't go to the start of the line after some commands +set scrolloff=3 " Keep three lines below the last line when scrolling +set gdefault " this makes search/replace global by default +set switchbuf=useopen " Switch to an existing buffer if one exists + +" --------------- +" Text Format +" --------------- +set tabstop=8 +set shiftwidth=8 " Tabs under smart indent +set softtabstop=8 +set smarttab +set noexpandtab +set shiftround +set backspace=indent,eol,start " Delete everything with backspace +set cindent +set autoindent + +" --------------- +" Searching +" --------------- +set ignorecase " Case insensitive search +set smartcase " Non-case sensitive search +set incsearch " Incremental search +set hlsearch " Highlight search results +set wildignore+=*.o,*.obj,*.exe,*.so,*.dll,*.pyc,.svn,.hg,.bzr,.git, + \.sass-cache,*.class,*.scssc,*.cssc,sprockets%*, + \*.lessc,*/node_modules/*,rake-pipeline-* + +" --------------- +" Visual +" --------------- +set showmatch " Show matching brackets. +set matchtime=2 " How many tenths of a second to blink +set winminheight=0 " Non Current Windows can be 0 line high +" Show invisible characters +set list + +" Reset the listchars +set listchars="" +" make tabs visible and show trailing spaces as dots +set listchars=tab:▸\ ,trail:• +" The character to show in the last column when wrap is off and the line +" continues beyond the right of the screen +set listchars+=extends:> +" The character to show in the last column when wrap is off and the line +" continues beyond the right of the screen +set listchars+=precedes:< + +" --------------- +" Sounds +" --------------- +set noerrorbells +set visualbell +set t_vb= + +" --------------- +" Mouse +" --------------- +set ttyfast +set mouse=a " Mouse in all modes +set mousehide " Hide mouse after chars typed + +" Better complete options to speed it up +set complete=.,w,b,u,U diff --git a/nvim/ftdetect/elm.vim b/nvim/ftdetect/elm.vim new file mode 100644 index 0000000..f57f7a2 --- /dev/null +++ b/nvim/ftdetect/elm.vim @@ -0,0 +1 @@ +autocmd BufNewFile,BufReadPost *.elm set filetype=elm diff --git a/nvim/ftdetect/html.vim b/nvim/ftdetect/html.vim new file mode 100644 index 0000000..5eb9bf7 --- /dev/null +++ b/nvim/ftdetect/html.vim @@ -0,0 +1 @@ +autocmd BufRead *.ejs set filetype=html diff --git a/nvim/ftdetect/javascript.vim b/nvim/ftdetect/javascript.vim new file mode 100644 index 0000000..47db8c3 --- /dev/null +++ b/nvim/ftdetect/javascript.vim @@ -0,0 +1 @@ +autocmd BufRead *.es6 set filetype=javascript diff --git a/nvim/ftdetect/json.vim b/nvim/ftdetect/json.vim new file mode 100644 index 0000000..16dc72f --- /dev/null +++ b/nvim/ftdetect/json.vim @@ -0,0 +1,6 @@ +autocmd BufRead .jscsrc set filetype=json +autocmd BufRead .jshintrc set filetype=json +autocmd BufRead .bowerrc set filetype=json +autocmd BufRead .babelrc set filetype=json +autocmd BufRead .eslintrc set filetype=json +autocmd BufRead .tslintrc set filetype=json diff --git a/nvim/ftdetect/markdown.vim b/nvim/ftdetect/markdown.vim new file mode 100644 index 0000000..1aaf0c1 --- /dev/null +++ b/nvim/ftdetect/markdown.vim @@ -0,0 +1 @@ +autocmd BufNewFile,BufReadPost *.md set filetype=markdown diff --git a/nvim/ftdetect/xml.vim b/nvim/ftdetect/xml.vim new file mode 100644 index 0000000..af220ce --- /dev/null +++ b/nvim/ftdetect/xml.vim @@ -0,0 +1 @@ +autocmd BufNewFile,BufRead *.svg set filetype=xml diff --git a/nvim/ftplugin/git.vim b/nvim/ftplugin/git.vim new file mode 100644 index 0000000..de2edcd --- /dev/null +++ b/nvim/ftplugin/git.vim @@ -0,0 +1 @@ +map q :q diff --git a/nvim/ftplugin/help.vim b/nvim/ftplugin/help.vim new file mode 100644 index 0000000..b570565 --- /dev/null +++ b/nvim/ftplugin/help.vim @@ -0,0 +1 @@ +map q :bd diff --git a/nvim/ftplugin/html.vim b/nvim/ftplugin/html.vim new file mode 100644 index 0000000..8d3ed19 --- /dev/null +++ b/nvim/ftplugin/html.vim @@ -0,0 +1 @@ +setlocal ts=4 sts=4 sw=4 noexpandtab indentkeys-=* diff --git a/nvim/ftplugin/javascript.vim b/nvim/ftplugin/javascript.vim new file mode 100644 index 0000000..ee9b7fa --- /dev/null +++ b/nvim/ftplugin/javascript.vim @@ -0,0 +1,3 @@ +setlocal textwidth=120 + +let g:neomake_javascript_enabled_markers = findfile('.jshintrc', '.;') != '' ? ['jshint'] : ['eslint'] diff --git a/nvim/ftplugin/markdown.vim b/nvim/ftplugin/markdown.vim new file mode 100644 index 0000000..72fe015 --- /dev/null +++ b/nvim/ftplugin/markdown.vim @@ -0,0 +1,2 @@ +setlocal textwidth=0 wrapmargin=0 wrap spell +let g:markdown_fenced_languages = ['css', 'javascript', 'js=javascript', 'json=javascript', 'stylus', 'html'] diff --git a/nvim/ftplugin/ruby.vim b/nvim/ftplugin/ruby.vim new file mode 100644 index 0000000..fdbfe82 --- /dev/null +++ b/nvim/ftplugin/ruby.vim @@ -0,0 +1 @@ +setlocal ts=2 sts=2 sw=2 expandtab diff --git a/nvim/ftplugin/swift.vim b/nvim/ftplugin/swift.vim new file mode 100644 index 0000000..21f3697 --- /dev/null +++ b/nvim/ftplugin/swift.vim @@ -0,0 +1,20 @@ +let g:neomake_swift_swift_maker = { + \ 'args': [ 'build' ], + \ 'append_file': 0, + \ 'errorformat': + \ '%E%f:%l:%c: error: %m,' . + \ '%W%f:%l:%c: warning: %m,' . + \ '%Z%\s%#^~%#,' . + \ '%-G%.%#', + \ } + +let g:neomake_swift_swiftc_maker = { + \ 'args': [ '-parse' ], + \ 'errorformat': + \ '%E%f:%l:%c: error: %m,' . + \ '%W%f:%l:%c: warning: %m,' . + \ '%Z%\s%#^~%#,' . + \ '%-G%.%#', + \ } + +let g:neomake_swift_enabled_makers = ['swift'] diff --git a/nvim/ftplugin/typescript.vim b/nvim/ftplugin/typescript.vim new file mode 100644 index 0000000..9849461 --- /dev/null +++ b/nvim/ftplugin/typescript.vim @@ -0,0 +1,9 @@ +let g:neomake_typescript_tsc_maker = { + \ 'args': [ '-m', 'commonjs', '--noEmit' ], + \ 'append_file': 0, + \ 'errorformat': + \ '%E%f %#(%l\,%c): error %m,' . + \ '%E%f %#(%l\,%c): %m,' . + \ '%Eerror %m,' . + \ '%C%\s%\+%m' +\ } diff --git a/nvim/ftplugin/xml.vim b/nvim/ftplugin/xml.vim new file mode 100644 index 0000000..3646e5a --- /dev/null +++ b/nvim/ftplugin/xml.vim @@ -0,0 +1 @@ +exe ":silent %!xmllint --format --recover - 2>/dev/null" diff --git a/nvim/functions.vim b/nvim/functions.vim new file mode 100644 index 0000000..969c13c --- /dev/null +++ b/nvim/functions.vim @@ -0,0 +1,218 @@ +" ---------------------------------------- +" Functions +" ---------------------------------------- + + +" --------------- +" Return Cursor Position in previously editted files +" --------------- +" http://vim.wikia.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session +" Restore cursor to file position in previous editing session +" To disable this, add the following to your .vimrc.before.local file: +" let g:ms_vim_no_restore_cursor = 1 +if !exists('g:ms_vim_no_restore_cursor') + function! ResCur() + if line("'\"") <= line("$") + silent! normal! g`" + return 1 + endif + endfunction +endif + +" --------------- +" Quick spelling fix (first item in z= list) +" --------------- +function! QuickSpellingFix() + if &spell + normal 1z= + else + " Enable spelling mode and do the correction + set spell + normal 1z= + set nospell + endif +endfunction + +command! QuickSpellingFix call QuickSpellingFix() +nnoremap z :QuickSpellingFix + +" --------------- +" Convert Ruby 1.8 hash rockets to 1.9 JSON style hashes. +" From: http://git.io/cxmJDw +" Note: Defaults to the entire file unless in visual mode. +" --------------- +command! -bar -range=% NotRocket execute + \',s/:\(\w\+\)\s*=>/\1:/e' + \ . (&gdefault ? '' : 'g') + +" ------------------------------------ +" Convert .should rspec syntax to expect. +" From: https://coderwall.com/p/o2oyrg +" ------------------------------------ +command! -bar -range=% Expect execute + \',s/\(\S\+\).should\(\s\+\)==\s*\(.\+\)' . + \'/expect(\1).to\2eq(\3)/e' . + \(&gdefault ? '' : 'g') + +" --------------- +" Strip Trailing White Space +" --------------- +" From http://vimbits.com/bits/377 +" Preserves/Saves the state, executes a command, and returns to the saved state +function! StripTrailingWhitespace() + " Preparation: save last search, and cursor position. + let _s=@/ + let l = line(".") + let c = col(".") + " do the business: + %s/\s\+$//e + " clean up: restore previous search history, and cursor position + let @/=_s + call cursor(l, c) +endfunction + +command! StripTrailingWhitespace :call StripTrailingWhitespace() +nnoremap stw :silent! StripTrailingWhitespace() + +" --------------- +" Paste using Paste Mode +" +" Keeps indentation in source. +" --------------- +function! PasteWithPasteMode() + if &paste + normal p + else + " Enable paste mode and paste the text, then disable paste mode. + set paste + normal p + set nopaste + endif +endfunction + +command! PasteWithPasteMode call PasteWithPasteMode() +nnoremap p :PasteWithPasteMode + +" --------------- +" Write Buffer if Necessary +" +" Writes the current buffer if it's needed, unless we're the in QuickFix mode. +" --------------- + +function WriteBufferIfNecessary() + if &modified && !&readonly + :write + endif +endfunction +command! WriteBufferIfNecessary call WriteBufferIfNecessary() + +function CRWriteIfNecessary() + if &filetype == "qf" + " Execute a normal enter when in Quickfix list. + execute "normal! \" + else + WriteBufferIfNecessary + endif +endfunction + +" Clear the search buffer when hitting return +" Idea for MapCR from http://git.io/pt8kjA +function! MapCR() + nnoremap :call CRWriteIfNecessary() +endfunction +call MapCR() + +" --------------- +" Make a scratch buffer with all of the leader keybindings. +" +" Adapted from http://ctoomey.com/posts/an-incremental-approach-to-vim/ +" --------------- +function! ListLeaders() + silent! redir @b + silent! nmap + silent! redir END + silent! new + silent! set buftype=nofile + silent! set bufhidden=hide + silent! setlocal noswapfile + silent! put! b + silent! g/^s*$/d + silent! %s/^.*,// + silent! normal ggVg + silent! sort + silent! let lines = getline(1,"$") + silent! normal +endfunction + +command! ListLeaders :call ListLeaders() + +function! CopyMatches(reg) + let hits = [] + %s//\=len(add(hits, submatch(0))) ? submatch(0) : ''/ge + let reg = empty(a:reg) ? '+' : a:reg + execute 'let @'.reg.' = join(hits, "\n") . "\n"' +endfunction +command! -register CopyMatches call CopyMatches() + +function! YankLineWithoutNewline() + let l = line(".") + let c = col(".") + normal ^y$ + " Clean up: restore previous search history, and cursor position + call cursor(l, c) +endfunction + +nnoremap yl :call YankLineWithoutNewline() + +" Show the word frequency of the current buffer in a split. +" from: http://vim.wikia.com/wiki/Word_frequency_statistics_for_a_file +function! WordFrequency() range + let all = split(join(getline(a:firstline, a:lastline)), '\A\+') + let frequencies = {} + for word in all + let frequencies[word] = get(frequencies, word, 0) + 1 + endfor + new + setlocal buftype=nofile bufhidden=hide noswapfile tabstop=20 + for [key,value] in items(frequencies) + call append('$', key."\t".value) + endfor + sort i +endfunction +command! -range=% WordFrequency ,call WordFrequency() + +" --------------- +" Sort attributes inside <> in html. +" E.g. +"
+" +" becomes +" +"
+" --------------- +function! SortAttributes() + normal vi>kojV + :'<,'>sort +endfunction + +command! SortAttributes call SortAttributes() +nnoremap sa :SortAttributes + +" --------------- +" Sort values inside a curl block +" --------------- +function! SortBlock() + normal vi} + :'<,'>sort +endfunction + +command! SortBlock call SortBlock() +nnoremap sb :SortBlock diff --git a/nvim/init.vim b/nvim/init.vim new file mode 100644 index 0000000..ed03404 --- /dev/null +++ b/nvim/init.vim @@ -0,0 +1,39 @@ +" try to run local vimrc settings specific to folder +try + source vimrc.local +catch +endtry + +let g:config_file_location='/home/mayank/.my_configs/nvim/' +let g:runtime_data_location='/home/mayank/.local/share/nvim/' + +exe 'set runtimepath+='. g:config_file_location + +" Load plugin-specific configuration. +exe 'source '. g:config_file_location. 'plugins.vim' + +" Load platform-specific configuration. +exe 'source '. g:config_file_location. 'platforms.vim' + +" All of the Vim configuration. +exe 'source '. g:config_file_location. 'config.vim' + +" New commands +exe 'source '. g:config_file_location. 'commands.vim' + +" Small custom functions. +exe 'source '. g:config_file_location. 'functions.vim' + +" All hotkeys, not dependant on plugins, are mapped here. +exe 'source '. g:config_file_location. 'mappings.vim' + +" Auto commands. +exe 'source '. g:config_file_location. 'autocmds.vim' + +" try to run local vimrc settings specific to folder +" again if something has changed +try + source vimrc.local +catch +endtry + diff --git a/nvim/mappings.vim b/nvim/mappings.vim new file mode 100644 index 0000000..dd68c02 --- /dev/null +++ b/nvim/mappings.vim @@ -0,0 +1,207 @@ +" ---------------------------------------- +" Mappings +" ---------------------------------------- + +" Set leader to , +" Note: This line MUST come before any mappings +let mapleader=',' +let maplocalleader = ' ' + + +" --------------- +" Regular Mappings +" --------------- + +" Make Y behave like other capital commands. +" Yank from the cursor to the end of the line, to be consistent with C and D. +" Hat-tip http://vimbits.com/bits/11 +nnoremap Y y$ + +" Just to beginning and end of lines easier. From http://vimbits.com/bits/16 +noremap H ^ +noremap L $ + +" Create newlines without entering insert mode +nnoremap go ok +nnoremap gO Oj + +" remap U to for easier redo +" from http://vimbits.com/bits/356 +nnoremap U + +" Swap implementations of ` and ' jump to markers +" By default, ' jumps to the marked line, ` jumps to the marked line and +" column, so swap them +nnoremap ' ` +nnoremap ` ' + +" Don't move on * +nnoremap * :let stay_star_view = winsaveview()*:call winrestview(stay_star_view) + +" --------------- +" Window Movement +" --------------- +" Easier moving in tabs and windows +" The lines conflict with the default digraph mapping of +" If you prefer that functionality, add the following to your +" .vimrc.before.local file: +" let g:ms_vim_no_easyWindows = 1 +if !exists('g:ms_vim_no_easyWindows') + map j_ + map k_ + map l_ + map h_ +endif + +" Equal Size Windows +map = = + + +" --------------- +" Modifer Mappings +" --------------- + +" Make line completion easier. +inoremap + +" Scroll larger amounts with C-j / C-k +nnoremap gj 15gjzz +nnoremap gk 15gkzz +vnoremap gj 15gjzz +vnoremap gk 15gkzz + +" --------------- +" Insert Mode Mappings +" --------------- + +" Let's make escape better, together. +inoremap jk +inoremap JK +inoremap Jk +inoremap jK + +" --------------- +" Leader Mappings +" --------------- + +" Clear search +noremap / :nohls + +" Highlight search word under cursor without jumping to next +nnoremap h * + +" Toggle spelling mode +nnoremap sp :set spell! + +" Quickly switch to last buffer +nnoremap , :e# + +" Underline the current line with '-' +nnoremap ul :t.\|s/./-/\|:nohls + +" Underline the current line with '=' +nnoremap uul :t.\|s/./=/\|:nohls + +" Surround the commented line with lines. +" +" Example: +" # Test 123 +" becomes +" # -------- +" # Test 123 +" # -------- +nnoremap cul :normal "lyy"lpwvLr-^"lyyk"lP + +" Format the entire file +nnoremap fef mx=ggG='x + +" Format a json file with Underscore CLI +" Inspirited by https://github.com/spf13/spf13-vim/blob/3.0/.vimrc#L390 +nnoremap fj :%!underscore print:set filetype=json + +" Split window vertically or horizontally *and* switch to the new split! +nnoremap hs :split:wincmd j:wincmd = +nnoremap vs :vsplit:wincmd l:wincmd = + +" Close the current window +nnoremap :close + +" Code folding options +nmap f0 :set foldlevel=0 +nmap f1 :set foldlevel=1 +nmap f2 :set foldlevel=2 +nmap f3 :set foldlevel=3 +nmap f4 :set foldlevel=4 +nmap f5 :set foldlevel=5 +nmap f6 :set foldlevel=6 +nmap f7 :set foldlevel=7 +nmap f8 :set foldlevel=8 +nmap f9 :set foldlevel=9 + +" Find merge conflict markers +map fc /\v^[<\|=>]{7}( .*\|$) + +" Visual shifting (does not exit Visual mode) +vnoremap < >gv + +" Allow using the repeat operator with a visual selection (!) +" http://stackoverflow.com/a/8064607/127816 +vnoremap . :normal . + +" Some helpers to edit mode +" http://vimcasts.org/e/14 +cnoremap %% =fnameescape(expand('%:h')).'/' +map ew :e %% + +" Easier formatting +nnoremap f gwip + + +" --------------- +" Typo Fixes +" --------------- + +noremap +inoremap +cnoremap w' w + +" Disable the ever-annoying Ex mode shortcut key. Type visual my ass. Instead, +" make Q repeat the last macro instead. *hat tip* http://vimbits.com/bits/263 +nnoremap Q @@ + +" Removes doc lookup mapping because it's easy to fat finger and never useful. +nnoremap K k +vnoremap K k + +" Toggle paste mode with F5 +nnoremap :set paste! + +" Paste and select pasted +nnoremap gpp '`[' . strpart(getregtype(), 0, 1) . '`]' + +" Insert date +iabbrev ddate =strftime("%Y-%m-%d") + +" copy current file name (relative/absolute) to system clipboard +" from http://stackoverflow.com/a/17096082/22423 +if has('mac') || has('gui_macvim') || has('gui_mac') + " relative path (src/foo.txt) + nnoremap yp :let @*=expand("%") + + " absolute path (/something/src/foo.txt) + nnoremap yP :let @*=expand("%:p") + + " filename (foo.txt) + nnoremap yf :let @*=expand("%:t") + + " directory name (/something/src) + nnoremap yd :let @*=expand("%:p:h") +endif + +" Wrapped lines goes down/up to next row, rather than next line in file. +noremap j gj +noremap k gk + +" For when you forget to sudo.. Really Write the file. +cmap w!! w !sudo tee % >/dev/null diff --git a/nvim/platforms.vim b/nvim/platforms.vim new file mode 100644 index 0000000..166660b --- /dev/null +++ b/nvim/platforms.vim @@ -0,0 +1,58 @@ +" ---------------------------------------- +" Platform Specific Configuration +" ---------------------------------------- + +if has('win32') || has('win64') + " Windows + source $VIMRUNTIME/mswin.vim + set guifont=Consolas:h10 + set guioptions-=T " Toolbar + set guioptions-=m " Menubar + + " Set height and width on Windows + set lines=80 + set columns=120 + + " Disable quickfixsigns on Windows due to incredible slowdown. + let g:loaded_quickfixsigns=1 + + " Windows has a nasty habit of launching gVim in the wrong working directory + cd ~ +elseif has('gui_macvim') + " MacVim + + " Custom Source Code font for Powerline + " From: https://github.com/Lokaltog/powerline-fonts + set guifont=Source\ Code\ Pro\ for\ Powerline:h12 + + " Hide Toolbar in MacVim + if has('gui_running') + set guioptions=egmrt + endif + + " Use option (alt) as meta key. + set macmeta + " D-t + macmenu &File.New\ Tab key= + " D-p + macmenu &File.Print key= + + " D-p + macmenu Edit.Find.Find\.\.\. key= + + " D-b + macmenu &Tools.Make key= + " D-l + macmenu &Tools.List\ Errors key= + set visualbell " Keeps the audio bell from sounding in the GUI +endif + +if has('macunix') || has('mac') + " Fix meta key for Mac + let c='a' + while c <= 'z' + exec "set =\e".c + exec "imap \e".c." " + let c = nr2char(1+char2nr(c)) + endw +endif diff --git a/nvim/plugins.vim b/nvim/plugins.vim new file mode 100644 index 0000000..433356e --- /dev/null +++ b/nvim/plugins.vim @@ -0,0 +1,34 @@ +" ---------------------------------------- +" Plugins using vim-plug +" ---------------------------------------- + +set nocompatible " Don't use compatibility mode +filetype off " required for plug install +let g:plugin_config_location=g:config_file_location.'vim_plugins/' + +" Specify a directory for plugins (for Neovim: ~/.local/share/nvim/plugged) +call plug#begin(g:runtime_data_location . 'plugged') + +" Source all the plugins with a global variable set that ensures only the +" Plugin 'name' code will be called. +let g:vim_plug_installing_plugins = 1 +for file in split(glob(g:plugin_config_location.'*.vim'), '\n') + exe 'source' fnameescape(file) +endfor +for file in split(glob(g:plugin_config_location.'custom/*.vim'), '\n') + exe 'source' fnameescape(file) +endfor +unlet g:vim_plug_installing_plugins + +call plug#end() + +" Automatically detect file types. (must turn on after vim-plug) +filetype plugin indent on + +" Source all the plugin files again, this time loading their configuration. +for file in split(glob(g:plugin_config_location.'*.vim'), '\n') + exe 'source' file +endfor +for file in split(glob(g:plugin_config_location.'custom/*.vim'), '\n') + exe 'source' file +endfor diff --git a/nvim/portkey.json b/nvim/portkey.json new file mode 100644 index 0000000..56da577 --- /dev/null +++ b/nvim/portkey.json @@ -0,0 +1,15 @@ +{ + "portkeys": [], + "vundle_plugins/*.vim": { + "type": "plugin" + }, + "after/**": { + "type": "after" + }, + "../.runtime_files/MyUltiSnips/**": { + "type": "snippet" + }, + "ftplugin/**": { + "type": "ftplugin" + } +} diff --git a/nvim/vim_plugins/HelpClose.vim b/nvim/vim_plugins/HelpClose.vim new file mode 100644 index 0000000..05ba0ee --- /dev/null +++ b/nvim/vim_plugins/HelpClose.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'HelpClose' + finish +endif diff --git a/nvim/vim_plugins/Join.vim b/nvim/vim_plugins/Join.vim new file mode 100644 index 0000000..5100e8b --- /dev/null +++ b/nvim/vim_plugins/Join.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'sk1418/Join' + finish +endif diff --git a/nvim/vim_plugins/L9.vim b/nvim/vim_plugins/L9.vim new file mode 100644 index 0000000..de040f1 --- /dev/null +++ b/nvim/vim_plugins/L9.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'L9' + finish +endif diff --git a/nvim/vim_plugins/ListToggle.vim b/nvim/vim_plugins/ListToggle.vim new file mode 100644 index 0000000..98b9eae --- /dev/null +++ b/nvim/vim_plugins/ListToggle.vim @@ -0,0 +1,7 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'Valloric/ListToggle' + finish +endif + +let g:lt_location_list_toggle_map = 'l' +let g:lt_quickfix_list_toggle_map = 'q' diff --git a/nvim/vim_plugins/MatchTagAlways.vim b/nvim/vim_plugins/MatchTagAlways.vim new file mode 100644 index 0000000..ae3f9f2 --- /dev/null +++ b/nvim/vim_plugins/MatchTagAlways.vim @@ -0,0 +1,12 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'Valloric/MatchTagAlways' + finish +endif + +let g:mta_filetypes = { + \ 'html' : 1, + \ 'xhtml' : 1, + \ 'xml' : 1, + \ 'handlebars' : 1, + \ 'eruby' : 1, + \} diff --git a/nvim/vim_plugins/PIV.vim b/nvim/vim_plugins/PIV.vim new file mode 100644 index 0000000..b979f34 --- /dev/null +++ b/nvim/vim_plugins/PIV.vim @@ -0,0 +1,7 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'spf13/PIV', { 'for': 'php' } + finish +endif + +let g:DisableAutoPHPFolding = 0 +let g:PIVAutoClose = 0 diff --git a/nvim/vim_plugins/QFEnter.vim b/nvim/vim_plugins/QFEnter.vim new file mode 100644 index 0000000..6d0d36d --- /dev/null +++ b/nvim/vim_plugins/QFEnter.vim @@ -0,0 +1,6 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'yssl/QFEnter' + finish +endif + +let g:qfenter_open_map = ['', '<2-LeftMouse>'] diff --git a/nvim/vim_plugins/YouCompleteMe.vim b/nvim/vim_plugins/YouCompleteMe.vim new file mode 100644 index 0000000..c56e98b --- /dev/null +++ b/nvim/vim_plugins/YouCompleteMe.vim @@ -0,0 +1,36 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'Valloric/YouCompleteMe', { 'do': './install.py' } + finish +endif + +let g:ycm_complete_in_comments = 1 +let g:ycm_seed_identifiers_with_syntax = 1 +let g:ycm_collect_identifiers_from_comments_and_strings = 1 +let g:ycm_use_ultisnips_completer = 1 +let g:ycm_filetype_specific_completion_to_disable = { + \ 'ruby' : 1, + \ 'javascript' : 1, + \ 'jsx' : 1, + \} + +let g:ycm_semantic_triggers = { + \ 'cs,java,javascript,typescript,d,python,perl6,scala,vb,elixir,go' : ['.'], + \ 'ruby' : ['.', '::'], + \ 'gitcommit' : ['#', ':'], + \ } + + +" Overwritten so we can allow markdown completion. +let g:ycm_filetype_blacklist = { + \ 'notes': 1, + \ 'unite': 1, + \ 'tagbar': 1, + \ 'pandoc': 1, + \ 'qf': 1, + \ 'vimwiki': 1, + \ 'text': 1, + \ 'infolog': 1, + \ 'mail': 1 +\} + +let g:ycm_global_ycm_extra_conf = "~/.vim/.runtime_files/.YouCompleteMe_files/.ycm_extra_conf.py" diff --git a/nvim/vim_plugins/ZoomWin.vim b/nvim/vim_plugins/ZoomWin.vim new file mode 100644 index 0000000..3272b24 --- /dev/null +++ b/nvim/vim_plugins/ZoomWin.vim @@ -0,0 +1,7 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'ZoomWin' + finish +endif + +" Zoom Window to Full Size +nnoremap wo :ZoomWin diff --git a/nvim/vim_plugins/ack.vim b/nvim/vim_plugins/ack.vim new file mode 100644 index 0000000..d6a00cb --- /dev/null +++ b/nvim/vim_plugins/ack.vim @@ -0,0 +1,6 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'mileszs/ack.vim' + finish +endif + +let g:ackprg = 'ag --vimgrep' diff --git a/nvim/vim_plugins/base16-vim.vim b/nvim/vim_plugins/base16-vim.vim new file mode 100644 index 0000000..0828d0b --- /dev/null +++ b/nvim/vim_plugins/base16-vim.vim @@ -0,0 +1,9 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'chriskempson/base16-vim' + finish +endif + +let base16colorspace=256 +if filereadable(expand("~/.vimrc_background")) + source ~/.vimrc_background +endif diff --git a/nvim/vim_plugins/colorv.vim b/nvim/vim_plugins/colorv.vim new file mode 100644 index 0000000..1c82db7 --- /dev/null +++ b/nvim/vim_plugins/colorv.vim @@ -0,0 +1,8 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'Rykka/colorv.vim' + finish +endif + +let g:colorv_preview_ftype = 'css,javascript,scss,stylus' +let g:colorv_cache_file=g:runtime_data_location . 'vim_colorv_cache' +let g:colorv_cache_fav=g:runtime_data_location . 'vim_colorv_cache_fav' diff --git a/nvim/vim_plugins/csv.vim b/nvim/vim_plugins/csv.vim new file mode 100644 index 0000000..2d2cf68 --- /dev/null +++ b/nvim/vim_plugins/csv.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'chrisbra/csv.vim', { 'for': 'csv' } + finish +endif diff --git a/nvim/vim_plugins/custom/.gitkeep b/nvim/vim_plugins/custom/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/nvim/vim_plugins/delimitMate.vim b/nvim/vim_plugins/delimitMate.vim new file mode 100644 index 0000000..46e5c1e --- /dev/null +++ b/nvim/vim_plugins/delimitMate.vim @@ -0,0 +1,7 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'Raimondi/delimitMate' + finish +endif + +let g:delimitMate_expand_cr=1 +let g:delimitMate_expand_space=1 diff --git a/nvim/vim_plugins/editorconfig-vim.vim b/nvim/vim_plugins/editorconfig-vim.vim new file mode 100644 index 0000000..6bac4ce --- /dev/null +++ b/nvim/vim_plugins/editorconfig-vim.vim @@ -0,0 +1,5 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'editorconfig/editorconfig-vim' + finish +endif + diff --git a/nvim/vim_plugins/elm.vim b/nvim/vim_plugins/elm.vim new file mode 100644 index 0000000..6383df6 --- /dev/null +++ b/nvim/vim_plugins/elm.vim @@ -0,0 +1,5 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'lambdatoast/elm.vim', { 'for': 'elm' } + finish +endif + diff --git a/nvim/vim_plugins/ember.vim b/nvim/vim_plugins/ember.vim new file mode 100644 index 0000000..d603ec5 --- /dev/null +++ b/nvim/vim_plugins/ember.vim @@ -0,0 +1,6 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'dsawardekar/ember.vim', { 'for': 'javascript' } + finish +endif + +nnoremap ert :Eapp router.coffee diff --git a/nvim/vim_plugins/emmet-vim.vim b/nvim/vim_plugins/emmet-vim.vim new file mode 100644 index 0000000..dc1e2cd --- /dev/null +++ b/nvim/vim_plugins/emmet-vim.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'mattn/emmet-vim', { 'for': 'html' } + finish +endif diff --git a/nvim/vim_plugins/fzf.vim b/nvim/vim_plugins/fzf.vim new file mode 100644 index 0000000..be3077d --- /dev/null +++ b/nvim/vim_plugins/fzf.vim @@ -0,0 +1,13 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'junegunn/fzf', { 'do': './install --all' } + Plug 'junegunn/fzf.vim' + finish +endif + +nnoremap fzf :FZF +vnoremap fzf :FZF + +nnoremap fzh :FZF ~ +vnoremap fzh :FZF ~ + + diff --git a/nvim/vim_plugins/gist-vim.vim b/nvim/vim_plugins/gist-vim.vim new file mode 100644 index 0000000..5a0a660 --- /dev/null +++ b/nvim/vim_plugins/gist-vim.vim @@ -0,0 +1,9 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'mattn/gist-vim' + finish +endif + +if has('macunix') || has('mac') + let g:gist_clip_command = 'pbcopy' +endif +let g:gist_post_private = 1 diff --git a/nvim/vim_plugins/github-complete.vim b/nvim/vim_plugins/github-complete.vim new file mode 100644 index 0000000..8638806 --- /dev/null +++ b/nvim/vim_plugins/github-complete.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'rhysd/github-complete.vim', { 'for': ['markdown', 'git'] } + finish +endif diff --git a/nvim/vim_plugins/goyo.vim b/nvim/vim_plugins/goyo.vim new file mode 100644 index 0000000..860dea8 --- /dev/null +++ b/nvim/vim_plugins/goyo.vim @@ -0,0 +1,46 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'junegunn/goyo.vim', { 'on': 'Goyo' } " distraction-free writing + finish +endif + +let g:goyo_width=95 +let g:goyo_height=90 + +function! s:goyo_enter() + silent !tmux set status off + silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z + set noshowmode + set noshowcmd + set scrolloff=999 + set mouse= + Limelight + delcommand ZoomWin + let b:quitting = 0 + let b:quitting_bang = 0 + autocmd QuitPre let b:quitting = 1 + cabbrev q! let b:quitting_bang = 1 q! + " ... +endfunction + +function! s:goyo_leave() + silent !tmux set status on + silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z + set showmode + set showcmd + set scrolloff=5 + set mouse=a + Limelight! + command! ZoomWin call ZoomWin() + " Quit Vim if this is the only remaining buffer + if b:quitting && len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1 + if b:quitting_bang + qa! + else + qa + endif + endif + " ... +endfunction + +autocmd! User GoyoEnter nested call goyo_enter() +autocmd! User GoyoLeave nested call goyo_leave() diff --git a/nvim/vim_plugins/html5.vim b/nvim/vim_plugins/html5.vim new file mode 100644 index 0000000..2370b02 --- /dev/null +++ b/nvim/vim_plugins/html5.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'othree/html5.vim', { 'for': 'html' } " html5 support + finish +endif diff --git a/nvim/vim_plugins/indenthtml.vim b/nvim/vim_plugins/indenthtml.vim new file mode 100644 index 0000000..13085a3 --- /dev/null +++ b/nvim/vim_plugins/indenthtml.vim @@ -0,0 +1,10 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'indenthtml.vim', { 'for': 'html' } " html indent support + finish +endif + +" Setup indenthtml to propertly indent html. Without this, formatting doesn't +" work on html. +let g:html_indent_inctags = "html,body,head,tbody" +let g:html_indent_script1 = "inc" +let g:html_indent_style1 = "inc" diff --git a/nvim/vim_plugins/limelight.vim b/nvim/vim_plugins/limelight.vim new file mode 100644 index 0000000..cfd94f3 --- /dev/null +++ b/nvim/vim_plugins/limelight.vim @@ -0,0 +1,5 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'junegunn/limelight.vim', { 'on': 'Limelight' } " focus tool. Good for presentating with vim + finish +endif + diff --git a/nvim/vim_plugins/matchit.zip.vim b/nvim/vim_plugins/matchit.zip.vim new file mode 100644 index 0000000..c9718ff --- /dev/null +++ b/nvim/vim_plugins/matchit.zip.vim @@ -0,0 +1,6 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'matchit.zip' " extended % matching + finish +endif + +let b:match_ignorecase = 1 diff --git a/nvim/vim_plugins/neomake.vim b/nvim/vim_plugins/neomake.vim new file mode 100644 index 0000000..86bb6ab --- /dev/null +++ b/nvim/vim_plugins/neomake.vim @@ -0,0 +1,32 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'benekastah/neomake' + finish +endif + +autocmd! BufWritePost * Neomake + +let g:neomake_list_height = 5 + +function! SetJavaScriptCheckers() + let checkers = [] + + if findfile('.eslintrc', '.;') != '' + call add(checkers, 'eslint') + endif + + if findfile('.jshintrc', '.;') != '' + call add(checkers, 'jshint') + endif + + if findfile('.jscsrc', '.;') != '' + call add(checkers, 'jscs') + endif + + if finddir('ProjectSettings', '.;') != '' + call add(checkers, 'unityscript') + endif + + let g:neomake_javascript_enabled_makers = checkers +endfunction + +autocmd FileType javascript call SetJavaScriptCheckers() diff --git a/nvim/vim_plugins/nerdtree.vim b/nvim/vim_plugins/nerdtree.vim new file mode 100644 index 0000000..a79cc50 --- /dev/null +++ b/nvim/vim_plugins/nerdtree.vim @@ -0,0 +1,30 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'scrooloose/nerdtree' + Plug 'Xuyuanp/nerdtree-git-plugin' + Plug 'ryanoasis/vim-devicons' + Plug 'tpope/vim-vinegar' + finish +endif + +" Toggle NERDTree +nmap n :NERDTreeToggle +" expand to the path of the file in the current buffer +nmap y :NERDTreeFind + + +let g:NERDShutUp=1 + +let g:NERDTreeShowBookmarks = 1 +let g:NERDTreeChDirMode = 0 +let g:NERDTreeMinimalUI = 1 +let g:NERDTreeMouseMode=1 +let g:NERDTreeShowHidden=1 + +let g:nerdtree_tabs_open_on_gui_startup=0 + +" loading the plugin +let g:webdevicons_enable = 1 +let g:webdevicons_enable_nerdtree = 1 +let g:WebDevIconsOS = 'Linux' +let g:WebDevIconsNerdTreeAfterGlyphPadding = '' +let g:WebDevIconsNerdTreeBeforeGlyphPadding = '' diff --git a/nvim/vim_plugins/nginx.vim b/nvim/vim_plugins/nginx.vim new file mode 100644 index 0000000..029e8ff --- /dev/null +++ b/nvim/vim_plugins/nginx.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'blueyed/nginx.vim', { 'for': 'nginx' } + finish +endif diff --git a/nvim/vim_plugins/open-browser.vim b/nvim/vim_plugins/open-browser.vim new file mode 100644 index 0000000..2a6ac2e --- /dev/null +++ b/nvim/vim_plugins/open-browser.vim @@ -0,0 +1,7 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'tyru/open-browser.vim' + finish +endif + +nmap o (openbrowser-smart-search) +vmap o (openbrowser-smart-search) diff --git a/nvim/vim_plugins/portkey.vim b/nvim/vim_plugins/portkey.vim new file mode 100644 index 0000000..b1f4faf --- /dev/null +++ b/nvim/vim_plugins/portkey.vim @@ -0,0 +1,7 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'dsawardekar/portkey' + finish +endif + +let g:portkey_autostart = 1 +nnoremap A :Alternate diff --git a/nvim/vim_plugins/presenting.vim b/nvim/vim_plugins/presenting.vim new file mode 100644 index 0000000..cd5d2db --- /dev/null +++ b/nvim/vim_plugins/presenting.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'sotte/presenting.vim', { 'for': 'markdown' } " a simple tool for presenting slides in vim based on text files + finish +endif diff --git a/nvim/vim_plugins/rainbow.vim b/nvim/vim_plugins/rainbow.vim new file mode 100644 index 0000000..aa62906 --- /dev/null +++ b/nvim/vim_plugins/rainbow.vim @@ -0,0 +1,6 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'luochen1990/rainbow' + finish +endif + +let g:rainbow_active = 1 "0 if you want to enable it later via :RainbowToggle diff --git a/nvim/vim_plugins/scratch.vim b/nvim/vim_plugins/scratch.vim new file mode 100644 index 0000000..0230d25 --- /dev/null +++ b/nvim/vim_plugins/scratch.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'scratch.vim' + finish +endif diff --git a/nvim/vim_plugins/spf13_plugins.vim b/nvim/vim_plugins/spf13_plugins.vim new file mode 100644 index 0000000..6aecf75 --- /dev/null +++ b/nvim/vim_plugins/spf13_plugins.vim @@ -0,0 +1,49 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'MarcWeber/vim-addon-mw-utils' + Plug 'tomtom/tlib_vim' + Plug 'rhysd/conflict-marker.vim' +" Plug 'tacahiroy/ctrlp-funky' + Plug 'terryma/vim-multiple-cursors' + Plug 'powerline/fonts' +" Plug 'ryanoasis/nerd-fonts' " very large font set + Plug 'bling/vim-bufferline' + Plug 'jistr/vim-nerdtree-tabs' + Plug 'vim-scripts/restore_view.vim' + Plug 'osyo-manga/vim-over' + Plug 'kana/vim-textobj-indent' + Plug 'gcmt/wildfire.vim' + Plug 'reedes/vim-litecorrect' + Plug 'reedes/vim-textobj-sentence' + Plug 'reedes/vim-textobj-quote' + Plug 'reedes/vim-wordy' + Plug 'scrooloose/nerdcommenter' +" Plug 'tpope/vim-commentary' +" Plug 'Shougo/neosnippet' +" Plug 'Shougo/neosnippet-snippets' + Plug 'arnaud-lb/vim-php-namespace', { 'for': 'php' } +" Plug 'lumiliet/vim-twig', { 'for': 'twig' } + Plug 'klen/python-mode', { 'for': 'python' } + Plug 'pwolfram/python.vim', { 'for': 'python' } + Plug 'python_match.vim', { 'for': 'python' } + Plug 'pythoncomplete', { 'for': 'python' } +" Plug 'briancollins/vim-jst' , { 'for': 'jst' } + Plug 'vim-scripts/HTML-AutoCloseTag', { 'for': 'html' } + Plug 'ap/vim-css-color', { 'for': ['css','less','sass','javascript','python','stylus'] } + Plug 'cakebaker/scss-syntax.vim', { 'for': 'scss' } " sass scss syntax support + Plug 'tpope/vim-rails', { 'for': 'ruby' } + Plug 'rust-lang/rust.vim', { 'for': 'rust' } + Plug 'JamshedVesuna/vim-markdown-preview', { 'for': 'markdown' } + Plug 'cespare/vim-toml', { 'for': 'toml' } + Plug 'quentindecock/vim-cucumber-align-pipes' + Plug 'saltstack/salt-vim', { 'for': 'sls' } + Plug 'stephpy/vim-yaml', { 'for': 'yaml' } + Plug 'maxbrunsfeld/vim-yankstack' + " TypeScript + Plug 'Quramy/tsuquyomi', { 'for': 'typescript', 'do': 'npm install' } " extended typescript support - works as a client for TSServer + Plug 'clausreinke/typescript-tools.vim', { 'for': 'typescript' } " typescript tools + Plug 'leafgarland/typescript-vim', { 'for': 'typescript' } " typescript support +endif + +" for vim-scripts/restore_view.vim +set viewoptions=cursor,folds,slash,unix +" let g:skipview_files = ['*\.vim'] diff --git a/nvim/vim_plugins/splitjoin.vim b/nvim/vim_plugins/splitjoin.vim new file mode 100644 index 0000000..6eb8f56 --- /dev/null +++ b/nvim/vim_plugins/splitjoin.vim @@ -0,0 +1,12 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'AndrewRadev/splitjoin.vim' + finish +endif + +let g:splitjoin_split_mapping = '' +let g:splitjoin_join_mapping = '' +let g:splitjoin_trailing_comma = 1 +let g:splitjoin_align = 1 + +nnoremap sj :SplitjoinSplit +nnoremap sk :SplitjoinJoin diff --git a/nvim/vim_plugins/supertab.vim b/nvim/vim_plugins/supertab.vim new file mode 100644 index 0000000..e845caa --- /dev/null +++ b/nvim/vim_plugins/supertab.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'ervandew/supertab' + finish +endif diff --git a/nvim/vim_plugins/swift.vim b/nvim/vim_plugins/swift.vim new file mode 100644 index 0000000..2dc7867 --- /dev/null +++ b/nvim/vim_plugins/swift.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'keith/swift.vim', { 'for': 'swift' } + finish +endif diff --git a/nvim/vim_plugins/switch.vim b/nvim/vim_plugins/switch.vim new file mode 100644 index 0000000..f5c00cb --- /dev/null +++ b/nvim/vim_plugins/switch.vim @@ -0,0 +1,6 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'AndrewRadev/switch.vim' + finish +endif + +let g:switch_mapping = '-' diff --git a/nvim/vim_plugins/synastic.vim b/nvim/vim_plugins/synastic.vim new file mode 100644 index 0000000..c31bdb5 --- /dev/null +++ b/nvim/vim_plugins/synastic.vim @@ -0,0 +1,21 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'scrooloose/syntastic' + finish +endif + +set statusline+=%#warningmsg# +set statusline+=%{SyntasticStatuslineFlag()} +set statusline+=%* + +let g:syntastic_always_populate_loc_list = 1 +let g:syntastic_auto_loc_list = 1 +let g:syntastic_check_on_open = 1 +let g:syntastic_check_on_wq = 0 + +let g:syntastic_c_compiler='gcc' + + + + + + diff --git a/nvim/vim_plugins/tabular.vim b/nvim/vim_plugins/tabular.vim new file mode 100644 index 0000000..e04ac18 --- /dev/null +++ b/nvim/vim_plugins/tabular.vim @@ -0,0 +1,11 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'godlygeek/tabular' + finish +endif + +nnoremap t= :Tabularize assignment +vnoremap t= :Tabularize assignment +nnoremap t: :Tabularize symbol +vnoremap t: :Tabularize symbol +nnoremap t, :Tabularize comma +vnoremap t, :Tabularize comma diff --git a/nvim/vim_plugins/tagbar.vim b/nvim/vim_plugins/tagbar.vim new file mode 100644 index 0000000..c062c60 --- /dev/null +++ b/nvim/vim_plugins/tagbar.vim @@ -0,0 +1,7 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'majutsushi/tagbar' + finish +endif + + +nmap :TagbarToggle diff --git a/nvim/vim_plugins/taskpaper.vim b/nvim/vim_plugins/taskpaper.vim new file mode 100644 index 0000000..2f9e47a --- /dev/null +++ b/nvim/vim_plugins/taskpaper.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'mutewinter/taskpaper.vim' + finish +endif diff --git a/nvim/vim_plugins/tcomment_vim.vim b/nvim/vim_plugins/tcomment_vim.vim new file mode 100644 index 0000000..863d29b --- /dev/null +++ b/nvim/vim_plugins/tcomment_vim.vim @@ -0,0 +1,12 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'tomtom/tcomment_vim' + finish +endif + +let g:tcommentMapLeader1 = '' +let g:tcommentMapLeader2 = '' +let g:tcommentMapLeaderOp1 = 'tc' +nnoremap cc :TComment +vnoremap cc :TComment +nnoremap cb :TCommentBlock +vnoremap cb :TCommentBlock diff --git a/nvim/vim_plugins/textile.vim b/nvim/vim_plugins/textile.vim new file mode 100644 index 0000000..68922dd --- /dev/null +++ b/nvim/vim_plugins/textile.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'timcharper/textile.vim', { 'for': 'textile' } + finish +endif diff --git a/nvim/vim_plugins/tomdoc.vim b/nvim/vim_plugins/tomdoc.vim new file mode 100644 index 0000000..d4c9c34 --- /dev/null +++ b/nvim/vim_plugins/tomdoc.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'wellbredgrapefruit/tomdoc.vim' + finish +endif diff --git a/nvim/vim_plugins/ultisnips.vim b/nvim/vim_plugins/ultisnips.vim new file mode 100644 index 0000000..5cce4f2 --- /dev/null +++ b/nvim/vim_plugins/ultisnips.vim @@ -0,0 +1,14 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'SirVer/ultisnips' + Plug 'honza/vim-snippets' + finish +endif + +" let g:UltiSnipsSnippetDirectories=['.runtime_files/MyUltiSnips'] +let g:UltiSnipsExpandTrigger='' +let g:UltiSnipsJumpForwardTrigger='' +let g:UltiSnipsJumpBackwardTrigger='' + + +" If you want :UltiSnipsEdit to split your window. +let g:UltiSnipsEditSplit="vertical" diff --git a/nvim/vim_plugins/undotree.vim b/nvim/vim_plugins/undotree.vim new file mode 100644 index 0000000..98a8d10 --- /dev/null +++ b/nvim/vim_plugins/undotree.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'mbbill/undotree' + finish +endif diff --git a/nvim/vim_plugins/vim-abolish.vim b/nvim/vim_plugins/vim-abolish.vim new file mode 100644 index 0000000..1b98ea4 --- /dev/null +++ b/nvim/vim_plugins/vim-abolish.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'tpope/vim-abolish' + finish +endif diff --git a/nvim/vim_plugins/vim-airline.vim b/nvim/vim_plugins/vim-airline.vim new file mode 100644 index 0000000..1a1e22b --- /dev/null +++ b/nvim/vim_plugins/vim-airline.vim @@ -0,0 +1,28 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'vim-airline/vim-airline' + Plug 'vim-airline/vim-airline-themes' + finish +endif + +let g:airline_powerline_fonts = 1 +let g:airline_detect_modified = 1 +let g:airline#extensions#whitespace#enabled = 1 +let g:airline#extensions#hunks#enabled = 0 +let g:airline_mode_map = { + \ 'n' : 'N', + \ 'i' : 'I', + \ 'R' : 'R', + \ 'v' : 'V', + \ 'V' : 'VL', + \ 'c' : 'CMD', + \ '' : 'VB', + \ } + +let g:airline_section_z = '%3p%% %{substitute(line("."), "\\v(\\d)((\\d\\d\\d)+\\d@!)@=", "\\1,", "g")}|%{substitute(line("$"), "\\v(\\d)((\\d\\d\\d)+\\d@!)@=", "\\1,", "g")}' + +let g:airline#extensions#default#layout = [ + \ [ 'a', 'warning', 'b', 'c' ], + \ [ 'x', 'y', 'z' ] + \ ] + +let g:airline_theme = 'luna' diff --git a/nvim/vim_plugins/vim-anzu.vim b/nvim/vim_plugins/vim-anzu.vim new file mode 100644 index 0000000..ab2d11c --- /dev/null +++ b/nvim/vim_plugins/vim-anzu.vim @@ -0,0 +1,8 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'osyo-manga/vim-anzu' + finish +endif + +nmap n (anzu-n) +nmap N (anzu-N) +let g:airline#extensions#anzu#enabled = 1 diff --git a/nvim/vim_plugins/vim-autoreadwatch.vim b/nvim/vim_plugins/vim-autoreadwatch.vim new file mode 100644 index 0000000..8a2e73a --- /dev/null +++ b/nvim/vim_plugins/vim-autoreadwatch.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'mayanksuman/vim-autoreadwatch' + finish +endif diff --git a/nvim/vim_plugins/vim-bundler.vim b/nvim/vim_plugins/vim-bundler.vim new file mode 100644 index 0000000..df06c2e --- /dev/null +++ b/nvim/vim_plugins/vim-bundler.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'tpope/vim-bundler' + finish +endif diff --git a/nvim/vim_plugins/vim-coffee-script.vim b/nvim/vim_plugins/vim-coffee-script.vim new file mode 100644 index 0000000..c1db597 --- /dev/null +++ b/nvim/vim_plugins/vim-coffee-script.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'kchmck/vim-coffee-script', { 'for': 'coffee' } + finish +endif diff --git a/nvim/vim_plugins/vim-colors-solarized.vim b/nvim/vim_plugins/vim-colors-solarized.vim new file mode 100644 index 0000000..85d310e --- /dev/null +++ b/nvim/vim_plugins/vim-colors-solarized.vim @@ -0,0 +1,9 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'altercation/vim-colors-solarized' + finish +endif + +let g:solarized_termcolors=256 +let g:solarized_termtrans=1 +let g:solarized_contrast="normal" +let g:solarized_visibility="normal" diff --git a/nvim/vim_plugins/vim-css3-syntax.vim b/nvim/vim_plugins/vim-css3-syntax.vim new file mode 100644 index 0000000..830af7c --- /dev/null +++ b/nvim/vim_plugins/vim-css3-syntax.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'hail2u/vim-css3-syntax', { 'for': 'css' } + finish +endif diff --git a/nvim/vim_plugins/vim-cucumber.vim b/nvim/vim_plugins/vim-cucumber.vim new file mode 100644 index 0000000..1e060d0 --- /dev/null +++ b/nvim/vim_plugins/vim-cucumber.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'tpope/vim-cucumber' + finish +endif diff --git a/nvim/vim_plugins/vim-easy-align.vim b/nvim/vim_plugins/vim-easy-align.vim new file mode 100644 index 0000000..61a88d4 --- /dev/null +++ b/nvim/vim_plugins/vim-easy-align.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'junegunn/vim-easy-align' + finish +endif diff --git a/nvim/vim_plugins/vim-easymotion.vim b/nvim/vim_plugins/vim-easymotion.vim new file mode 100644 index 0000000..41ceb9c --- /dev/null +++ b/nvim/vim_plugins/vim-easymotion.vim @@ -0,0 +1,22 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'easymotion/vim-easymotion' + finish +endif + +" Disable default mappings +let g:EasyMotion_do_mapping = 0 +" Use uppercase target labels and type as a lower case +let g:EasyMotion_use_upper = 1 + " type `l` and match `l`&`L` +let g:EasyMotion_smartcase = 1 +" Smartsign (type `3` and match `3`&`#`) +let g:EasyMotion_use_smartsign_us = 1 + +" Bi-directional find motion +" Jump to anywhere you want with minimal keystrokes, with just one key binding. +" `s{char}{label}` +nmap s (easymotion-s) +vmap s (easymotion-s) + +map j (easymotion-j) +map k (easymotion-k) diff --git a/nvim/vim_plugins/vim-endwise.vim b/nvim/vim_plugins/vim-endwise.vim new file mode 100644 index 0000000..057d9eb --- /dev/null +++ b/nvim/vim_plugins/vim-endwise.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'tpope/vim-endwise' + finish +endif diff --git a/nvim/vim_plugins/vim-eunuch.vim b/nvim/vim_plugins/vim-eunuch.vim new file mode 100644 index 0000000..f2fb0ac --- /dev/null +++ b/nvim/vim_plugins/vim-eunuch.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'tpope/vim-eunuch' + finish +endif diff --git a/nvim/vim_plugins/vim-fugitive.vim b/nvim/vim_plugins/vim-fugitive.vim new file mode 100644 index 0000000..9987192 --- /dev/null +++ b/nvim/vim_plugins/vim-fugitive.vim @@ -0,0 +1,19 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'tpope/vim-fugitive' + finish +endif + +nnoremap gc :Gcommit -v +nnoremap gca :Gcommit -a -v +nnoremap gw :Gwrite +nnoremap gs :Gstatus +nnoremap gp :Git push + " Mnemonic, gu = Git Update +nnoremap gu :Git pull +nnoremap gd :Gvdiff +" Exit a diff by closing the diff window +nnoremap gx :wincmd h:q +" Start git command +nnoremap gi :Git +" Undo the last commit +command! Gcundo :Git reset HEAD~1 diff --git a/nvim/vim_plugins/vim-go.vim b/nvim/vim_plugins/vim-go.vim new file mode 100644 index 0000000..5b5230a --- /dev/null +++ b/nvim/vim_plugins/vim-go.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'fatih/vim-go', { 'for': 'go' , 'do': ':GoInstallBinaries' } " go support + finish +endif diff --git a/nvim/vim_plugins/vim-haml.vim b/nvim/vim_plugins/vim-haml.vim new file mode 100644 index 0000000..7110b81 --- /dev/null +++ b/nvim/vim_plugins/vim-haml.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'tpope/vim-haml' + finish +endif diff --git a/nvim/vim_plugins/vim-hardtime.vim b/nvim/vim_plugins/vim-hardtime.vim new file mode 100644 index 0000000..ffd2412 --- /dev/null +++ b/nvim/vim_plugins/vim-hardtime.vim @@ -0,0 +1,14 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'takac/vim-hardtime' + finish +endif + +let g:hardtime_default_on = 0 +let g:hardtime_ignore_buffer_patterns = ["NERD.*", "Help"] +let g:hardtime_allow_different_key = 1 +let g:hardtime_ignore_quickfix = 1 +let g:hardtime_maxcount = 1 + +let g:list_of_normal_keys = ["h", "j", "k", "l", "", "", "", ""] +let g:list_of_visual_keys = ["h", "j", "k", "l", "", "", "", ""] +let g:list_of_insert_keys = ["", "", "", ""] diff --git a/nvim/vim_plugins/vim-indent-guides.vim b/nvim/vim_plugins/vim-indent-guides.vim new file mode 100644 index 0000000..008daae --- /dev/null +++ b/nvim/vim_plugins/vim-indent-guides.vim @@ -0,0 +1,10 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'nathanaelkane/vim-indent-guides' + finish +endif + +let g:indent_guides_enable_on_vim_startup = 1 +let g:indent_guides_guide_size=1 +let g:indent_guides_start_level=2 + +let g:indent_guides_auto_colors = 0 diff --git a/nvim/vim_plugins/vim-jade.vim b/nvim/vim_plugins/vim-jade.vim new file mode 100644 index 0000000..6a73309 --- /dev/null +++ b/nvim/vim_plugins/vim-jade.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'digitaltoad/vim-jade', { 'for': ['jade', 'pug'] } " jade support + finish +endif diff --git a/nvim/vim_plugins/vim-javascript.vim b/nvim/vim_plugins/vim-javascript.vim new file mode 100644 index 0000000..212f83f --- /dev/null +++ b/nvim/vim_plugins/vim-javascript.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'pangloss/vim-javascript', { 'for': 'javascript' } " JavaScript syntax highlighting and indent support + finish +endif diff --git a/nvim/vim_plugins/vim-json.vim b/nvim/vim_plugins/vim-json.vim new file mode 100644 index 0000000..929e8e1 --- /dev/null +++ b/nvim/vim_plugins/vim-json.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'elzr/vim-json', { 'for': 'json' } " JSON support + finish +endif diff --git a/nvim/vim_plugins/vim-jsx.vim b/nvim/vim_plugins/vim-jsx.vim new file mode 100644 index 0000000..8adb2e8 --- /dev/null +++ b/nvim/vim_plugins/vim-jsx.vim @@ -0,0 +1,6 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'mxw/vim-jsx', { 'for': ['jsx', 'javascript'] } + finish +endif + +autocmd FileType javascript let g:jsx_ext_required = findfile('.jsx', '.;') != '' ? 0 : 1 diff --git a/nvim/vim_plugins/vim-less.vim b/nvim/vim_plugins/vim-less.vim new file mode 100644 index 0000000..1a1eeb1 --- /dev/null +++ b/nvim/vim_plugins/vim-less.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'groenewege/vim-less', { 'for': 'less' } + finish +endif diff --git a/nvim/vim_plugins/vim-markdown.vim b/nvim/vim_plugins/vim-markdown.vim new file mode 100644 index 0000000..b0d4516 --- /dev/null +++ b/nvim/vim_plugins/vim-markdown.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'gabrielelana/vim-markdown', { 'for': 'markdown' } + finish +endif diff --git a/nvim/vim_plugins/vim-misc.vim b/nvim/vim_plugins/vim-misc.vim new file mode 100644 index 0000000..59c3e33 --- /dev/null +++ b/nvim/vim_plugins/vim-misc.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'xolox/vim-misc' + finish +endif diff --git a/nvim/vim_plugins/vim-mustache-handlebars.vim b/nvim/vim_plugins/vim-mustache-handlebars.vim new file mode 100644 index 0000000..884fec6 --- /dev/null +++ b/nvim/vim_plugins/vim-mustache-handlebars.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'mustache/vim-mustache-handlebars', { 'for': 'mustache' } + finish +endif diff --git a/nvim/vim_plugins/vim-numbertoggle.vim b/nvim/vim_plugins/vim-numbertoggle.vim new file mode 100644 index 0000000..22b9950 --- /dev/null +++ b/nvim/vim_plugins/vim-numbertoggle.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'jeffkreeftmeijer/vim-numbertoggle' + finish +endif diff --git a/nvim/vim_plugins/vim-orgmode.vim b/nvim/vim_plugins/vim-orgmode.vim new file mode 100644 index 0000000..32481bd --- /dev/null +++ b/nvim/vim_plugins/vim-orgmode.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'jceb/vim-orgmode' + finish +endif diff --git a/nvim/vim_plugins/vim-pasta.vim b/nvim/vim_plugins/vim-pasta.vim new file mode 100644 index 0000000..8715f6d --- /dev/null +++ b/nvim/vim_plugins/vim-pasta.vim @@ -0,0 +1,6 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'sickill/vim-pasta' " context-aware pasting + finish +endif + +let g:pasta_disabled_filetypes = ['python', 'coffee', 'yaml'] diff --git a/nvim/vim_plugins/vim-rake.vim b/nvim/vim_plugins/vim-rake.vim new file mode 100644 index 0000000..c4b2f93 --- /dev/null +++ b/nvim/vim_plugins/vim-rake.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'tpope/vim-rake', { 'for': 'ruby' } + finish +endif diff --git a/nvim/vim_plugins/vim-repeat.vim b/nvim/vim_plugins/vim-repeat.vim new file mode 100644 index 0000000..d21c3e7 --- /dev/null +++ b/nvim/vim_plugins/vim-repeat.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'tpope/vim-repeat' + finish +endif diff --git a/nvim/vim_plugins/vim-ruby-refactoring.vim b/nvim/vim_plugins/vim-ruby-refactoring.vim new file mode 100644 index 0000000..33af3d7 --- /dev/null +++ b/nvim/vim_plugins/vim-ruby-refactoring.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'ecomba/vim-ruby-refactoring', { 'for': 'ruby' } + finish +endif diff --git a/nvim/vim_plugins/vim-ruby.vim b/nvim/vim_plugins/vim-ruby.vim new file mode 100644 index 0000000..42a3b66 --- /dev/null +++ b/nvim/vim_plugins/vim-ruby.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'vim-ruby/vim-ruby', { 'for': 'ruby' } + finish +endif diff --git a/nvim/vim_plugins/vim-session.vim b/nvim/vim_plugins/vim-session.vim new file mode 100644 index 0000000..b50eab1 --- /dev/null +++ b/nvim/vim_plugins/vim-session.vim @@ -0,0 +1,10 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'xolox/vim-session' + Plug 'tpope/vim-obsession' + finish +endif + +let g:session_autosave = 0 +let g:session_autoload = 0 +nnoremap os :OpenSession +let g:session_directory=g:runtime_data_location. 'session' diff --git a/nvim/vim_plugins/vim-signify.vim b/nvim/vim_plugins/vim-signify.vim new file mode 100644 index 0000000..30dc8a5 --- /dev/null +++ b/nvim/vim_plugins/vim-signify.vim @@ -0,0 +1,10 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'mhinz/vim-signify' + finish +endif + +nmap gj (signify-next-hunk) +nmap gk (signify-prev-hunk) +" Makes switching buffers in large repos have no delay +let g:signify_update_on_bufenter = 0 +let g:signify_sign_overwrite = 0 diff --git a/nvim/vim_plugins/vim-startify.vim b/nvim/vim_plugins/vim-startify.vim new file mode 100644 index 0000000..1885d5e --- /dev/null +++ b/nvim/vim_plugins/vim-startify.vim @@ -0,0 +1,30 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'mhinz/vim-startify' + finish +endif + +let g:startify_list_order = [ + \ [' Last modified'], + \ 'dir', + \ [' Recent'], + \ 'files', + \ ] +let g:startify_skiplist = [ + \ 'COMMIT_EDITMSG', + \ $VIMRUNTIME .'/doc', + \ 'bundle/.*/doc', + \ ] +let g:startify_files_number = 15 +let g:startify_custom_indices = ['a', 's', 'd', 'f', 'g'] +let g:startify_change_to_dir = 0 + +hi StartifyBracket ctermfg=240 +hi StartifyFooter ctermfg=111 +hi StartifyHeader ctermfg=203 +hi StartifyPath ctermfg=245 +hi StartifySlash ctermfg=240 + +" Keep NERDTree from opening a split when startify is open +autocmd FileType startify setlocal buftype= + +let g:startify_recursive_dir = 1 diff --git a/nvim/vim_plugins/vim-stylus.vim b/nvim/vim_plugins/vim-stylus.vim new file mode 100644 index 0000000..6f40b56 --- /dev/null +++ b/nvim/vim_plugins/vim-stylus.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'wavded/vim-stylus', { 'for': ['stylus', 'markdown'] } + finish +endif diff --git a/nvim/vim_plugins/vim-surround.vim b/nvim/vim_plugins/vim-surround.vim new file mode 100644 index 0000000..b8ef0cc --- /dev/null +++ b/nvim/vim_plugins/vim-surround.vim @@ -0,0 +1,12 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'tpope/vim-surround' + finish +endif + +" Use # to get a variable interpolation (inside of a string)} +" ysiw# Wrap the token under the cursor in #{} +" Thanks to http://git.io/_XqKzQ +let g:surround_35 = "#{\r}" + +" Shortcuts for common surrounds +map y# ysi"# diff --git a/nvim/vim_plugins/vim-swap.vim b/nvim/vim_plugins/vim-swap.vim new file mode 100644 index 0000000..e93ba7c --- /dev/null +++ b/nvim/vim_plugins/vim-swap.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'machakann/vim-swap' + finish +endif diff --git a/nvim/vim_plugins/vim-textobj-reactprop.vim b/nvim/vim_plugins/vim-textobj-reactprop.vim new file mode 100644 index 0000000..a05aae1 --- /dev/null +++ b/nvim/vim_plugins/vim-textobj-reactprop.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'justinj/vim-textobj-reactprop' + finish +endif diff --git a/nvim/vim_plugins/vim-textobj-rubyblock.vim b/nvim/vim_plugins/vim-textobj-rubyblock.vim new file mode 100644 index 0000000..9244575 --- /dev/null +++ b/nvim/vim_plugins/vim-textobj-rubyblock.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'nelstrom/vim-textobj-rubyblock' + finish +endif diff --git a/nvim/vim_plugins/vim-textobj-user.vim b/nvim/vim_plugins/vim-textobj-user.vim new file mode 100644 index 0000000..5222bf8 --- /dev/null +++ b/nvim/vim_plugins/vim-textobj-user.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'kana/vim-textobj-user' + finish +endif diff --git a/nvim/vim_plugins/vim-tmux-navigator.vim b/nvim/vim_plugins/vim-tmux-navigator.vim new file mode 100644 index 0000000..b531259 --- /dev/null +++ b/nvim/vim_plugins/vim-tmux-navigator.vim @@ -0,0 +1,5 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'christoomey/vim-tmux-navigator' + finish +endif + diff --git a/nvim/vim_plugins/vim-tmux.vim b/nvim/vim_plugins/vim-tmux.vim new file mode 100644 index 0000000..cf57e39 --- /dev/null +++ b/nvim/vim_plugins/vim-tmux.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'mutewinter/vim-tmux' + finish +endif diff --git a/nvim/vim_plugins/vim-togglecursor.vim b/nvim/vim_plugins/vim-togglecursor.vim new file mode 100644 index 0000000..e2696f5 --- /dev/null +++ b/nvim/vim_plugins/vim-togglecursor.vim @@ -0,0 +1,6 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'jszakmeister/vim-togglecursor' + finish +endif + +let g:togglecursor_leave='line' diff --git a/nvim/vim_plugins/vim-turbux.vim b/nvim/vim_plugins/vim-turbux.vim new file mode 100644 index 0000000..5281373 --- /dev/null +++ b/nvim/vim_plugins/vim-turbux.vim @@ -0,0 +1,10 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'jgdavey/vim-turbux' + finish +endif + +let g:no_turbux_mappings = 1 +map X SendTestToTmux +map x SendFocusedTestToTmux +let g:turbux_command_rspec = 'spring rspec' +let g:turbux_command_cucumber = 'spring cucumber' diff --git a/nvim/vim_plugins/vim-unimpaired.vim b/nvim/vim_plugins/vim-unimpaired.vim new file mode 100644 index 0000000..3be2c93 --- /dev/null +++ b/nvim/vim_plugins/vim-unimpaired.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'tpope/vim-unimpaired' + finish +endif diff --git a/nvim/vim_plugins/vim-visual-star-search.vim b/nvim/vim_plugins/vim-visual-star-search.vim new file mode 100644 index 0000000..78a5220 --- /dev/null +++ b/nvim/vim_plugins/vim-visual-star-search.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'nelstrom/vim-visual-star-search' + finish +endif diff --git a/nvim/vim_plugins/vim-voogle.vim b/nvim/vim_plugins/vim-voogle.vim new file mode 100644 index 0000000..273d30b --- /dev/null +++ b/nvim/vim_plugins/vim-voogle.vim @@ -0,0 +1,6 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'papanikge/vim-voogle' + finish +endif + +let g:voogle_map='g' diff --git a/nvim/vim_plugins/vimux.vim b/nvim/vim_plugins/vimux.vim new file mode 100644 index 0000000..9096c85 --- /dev/null +++ b/nvim/vim_plugins/vimux.vim @@ -0,0 +1,6 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'benmills/vimux' + finish +endif + +let g:VimuxUseNearestPane = 1 diff --git a/nvim/vim_plugins/webapi-vim.vim b/nvim/vim_plugins/webapi-vim.vim new file mode 100644 index 0000000..8337637 --- /dev/null +++ b/nvim/vim_plugins/webapi-vim.vim @@ -0,0 +1,4 @@ +if exists('g:vim_plug_installing_plugins') + Plug 'mattn/webapi-vim' + finish +endif diff --git a/scripts/base16-shell.sh b/scripts/base16-shell.sh new file mode 100755 index 0000000..bddf8f0 --- /dev/null +++ b/scripts/base16-shell.sh @@ -0,0 +1,88 @@ +main() { + # Use colors, but only if connected to a terminal, and that terminal + # supports them. + if which tput >/dev/null 2>&1; then + ncolors=$(tput colors) + fi + if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then + RED="$(tput setaf 1)" + GREEN="$(tput setaf 2)" + YELLOW="$(tput setaf 3)" + BLUE="$(tput setaf 4)" + BOLD="$(tput bold)" + NORMAL="$(tput sgr0)" + else + RED="" + GREEN="" + YELLOW="" + BLUE="" + BOLD="" + NORMAL="" + fi + + # Only enable exit-on-error after the non-critical colorization stuff, + # which may fail on systems lacking tput or terminfo + set -e + + CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l) + if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then + printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n" + exit + fi + unset CHECK_ZSH_INSTALLED + + if [ ! -n "$BASE16_ZSH" ]; then + curr_dir=$PWD + cd $HOME + BASE16_ZSH="$(pwd)/.config/base16-shell" + echo "Base16-Shell is going to be installed in $BASE16_ZSH ." + cd $curr_dir + fi + + if [ -d "$BASE16_ZSH" ]; then + printf "${YELLOW}You already have Base16-Shell for zsh installed.${NORMAL}\n" + printf "You'll need to remove $BASE16_ZSH if you want to re-install.\n" + exit + fi + + # Prevent the cloned repository from having insecure permissions. Failing to do + # so causes compinit() calls to fail with "command not found: compdef" errors + # for users with insecure umasks (e.g., "002", allowing group writability). Note + # that this will be ignored under Cygwin by default, as Windows ACLs take + # precedence over umasks except for filesystems mounted with option "noacl". + umask g-w,o-w + + printf "${BLUE}Cloning Base16-Shell...${NORMAL}\n" + hash git >/dev/null 2>&1 || { + echo "Error: git is not installed" + exit 1 + } + # The Windows (MSYS) Git is not compatible with normal use on cygwin + if [ "$OSTYPE" = cygwin ]; then + if git --version | grep msysgit > /dev/null; then + echo "Error: Windows/MSYS Git is not supported on Cygwin" + echo "Error: Make sure the Cygwin git package is installed and is first on the path" + exit 1 + fi + fi + + mkdir -p $BASE16_ZSH + env git clone --depth=1 https://github.com/chriskempson/base16-shell.git $BASE16_ZSH || { + printf "Error: git clone of Base16-Shell repo failed\n" + exit 1 + } + + printf "${GREEN}" + echo ' ____ _ ____ _____ _ __ ____ _ _ _ ' + echo '| __ ) / \ / ___|| ____/ |/ /_ / ___|| |__ ___| | |' + echo '| _ \ / _ \ \___ \| _| | | '_ \ ____ \___ \| '_ \ / _ \ | |' + echo '| |_) / ___ \ ___) | |___| | (_) | |____| ___) | | | | __/ | |' + echo '|____/_/ \_\____/|_____|_|\___/ |____/|_| |_|\___|_|_| .... is now installed.' + echo '' + echo '' + printf "${NORMAL}" + env zsh + base16_brewer +} + +main diff --git a/scripts/git.sh b/scripts/git.sh new file mode 100755 index 0000000..f025230 --- /dev/null +++ b/scripts/git.sh @@ -0,0 +1,59 @@ +main() { + # Use colors, but only if connected to a terminal, and that terminal + # supports them. + if which tput >/dev/null 2>&1; then + ncolors=$(tput colors) + fi + if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then + RED="$(tput setaf 1)" + GREEN="$(tput setaf 2)" + YELLOW="$(tput setaf 3)" + BLUE="$(tput setaf 4)" + BOLD="$(tput bold)" + NORMAL="$(tput sgr0)" + else + RED="" + GREEN="" + YELLOW="" + BLUE="" + BOLD="" + NORMAL="" + fi + + # Only enable exit-on-error after the non-critical colorization stuff, + # which may fail on systems lacking tput or terminfo + set -e + + curr_dir=$PWD + hash git >/dev/null 2>&1 || { + echo "Error: git is not installed" + exit 1 + } + cd ../git/ + +printf "${BLUE}Looking for an existing git config...${NORMAL}\n" + if [ -f ~/.gitconfig ] || [ -h ~/.gitconfig ]; then + printf "${YELLOW}Found ~/.gitconfig.${NORMAL} ${GREEN}Backing up to ~/.gitconfig.old${NORMAL}\n"; + mv ~/.gitconfig ~/.gitconfig.old; + fi + + if [ -f ~/.gitignore_global ] || [ -h ~/.gitignore_global ]; then + printf "${YELLOW}Found ~/.gitignore_global.${NORMAL} ${GREEN}Backing up to ~/.gitignore_global.old${NORMAL}\n"; + mv ~/.gitignore_global ~/.gitignore_global.old; + fi + + umask g-w,o-w + + sed -i "/templatedir = */c\\templatedir = $PWD" gitconfig.symlink + + ln -s $(pwd)/gitconfig.symlink ~/.gitconfig + ln -s $(pwd)/gitignore_global.symlink ~/.gitignore_global + + cd $curr_dir + + printf "${GREEN}" + echo 'git is now configured successfully.' + printf "${NORMAL}" +} + +main diff --git a/scripts/nvim.sh b/scripts/nvim.sh new file mode 100755 index 0000000..b77cfe6 --- /dev/null +++ b/scripts/nvim.sh @@ -0,0 +1,53 @@ +main() { + # Use colors, but only if connected to a terminal, and that terminal + # supports them. + if which tput >/dev/null 2>&1; then + ncolors=$(tput colors) + fi + if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then + RED="$(tput setaf 1)" + GREEN="$(tput setaf 2)" + YELLOW="$(tput setaf 3)" + BLUE="$(tput setaf 4)" + BOLD="$(tput bold)" + NORMAL="$(tput sgr0)" + else + RED="" + GREEN="" + YELLOW="" + BLUE="" + BOLD="" + NORMAL="" + fi + + # Only enable exit-on-error after the non-critical colorization stuff, + # which may fail on systems lacking tput or terminfo + set -e + + curr_dir=$PWD + printf "${BLUE}Enabling python support in nvim...${NORMAL}\n" + sudo -E pip2 install --user neovim + sudo -E pip3 install --user neovim + + printf "${BLUE}Looking for an existing nvim config...${NORMAL}\n" + if [ -d ~/.config/nvim ]; then + printf "${YELLOW}Found ~/.config/nvim.${NORMAL} ${GREEN}Backing up to ~/.config/nvim.old${NORMAL}\n"; + mv ~/.config/nvim ~/.config/nvim.old; + fi + cd .. + sed -i "/let g:config_file_location='*'/c\\let g:config_file_location='$PWD/nvim/'" nvim/init.vim + sed -i "/let g:runtime_data_location='*'/c\\let g:runtime_data_location='$HOME/.local/share/nvim/'" nvim/init.vim + ln -s $(pwd)/nvim ~/.config/nvim + + printf "${BLUE}Looking for an existing vim config...${NORMAL}\n" + if [ -f ~/.vimrc ] || [ -h ~/.vimrc ]; then + printf "${YELLOW}Found ~/.vimrc.${NORMAL} ${GREEN}Backing up to ~/.vimrc.old${NORMAL}\n"; + mv ~/.vimrc ~/.vimrc.old; + fi + ln -s ~/.config/nvim/init.vim ~/.vimrc + cd $curr_dir + nvim +PlugInstall +qa + echo "vim config is now installed" +} + +main diff --git a/scripts/oh_my_zsh_install.sh b/scripts/oh_my_zsh_install.sh new file mode 100755 index 0000000..7253a03 --- /dev/null +++ b/scripts/oh_my_zsh_install.sh @@ -0,0 +1,129 @@ +main() { + # Use colors, but only if connected to a terminal, and that terminal + # supports them. + if which tput >/dev/null 2>&1; then + ncolors=$(tput colors) + fi + if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then + RED="$(tput setaf 1)" + GREEN="$(tput setaf 2)" + YELLOW="$(tput setaf 3)" + BLUE="$(tput setaf 4)" + BOLD="$(tput bold)" + NORMAL="$(tput sgr0)" + else + RED="" + GREEN="" + YELLOW="" + BLUE="" + BOLD="" + NORMAL="" + fi + + # Only enable exit-on-error after the non-critical colorization stuff, + # which may fail on systems lacking tput or terminfo + set -e + + curr_dir=$PWD + + CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l) + if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then + printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n" + exit + fi + unset CHECK_ZSH_INSTALLED + + if [ ! -n "$ZSH" ]; then + cd $HOME + echo $PWD + ZSH="$(pwd)/.config/oh-my-zsh" + echo "oh-my-zsh is going to be installed in $ZSH ." + cd $curr_dir + fi + + if [ -d "$ZSH" ]; then + printf "${YELLOW}You already have Oh My Zsh installed.${NORMAL}\n" + printf "You'll need to remove $ZSH if you want to re-install.\n" + exit + fi + + # Prevent the cloned repository from having insecure permissions. Failing to do + # so causes compinit() calls to fail with "command not found: compdef" errors + # for users with insecure umasks (e.g., "002", allowing group writability). Note + # that this will be ignored under Cygwin by default, as Windows ACLs take + # precedence over umasks except for filesystems mounted with option "noacl". + umask g-w,o-w + + printf "${BLUE}Cloning Oh My Zsh...${NORMAL}\n" + hash git >/dev/null 2>&1 || { + echo "Error: git is not installed" + exit 1 + } + # The Windows (MSYS) Git is not compatible with normal use on cygwin + if [ "$OSTYPE" = cygwin ]; then + if git --version | grep msysgit > /dev/null; then + echo "Error: Windows/MSYS Git is not supported on Cygwin" + echo "Error: Make sure the Cygwin git package is installed and is first on the path" + exit 1 + fi + fi + env git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git $ZSH || { + printf "Error: git clone of oh-my-zsh repo failed\n" + exit 1 + } + + + printf "${BLUE}Looking for an existing zsh config...${NORMAL}\n" + if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then + printf "${YELLOW}Found ~/.zshrc.${NORMAL} ${GREEN}Backing up to ~/.zshrc.old${NORMAL}\n"; + mv ~/.zshrc ~/.zshrc.old; + fi + + printf "${BLUE}Using the Oh My Zsh template file and adding it to ~/.zshrc${NORMAL}\n" + cd ../zsh + cp $ZSH/templates/zshrc.zsh-template zshrc-oh-my-zsh + sed -i "/^export ZSH=/ c\\ + export ZSH=$ZSH + " zshrc-oh-my-zsh + sed -i 's/~\/.oh-my-zsh/$ZSH/g' zshrc-oh-my-zsh + sed -i 's/robbyrussell/intheloop/g' zshrc-oh-my-zsh + cd .. + sed -i "/export MY_DOTFILE_FOLDER=*/c\\export MY_DOTFILE_FOLDER=$PWD" zsh/zshrc.symlink + echo "source $(pwd)/shell_common_config">>~/.bashrc + ln -s $(pwd)/zsh/zshrc.symlink ~/.zshrc + cd $curr_dir + + # If this user's login shell is not already "zsh", attempt to switch. + TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)') + if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then + # If this platform provides a "chsh" command (not Cygwin), do it, man! + if hash chsh >/dev/null 2>&1; then + printf "${BLUE}Time to change your default shell to zsh! Please enter your password.${NORMAL}\n" + chsh -s $(grep /zsh$ /etc/shells | tail -1) + # Else, suggest the user do so manually. + else + printf "I can't change your shell automatically because this system does not have chsh.\n" + printf "${BLUE}Please manually change your default shell to zsh!${NORMAL}\n" + fi + fi + + printf "${GREEN}" + echo ' __ __ ' + echo ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' + echo ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' + echo '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' + echo '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' + echo ' /____/ ....is now installed!' + echo '' + echo '' + echo 'Please look over the ~/.zshrc file to select plugins, themes, and options.' + echo '' + echo 'p.s. Follow us at https://twitter.com/ohmyzsh.' + echo '' + echo 'p.p.s. Get stickers and t-shirts at http://shop.planetargon.com.' + echo '' + printf "${NORMAL}" + env zsh +} + +main diff --git a/scripts/tmux.sh b/scripts/tmux.sh new file mode 100755 index 0000000..e999a84 --- /dev/null +++ b/scripts/tmux.sh @@ -0,0 +1,88 @@ +main() { + # Use colors, but only if connected to a terminal, and that terminal + # supports them. + if which tput >/dev/null 2>&1; then + ncolors=$(tput colors) + fi + if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then + RED="$(tput setaf 1)" + GREEN="$(tput setaf 2)" + YELLOW="$(tput setaf 3)" + BLUE="$(tput setaf 4)" + BOLD="$(tput bold)" + NORMAL="$(tput sgr0)" + else + RED="" + GREEN="" + YELLOW="" + BLUE="" + BOLD="" + NORMAL="" + fi + + # Only enable exit-on-error after the non-critical colorization stuff, + # which may fail on systems lacking tput or terminfo + set -e + curr_dir=$PWD + + CHECK_TMUX_INSTALLED=$(grep /tmux$ /etc/shells | wc -l) + if [ ! $CHECK_TMUX_INSTALLED -ge 1 ]; then + printf "${YELLOW}tmux is not installed!${NORMAL} Please install tmux first!\n" + exit + fi + unset CHECK_TMUX_INSTALLED + + if [ ! -n "$TPM_DIR" ]; then + cd $HOME + TPM_DIR="$(pwd)/.local/share/tmux/plugins/tpm" + cd $curr_dir + echo "tmux plugins are going to be installed in $TPM_DIR ." + fi + + if [ -d "$TPM_DIR" ]; then + printf "${YELLOW}You already have tmux plugins installed.${NORMAL}\n" + printf "You'll need to remove $TPM_DIR if you want to re-install.\n" + exit + fi + + # Prevent the cloned repository from having insecure permissions. Failing to do + # so causes compinit() calls to fail with "command not found: compdef" errors + # for users with insecure umasks (e.g., "002", allowing group writability). Note + # that this will be ignored under Cygwin by default, as Windows ACLs take + # precedence over umasks except for filesystems mounted with option "noacl". + umask g-w,o-w + + printf "${BLUE}Cloning tmux plugin manager (tpm)...${NORMAL}\n" + mkdir -p $TPM_DIR + hash git >/dev/null 2>&1 || { + echo "Error: git is not installed" + exit 1 + } + # The Windows (MSYS) Git is not compatible with normal use on cygwin + if [ "$OSTYPE" = cygwin ]; then + if git --version | grep msysgit > /dev/null; then + echo "Error: Windows/MSYS Git is not supported on Cygwin" + echo "Error: Make sure the Cygwin git package is installed and is first on the path" + exit 1 + fi + fi + env git clone --depth=1 https://github.com/tmux-plugins/tpm $TPM_DIR || { + printf "Error: git clone of tpm repo failed\n" + exit 1 + } + + printf "${BLUE}Looking for an existing zsh config...${NORMAL}\n" + if [ -f ~/.tmux.conf ] || [ -h ~/.tmux.conf ]; then + printf "${YELLOW}Found ~/.tmux.conf.${NORMAL} ${GREEN}Backing up to ~/.tmux.conf.old${NORMAL}\n"; + mv ~/.tmux.conf ~/.tmux.conf.old; + fi + cd '../tmux' + ln -s $(pwd)/tmux.conf.symlink ~/.tmux.conf + cd $curr_dir + printf "${GREEN}" + echo 'tmux setup is now complete.' + printf "${NORMAL}" + +} + +main diff --git a/shell_common_config b/shell_common_config new file mode 100644 index 0000000..6c26ae5 --- /dev/null +++ b/shell_common_config @@ -0,0 +1,9 @@ +# BASE16-Shell Entry +BASE16_SHELL=$HOME/.config/base16-shell/ +[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)" + +# 256 color support for vim +TERM=xterm-256color + +# unicode support in tmux +alias tmux='tmux -u' diff --git a/tmux/dev.tmux.conf.symlink b/tmux/dev.tmux.conf.symlink new file mode 100644 index 0000000..91ba244 --- /dev/null +++ b/tmux/dev.tmux.conf.symlink @@ -0,0 +1,8 @@ +source-file ~/.tmux.conf +new-session -s dev -n ide +split-window -v -p 10 -t dev +select-pane -t 1 +split-window -h -p 30 -t dev +new-window -n shell +select-window -t dev:1 +select-pane -t 1 diff --git a/tmux/tmux.conf.symlink b/tmux/tmux.conf.symlink new file mode 100644 index 0000000..f6a83a5 --- /dev/null +++ b/tmux/tmux.conf.symlink @@ -0,0 +1,88 @@ +set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.local/share/tmux/plugins' + +set -g @plugin 'Mpdreamz/tmux-cmus' +set -g @plugin 'tmux-plugins/tmux-yank' +set -g @plugin 'tmux-plugins/tmux-battery' +set -g @plugin 'tmux-plugins/tmux-open' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-continuum' +set -g @plugin 'christoomey/vim-tmux-navigator' + +set -g default-command "/bin/zsh" + +set -g history-limit 20000 + + +# set the base index for windows to 1 +set -g base-index 1 +setw -g pane-base-index 1 +set -g quiet on + +# Activity Monitoring +setw -g monitor-activity off +set -g visual-activity off + +# Rather than constraining window size to the maximum size of any client +# connected to the *session*, constrain window size to the maximum size of any +# client connected to *that window*. Much more reasonable. +setw -g aggressive-resize on + +# make delay shorter +set -sg escape-time 0 + + +set-option -g set-titles on +set-option -g set-titles-string "#T - #W" +# set-window-option -g automatic-rename on + +###################### +#### Key Bindings #### +###################### + +# reload config file +bind r source-file ~/.tmux.conf \; display "Config Reloaded!" + +# synchronize all panes in a window +bind y setw synchronize-panes + +# pane movement shortcuts +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + + +# Resize pane shortcuts +bind -r H resize-pane -L 10 +bind -r J resize-pane -D 10 +bind -r K resize-pane -U 10 +bind -r L resize-pane -R 10 + +# enable mouse support for switching panes/windows +setw -g mouse on + +bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage" +bind-key -t vi-copy PPage page-up +bind-key -t vi-copy NPage page-down + +bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "select-pane -t =; send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" +bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "select-pane -t =; send-keys -M" "select-pane -t =; send-keys -M" +bind-key -t vi-copy WheelUpPane halfpage-up +bind-key -t vi-copy WheelDownPane halfpage-down + +# maximizing and restoring windows +unbind Up +bind Up new-window -d -n fullscreen \; swap-pane -s fullscreen.1 \; select-window -t fullscreen +unbind Down +bind Down last-window \; swap-pane -s fullscreen.1 \; kill-window -t fullscreen + +# set vi mode for copy mode +setw -g mode-keys vi +# more settings to make copy-mode more vim-like +bind Escape copy-mode +bind -t vi-copy 'v' begin-selection +bind -t vi-copy 'y' copy-selection +bind P paste-buffer + + +run '~/.local/share/tmux/plugins/tpm/tpm' diff --git a/zsh/zshrc-oh-my-zsh b/zsh/zshrc-oh-my-zsh new file mode 100644 index 0000000..ad1274b --- /dev/null +++ b/zsh/zshrc-oh-my-zsh @@ -0,0 +1,85 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + +# Path to your oh-my-zsh installation. + export ZSH=/home/mayank/.config/oh-my-zsh + +# Set name of the theme to load. Optionally, if you set this to "random" +# it'll load a random theme each time that oh-my-zsh is loaded. +# See https://github.com/intheloop/oh-my-zsh/wiki/Themes +ZSH_THEME="intheloop" + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. Case +# sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +# DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? (plugins can be found in $ZSH/plugins/*) +# Custom plugins may be added to $ZSH/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='mvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# ssh +# export SSH_KEY_PATH="~/.ssh/rsa_id" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate $ZSH" diff --git a/zsh/zshrc.symlink b/zsh/zshrc.symlink new file mode 100644 index 0000000..53e3dbe --- /dev/null +++ b/zsh/zshrc.symlink @@ -0,0 +1,4 @@ +export MY_DOTFILE_FOLDER=/home/mayank/.my_configs + +source $MY_DOTFILE_FOLDER/zsh/zshrc-oh-my-zsh +source $MY_DOTFILE_FOLDER/shell_common_config