diff --git a/dot_config/nvim/lua/user/init.lua b/dot_config/astronvim/lua/user/init.lua similarity index 100% rename from dot_config/nvim/lua/user/init.lua rename to dot_config/astronvim/lua/user/init.lua diff --git a/dot_config/nvim/LICENSE b/dot_config/nvim/LICENSE deleted file mode 100644 index f288702..0000000 --- a/dot_config/nvim/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/dot_config/nvim/colors/default_theme.lua b/dot_config/nvim/colors/default_theme.lua deleted file mode 100644 index c6fe0a2..0000000 --- a/dot_config/nvim/colors/default_theme.lua +++ /dev/null @@ -1,9 +0,0 @@ -vim.g.colors_name = "default_theme" - -package.loaded["default_theme"] = nil -package.loaded["default_theme.base"] = nil -package.loaded["default_theme.treesitter"] = nil -package.loaded["default_theme.lsp"] = nil -package.loaded["default_theme.others"] = nil - -require "default_theme" diff --git a/dot_config/nvim/config.ld b/dot_config/nvim/config.ld deleted file mode 100644 index 0bb9d28..0000000 --- a/dot_config/nvim/config.ld +++ /dev/null @@ -1,10 +0,0 @@ -project='AstroNvim' -title='AstroNvim API' -description='Documentation of AstroNvim\'s core API' -format = 'markdown' -file='lua' -dir='docs' -no_space_before_args=true -examples = { - 'lua/user_example/init.lua' -} diff --git a/dot_config/nvim/dot_git/FETCH_HEAD b/dot_config/nvim/dot_git/FETCH_HEAD deleted file mode 100644 index 8bf8d75..0000000 --- a/dot_config/nvim/dot_git/FETCH_HEAD +++ /dev/null @@ -1,7 +0,0 @@ -176265812355a53559497c0f0ada7ab62a2d1ba8 branch 'main' of https://github.com/AstroNvim/AstroNvim -2ffd706983d0171604941fa31bfd8182db6a530a not-for-merge branch 'format' of https://github.com/AstroNvim/AstroNvim -3dd00eaf98ccaae3c8b4bcf4a4e05390c0139fe6 not-for-merge branch 'gh-pages' of https://github.com/AstroNvim/AstroNvim -1356d5364dd54549d93127fbd1ae11bed550712d not-for-merge branch 'heirline_bufferline' of https://github.com/AstroNvim/AstroNvim -ddc49bc4d074d5b9a9899b9bee33de3416f464bd not-for-merge branch 'nightly' of https://github.com/AstroNvim/AstroNvim -8ec90cc9229a2a22cf94ae5728b5ee44f3b489af not-for-merge branch 'readme_update' of https://github.com/AstroNvim/AstroNvim -0c6708938039aed1da4ba8e5f1961b328803462f not-for-merge branch 'remove_mason_lazy_load' of https://github.com/AstroNvim/AstroNvim diff --git a/dot_config/nvim/dot_git/HEAD b/dot_config/nvim/dot_git/HEAD deleted file mode 100644 index b870d82..0000000 --- a/dot_config/nvim/dot_git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/main diff --git a/dot_config/nvim/dot_git/ORIG_HEAD b/dot_config/nvim/dot_git/ORIG_HEAD deleted file mode 100644 index b326264..0000000 --- a/dot_config/nvim/dot_git/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -5288bad46858f15f2290aeb3d09c8bd8e58b7882 diff --git a/dot_config/nvim/dot_git/config b/dot_config/nvim/dot_git/config deleted file mode 100644 index db04f1a..0000000 --- a/dot_config/nvim/dot_git/config +++ /dev/null @@ -1,13 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true -[remote "origin"] - url = https://github.com/AstroNvim/AstroNvim - fetch = +refs/heads/*:refs/remotes/origin/* -[branch "main"] - remote = origin - merge = refs/heads/main diff --git a/dot_config/nvim/dot_git/description b/dot_config/nvim/dot_git/description deleted file mode 100644 index 498b267..0000000 --- a/dot_config/nvim/dot_git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/dot_config/nvim/dot_git/hooks/executable_applypatch-msg.sample b/dot_config/nvim/dot_git/hooks/executable_applypatch-msg.sample deleted file mode 100644 index a5d7b84..0000000 --- a/dot_config/nvim/dot_git/hooks/executable_applypatch-msg.sample +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message taken by -# applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. The hook is -# allowed to edit the commit message file. -# -# To enable this hook, rename this file to "applypatch-msg". - -. git-sh-setup -commitmsg="$(git rev-parse --git-path hooks/commit-msg)" -test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} -: diff --git a/dot_config/nvim/dot_git/hooks/executable_commit-msg.sample b/dot_config/nvim/dot_git/hooks/executable_commit-msg.sample deleted file mode 100644 index b58d118..0000000 --- a/dot_config/nvim/dot_git/hooks/executable_commit-msg.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to check the commit log message. -# Called by "git commit" with one argument, the name of the file -# that has the commit message. The hook should exit with non-zero -# status after issuing an appropriate message if it wants to stop the -# commit. The hook is allowed to edit the commit message file. -# -# To enable this hook, rename this file to "commit-msg". - -# Uncomment the below to add a Signed-off-by line to the message. -# Doing this in a hook is a bad idea in general, but the prepare-commit-msg -# hook is more suited to it. -# -# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" - -# This example catches duplicate Signed-off-by lines. - -test "" = "$(grep '^Signed-off-by: ' "$1" | - sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { - echo >&2 Duplicate Signed-off-by lines. - exit 1 -} diff --git a/dot_config/nvim/dot_git/hooks/executable_fsmonitor-watchman.sample b/dot_config/nvim/dot_git/hooks/executable_fsmonitor-watchman.sample deleted file mode 100644 index 23e856f..0000000 --- a/dot_config/nvim/dot_git/hooks/executable_fsmonitor-watchman.sample +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use IPC::Open2; - -# An example hook script to integrate Watchman -# (https://facebook.github.io/watchman/) with git to speed up detecting -# new and modified files. -# -# The hook is passed a version (currently 2) and last update token -# formatted as a string and outputs to stdout a new update token and -# all files that have been modified since the update token. Paths must -# be relative to the root of the working tree and separated by a single NUL. -# -# To enable this hook, rename this file to "query-watchman" and set -# 'git config core.fsmonitor .git/hooks/query-watchman' -# -my ($version, $last_update_token) = @ARGV; - -# Uncomment for debugging -# print STDERR "$0 $version $last_update_token\n"; - -# Check the hook interface version -if ($version ne 2) { - die "Unsupported query-fsmonitor hook version '$version'.\n" . - "Falling back to scanning...\n"; -} - -my $git_work_tree = get_working_dir(); - -my $retry = 1; - -my $json_pkg; -eval { - require JSON::XS; - $json_pkg = "JSON::XS"; - 1; -} or do { - require JSON::PP; - $json_pkg = "JSON::PP"; -}; - -launch_watchman(); - -sub launch_watchman { - my $o = watchman_query(); - if (is_work_tree_watched($o)) { - output_result($o->{clock}, @{$o->{files}}); - } -} - -sub output_result { - my ($clockid, @files) = @_; - - # Uncomment for debugging watchman output - # open (my $fh, ">", ".git/watchman-output.out"); - # binmode $fh, ":utf8"; - # print $fh "$clockid\n@files\n"; - # close $fh; - - binmode STDOUT, ":utf8"; - print $clockid; - print "\0"; - local $, = "\0"; - print @files; -} - -sub watchman_clock { - my $response = qx/watchman clock "$git_work_tree"/; - die "Failed to get clock id on '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - - return $json_pkg->new->utf8->decode($response); -} - -sub watchman_query { - my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') - or die "open2() failed: $!\n" . - "Falling back to scanning...\n"; - - # In the query expression below we're asking for names of files that - # changed since $last_update_token but not from the .git folder. - # - # To accomplish this, we're using the "since" generator to use the - # recency index to select candidate nodes and "fields" to limit the - # output to file names only. Then we're using the "expression" term to - # further constrain the results. - my $last_update_line = ""; - if (substr($last_update_token, 0, 1) eq "c") { - $last_update_token = "\"$last_update_token\""; - $last_update_line = qq[\n"since": $last_update_token,]; - } - my $query = <<" END"; - ["query", "$git_work_tree", {$last_update_line - "fields": ["name"], - "expression": ["not", ["dirname", ".git"]] - }] - END - - # Uncomment for debugging the watchman query - # open (my $fh, ">", ".git/watchman-query.json"); - # print $fh $query; - # close $fh; - - print CHLD_IN $query; - close CHLD_IN; - my $response = do {local $/; }; - - # Uncomment for debugging the watch response - # open ($fh, ">", ".git/watchman-response.json"); - # print $fh $response; - # close $fh; - - die "Watchman: command returned no output.\n" . - "Falling back to scanning...\n" if $response eq ""; - die "Watchman: command returned invalid output: $response\n" . - "Falling back to scanning...\n" unless $response =~ /^\{/; - - return $json_pkg->new->utf8->decode($response); -} - -sub is_work_tree_watched { - my ($output) = @_; - my $error = $output->{error}; - if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) { - $retry--; - my $response = qx/watchman watch "$git_work_tree"/; - die "Failed to make watchman watch '$git_work_tree'.\n" . - "Falling back to scanning...\n" if $? != 0; - $output = $json_pkg->new->utf8->decode($response); - $error = $output->{error}; - die "Watchman: $error.\n" . - "Falling back to scanning...\n" if $error; - - # Uncomment for debugging watchman output - # open (my $fh, ">", ".git/watchman-output.out"); - # close $fh; - - # Watchman will always return all files on the first query so - # return the fast "everything is dirty" flag to git and do the - # Watchman query just to get it over with now so we won't pay - # the cost in git to look up each individual file. - my $o = watchman_clock(); - $error = $output->{error}; - - die "Watchman: $error.\n" . - "Falling back to scanning...\n" if $error; - - output_result($o->{clock}, ("/")); - $last_update_token = $o->{clock}; - - eval { launch_watchman() }; - return 0; - } - - die "Watchman: $error.\n" . - "Falling back to scanning...\n" if $error; - - return 1; -} - -sub get_working_dir { - my $working_dir; - if ($^O =~ 'msys' || $^O =~ 'cygwin') { - $working_dir = Win32::GetCwd(); - $working_dir =~ tr/\\/\//; - } else { - require Cwd; - $working_dir = Cwd::cwd(); - } - - return $working_dir; -} diff --git a/dot_config/nvim/dot_git/hooks/executable_post-update.sample b/dot_config/nvim/dot_git/hooks/executable_post-update.sample deleted file mode 100644 index ec17ec1..0000000 --- a/dot_config/nvim/dot_git/hooks/executable_post-update.sample +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare a packed repository for use over -# dumb transports. -# -# To enable this hook, rename this file to "post-update". - -exec git update-server-info diff --git a/dot_config/nvim/dot_git/hooks/executable_pre-applypatch.sample b/dot_config/nvim/dot_git/hooks/executable_pre-applypatch.sample deleted file mode 100644 index 4142082..0000000 --- a/dot_config/nvim/dot_git/hooks/executable_pre-applypatch.sample +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed -# by applypatch from an e-mail message. -# -# The hook should exit with non-zero status after issuing an -# appropriate message if it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-applypatch". - -. git-sh-setup -precommit="$(git rev-parse --git-path hooks/pre-commit)" -test -x "$precommit" && exec "$precommit" ${1+"$@"} -: diff --git a/dot_config/nvim/dot_git/hooks/executable_pre-commit.sample b/dot_config/nvim/dot_git/hooks/executable_pre-commit.sample deleted file mode 100644 index e144712..0000000 --- a/dot_config/nvim/dot_git/hooks/executable_pre-commit.sample +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# To enable this hook, rename this file to "pre-commit". - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=$(git hash-object -t tree /dev/null) -fi - -# If you want to allow non-ASCII filenames set this variable to true. -allownonascii=$(git config --type=bool hooks.allownonascii) - -# Redirect output to stderr. -exec 1>&2 - -# Cross platform projects tend to avoid non-ASCII filenames; prevent -# them from being added to the repository. We exploit the fact that the -# printable range starts at the space character and ends with tilde. -if [ "$allownonascii" != "true" ] && - # Note that the use of brackets around a tr range is ok here, (it's - # even required, for portability to Solaris 10's /usr/bin/tr), since - # the square bracket bytes happen to fall in the designated range. - test $(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 -then - cat <<\EOF -Error: Attempt to add a non-ASCII file name. - -This can cause problems if you want to work with people on other platforms. - -To be portable it is advisable to rename the file. - -If you know what you are doing you can disable this check using: - - git config hooks.allownonascii true -EOF - exit 1 -fi - -# If there are whitespace errors, print the offending file names and fail. -exec git diff-index --check --cached $against -- diff --git a/dot_config/nvim/dot_git/hooks/executable_pre-merge-commit.sample b/dot_config/nvim/dot_git/hooks/executable_pre-merge-commit.sample deleted file mode 100644 index 399eab1..0000000 --- a/dot_config/nvim/dot_git/hooks/executable_pre-merge-commit.sample +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# -# An example hook script to verify what is about to be committed. -# Called by "git merge" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message to -# stderr if it wants to stop the merge commit. -# -# To enable this hook, rename this file to "pre-merge-commit". - -. git-sh-setup -test -x "$GIT_DIR/hooks/pre-commit" && - exec "$GIT_DIR/hooks/pre-commit" -: diff --git a/dot_config/nvim/dot_git/hooks/executable_pre-push.sample b/dot_config/nvim/dot_git/hooks/executable_pre-push.sample deleted file mode 100644 index 4ce688d..0000000 --- a/dot_config/nvim/dot_git/hooks/executable_pre-push.sample +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# An example hook script to verify what is about to be pushed. Called by "git -# push" after it has checked the remote status, but before anything has been -# pushed. If this script exits with a non-zero status nothing will be pushed. -# -# This hook is called with the following parameters: -# -# $1 -- Name of the remote to which the push is being done -# $2 -- URL to which the push is being done -# -# If pushing without using a named remote those arguments will be equal. -# -# Information about the commits which are being pushed is supplied as lines to -# the standard input in the form: -# -# -# -# This sample shows how to prevent push of commits where the log message starts -# with "WIP" (work in progress). - -remote="$1" -url="$2" - -zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" - exit 1 - fi - fi -done - -exit 0 diff --git a/dot_config/nvim/dot_git/hooks/executable_pre-rebase.sample b/dot_config/nvim/dot_git/hooks/executable_pre-rebase.sample deleted file mode 100644 index 6cbef5c..0000000 --- a/dot_config/nvim/dot_git/hooks/executable_pre-rebase.sample +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2006, 2008 Junio C Hamano -# -# The "pre-rebase" hook is run just before "git rebase" starts doing -# its job, and can prevent the command from running by exiting with -# non-zero status. -# -# The hook is called with the following parameters: -# -# $1 -- the upstream the series was forked from. -# $2 -- the branch being rebased (or empty when rebasing the current branch). -# -# This sample shows how to prevent topic branches that are already -# merged to 'next' branch from getting rebased, because allowing it -# would result in rebasing already published history. - -publish=next -basebranch="$1" -if test "$#" = 2 -then - topic="refs/heads/$2" -else - topic=`git symbolic-ref HEAD` || - exit 0 ;# we do not interrupt rebasing detached HEAD -fi - -case "$topic" in -refs/heads/??/*) - ;; -*) - exit 0 ;# we do not interrupt others. - ;; -esac - -# Now we are dealing with a topic branch being rebased -# on top of master. Is it OK to rebase it? - -# Does the topic really exist? -git show-ref -q "$topic" || { - echo >&2 "No such branch $topic" - exit 1 -} - -# Is topic fully merged to master? -not_in_master=`git rev-list --pretty=oneline ^master "$topic"` -if test -z "$not_in_master" -then - echo >&2 "$topic is fully merged to master; better remove it." - exit 1 ;# we could allow it, but there is no point. -fi - -# Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git rev-list ^master ${publish} | sort` -if test "$only_next_1" = "$only_next_2" -then - not_in_topic=`git rev-list "^$topic" master` - if test -z "$not_in_topic" - then - echo >&2 "$topic is already up to date with master" - exit 1 ;# we could allow it, but there is no point. - else - exit 0 - fi -else - not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` - /usr/bin/perl -e ' - my $topic = $ARGV[0]; - my $msg = "* $topic has commits already merged to public branch:\n"; - my (%not_in_next) = map { - /^([0-9a-f]+) /; - ($1 => 1); - } split(/\n/, $ARGV[1]); - for my $elem (map { - /^([0-9a-f]+) (.*)$/; - [$1 => $2]; - } split(/\n/, $ARGV[2])) { - if (!exists $not_in_next{$elem->[0]}) { - if ($msg) { - print STDERR $msg; - undef $msg; - } - print STDERR " $elem->[1]\n"; - } - } - ' "$topic" "$not_in_next" "$not_in_master" - exit 1 -fi - -<<\DOC_END - -This sample hook safeguards topic branches that have been -published from being rewound. - -The workflow assumed here is: - - * Once a topic branch forks from "master", "master" is never - merged into it again (either directly or indirectly). - - * Once a topic branch is fully cooked and merged into "master", - it is deleted. If you need to build on top of it to correct - earlier mistakes, a new topic branch is created by forking at - the tip of the "master". This is not strictly necessary, but - it makes it easier to keep your history simple. - - * Whenever you need to test or publish your changes to topic - branches, merge them into "next" branch. - -The script, being an example, hardcodes the publish branch name -to be "next", but it is trivial to make it configurable via -$GIT_DIR/config mechanism. - -With this workflow, you would want to know: - -(1) ... if a topic branch has ever been merged to "next". Young - topic branches can have stupid mistakes you would rather - clean up before publishing, and things that have not been - merged into other branches can be easily rebased without - affecting other people. But once it is published, you would - not want to rewind it. - -(2) ... if a topic branch has been fully merged to "master". - Then you can delete it. More importantly, you should not - build on top of it -- other people may already want to - change things related to the topic as patches against your - "master", so if you need further changes, it is better to - fork the topic (perhaps with the same name) afresh from the - tip of "master". - -Let's look at this example: - - o---o---o---o---o---o---o---o---o---o "next" - / / / / - / a---a---b A / / - / / / / - / / c---c---c---c B / - / / / \ / - / / / b---b C \ / - / / / / \ / - ---o---o---o---o---o---o---o---o---o---o---o "master" - - -A, B and C are topic branches. - - * A has one fix since it was merged up to "next". - - * B has finished. It has been fully merged up to "master" and "next", - and is ready to be deleted. - - * C has not merged to "next" at all. - -We would want to allow C to be rebased, refuse A, and encourage -B to be deleted. - -To compute (1): - - git rev-list ^master ^topic next - git rev-list ^master next - - if these match, topic has not merged in next at all. - -To compute (2): - - git rev-list master..topic - - if this is empty, it is fully merged to "master". - -DOC_END diff --git a/dot_config/nvim/dot_git/hooks/executable_pre-receive.sample b/dot_config/nvim/dot_git/hooks/executable_pre-receive.sample deleted file mode 100644 index a1fd29e..0000000 --- a/dot_config/nvim/dot_git/hooks/executable_pre-receive.sample +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# -# An example hook script to make use of push options. -# The example simply echoes all push options that start with 'echoback=' -# and rejects all pushes when the "reject" push option is used. -# -# To enable this hook, rename this file to "pre-receive". - -if test -n "$GIT_PUSH_OPTION_COUNT" -then - i=0 - while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" - do - eval "value=\$GIT_PUSH_OPTION_$i" - case "$value" in - echoback=*) - echo "echo from the pre-receive-hook: ${value#*=}" >&2 - ;; - reject) - exit 1 - esac - i=$((i + 1)) - done -fi diff --git a/dot_config/nvim/dot_git/hooks/executable_prepare-commit-msg.sample b/dot_config/nvim/dot_git/hooks/executable_prepare-commit-msg.sample deleted file mode 100644 index 10fa14c..0000000 --- a/dot_config/nvim/dot_git/hooks/executable_prepare-commit-msg.sample +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# An example hook script to prepare the commit log message. -# Called by "git commit" with the name of the file that has the -# commit message, followed by the description of the commit -# message's source. The hook's purpose is to edit the commit -# message file. If the hook fails with a non-zero status, -# the commit is aborted. -# -# To enable this hook, rename this file to "prepare-commit-msg". - -# This hook includes three examples. The first one removes the -# "# Please enter the commit message..." help message. -# -# The second includes the output of "git diff --name-status -r" -# into the message, just before the "git status" output. It is -# commented because it doesn't cope with --amend or with squashed -# commits. -# -# The third example adds a Signed-off-by line to the message, that can -# still be edited. This is rarely a good idea. - -COMMIT_MSG_FILE=$1 -COMMIT_SOURCE=$2 -SHA1=$3 - -/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" - -# case "$COMMIT_SOURCE,$SHA1" in -# ,|template,) -# /usr/bin/perl -i.bak -pe ' -# print "\n" . `git diff --cached --name-status -r` -# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; -# *) ;; -# esac - -# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') -# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" -# if test -z "$COMMIT_SOURCE" -# then -# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" -# fi diff --git a/dot_config/nvim/dot_git/hooks/executable_push-to-checkout.sample b/dot_config/nvim/dot_git/hooks/executable_push-to-checkout.sample deleted file mode 100644 index af5a0c0..0000000 --- a/dot_config/nvim/dot_git/hooks/executable_push-to-checkout.sample +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -# An example hook script to update a checked-out tree on a git push. -# -# This hook is invoked by git-receive-pack(1) when it reacts to git -# push and updates reference(s) in its repository, and when the push -# tries to update the branch that is currently checked out and the -# receive.denyCurrentBranch configuration variable is set to -# updateInstead. -# -# By default, such a push is refused if the working tree and the index -# of the remote repository has any difference from the currently -# checked out commit; when both the working tree and the index match -# the current commit, they are updated to match the newly pushed tip -# of the branch. This hook is to be used to override the default -# behaviour; however the code below reimplements the default behaviour -# as a starting point for convenient modification. -# -# The hook receives the commit with which the tip of the current -# branch is going to be updated: -commit=$1 - -# It can exit with a non-zero status to refuse the push (when it does -# so, it must not modify the index or the working tree). -die () { - echo >&2 "$*" - exit 1 -} - -# Or it can make any necessary changes to the working tree and to the -# index to bring them to the desired state when the tip of the current -# branch is updated to the new commit, and exit with a zero status. -# -# For example, the hook can simply run git read-tree -u -m HEAD "$1" -# in order to emulate git fetch that is run in the reverse direction -# with git push, as the two-tree form of git read-tree -u -m is -# essentially the same as git switch or git checkout that switches -# branches while keeping the local changes in the working tree that do -# not interfere with the difference between the branches. - -# The below is a more-or-less exact translation to shell of the C code -# for the default behaviour for git's push-to-checkout hook defined in -# the push_to_deploy() function in builtin/receive-pack.c. -# -# Note that the hook will be executed from the repository directory, -# not from the working tree, so if you want to perform operations on -# the working tree, you will have to adapt your code accordingly, e.g. -# by adding "cd .." or using relative paths. - -if ! git update-index -q --ignore-submodules --refresh -then - die "Up-to-date check failed" -fi - -if ! git diff-files --quiet --ignore-submodules -- -then - die "Working directory has unstaged changes" -fi - -# This is a rough translation of: -# -# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX -if git cat-file -e HEAD 2>/dev/null -then - head=HEAD -else - head=$(git hash-object -t tree --stdin &2 - echo " (if you want, you could supply GIT_DIR then run" >&2 - echo " $0 )" >&2 - exit 1 -fi - -if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then - echo "usage: $0 " >&2 - exit 1 -fi - -# --- Config -allowunannotated=$(git config --type=bool hooks.allowunannotated) -allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) -denycreatebranch=$(git config --type=bool hooks.denycreatebranch) -allowdeletetag=$(git config --type=bool hooks.allowdeletetag) -allowmodifytag=$(git config --type=bool hooks.allowmodifytag) - -# check for no description -projectdesc=$(sed -e '1q' "$GIT_DIR/description") -case "$projectdesc" in -"Unnamed repository"* | "") - echo "*** Project description file hasn't been set" >&2 - exit 1 - ;; -esac - -# --- Check types -# if $newrev is 0000...0000, it's a commit to delete a ref. -zero=$(git hash-object --stdin &2 - echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 - exit 1 - fi - ;; - refs/tags/*,delete) - # delete tag - if [ "$allowdeletetag" != "true" ]; then - echo "*** Deleting a tag is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/tags/*,tag) - # annotated tag - if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 - then - echo "*** Tag '$refname' already exists." >&2 - echo "*** Modifying a tag is not allowed in this repository." >&2 - exit 1 - fi - ;; - refs/heads/*,commit) - # branch - if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then - echo "*** Creating a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/heads/*,delete) - # delete branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - refs/remotes/*,commit) - # tracking branch - ;; - refs/remotes/*,delete) - # delete tracking branch - if [ "$allowdeletebranch" != "true" ]; then - echo "*** Deleting a tracking branch is not allowed in this repository" >&2 - exit 1 - fi - ;; - *) - # Anything else (is there anything else?) - echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 - exit 1 - ;; -esac - -# --- Finished -exit 0 diff --git a/dot_config/nvim/dot_git/index b/dot_config/nvim/dot_git/index deleted file mode 100644 index 4040311..0000000 Binary files a/dot_config/nvim/dot_git/index and /dev/null differ diff --git a/dot_config/nvim/dot_git/info/exclude b/dot_config/nvim/dot_git/info/exclude deleted file mode 100644 index a5196d1..0000000 --- a/dot_config/nvim/dot_git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/dot_config/nvim/dot_git/logs/HEAD b/dot_config/nvim/dot_git/logs/HEAD deleted file mode 100644 index 03fd1eb..0000000 --- a/dot_config/nvim/dot_git/logs/HEAD +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 ba775276324b75e4f703cd63fea3cfe7726514de Riley Smith 1659027739 -0700 clone: from https://github.com/AstroNvim/AstroNvim -ba775276324b75e4f703cd63fea3cfe7726514de 5288bad46858f15f2290aeb3d09c8bd8e58b7882 Riley Smith 1666894344 -0700 pull --rebase: Fast-forward -5288bad46858f15f2290aeb3d09c8bd8e58b7882 176265812355a53559497c0f0ada7ab62a2d1ba8 Riley Smith 1670548363 -0800 pull --rebase: Fast-forward diff --git a/dot_config/nvim/dot_git/logs/refs/heads/main b/dot_config/nvim/dot_git/logs/refs/heads/main deleted file mode 100644 index 03fd1eb..0000000 --- a/dot_config/nvim/dot_git/logs/refs/heads/main +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 ba775276324b75e4f703cd63fea3cfe7726514de Riley Smith 1659027739 -0700 clone: from https://github.com/AstroNvim/AstroNvim -ba775276324b75e4f703cd63fea3cfe7726514de 5288bad46858f15f2290aeb3d09c8bd8e58b7882 Riley Smith 1666894344 -0700 pull --rebase: Fast-forward -5288bad46858f15f2290aeb3d09c8bd8e58b7882 176265812355a53559497c0f0ada7ab62a2d1ba8 Riley Smith 1670548363 -0800 pull --rebase: Fast-forward diff --git a/dot_config/nvim/dot_git/logs/refs/remotes/origin/HEAD b/dot_config/nvim/dot_git/logs/refs/remotes/origin/HEAD deleted file mode 100644 index 89b4775..0000000 --- a/dot_config/nvim/dot_git/logs/refs/remotes/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 ba775276324b75e4f703cd63fea3cfe7726514de Riley Smith 1659027739 -0700 clone: from https://github.com/AstroNvim/AstroNvim diff --git a/dot_config/nvim/dot_git/logs/refs/remotes/origin/dap b/dot_config/nvim/dot_git/logs/refs/remotes/origin/dap deleted file mode 100644 index 8ed9719..0000000 --- a/dot_config/nvim/dot_git/logs/refs/remotes/origin/dap +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 28bdb9800c1fdaa0f2063a2073e1af1c9c9faa6d Riley Smith 1666894323 -0700 fetch origin: storing head diff --git a/dot_config/nvim/dot_git/logs/refs/remotes/origin/devicon b/dot_config/nvim/dot_git/logs/refs/remotes/origin/devicon deleted file mode 100644 index 2d57ab0..0000000 --- a/dot_config/nvim/dot_git/logs/refs/remotes/origin/devicon +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 23d7faaa166f633d00a446726bab2e355143c3e2 Riley Smith 1666894323 -0700 fetch origin: storing head diff --git a/dot_config/nvim/dot_git/logs/refs/remotes/origin/gh-pages b/dot_config/nvim/dot_git/logs/refs/remotes/origin/gh-pages deleted file mode 100644 index efe746f..0000000 --- a/dot_config/nvim/dot_git/logs/refs/remotes/origin/gh-pages +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 1e520d7e47dc588f58f59613ab17300ff8496986 Riley Smith 1666894323 -0700 fetch origin: storing head -1e520d7e47dc588f58f59613ab17300ff8496986 3dd00eaf98ccaae3c8b4bcf4a4e05390c0139fe6 Riley Smith 1670548361 -0800 fetch origin: fast-forward diff --git a/dot_config/nvim/dot_git/logs/refs/remotes/origin/heirline_bufferline b/dot_config/nvim/dot_git/logs/refs/remotes/origin/heirline_bufferline deleted file mode 100644 index e87d99a..0000000 --- a/dot_config/nvim/dot_git/logs/refs/remotes/origin/heirline_bufferline +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 c7a79519290352fc5710b95285bb016176a8efd0 Riley Smith 1666894323 -0700 fetch origin: storing head -c7a79519290352fc5710b95285bb016176a8efd0 6d7dbb93ab965aef1d48fb23859893bb66ab379f Riley Smith 1670548361 -0800 fetch origin: forced-update -6d7dbb93ab965aef1d48fb23859893bb66ab379f 1356d5364dd54549d93127fbd1ae11bed550712d Riley Smith 1671013094 -0800 fetch origin: forced-update diff --git a/dot_config/nvim/dot_git/logs/refs/remotes/origin/main b/dot_config/nvim/dot_git/logs/refs/remotes/origin/main deleted file mode 100644 index 0760141..0000000 --- a/dot_config/nvim/dot_git/logs/refs/remotes/origin/main +++ /dev/null @@ -1,2 +0,0 @@ -ba775276324b75e4f703cd63fea3cfe7726514de 5288bad46858f15f2290aeb3d09c8bd8e58b7882 Riley Smith 1666894323 -0700 fetch origin: fast-forward -5288bad46858f15f2290aeb3d09c8bd8e58b7882 176265812355a53559497c0f0ada7ab62a2d1ba8 Riley Smith 1670548361 -0800 fetch origin: fast-forward diff --git a/dot_config/nvim/dot_git/logs/refs/remotes/origin/nightly b/dot_config/nvim/dot_git/logs/refs/remotes/origin/nightly deleted file mode 100644 index 94fb960..0000000 --- a/dot_config/nvim/dot_git/logs/refs/remotes/origin/nightly +++ /dev/null @@ -1,4 +0,0 @@ -0000000000000000000000000000000000000000 0ce1b696613bc3dba23f24508ca5a2b7133fd5ba Riley Smith 1666894323 -0700 fetch origin: storing head -0ce1b696613bc3dba23f24508ca5a2b7133fd5ba bbff11735a735bb839862eaba51c96d3a9fb5181 Riley Smith 1670548361 -0800 fetch origin: forced-update -bbff11735a735bb839862eaba51c96d3a9fb5181 f33cf19822c789b04c11a4ef795b462705aabde2 Riley Smith 1671013094 -0800 fetch origin: forced-update -f33cf19822c789b04c11a4ef795b462705aabde2 ddc49bc4d074d5b9a9899b9bee33de3416f464bd Riley Smith 1671252112 -0800 fetch origin: forced-update diff --git a/dot_config/nvim/dot_git/logs/refs/remotes/origin/readme b/dot_config/nvim/dot_git/logs/refs/remotes/origin/readme deleted file mode 100644 index d75e48b..0000000 --- a/dot_config/nvim/dot_git/logs/refs/remotes/origin/readme +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 b5188030d2e272f5a0cc75e0e9ba2d0cdc5093d0 Riley Smith 1666894323 -0700 fetch origin: storing head diff --git a/dot_config/nvim/dot_git/logs/refs/remotes/origin/shields b/dot_config/nvim/dot_git/logs/refs/remotes/origin/shields deleted file mode 100644 index 6748cf9..0000000 --- a/dot_config/nvim/dot_git/logs/refs/remotes/origin/shields +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 e1a36a82a3b53ade76ea1384853d4fd387e81a8c Riley Smith 1666894323 -0700 fetch origin: storing head diff --git a/dot_config/nvim/dot_git/objects/info/.keep b/dot_config/nvim/dot_git/objects/info/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/dot_config/nvim/dot_git/objects/pack/readonly_pack-33a23b1a698108fd26b05313b79912f1cb7c7109.idx b/dot_config/nvim/dot_git/objects/pack/readonly_pack-33a23b1a698108fd26b05313b79912f1cb7c7109.idx deleted file mode 100644 index 8cf0e37..0000000 Binary files a/dot_config/nvim/dot_git/objects/pack/readonly_pack-33a23b1a698108fd26b05313b79912f1cb7c7109.idx and /dev/null differ diff --git a/dot_config/nvim/dot_git/objects/pack/readonly_pack-33a23b1a698108fd26b05313b79912f1cb7c7109.pack b/dot_config/nvim/dot_git/objects/pack/readonly_pack-33a23b1a698108fd26b05313b79912f1cb7c7109.pack deleted file mode 100644 index ee3bf77..0000000 Binary files a/dot_config/nvim/dot_git/objects/pack/readonly_pack-33a23b1a698108fd26b05313b79912f1cb7c7109.pack and /dev/null differ diff --git a/dot_config/nvim/dot_git/objects/pack/readonly_pack-fa6b3ca507f5c08d5f27e1e3a21c78b58166d508.idx b/dot_config/nvim/dot_git/objects/pack/readonly_pack-fa6b3ca507f5c08d5f27e1e3a21c78b58166d508.idx deleted file mode 100644 index fef90cd..0000000 Binary files a/dot_config/nvim/dot_git/objects/pack/readonly_pack-fa6b3ca507f5c08d5f27e1e3a21c78b58166d508.idx and /dev/null differ diff --git a/dot_config/nvim/dot_git/objects/pack/readonly_pack-fa6b3ca507f5c08d5f27e1e3a21c78b58166d508.pack b/dot_config/nvim/dot_git/objects/pack/readonly_pack-fa6b3ca507f5c08d5f27e1e3a21c78b58166d508.pack deleted file mode 100644 index 3ec4888..0000000 Binary files a/dot_config/nvim/dot_git/objects/pack/readonly_pack-fa6b3ca507f5c08d5f27e1e3a21c78b58166d508.pack and /dev/null differ diff --git a/dot_config/nvim/dot_git/packed-refs b/dot_config/nvim/dot_git/packed-refs deleted file mode 100644 index 5932b45..0000000 --- a/dot_config/nvim/dot_git/packed-refs +++ /dev/null @@ -1,24 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted -ba775276324b75e4f703cd63fea3cfe7726514de refs/remotes/origin/main -433fdda5b4ff136aa809c0ea678a19ff2559f696 refs/remotes/origin/mason -22d1bd5ef53a0c68d15848e1af976924f3e74c0d refs/remotes/origin/neovim-0.8 -1c67dbfd97f89abd02588c61bee2ee2dd9090df9 refs/remotes/origin/v2 -dad69af980919aab0b3157f6f767ddda438605f6 refs/tags/nvim-0.6 -^fbdeb0f7ee3e351d025ad50aa08950bc8fb5db72 -5e06f9bd75f2cfca2862eeb68fdb9915114def90 refs/tags/v1.0.0 -bfcdfd6dbb738cdb03f4f44a213a971b8d8bcb56 refs/tags/v1.1.0 -f25e3a6bf4b9aa59c8f822e65930401c1fad521f refs/tags/v1.2.0 -^db1b310f9afd28670f61bf2c160165ffa12763f0 -fa8f1f66c488f8cc5cd30379cbd7b4c5cf630e9c refs/tags/v1.3.0 -^29f595f1fe916297b23ec0447c257dffe3164f80 -e0c08e43119962a3447156cc55116084779f7154 refs/tags/v1.4.0 -ccbfa441902c5d138fcd1ff6b5c300cb21a32a92 refs/tags/v1.4.1 -ed749b7879c8a0082f3edcad371b52d3a586a27d refs/tags/v1.4.2 -81439578e81d257607d6d11eabe00a6eb1ca6ea5 refs/tags/v1.4.3 -6a20f0ce418f672f8f78ecd436113a2b8f4cfbbd refs/tags/v1.4.4 -f06ecaf46d67bb3a2886eee7d5d62a9805b668c3 refs/tags/v1.5.0 -b5b620b2b823cade3a6f5c6fb7d83d4d8651390b refs/tags/v1.5.1 -5696a8b99becb36a3b91921e39ec2470d2b3533b refs/tags/v1.5.2 -e85e050a2798cbe69763fe91edc649c0bd1df48f refs/tags/v1.6.0 -d213b4ddfc5baa0ec4cd384e6a1fd74de3dc37f7 refs/tags/v1.6.1 -24760d63c27973e0c7573532cad89dffe1dcffa8 refs/tags/v1.7.0 diff --git a/dot_config/nvim/dot_git/refs/heads/main b/dot_config/nvim/dot_git/refs/heads/main deleted file mode 100644 index a958dd8..0000000 --- a/dot_config/nvim/dot_git/refs/heads/main +++ /dev/null @@ -1 +0,0 @@ -176265812355a53559497c0f0ada7ab62a2d1ba8 diff --git a/dot_config/nvim/dot_git/refs/remotes/origin/HEAD b/dot_config/nvim/dot_git/refs/remotes/origin/HEAD deleted file mode 100644 index 4b0a875..0000000 --- a/dot_config/nvim/dot_git/refs/remotes/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/remotes/origin/main diff --git a/dot_config/nvim/dot_git/refs/remotes/origin/dap b/dot_config/nvim/dot_git/refs/remotes/origin/dap deleted file mode 100644 index 956b73a..0000000 --- a/dot_config/nvim/dot_git/refs/remotes/origin/dap +++ /dev/null @@ -1 +0,0 @@ -28bdb9800c1fdaa0f2063a2073e1af1c9c9faa6d diff --git a/dot_config/nvim/dot_git/refs/remotes/origin/devicon b/dot_config/nvim/dot_git/refs/remotes/origin/devicon deleted file mode 100644 index d0ee1a7..0000000 --- a/dot_config/nvim/dot_git/refs/remotes/origin/devicon +++ /dev/null @@ -1 +0,0 @@ -23d7faaa166f633d00a446726bab2e355143c3e2 diff --git a/dot_config/nvim/dot_git/refs/remotes/origin/gh-pages b/dot_config/nvim/dot_git/refs/remotes/origin/gh-pages deleted file mode 100644 index 55d7628..0000000 --- a/dot_config/nvim/dot_git/refs/remotes/origin/gh-pages +++ /dev/null @@ -1 +0,0 @@ -3dd00eaf98ccaae3c8b4bcf4a4e05390c0139fe6 diff --git a/dot_config/nvim/dot_git/refs/remotes/origin/heirline_bufferline b/dot_config/nvim/dot_git/refs/remotes/origin/heirline_bufferline deleted file mode 100644 index 4698e8c..0000000 --- a/dot_config/nvim/dot_git/refs/remotes/origin/heirline_bufferline +++ /dev/null @@ -1 +0,0 @@ -1356d5364dd54549d93127fbd1ae11bed550712d diff --git a/dot_config/nvim/dot_git/refs/remotes/origin/main b/dot_config/nvim/dot_git/refs/remotes/origin/main deleted file mode 100644 index a958dd8..0000000 --- a/dot_config/nvim/dot_git/refs/remotes/origin/main +++ /dev/null @@ -1 +0,0 @@ -176265812355a53559497c0f0ada7ab62a2d1ba8 diff --git a/dot_config/nvim/dot_git/refs/remotes/origin/nightly b/dot_config/nvim/dot_git/refs/remotes/origin/nightly deleted file mode 100644 index 2e7af68..0000000 --- a/dot_config/nvim/dot_git/refs/remotes/origin/nightly +++ /dev/null @@ -1 +0,0 @@ -ddc49bc4d074d5b9a9899b9bee33de3416f464bd diff --git a/dot_config/nvim/dot_git/refs/remotes/origin/readme b/dot_config/nvim/dot_git/refs/remotes/origin/readme deleted file mode 100644 index b8aaa4e..0000000 --- a/dot_config/nvim/dot_git/refs/remotes/origin/readme +++ /dev/null @@ -1 +0,0 @@ -b5188030d2e272f5a0cc75e0e9ba2d0cdc5093d0 diff --git a/dot_config/nvim/dot_git/refs/remotes/origin/shields b/dot_config/nvim/dot_git/refs/remotes/origin/shields deleted file mode 100644 index 36a4089..0000000 --- a/dot_config/nvim/dot_git/refs/remotes/origin/shields +++ /dev/null @@ -1 +0,0 @@ -e1a36a82a3b53ade76ea1384853d4fd387e81a8c diff --git a/dot_config/nvim/dot_git/refs/tags/.keep b/dot_config/nvim/dot_git/refs/tags/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/dot_config/nvim/dot_git/refs/tags/v1.10.0 b/dot_config/nvim/dot_git/refs/tags/v1.10.0 deleted file mode 100644 index 50abb89..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v1.10.0 +++ /dev/null @@ -1 +0,0 @@ -392b92d4f731d6126a1a3b946cc3a20e7aef9bfc diff --git a/dot_config/nvim/dot_git/refs/tags/v1.8.0 b/dot_config/nvim/dot_git/refs/tags/v1.8.0 deleted file mode 100644 index 7753671..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v1.8.0 +++ /dev/null @@ -1 +0,0 @@ -8453ed985262a23cb9ff4a1bbf02c32ca5460ea7 diff --git a/dot_config/nvim/dot_git/refs/tags/v1.8.1 b/dot_config/nvim/dot_git/refs/tags/v1.8.1 deleted file mode 100644 index b191c57..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v1.8.1 +++ /dev/null @@ -1 +0,0 @@ -5e28adaed25853c2e1ff3d3a464d71750a38dc39 diff --git a/dot_config/nvim/dot_git/refs/tags/v1.9.0 b/dot_config/nvim/dot_git/refs/tags/v1.9.0 deleted file mode 100644 index bd11fae..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v1.9.0 +++ /dev/null @@ -1 +0,0 @@ -7ba02c5c6097a9b5a4f42ca7204fc856502bd14e diff --git a/dot_config/nvim/dot_git/refs/tags/v1.9.1 b/dot_config/nvim/dot_git/refs/tags/v1.9.1 deleted file mode 100644 index 0ff1e6b..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v1.9.1 +++ /dev/null @@ -1 +0,0 @@ -3c96bb087f1db8fba779546f4662bae6864e5bc8 diff --git a/dot_config/nvim/dot_git/refs/tags/v1.9.2 b/dot_config/nvim/dot_git/refs/tags/v1.9.2 deleted file mode 100644 index ace3655..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v1.9.2 +++ /dev/null @@ -1 +0,0 @@ -9badfdd8f2e472fc79dd666679df9ed6237240a8 diff --git a/dot_config/nvim/dot_git/refs/tags/v2.0.0 b/dot_config/nvim/dot_git/refs/tags/v2.0.0 deleted file mode 100644 index b1b5c44..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v2.0.0 +++ /dev/null @@ -1 +0,0 @@ -53d210d3905f65b9e8f0bdb0c8a307440ebfc3f8 diff --git a/dot_config/nvim/dot_git/refs/tags/v2.0.1 b/dot_config/nvim/dot_git/refs/tags/v2.0.1 deleted file mode 100644 index 3cafbf3..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v2.0.1 +++ /dev/null @@ -1 +0,0 @@ -a157c0ed2ce6b6b956819e29bc78688044f2ef1d diff --git a/dot_config/nvim/dot_git/refs/tags/v2.0.2 b/dot_config/nvim/dot_git/refs/tags/v2.0.2 deleted file mode 100644 index 7fddd4b..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v2.0.2 +++ /dev/null @@ -1 +0,0 @@ -0882a17b0d399c3fef12cd963fac32f8ba4f5a3c diff --git a/dot_config/nvim/dot_git/refs/tags/v2.1.0 b/dot_config/nvim/dot_git/refs/tags/v2.1.0 deleted file mode 100644 index d12dddc..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v2.1.0 +++ /dev/null @@ -1 +0,0 @@ -f65794ed742a255498a161f8a4ccd1b334404be4 diff --git a/dot_config/nvim/dot_git/refs/tags/v2.1.1 b/dot_config/nvim/dot_git/refs/tags/v2.1.1 deleted file mode 100644 index 593c82e..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v2.1.1 +++ /dev/null @@ -1 +0,0 @@ -5148df725aebcfe2a80876762a2425c7e1820569 diff --git a/dot_config/nvim/dot_git/refs/tags/v2.2.0 b/dot_config/nvim/dot_git/refs/tags/v2.2.0 deleted file mode 100644 index dc27c4d..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v2.2.0 +++ /dev/null @@ -1 +0,0 @@ -501aece937d323c534dddc0ebeb07c4560b409e5 diff --git a/dot_config/nvim/dot_git/refs/tags/v2.2.1 b/dot_config/nvim/dot_git/refs/tags/v2.2.1 deleted file mode 100644 index f15e3fa..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v2.2.1 +++ /dev/null @@ -1 +0,0 @@ -3f269b70cdf41a7636b0c2472afe1dba9467ccc6 diff --git a/dot_config/nvim/dot_git/refs/tags/v2.2.2 b/dot_config/nvim/dot_git/refs/tags/v2.2.2 deleted file mode 100644 index 3c34c78..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v2.2.2 +++ /dev/null @@ -1 +0,0 @@ -fa82ff92b438d764f2ed683cca2ec7e95e7ffb72 diff --git a/dot_config/nvim/dot_git/refs/tags/v2.3.0 b/dot_config/nvim/dot_git/refs/tags/v2.3.0 deleted file mode 100644 index 57f460a..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v2.3.0 +++ /dev/null @@ -1 +0,0 @@ -893665a969129eb528e54b7e4bee1e6c952d6d25 diff --git a/dot_config/nvim/dot_git/refs/tags/v2.4.0 b/dot_config/nvim/dot_git/refs/tags/v2.4.0 deleted file mode 100644 index 761633a..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v2.4.0 +++ /dev/null @@ -1 +0,0 @@ -f5200f4b00df1db0c14a13b61bbb428594733e52 diff --git a/dot_config/nvim/dot_git/refs/tags/v2.4.1 b/dot_config/nvim/dot_git/refs/tags/v2.4.1 deleted file mode 100644 index db28c40..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v2.4.1 +++ /dev/null @@ -1 +0,0 @@ -a4292d28b867249ba6330616e4689e6cf69ad3f0 diff --git a/dot_config/nvim/dot_git/refs/tags/v2.4.2 b/dot_config/nvim/dot_git/refs/tags/v2.4.2 deleted file mode 100644 index b326264..0000000 --- a/dot_config/nvim/dot_git/refs/tags/v2.4.2 +++ /dev/null @@ -1 +0,0 @@ -5288bad46858f15f2290aeb3d09c8bd8e58b7882 diff --git a/dot_config/nvim/dot_github/CODE_OF_CONDUCT.md b/dot_config/nvim/dot_github/CODE_OF_CONDUCT.md deleted file mode 100644 index 86a3913..0000000 --- a/dot_config/nvim/dot_github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -education, socio-economic status, nationality, personal appearance, race, -religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at {{ email }}. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - diff --git a/dot_config/nvim/dot_github/CONTRIBUTING.md b/dot_config/nvim/dot_github/CONTRIBUTING.md deleted file mode 100644 index fff45e3..0000000 --- a/dot_config/nvim/dot_github/CONTRIBUTING.md +++ /dev/null @@ -1,170 +0,0 @@ -# CONTRIBUTING - -## AstroNvim install for contributors - -If you wish to contribute to AstroNvim, you should: -1. [create a fork on GitHub](https://docs.github.com/en/get-started/quickstart/fork-a-repo) -2. clone your fork to your machine - - For ssh: - ```shell - $ git clone git@github.com:/AstroNvim.git ~/.config/nvim - ``` - - For https: - ```shell - $ git clone https://github.com//AstroNvim.git ~/.config/nvim - ``` -3. [add a new remote repo to track](https://www.atlassian.com/git/tutorials/git-forks-and-upstreams) - - this means you can push/pull as normal to your own repo, but also easily track & update from the AstroNvim repo - - for ssh: - ```shell - $ git remote add upstream git@github.com:AstroNvim/AstroNvim.git - ``` - - for https: - ```shell - $ git remote add upstream https://github.com/AstroNvim/AstroNvim.git - ``` -4. any time you create a branch to do some work, use - ```shell - $ git fetch upstream && git checkout -b dev-myFEAT upstream/main - ``` -5. only use the **--rebase** flag to update your dev branch - - this means that there are no `Merge AstroNvim/main into devBranch` commits, which are to be avoided - ```shell - $ git pull upstream --rebase - ``` - -## Things to know before contributing - -- Development happens on the `nightly` branch, so please make sure of a couple things - - - all branches are rebased on the `nightly` branch to get the latest updates. - - - all pull requests are made to merge into `nightly` - -- When making a PR (pull request), please be very descriptive about what you've done! - -- Commit messages must follow [Conventional Commits Specification](https://www.conventionalcommits.org/en/v1.0.0/) - - - PR titles and commit messages should be formatted with 'fix', 'feat', 'docs', 'refactor', or 'chore'. ex: `feat: add new plugin` - - - If your contribution mostly pertains to a single module in AstroNvim, please include that in the title. ex: If you have modified something in the `lua/configs/lsp` folder for the lsp configuration use something like `fix(lsp): typo in lsp mappings` - - - If your contribution contains any sort of breaking change include a `!` at the end of the change type. ex: `feat!: move status bar from lualine to feline` - -- PRs should follow the pull request formats where applicable - -- We are open to all PRs, but if a PR is denied for any reason please don't be discouraged! We'll still be open to discussions. If you have any questions before opening the PR feel free to join the [discord server](https://discord.gg/UcZutyeaFW). - -- AstroNvim aims to provide the best user experience when it comes to being able to support confident updating for users, for this reason please avoid opening PRs with breaking changes. Avoiding breaking changes is not always going to be possible, so if you think it is completely necessary we are open to discussion. - -## How to remove, squash, or edit commits from your PR -> You may have been directed here to remove a commit such as a merge commit: `Merge AstroNvim/main into devBranch` from your PR - -> As these commands edit your git history, you may need to **force push** with `git push origin --force-with-lease` - -1. Run the following: - ``` - $ git rebase -i HEAD~ - ``` -
Example -

- - ```shell - $ git rebase -i HEAD~4 - ``` - - ```shell - pick 28b2dcb feat: statusline add lsp status - pick dad9a39 fix: typo - pick 68f72f1 add clickable btn for exiting nvim - pick b281b53 avoid using q! for quitting vim - - # Rebase 52b655b..b281b53 onto 52b655b (4 commands) - # - # Commands: - # p, pick = use commit - # r, reword = use commit, but edit the commit message - # e, edit = use commit, but stop for amending - # s, squash = use commit, but meld into previous commit - # f, fixup = like "squash", but discard this commit's log message - # x, exec = run command (the rest of the line) using shell - # b, break = stop here (continue rebase later with 'git rebase --continue') - # d, drop = remove commit - # l, label

-
- -2. Change the `pick` commands to whatever you wish, you may wish to `s` `squash`, `d` `drop` or `e` `edit` a commit. Then save & quit this git file to run it. - -
Example -

- - ```shell {3,4} - pick 28b2dcb feat: statusline add lsp status - squash dad9a39 fix: typo - edit 68f72f1 add clickable btn for exiting nvim - d b281b53 avoid using q! for quitting vim - - # Rebase 52b655b..b281b53 onto 52b655b (4 commands) - # - # Commands: - # p, pick = use commit - # r, reword = use commit, but edit the commit message - # e, edit = use commit, but stop for amending - # s, squash = use commit, but meld into previous commit - # f, fixup = like "squash", but discard this commit's log message - # x, exec = run command (the rest of the line) using shell - # b, break = stop here (continue rebase later with 'git rebase --continue') - # d, drop = remove commit - # l, label

-
- -3. If you picked `drop` you are done. If you picked `squash` then you will be brought to a screen to update the commit message for the new aggregated commit, please make sure the new commit message follows the Conventional Commit specification. If you picked `edit` then edit your files, then run: - ```shell - $ git add - ``` - -4. Continue rebasing until all edits are finished. Run the following command to continue through the rebase if there are more changes: - - ```shell - $ git rebase --continue - ``` - -5. Push the changes with `--force-with-lease`: - ```shell - $ git push origin --force-with-lease - ``` - -## Help -For help with contributing and anything else AstroNvim related join the [discord](https://discord.gg/UcZutyeaFW) diff --git a/dot_config/nvim/dot_github/FUNDING.yml b/dot_config/nvim/dot_github/FUNDING.yml deleted file mode 100644 index ec71cb6..0000000 --- a/dot_config/nvim/dot_github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -ko_fi: mehalter -custom: https://www.buymeacoffee.com/mehalter diff --git a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/bug_report.md b/dot_config/nvim/dot_github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index aa23535..0000000 --- a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: '' - ---- - -**Checklist** -Please confirm you have run the following commands and restarted Neovim and are encountering the issue with the current latest version of AstroNvim -- [ ] `:PackerSync` -- [ ] `:AstroUpdate` -- [ ] restarted AstroNvim -- [ ] Neovim version >= 0.7.0 - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots or recording ([Asciinema](asciinema.org)) to help explain your problem. - -**Additional context** -Add any other context about the problem here. diff --git a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/bug_report.yaml b/dot_config/nvim/dot_github/ISSUE_TEMPLATE/bug_report.yaml deleted file mode 100644 index 3edf891..0000000 --- a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/bug_report.yaml +++ /dev/null @@ -1,78 +0,0 @@ -name: Bug report -description: Create a report to help us improve -labels: [bug] - -body: - - type: checkboxes - id: terms - attributes: - label: Checklist - description: Have you completed the following steps and are still able to replicate the issue? - options: - - label: "Using a stable version of Neovim (i.e. not neovim nightly)" - required: true - - label: "`:PackerSync`" - required: true - - label: "`:AstroUpdate`" - required: true - - label: Restarted AstroNvim - required: true - - type: input - id: version - attributes: - label: AstroNvim version - placeholder: | - output of :AstroVersion - validations: - required: true - - type: input - id: nvim-version - attributes: - label: Neovim version (>= 0.8) - description: "Output of `nvim --version`" - placeholder: | - NVIM v0.8.0 - validations: - required: true - - type: input - id: system-version - attributes: - label: "Operating system/version" - placeholder: "macOS 11.5" - validations: - required: true - - type: textarea - id: description - attributes: - label: Describe the bug - placeholder: A clear and concise description of what the bug is. - validations: - required: true - - type: textarea - id: reproduce - attributes: - label: Steps to Reproduce - placeholder: | - 1. Go to '...' - 2. Click on '....' - 3. Scroll down to '....' - 4. See error - validations: - required: true - - type: textarea - id: expected - attributes: - label: Expected behavior - placeholder: A clear and concise description of what you expected to happen - validations: - required: true - - type: textarea - id: screenshots - attributes: - label: Screenshots - description: If applicable, add screenshots or recording ([Asciinema](asciinema.org)) to help explain your problem. - - type: textarea - id: additional-context - attributes: - label: Additional Context - placeholder: Add any additional context about the problem here. diff --git a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/config.yml b/dot_config/nvim/dot_github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 9248681..0000000 --- a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,8 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: r/AstroNvim (Reddit) - url: https://www.reddit.com/r/AstroNvim - about: Ask questions about AstroNvim on the official Subreddit - - name: Discord Chat - url: https://discord.gg/UcZutyeaFW - about: Ask questions and have discussions about AstroNvim on Discord diff --git a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/feature_request.md b/dot_config/nvim/dot_github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 59094e2..0000000 --- a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: enhancement -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/feature_request.yaml b/dot_config/nvim/dot_github/ISSUE_TEMPLATE/feature_request.yaml deleted file mode 100644 index e28e766..0000000 --- a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/feature_request.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Feature request -description: Suggest an idea for this project -labels: [enhancement] - -body: - - type: textarea - id: problem - attributes: - label: Is your feature related to a problem? - placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - - type: textarea - id: solution - attributes: - label: Describe the new feature - placeholder: A clear and concise description of what the new feature is. - validations: - required: true - - type: textarea - id: additional-context - attributes: - label: Additional context - placeholder: Add any other context or screenshots about the feature request here. diff --git a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/question.md b/dot_config/nvim/dot_github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index 10cb6c8..0000000 --- a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Question -about: Ask a general question about AstroNvim usage -title: '' -labels: question -assignees: '' - ---- - - diff --git a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/question.yaml b/dot_config/nvim/dot_github/ISSUE_TEMPLATE/question.yaml deleted file mode 100644 index 6edc4c2..0000000 --- a/dot_config/nvim/dot_github/ISSUE_TEMPLATE/question.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Question -description: Ask a general question about AstroNvim usage -labels: [question] - -body: - - type: textarea - id: question - attributes: - label: Question - validations: - required: true - - type: textarea - id: user-config - attributes: - label: User Configuration - description: "Please include your `user/init.lua` file here if relevant" - placeholder: | - ```lua - local config = { - header = "My Custom Config", - } - - return config - ``` diff --git a/dot_config/nvim/dot_github/PULL_REQUEST_TEMPLATE/chore.md b/dot_config/nvim/dot_github/PULL_REQUEST_TEMPLATE/chore.md deleted file mode 100644 index 60c219a..0000000 --- a/dot_config/nvim/dot_github/PULL_REQUEST_TEMPLATE/chore.md +++ /dev/null @@ -1,7 +0,0 @@ -Fixes Issue # (If it doesn't fix an issue then delete this line) - -Description: -Describe the refactor or cleanup that was completed - -Other: -Anything else relevant goes here diff --git a/dot_config/nvim/dot_github/PULL_REQUEST_TEMPLATE/feature.md b/dot_config/nvim/dot_github/PULL_REQUEST_TEMPLATE/feature.md deleted file mode 100644 index b2ff3d5..0000000 --- a/dot_config/nvim/dot_github/PULL_REQUEST_TEMPLATE/feature.md +++ /dev/null @@ -1,10 +0,0 @@ -Fixes Issue # (If it doesn't fix an issue then delete this line) - -Features Added: -- Plugin Name (Add links if possible too) - -Reasoning: -List why the feature is needed - -Other: -Anything else relevant goes here diff --git a/dot_config/nvim/dot_github/PULL_REQUEST_TEMPLATE/fix.md b/dot_config/nvim/dot_github/PULL_REQUEST_TEMPLATE/fix.md deleted file mode 100644 index a173370..0000000 --- a/dot_config/nvim/dot_github/PULL_REQUEST_TEMPLATE/fix.md +++ /dev/null @@ -1,7 +0,0 @@ -Fixes Issue # (If it doesn't fix an issue then delete this line) - -Bugs Fixed: -- A bullet for each bug fixed and a description - -Other: -Anything else relevant goes here diff --git a/dot_config/nvim/dot_github/README.md b/dot_config/nvim/dot_github/README.md deleted file mode 100644 index 906c7db..0000000 --- a/dot_config/nvim/dot_github/README.md +++ /dev/null @@ -1,147 +0,0 @@ -
- -
- -

AstroNvim

- -

- Install - · - Configure - · - Docs -

- -

- - - - - - - - - -
- - - - - - -

- -

-AstroNvim is an aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins -

- -## 🌟 Preview - -![Preview1](https://github.com/AstroNvim/astronvim.github.io/raw/main/static/img/dashboard.png) -![Preview2](https://github.com/AstroNvim/astronvim.github.io/raw/main/static/img/overview.png) -![Preview33](https://github.com/AstroNvim/astronvim.github.io/raw/main/static/img/vertsplit.png) - -## ✨ Features - -- File explorer with [Neo-tree](https://github.com/nvim-neo-tree/neo-tree.nvim) -- Autocompletion with [Cmp](https://github.com/hrsh7th/nvim-cmp) -- Git integration with [Gitsigns](https://github.com/lewis6991/gitsigns.nvim) -- Statusline with [Heirline](https://github.com/rebelot/heirline.nvim) -- Terminal with [Toggleterm](https://github.com/akinsho/toggleterm.nvim) -- Fuzzy finding with [Telescope](https://github.com/nvim-telescope/telescope.nvim) -- Syntax highlighting with [Treesitter](https://github.com/nvim-treesitter/nvim-treesitter) -- Formatting and linting with [Null-ls](https://github.com/jose-elias-alvarez/null-ls.nvim) -- Language Server Protocol with [Native LSP](https://github.com/neovim/nvim-lspconfig) -- Debug Adapter Protocol with [nvim-dap](https://github.com/mfussenegger/nvim-dap) -- Buffer Line with [bufferline.nvim](https://github.com/akinsho/bufferline.nvim) - -## ⚡ Requirements - -- [Nerd Fonts](https://www.nerdfonts.com/font-downloads) (_Optional with manual intervention:_ See [Documentation on customizing icons](https://astronvim.github.io/Recipes/icons)) -- [Neovim 0.8 (_Not_ including nightly)](https://github.com/neovim/neovim/releases/tag/v0.8.0) -- [Tree-sitter CLI](https://github.com/tree-sitter/tree-sitter/blob/master/cli/README.md) (_Note:_ This is only necessary if you want to use `auto_install` feature with Treesitter) -- A clipboard tool is necessary for the integration with the system clipboard (see [`:help clipboard-tool`](https://neovim.io/doc/user/provider.html#clipboard-tool) for supported solutions) -- Terminal with true color support (for the default theme, otherwise it is dependent on the theme you are using) -- Optional Requirements: - - [ripgrep](https://github.com/BurntSushi/ripgrep) - live grep telescope search (`fw`) - - [lazygit](https://github.com/jesseduffield/lazygit) - git ui toggle terminal (`tl` or `gg`) - - [go DiskUsage()](https://github.com/dundee/gdu) - disk usage toggle terminal (`tu`) - - [bottom](https://github.com/ClementTsang/bottom) - process viewer toggle terminal (`tt`) - - [Python](https://www.python.org/) - python repl toggle terminal (`tp`) - - [Node](https://nodejs.org/en/) - node repl toggle terminal (`tn`) - -> Note when using default theme: For MacOS, the default terminal does not have true color support. You will need to use [iTerm2](https://iterm2.com/) or another [terminal emulator](https://gist.github.com/XVilka/8346728#terminal-emulators) that has true color support. - -## 🛠️ Installation - -#### Make a backup of your current nvim and shared folder - -```shell -mv ~/.config/nvim ~/.config/nvim.bak -mv ~/.local/share/nvim ~/.local/share/nvim.bak -``` - -#### Clone the repository - -```shell -git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim -nvim +PackerSync -``` - -## 📦 Basic Setup - -#### Install LSP - -Enter `:LspInstall` followed by the name of the server you want to install
-Example: `:LspInstall pyright` - -#### Install language parser - -Enter `:TSInstall` followed by the name of the language you want to install
-Example: `:TSInstall python` - -#### Install Debugger - -Enter `:DapInstall` followed by the name of the debugger you want to install
-Example: `:DapInstall python` - -#### Manage plugins - -Run `:PackerClean` to remove any disabled or unused plugins
-Run `:PackerSync` to update and clean plugins
- -#### Update AstroNvim - -Run `:AstroUpdate` to get the latest updates from the repository
- -## 🗒️ Links - -[AstroNvim Documentation](https://astronvim.github.io/) -[Core AstroNvim LUA API Documentation](https://astronvim.github.io/AstroNvim/) - -- [Basic Usage](https://astronvim.github.io/Basic%20Usage/walkthrough) is given for basic usage -- [Default Mappings](https://astronvim.github.io/Basic%20Usage/mappings) more about the default key bindings -- [Default Plugin Configuration](https://astronvim.github.io/configuration/plugin_defaults) more about the provided plugin defaults -- [Advanced Configuration](https://astronvim.github.io/configuration/config_options) more about advanced configuration - -### 📹 Videos - -There have been some great review videos released by members of the community! Here are a few: - -- [Why I'm quitting VIM by Carlos Mafla](https://www.youtube.com/watch?v=71GDopdc9rw) (Content By: [@gigo6000](https://github.com/gigo6000)) -- [Astro Vim - All in one Nvim config!! by John McBride](https://www.youtube.com/watch?v=JQLZ7NJRTEo) (Content By: [@jpmcb](https://github.com/jpmcb)) - -## ⭐ Credits - -Sincere appreciation to the following repositories, plugin authors and the entire neovim community out there that made the development of AstroNvim possible. - -- [Plugins](https://astronvim.github.io/acknowledgements#plugins-used-in-astronvim) -- [NvChad](https://github.com/NvChad/NvChad) -- [LunarVim](https://github.com/LunarVim) -- [CosmicVim](https://github.com/CosmicNvim/CosmicNvim) - -
- -[![Lua](https://img.shields.io/badge/Made%20with%20Lua-blue.svg?style=for-the-badge&logo=lua)](https://lua.org) - -
diff --git a/dot_config/nvim/dot_github/stale.yml b/dot_config/nvim/dot_github/stale.yml deleted file mode 100644 index 80a5164..0000000 --- a/dot_config/nvim/dot_github/stale.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 60 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security - - notice - - wip -# Label to use when marking an issue as stale -staleLabel: stale -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed in 7 days if no further activity occurs. - Thank you for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/dot_config/nvim/dot_github/workflows/conventional_commit.yml b/dot_config/nvim/dot_github/workflows/conventional_commit.yml deleted file mode 100644 index 76819c4..0000000 --- a/dot_config/nvim/dot_github/workflows/conventional_commit.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Conventional Commits - -on: - pull_request: - branches: [ main ] - -jobs: - build: - name: Conventional Commits - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: webiny/action-conventional-commits@v1.0.3 diff --git a/dot_config/nvim/dot_github/workflows/docs.yml b/dot_config/nvim/dot_github/workflows/docs.yml deleted file mode 100644 index f40569e..0000000 --- a/dot_config/nvim/dot_github/workflows/docs.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Documentation - -on: - push: - branches: - - main - pull_request: - -jobs: - docs: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup Lua - uses: leafo/gh-actions-lua@v8 - with: - luaVersion: 5.4 - - name: Install LDoc - uses: leafo/gh-actions-luarocks@v4 - - name: Setup dependencies - run: luarocks install ldoc - - name: Build Docs - run: | - ldoc . - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.ref == 'refs/heads/main' }} - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs diff --git a/dot_config/nvim/dot_github/workflows/luacheck.yml b/dot_config/nvim/dot_github/workflows/luacheck.yml deleted file mode 100644 index cee961e..0000000 --- a/dot_config/nvim/dot_github/workflows/luacheck.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: Lua Linting - -on: [push, pull_request] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: nebularg/actions-luacheck@v1 diff --git a/dot_config/nvim/dot_github/workflows/style.yml b/dot_config/nvim/dot_github/workflows/style.yml deleted file mode 100644 index f0e770f..0000000 --- a/dot_config/nvim/dot_github/workflows/style.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Style Check - -on: [push, pull_request] - -jobs: - style: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: JohnnyMorganz/stylua-action@1.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v0.14.2 - # CLI arguments - args: --check . diff --git a/dot_config/nvim/dot_github/workflows/updater.yml b/dot_config/nvim/dot_github/workflows/updater.yml deleted file mode 100644 index aca2641..0000000 --- a/dot_config/nvim/dot_github/workflows/updater.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Updater Comment - -on: - pull_request_target: - paths: - - "**.lua" - - "packer_snapshot" - types: - - opened - -jobs: - updater-comment: - name: Comment updater settings - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v6 - with: - script: | - const src = context.payload.pull_request.head - const user = src.user.login - const tab = " " - let settings = tab + "updater = {\n" + tab + tab + `channel = "nightly",\n` - if (src.ref != "nightly") { - settings += tab + tab + `branch = "${src.ref}",\n` - } - if (user != "AstroNvim") { - settings += tab + tab + `remote = "${user}",\n` - settings += tab + tab + `remotes = {\n` - settings += tab + tab + tab + `["${user}"] = "${user}/${src.repo.name}",\n` - settings += tab + tab + `},\n` - } - settings += tab + "}," - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: "Use the following `updater` settings in your `user/init.lua` file, restart, and run `:AstroUpdate` to test this pull request:\n```\n" + settings + "\n```", - }) diff --git a/dot_config/nvim/dot_gitignore b/dot_config/nvim/dot_gitignore deleted file mode 100644 index 4678955..0000000 --- a/dot_config/nvim/dot_gitignore +++ /dev/null @@ -1,9 +0,0 @@ -!colors/default_theme.lua -colors/* -docs -ginit.vim -lua/packer_compiled.lua -lua/user -plugin -ftplugin -spell diff --git a/dot_config/nvim/dot_luacheckrc b/dot_config/nvim/dot_luacheckrc deleted file mode 100644 index 809581e..0000000 --- a/dot_config/nvim/dot_luacheckrc +++ /dev/null @@ -1,21 +0,0 @@ --- Global objects -globals = { - "PACKER_BOOTSTRAP", - "astronvim", - "astronvim_installation", - "vim", - "bit", - "C", - "packer_plugins", -} - --- Rerun tests only if their modification time changed -cache = true - --- Don't report unused self arguments of methods -self = false - -ignore = { - "631", -- max_line_length - "212/_.*", -- unused argument, for vars with "_" prefix -} diff --git a/dot_config/nvim/dot_stylua.toml b/dot_config/nvim/dot_stylua.toml deleted file mode 100644 index bfcffff..0000000 --- a/dot_config/nvim/dot_stylua.toml +++ /dev/null @@ -1,7 +0,0 @@ -column_width = 120 -line_endings = "Unix" -indent_type = "Spaces" -indent_width = 2 -quote_style = "AutoPreferDouble" -call_parentheses = "None" -collapse_simple_statement = "Always" diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua deleted file mode 100644 index 2bf8f14..0000000 --- a/dot_config/nvim/init.lua +++ /dev/null @@ -1,21 +0,0 @@ -local impatient_ok, impatient = pcall(require, "impatient") -if impatient_ok then impatient.enable_profile() end - -for _, source in ipairs { - "core.utils", - "core.options", - "core.bootstrap", - "core.diagnostics", - "core.autocmds", - "core.mappings", - "configs.which-key-register", -} do - local status_ok, fault = pcall(require, source) - if not status_ok then vim.api.nvim_err_writeln("Failed to load " .. source .. "\n\n" .. fault) end -end - -astronvim.conditional_func(astronvim.user_plugin_opts("polish", nil, false)) - -if vim.fn.has "nvim-0.8" ~= 1 or vim.version().prerelease then - vim.schedule(function() astronvim.notify("Unsupported Neovim Version! Please check the requirements", "error") end) -end diff --git a/dot_config/nvim/lua/configs/Comment.lua b/dot_config/nvim/lua/configs/Comment.lua deleted file mode 100644 index 6521d72..0000000 --- a/dot_config/nvim/lua/configs/Comment.lua +++ /dev/null @@ -1,16 +0,0 @@ -local utils = require "Comment.utils" -require("Comment").setup(astronvim.user_plugin_opts("plugins.Comment", { - pre_hook = function(ctx) - local location = nil - if ctx.ctype == utils.ctype.blockwise then - location = require("ts_context_commentstring.utils").get_cursor_location() - elseif ctx.cmotion == utils.cmotion.v or ctx.cmotion == utils.cmotion.V then - location = require("ts_context_commentstring.utils").get_visual_start_location() - end - - return require("ts_context_commentstring.internal").calculate_commentstring { - key = ctx.ctype == utils.ctype.linewise and "__default" or "__multiline", - location = location, - } - end, -})) diff --git a/dot_config/nvim/lua/configs/aerial.lua b/dot_config/nvim/lua/configs/aerial.lua deleted file mode 100644 index d4c7310..0000000 --- a/dot_config/nvim/lua/configs/aerial.lua +++ /dev/null @@ -1,25 +0,0 @@ -require("aerial").setup(astronvim.user_plugin_opts("plugins.aerial", { - attach_mode = "global", - backends = { "lsp", "treesitter", "markdown", "man" }, - layout = { - min_width = 28, - }, - show_guides = true, - filter_kind = false, - guides = { - mid_item = "├ ", - last_item = "└ ", - nested_top = "│ ", - whitespace = " ", - }, - keymaps = { - ["[y"] = "actions.prev", - ["]y"] = "actions.next", - ["[Y"] = "actions.prev_up", - ["]Y"] = "actions.next_up", - ["{"] = false, - ["}"] = false, - ["[["] = false, - ["]]"] = false, - }, -})) diff --git a/dot_config/nvim/lua/configs/alpha.lua b/dot_config/nvim/lua/configs/alpha.lua deleted file mode 100644 index 933dd6b..0000000 --- a/dot_config/nvim/lua/configs/alpha.lua +++ /dev/null @@ -1,36 +0,0 @@ -require("alpha").setup(astronvim.user_plugin_opts("plugins.alpha", { - layout = { - { type = "padding", val = vim.fn.max { 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) } }, - { - type = "text", - val = astronvim.user_plugin_opts("header", { - " █████ ███████ ████████ ██████ ██████", - "██ ██ ██ ██ ██ ██ ██ ██", - "███████ ███████ ██ ██████ ██ ██", - "██ ██ ██ ██ ██ ██ ██ ██", - "██ ██ ███████ ██ ██ ██ ██████", - " ", - " ███  ██ ██  ██ ██ ███  ███", - " ████  ██ ██  ██ ██ ████  ████", - " ██ ██  ██ ██  ██ ██ ██ ████ ██", - " ██  ██ ██  ██  ██  ██ ██  ██  ██", - " ██   ████   ████   ██ ██      ██", - }, false), - opts = { position = "center", hl = "DashboardHeader" }, - }, - { type = "padding", val = 5 }, - { - type = "group", - val = { - astronvim.alpha_button("LDR f f", " Find File "), - astronvim.alpha_button("LDR f o", " Recents "), - astronvim.alpha_button("LDR f w", " Find Word "), - astronvim.alpha_button("LDR f n", " New File "), - astronvim.alpha_button("LDR f m", " Bookmarks "), - astronvim.alpha_button("LDR S l", " Last Session "), - }, - opts = { spacing = 1 }, - }, - }, - opts = { noautocmd = true }, -})) diff --git a/dot_config/nvim/lua/configs/autopairs.lua b/dot_config/nvim/lua/configs/autopairs.lua deleted file mode 100644 index fb9e086..0000000 --- a/dot_config/nvim/lua/configs/autopairs.lua +++ /dev/null @@ -1,28 +0,0 @@ -local npairs = require "nvim-autopairs" -npairs.setup(astronvim.user_plugin_opts("plugins.nvim-autopairs", { - check_ts = true, - ts_config = { java = false }, - fast_wrap = { - map = "", - chars = { "{", "[", "(", '"', "'" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "PmenuSel", - highlight_grey = "LineNr", - }, -})) - -if not vim.g.autopairs_enabled then npairs.disable() end - -local rules = astronvim.user_plugin_opts("nvim-autopairs").add_rules -if vim.tbl_contains({ "function", "table" }, type(rules)) then - npairs.add_rules(type(rules) == "function" and rules(npairs) or rules) -end - -local cmp_status_ok, cmp = pcall(require, "cmp") -if cmp_status_ok then - cmp.event:on("confirm_done", require("nvim-autopairs.completion.cmp").on_confirm_done { tex = false }) -end diff --git a/dot_config/nvim/lua/configs/better_escape.lua b/dot_config/nvim/lua/configs/better_escape.lua deleted file mode 100644 index d6afb22..0000000 --- a/dot_config/nvim/lua/configs/better_escape.lua +++ /dev/null @@ -1 +0,0 @@ -require("better_escape").setup(astronvim.user_plugin_opts "plugins.better_escape") diff --git a/dot_config/nvim/lua/configs/bufferline.lua b/dot_config/nvim/lua/configs/bufferline.lua deleted file mode 100644 index 96626de..0000000 --- a/dot_config/nvim/lua/configs/bufferline.lua +++ /dev/null @@ -1,36 +0,0 @@ -local close_func = function(bufnum) - local bufdelete_avail, bufdelete = pcall(require, "bufdelete") - if bufdelete_avail then - bufdelete.bufdelete(bufnum, true) - else - vim.cmd.bdelete { args = { bufnum }, bang = true } - end -end -require("bufferline").setup(astronvim.user_plugin_opts("plugins.bufferline", { - options = { - offsets = { - { filetype = "NvimTree", text = "", padding = 1 }, - { filetype = "neo-tree", text = "", padding = 1 }, - { filetype = "Outline", text = "", padding = 1 }, - }, - buffer_close_icon = astronvim.get_icon "BufferClose", - modified_icon = astronvim.get_icon "FileModified", - close_icon = astronvim.get_icon "NeovimClose", - close_command = close_func, - right_mouse_command = close_func, - max_name_length = 14, - max_prefix_length = 13, - tab_size = 20, - separator_style = "thin", - }, -})) -local highlights = require "bufferline.highlights" -vim.api.nvim_create_autocmd("User", { - pattern = "AstroColorScheme", - group = "BufferlineCmds", - desc = "Bufferline apply colors after astronvim colorscheme change", - callback = function() - highlights.reset_icon_hl_cache() - highlights.set_all(require("bufferline.config").update_highlights()) - end, -}) diff --git a/dot_config/nvim/lua/configs/cinnamon.lua b/dot_config/nvim/lua/configs/cinnamon.lua deleted file mode 100644 index aae68f9..0000000 --- a/dot_config/nvim/lua/configs/cinnamon.lua +++ /dev/null @@ -1,3 +0,0 @@ -local status_ok, cinnamon = pcall(require, "cinnamon") -if not status_ok then return end -cinnamon.setup(astronvim.user_plugin_opts("plugins.cinnamon", {})) diff --git a/dot_config/nvim/lua/configs/cmp.lua b/dot_config/nvim/lua/configs/cmp.lua deleted file mode 100644 index 8255531..0000000 --- a/dot_config/nvim/lua/configs/cmp.lua +++ /dev/null @@ -1,92 +0,0 @@ -local cmp = require "cmp" -local snip_status_ok, luasnip = pcall(require, "luasnip") -local lspkind_status_ok, lspkind = pcall(require, "lspkind") -if not snip_status_ok then return end -local setup = cmp.setup -local border_opts = - { border = "single", winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None" } - -local function has_words_before() - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match "%s" == nil -end - -setup(astronvim.user_plugin_opts("plugins.cmp", { - enabled = function() - if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then return false end - return vim.g.cmp_enabled - end, - preselect = cmp.PreselectMode.None, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = lspkind_status_ok and lspkind.cmp_format(astronvim.lspkind) or nil, - }, - snippet = { - expand = function(args) luasnip.lsp_expand(args.body) end, - }, - duplicates = { - nvim_lsp = 1, - luasnip = 1, - cmp_tabnine = 1, - buffer = 1, - path = 1, - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - window = { - completion = cmp.config.window.bordered(border_opts), - documentation = cmp.config.window.bordered(border_opts), - }, - mapping = { - [""] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select }, - [""] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Select }, - [""] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert }, - [""] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert }, - [""] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert }, - [""] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert }, - [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.config.disable, - [""] = cmp.mapping { - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }, - [""] = cmp.mapping.confirm { select = false }, - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { - "i", - "s", - }), - }, -})) -for setup_opt, setup_table in pairs(astronvim.user_plugin_opts("cmp.setup", {})) do - for pattern, options in pairs(setup_table) do - setup[setup_opt](pattern, options) - end -end diff --git a/dot_config/nvim/lua/configs/colorizer.lua b/dot_config/nvim/lua/configs/colorizer.lua deleted file mode 100644 index 004e89e..0000000 --- a/dot_config/nvim/lua/configs/colorizer.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("colorizer").setup( - astronvim.user_plugin_opts("plugins.colorizer", { user_default_options = { names = false } }) -) diff --git a/dot_config/nvim/lua/configs/dressing.lua b/dot_config/nvim/lua/configs/dressing.lua deleted file mode 100644 index 837f51b..0000000 --- a/dot_config/nvim/lua/configs/dressing.lua +++ /dev/null @@ -1,10 +0,0 @@ -require("dressing").setup(astronvim.user_plugin_opts("plugins.dressing", { - input = { - default_prompt = "➤ ", - win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" }, - }, - select = { - backend = { "telescope", "builtin" }, - builtin = { win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" } }, - }, -})) diff --git a/dot_config/nvim/lua/configs/feline.lua b/dot_config/nvim/lua/configs/feline.lua deleted file mode 100644 index 2ab43bb..0000000 --- a/dot_config/nvim/lua/configs/feline.lua +++ /dev/null @@ -1,45 +0,0 @@ -local status_ok, feline = pcall(require, "feline") -if not status_ok then return end -local C = require "default_theme.colors" -local hl = require("core.status").hl -local provider = require("core.status").provider -local conditional = require("core.status").conditional --- stylua: ignore -feline.setup(astronvim.user_plugin_opts("plugins.feline", { - disable = { filetypes = { "^NvimTree$", "^neo%-tree$", "^dashboard$", "^Outline$", "^aerial$" } }, - theme = hl.group("StatusLine", { fg = C.fg, bg = C.bg_1 }), - components = { - active = { - { - { provider = provider.spacer(), hl = hl.mode() }, - { provider = provider.spacer(2) }, - { provider = "git_branch", hl = hl.fg("Conditional", { fg = C.purple_1, style = "bold" }), icon = " " }, - { provider = provider.spacer(3), enabled = conditional.git_available }, - { provider = { name = "file_type", opts = { filetype_icon = true, case = "lowercase" } }, enabled = conditional.has_filetype }, - { provider = provider.spacer(2), enabled = conditional.has_filetype }, - { provider = "git_diff_added", hl = hl.fg("GitSignsAdd", { fg = C.green }), icon = "  " }, - { provider = "git_diff_changed", hl = hl.fg("GitSignsChange", { fg = C.orange_1 }), icon = " 柳" }, - { provider = "git_diff_removed", hl = hl.fg("GitSignsDelete", { fg = C.red_1 }), icon = "  " }, - { provider = provider.spacer(2), enabled = conditional.git_changed }, - { provider = "diagnostic_errors", hl = hl.fg("DiagnosticError", { fg = C.red_1 }), icon = "  " }, - { provider = "diagnostic_warnings", hl = hl.fg("DiagnosticWarn", { fg = C.orange_1 }), icon = "  " }, - { provider = "diagnostic_info", hl = hl.fg("DiagnosticInfo", { fg = C.white_2 }), icon = "  " }, - { provider = "diagnostic_hints", hl = hl.fg("DiagnosticHint", { fg = C.yellow_1 }), icon = "  " }, - }, - { - { provider = provider.lsp_progress, enabled = conditional.bar_width() }, - { provider = provider.lsp_client_names(true), short_provider = provider.lsp_client_names(), enabled = conditional.bar_width(), icon = "  " }, - { provider = provider.spacer(2), enabled = conditional.bar_width() }, - { provider = provider.treesitter_status, enabled = conditional.bar_width(), hl = hl.fg("GitSignsAdd", { fg = C.green }) }, - { provider = provider.spacer(2) }, - { provider = "position" }, - { provider = provider.spacer(2) }, - { provider = "line_percentage" }, - { provider = provider.spacer() }, - { provider = "scroll_bar", hl = hl.fg("TypeDef", { fg = C.yellow }) }, - { provider = provider.spacer(2) }, - { provider = provider.spacer(), hl = hl.mode() }, - }, - }, - }, -})) diff --git a/dot_config/nvim/lua/configs/gitsigns.lua b/dot_config/nvim/lua/configs/gitsigns.lua deleted file mode 100644 index 92ca456..0000000 --- a/dot_config/nvim/lua/configs/gitsigns.lua +++ /dev/null @@ -1,10 +0,0 @@ -require("gitsigns").setup(astronvim.user_plugin_opts("plugins.gitsigns", { - signs = { - add = { text = "▎" }, - change = { text = "▎" }, - delete = { text = "▎" }, - topdelete = { text = "契" }, - changedelete = { text = "▎" }, - untracked = { text = "▎" }, - }, -})) diff --git a/dot_config/nvim/lua/configs/heirline.lua b/dot_config/nvim/lua/configs/heirline.lua deleted file mode 100644 index 5e40f8d..0000000 --- a/dot_config/nvim/lua/configs/heirline.lua +++ /dev/null @@ -1,134 +0,0 @@ -local heirline = require "heirline" -if not astronvim.status then return end -local C = require "default_theme.colors" - -local function setup_colors() - local StatusLine = astronvim.get_hlgroup("StatusLine", { fg = C.fg, bg = C.grey_4 }) - local WinBar = astronvim.get_hlgroup("WinBar", { fg = C.grey_2, bg = C.bg }) - local WinBarNC = astronvim.get_hlgroup("WinBarNC", { fg = C.grey, bg = C.bg }) - local Conditional = astronvim.get_hlgroup("Conditional", { fg = C.purple_1, bg = C.grey_4 }) - local String = astronvim.get_hlgroup("String", { fg = C.green, bg = C.grey_4 }) - local TypeDef = astronvim.get_hlgroup("TypeDef", { fg = C.yellow, bg = C.grey_4 }) - local GitSignsAdd = astronvim.get_hlgroup("GitSignsAdd", { fg = C.green, bg = C.grey_4 }) - local GitSignsChange = astronvim.get_hlgroup("GitSignsChange", { fg = C.orange_1, bg = C.grey_4 }) - local GitSignsDelete = astronvim.get_hlgroup("GitSignsDelete", { fg = C.red_1, bg = C.grey_4 }) - local DiagnosticError = astronvim.get_hlgroup("DiagnosticError", { fg = C.red_1, bg = C.grey_4 }) - local DiagnosticWarn = astronvim.get_hlgroup("DiagnosticWarn", { fg = C.orange_1, bg = C.grey_4 }) - local DiagnosticInfo = astronvim.get_hlgroup("DiagnosticInfo", { fg = C.white_2, bg = C.grey_4 }) - local DiagnosticHint = astronvim.get_hlgroup("DiagnosticHint", { fg = C.yellow_1, bg = C.grey_4 }) - local HeirlineInactive = astronvim.get_hlgroup("HeirlineInactive", { fg = nil }).fg - or astronvim.status.hl.lualine_mode("inactive", C.grey_7) - local HeirlineNormal = astronvim.get_hlgroup("HeirlineNormal", { fg = nil }).fg - or astronvim.status.hl.lualine_mode("normal", C.blue) - local HeirlineInsert = astronvim.get_hlgroup("HeirlineInsert", { fg = nil }).fg - or astronvim.status.hl.lualine_mode("insert", C.green) - local HeirlineVisual = astronvim.get_hlgroup("HeirlineVisual", { fg = nil }).fg - or astronvim.status.hl.lualine_mode("visual", C.purple) - local HeirlineReplace = astronvim.get_hlgroup("HeirlineReplace", { fg = nil }).fg - or astronvim.status.hl.lualine_mode("replace", C.red_1) - local HeirlineCommand = astronvim.get_hlgroup("HeirlineCommand", { fg = nil }).fg - or astronvim.status.hl.lualine_mode("command", C.yellow_1) - local HeirlineTerminal = astronvim.get_hlgroup("HeirlineTerminal", { fg = nil }).fg - or astronvim.status.hl.lualine_mode("inactive", HeirlineInsert) - - local colors = astronvim.user_plugin_opts("heirline.colors", { - fg = StatusLine.fg, - bg = StatusLine.bg, - section_fg = StatusLine.fg, - section_bg = StatusLine.bg, - git_branch_fg = Conditional.fg, - treesitter_fg = String.fg, - scrollbar = TypeDef.fg, - git_added = GitSignsAdd.fg, - git_changed = GitSignsChange.fg, - git_removed = GitSignsDelete.fg, - diag_ERROR = DiagnosticError.fg, - diag_WARN = DiagnosticWarn.fg, - diag_INFO = DiagnosticInfo.fg, - diag_HINT = DiagnosticHint.fg, - winbar_fg = WinBar.fg, - winbar_bg = WinBar.bg, - winbarnc_fg = WinBarNC.fg, - winbarnc_bg = WinBarNC.bg, - inactive = HeirlineInactive, - normal = HeirlineNormal, - insert = HeirlineInsert, - visual = HeirlineVisual, - replace = HeirlineReplace, - command = HeirlineCommand, - terminal = HeirlineTerminal, - }) - - for _, section in ipairs { - "git_branch", - "file_info", - "git_diff", - "diagnostics", - "lsp", - "macro_recording", - "cmd_info", - "treesitter", - "nav", - } do - if not colors[section .. "_bg"] then colors[section .. "_bg"] = colors["section_bg"] end - if not colors[section .. "_fg"] then colors[section .. "_fg"] = colors["section_fg"] end - end - return colors -end - -heirline.load_colors(setup_colors()) -local heirline_opts = astronvim.user_plugin_opts("plugins.heirline", { - { - hl = { fg = "fg", bg = "bg" }, - astronvim.status.component.mode(), - astronvim.status.component.git_branch(), - astronvim.status.component.file_info( - astronvim.is_available "bufferline.nvim" and { filetype = {}, filename = false, file_modified = false } or nil - ), - astronvim.status.component.git_diff(), - astronvim.status.component.diagnostics(), - astronvim.status.component.fill(), - astronvim.status.component.cmd_info(), - astronvim.status.component.fill(), - astronvim.status.component.lsp(), - astronvim.status.component.treesitter(), - astronvim.status.component.nav(), - astronvim.status.component.mode { surround = { separator = "right" } }, - }, - { - fallthrough = false, - astronvim.status.component.file_info { - condition = function() return not astronvim.status.condition.is_active() end, - unique_path = {}, - file_icon = { hl = false }, - hl = { fg = "winbarnc_fg", bg = "winbarnc_bg" }, - surround = false, - update = "BufEnter", - }, - astronvim.status.component.breadcrumbs { hl = { fg = "winbar_fg", bg = "winbar_bg" } }, - }, -}) -heirline.setup(heirline_opts[1], heirline_opts[2], heirline_opts[3]) - -local augroup = vim.api.nvim_create_augroup("Heirline", { clear = true }) -vim.api.nvim_create_autocmd("User", { - pattern = "AstroColorScheme", - group = augroup, - desc = "Refresh heirline colors", - callback = function() require("heirline.utils").on_colorscheme(setup_colors()) end, -}) -vim.api.nvim_create_autocmd("User", { - pattern = "HeirlineInitWinbar", - group = augroup, - desc = "Disable winbar for some filetypes", - callback = function() - if - astronvim.status.condition.buffer_matches { - buftype = { "terminal", "prompt", "nofile", "help", "quickfix" }, - filetype = { "NvimTree", "neo-tree", "dashboard", "Outline", "aerial" }, - } - then - vim.opt_local.winbar = nil - end - end, -}) diff --git a/dot_config/nvim/lua/configs/icons.lua b/dot_config/nvim/lua/configs/icons.lua deleted file mode 100644 index a519d71..0000000 --- a/dot_config/nvim/lua/configs/icons.lua +++ /dev/null @@ -1,16 +0,0 @@ -local status_ok, icons = pcall(require, "nvim-web-devicons") -if not status_ok then return end -icons.set_icon(astronvim.user_plugin_opts("plugins.nvim-web-devicons", { - deb = { icon = "", name = "Deb" }, - lock = { icon = "", name = "Lock" }, - mp3 = { icon = "", name = "Mp3" }, - mp4 = { icon = "", name = "Mp4" }, - out = { icon = "", name = "Out" }, - ["robots.txt"] = { icon = "ﮧ", name = "Robots" }, - ttf = { icon = "", name = "TrueTypeFont" }, - rpm = { icon = "", name = "Rpm" }, - woff = { icon = "", name = "WebOpenFontFormat" }, - woff2 = { icon = "", name = "WebOpenFontFormat2" }, - xz = { icon = "", name = "Xz" }, - zip = { icon = "", name = "Zip" }, -})) diff --git a/dot_config/nvim/lua/configs/indent-line.lua b/dot_config/nvim/lua/configs/indent-line.lua deleted file mode 100644 index 0adb603..0000000 --- a/dot_config/nvim/lua/configs/indent-line.lua +++ /dev/null @@ -1,45 +0,0 @@ -require("indent_blankline").setup(astronvim.user_plugin_opts("plugins.indent_blankline", { - buftype_exclude = { - "nofile", - "terminal", - }, - filetype_exclude = { - "help", - "startify", - "aerial", - "alpha", - "dashboard", - "packer", - "neogitstatus", - "NvimTree", - "neo-tree", - "Trouble", - }, - context_patterns = { - "class", - "return", - "function", - "method", - "^if", - "^while", - "jsx_element", - "^for", - "^object", - "^table", - "block", - "arguments", - "if_statement", - "else_clause", - "jsx_element", - "jsx_self_closing_element", - "try_statement", - "catch_clause", - "import_statement", - "operation_type", - }, - show_trailing_blankline_indent = false, - use_treesitter = true, - char = "▏", - context_char = "▏", - show_current_context = true, -})) diff --git a/dot_config/nvim/lua/configs/indent-o-matic.lua b/dot_config/nvim/lua/configs/indent-o-matic.lua deleted file mode 100644 index 490ca08..0000000 --- a/dot_config/nvim/lua/configs/indent-o-matic.lua +++ /dev/null @@ -1,3 +0,0 @@ -local indent_o_matic = require "indent-o-matic" -indent_o_matic.setup(astronvim.user_plugin_opts "plugins.indent-o-matic") -indent_o_matic.detect() diff --git a/dot_config/nvim/lua/configs/lsp/handlers.lua b/dot_config/nvim/lua/configs/lsp/handlers.lua deleted file mode 100644 index f1f0ed5..0000000 --- a/dot_config/nvim/lua/configs/lsp/handlers.lua +++ /dev/null @@ -1,90 +0,0 @@ -astronvim.lsp = {} -local user_plugin_opts = astronvim.user_plugin_opts -local conditional_func = astronvim.conditional_func - -astronvim.lsp.on_attach = function(client, bufnr) - astronvim.set_mappings( - user_plugin_opts("lsp.mappings", { - n = { - ["K"] = { function() vim.lsp.buf.hover() end, desc = "Hover symbol details" }, - ["la"] = { function() vim.lsp.buf.code_action() end, desc = "LSP code action" }, - ["lf"] = { function() vim.lsp.buf.formatting_sync() end, desc = "Format code" }, - ["lh"] = { function() vim.lsp.buf.signature_help() end, desc = "Signature help" }, - ["lr"] = { function() vim.lsp.buf.rename() end, desc = "Rename current symbol" }, - ["gD"] = { function() vim.lsp.buf.declaration() end, desc = "Declaration of current symbol" }, - ["gI"] = { function() vim.lsp.buf.implementation() end, desc = "Implementation of current symbol" }, - ["gd"] = { function() vim.lsp.buf.definition() end, desc = "Show the definition of current symbol" }, - ["gr"] = { function() vim.lsp.buf.references() end, desc = "References of current symbol" }, - ["ld"] = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" }, - ["[d"] = { function() vim.diagnostic.goto_prev() end, desc = "Previous diagnostic" }, - ["]d"] = { function() vim.diagnostic.goto_next() end, desc = "Next diagnostic" }, - ["gl"] = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" }, - }, - }), - { buffer = bufnr } - ) - - vim.api.nvim_buf_create_user_command( - bufnr, - "Format", - function() vim.lsp.buf.formatting() end, - { desc = "Format file with LSP" } - ) - - if client.resolved_capabilities.document_highlight then - vim.api.nvim_create_augroup("lsp_document_highlight", { clear = true }) - vim.api.nvim_create_autocmd("CursorHold", { - group = "lsp_document_highlight", - pattern = "", - callback = vim.lsp.buf.document_highlight, - }) - vim.api.nvim_create_autocmd("CursorMoved", { - group = "lsp_document_highlight", - pattern = "", - callback = vim.lsp.buf.clear_references, - }) - end - - local on_attach_override = user_plugin_opts("lsp.on_attach", nil, false) - local aerial_avail, aerial = pcall(require, "aerial") - conditional_func(on_attach_override, true, client, bufnr) - conditional_func(aerial.on_attach, aerial_avail, client, bufnr) -end - -astronvim.lsp.capabilities = vim.lsp.protocol.make_client_capabilities() -astronvim.lsp.capabilities.textDocument.completion.completionItem.documentationFormat = { "markdown", "plaintext" } -astronvim.lsp.capabilities.textDocument.completion.completionItem.snippetSupport = true -astronvim.lsp.capabilities.textDocument.completion.completionItem.preselectSupport = true -astronvim.lsp.capabilities.textDocument.completion.completionItem.insertReplaceSupport = true -astronvim.lsp.capabilities.textDocument.completion.completionItem.labelDetailsSupport = true -astronvim.lsp.capabilities.textDocument.completion.completionItem.deprecatedSupport = true -astronvim.lsp.capabilities.textDocument.completion.completionItem.commitCharactersSupport = true -astronvim.lsp.capabilities.textDocument.completion.completionItem.tagSupport = { valueSet = { 1 } } -astronvim.lsp.capabilities.textDocument.completion.completionItem.resolveSupport = { - properties = { "documentation", "detail", "additionalTextEdits" }, -} -astronvim.lsp.capabilities = user_plugin_opts("lsp.capabilities", astronvim.lsp.capabilities) -astronvim.lsp.flags = user_plugin_opts "lsp.flags" - -function astronvim.lsp.server_settings(server_name) - local server = require("lspconfig")[server_name] - local opts = user_plugin_opts( - "lsp.server-settings." .. server_name, - user_plugin_opts("lsp.server-settings." .. server_name, { - capabilities = vim.tbl_deep_extend("force", astronvim.lsp.capabilities, server.capabilities or {}), - flags = vim.tbl_deep_extend("force", astronvim.lsp.flags, server.flags or {}), - }, true, "configs") - ) - local old_on_attach = server.on_attach - local user_on_attach = opts.on_attach - opts.on_attach = function(client, bufnr) - conditional_func(old_on_attach, true, client, bufnr) - astronvim.lsp.on_attach(client, bufnr) - conditional_func(user_on_attach, true, client, bufnr) - end - return opts -end - -function astronvim.lsp.disable_formatting(client) client.resolved_capabilities.document_formatting = false end - -return astronvim.lsp diff --git a/dot_config/nvim/lua/configs/lsp/init.lua b/dot_config/nvim/lua/configs/lsp/init.lua deleted file mode 100644 index 9793e9a..0000000 --- a/dot_config/nvim/lua/configs/lsp/init.lua +++ /dev/null @@ -1,54 +0,0 @@ -local status_ok, lspconfig = pcall(require, "lspconfig") -if not status_ok then return end -require "configs.lsp.handlers" -local insert = table.insert -local tbl_contains = vim.tbl_contains -local sign_define = vim.fn.sign_define -local user_plugin_opts = astronvim.user_plugin_opts -local user_registration = user_plugin_opts("lsp.server_registration", nil, false) - -local signs = { - { name = "DiagnosticSignError", text = "" }, - { name = "DiagnosticSignWarn", text = "" }, - { name = "DiagnosticSignHint", text = "" }, - { name = "DiagnosticSignInfo", text = "" }, -} -for _, sign in ipairs(signs) do - sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) -end -vim.diagnostic.config(user_plugin_opts("diagnostics", { - virtual_text = true, - signs = { active = signs }, - update_in_insert = true, - underline = true, - severity_sort = true, - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, -})) -vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }) -vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" }) - -local servers = user_plugin_opts "lsp.servers" -local skip_setup = user_plugin_opts "lsp.skip_setup" -local installer_avail, lsp_installer = pcall(require, "nvim-lsp-installer") -if installer_avail then - for _, server in ipairs(lsp_installer.get_installed_servers()) do - insert(servers, server.name) - end -end -for _, server in ipairs(servers) do - if not tbl_contains(skip_setup, server) then - local opts = astronvim.lsp.server_settings(server) - if type(user_registration) == "function" then - user_registration(server, opts) - else - lspconfig[server].setup(opts) - end - end -end diff --git a/dot_config/nvim/lua/configs/lsp/server-settings/html.lua b/dot_config/nvim/lua/configs/lsp/server-settings/html.lua deleted file mode 100644 index 1c6b4d5..0000000 --- a/dot_config/nvim/lua/configs/lsp/server-settings/html.lua +++ /dev/null @@ -1 +0,0 @@ -return { on_attach = astronvim.lsp.disable_formatting } diff --git a/dot_config/nvim/lua/configs/lsp/server-settings/jsonls.lua b/dot_config/nvim/lua/configs/lsp/server-settings/jsonls.lua deleted file mode 100644 index 89b7201..0000000 --- a/dot_config/nvim/lua/configs/lsp/server-settings/jsonls.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - on_attach = astronvim.lsp.disable_formatting, - settings = { - json = { - schemas = require("schemastore").json.schemas(), - }, - }, - setup = { - commands = { - Format = { - function() vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 }) end, - }, - }, - }, -} diff --git a/dot_config/nvim/lua/configs/lsp/server-settings/pyright.lua b/dot_config/nvim/lua/configs/lsp/server-settings/pyright.lua deleted file mode 100644 index c2a518d..0000000 --- a/dot_config/nvim/lua/configs/lsp/server-settings/pyright.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - settings = { - python = { - analysis = { - typeCheckingMode = "off", - }, - }, - }, -} diff --git a/dot_config/nvim/lua/configs/lsp/server-settings/rust_analyzer.lua b/dot_config/nvim/lua/configs/lsp/server-settings/rust_analyzer.lua deleted file mode 100644 index f9b89a9..0000000 --- a/dot_config/nvim/lua/configs/lsp/server-settings/rust_analyzer.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - settings = { - ["rust-analyzer"] = { - cargo = { - loadOutDirsFromCheck = true, - }, - checkOnSave = { - command = "clippy", - }, - experimental = { - procAttrMacros = true, - }, - }, - }, -} diff --git a/dot_config/nvim/lua/configs/lsp/server-settings/sumneko_lua.lua b/dot_config/nvim/lua/configs/lsp/server-settings/sumneko_lua.lua deleted file mode 100644 index 3bf46a2..0000000 --- a/dot_config/nvim/lua/configs/lsp/server-settings/sumneko_lua.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - on_attach = astronvim.lsp.disable_formatting, - settings = { - Lua = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - [vim.fn.expand "$VIMRUNTIME/lua"] = true, - [astronvim.install.home .. "/lua"] = true, - [astronvim.install.config .. "/lua"] = true, - }, - }, - }, - }, -} diff --git a/dot_config/nvim/lua/configs/lsp/server-settings/tsserver.lua b/dot_config/nvim/lua/configs/lsp/server-settings/tsserver.lua deleted file mode 100644 index 1c6b4d5..0000000 --- a/dot_config/nvim/lua/configs/lsp/server-settings/tsserver.lua +++ /dev/null @@ -1 +0,0 @@ -return { on_attach = astronvim.lsp.disable_formatting } diff --git a/dot_config/nvim/lua/configs/lspconfig.lua b/dot_config/nvim/lua/configs/lspconfig.lua deleted file mode 100644 index c1095c1..0000000 --- a/dot_config/nvim/lua/configs/lspconfig.lua +++ /dev/null @@ -1,11 +0,0 @@ -vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }) -vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" }) -local setup_servers = function() - vim.tbl_map(astronvim.lsp.setup, astronvim.user_plugin_opts "lsp.servers") - vim.cmd "silent! do FileType" -end -if astronvim.is_available "mason-lspconfig.nvim" then - vim.api.nvim_create_autocmd("User", { pattern = "AstroLspSetup", once = true, callback = setup_servers }) -else - setup_servers() -end diff --git a/dot_config/nvim/lua/configs/lspkind.lua b/dot_config/nvim/lua/configs/lspkind.lua deleted file mode 100644 index 6f13763..0000000 --- a/dot_config/nvim/lua/configs/lspkind.lua +++ /dev/null @@ -1,23 +0,0 @@ -astronvim.lspkind = astronvim.user_plugin_opts("plugins.lspkind", { - mode = "symbol", - symbol_map = { - NONE = "", - Array = "", - Boolean = "⊨", - Class = "", - Constructor = "", - Key = "", - Namespace = "", - Null = "NULL", - Number = "#", - Object = "⦿", - Package = "", - Property = "", - Reference = "", - Snippet = "", - String = "𝓐", - TypeParameter = "", - Unit = "", - }, -}) -require("lspkind").init(astronvim.lspkind) diff --git a/dot_config/nvim/lua/configs/luasnip.lua b/dot_config/nvim/lua/configs/luasnip.lua deleted file mode 100644 index 5ee7d14..0000000 --- a/dot_config/nvim/lua/configs/luasnip.lua +++ /dev/null @@ -1,17 +0,0 @@ -local user_settings = astronvim.user_plugin_opts "luasnip" -local luasnip = require "luasnip" -if user_settings.config then luasnip.config.setup(user_settings.config) end -for _, load_type in ipairs { "vscode", "snipmate", "lua" } do - local loader = require("luasnip.loaders.from_" .. load_type) - loader.lazy_load() - -- TODO: DEPRECATE _snippet_paths option in next major version release - local paths = user_settings[load_type .. "_snippet_paths"] - if paths then loader.lazy_load { paths = paths } end - local loader_settings = user_settings[load_type] - if loader_settings then loader.lazy_load(loader_settings) end -end -if type(user_settings.filetype_extend) == "table" then - for filetype, snippets in pairs(user_settings.filetype_extend) do - luasnip.filetype_extend(filetype, snippets) - end -end diff --git a/dot_config/nvim/lua/configs/mason-lspconfig.lua b/dot_config/nvim/lua/configs/mason-lspconfig.lua deleted file mode 100644 index 8fb1efd..0000000 --- a/dot_config/nvim/lua/configs/mason-lspconfig.lua +++ /dev/null @@ -1,6 +0,0 @@ -local mason_lspconfig = require "mason-lspconfig" -mason_lspconfig.setup(astronvim.user_plugin_opts "plugins.mason-lspconfig") -mason_lspconfig.setup_handlers( - astronvim.user_plugin_opts("mason-lspconfig.setup_handlers", { function(server) astronvim.lsp.setup(server) end }) -) -astronvim.event "LspSetup" diff --git a/dot_config/nvim/lua/configs/mason-null-ls.lua b/dot_config/nvim/lua/configs/mason-null-ls.lua deleted file mode 100644 index fe398de..0000000 --- a/dot_config/nvim/lua/configs/mason-null-ls.lua +++ /dev/null @@ -1,3 +0,0 @@ -local mason_null_ls = require "mason-null-ls" -mason_null_ls.setup(astronvim.user_plugin_opts("plugins.mason-null-ls", { automatic_setup = true })) -mason_null_ls.setup_handlers(astronvim.user_plugin_opts("mason-null-ls.setup_handlers", {})) diff --git a/dot_config/nvim/lua/configs/mason.lua b/dot_config/nvim/lua/configs/mason.lua deleted file mode 100644 index 2bd51e8..0000000 --- a/dot_config/nvim/lua/configs/mason.lua +++ /dev/null @@ -1,9 +0,0 @@ -require("mason").setup(astronvim.user_plugin_opts("plugins.mason", { - ui = { - icons = { - package_installed = "✓", - package_uninstalled = "✗", - package_pending = "⟳", - }, - }, -})) diff --git a/dot_config/nvim/lua/configs/neo-tree.lua b/dot_config/nvim/lua/configs/neo-tree.lua deleted file mode 100644 index 21b5da5..0000000 --- a/dot_config/nvim/lua/configs/neo-tree.lua +++ /dev/null @@ -1,55 +0,0 @@ -require("neo-tree").setup(astronvim.user_plugin_opts("plugins.neo-tree", { - close_if_last_window = true, - enable_diagnostics = false, - source_selector = { - winbar = true, - content_layout = "center", - tab_labels = { - filesystem = astronvim.get_icon "FolderClosed" .. " File", - buffers = astronvim.get_icon "DefaultFile" .. " Bufs", - git_status = astronvim.get_icon "Git" .. " Git", - diagnostics = astronvim.get_icon "Diagnostic" .. " Diagnostic", - }, - }, - default_component_configs = { - indent = { padding = 0 }, - icon = { - folder_closed = astronvim.get_icon "FolderClosed", - folder_open = astronvim.get_icon "FolderOpen", - folder_empty = astronvim.get_icon "FolderEmpty", - default = astronvim.get_icon "DefaultFile", - }, - git_status = { - symbols = { - added = astronvim.get_icon "GitAdd", - deleted = astronvim.get_icon "GitDelete", - modified = astronvim.get_icon "GitChange", - renamed = astronvim.get_icon "GitRenamed", - untracked = astronvim.get_icon "GitUntracked", - ignored = astronvim.get_icon "GitIgnored", - unstaged = astronvim.get_icon "GitUnstaged", - staged = astronvim.get_icon "GitStaged", - conflict = astronvim.get_icon "GitConflict", - }, - }, - }, - window = { - width = 30, - mappings = { - [""] = false, -- disable space until we figure out which-key disabling - o = "open", - O = function(state) astronvim.system_open(state.tree:get_node():get_id()) end, - H = "prev_source", - L = "next_source", - }, - }, - filesystem = { - follow_current_file = true, - hijack_netrw_behavior = "open_current", - use_libuv_file_watcher = true, - window = { mappings = { h = "toggle_hidden" } }, - }, - event_handlers = { - { event = "neo_tree_buffer_enter", handler = function(_) vim.opt_local.signcolumn = "auto" end }, - }, -})) diff --git a/dot_config/nvim/lua/configs/notify.lua b/dot_config/nvim/lua/configs/notify.lua deleted file mode 100644 index a4388fb..0000000 --- a/dot_config/nvim/lua/configs/notify.lua +++ /dev/null @@ -1,3 +0,0 @@ -local notify = require "notify" -notify.setup(astronvim.user_plugin_opts("plugins.notify", { stages = "fade" })) -vim.notify = notify diff --git a/dot_config/nvim/lua/configs/null-ls.lua b/dot_config/nvim/lua/configs/null-ls.lua deleted file mode 100644 index e1eca3b..0000000 --- a/dot_config/nvim/lua/configs/null-ls.lua +++ /dev/null @@ -1 +0,0 @@ -require("null-ls").setup(astronvim.user_plugin_opts("plugins.null-ls", { on_attach = astronvim.lsp.on_attach })) diff --git a/dot_config/nvim/lua/configs/nvim-lsp-installer.lua b/dot_config/nvim/lua/configs/nvim-lsp-installer.lua deleted file mode 100644 index ec3eaba..0000000 --- a/dot_config/nvim/lua/configs/nvim-lsp-installer.lua +++ /dev/null @@ -1,11 +0,0 @@ -local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer") -if not status_ok then return end -lsp_installer.setup(astronvim.user_plugin_opts("plugins.nvim-lsp-installer", { - ui = { - icons = { - server_installed = "✓", - server_uninstalled = "✗", - server_pending = "⟳", - }, - }, -})) diff --git a/dot_config/nvim/lua/configs/nvim-web-devicons.lua b/dot_config/nvim/lua/configs/nvim-web-devicons.lua deleted file mode 100644 index 54f4615..0000000 --- a/dot_config/nvim/lua/configs/nvim-web-devicons.lua +++ /dev/null @@ -1,15 +0,0 @@ -require("nvim-web-devicons").set_default_icon(astronvim.get_icon "DefaultFile", "#6d8086", "66") -require("nvim-web-devicons").set_icon(astronvim.user_plugin_opts("plugins.nvim-web-devicons", { - deb = { icon = "", name = "Deb" }, - lock = { icon = "", name = "Lock" }, - mp3 = { icon = "", name = "Mp3" }, - mp4 = { icon = "", name = "Mp4" }, - out = { icon = "", name = "Out" }, - ["robots.txt"] = { icon = "ﮧ", name = "Robots" }, - ttf = { icon = "", name = "TrueTypeFont" }, - rpm = { icon = "", name = "Rpm" }, - woff = { icon = "", name = "WebOpenFontFormat" }, - woff2 = { icon = "", name = "WebOpenFontFormat2" }, - xz = { icon = "", name = "Xz" }, - zip = { icon = "", name = "Zip" }, -})) diff --git a/dot_config/nvim/lua/configs/server-settings/jsonls.lua b/dot_config/nvim/lua/configs/server-settings/jsonls.lua deleted file mode 100644 index 98da93b..0000000 --- a/dot_config/nvim/lua/configs/server-settings/jsonls.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - settings = { - json = { - schemas = require("schemastore").json.schemas(), - validate = { enable = true }, - }, - }, -} diff --git a/dot_config/nvim/lua/configs/server-settings/sumneko_lua.lua b/dot_config/nvim/lua/configs/server-settings/sumneko_lua.lua deleted file mode 100644 index 378f7c3..0000000 --- a/dot_config/nvim/lua/configs/server-settings/sumneko_lua.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - settings = { - Lua = { - telemetry = { enable = false }, - runtime = { version = "LuaJIT" }, - diagnostics = { globals = { "vim", "astronvim", "astronvim_installation", "packer_plugins", "bit" } }, - workspace = { - library = { - vim.fn.expand "$VIMRUNTIME/lua", - astronvim.install.home .. "/lua", - astronvim.install.config .. "/lua", - }, - }, - }, - }, -} diff --git a/dot_config/nvim/lua/configs/session_manager.lua b/dot_config/nvim/lua/configs/session_manager.lua deleted file mode 100644 index 409a1dd..0000000 --- a/dot_config/nvim/lua/configs/session_manager.lua +++ /dev/null @@ -1 +0,0 @@ -require("session_manager").setup(astronvim.user_plugin_opts "plugins.session_manager") diff --git a/dot_config/nvim/lua/configs/smart-splits.lua b/dot_config/nvim/lua/configs/smart-splits.lua deleted file mode 100644 index f43f7ac..0000000 --- a/dot_config/nvim/lua/configs/smart-splits.lua +++ /dev/null @@ -1,9 +0,0 @@ -require("smart-splits").setup(astronvim.user_plugin_opts("plugins.smart-splits", { - ignored_filetypes = { - "nofile", - "quickfix", - "qf", - "prompt", - }, - ignored_buftypes = { "nofile" }, -})) diff --git a/dot_config/nvim/lua/configs/telescope.lua b/dot_config/nvim/lua/configs/telescope.lua deleted file mode 100644 index 6dd3432..0000000 --- a/dot_config/nvim/lua/configs/telescope.lua +++ /dev/null @@ -1,38 +0,0 @@ -local telescope = require "telescope" -local actions = require "telescope.actions" - -telescope.setup(astronvim.user_plugin_opts("plugins.telescope", { - defaults = { - - prompt_prefix = string.format("%s ", astronvim.get_icon "Search"), - selection_caret = string.format("%s ", astronvim.get_icon "Selected"), - path_display = { "truncate" }, - sorting_strategy = "ascending", - layout_config = { - horizontal = { - prompt_position = "top", - preview_width = 0.55, - results_width = 0.8, - }, - vertical = { - mirror = false, - }, - width = 0.87, - height = 0.80, - preview_cutoff = 120, - }, - - mappings = { - i = { - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - }, - n = { ["q"] = actions.close }, - }, - }, -})) - -astronvim.conditional_func(telescope.load_extension, pcall(require, "notify"), "notify") -astronvim.conditional_func(telescope.load_extension, pcall(require, "aerial"), "aerial") diff --git a/dot_config/nvim/lua/configs/toggleterm.lua b/dot_config/nvim/lua/configs/toggleterm.lua deleted file mode 100644 index 8fb1444..0000000 --- a/dot_config/nvim/lua/configs/toggleterm.lua +++ /dev/null @@ -1,13 +0,0 @@ -require("toggleterm").setup(astronvim.user_plugin_opts("plugins.toggleterm", { - size = 10, - open_mapping = [[]], - shading_factor = 2, - direction = "float", - float_opts = { - border = "curved", - highlights = { - border = "Normal", - background = "Normal", - }, - }, -})) diff --git a/dot_config/nvim/lua/configs/treesitter.lua b/dot_config/nvim/lua/configs/treesitter.lua deleted file mode 100644 index bf024f9..0000000 --- a/dot_config/nvim/lua/configs/treesitter.lua +++ /dev/null @@ -1,19 +0,0 @@ -require("nvim-treesitter.configs").setup(astronvim.user_plugin_opts("plugins.treesitter", { - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - context_commentstring = { - enable = true, - enable_autocmd = false, - }, - rainbow = { - enable = true, - disable = { "html" }, - extended_mode = false, - max_file_lines = nil, - }, - autotag = { enable = true }, - incremental_selection = { enable = true }, - indent = { enable = false }, -})) diff --git a/dot_config/nvim/lua/configs/which-key-register.lua b/dot_config/nvim/lua/configs/which-key-register.lua deleted file mode 100644 index 947b4af..0000000 --- a/dot_config/nvim/lua/configs/which-key-register.lua +++ /dev/null @@ -1,51 +0,0 @@ -local is_available = astronvim.is_available -local user_plugin_opts = astronvim.user_plugin_opts -local mappings = { - n = { - [""] = { - f = { name = "File" }, - p = { name = "Packages" }, - l = { name = "LSP" }, - u = { name = "UI" }, - }, - }, -} - -local extra_sections = { - D = "Debugger", - g = "Git", - s = "Search", - S = "Session", - t = "Terminal", -} - -local function init_table(mode, prefix, idx) - if not mappings[mode][prefix][idx] then mappings[mode][prefix][idx] = { name = extra_sections[idx] } end -end - -if is_available "neovim-session-manager" then init_table("n", "", "S") end - -if is_available "gitsigns.nvim" then init_table("n", "", "g") end - -if is_available "toggleterm.nvim" then - init_table("n", "", "g") - init_table("n", "", "t") -end - -if is_available "telescope.nvim" then - init_table("n", "", "s") - init_table("n", "", "g") -end - -if is_available "nvim-dap" then init_table("n", "", "D") end - -if is_available "Comment.nvim" then - for _, mode in ipairs { "n", "v" } do - if not mappings[mode] then mappings[mode] = {} end - if not mappings[mode].g then mappings[mode].g = {} end - mappings[mode].g.c = "Comment toggle linewise" - mappings[mode].g.b = "Comment toggle blockwise" - end -end - -astronvim.which_key_register(user_plugin_opts("which-key.register", mappings)) diff --git a/dot_config/nvim/lua/configs/which-key.lua b/dot_config/nvim/lua/configs/which-key.lua deleted file mode 100644 index b2061c0..0000000 --- a/dot_config/nvim/lua/configs/which-key.lua +++ /dev/null @@ -1,11 +0,0 @@ -require("which-key").setup(astronvim.user_plugin_opts("plugins.which-key", { - plugins = { - spelling = { enabled = true }, - presets = { operators = false }, - }, - window = { - border = "rounded", - padding = { 2, 2, 2, 2 }, - }, - disable = { filetypes = { "TelescopePrompt" } }, -})) diff --git a/dot_config/nvim/lua/configs/window-picker.lua b/dot_config/nvim/lua/configs/window-picker.lua deleted file mode 100644 index b8df293..0000000 --- a/dot_config/nvim/lua/configs/window-picker.lua +++ /dev/null @@ -1,4 +0,0 @@ -local colors = require "default_theme.colors" -require("window-picker").setup( - astronvim.user_plugin_opts("plugins.window-picker", { use_winbar = "smart", other_win_hl_color = colors.grey_4 }) -) diff --git a/dot_config/nvim/lua/core/autocmds.lua b/dot_config/nvim/lua/core/autocmds.lua deleted file mode 100644 index c9583d8..0000000 --- a/dot_config/nvim/lua/core/autocmds.lua +++ /dev/null @@ -1,186 +0,0 @@ -local is_available = astronvim.is_available -local user_plugin_opts = astronvim.user_plugin_opts -local namespace = vim.api.nvim_create_namespace -local cmd = vim.api.nvim_create_autocmd -local augroup = vim.api.nvim_create_augroup -local create_command = vim.api.nvim_create_user_command - -vim.on_key(function(char) - if vim.fn.mode() == "n" then - local new_hlsearch = vim.tbl_contains({ "", "n", "N", "*", "#", "?", "/" }, vim.fn.keytrans(char)) - if vim.opt.hlsearch:get() ~= new_hlsearch then vim.opt.hlsearch = new_hlsearch end - end -end, namespace "auto_hlsearch") - -cmd({ "VimEnter", "FileType", "BufEnter", "WinEnter" }, { - desc = "URL Highlighting", - group = augroup("highlighturl", { clear = true }), - pattern = "*", - callback = function() astronvim.set_url_match() end, -}) - -cmd("TextYankPost", { - desc = "Highlight yanked text", - group = augroup("highlightyank", { clear = true }), - pattern = "*", - callback = function() vim.highlight.on_yank() end, -}) - -cmd("FileType", { - desc = "Unlist quickfist buffers", - group = augroup("unlist_quickfist", { clear = true }), - pattern = "qf", - callback = function() vim.opt_local.buflisted = false end, -}) - -cmd("BufEnter", { - desc = "Quit AstroNvim if more than one window is open and only sidebar windows are list", - group = augroup("auto_quit", { clear = true }), - callback = function() - local wins = vim.api.nvim_tabpage_list_wins(0) - -- Both neo-tree and aerial will auto-quit if there is only a single window left - if #wins <= 1 then return end - local sidebar_fts = { aerial = true, ["neo-tree"] = true } - for _, winid in ipairs(wins) do - if vim.api.nvim_win_is_valid(winid) then - local bufnr = vim.api.nvim_win_get_buf(winid) - local filetype = vim.api.nvim_buf_get_option(bufnr, "filetype") - -- If any visible windows are not sidebars, early return - if not sidebar_fts[filetype] then - return - -- If the visible window is a sidebar - else - -- only count filetypes once, so remove a found sidebar from the detection - sidebar_fts[filetype] = nil - end - end - end - if #vim.api.nvim_list_tabpages() > 1 then - vim.cmd.tabclose() - else - vim.cmd.qall() - end - end, -}) - -if is_available "alpha-nvim" then - local group_name = augroup("alpha_settings", { clear = true }) - cmd("User", { - desc = "Disable status and tablines for alpha", - group = group_name, - pattern = "AlphaReady", - callback = function() - local prev_showtabline = vim.opt.showtabline - local prev_status = vim.opt.laststatus - vim.opt.laststatus = 0 - vim.opt.showtabline = 0 - vim.opt_local.winbar = nil - cmd("BufUnload", { - pattern = "", - callback = function() - vim.opt.laststatus = prev_status - vim.opt.showtabline = prev_showtabline - end, - }) - end, - }) - cmd("VimEnter", { - desc = "Start Alpha when vim is opened with no arguments", - group = group_name, - callback = function() - local should_skip = false - if vim.fn.argc() > 0 or vim.fn.line2byte "$" ~= -1 or not vim.o.modifiable then - should_skip = true - else - for _, arg in pairs(vim.v.argv) do - if arg == "-b" or arg == "-c" or vim.startswith(arg, "+") or arg == "-S" then - should_skip = true - break - end - end - end - if not should_skip then - if is_available "bufferline.nvim" then pcall(require, "bufferline") end - require("alpha").start(true) - end - end, - }) -end - -if is_available "neo-tree.nvim" then - cmd("BufEnter", { - desc = "Open Neo-Tree on startup with directory", - group = augroup("neotree_start", { clear = true }), - callback = function() - local stats = vim.loop.fs_stat(vim.api.nvim_buf_get_name(0)) - if stats and stats.type == "directory" then require("neo-tree.setup.netrw").hijack() end - end, - }) -end - -if is_available "nvim-dap-ui" then - vim.api.nvim_create_autocmd("FileType", { - desc = "Make q close dap floating windows", - group = vim.api.nvim_create_augroup("dapui", { clear = true }), - pattern = "dap-float", - callback = function() vim.keymap.set("n", "q", "close!") end, - }) -end - -cmd({ "VimEnter", "ColorScheme" }, { - desc = "Load custom highlights from user configuration", - group = augroup("astronvim_highlights", { clear = true }), - callback = function() - if vim.g.colors_name then - for _, module in ipairs { "init", vim.g.colors_name } do - for group, spec in pairs(user_plugin_opts("highlights." .. module)) do - vim.api.nvim_set_hl(0, group, spec) - end - end - end - astronvim.event "ColorScheme" - end, -}) - -vim.api.nvim_create_autocmd("BufRead", { - group = vim.api.nvim_create_augroup("git_plugin_lazy_load", { clear = true }), - callback = function() - vim.fn.system("git -C " .. vim.fn.expand "%:p:h" .. " rev-parse") - if vim.v.shell_error == 0 then - vim.api.nvim_del_augroup_by_name "git_plugin_lazy_load" - local packer = require "packer" - vim.tbl_map(function(plugin) packer.loader(plugin) end, astronvim.git_plugins) - end - end, -}) -vim.api.nvim_create_autocmd({ "BufRead", "BufWinEnter", "BufNewFile" }, { - group = vim.api.nvim_create_augroup("file_plugin_lazy_load", { clear = true }), - callback = function() - local title = vim.fn.expand "%" - if not (title == "" or title == "[packer]" or title:match "^neo%-tree%s+filesystem") then - vim.api.nvim_del_augroup_by_name "file_plugin_lazy_load" - local packer = require "packer" - vim.tbl_map(function(plugin) packer.loader(plugin) end, astronvim.file_plugins) - end - end, -}) - -create_command( - "AstroUpdatePackages", - function() astronvim.updater.update_packages() end, - { desc = "Update Packer and Mason" } -) -create_command("AstroUpdate", function() astronvim.updater.update() end, { desc = "Update AstroNvim" }) -create_command("AstroReload", function() astronvim.updater.reload() end, { desc = "Reload AstroNvim" }) -create_command("AstroVersion", function() astronvim.updater.version() end, { desc = "Check AstroNvim Version" }) -create_command("AstroChangelog", function() astronvim.updater.changelog() end, { desc = "Check AstroNvim Changelog" }) -create_command("ToggleHighlightURL", function() astronvim.ui.toggle_url_match() end, { desc = "Toggle URL Highlights" }) - -if is_available "mason.nvim" then - create_command("MasonUpdateAll", function() astronvim.mason.update_all() end, { desc = "Update Mason Packages" }) - create_command( - "MasonUpdate", - function(opts) astronvim.mason.update(opts.args) end, - { nargs = 1, desc = "Update Mason Package" } - ) -end diff --git a/dot_config/nvim/lua/core/bootstrap.lua b/dot_config/nvim/lua/core/bootstrap.lua deleted file mode 100644 index 48839f8..0000000 --- a/dot_config/nvim/lua/core/bootstrap.lua +++ /dev/null @@ -1,4 +0,0 @@ -astronvim.initialize_packer() - -local colorscheme = astronvim.user_plugin_opts("colorscheme", nil, false) -vim.cmd.colorscheme(vim.tbl_contains(vim.fn.getcompletion("", "color"), colorscheme) and colorscheme or "default_theme") diff --git a/dot_config/nvim/lua/core/diagnostics.lua b/dot_config/nvim/lua/core/diagnostics.lua deleted file mode 100644 index c214098..0000000 --- a/dot_config/nvim/lua/core/diagnostics.lua +++ /dev/null @@ -1,43 +0,0 @@ -local signs = { - { name = "DiagnosticSignError", text = astronvim.get_icon "DiagnosticError" }, - { name = "DiagnosticSignWarn", text = astronvim.get_icon "DiagnosticWarn" }, - { name = "DiagnosticSignHint", text = astronvim.get_icon "DiagnosticHint" }, - { name = "DiagnosticSignInfo", text = astronvim.get_icon "DiagnosticInfo" }, - { name = "DiagnosticSignError", text = astronvim.get_icon "DiagnosticError" }, - { name = "DapStopped", text = astronvim.get_icon "DapStopped", texthl = "DiagnosticWarn" }, - { name = "DapBreakpoint", text = astronvim.get_icon "DapBreakpoint", texthl = "DiagnosticInfo" }, - { name = "DapBreakpointRejected", text = astronvim.get_icon "DapBreakpointRejected", texthl = "DiagnosticError" }, - { name = "DapBreakpointCondition", text = astronvim.get_icon "DapBreakpointCondition", texthl = "DiagnosticInfo" }, - { name = "DapLogPoint", text = astronvim.get_icon "DapLogPoint", texthl = "DiagnosticInfo" }, -} - -for _, sign in ipairs(signs) do - if not sign.texthl then sign.texthl = sign.name end - vim.fn.sign_define(sign.name, sign) -end - -astronvim.lsp.diagnostics = { - off = { - underline = false, - virtual_text = false, - signs = false, - update_in_insert = false, - }, - on = astronvim.user_plugin_opts("diagnostics", { - virtual_text = true, - signs = { active = signs }, - update_in_insert = true, - underline = true, - severity_sort = true, - float = { - focused = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, - }), -} - -vim.diagnostic.config(astronvim.lsp.diagnostics[vim.g.diagnostics_enabled and "on" or "off"]) diff --git a/dot_config/nvim/lua/core/icons/nerd_font.lua b/dot_config/nvim/lua/core/icons/nerd_font.lua deleted file mode 100644 index 0df83df..0000000 --- a/dot_config/nvim/lua/core/icons/nerd_font.lua +++ /dev/null @@ -1,43 +0,0 @@ -return { - ActiveLSP = "", - ActiveTS = "綠", - BufferClose = "", - DapBreakpoint = "", - DapBreakpointCondition = "", - DapBreakpointRejected = "", - DapLogPoint = ".>", - DapStopped = "", - DefaultFile = "", - Diagnostic = "裂", - DiagnosticError = "", - DiagnosticHint = "", - DiagnosticInfo = "", - DiagnosticWarn = "", - Ellipsis = "…", - FileModified = "", - FileReadOnly = "", - FolderClosed = "", - FolderEmpty = "", - FolderOpen = "", - Git = "", - GitAdd = "", - GitBranch = "", - GitChange = "", - GitConflict = "", - GitDelete = "", - GitIgnored = "◌", - GitRenamed = "➜", - GitStaged = "✓", - GitUnstaged = "✗", - GitUntracked = "★", - LSPLoaded = "", - LSPLoading1 = "", - LSPLoading2 = "", - LSPLoading3 = "", - MacroRecording = "", - NeovimClose = "", - Paste = "", - Search = "", - Selected = "❯", - Spellcheck = "暈", -} diff --git a/dot_config/nvim/lua/core/icons/text.lua b/dot_config/nvim/lua/core/icons/text.lua deleted file mode 100644 index 347eb5a..0000000 --- a/dot_config/nvim/lua/core/icons/text.lua +++ /dev/null @@ -1,35 +0,0 @@ -return { - ActiveLSP = "LSP:", - BufferClose = "x", - DapBreakpoint = "B", - DapBreakpointCondition = "C", - DapBreakpointRejected = "R", - DapLogPoint = "L", - DapStopped = ">", - DefaultFile = "[F]", - DiagnosticError = "X", - DiagnosticHint = "?", - DiagnosticInfo = "i", - DiagnosticWarn = "!", - Ellipsis = "...", - FileModified = "*", - FileReadOnly = "[lock]", - FolderClosed = "[D]", - FolderEmpty = "[E]", - FolderOpen = "[O]", - GitAdd = "[+]", - GitChange = "[/]", - GitConflict = "[!]", - GitDelete = "[-]", - GitIgnored = "[I]", - GitRenamed = "[R]", - GitStaged = "[S]", - GitUnstaged = "[U]", - GitUntracked = "[?]", - MacroRecording = "Recording:", - NeovimClose = "X", - Paste = "[PASTE]", - Search = "?", - Selected = "*", - Spellcheck = "[SPELL]", -} diff --git a/dot_config/nvim/lua/core/mappings.lua b/dot_config/nvim/lua/core/mappings.lua deleted file mode 100644 index ad01273..0000000 --- a/dot_config/nvim/lua/core/mappings.lua +++ /dev/null @@ -1,272 +0,0 @@ -local is_available = astronvim.is_available - -local maps = { i = {}, n = {}, v = {}, t = {}, [""] = {} } - -maps[""][""] = "" - --- Normal -- --- Standard Operations -maps.n["w"] = { "w", desc = "Save" } -maps.n["q"] = { "q", desc = "Quit" } -maps.n["h"] = { "nohlsearch", desc = "No Highlight" } -- TODO: REMOVE IN v3 -maps.n["fn"] = { "enew", desc = "New File" } -maps.n["gx"] = { function() astronvim.system_open() end, desc = "Open the file under cursor with system app" } -maps.n[""] = { "w!", desc = "Force write" } -maps.n[""] = { "q!", desc = "Force quit" } -maps.n["Q"] = "" - --- Packer -maps.n["pc"] = { "PackerCompile", desc = "Packer Compile" } -maps.n["pi"] = { "PackerInstall", desc = "Packer Install" } -maps.n["ps"] = { "PackerSync", desc = "Packer Sync" } -maps.n["pS"] = { "PackerStatus", desc = "Packer Status" } -maps.n["pu"] = { "PackerUpdate", desc = "Packer Update" } - --- AstroNvim -maps.n["pa"] = { "AstroUpdatePackages", desc = "Update Packer and Mason" } -maps.n["pA"] = { "AstroUpdate", desc = "AstroNvim Update" } -maps.n["pv"] = { "AstroVersion", desc = "AstroNvim Version" } -maps.n["pl"] = { "AstroChangelog", desc = "AstroNvim Changelog" } - --- Alpha -if is_available "alpha-nvim" then - maps.n["d"] = { function() require("alpha").start() end, desc = "Alpha Dashboard" } -end - --- Bufdelete -if is_available "bufdelete.nvim" then - maps.n["c"] = { function() require("bufdelete").bufdelete(0, false) end, desc = "Close buffer" } - maps.n["C"] = { function() require("bufdelete").bufdelete(0, true) end, desc = "Force close buffer" } -else - maps.n["c"] = { "bdelete", desc = "Close buffer" } - maps.n["C"] = { "bdelete!", desc = "Force close buffer" } -end - --- Navigate buffers -if is_available "bufferline.nvim" then - maps.n[""] = { "BufferLineCycleNext", desc = "Next buffer tab" } - maps.n[""] = { "BufferLineCyclePrev", desc = "Previous buffer tab" } - maps.n[">b"] = { "BufferLineMoveNext", desc = "Move buffer tab right" } - maps.n["BufferLineMovePrev", desc = "Move buffer tab left" } -else - maps.n[""] = { "bnext", desc = "Next buffer" } - maps.n[""] = { "bprevious", desc = "Previous buffer" } -end - --- Comment -if is_available "Comment.nvim" then - maps.n["/"] = { function() require("Comment.api").toggle.linewise.current() end, desc = "Comment line" } - maps.v["/"] = { - "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", - desc = "Toggle comment line", - } -end - --- GitSigns -if is_available "gitsigns.nvim" then - maps.n["gj"] = { function() require("gitsigns").next_hunk() end, desc = "Next git hunk" } - maps.n["gk"] = { function() require("gitsigns").prev_hunk() end, desc = "Previous git hunk" } - maps.n["gl"] = { function() require("gitsigns").blame_line() end, desc = "View git blame" } - maps.n["gp"] = { function() require("gitsigns").preview_hunk() end, desc = "Preview git hunk" } - maps.n["gh"] = { function() require("gitsigns").reset_hunk() end, desc = "Reset git hunk" } - maps.n["gr"] = { function() require("gitsigns").reset_buffer() end, desc = "Reset git buffer" } - maps.n["gs"] = { function() require("gitsigns").stage_hunk() end, desc = "Stage git hunk" } - maps.n["gu"] = { function() require("gitsigns").undo_stage_hunk() end, desc = "Unstage git hunk" } - maps.n["gd"] = { function() require("gitsigns").diffthis() end, desc = "View git diff" } -end - --- NeoTree -if is_available "neo-tree.nvim" then - maps.n["e"] = { "Neotree toggle", desc = "Toggle Explorer" } - maps.n["o"] = { "Neotree focus", desc = "Focus Explorer" } -end - --- Session Manager -if is_available "neovim-session-manager" then - maps.n["Sl"] = { "SessionManager! load_last_session", desc = "Load last session" } - maps.n["Ss"] = { "SessionManager! save_current_session", desc = "Save this session" } - maps.n["Sd"] = { "SessionManager! delete_session", desc = "Delete session" } - maps.n["Sf"] = { "SessionManager! load_session", desc = "Search sessions" } - maps.n["S."] = - { "SessionManager! load_current_dir_session", desc = "Load current directory session" } -end - --- Package Manager -if is_available "mason.nvim" then - maps.n["pI"] = { "Mason", desc = "Mason Installer" } - maps.n["pU"] = { "MasonUpdateAll", desc = "Mason Update" } -end - --- LSP Installer -if is_available "mason-lspconfig.nvim" then maps.n["li"] = { "LspInfo", desc = "LSP information" } end - --- Smart Splits -if is_available "smart-splits.nvim" then - -- Better window navigation - maps.n[""] = { function() require("smart-splits").move_cursor_left() end, desc = "Move to left split" } - maps.n[""] = { function() require("smart-splits").move_cursor_down() end, desc = "Move to below split" } - maps.n[""] = { function() require("smart-splits").move_cursor_up() end, desc = "Move to above split" } - maps.n[""] = { function() require("smart-splits").move_cursor_right() end, desc = "Move to right split" } - - -- Resize with arrows - maps.n[""] = { function() require("smart-splits").resize_up() end, desc = "Resize split up" } - maps.n[""] = { function() require("smart-splits").resize_down() end, desc = "Resize split down" } - maps.n[""] = { function() require("smart-splits").resize_left() end, desc = "Resize split left" } - maps.n[""] = { function() require("smart-splits").resize_right() end, desc = "Resize split right" } -else - maps.n[""] = { "h", desc = "Move to left split" } - maps.n[""] = { "j", desc = "Move to below split" } - maps.n[""] = { "k", desc = "Move to above split" } - maps.n[""] = { "l", desc = "Move to right split" } - maps.n[""] = { "resize -2", desc = "Resize split up" } - maps.n[""] = { "resize +2", desc = "Resize split down" } - maps.n[""] = { "vertical resize -2", desc = "Resize split left" } - maps.n[""] = { "vertical resize +2", desc = "Resize split right" } -end - --- SymbolsOutline -if is_available "aerial.nvim" then - maps.n["lS"] = { function() require("aerial").toggle() end, desc = "Symbols outline" } -end - --- Telescope -if is_available "telescope.nvim" then - maps.n["fw"] = { function() require("telescope.builtin").live_grep() end, desc = "Search words" } - maps.n["fW"] = { - function() - require("telescope.builtin").live_grep { - additional_args = function(args) return vim.list_extend(args, { "--hidden", "--no-ignore" }) end, - } - end, - desc = "Search words in all files", - } - maps.n["gt"] = { function() require("telescope.builtin").git_status() end, desc = "Git status" } - maps.n["gb"] = { function() require("telescope.builtin").git_branches() end, desc = "Git branches" } - maps.n["gc"] = { function() require("telescope.builtin").git_commits() end, desc = "Git commits" } - maps.n["ff"] = { function() require("telescope.builtin").find_files() end, desc = "Search files" } - maps.n["fF"] = { - function() require("telescope.builtin").find_files { hidden = true, no_ignore = true } end, - desc = "Search all files", - } - maps.n["fb"] = { function() require("telescope.builtin").buffers() end, desc = "Search buffers" } - maps.n["fh"] = { function() require("telescope.builtin").help_tags() end, desc = "Search help" } - maps.n["fm"] = { function() require("telescope.builtin").marks() end, desc = "Search marks" } - maps.n["fo"] = { function() require("telescope.builtin").oldfiles() end, desc = "Search history" } - maps.n["fc"] = - { function() require("telescope.builtin").grep_string() end, desc = "Search for word under cursor" } - maps.n["sb"] = { function() require("telescope.builtin").git_branches() end, desc = "Git branches" } - maps.n["sh"] = { function() require("telescope.builtin").help_tags() end, desc = "Search help" } - maps.n["sm"] = { function() require("telescope.builtin").man_pages() end, desc = "Search man" } - maps.n["sr"] = { function() require("telescope.builtin").registers() end, desc = "Search registers" } - maps.n["sk"] = { function() require("telescope.builtin").keymaps() end, desc = "Search keymaps" } - maps.n["sc"] = { function() require("telescope.builtin").commands() end, desc = "Search commands" } - if astronvim.is_available "nvim-notify" then - maps.n["sn"] = - { function() require("telescope").extensions.notify.notify() end, desc = "Search notifications" } - end - maps.n["ls"] = { - function() - local aerial_avail, _ = pcall(require, "aerial") - if aerial_avail then - require("telescope").extensions.aerial.aerial() - else - require("telescope.builtin").lsp_document_symbols() - end - end, - desc = "Search symbols", - } - maps.n["lD"] = { function() require("telescope.builtin").diagnostics() end, desc = "Search diagnostics" } -end - --- Terminal -if is_available "toggleterm.nvim" then - local toggle_term_cmd = astronvim.toggle_term_cmd - if vim.fn.executable "lazygit" == 1 then - maps.n["gg"] = { function() toggle_term_cmd "lazygit" end, desc = "ToggleTerm lazygit" } - maps.n["tl"] = { function() toggle_term_cmd "lazygit" end, desc = "ToggleTerm lazygit" } - end - if vim.fn.executable "node" == 1 then - maps.n["tn"] = { function() toggle_term_cmd "node" end, desc = "ToggleTerm node" } - end - if vim.fn.executable "gdu" == 1 then - maps.n["tu"] = { function() toggle_term_cmd "gdu" end, desc = "ToggleTerm gdu" } - end - if vim.fn.executable "btm" == 1 then - maps.n["tt"] = { function() toggle_term_cmd "btm" end, desc = "ToggleTerm btm" } - end - if vim.fn.executable "python" == 1 then - maps.n["tp"] = { function() toggle_term_cmd "python" end, desc = "ToggleTerm python" } - end - maps.n["tf"] = { "ToggleTerm direction=float", desc = "ToggleTerm float" } - maps.n["th"] = { "ToggleTerm size=10 direction=horizontal", desc = "ToggleTerm horizontal split" } - maps.n["tv"] = { "ToggleTerm size=80 direction=vertical", desc = "ToggleTerm vertical split" } - maps.n[""] = { "ToggleTerm", desc = "Toggle terminal" } - maps.t[""] = maps.n[""] - maps.n[""] = maps.n[""] - maps.t[""] = maps.n[""] -end - -if is_available "nvim-dap" then - -- modified function keys found with `showkey -a` in the terminal to get key code - -- run `nvim -V3log +quit` and search through the "Terminal info" in the `log` file for the correct keyname - maps.n[""] = { function() require("dap").continue() end, desc = "Debugger: Start" } - maps.n[""] = { function() require("dap").terminate() end, desc = "Debugger: Stop" } -- Shift+F5 - maps.n[""] = { function() require("dap").restart_frame() end, desc = "Debugger: Restart" } -- Control+F5 - maps.n[""] = { function() require("dap").pause() end, desc = "Debugger: Pause" } - maps.n[""] = { function() require("dap").toggle_breakpoint() end, desc = "Debugger: Toggle Breakpoint" } - maps.n[""] = { function() require("dap").step_over() end, desc = "Debugger: Step Over" } - maps.n[""] = { function() require("dap").step_into() end, desc = "Debugger: Step Into" } - maps.n[""] = { function() require("dap").step_out() end, desc = "Debugger: Step Out" } -- Shift+F11 - maps.n["Db"] = { function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint (F9)" } - maps.n["DB"] = { function() require("dap").clear_breakpoints() end, desc = "Clear Breakpoints" } - maps.n["Dc"] = { function() require("dap").continue() end, desc = "Start/Continue (F5)" } - maps.n["Di"] = { function() require("dap").step_into() end, desc = "Step Into (F11)" } - maps.n["Do"] = { function() require("dap").step_over() end, desc = "Step Over (F10)" } - maps.n["DO"] = { function() require("dap").step_out() end, desc = "Step Out (S-F11)" } - maps.n["Dq"] = { function() require("dap").close() end, desc = "Close Session" } - maps.n["DQ"] = { function() require("dap").terminate() end, desc = "Terminate Session (S-F5)" } - maps.n["Dp"] = { function() require("dap").pause() end, desc = "Pause (F6)" } - maps.n["Dr"] = { function() require("dap").restart_frame() end, desc = "Restart (C-F5)" } - maps.n["DR"] = { function() require("dap").repl.toggle() end, desc = "Toggle REPL" } - if is_available "nvim-dap-ui" then - maps.n["Du"] = { function() require("dapui").toggle() end, desc = "Toggle Debugger UI" } - maps.n["Dh"] = { function() require("dap.ui.widgets").hover() end, desc = "Debugger Hover" } - end -end - --- Stay in indent mode -maps.v["<"] = { ""] = { ">gv", desc = "indent line" } - --- Improved Terminal Navigation -maps.t[""] = { "h", desc = "Terminal left window navigation" } -maps.t[""] = { "j", desc = "Terminal down window navigation" } -maps.t[""] = { "k", desc = "Terminal up window navigation" } -maps.t[""] = { "l", desc = "Terminal right window navigation" } - --- Custom menu for modification of the user experience -if is_available "nvim-autopairs" then - maps.n["ua"] = { function() astronvim.ui.toggle_autopairs() end, desc = "Toggle autopairs" } -end -maps.n["ub"] = { function() astronvim.ui.toggle_background() end, desc = "Toggle background" } -if is_available "nvim-cmp" then - maps.n["uc"] = { function() astronvim.ui.toggle_cmp() end, desc = "Toggle autocompletion" } -end -if is_available "nvim-colorizer.lua" then - maps.n["uC"] = { "ColorizerToggle", desc = "Toggle color highlight" } -end -maps.n["uS"] = { function() astronvim.ui.toggle_conceal() end, desc = "Toggle conceal" } -maps.n["ud"] = { function() astronvim.ui.toggle_diagnostics() end, desc = "Toggle diagnostics" } -maps.n["ug"] = { function() astronvim.ui.toggle_signcolumn() end, desc = "Toggle signcolumn" } -maps.n["ui"] = { function() astronvim.ui.set_indent() end, desc = "Change indent setting" } -maps.n["ul"] = { function() astronvim.ui.toggle_statusline() end, desc = "Toggle statusline" } -maps.n["un"] = { function() astronvim.ui.change_number() end, desc = "Change line numbering" } -maps.n["us"] = { function() astronvim.ui.toggle_spell() end, desc = "Toggle spellcheck" } -maps.n["up"] = { function() astronvim.ui.toggle_paste() end, desc = "Toggle paste mode" } -maps.n["ut"] = { function() astronvim.ui.toggle_tabline() end, desc = "Toggle tabline" } -maps.n["uu"] = { function() astronvim.ui.toggle_url_match() end, desc = "Toggle URL highlight" } -maps.n["uw"] = { function() astronvim.ui.toggle_wrap() end, desc = "Toggle wrap" } -maps.n["uy"] = { function() astronvim.ui.toggle_syntax() end, desc = "Toggle syntax highlight" } -maps.n["uN"] = { function() astronvim.ui.toggle_ui_notifications() end, desc = "Toggle UI notifications" } - -astronvim.set_mappings(astronvim.user_plugin_opts("mappings", maps)) diff --git a/dot_config/nvim/lua/core/options.lua b/dot_config/nvim/lua/core/options.lua deleted file mode 100644 index f7f79fe..0000000 --- a/dot_config/nvim/lua/core/options.lua +++ /dev/null @@ -1,69 +0,0 @@ -vim.opt.shortmess:append { s = true, I = true } -- disable startup message -astronvim.vim_opts(astronvim.user_plugin_opts("options", { - opt = { - backspace = vim.opt.backspace + { "nostop" }, -- Don't stop backspace at insert - clipboard = "unnamedplus", -- Connection to the system clipboard - cmdheight = 0, -- hide command line unless needed - completeopt = { "menuone", "noselect" }, -- Options for insert mode completion - copyindent = true, -- Copy the previous indentation on autoindenting - cursorline = true, -- Highlight the text line of the cursor - expandtab = true, -- Enable the use of space in tab - fileencoding = "utf-8", -- File content encoding for the buffer - fillchars = { eob = " " }, -- Disable `~` on nonexistent lines - history = 100, -- Number of commands to remember in a history table - ignorecase = true, -- Case insensitive searching - laststatus = 3, -- globalstatus - lazyredraw = true, -- lazily redraw screen - mouse = "a", -- Enable mouse support - number = true, -- Show numberline - preserveindent = true, -- Preserve indent structure as much as possible - pumheight = 10, -- Height of the pop up menu - relativenumber = true, -- Show relative numberline - scrolloff = 8, -- Number of lines to keep above and below the cursor - shiftwidth = 2, -- Number of space inserted for indentation - showmode = false, -- Disable showing modes in command line - showtabline = 2, -- always display tabline - sidescrolloff = 8, -- Number of columns to keep at the sides of the cursor - signcolumn = "yes", -- Always show the sign column - smartcase = true, -- Case sensitivie searching - splitbelow = true, -- Splitting a new window below the current one - splitright = true, -- Splitting a new window at the right of the current one - swapfile = false, -- Disable use of swapfile for the buffer - tabstop = 2, -- Number of space in a tab - termguicolors = true, -- Enable 24-bit RGB color in the TUI - timeoutlen = 300, -- Length of time to wait for a mapped sequence - undofile = true, -- Enable persistent undo - updatetime = 300, -- Length of time to wait before triggering the plugin - wrap = false, -- Disable wrapping of lines longer than the width of window - writebackup = false, -- Disable making a backup before overwriting a file - }, - g = { - highlighturl_enabled = true, -- highlight URLs by default - mapleader = " ", -- set leader key - zipPlugin = false, -- disable zip - load_black = false, -- disable black - loaded_2html_plugin = true, -- disable 2html - loaded_getscript = true, -- disable getscript - loaded_getscriptPlugin = true, -- disable getscript - loaded_gzip = true, -- disable gzip - loaded_logipat = true, -- disable logipat - loaded_matchit = true, -- disable matchit - loaded_netrwFileHandlers = true, -- disable netrw - loaded_netrwPlugin = true, -- disable netrw - loaded_netrwSettngs = true, -- disable netrw - loaded_remote_plugins = true, -- disable remote plugins - loaded_tar = true, -- disable tar - loaded_tarPlugin = true, -- disable tar - loaded_zip = true, -- disable zip - loaded_zipPlugin = true, -- disable zip - loaded_vimball = true, -- disable vimball - loaded_vimballPlugin = true, -- disable vimball - autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled) - cmp_enabled = true, -- enable completion at start - autopairs_enabled = true, -- enable autopairs at start - diagnostics_enabled = true, -- enable diagnostics at start - status_diagnostics_enabled = true, -- enable diagnostics in statusline - icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available) - ui_notifications_enabled = true, -- disable notifications when toggling UI elements - }, -})) diff --git a/dot_config/nvim/lua/core/plugins.lua b/dot_config/nvim/lua/core/plugins.lua deleted file mode 100644 index 443f544..0000000 --- a/dot_config/nvim/lua/core/plugins.lua +++ /dev/null @@ -1,365 +0,0 @@ -local astro_plugins = { - -- Plugin manager - ["wbthomason/packer.nvim"] = { - setup = function() - astronvim.lazy_load_commands("packer.nvim", { - "PackerSnapshot", - "PackerSnapshotRollback", - "PackerSnapshotDelete", - "PackerInstall", - "PackerUpdate", - "PackerSync", - "PackerClean", - "PackerCompile", - "PackerStatus", - "PackerProfile", - "PackerLoad", - }) - end, - config = function() require "core.plugins" end, - }, - - -- Optimiser - ["lewis6991/impatient.nvim"] = {}, - - -- Lua functions - ["nvim-lua/plenary.nvim"] = { module = "plenary" }, - - -- Indent detection - ["Darazaki/indent-o-matic"] = { - opt = true, - setup = function() table.insert(astronvim.file_plugins, "indent-o-matic") end, - config = function() require "configs.indent-o-matic" end, - }, - - -- Notification Enhancer - ["rcarriga/nvim-notify"] = { - opt = true, - setup = function() astronvim.load_plugin_with_func("nvim-notify", vim, "notify") end, - config = function() require "configs.notify" end, - }, - - -- Neovim UI Enhancer - ["stevearc/dressing.nvim"] = { - opt = true, - setup = function() astronvim.load_plugin_with_func("dressing.nvim", vim.ui, { "input", "select" }) end, - config = function() require "configs.dressing" end, - }, - - -- Smarter Splits - ["mrjones2014/smart-splits.nvim"] = { - module = "smart-splits", - config = function() require "configs.smart-splits" end, - }, - - -- Icons - ["nvim-tree/nvim-web-devicons"] = { - disable = not vim.g.icons_enabled, - module = "nvim-web-devicons", - config = function() require "configs.nvim-web-devicons" end, - }, - - -- LSP Icons - ["onsails/lspkind.nvim"] = { - disable = not vim.g.icons_enabled, - module = "lspkind", - config = function() require "configs.lspkind" end, - }, - - -- Bufferline - ["akinsho/bufferline.nvim"] = { - module = "bufferline", - event = "UIEnter", - config = function() require "configs.bufferline" end, - }, - - -- Better buffer closing - ["famiu/bufdelete.nvim"] = { - module = "bufdelete", - setup = function() astronvim.lazy_load_commands("bufdelete.nvim", { "Bdelete", "Bwipeout" }) end, - }, - - ["s1n7ax/nvim-window-picker"] = { - tag = "v1.*", - module = "window-picker", - config = function() require "configs.window-picker" end, - }, - - -- File explorer - ["nvim-neo-tree/neo-tree.nvim"] = { - branch = "v2.x", - module = "neo-tree", - requires = { { "MunifTanjim/nui.nvim", module = "nui" } }, - setup = function() - astronvim.lazy_load_commands("neo-tree.nvim", "Neotree") - vim.g.neo_tree_remove_legacy_commands = true - end, - config = function() require "configs.neo-tree" end, - }, - - -- Statusline - ["rebelot/heirline.nvim"] = { event = "VimEnter", config = function() require "configs.heirline" end }, - - -- Syntax highlighting - ["nvim-treesitter/nvim-treesitter"] = { - module = "nvim-treesitter", - setup = function() - table.insert(astronvim.file_plugins, "nvim-treesitter") - astronvim.lazy_load_commands("nvim-treesitter", { - "TSBufDisable", - "TSBufEnable", - "TSBufToggle", - "TSDisable", - "TSEnable", - "TSToggle", - "TSInstall", - "TSInstallInfo", - "TSInstallSync", - "TSModuleInfo", - "TSUninstall", - "TSUpdate", - "TSUpdateSync", - }) - end, - run = function() require("nvim-treesitter.install").update { with_sync = true }() end, - config = function() require "configs.treesitter" end, - }, - - -- Parenthesis highlighting - ["p00f/nvim-ts-rainbow"] = { after = "nvim-treesitter" }, - - -- Autoclose tags - ["windwp/nvim-ts-autotag"] = { after = "nvim-treesitter" }, - - -- Context based commenting - ["JoosepAlviste/nvim-ts-context-commentstring"] = { after = "nvim-treesitter" }, - - -- Snippet collection - ["rafamadriz/friendly-snippets"] = { opt = true }, - - -- Snippet engine - ["L3MON4D3/LuaSnip"] = { - module = "luasnip", - wants = "friendly-snippets", - config = function() require "configs.luasnip" end, - }, - - -- Completion engine - ["hrsh7th/nvim-cmp"] = { event = "InsertEnter", config = function() require "configs.cmp" end }, - - -- Snippet completion source - ["saadparwaiz1/cmp_luasnip"] = { - after = "nvim-cmp", - config = function() astronvim.add_user_cmp_source "luasnip" end, - }, - - -- Buffer completion source - ["hrsh7th/cmp-buffer"] = { after = "nvim-cmp", config = function() astronvim.add_user_cmp_source "buffer" end }, - - -- Path completion source - ["hrsh7th/cmp-path"] = { after = "nvim-cmp", config = function() astronvim.add_user_cmp_source "path" end }, - - -- LSP completion source - ["hrsh7th/cmp-nvim-lsp"] = { after = "nvim-cmp", config = function() astronvim.add_user_cmp_source "nvim_lsp" end }, - - -- Built-in LSP - ["neovim/nvim-lspconfig"] = { - module = "lspconfig", - setup = function() table.insert(astronvim.file_plugins, "nvim-lspconfig") end, - config = function() require "configs.lspconfig" end, - }, - - -- Formatting and linting - ["jose-elias-alvarez/null-ls.nvim"] = { - module = "null-ls", - setup = function() table.insert(astronvim.file_plugins, "null-ls.nvim") end, - config = function() require "configs.null-ls" end, - }, - - -- Debugger - ["mfussenegger/nvim-dap"] = { - disable = vim.fn.has "win32" == 1, - module = "dap", - config = function() require "configs.dap" end, - }, - - -- Debugger UI - ["rcarriga/nvim-dap-ui"] = { - disable = vim.fn.has "win32" == 1, - after = "nvim-dap", - config = function() require "configs.dapui" end, - }, - - -- Package Manager - ["williamboman/mason.nvim"] = { - module = "mason", - cmd = { - "Mason", - "MasonInstall", - "MasonUninstall", - "MasonUninstallAll", - "MasonLog", - "MasonUpdate", -- astronvim command - "MasonUpdateAll", -- astronvim command - }, - config = function() - require "configs.mason" - vim.tbl_map(function(plugin) pcall(require, plugin) end, { "lspconfig", "null-ls", "dap" }) - end, - }, - - -- LSP manager - ["williamboman/mason-lspconfig.nvim"] = { - after = "nvim-lspconfig", - config = function() require "configs.mason-lspconfig" end, - }, - - -- null-ls manager - ["jayp0521/mason-null-ls.nvim"] = { after = "null-ls.nvim", config = function() require "configs.mason-null-ls" end }, - - -- dap manager - ["jayp0521/mason-nvim-dap.nvim"] = { - disable = vim.fn.has "win32" == 1, - after = "nvim-dap", - config = function() require "configs.mason-nvim-dap" end, - }, - - -- LSP symbols - ["stevearc/aerial.nvim"] = { - module = "aerial", - after = { "nvim-treesitter", "nvim-lspconfig" }, - ft = { "man", "markdown" }, - config = function() require "configs.aerial" end, - }, - - -- Fuzzy finder - ["nvim-telescope/telescope.nvim"] = { - module = "telescope", - setup = function() astronvim.lazy_load_commands("telescope.nvim", "Telescope") end, - config = function() require "configs.telescope" end, - }, - - -- Fuzzy finder syntax support - ["nvim-telescope/telescope-fzf-native.nvim"] = { - after = "telescope.nvim", - disable = vim.fn.executable "make" == 0, - run = "make", - config = function() require("telescope").load_extension "fzf" end, - }, - - -- Git integration - ["lewis6991/gitsigns.nvim"] = { - disable = vim.fn.executable "git" == 0, - ft = "gitcommit", - setup = function() table.insert(astronvim.git_plugins, "gitsigns.nvim") end, - config = function() require "configs.gitsigns" end, - }, - - -- Start screen - ["goolord/alpha-nvim"] = { - module = "alpha", - setup = function() astronvim.lazy_load_commands("alpha-nvim", "Alpha") end, - config = function() require "configs.alpha" end, - }, - - -- Color highlighting - ["NvChad/nvim-colorizer.lua"] = { - opt = true, - setup = function() table.insert(astronvim.file_plugins, "nvim-colorizer.lua") end, - config = function() require "configs.colorizer" end, - }, - - -- Autopairs - ["windwp/nvim-autopairs"] = { event = "InsertEnter", config = function() require "configs.autopairs" end }, - - -- Terminal - ["akinsho/toggleterm.nvim"] = { - module = "toggleterm", - setup = function() astronvim.lazy_load_commands("toggleterm.nvim", "ToggleTerm") end, - config = function() require "configs.toggleterm" end, - }, - - -- Commenting - ["numToStr/Comment.nvim"] = { - module = "Comment", - keys = { "gc", "gb" }, - config = function() require "configs.Comment" end, - }, - - -- Indentation - ["lukas-reineke/indent-blankline.nvim"] = { - opt = true, - setup = function() table.insert(astronvim.file_plugins, "indent-blankline.nvim") end, - config = function() require "configs.indent-line" end, - }, - - -- Keymaps popup - ["folke/which-key.nvim"] = { module = "which-key", config = function() require "configs.which-key" end }, - - -- Smooth escaping - ["max397574/better-escape.nvim"] = { - event = "InsertCharPre", - config = function() require "configs.better_escape" end, - }, - - -- Get extra JSON schemas - ["b0o/SchemaStore.nvim"] = { module = "schemastore" }, - - -- Session manager - ["Shatur/neovim-session-manager"] = { - module = "session_manager", - event = "BufWritePost", - setup = function() astronvim.lazy_load_commands("neovim-session-manager", "SessionManager") end, - config = function() require "configs.session_manager" end, - }, -} - -if astronvim.updater.snapshot then - for plugin, options in pairs(astro_plugins) do - local pin = astronvim.updater.snapshot[plugin:match "/([^/]*)$"] - options.commit = pin and pin.commit or options.commit - end -end - -local user_plugin_opts = astronvim.user_plugin_opts -local status_ok, packer = pcall(require, "packer") -if status_ok then - packer.startup { - function(use) - local plugins = user_plugin_opts("plugins.init", astro_plugins) - for key, plugin in pairs(plugins) do - if type(key) == "string" and not plugin[1] then plugin[1] = key end - if key == "williamboman/mason.nvim" and plugin.cmd then - for mason_plugin, commands in pairs { -- lazy load mason plugin commands with Mason - ["jayp0521/mason-null-ls.nvim"] = { "NullLsInstall", "NullLsUninstall" }, - ["williamboman/mason-lspconfig.nvim"] = { "LspInstall", "LspUninstall" }, - ["jayp0521/mason-nvim-dap.nvim"] = { "DapInstall", "DapUninstall" }, - } do - if plugins[mason_plugin] and not plugins[mason_plugin].disable then - vim.list_extend(plugin.cmd, commands) - end - end - end - use(plugin) - end - end, - config = user_plugin_opts("plugins.packer", { - compile_path = astronvim.default_compile_path, - display = { - open_fn = function() return require("packer.util").float { border = "rounded" } end, - }, - profile = { - enable = true, - threshold = 0.0001, - }, - git = { - clone_timeout = 300, - subcommands = { - update = "pull --rebase", - }, - }, - auto_clean = true, - compile_on_sync = true, - }), - } -end diff --git a/dot_config/nvim/lua/core/status.lua b/dot_config/nvim/lua/core/status.lua deleted file mode 100644 index 90f571d..0000000 --- a/dot_config/nvim/lua/core/status.lua +++ /dev/null @@ -1,112 +0,0 @@ -local M = { hl = {}, provider = {}, conditional = {} } -local C = require "default_theme.colors" - -local function hl_by_name(name) return string.format("#%06x", vim.api.nvim_get_hl_by_name(name.group, true)[name.prop]) end - -local function hl_prop(group, prop) - local status_ok, color = pcall(hl_by_name, { group = group, prop = prop }) - return status_ok and color or nil -end - -M.modes = { - ["n"] = { "NORMAL", "Normal", C.blue }, - ["no"] = { "N-PENDING", "Normal", C.blue }, - ["i"] = { "INSERT", "Insert", C.green }, - ["ic"] = { "INSERT", "Insert", C.green }, - ["t"] = { "TERMINAL", "Insert", C.green }, - ["v"] = { "VISUAL", "Visual", C.purple }, - ["V"] = { "V-LINE", "Visual", C.purple }, - [""] = { "V-BLOCK", "Visual", C.purple }, - ["R"] = { "REPLACE", "Replace", C.red_1 }, - ["Rv"] = { "V-REPLACE", "Replace", C.red_1 }, - ["s"] = { "SELECT", "Visual", C.orange_1 }, - ["S"] = { "S-LINE", "Visual", C.orange_1 }, - [""] = { "S-BLOCK", "Visual", C.orange_1 }, - ["c"] = { "COMMAND", "Command", C.yellow_1 }, - ["cv"] = { "COMMAND", "Command", C.yellow_1 }, - ["ce"] = { "COMMAND", "Command", C.yellow_1 }, - ["r"] = { "PROMPT", "Inactive", C.grey_7 }, - ["rm"] = { "MORE", "Inactive", C.grey_7 }, - ["r?"] = { "CONFIRM", "Inactive", C.grey_7 }, - ["!"] = { "SHELL", "Inactive", C.grey_7 }, -} - -function M.hl.group(hlgroup, base) - return vim.tbl_deep_extend( - "force", - base or {}, - { fg = hl_prop(hlgroup, "foreground"), bg = hl_prop(hlgroup, "background") } - ) -end - -function M.hl.fg(hlgroup, base) return vim.tbl_deep_extend("force", base or {}, { fg = hl_prop(hlgroup, "foreground") }) end - -function M.hl.mode(base) - local lualine_avail, lualine = pcall(require, "lualine.themes." .. (vim.g.colors_name or "default_theme")) - return function() - local lualine_opts = lualine_avail and lualine[M.modes[vim.fn.mode()][2]:lower()] - return M.hl.group( - "Feline" .. M.modes[vim.fn.mode()][2], - vim.tbl_deep_extend( - "force", - lualine_opts and type(lualine_opts.a) == "table" and lualine_opts.a - or { fg = C.bg_1, bg = M.modes[vim.fn.mode()][3] }, - base or {} - ) - ) - end -end - -function M.provider.lsp_progress() - local Lsp = vim.lsp.util.get_progress_messages()[1] - return Lsp - and string.format( - " %%<%s %s %s (%s%%%%) ", - ((Lsp.percentage or 0) >= 70 and { "", "", "" } or { "", "", "" })[math.floor( - vim.loop.hrtime() / 12e7 - ) % 3 + 1], - Lsp.title or "", - Lsp.message or "", - Lsp.percentage or 0 - ) - or "" -end - -function M.provider.lsp_client_names(expand_null_ls) - return function() - local buf_client_names = {} - for _, client in pairs(vim.lsp.buf_get_clients(0)) do - if client.name == "null-ls" and expand_null_ls then - vim.list_extend(buf_client_names, astronvim.null_ls_sources(vim.bo.filetype, "FORMATTING")) - vim.list_extend(buf_client_names, astronvim.null_ls_sources(vim.bo.filetype, "DIAGNOSTICS")) - else - table.insert(buf_client_names, client.name) - end - end - return table.concat(buf_client_names, ", ") - end -end - -function M.provider.treesitter_status() - local ts = vim.treesitter.highlighter.active[vim.api.nvim_get_current_buf()] - return (ts and next(ts)) and " 綠TS" or "" -end - -function M.provider.spacer(n) return string.rep(" ", n or 1) end - -function M.conditional.git_available() return vim.b.gitsigns_head ~= nil end - -function M.conditional.git_changed() - local git_status = vim.b.gitsigns_status_dict - return git_status and (git_status.added or 0) + (git_status.removed or 0) + (git_status.changed or 0) > 0 -end - -function M.conditional.has_filetype() - return vim.fn.empty(vim.fn.expand "%:t") ~= 1 and vim.bo.filetype and vim.bo.filetype ~= "" -end - -function M.conditional.bar_width(n) - return function() return (vim.opt.laststatus:get() == 3 and vim.opt.columns:get() or vim.fn.winwidth(0)) > (n or 80) end -end - -return M diff --git a/dot_config/nvim/lua/core/utils/git.lua b/dot_config/nvim/lua/core/utils/git.lua deleted file mode 100644 index 125d296..0000000 --- a/dot_config/nvim/lua/core/utils/git.lua +++ /dev/null @@ -1,157 +0,0 @@ ---- ### Git LUA API --- --- This module can be loaded with `local git = require "core.utils.git"` --- --- @module core.utils.git --- @copyright 2022 --- @license GNU General Public License v3.0 - -local git = { url = "https://github.com/" } - ---- Run a git command from the AstroNvim installation directory --- @param args the git arguments --- @return the result of the command or nil if unsuccessful -function git.cmd(args, ...) return astronvim.cmd("git -C " .. astronvim.install.home .. " " .. args, ...) end - ---- Check if the AstroNvim is able to reach the `git` command --- @return the result of running `git --help` -function git.available() return vim.fn.executable "git" == 1 end - ---- Check if the AstroNvim home is a git repo --- @return the result of the command -function git.is_repo() return git.cmd("rev-parse --is-inside-work-tree", false) end - ---- Fetch git remote --- @param remote the remote to fetch --- @return the result of the command -function git.fetch(remote, ...) return git.cmd("fetch " .. remote, ...) end - ---- Pull the git repo --- @return the result of the command -function git.pull(...) return git.cmd("pull --rebase", ...) end - ---- Checkout git target --- @param dest the target to checkout --- @return the result of the command -function git.checkout(dest, ...) return git.cmd("checkout " .. dest, ...) end - ---- Hard reset to a git target --- @param dest the target to hard reset to --- @return the result of the command -function git.hard_reset(dest, ...) return git.cmd("reset --hard " .. dest, ...) end - ---- Check if a branch contains a commit --- @param remote the git remote to check --- @param branch the git branch to check --- @param commit the git commit to check for --- @return the result of the command -function git.branch_contains(remote, branch, commit, ...) - return git.cmd("merge-base --is-ancestor " .. commit .. " " .. remote .. "/" .. branch, ...) ~= nil -end - ---- Add a git remote --- @param remote the remote to add --- @param url the url of the remote --- @return the result of the command -function git.remote_add(remote, url, ...) return git.cmd("remote add " .. remote .. " " .. url, ...) end - ---- Update a git remote URL --- @param remote the remote to update --- @param url the new URL of the remote --- @return the result of the command -function git.remote_update(remote, url, ...) return git.cmd("remote set-url " .. remote .. " " .. url, ...) end - ---- Get the URL of a given git remote --- @param remote the remote to get the URL of --- @return the url of the remote -function git.remote_url(remote, ...) return astronvim.trim_or_nil(git.cmd("remote get-url " .. remote, ...)) end - ---- Get the current version with git describe including tags --- @return the current git describe string -function git.current_version(...) return astronvim.trim_or_nil(git.cmd("describe --tags", ...)) end - ---- Get the current branch --- @return the branch of the AstroNvim installation -function git.current_branch(...) return astronvim.trim_or_nil(git.cmd("rev-parse --abbrev-ref HEAD", ...)) end - ---- Get the current head of the git repo --- @return the head string -function git.local_head(...) return astronvim.trim_or_nil(git.cmd("rev-parse HEAD", ...)) end - ---- Get the current head of a git remote --- @param remote the remote to check --- @param branch the branch to check --- @return the head string of the remote branch -function git.remote_head(remote, branch, ...) - return astronvim.trim_or_nil(git.cmd("rev-list -n 1 " .. remote .. "/" .. branch, ...)) -end - ---- Get the commit hash of a given tag --- @param tag the tag to resolve --- @return the commit hash of a git tag -function git.tag_commit(tag, ...) return astronvim.trim_or_nil(git.cmd("rev-list -n 1 " .. tag, ...)) end - ---- Get the commit log between two commit hashes --- @param start_hash the start commit hash --- @param end_hash the end commit hash --- @return an array like table of commit messages -function git.get_commit_range(start_hash, end_hash, ...) - local range = "" - if start_hash and end_hash then range = start_hash .. ".." .. end_hash end - local log = git.cmd('log --no-merges --pretty="format:[%h] %s" ' .. range, ...) - return log and vim.fn.split(log, "\n") or {} -end - ---- Get a list of all tags with a regex filter --- @param search a regex to search the tags with (defaults to "v*" for version tags) --- @return an array like table of tags that match the search -function git.get_versions(search, ...) - local tags = git.cmd('tag -l --sort=version:refname "' .. (search == "latest" and "v*" or search) .. '"', ...) - return tags and vim.fn.split(tags, "\n") or {} -end - ---- Get the latest version of a list of versions --- @param versions a list of versions to search (defaults to all versions available) --- @return the latest version from the array -function git.latest_version(versions, ...) - if not versions then versions = git.get_versions(...) end - return versions[#versions] -end - ---- Parse a remote url --- @param str the remote to parse to a full git url --- @return the full git url for the given remote string -function git.parse_remote_url(str) - return vim.fn.match(str, astronvim.url_matcher) == -1 - and git.url .. str .. (vim.fn.match(str, "/") == -1 and "/AstroNvim.git" or ".git") - or str -end - ---- Check if a Conventional Commit commit message is breaking or not --- @param commit a commit message --- @return boolean true if the message is breaking, false if the commit message is not breaking -function git.is_breaking(commit) return vim.fn.match(commit, "\\[.*\\]\\s\\+\\w\\+\\((\\w\\+)\\)\\?!:") ~= -1 end - ---- Get a list of breaking commits from commit messages using Conventional Commit standard --- @param commits an array like table of commit messages --- @return an array like table of commits that are breaking -function git.breaking_changes(commits) return vim.tbl_filter(git.is_breaking, commits) end - ---- Generate a table of commit messages for neovim's echo API with highlighting --- @param commits an array like table of commit messages --- @return an array like table of echo messages to provide to nvim_echo or astronvim.echo -function git.pretty_changelog(commits) - local changelog = {} - for _, commit in ipairs(commits) do - local hash, type, msg = commit:match "(%[.*%])(.*:)(.*)" - if hash and type and msg then - vim.list_extend( - changelog, - { { hash, "DiffText" }, { type, git.is_breaking(commit) and "DiffDelete" or "DiffChange" }, { msg }, { "\n" } } - ) - end - end - return changelog -end - -return git diff --git a/dot_config/nvim/lua/core/utils/init.lua b/dot_config/nvim/lua/core/utils/init.lua deleted file mode 100644 index fe3121f..0000000 --- a/dot_config/nvim/lua/core/utils/init.lua +++ /dev/null @@ -1,542 +0,0 @@ ---- ### AstroNvim Utilities --- --- This module is automatically loaded by AstroNvim on during it's initialization into global variable `astronvim` --- --- This module can also be manually loaded with `local astronvim = require "core.utils"` --- --- @module core.utils --- @copyright 2022 --- @license GNU General Public License v3.0 - -_G.astronvim = {} -local stdpath = vim.fn.stdpath -local tbl_insert = table.insert -local map = vim.keymap.set - ---- installation details from external installers -astronvim.install = astronvim_installation or { home = stdpath "config" } ---- external astronvim configuration folder -astronvim.install.config = stdpath("config"):gsub("nvim$", "astronvim") -vim.opt.rtp:append(astronvim.install.config) -local supported_configs = { astronvim.install.home, astronvim.install.config } - ---- Looks to see if a module path references a lua file in a configuration folder and tries to load it. If there is an error loading the file, write an error and continue --- @param module the module path to try and load --- @return the loaded module if successful or nil -local function load_module_file(module) - -- placeholder for final return value - local found_module = nil - -- search through each of the supported configuration locations - for _, config_path in ipairs(supported_configs) do - -- convert the module path to a file path (example user.init -> user/init.lua) - local module_path = config_path .. "/lua/" .. module:gsub("%.", "/") .. ".lua" - -- check if there is a readable file, if so, set it as found - if vim.fn.filereadable(module_path) == 1 then found_module = module_path end - end - -- if we found a readable lua file, try to load it - if found_module then - -- try to load the file - local status_ok, loaded_module = pcall(require, module) - -- if successful at loading, set the return variable - if status_ok then - found_module = loaded_module - -- if unsuccessful, throw an error - else - vim.api.nvim_err_writeln("Error loading file: " .. found_module .. "\n\n" .. loaded_module) - end - end - -- return the loaded module or nil if no file found - return found_module -end - ---- user settings from the base `user/init.lua` file -astronvim.user_settings = load_module_file "user.init" ---- default packer compilation location to be used in bootstrapping and packer setup call -astronvim.default_compile_path = stdpath "data" .. "/packer_compiled.lua" ---- table of user created terminals -astronvim.user_terminals = {} ---- table of plugins to load with git -astronvim.git_plugins = {} ---- table of plugins to load when file opened -astronvim.file_plugins = {} ---- regex used for matching a valid URL/URI string -astronvim.url_matcher = - "\\v\\c%(%(h?ttps?|ftp|file|ssh|git)://|[a-z]+[@][a-z]+[.][a-z]+:)%([&:#*@~%_\\-=?!+;/0-9a-z]+%(%([.;/?]|[.][.]+)[&:#*@~%_\\-=?!+/0-9a-z]+|:\\d+|,%(%(%(h?ttps?|ftp|file|ssh|git)://|[a-z]+[@][a-z]+[.][a-z]+:)@![0-9a-z]+))*|\\([&:#*@~%_\\-=?!+;/.0-9a-z]*\\)|\\[[&:#*@~%_\\-=?!+;/.0-9a-z]*\\]|\\{%([&:#*@~%_\\-=?!+;/.0-9a-z]*|\\{[&:#*@~%_\\-=?!+;/.0-9a-z]*})\\})+" - ---- Main configuration engine logic for extending a default configuration table with either a function override or a table to merge into the default option --- @function astronvim.func_or_extend --- @param overrides the override definition, either a table or a function that takes a single parameter of the original table --- @param default the default configuration table --- @param extend boolean value to either extend the default or simply overwrite it if an override is provided --- @return the new configuration table -local function func_or_extend(overrides, default, extend) - -- if we want to extend the default with the provided override - if extend then - -- if the override is a table, use vim.tbl_deep_extend - if type(overrides) == "table" then - default = astronvim.default_tbl(overrides, default) - -- if the override is a function, call it with the default and overwrite default with the return value - elseif type(overrides) == "function" then - default = overrides(default) - end - -- if extend is set to false and we have a provided override, simply override the default - elseif overrides ~= nil then - default = overrides - end - -- return the modified default table - return default -end - ---- Merge extended options with a default table of options --- @param opts the new options that should be merged with the default table --- @param default the default table that you want to merge into --- @return the merged table -function astronvim.default_tbl(opts, default) - opts = opts or {} - return default and vim.tbl_deep_extend("force", default, opts) or opts -end - ---- Call function if a condition is met --- @param func the function to run --- @param condition a boolean value of whether to run the function or not -function astronvim.conditional_func(func, condition, ...) - -- if the condition is true or no condition is provided, evaluate the function with the rest of the parameters and return the result - if (condition == nil or condition) and type(func) == "function" then return func(...) end -end - ---- Get highlight properties for a given highlight name --- @param name highlight group name --- @return table of highlight group properties -function astronvim.get_hlgroup(name, fallback) - if vim.fn.hlexists(name) == 1 then - local hl = vim.api.nvim_get_hl_by_name(name, vim.o.termguicolors) - local old_true_val = hl[true] - hl[true] = nil - if not vim.tbl_isempty(hl) then - hl[true] = old_true_val - if not hl["foreground"] then hl["foreground"] = "NONE" end - if not hl["background"] then hl["background"] = "NONE" end - hl.fg, hl.bg, hl.sp = hl.foreground, hl.background, hl.special - hl.ctermfg, hl.ctermbg = hl.foreground, hl.background - return hl - end - end - return fallback -end - ---- Trim a string or return nil --- @param str the string to trim --- @return a trimmed version of the string or nil if the parameter isn't a string -function astronvim.trim_or_nil(str) return type(str) == "string" and vim.trim(str) or nil end - ---- Add left and/or right padding to a string --- @param str the string to add padding to --- @param padding a table of the format `{ left = 0, right = 0}` that defines the number of spaces to include to the left and the right of the string --- @return the padded string -function astronvim.pad_string(str, padding) - padding = padding or {} - return str and str ~= "" and string.rep(" ", padding.left or 0) .. str .. string.rep(" ", padding.right or 0) or "" -end - ---- Initialize icons used throughout the user interface -function astronvim.initialize_icons() - astronvim.icons = astronvim.user_plugin_opts("icons", require "core.icons.nerd_font") - astronvim.text_icons = astronvim.user_plugin_opts("text_icons", require "core.icons.text") -end - ---- Get an icon from `lspkind` if it is available and return it --- @param kind the kind of icon in `lspkind` to retrieve --- @return the icon -function astronvim.get_icon(kind) - local icon_pack = vim.g.icons_enabled and "icons" or "text_icons" - if not astronvim[icon_pack] then astronvim.initialize_icons() end - return astronvim[icon_pack] and astronvim[icon_pack][kind] or "" -end - ---- Serve a notification with a title of AstroNvim --- @param msg the notification body --- @param type the type of the notification (:help vim.log.levels) --- @param opts table of nvim-notify options to use (:help notify-options) -function astronvim.notify(msg, type, opts) - vim.schedule(function() vim.notify(msg, type, astronvim.default_tbl(opts, { title = "AstroNvim" })) end) -end - ---- Trigger an AstroNvim user event --- @param event the event name to be appended to Astro -function astronvim.event(event) - vim.schedule(function() vim.api.nvim_exec_autocmds("User", { pattern = "Astro" .. event }) end) -end - ---- Wrapper function for neovim echo API --- @param messages an array like table where each item is an array like table of strings to echo -function astronvim.echo(messages) - -- if no parameter provided, echo a new line - messages = messages or { { "\n" } } - if type(messages) == "table" then vim.api.nvim_echo(messages, false, {}) end -end - ---- Echo a message and prompt the user for yes or no response --- @param messages the message to echo --- @return True if the user responded y, False for any other response -function astronvim.confirm_prompt(messages) - if messages then astronvim.echo(messages) end - local confirmed = string.lower(vim.fn.input "(y/n) ") == "y" - astronvim.echo() - astronvim.echo() - return confirmed -end - ---- Search the user settings (user/init.lua table) for a table with a module like path string --- @param module the module path like string to look up in the user settings table --- @return the value of the table entry if exists or nil -local function user_setting_table(module) - -- get the user settings table - local settings = astronvim.user_settings or {} - -- iterate over the path string split by '.' to look up the table value - for tbl in string.gmatch(module, "([^%.]+)") do - settings = settings[tbl] - -- if key doesn't exist, keep the nil value and stop searching - if settings == nil then break end - end - -- return the found settings - return settings -end - ---- Check if packer is installed and loadable, if not then install it and make sure it loads -function astronvim.initialize_packer() - -- try loading packer - local packer_path = stdpath "data" .. "/site/pack/packer/opt/packer.nvim" - local packer_avail = vim.fn.empty(vim.fn.glob(packer_path)) == 0 - -- if packer isn't availble, reinstall it - if not packer_avail then - -- set the location to install packer - -- delete the old packer install if one exists - vim.fn.delete(packer_path, "rf") - -- clone packer - vim.fn.system { - "git", - "clone", - "--depth", - "1", - "https://github.com/wbthomason/packer.nvim", - packer_path, - } - -- add packer and try loading it - vim.cmd.packadd "packer.nvim" - local packer_loaded, _ = pcall(require, "packer") - packer_avail = packer_loaded - -- if packer didn't load, print error - if not packer_avail then vim.api.nvim_err_writeln("Failed to load packer at:" .. packer_path) end - end - -- if packer is available, check if there is a compiled packer file - if packer_avail then - -- try to load the packer compiled file - local run_me, _ = loadfile( - astronvim.user_plugin_opts("plugins.packer", { compile_path = astronvim.default_compile_path }).compile_path - ) - if run_me then - -- if the file loads, run the compiled function - run_me() - else - -- if there is no compiled file, ask user to sync packer - require "core.plugins" - vim.api.nvim_create_autocmd("User", { - once = true, - pattern = "PackerComplete", - callback = function() - vim.cmd.bw() - vim.tbl_map(require, { "nvim-treesitter", "mason" }) - astronvim.notify "Mason is installing packages if configured, check status with :Mason" - end, - }) - vim.opt.cmdheight = 1 - vim.notify "Please wait while plugins are installed..." - vim.cmd.PackerSync() - end - end -end - -function astronvim.lazy_load_commands(plugin, commands) - if type(commands) == "string" then commands = { commands } end - if astronvim.is_available(plugin) and not packer_plugins[plugin].loaded then - for _, command in ipairs(commands) do - pcall( - vim.cmd, - string.format( - 'command -nargs=* -range -bang -complete=file %s lua require("packer.load")({"%s"}, { cmd = "%s", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)', - command, - plugin, - command - ) - ) - end - end -end - ---- Set vim options with a nested table like API with the format vim... --- @param options the nested table of vim options -function astronvim.vim_opts(options) - for scope, table in pairs(options) do - for setting, value in pairs(table) do - vim[scope][setting] = value - end - end -end - ---- User configuration entry point to override the default options of a configuration table with a user configuration file or table in the user/init.lua user settings --- @param module the module path of the override setting --- @param default the default settings that will be overridden --- @param extend boolean value to either extend the default settings or overwrite them with the user settings entirely (default: true) --- @param prefix a module prefix for where to search (default: user) --- @return the new configuration settings with the user overrides applied -function astronvim.user_plugin_opts(module, default, extend, prefix) - -- default to extend = true - if extend == nil then extend = true end - -- if no default table is provided set it to an empty table - default = default or {} - -- try to load a module file if it exists - local user_settings = load_module_file((prefix or "user") .. "." .. module) - -- if no user module file is found, try to load an override from the user settings table from user/init.lua - if user_settings == nil and prefix == nil then user_settings = user_setting_table(module) end - -- if a user override was found call the configuration engine - if user_settings ~= nil then default = func_or_extend(user_settings, default, extend) end - -- return the final configuration table with any overrides applied - return default -end - ---- Open a URL under the cursor with the current operating system (Supports Mac OS X and *nix) --- @param path the path of the file to open with the system opener -function astronvim.system_open(path) - path = path or vim.fn.expand "" - if vim.fn.has "mac" == 1 then - -- if mac use the open command - vim.fn.jobstart({ "open", path }, { detach = true }) - elseif vim.fn.has "unix" == 1 then - -- if unix then use xdg-open - vim.fn.jobstart({ "xdg-open", path }, { detach = true }) - else - -- if any other operating system notify the user that there is currently no support - astronvim.notify("System open is not supported on this OS!", "error") - end -end - --- term_details can be either a string for just a command or --- a complete table to provide full access to configuration when calling Terminal:new() - ---- Toggle a user terminal if it exists, if not then create a new one and save it --- @param term_details a terminal command string or a table of options for Terminal:new() (Check toggleterm.nvim documentation for table format) -function astronvim.toggle_term_cmd(opts) - local terms = astronvim.user_terminals - -- if a command string is provided, create a basic table for Terminal:new() options - if type(opts) == "string" then opts = { cmd = opts, hidden = true } end - local num = vim.v.count > 0 and vim.v.count or 1 - -- if terminal doesn't exist yet, create it - if not terms[opts.cmd] then terms[opts.cmd] = {} end - if not terms[opts.cmd][num] then - if not opts.count then opts.count = vim.tbl_count(terms) * 100 + num end - terms[opts.cmd][num] = require("toggleterm.terminal").Terminal:new(opts) - end - -- toggle the terminal - astronvim.user_terminals[opts.cmd][num]:toggle() -end - ---- Add a source to cmp --- @param source the cmp source string or table to add (see cmp documentation for source table format) -function astronvim.add_cmp_source(source) - -- load cmp if available - local cmp_avail, cmp = pcall(require, "cmp") - if cmp_avail then - -- get the current cmp config - local config = cmp.get_config() - -- add the source to the list of sources - tbl_insert(config.sources, source) - -- call the setup function again - cmp.setup(config) - end -end - ---- Get the priority of a cmp source --- @param source the cmp source string or table (see cmp documentation for source table format) --- @return a cmp source table with the priority set from the user configuration -function astronvim.get_user_cmp_source(source) - -- if the source is a string, convert it to a cmp source table - source = type(source) == "string" and { name = source } or source - -- get the priority of the source name from the user configuration - local priority = astronvim.user_plugin_opts("cmp.source_priority", { - nvim_lsp = 1000, - luasnip = 750, - buffer = 500, - path = 250, - })[source.name] - -- if a priority is found, set it in the source - if priority then source.priority = priority end - -- return the source table - return source -end - ---- add a source to cmp with the user configured priority --- @param source a cmp source string or table (see cmp documentation for source table format) -function astronvim.add_user_cmp_source(source) astronvim.add_cmp_source(astronvim.get_user_cmp_source(source)) end - ---- register mappings table with which-key --- @param mappings nested table of mappings where the first key is the mode, the second key is the prefix, and the value is the mapping table for which-key --- @param opts table of which-key options when setting the mappings (see which-key documentation for possible values) -function astronvim.which_key_register(mappings, opts) - local status_ok, which_key = pcall(require, "which-key") - if not status_ok then return end - for mode, prefixes in pairs(mappings) do - for prefix, mapping_table in pairs(prefixes) do - which_key.register( - mapping_table, - astronvim.default_tbl(opts, { - mode = mode, - prefix = prefix, - buffer = nil, - silent = true, - noremap = true, - nowait = true, - }) - ) - end - end -end - ---- Get a list of registered null-ls providers for a given filetype --- @param filetype the filetype to search null-ls for --- @return a list of null-ls sources -function astronvim.null_ls_providers(filetype) - local registered = {} - -- try to load null-ls - local sources_avail, sources = pcall(require, "null-ls.sources") - if sources_avail then - -- get the available sources of a given filetype - for _, source in ipairs(sources.get_available(filetype)) do - -- get each source name - for method in pairs(source.methods) do - registered[method] = registered[method] or {} - tbl_insert(registered[method], source.name) - end - end - end - -- return the found null-ls sources - return registered -end - ---- Get the null-ls sources for a given null-ls method --- @param filetype the filetype to search null-ls for --- @param method the null-ls method (check null-ls documentation for available methods) --- @return the available sources for the given filetype and method -function astronvim.null_ls_sources(filetype, method) - local methods_avail, methods = pcall(require, "null-ls.methods") - return methods_avail and astronvim.null_ls_providers(filetype)[methods.internal[method]] or {} -end - ---- Create a button entity to use with the alpha dashboard --- @param sc the keybinding string to convert to a button --- @param txt the explanation text of what the keybinding does --- @return a button entity table for an alpha configuration -function astronvim.alpha_button(sc, txt) - -- replace in shortcut text with LDR for nicer printing - local sc_ = sc:gsub("%s", ""):gsub("LDR", "") - -- if the leader is set, replace the text with the actual leader key for nicer printing - if vim.g.mapleader then sc = sc:gsub("LDR", vim.g.mapleader == " " and "SPC" or vim.g.mapleader) end - -- return the button entity to display the correct text and send the correct keybinding on press - return { - type = "button", - val = txt, - on_press = function() - local key = vim.api.nvim_replace_termcodes(sc_, true, false, true) - vim.api.nvim_feedkeys(key, "normal", false) - end, - opts = { - position = "center", - text = txt, - shortcut = sc, - cursor = 5, - width = 36, - align_shortcut = "right", - hl = "DashboardCenter", - hl_shortcut = "DashboardShortcut", - }, - } -end - ---- Check if a plugin is defined in packer. Useful with lazy loading when a plugin is not necessarily loaded yet --- @param plugin the plugin string to search for --- @return boolean value if the plugin is available -function astronvim.is_available(plugin) return packer_plugins ~= nil and packer_plugins[plugin] ~= nil end - ---- A helper function to wrap a module function to require a plugin before running --- @param plugin the plugin string to call `require("packer").laoder` with --- @param module the system module where the functions live (e.g. `vim.ui`) --- @param func_names a string or a list like table of strings for functions to wrap in the given moduel (e.g. `{ "ui", "select }`) -function astronvim.load_plugin_with_func(plugin, module, func_names) - if type(func_names) == "string" then func_names = { func_names } end - for _, func in ipairs(func_names) do - local old_func = module[func] - module[func] = function(...) - module[func] = old_func - require("packer").loader(plugin) - module[func](...) - end - end -end - ---- Table based API for setting keybindings --- @param map_table A nested table where the first key is the vim mode, the second key is the key to map, and the value is the function to set the mapping to --- @param base A base set of options to set on every keybinding -function astronvim.set_mappings(map_table, base) - -- iterate over the first keys for each mode - for mode, maps in pairs(map_table) do - -- iterate over each keybinding set in the current mode - for keymap, options in pairs(maps) do - -- build the options for the command accordingly - if options then - local cmd = options - local keymap_opts = base or {} - if type(options) == "table" then - cmd = options[1] - keymap_opts = vim.tbl_deep_extend("force", options, keymap_opts) - keymap_opts[1] = nil - end - -- extend the keybinding options with the base provided and set the mapping - map(mode, keymap, cmd, keymap_opts) - end - end - end -end - ---- Delete the syntax matching rules for URLs/URIs if set -function astronvim.delete_url_match() - for _, match in ipairs(vim.fn.getmatches()) do - if match.group == "HighlightURL" then vim.fn.matchdelete(match.id) end - end -end - ---- Add syntax matching rules for highlighting URLs/URIs -function astronvim.set_url_match() - astronvim.delete_url_match() - if vim.g.highlighturl_enabled then vim.fn.matchadd("HighlightURL", astronvim.url_matcher, 15) end -end - ---- Run a shell command and capture the output and if the command succeeded or failed --- @param cmd the terminal command to execute --- @param show_error boolean of whether or not to show an unsuccessful command as an error to the user --- @return the result of a successfully executed command or nil -function astronvim.cmd(cmd, show_error) - if vim.fn.has "win32" == 1 then cmd = { "cmd.exe", "/C", cmd } end - local result = vim.fn.system(cmd) - local success = vim.api.nvim_get_vvar "shell_error" == 0 - if not success and (show_error == nil and true or show_error) then - vim.api.nvim_err_writeln("Error running command: " .. cmd .. "\nError message:\n" .. result) - end - return success and result:gsub("[\27\155][][()#;?%d]*[A-PRZcf-ntqry=><~]", "") or nil -end - -require "core.utils.ui" -require "core.utils.status" -require "core.utils.updater" -require "core.utils.mason" -require "core.utils.lsp" - -return astronvim diff --git a/dot_config/nvim/lua/core/utils/lsp.lua b/dot_config/nvim/lua/core/utils/lsp.lua deleted file mode 100644 index e238178..0000000 --- a/dot_config/nvim/lua/core/utils/lsp.lua +++ /dev/null @@ -1,235 +0,0 @@ ---- ### AstroNvim LSP --- --- This module is automatically loaded by AstroNvim on during it's initialization into global variable `astronvim.lsp` --- --- This module can also be manually loaded with `local updater = require("core.utils").lsp` --- --- @module core.utils.lsp --- @see core.utils --- @copyright 2022 --- @license GNU General Public License v3.0 - -astronvim.lsp = {} -local tbl_contains = vim.tbl_contains -local tbl_isempty = vim.tbl_isempty -local user_plugin_opts = astronvim.user_plugin_opts -local conditional_func = astronvim.conditional_func -local is_available = astronvim.is_available -local user_registration = user_plugin_opts("lsp.server_registration", nil, false) -local skip_setup = user_plugin_opts "lsp.skip_setup" - -astronvim.lsp.formatting = - astronvim.user_plugin_opts("lsp.formatting", { format_on_save = { enabled = true }, disabled = {} }) -if type(astronvim.lsp.formatting.format_on_save) == "boolean" then - astronvim.lsp.formatting.format_on_save = { enabled = astronvim.lsp.formatting.format_on_save } -end - -astronvim.lsp.format_opts = vim.deepcopy(astronvim.lsp.formatting) -astronvim.lsp.format_opts.disabled = nil -astronvim.lsp.format_opts.format_on_save = nil -astronvim.lsp.format_opts.filter = function(client) - local filter = astronvim.lsp.formatting.filter - local disabled = astronvim.lsp.formatting.disabled or {} - -- check if client is fully disabled or filtered by function - return not (vim.tbl_contains(disabled, client.name) or (type(filter) == "function" and not filter(client))) -end - ---- Helper function to set up a given server with the Neovim LSP client --- @param server the name of the server to be setup -astronvim.lsp.setup = function(server) - if not tbl_contains(skip_setup, server) then - -- if server doesn't exist, set it up from user server definition - if not pcall(require, "lspconfig.server_configurations." .. server) then - local server_definition = user_plugin_opts("lsp.server-settings." .. server) - if server_definition.cmd then require("lspconfig.configs")[server] = { default_config = server_definition } end - end - local opts = astronvim.lsp.server_settings(server) - if type(user_registration) == "function" then - user_registration(server, opts) - else - require("lspconfig")[server].setup(opts) - end - end -end - ---- The `on_attach` function used by AstroNvim --- @param client the LSP client details when attaching --- @param bufnr the number of the buffer that the LSP client is attaching to -astronvim.lsp.on_attach = function(client, bufnr) - local capabilities = client.server_capabilities - local lsp_mappings = { - n = { - ["ld"] = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" }, - ["[d"] = { function() vim.diagnostic.goto_prev() end, desc = "Previous diagnostic" }, - ["]d"] = { function() vim.diagnostic.goto_next() end, desc = "Next diagnostic" }, - ["gl"] = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" }, - }, - v = {}, - } - - if capabilities.codeActionProvider then - lsp_mappings.n["la"] = { function() vim.lsp.buf.code_action() end, desc = "LSP code action" } - lsp_mappings.v["la"] = lsp_mappings.n["la"] - end - - if capabilities.codeLensProvider then - lsp_mappings.n["ll"] = { function() vim.lsp.codelens.refresh() end, desc = "LSP codelens refresh" } - lsp_mappings.n["lL"] = { function() vim.lsp.codelens.run() end, desc = "LSP codelens run" } - end - - if capabilities.declarationProvider then - lsp_mappings.n["gD"] = { function() vim.lsp.buf.declaration() end, desc = "Declaration of current symbol" } - end - - if capabilities.definitionProvider then - lsp_mappings.n["gd"] = { function() vim.lsp.buf.definition() end, desc = "Show the definition of current symbol" } - end - - if capabilities.documentFormattingProvider and not tbl_contains(astronvim.lsp.formatting.disabled, client.name) then - lsp_mappings.n["lf"] = { - function() vim.lsp.buf.format(astronvim.lsp.format_opts) end, - desc = "Format code", - } - lsp_mappings.v["lf"] = lsp_mappings.n["lf"] - - vim.api.nvim_buf_create_user_command( - bufnr, - "Format", - function() vim.lsp.buf.format(astronvim.lsp.format_opts) end, - { desc = "Format file with LSP" } - ) - local autoformat = astronvim.lsp.formatting.format_on_save - local filetype = vim.api.nvim_buf_get_option(bufnr, "filetype") - if - autoformat.enabled - and (tbl_isempty(autoformat.allow_filetypes or {}) or tbl_contains(autoformat.allow_filetypes, filetype)) - and (tbl_isempty(autoformat.ignore_filetypes or {}) or not tbl_contains(autoformat.ignore_filetypes, filetype)) - then - local autocmd_group = "auto_format_" .. bufnr - vim.api.nvim_create_augroup(autocmd_group, { clear = true }) - vim.api.nvim_create_autocmd("BufWritePre", { - group = autocmd_group, - buffer = bufnr, - desc = "Auto format buffer " .. bufnr .. " before save", - callback = function() - if vim.g.autoformat_enabled then - vim.lsp.buf.format(astronvim.default_tbl({ bufnr = bufnr }, astronvim.lsp.format_opts)) - end - end, - }) - lsp_mappings.n["uf"] = { - function() astronvim.ui.toggle_autoformat() end, - desc = "Toggle autoformatting", - } - end - end - - if capabilities.documentHighlightProvider then - local highlight_name = vim.fn.printf("lsp_document_highlight_%d", bufnr) - vim.api.nvim_create_augroup(highlight_name, {}) - vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { - group = highlight_name, - buffer = bufnr, - callback = function() vim.lsp.buf.document_highlight() end, - }) - vim.api.nvim_create_autocmd("CursorMoved", { - group = highlight_name, - buffer = bufnr, - callback = function() vim.lsp.buf.clear_references() end, - }) - end - - if capabilities.hoverProvider then - lsp_mappings.n["K"] = { function() vim.lsp.buf.hover() end, desc = "Hover symbol details" } - end - - if capabilities.implementationProvider then - lsp_mappings.n["gI"] = { function() vim.lsp.buf.implementation() end, desc = "Implementation of current symbol" } - end - - if capabilities.referencesProvider then - lsp_mappings.n["gr"] = { function() vim.lsp.buf.references() end, desc = "References of current symbol" } - lsp_mappings.n["lR"] = { function() vim.lsp.buf.references() end, desc = "Search references" } - end - - if capabilities.renameProvider then - lsp_mappings.n["lr"] = { function() vim.lsp.buf.rename() end, desc = "Rename current symbol" } - end - - if capabilities.signatureHelpProvider then - lsp_mappings.n["lh"] = { function() vim.lsp.buf.signature_help() end, desc = "Signature help" } - end - - if capabilities.typeDefinitionProvider then - lsp_mappings.n["gT"] = { function() vim.lsp.buf.type_definition() end, desc = "Definition of current type" } - end - - if capabilities.workspaceSymbolProvider then - lsp_mappings.n["lG"] = { function() vim.lsp.buf.workspace_symbol() end, desc = "Search workspace symbols" } - end - - if is_available "telescope.nvim" then -- setup telescope mappings if available - if lsp_mappings.n.gd then lsp_mappings.n.gd[1] = function() require("telescope.builtin").lsp_definitions() end end - if lsp_mappings.n.gI then - lsp_mappings.n.gI[1] = function() require("telescope.builtin").lsp_implementations() end - end - if lsp_mappings.n.gr then lsp_mappings.n.gr[1] = function() require("telescope.builtin").lsp_references() end end - if lsp_mappings.n["lR"] then - lsp_mappings.n["lR"][1] = function() require("telescope.builtin").lsp_references() end - end - if lsp_mappings.n.gT then - lsp_mappings.n.gT[1] = function() require("telescope.builtin").lsp_type_definitions() end - end - if lsp_mappings.n["lG"] then - lsp_mappings.n["lG"][1] = function() require("telescope.builtin").lsp_workspace_symbols() end - end - end - - astronvim.set_mappings(user_plugin_opts("lsp.mappings", lsp_mappings), { buffer = bufnr }) - if not vim.tbl_isempty(lsp_mappings.v) then - astronvim.which_key_register({ v = { [""] = { l = { name = "LSP" } } } }, { buffer = bufnr }) - end - - local on_attach_override = user_plugin_opts("lsp.on_attach", nil, false) - conditional_func(on_attach_override, true, client, bufnr) -end - ---- The default AstroNvim LSP capabilities -astronvim.lsp.capabilities = vim.lsp.protocol.make_client_capabilities() -astronvim.lsp.capabilities.textDocument.completion.completionItem.documentationFormat = { "markdown", "plaintext" } -astronvim.lsp.capabilities.textDocument.completion.completionItem.snippetSupport = true -astronvim.lsp.capabilities.textDocument.completion.completionItem.preselectSupport = true -astronvim.lsp.capabilities.textDocument.completion.completionItem.insertReplaceSupport = true -astronvim.lsp.capabilities.textDocument.completion.completionItem.labelDetailsSupport = true -astronvim.lsp.capabilities.textDocument.completion.completionItem.deprecatedSupport = true -astronvim.lsp.capabilities.textDocument.completion.completionItem.commitCharactersSupport = true -astronvim.lsp.capabilities.textDocument.completion.completionItem.tagSupport = { valueSet = { 1 } } -astronvim.lsp.capabilities.textDocument.completion.completionItem.resolveSupport = { - properties = { "documentation", "detail", "additionalTextEdits" }, -} -astronvim.lsp.capabilities = user_plugin_opts("lsp.capabilities", astronvim.lsp.capabilities) -astronvim.lsp.flags = user_plugin_opts "lsp.flags" - ---- Get the server settings for a given language server to be provided to the server's `setup()` call --- @param server_name the name of the server --- @return the table of LSP options used when setting up the given language server -function astronvim.lsp.server_settings(server_name) - local server = require("lspconfig")[server_name] - local opts = user_plugin_opts( -- get user server-settings - "lsp.server-settings." .. server_name, -- TODO: RENAME lsp.server-settings to lsp.config in v3 - user_plugin_opts("server-settings." .. server_name, { -- get default server-settings - capabilities = vim.tbl_deep_extend("force", astronvim.lsp.capabilities, server.capabilities or {}), - flags = vim.tbl_deep_extend("force", astronvim.lsp.flags, server.flags or {}), - }, true, "configs") - ) - local old_on_attach = server.on_attach - local user_on_attach = opts.on_attach - opts.on_attach = function(client, bufnr) - conditional_func(old_on_attach, true, client, bufnr) - astronvim.lsp.on_attach(client, bufnr) - conditional_func(user_on_attach, true, client, bufnr) - end - return opts -end - -return astronvim.lsp diff --git a/dot_config/nvim/lua/core/utils/status.lua b/dot_config/nvim/lua/core/utils/status.lua deleted file mode 100644 index 1b64238..0000000 --- a/dot_config/nvim/lua/core/utils/status.lua +++ /dev/null @@ -1,1090 +0,0 @@ ---- ### AstroNvim Status --- --- This module is automatically loaded by AstroNvim on during it's initialization into global variable `astronvim.status` --- --- This module can also be manually loaded with `local status = require "core.utils.status"` --- --- @module core.utils.status --- @copyright 2022 --- @license GNU General Public License v3.0 -astronvim.status = { hl = {}, init = {}, provider = {}, condition = {}, component = {}, utils = {}, env = {} } - -astronvim.status.env.modes = { - ["n"] = { "NORMAL", "normal" }, - ["no"] = { "OP", "normal" }, - ["nov"] = { "OP", "normal" }, - ["noV"] = { "OP", "normal" }, - ["no"] = { "OP", "normal" }, - ["niI"] = { "NORMAL", "normal" }, - ["niR"] = { "NORMAL", "normal" }, - ["niV"] = { "NORMAL", "normal" }, - ["i"] = { "INSERT", "insert" }, - ["ic"] = { "INSERT", "insert" }, - ["ix"] = { "INSERT", "insert" }, - ["t"] = { "TERM", "terminal" }, - ["nt"] = { "TERM", "terminal" }, - ["v"] = { "VISUAL", "visual" }, - ["vs"] = { "VISUAL", "visual" }, - ["V"] = { "LINES", "visual" }, - ["Vs"] = { "LINES", "visual" }, - [""] = { "BLOCK", "visual" }, - ["s"] = { "BLOCK", "visual" }, - ["R"] = { "REPLACE", "replace" }, - ["Rc"] = { "REPLACE", "replace" }, - ["Rx"] = { "REPLACE", "replace" }, - ["Rv"] = { "V-REPLACE", "replace" }, - ["s"] = { "SELECT", "visual" }, - ["S"] = { "SELECT", "visual" }, - [""] = { "BLOCK", "visual" }, - ["c"] = { "COMMAND", "command" }, - ["cv"] = { "COMMAND", "command" }, - ["ce"] = { "COMMAND", "command" }, - ["r"] = { "PROMPT", "inactive" }, - ["rm"] = { "MORE", "inactive" }, - ["r?"] = { "CONFIRM", "inactive" }, - ["!"] = { "SHELL", "inactive" }, - ["null"] = { "null", "inactive" }, -} - -local function pattern_match(str, pattern_list) - for _, pattern in ipairs(pattern_list) do - if str:find(pattern) then return true end - end - return false -end - -astronvim.status.env.buf_matchers = { - filetype = function(pattern_list) return pattern_match(vim.bo.filetype, pattern_list) end, - buftype = function(pattern_list) return pattern_match(vim.bo.buftype, pattern_list) end, - bufname = function(pattern_list) return pattern_match(vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ":t"), pattern_list) end, -} - -astronvim.status.env.separators = astronvim.user_plugin_opts("heirline.separators", { - none = { "", "" }, - left = { "", " " }, - right = { " ", "" }, - center = { " ", " " }, - tab = { "", "" }, -}) - ---- Get the highlight background color of the lualine theme for the current colorscheme --- @param mode the neovim mode to get the color of --- @param fallback the color to fallback on if a lualine theme is not present --- @return The background color of the lualine theme or the fallback parameter if one doesn't exist -function astronvim.status.hl.lualine_mode(mode, fallback) - local lualine_avail, lualine = pcall(require, "lualine.themes." .. (vim.g.colors_name or "default_theme")) - local lualine_opts = lualine_avail and lualine[mode] - return lualine_opts and type(lualine_opts.a) == "table" and lualine_opts.a.bg or fallback -end - ---- Get the highlight for the current mode --- @return the highlight group for the current mode --- @usage local heirline_component = { provider = "Example Provider", hl = astronvim.status.hl.mode }, -function astronvim.status.hl.mode() return { bg = astronvim.status.hl.mode_bg() } end - ---- Get the foreground color group for the current mode, good for usage with Heirline surround utility --- @return the highlight group for the current mode foreground --- @usage local heirline_component = require("heirline.utils").surround({ "|", "|" }, astronvim.status.hl.mode_bg, heirline_component), - -function astronvim.status.hl.mode_bg() return astronvim.status.env.modes[vim.fn.mode()][2] end - ---- Get the foreground color group for the current filetype --- @return the highlight group for the current filetype foreground --- @usage local heirline_component = { provider = astronvim.status.provider.fileicon(), hl = astronvim.status.hl.filetype_color }, -function astronvim.status.hl.filetype_color(self) - local devicons_avail, devicons = pcall(require, "nvim-web-devicons") - if not devicons_avail then return {} end - local _, color = devicons.get_icon_color( - vim.fn.fnamemodify(vim.api.nvim_buf_get_name(self and self.bufnr or 0), ":t"), - nil, - { default = true } - ) - return { fg = color } -end - ---- An `init` function to build a set of children components for LSP breadcrumbs --- @param opts options for configuring the breadcrumbs (default: `{ separator = " > ", icon = { enabled = true, hl = false }, padding = { left = 0, right = 0 } }`) --- @return The Heirline init function --- @usage local heirline_component = { init = astronvim.status.init.breadcrumbs { padding = { left = 1 } } } -function astronvim.status.init.breadcrumbs(opts) - opts = astronvim.default_tbl( - opts, - { separator = " > ", icon = { enabled = true, hl = false }, padding = { left = 0, right = 0 } } - ) - return function(self) - local data = require("aerial").get_location(true) or {} - local children = {} - -- create a child for each level - for i, d in ipairs(data) do - local pos = astronvim.status.utils.encode_pos(d.lnum, d.col, self.winnr) - local child = { - { provider = string.gsub(d.name, "%%", "%%%%"):gsub("%s*->%s*", "") }, -- add symbol name - on_click = { -- add on click function - minwid = pos, - callback = function(_, minwid) - local lnum, col, winnr = astronvim.status.utils.decode_pos(minwid) - vim.api.nvim_win_set_cursor(vim.fn.win_getid(winnr), { lnum, col }) - end, - name = "heirline_breadcrumbs", - }, - } - if opts.icon.enabled then -- add icon and highlight if enabled - table.insert(child, 1, { - provider = string.format("%s ", d.icon), - hl = opts.icon.hl and string.format("Aerial%sIcon", d.kind) or nil, - }) - end - if #data > 1 and i < #data then table.insert(child, { provider = opts.separator }) end -- add a separator only if needed - table.insert(children, child) - end - if opts.padding.left > 0 then -- add left padding - table.insert(children, 1, { provider = astronvim.pad_string(" ", { left = opts.padding.left - 1 }) }) - end - if opts.padding.right > 0 then -- add right padding - table.insert(children, { provider = astronvim.pad_string(" ", { right = opts.padding.right - 1 }) }) - end - -- instantiate the new child - self[1] = self:new(children, 1) - end -end - ---- An `init` function to build multiple update events which is not supported yet by Heirline's update field --- @param opts an array like table of autocmd events as either just a string or a table with custom patterns and callbacks. --- @return The Heirline init function --- @usage local heirline_component = { init = astronvim.status.init.update_events { "BufEnter", { "User", pattern = "LspProgressUpdate" } } } -function astronvim.status.init.update_events(opts) - return function(self) - if not rawget(self, "once") then - local clear_cache = function() self._win_cache = nil end - for _, event in ipairs(opts) do - local event_opts = { callback = clear_cache } - if type(event) == "table" then - event_opts.pattern = event.pattern - event_opts.callback = event.callback or clear_cache - event.pattern = nil - event.callback = nil - end - vim.api.nvim_create_autocmd(event, event_opts) - end - self.once = true - end - end -end - ---- A provider function for the fill string --- @return the statusline string for filling the empty space --- @usage local heirline_component = { provider = astronvim.status.provider.fill } -function astronvim.status.provider.fill() return "%=" end - ---- A provider function for showing if spellcheck is on --- @param opts options passed to the stylize function --- @return the function for outputting if spell is enabled --- @usage local heirline_component = { provider = astronvim.status.provider.spell() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.spell(opts) - opts = astronvim.default_tbl(opts, { str = "", icon = { kind = "Spellcheck" }, show_empty = true }) - return function() return astronvim.status.utils.stylize(vim.wo.spell and opts.str, opts) end -end - ---- A provider function for showing if paste is enabled --- @param opts options passed to the stylize function --- @return the function for outputting if paste is enabled - --- @usage local heirline_component = { provider = astronvim.status.provider.paste() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.paste(opts) - opts = astronvim.default_tbl(opts, { str = "", icon = { kind = "Paste" }, show_empty = true }) - return function() return astronvim.status.utils.stylize(vim.opt.paste:get() and opts.str, opts) end -end - ---- A provider function for displaying if a macro is currently being recorded --- @param opts a prefix before the recording register and options passed to the stylize function --- @return a function that returns a string of the current recording status --- @usage local heirline_component = { provider = astronvim.status.provider.macro_recording() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.macro_recording(opts) - opts = astronvim.default_tbl(opts, { prefix = "@" }) - return function() - local register = vim.fn.reg_recording() - if register ~= "" then register = opts.prefix .. register end - return astronvim.status.utils.stylize(register, opts) - end -end - ---- A provider function for displaying the current search count --- @param opts options for `vim.fn.searchcount` and options passed to the stylize function --- @return a function that returns a string of the current search location --- @usage local heirline_component = { provider = astronvim.status.provider.search_count() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.search_count(opts) - local search_func = vim.tbl_isempty(opts or {}) and function() return vim.fn.searchcount() end - or function() return vim.fn.searchcount(opts) end - return function() - local search_ok, search = pcall(search_func) - if search_ok and type(search) == "table" and search.total then - return astronvim.status.utils.stylize( - string.format( - "%s%d/%s%d", - search.current > search.maxcount and ">" or "", - math.min(search.current, search.maxcount), - search.incomplete == 2 and ">" or "", - math.min(search.total, search.maxcount) - ), - opts - ) - end - end -end - ---- A provider function for showing the text of the current vim mode --- @param opts options for padding the text and options passed to the stylize function --- @return the function for displaying the text of the current vim mode --- @usage local heirline_component = { provider = astronvim.status.provider.mode_text() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.mode_text(opts) - local max_length = - math.max(unpack(vim.tbl_map(function(str) return #str[1] end, vim.tbl_values(astronvim.status.env.modes)))) - return function() - local text = astronvim.status.env.modes[vim.fn.mode()][1] - if opts.pad_text then - local padding = max_length - #text - if opts.pad_text == "right" then - text = string.rep(" ", padding) .. text - elseif opts.pad_text == "left" then - text = text .. string.rep(" ", padding) - elseif opts.pad_text == "center" then - text = string.rep(" ", math.floor(padding / 2)) .. text .. string.rep(" ", math.ceil(padding / 2)) - end - end - return astronvim.status.utils.stylize(text, opts) - end -end - ---- A provider function for showing the percentage of the current location in a document --- @param opts options for Top/Bot text, fixed width, and options passed to the stylize function --- @return the statusline string for displaying the percentage of current document location --- @usage local heirline_component = { provider = astronvim.status.provider.percentage() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.percentage(opts) - opts = astronvim.default_tbl(opts, { fixed_width = false, edge_text = true }) - return function() - local text = "%" .. (opts.fixed_width and "3" or "") .. "p%%" - if opts.edge_text then - local current_line = vim.fn.line "." - if current_line == 1 then - text = (opts.fixed_width and " " or "") .. "Top" - elseif current_line == vim.fn.line "$" then - text = (opts.fixed_width and " " or "") .. "Bot" - end - end - return astronvim.status.utils.stylize(text, opts) - end -end - ---- A provider function for showing the current line and character in a document --- @param opts options for padding the line and character locations and options passed to the stylize function --- @return the statusline string for showing location in document line_num:char_num --- @usage local heirline_component = { provider = astronvim.status.provider.ruler({ pad_ruler = { line = 3, char = 2 } }) } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.ruler(opts) - opts = astronvim.default_tbl(opts, { pad_ruler = { line = 0, char = 0 } }) - return astronvim.status.utils.stylize(string.format("%%%dl:%%%dc", opts.pad_ruler.line, opts.pad_ruler.char), opts) -end - ---- A provider function for showing the current location as a scrollbar --- @param opts options passed to the stylize function --- @return the function for outputting the scrollbar --- @usage local heirline_component = { provider = astronvim.status.provider.scrollbar() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.scrollbar(opts) - local sbar = { "▁", "▂", "▃", "▄", "▅", "▆", "▇", "█" } - return function() - local curr_line = vim.api.nvim_win_get_cursor(0)[1] - local lines = vim.api.nvim_buf_line_count(0) - local i = math.floor((curr_line - 1) / lines * #sbar) + 1 - return astronvim.status.utils.stylize(string.rep(sbar[i], 2), opts) - end -end - ---- A provider to simply show a cloes button icon --- @param opts options passed to the stylize function and the kind of icon to use --- @return return the stylized icon --- @usage local heirline_component = { provider = astronvim.status.provider.close_button() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.close_button(opts) - opts = astronvim.default_tbl(opts, { kind = "BufferClose" }) - return astronvim.status.utils.stylize(astronvim.get_icon(opts.kind), opts) -end - ---- A provider function for showing the current filetype --- @param opts options passed to the stylize function --- @return the function for outputting the filetype --- @usage local heirline_component = { provider = astronvim.status.provider.filetype() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.filetype(opts) - return function(self) - local buffer = vim.bo[self and self.bufnr or 0] - return astronvim.status.utils.stylize(string.lower(buffer.filetype), opts) - end -end - ---- A provider function for showing the current filename --- @param opts options for argument to fnamemodify to format filename and options passed to the stylize function --- @return the function for outputting the filename --- @usage local heirline_component = { provider = astronvim.status.provider.filename() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.filename(opts) - opts = astronvim.default_tbl( - opts, - { fallback = "[No Name]", fname = function(nr) return vim.api.nvim_buf_get_name(nr) end, modify = ":t" } - ) - return function(self) - local filename = vim.fn.fnamemodify(opts.fname(self and self.bufnr or 0), opts.modify) - return astronvim.status.utils.stylize((filename == "" and opts.fallback or filename), opts) - end -end - ---- Get a unique filepath between all buffers --- @param opts options for function to get the buffer name, a buffer number, max length, and options passed to the stylize function --- @return path to file that uniquely identifies each buffer --- @usage local heirline_component = { provider = astronvim.status.provider.unique_path() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.unique_path(opts) - opts = astronvim.default_tbl(opts, { - buf_name = function(bufnr) return vim.fn.fnamemodify(vim.api.nvim_buf_get_name(bufnr), ":t") end, - bufnr = 0, - max_length = 16, - }) - return function(self) - opts.bufnr = self and self.bufnr or opts.bufnr - local name = opts.buf_name(opts.bufnr) - local unique_path = "" - -- check for same buffer names under different dirs - for _, value in ipairs(astronvim.status.utils.get_valid_buffers()) do - if name == opts.buf_name(value) and value ~= opts.bufnr then - local other = {} - for match in (vim.api.nvim_buf_get_name(value) .. "/"):gmatch("(.-)" .. "/") do - table.insert(other, match) - end - - local current = {} - for match in (vim.api.nvim_buf_get_name(opts.bufnr) .. "/"):gmatch("(.-)" .. "/") do - table.insert(current, match) - end - - unique_path = "" - - for i = #current - 1, 1, -1 do - local value_current = current[i] - local other_current = other[i] - - if value_current ~= other_current then - unique_path = value_current .. "/" - break - end - end - break - end - end - return astronvim.status.utils.stylize( - ( - opts.max_length > 0 - and #unique_path > opts.max_length - and string.sub(unique_path, 1, opts.max_length - 2) .. astronvim.get_icon "Ellipsis" .. "/" - ) or unique_path, - opts - ) - end -end - ---- A provider function for showing if the current file is modifiable --- @param opts options passed to the stylize function --- @return the function for outputting the indicator if the file is modified --- @usage local heirline_component = { provider = astronvim.status.provider.file_modified() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.file_modified(opts) - opts = astronvim.default_tbl(opts, { str = "", icon = { kind = "FileModified" }, show_empty = true }) - return function(self) - return astronvim.status.utils.stylize( - astronvim.status.condition.file_modified((self or {}).bufnr) and opts.str, - opts - ) - end -end - ---- A provider function for showing if the current file is read-only --- @param opts options passed to the stylize function --- @return the function for outputting the indicator if the file is read-only --- @usage local heirline_component = { provider = astronvim.status.provider.file_read_only() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.file_read_only(opts) - opts = astronvim.default_tbl(opts, { str = "", icon = { kind = "FileReadOnly" }, show_empty = true }) - return function(self) - return astronvim.status.utils.stylize( - astronvim.status.condition.file_read_only((self or {}).bufnr) and opts.str, - opts - ) - end -end - ---- A provider function for showing the current filetype icon --- @param opts options passed to the stylize function --- @return the function for outputting the filetype icon --- @usage local heirline_component = { provider = astronvim.status.provider.file_icon() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.file_icon(opts) - return function(self) - local devicons_avail, devicons = pcall(require, "nvim-web-devicons") - if not devicons_avail then return "" end - local ft_icon, _ = devicons.get_icon( - vim.fn.fnamemodify(vim.api.nvim_buf_get_name(self and self.bufnr or 0), ":t"), - nil, - { default = true } - ) - return astronvim.status.utils.stylize(ft_icon, opts) - end -end - ---- A provider function for showing the current git branch --- @param opts options passed to the stylize function --- @return the function for outputting the git branch --- @usage local heirline_component = { provider = astronvim.status.provider.git_branch() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.git_branch(opts) - return function(self) return astronvim.status.utils.stylize(vim.b[self and self.bufnr or 0].gitsigns_head or "", opts) end -end - ---- A provider function for showing the current git diff count of a specific type --- @param opts options for type of git diff and options passed to the stylize function --- @return the function for outputting the git diff --- @usage local heirline_component = { provider = astronvim.status.provider.git_diff({ type = "added" }) } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.git_diff(opts) - if not opts or not opts.type then return end - return function(self) - local status = vim.b[self and self.bufnr or 0].gitsigns_status_dict - return astronvim.status.utils.stylize( - status and status[opts.type] and status[opts.type] > 0 and tostring(status[opts.type]) or "", - opts - ) - end -end - ---- A provider function for showing the current diagnostic count of a specific severity --- @param opts options for severity of diagnostic and options passed to the stylize function --- @return the function for outputting the diagnostic count --- @usage local heirline_component = { provider = astronvim.status.provider.diagnostics({ severity = "ERROR" }) } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.diagnostics(opts) - if not opts or not opts.severity then return end - return function(self) - local bufnr = self and self.bufnr or 0 - local count = #vim.diagnostic.get(bufnr, opts.severity and { severity = vim.diagnostic.severity[opts.severity] }) - return astronvim.status.utils.stylize(count ~= 0 and tostring(count) or "", opts) - end -end - ---- A provider function for showing the current progress of loading language servers --- @param opts options passed to the stylize function --- @return the function for outputting the LSP progress --- @usage local heirline_component = { provider = astronvim.status.provider.lsp_progress() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.lsp_progress(opts) - return function() - local Lsp = vim.lsp.util.get_progress_messages()[1] - return astronvim.status.utils.stylize( - Lsp - and string.format( - " %%<%s %s %s (%s%%%%) ", - astronvim.get_icon("LSP" .. ((Lsp.percentage or 0) >= 70 and { "Loaded", "Loaded", "Loaded" } or { - "Loading1", - "Loading2", - "Loading3", - })[math.floor(vim.loop.hrtime() / 12e7) % 3 + 1]), - Lsp.title or "", - Lsp.message or "", - Lsp.percentage or 0 - ) - or "", - opts - ) - end -end - ---- A provider function for showing the connected LSP client names --- @param opts options for explanding null_ls clients, max width percentage, and options passed to the stylize function --- @return the function for outputting the LSP client names --- @usage local heirline_component = { provider = astronvim.status.provider.lsp_client_names({ expand_null_ls = true, truncate = 0.25 }) } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.lsp_client_names(opts) - opts = astronvim.default_tbl(opts, { expand_null_ls = true, truncate = 0.25 }) - return function(self) - local buf_client_names = {} - for _, client in pairs(vim.lsp.get_active_clients { bufnr = self and self.bufnr or 0 }) do - if client.name == "null-ls" and opts.expand_null_ls then - local null_ls_sources = {} - for _, type in ipairs { "FORMATTING", "DIAGNOSTICS" } do - for _, source in ipairs(astronvim.null_ls_sources(vim.bo.filetype, type)) do - null_ls_sources[source] = true - end - end - vim.list_extend(buf_client_names, vim.tbl_keys(null_ls_sources)) - else - table.insert(buf_client_names, client.name) - end - end - local str = table.concat(buf_client_names, ", ") - if type(opts.truncate) == "number" then - local max_width = math.floor(astronvim.status.utils.width() * opts.truncate) - if #str > max_width then str = string.sub(str, 0, max_width) .. "…" end - end - return astronvim.status.utils.stylize(str, opts) - end -end - ---- A provider function for showing if treesitter is connected --- @param opts options passed to the stylize function --- @return the function for outputting TS if treesitter is connected --- @usage local heirline_component = { provider = astronvim.status.provider.treesitter_status() } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.treesitter_status(opts) - return function() return astronvim.status.utils.stylize(require("nvim-treesitter.parser").has_parser() and "TS" or "", opts) end -end - ---- A provider function for displaying a single string --- @param opts options passed to the stylize function --- @return the stylized statusline string --- @usage local heirline_component = { provider = astronvim.status.provider.str({ str = "Hello" }) } --- @see astronvim.status.utils.stylize -function astronvim.status.provider.str(opts) - opts = astronvim.default_tbl(opts, { str = " " }) - return astronvim.status.utils.stylize(opts.str, opts) -end - ---- A condition function if the window is currently active --- @return boolean of wether or not the window is currently actie --- @usage local heirline_component = { provider = "Example Provider", condition = astronvim.status.condition.is_active } -function astronvim.status.condition.is_active() return vim.api.nvim_get_current_win() == tonumber(vim.g.actual_curwin) end - ---- A condition function if the buffer filetype,buftype,bufname match a pattern --- @return boolean of wether or not LSP is attached --- @usage local heirline_component = { provider = "Example Provider", condition = function() return astronvim.status.condition.buffer_matches { buftype = { "terminal" } } end } -function astronvim.status.condition.buffer_matches(patterns) - for kind, pattern_list in pairs(patterns) do - if astronvim.status.env.buf_matchers[kind](pattern_list) then return true end - end - return false -end - ---- A condition function if a macro is being recorded --- @return boolean of wether or not a macro is currently being recorded --- @usage local heirline_component = { provider = "Example Provider", condition = astronvim.status.condition.is_macro_recording } -function astronvim.status.condition.is_macro_recording() return vim.fn.reg_recording() ~= "" end - ---- A condition function if search is visible --- @return boolean of wether or not searching is currently visible --- @usage local heirline_component = { provider = "Example Provider", condition = astronvim.status.condition.is_hlsearch } -function astronvim.status.condition.is_hlsearch() return vim.v.hlsearch ~= 0 end - ---- A condition function if the current file is in a git repo --- @return boolean of wether or not the current file is in a git repo --- @usage local heirline_component = { provider = "Example Provider", condition = astronvim.status.condition.is_git_repo } -function astronvim.status.condition.is_git_repo() return vim.b.gitsigns_head or vim.b.gitsigns_status_dict end - ---- A condition function if there are any git changes --- @return boolean of wether or not there are any git changes --- @usage local heirline_component = { provider = "Example Provider", condition = astronvim.status.condition.git_changed } -function astronvim.status.condition.git_changed() - local git_status = vim.b.gitsigns_status_dict - return git_status and (git_status.added or 0) + (git_status.removed or 0) + (git_status.changed or 0) > 0 -end - ---- A condition function if the current buffer is modified --- @return boolean of wether or not the current buffer is modified --- @usage local heirline_component = { provider = "Example Provider", condition = astronvim.status.condition.file_modified } -function astronvim.status.condition.file_modified(bufnr) return vim.bo[bufnr or 0].modified end - ---- A condition function if the current buffer is read only --- @return boolean of wether or not the current buffer is read only or not modifiable --- @usage local heirline_component = { provider = "Example Provider", condition = astronvim.status.condition.file_read_only } -function astronvim.status.condition.file_read_only(bufnr) - local buffer = vim.bo[bufnr or 0] - return not buffer.modifiable or buffer.readonly -end - ---- A condition function if the current file has any diagnostics --- @return boolean of wether or not the current file has any diagnostics --- @usage local heirline_component = { provider = "Example Provider", condition = astronvim.status.condition.has_diagnostics } -function astronvim.status.condition.has_diagnostics() - return vim.g.status_diagnostics_enabled and #vim.diagnostic.get(0) > 0 -end - ---- A condition function if there is a defined filetype --- @return boolean of wether or not there is a filetype --- @usage local heirline_component = { provider = "Example Provider", condition = astronvim.status.condition.has_filetype } -function astronvim.status.condition.has_filetype() - return vim.fn.empty(vim.fn.expand "%:t") ~= 1 and vim.bo.filetype and vim.bo.filetype ~= "" -end - ---- A condition function if Aerial is available --- @return boolean of wether or not aerial plugin is installed --- @usage local heirline_component = { provider = "Example Provider", condition = astronvim.status.condition.aerial_available } --- function astronvim.status.condition.aerial_available() return astronvim.is_available "aerial.nvim" end -function astronvim.status.condition.aerial_available() return package.loaded["aerial"] end - ---- A condition function if LSP is attached --- @return boolean of wether or not LSP is attached --- @usage local heirline_component = { provider = "Example Provider", condition = astronvim.status.condition.lsp_attached } -function astronvim.status.condition.lsp_attached() return next(vim.lsp.buf_get_clients()) ~= nil end - ---- A condition function if treesitter is in use --- @return boolean of wether or not treesitter is active --- @usage local heirline_component = { provider = "Example Provider", condition = astronvim.status.condition.treesitter_available } -function astronvim.status.condition.treesitter_available() - return package.loaded["nvim-treesitter"] and require("nvim-treesitter.parsers").has_parser() -end - ---- A utility function to stylize a string with an icon from lspkind, separators, and left/right padding --- @param str the string to stylize --- @param opts options of `{ padding = { left = 0, right = 0 }, separator = { left = "|", right = "|" }, show_empty = false, icon = { kind = "NONE", padding = { left = 0, right = 0 } } }` --- @return the stylized string --- @usage local string = astronvim.status.utils.stylize("Hello", { padding = { left = 1, right = 1 }, icon = { kind = "String" } }) -function astronvim.status.utils.stylize(str, opts) - opts = astronvim.default_tbl(opts, { - padding = { left = 0, right = 0 }, - separator = { left = "", right = "" }, - show_empty = false, - icon = { kind = "NONE", padding = { left = 0, right = 0 } }, - }) - local icon = astronvim.pad_string(astronvim.get_icon(opts.icon.kind), opts.icon.padding) - return str - and (str ~= "" or opts.show_empty) - and opts.separator.left .. astronvim.pad_string(icon .. str, opts.padding) .. opts.separator.right - or "" -end - ---- A Heirline component for filling in the empty space of the bar --- @return The heirline component table --- @usage local heirline_component = astronvim.status.component.fill() -function astronvim.status.component.fill() return { provider = astronvim.status.provider.fill() } end - ---- A function to build a set of children components for an entire file information section --- @param opts options for configuring file_icon, filename, filetype, file_modified, file_read_only, and the overall padding --- @return The Heirline component table --- @usage local heirline_component = astronvim.status.component.file_info() -function astronvim.status.component.file_info(opts) - opts = astronvim.default_tbl(opts, { - file_icon = { hl = astronvim.status.hl.filetype_color, padding = { left = 1, right = 1 } }, - filename = {}, - file_modified = { padding = { left = 1 } }, - file_read_only = { padding = { left = 1 } }, - surround = { separator = "left", color = "file_info_bg", condition = astronvim.status.condition.has_filetype }, - hl = { fg = "file_info_fg" }, - }) - return astronvim.status.component.builder(astronvim.status.utils.setup_providers(opts, { - "file_icon", - "unique_path", - "filename", - "filetype", - "file_modified", - "file_read_only", - "close_button", - })) -end - ---- A function to build a set of children components for an entire navigation section --- @param opts options for configuring ruler, percentage, scrollbar, and the overall padding --- @return The Heirline component table --- @usage local heirline_component = astronvim.status.component.nav() -function astronvim.status.component.nav(opts) - opts = astronvim.default_tbl(opts, { - ruler = {}, - percentage = { padding = { left = 1 } }, - scrollbar = { padding = { left = 1 }, hl = { fg = "scrollbar" } }, - surround = { separator = "right", color = "nav_bg" }, - hl = { fg = "nav_fg" }, - update = { "CursorMoved", "BufEnter" }, - }) - return astronvim.status.component.builder( - astronvim.status.utils.setup_providers(opts, { "ruler", "percentage", "scrollbar" }) - ) -end - ---- A function to build a set of children components for a macro recording section --- @param opts options for configuring macro recording and the overall padding --- @return The Heirline component table --- @usage local heirline_component = astronvim.status.component.macro_recording() --- TODO: deprecate on next major version release -function astronvim.status.component.macro_recording(opts) - opts = astronvim.default_tbl(opts, { - macro_recording = { icon = { kind = "MacroRecording", padding = { right = 1 } } }, - surround = { - separator = "center", - color = "macro_recording_bg", - condition = astronvim.status.condition.is_macro_recording, - }, - hl = { fg = "macro_recording_fg", bold = true }, - update = { "RecordingEnter", "RecordingLeave" }, - }) - return astronvim.status.component.builder(astronvim.status.utils.setup_providers(opts, { "macro_recording" })) -end - ---- A function to build a set of children components for information shown in the cmdline --- @param opts options for configuring macro recording, search count, and the overall padding --- @return The Heirline component table --- @usage local heirline_component = astronvim.status.component.cmd_info() -function astronvim.status.component.cmd_info(opts) - opts = astronvim.default_tbl(opts, { - macro_recording = { - icon = { kind = "MacroRecording", padding = { right = 1 } }, - condition = astronvim.status.condition.is_macro_recording, - update = { "RecordingEnter", "RecordingLeave" }, - }, - search_count = { - icon = { kind = "Search", padding = { right = 1 } }, - padding = { left = 1 }, - condition = astronvim.status.condition.is_hlsearch, - }, - surround = { - separator = "center", - color = "cmd_info_bg", - condition = function() return astronvim.status.condition.is_hlsearch() or astronvim.status.condition.is_macro_recording() end, - }, - condition = function() return vim.opt.cmdheight:get() == 0 end, - hl = { fg = "cmd_info_fg" }, - }) - return astronvim.status.component.builder( - astronvim.status.utils.setup_providers(opts, { "macro_recording", "search_count" }) - ) -end - ---- A function to build a set of children components for a mode section --- @param opts options for configuring mode_text, paste, spell, and the overall padding --- @return The Heirline component table --- @usage local heirline_component = astronvim.status.component.mode { mode_text = true } -function astronvim.status.component.mode(opts) - opts = astronvim.default_tbl(opts, { - mode_text = false, - paste = false, - spell = false, - surround = { separator = "left", color = astronvim.status.hl.mode_bg }, - hl = { fg = "bg" }, - update = "ModeChanged", - }) - if not opts["mode_text"] then opts.str = { str = " " } end - return astronvim.status.component.builder( - astronvim.status.utils.setup_providers(opts, { "mode_text", "str", "paste", "spell" }) - ) -end - ---- A function to build a set of children components for an LSP breadcrumbs section --- @param opts options for configuring breadcrumbs and the overall padding --- @return The Heirline component table --- @usage local heirline_component = astronvim.status.component.breadcumbs() -function astronvim.status.component.breadcrumbs(opts) - opts = astronvim.default_tbl( - opts, - { padding = { left = 1 }, condition = astronvim.status.condition.aerial_available, update = "CursorMoved" } - ) - opts.init = astronvim.status.init.breadcrumbs(opts) - return opts -end - ---- A function to build a set of children components for a git branch section --- @param opts options for configuring git branch and the overall padding --- @return The Heirline component table --- @usage local heirline_component = astronvim.status.component.git_branch() -function astronvim.status.component.git_branch(opts) - opts = astronvim.default_tbl(opts, { - git_branch = { icon = { kind = "GitBranch", padding = { right = 1 } } }, - surround = { separator = "left", color = "git_branch_bg", condition = astronvim.status.condition.is_git_repo }, - hl = { fg = "git_branch_fg", bold = true }, - on_click = { - name = "heirline_branch", - callback = function() - if astronvim.is_available "telescope.nvim" then - vim.defer_fn(function() require("telescope.builtin").git_branches() end, 100) - end - end, - }, - update = { "User", pattern = "GitSignsUpdate" }, - init = astronvim.status.init.update_events { "BufEnter" }, - }) - return astronvim.status.component.builder(astronvim.status.utils.setup_providers(opts, { "git_branch" })) -end - ---- A function to build a set of children components for a git difference section --- @param opts options for configuring git changes and the overall padding --- @return The Heirline component table --- @usage local heirline_component = astronvim.status.component.git_diff() -function astronvim.status.component.git_diff(opts) - opts = astronvim.default_tbl(opts, { - added = { icon = { kind = "GitAdd", padding = { left = 1, right = 1 } } }, - changed = { icon = { kind = "GitChange", padding = { left = 1, right = 1 } } }, - removed = { icon = { kind = "GitDelete", padding = { left = 1, right = 1 } } }, - hl = { fg = "git_diff_fg", bold = true }, - on_click = { - name = "heirline_git", - callback = function() - if astronvim.is_available "telescope.nvim" then - vim.defer_fn(function() require("telescope.builtin").git_status() end, 100) - end - end, - }, - surround = { separator = "left", color = "git_diff_bg", condition = astronvim.status.condition.git_changed }, - update = { "User", pattern = "GitSignsUpdate" }, - init = astronvim.status.init.update_events { "BufEnter" }, - }) - return astronvim.status.component.builder( - astronvim.status.utils.setup_providers(opts, { "added", "changed", "removed" }, function(p_opts, provider) - local out = astronvim.status.utils.build_provider(p_opts, provider) - if out then - out.provider = "git_diff" - out.opts.type = provider - out.hl = { fg = "git_" .. provider } - end - return out - end) - ) -end - ---- A function to build a set of children components for a diagnostics section --- @param opts options for configuring diagnostic providers and the overall padding --- @return The Heirline component table --- @usage local heirline_component = astronvim.status.component.diagnostics() -function astronvim.status.component.diagnostics(opts) - opts = astronvim.default_tbl(opts, { - ERROR = { icon = { kind = "DiagnosticError", padding = { left = 1, right = 1 } } }, - WARN = { icon = { kind = "DiagnosticWarn", padding = { left = 1, right = 1 } } }, - INFO = { icon = { kind = "DiagnosticInfo", padding = { left = 1, right = 1 } } }, - HINT = { icon = { kind = "DiagnosticHint", padding = { left = 1, right = 1 } } }, - surround = { separator = "left", color = "diagnostics_bg", condition = astronvim.status.condition.has_diagnostics }, - hl = { fg = "diagnostics_fg" }, - on_click = { - name = "heirline_diagnostic", - callback = function() - if astronvim.is_available "telescope.nvim" then - vim.defer_fn(function() require("telescope.builtin").diagnostics() end, 100) - end - end, - }, - update = { "DiagnosticChanged", "BufEnter" }, - }) - return astronvim.status.component.builder( - astronvim.status.utils.setup_providers(opts, { "ERROR", "WARN", "INFO", "HINT" }, function(p_opts, provider) - local out = astronvim.status.utils.build_provider(p_opts, provider) - if out then - out.provider = "diagnostics" - out.opts.severity = provider - out.hl = { fg = "diag_" .. provider } - end - return out - end) - ) -end - ---- A function to build a set of children components for a Treesitter section --- @param opts options for configuring diagnostic providers and the overall padding --- @return The Heirline component table --- @usage local heirline_component = astronvim.status.component.treesitter() -function astronvim.status.component.treesitter(opts) - opts = astronvim.default_tbl(opts, { - str = { str = "TS", icon = { kind = "ActiveTS" } }, - surround = { - separator = "right", - color = "treesitter_bg", - condition = astronvim.status.condition.treesitter_available, - }, - hl = { fg = "treesitter_fg" }, - update = { "OptionSet", pattern = "syntax" }, - init = astronvim.status.init.update_events { "BufEnter" }, - }) - return astronvim.status.component.builder(astronvim.status.utils.setup_providers(opts, { "str" })) -end - ---- A function to build a set of children components for an LSP section --- @param opts options for configuring lsp progress and client_name providers and the overall padding --- @return The Heirline component table --- @usage local heirline_component = astronvim.status.component.lsp() -function astronvim.status.component.lsp(opts) - opts = astronvim.default_tbl(opts, { - lsp_progress = { - str = "", - padding = { right = 1 }, - update = { "User", pattern = { "LspProgressUpdate", "LspRequest" } }, - }, - lsp_client_names = { - str = "LSP", - update = { "LspAttach", "LspDetach", "BufEnter" }, - icon = { kind = "ActiveLSP", padding = { right = 2 } }, - }, - hl = { fg = "lsp_fg" }, - surround = { separator = "right", color = "lsp_bg", condition = astronvim.status.condition.lsp_attached }, - on_click = { - name = "heirline_lsp", - callback = function() - vim.defer_fn(function() vim.cmd.LspInfo() end, 100) - end, - }, - }) - return astronvim.status.component.builder( - astronvim.status.utils.setup_providers( - opts, - { "lsp_progress", "lsp_client_names" }, - function(p_opts, provider, i) - return p_opts - and { - flexible = i, - astronvim.status.utils.build_provider(p_opts, astronvim.status.provider[provider](p_opts)), - astronvim.status.utils.build_provider(p_opts, astronvim.status.provider.str(p_opts)), - } - or false - end - ) - ) -end - ---- A general function to build a section of astronvim status providers with highlights, conditions, and section surrounding --- @param opts a list of components to build into a section --- @return The Heirline component table --- @usage local heirline_component = astronvim.status.components.builder({ { provider = "file_icon", opts = { padding = { right = 1 } } }, { provider = "filename" } }) -function astronvim.status.component.builder(opts) - opts = astronvim.default_tbl(opts, { padding = { left = 0, right = 0 } }) - local children = {} - if opts.padding.left > 0 then -- add left padding - table.insert(children, { provider = astronvim.pad_string(" ", { left = opts.padding.left - 1 }) }) - end - for key, entry in pairs(opts) do - if - type(key) == "number" - and type(entry) == "table" - and astronvim.status.provider[entry.provider] - and (entry.opts == nil or type(entry.opts) == "table") - then - entry.provider = astronvim.status.provider[entry.provider](entry.opts) - end - children[key] = entry - end - if opts.padding.right > 0 then -- add right padding - table.insert(children, { provider = astronvim.pad_string(" ", { right = opts.padding.right - 1 }) }) - end - return opts.surround - and astronvim.status.utils.surround( - opts.surround.separator, - opts.surround.color, - children, - opts.surround.condition - ) - or children -end - ---- Convert a component parameter table to a table that can be used with the component builder --- @param opts a table of provider options --- @param provider a provider in `astronvim.status.providers` --- @return the provider table that can be used in `astronvim.status.component.builder` -function astronvim.status.utils.build_provider(opts, provider, _) - return opts - and { - provider = provider, - opts = opts, - condition = opts.condition, - on_click = opts.on_click, - update = opts.update, - hl = opts.hl, - } - or false -end - ---- Convert key/value table of options to an array of providers for the component builder --- @param opts the table of options for the components --- @param providers an ordered list like array of providers that are configured in the options table --- @param setup a function that takes provider options table, provider name, provider index and returns the setup provider table, optional, default is `astronvim.status.utils.build_provider` --- @return the fully setup options table with the appropriately ordered providers -function astronvim.status.utils.setup_providers(opts, providers, setup) - setup = setup or astronvim.status.utils.build_provider - for i, provider in ipairs(providers) do - opts[i] = setup(opts[provider], provider, i) - end - return opts -end - ---- A utility function to get the width of the bar --- @param is_winbar boolean true if you want the width of the winbar, false if you want the statusline width --- @return the width of the specified bar -function astronvim.status.utils.width(is_winbar) - return vim.o.laststatus == 3 and not is_winbar and vim.o.columns or vim.api.nvim_win_get_width(0) -end - ---- Surround component with separator and color adjustment --- @param separator the separator index to use in `astronvim.status.env.separators` --- @param color the color to use as the separator foreground/component background --- @param component the component to surround --- @param condition the condition for displaying the surrounded component --- @return the new surrounded component -function astronvim.status.utils.surround(separator, color, component, condition) - local function surround_color(self) - local colors = type(color) == "function" and color(self) or color - return type(colors) == "string" and { main = colors } or colors - end - - separator = type(separator) == "string" and astronvim.status.env.separators[separator] or separator - local surrounded = { condition = condition } - if separator[1] ~= "" then - table.insert(surrounded, { - provider = separator[1], - hl = function(self) - local s_color = surround_color(self) - if s_color then return { fg = s_color.main, bg = s_color.left } end - end, - }) - end - table.insert(surrounded, { - hl = function(self) - local s_color = surround_color(self) - if s_color then return { bg = s_color.main } end - end, - astronvim.default_tbl({}, component), - }) - if separator[2] ~= "" then - table.insert(surrounded, { - provider = separator[2], - hl = function(self) - local s_color = surround_color(self) - if s_color then return { fg = s_color.main, bg = s_color.right } end - end, - }) - end - return surrounded -end - ---- Check if a buffer is valid --- @param bufnr the buffer to check --- @return true if the buffer is valid or false -function astronvim.status.utils.is_valid_buffer(bufnr) - if not bufnr or bufnr < 1 then return false end - return vim.bo[bufnr].buflisted and vim.api.nvim_buf_is_valid(bufnr) -end - ---- Get all valid buffers --- @return array-like table of valid buffer numbers -function astronvim.status.utils.get_valid_buffers() - return vim.tbl_filter(astronvim.status.utils.is_valid_buffer, vim.api.nvim_list_bufs()) -end - ---- Encode a position to a single value that can be decoded later --- @param line line number of position --- @param col column number of position --- @param winnr a window number --- @return the encoded position -function astronvim.status.utils.encode_pos(line, col, winnr) - return bit.bor(bit.lshift(line, 16), bit.lshift(col, 6), winnr) -end - ---- Decode a previously encoded position to it's sub parts --- @param c the encoded position --- @return line number, column number, window id -function astronvim.status.utils.decode_pos(c) - return bit.rshift(c, 16), bit.band(bit.rshift(c, 6), 1023), bit.band(c, 63) -end - -return astronvim.status diff --git a/dot_config/nvim/lua/core/utils/ui.lua b/dot_config/nvim/lua/core/utils/ui.lua deleted file mode 100644 index 887153f..0000000 --- a/dot_config/nvim/lua/core/utils/ui.lua +++ /dev/null @@ -1,185 +0,0 @@ ---- ### AstroNvim UI Options --- --- This module is automatically loaded by AstroNvim on during it's initialization into global variable `astronvim.ui` --- --- This module can also be manually loaded with `local updater = require("core.utils").ui` --- --- @module core.utils.ui --- @see core.utils --- @copyright 2022 --- @license GNU General Public License v3.0 - -astronvim.ui = {} - -local function bool2str(bool) return bool and "on" or "off" end - -local function ui_notify(str) - if vim.g.ui_notifications_enabled then astronvim.notify(str) end -end - ---- Toggle notifications for UI toggles -function astronvim.ui.toggle_ui_notifications() - vim.g.ui_notifications_enabled = not vim.g.ui_notifications_enabled - ui_notify(string.format("ui notifications %s", bool2str(vim.g.ui_notifications_enabled))) -end - ---- Toggle autopairs -function astronvim.ui.toggle_autopairs() - local ok, autopairs = pcall(require, "nvim-autopairs") - if ok then - if autopairs.state.disabled then - autopairs.enable() - else - autopairs.disable() - end - vim.g.autopairs_enabled = autopairs.state.disabled - ui_notify(string.format("autopairs %s", bool2str(not autopairs.state.disabled))) - else - ui_notify "autopairs not available" - end -end - ---- Toggle diagnostics -function astronvim.ui.toggle_diagnostics() - local status = "on" - if vim.g.status_diagnostics_enabled then - if vim.g.diagnostics_enabled then - vim.g.diagnostics_enabled = false - status = "virtual text off" - else - vim.g.status_diagnostics_enabled = false - status = "fully off" - end - else - vim.g.diagnostics_enabled = true - vim.g.status_diagnostics_enabled = true - end - - vim.diagnostic.config(astronvim.lsp.diagnostics[bool2str(vim.g.diagnostics_enabled)]) - ui_notify(string.format("diagnostics %s", status)) -end - ---- Toggle background="dark"|"light" -function astronvim.ui.toggle_background() - vim.go.background = vim.go.background == "light" and "dark" or "light" - ui_notify(string.format("background=%s", vim.go.background)) -end - ---- Toggle cmp entrirely -function astronvim.ui.toggle_cmp() - vim.g.cmp_enabled = not vim.g.cmp_enabled - local ok, _ = pcall(require, "cmp") - ui_notify(ok and string.format("completion %s", bool2str(vim.g.cmp_enabled)) or "completion not available") -end - ---- Toggle auto format -function astronvim.ui.toggle_autoformat() - vim.g.autoformat_enabled = not vim.g.autoformat_enabled - ui_notify(string.format("Autoformatting %s", bool2str(vim.g.autoformat_enabled))) -end - ---- Toggle showtabline=2|0 -function astronvim.ui.toggle_tabline() - vim.opt.showtabline = vim.opt.showtabline:get() == 0 and 2 or 0 - ui_notify(string.format("tabline %s", bool2str(vim.opt.showtabline:get() == 2))) -end - ---- Toggle conceal=2|0 -function astronvim.ui.toggle_conceal() - vim.opt.conceallevel = vim.opt.conceallevel:get() == 0 and 2 or 0 - ui_notify(string.format("conceal %s", bool2str(vim.opt.conceallevel:get() == 2))) -end - ---- Toggle laststatus=3|2|0 -function astronvim.ui.toggle_statusline() - local laststatus = vim.opt.laststatus:get() - local status - if laststatus == 0 then - vim.opt.laststatus = 2 - status = "local" - elseif laststatus == 2 then - vim.opt.laststatus = 3 - status = "global" - elseif laststatus == 3 then - vim.opt.laststatus = 0 - status = "off" - end - ui_notify(string.format("statusline %s", status)) -end - ---- Toggle signcolumn="auto"|"no" -function astronvim.ui.toggle_signcolumn() - if vim.wo.signcolumn == "no" then - vim.wo.signcolumn = "yes" - elseif vim.wo.signcolumn == "yes" then - vim.wo.signcolumn = "auto" - else - vim.wo.signcolumn = "no" - end - ui_notify(string.format("signcolumn=%s", vim.wo.signcolumn)) -end - ---- Set the indent and tab related numbers -function astronvim.ui.set_indent() - local indent = tonumber(vim.fn.input "Set indent value (>0 expandtab, <=0 noexpandtab): ") - if not indent or indent == 0 then return end - vim.bo.expandtab = (indent > 0) -- local to buffer - indent = math.abs(indent) - vim.bo.tabstop = indent -- local to buffer - vim.bo.softtabstop = indent -- local to buffer - vim.bo.shiftwidth = indent -- local to buffer - ui_notify(string.format("indent=%d %s", indent, vim.bo.expandtab and "expandtab" or "noexpandtab")) -end - ---- Change the number display modes -function astronvim.ui.change_number() - local number = vim.wo.number -- local to window - local relativenumber = vim.wo.relativenumber -- local to window - if not number and not relativenumber then - vim.wo.number = true - elseif number and not relativenumber then - vim.wo.relativenumber = true - elseif number and relativenumber then - vim.wo.number = false - else -- not number and relativenumber - vim.wo.relativenumber = false - end - ui_notify(string.format("number %s, relativenumber %s", bool2str(vim.wo.number), bool2str(vim.wo.relativenumber))) -end - ---- Toggle spell -function astronvim.ui.toggle_spell() - vim.wo.spell = not vim.wo.spell -- local to window - ui_notify(string.format("spell %s", bool2str(vim.wo.spell))) -end - ---- Toggle paste -function astronvim.ui.toggle_paste() - vim.opt.paste = not vim.opt.paste:get() -- local to window - ui_notify(string.format("paste %s", bool2str(vim.opt.paste:get()))) -end - ---- Toggle wrap -function astronvim.ui.toggle_wrap() - vim.wo.wrap = not vim.wo.wrap -- local to window - ui_notify(string.format("wrap %s", bool2str(vim.wo.wrap))) -end - ---- Toggle syntax highlighting and treesitter -function astronvim.ui.toggle_syntax() - local ts_avail, parsers = pcall(require, "nvim-treesitter.parsers") - if vim.g.syntax_on then -- global var for on//off - if ts_avail and parsers.has_parser() then vim.cmd.TSBufDisable "highlight" end - vim.cmd.syntax "off" -- set vim.g.syntax_on = false - else - if ts_avail and parsers.has_parser() then vim.cmd.TSBufEnable "highlight" end - vim.cmd.syntax "on" -- set vim.g.syntax_on = true - end - ui_notify(string.format("syntax %s", bool2str(vim.g.syntax_on))) -end - ---- Toggle URL/URI syntax highlighting rules -function astronvim.ui.toggle_url_match() - vim.g.highlighturl_enabled = not vim.g.highlighturl_enabled - astronvim.set_url_match() -end diff --git a/dot_config/nvim/lua/core/utils/updater.lua b/dot_config/nvim/lua/core/utils/updater.lua deleted file mode 100644 index 552ac44..0000000 --- a/dot_config/nvim/lua/core/utils/updater.lua +++ /dev/null @@ -1,296 +0,0 @@ ---- ### AstroNvim Updater --- --- This module is automatically loaded by AstroNvim on during it's initialization into global variable `astronvim.updater` --- --- This module can also be manually loaded with `local updater = require("core.utils").updater` --- --- @module core.utils.updater --- @see core.utils --- @copyright 2022 --- @license GNU General Public License v3.0 - -local fn = vim.fn -local git = require "core.utils.git" ---- Updater settings overridden with any user provided configuration -local options = astronvim.user_plugin_opts("updater", { - remote = "origin", - channel = "stable", - show_changelog = true, - auto_reload = true, - auto_quit = true, -}) - --- set the install channel -if options.branch then options.channel = "nightly" end -if astronvim.install.is_stable ~= nil then options.channel = astronvim.install.is_stable and "stable" or "nightly" end - -astronvim.updater = { options = options } --- if the channel is stable or the user has chosen to pin the system plugins -if options.pin_plugins == nil and options.channel == "stable" or options.pin_plugins then - -- load the current packer snapshot from the installation home location - local loaded, snapshot = pcall(fn.readfile, astronvim.install.home .. "/packer_snapshot") - if loaded then - -- decode the snapshot JSON and save it to a variable - loaded, snapshot = pcall(fn.json_decode, snapshot) - astronvim.updater.snapshot = type(snapshot) == "table" and snapshot or nil - end - -- if there is an error loading the snapshot, print an error - if not loaded then vim.api.nvim_err_writeln "Error loading packer snapshot" end -end - ---- Get the current AstroNvim version --- @param quiet boolean to quietly execute or send a notification --- @return the current AstroNvim version string -function astronvim.updater.version(quiet) - local version = astronvim.install.version or git.current_version(false) - if version and not quiet then astronvim.notify("Version: " .. version) end - return version -end - ---- Get the full AstroNvim changelog --- @param quiet boolean to quietly execute or display the changelog --- @return the current AstroNvim changelog table of commit messages -function astronvim.updater.changelog(quiet) - local summary = {} - vim.list_extend(summary, git.pretty_changelog(git.get_commit_range())) - if not quiet then astronvim.echo(summary) end - return summary -end - ---- Attempt an update of AstroNvim --- @param target the target if checking out a specific tag or commit or nil if just pulling -local function attempt_update(target) - -- if updating to a new stable version or a specific commit checkout the provided target - if options.channel == "stable" or options.commit then - return git.checkout(target, false) - -- if no target, pull the latest - else - return git.pull(false) - end -end - ---- Cancelled update message -local cancelled_message = { { "Update cancelled", "WarningMsg" } } - ---- Reload the AstroNvim configuration live (Experimental) --- @param quiet boolean to quietly execute or send a notification -function astronvim.updater.reload(quiet) - -- stop LSP if it is running - if vim.fn.exists ":LspStop" ~= 0 then vim.cmd.LspStop() end - local reload_module = require("plenary.reload").reload_module - -- unload AstroNvim configuration files - reload_module "user" - reload_module "configs" - reload_module "default_theme" - reload_module "core" - -- manual unload some plugins that need it if they exist - reload_module "cmp" - reload_module "which-key" - -- source the AstroNvim configuration - local reloaded, _ = pcall(dofile, vim.fn.expand "$MYVIMRC") - -- if successful reload and not quiet, display a notification - if reloaded and not quiet then astronvim.notify "Reloaded AstroNvim" end -end - ---- Sync Packer and then update Mason -function astronvim.updater.update_packages() - vim.api.nvim_create_autocmd("User", { - once = true, - desc = "Update Mason with Packer", - group = vim.api.nvim_create_augroup("astro_sync", { clear = true }), - pattern = "PackerComplete", - callback = function() - if astronvim.is_available "mason.nvim" then - vim.api.nvim_create_autocmd("User", { - pattern = "AstroMasonUpdateComplete", - once = true, - callback = function() astronvim.event "UpdatePackagesComplete" end, - }) - astronvim.mason.update_all() - else - astronvim.event "UpdatePackagesComplete" - end - end, - }) - vim.cmd.PackerSync() -end - ---- AstroNvim's updater function -function astronvim.updater.update() - -- if the git command is not available, then throw an error - if not git.available() then - astronvim.notify( - "git command is not available, please verify it is accessible in a command line. This may be an issue with your PATH", - "error" - ) - return - end - - -- if installed with an external package manager, disable the internal updater - if not git.is_repo() then - astronvim.notify("Updater not available for non-git installations", "error") - return - end - -- set up any remotes defined by the user if they do not exist - for remote, entry in pairs(options.remotes and options.remotes or {}) do - local url = git.parse_remote_url(entry) - local current_url = git.remote_url(remote, false) - local check_needed = false - if not current_url then - git.remote_add(remote, url) - check_needed = true - elseif - current_url ~= url - and astronvim.confirm_prompt { - { "Remote " }, - { remote, "Title" }, - { " is currently set to " }, - { current_url, "WarningMsg" }, - { "\nWould you like us to set it to " }, - { url, "String" }, - { "?" }, - } - then - git.remote_update(remote, url) - check_needed = true - end - if check_needed and git.remote_url(remote, false) ~= url then - vim.api.nvim_err_writeln("Error setting up remote " .. remote .. " to " .. url) - return - end - end - local is_stable = options.channel == "stable" - if is_stable then - options.branch = "main" - elseif not options.branch then - options.branch = "nightly" - end - -- fetch the latest remote - if not git.fetch(options.remote) then - vim.api.nvim_err_writeln("Error fetching remote: " .. options.remote) - return - end - -- switch to the necessary branch only if not on the stable channel - if not is_stable then - local local_branch = (options.remote == "origin" and "" or (options.remote .. "_")) .. options.branch - if git.current_branch() ~= local_branch then - astronvim.echo { - { "Switching to branch: " }, - { options.remote .. "/" .. options.branch .. "\n\n", "String" }, - } - if not git.checkout(local_branch, false) then - git.checkout("-b " .. local_branch .. " " .. options.remote .. "/" .. options.branch, false) - end - end - -- check if the branch was switched to successfully - if git.current_branch() ~= local_branch then - vim.api.nvim_err_writeln("Error checking out branch: " .. options.remote .. "/" .. options.branch) - return - end - end - local source = git.local_head() -- calculate current commit - local target -- calculate target commit - if is_stable then -- if stable get tag commit - local version_search = options.version or "latest" - options.version = git.latest_version(git.get_versions(version_search)) - if not options.version then -- continue only if stable version is found - vim.api.nvim_err_writeln("Error finding version: " .. version_search) - return - end - target = git.tag_commit(options.version) - elseif options.commit then -- if commit specified use it - target = git.branch_contains(options.remote, options.branch, options.commit) and options.commit or nil - else -- get most recent commit - target = git.remote_head(options.remote, options.branch) - end - if not source or not target then -- continue if current and target commits were found - vim.api.nvim_err_writeln "Error checking for updates" - return - elseif source == target then - astronvim.echo { { "No updates available", "String" } } - return - elseif -- prompt user if they want to accept update - not options.skip_prompts - and not astronvim.confirm_prompt { - { "Update available to ", "Title" }, - { is_stable and options.version or target, "String" }, - { "\nUpdating requires a restart, continue?" }, - } - then - astronvim.echo(cancelled_message) - return - else -- perform update - -- calculate and print the changelog - local changelog = git.get_commit_range(source, target) - local breaking = git.breaking_changes(changelog) - local breaking_prompt = { { "Update contains the following breaking changes:\n", "WarningMsg" } } - vim.list_extend(breaking_prompt, git.pretty_changelog(breaking)) - vim.list_extend(breaking_prompt, { { "\nWould you like to continue?" } }) - if #breaking > 0 and not options.skip_prompts and not astronvim.confirm_prompt(breaking_prompt) then - astronvim.echo(cancelled_message) - return - end - -- attempt an update - local updated = attempt_update(target) - -- check for local file conflicts and prompt user to continue or abort - if - not updated - and not options.skip_prompts - and not astronvim.confirm_prompt { - { "Unable to pull due to local modifications to base files.\n", "ErrorMsg" }, - { "Reset local files and continue?" }, - } - then - astronvim.echo(cancelled_message) - return - -- if continued and there were errors reset the base config and attempt another update - elseif not updated then - git.hard_reset(source) - updated = attempt_update(target) - end - -- if update was unsuccessful throw an error - if not updated then - vim.api.nvim_err_writeln "Error ocurred performing update" - return - end - -- print a summary of the update with the changelog - local summary = { - { "AstroNvim updated successfully to ", "Title" }, - { git.current_version(), "String" }, - { "!\n", "Title" }, - { - options.auto_reload and "AstroNvim will now sync packer and quit.\n\n" - or "Please restart and run :PackerSync.\n\n", - "WarningMsg", - }, - } - if options.show_changelog and #changelog > 0 then - vim.list_extend(summary, { { "Changelog:\n", "Title" } }) - vim.list_extend(summary, git.pretty_changelog(changelog)) - end - astronvim.echo(summary) - - -- if the user wants to auto quit, create an autocommand to quit AstroNvim on the update completing - if options.auto_quit then - vim.api.nvim_create_autocmd("User", { pattern = "AstroUpdateComplete", command = "quitall" }) - end - - -- if the user wants to reload and sync packer - if options.auto_reload then - -- perform a reload - vim.opt.modifiable = true - astronvim.updater.reload(true) -- run quiet to not show notification on reload - vim.api.nvim_create_autocmd("User", { - once = true, - pattern = "AstroUpdatePackagesComplete", - callback = function() astronvim.event "UpdateComplete" end, - }) - require "core.plugins" - astronvim.updater.update_packages() - -- if packer isn't available send successful update event - else - -- send user event of successful update - astronvim.event "UpdateComplete" - end - end -end diff --git a/dot_config/nvim/lua/default_theme/base.lua b/dot_config/nvim/lua/default_theme/base.lua deleted file mode 100644 index 9cd88dc..0000000 --- a/dot_config/nvim/lua/default_theme/base.lua +++ /dev/null @@ -1,85 +0,0 @@ -local base = { - Normal = { fg = C.fg, bg = C.bg }, - NormalNC = { fg = C.fg, bg = C.black }, - Comment = { fg = C.grey_2, bg = C.none }, - Constant = { fg = C.yellow, bg = C.none }, - String = { fg = C.green, bg = C.none }, - Character = { fg = C.green, bg = C.none }, - Number = { fg = C.orange, bg = C.none }, - Boolean = { fg = C.blue, bg = C.none }, - Float = { fg = C.yellow, bg = C.none }, - Identifier = { fg = C.blue, bg = C.none }, - Function = { fg = C.yellow, bg = C.none }, - Statement = { fg = C.purple, bg = C.none }, - Conditional = { fg = C.purple_1, bg = C.none }, - Repeat = { fg = C.purple, bg = C.none }, - Label = { fg = C.blue, bg = C.none }, - Operator = { fg = C.purple, bg = C.none }, - Keyword = { fg = C.purple, bg = C.none }, - Exception = { fg = C.purple, bg = C.none }, - Preproc = { fg = C.yellow, bg = C.none }, - Include = { fg = C.purple, bg = C.none }, - Define = { fg = C.purple, bg = C.none }, - Title = { fg = C.cyan, bg = C.none }, - Macro = { fg = C.purple, bg = C.none }, - PreCondit = { fg = C.blue, bg = C.none }, - Type = { fg = C.blue, bg = C.none }, - StorageClass = { fg = C.blue, bg = C.none }, - Structure = { fg = C.yellow, bg = C.none }, - Typedef = { fg = C.yellow, bg = C.none }, - Special = { fg = C.blue, bg = C.none }, - SpecialComment = { fg = C.grey, bg = C.none }, - Error = { fg = C.red, bg = C.none }, - Todo = { fg = C.purple, bg = C.none }, - Underlined = { fg = C.cyan, bg = C.none }, - Cursor = { fg = C.none, bg = C.none }, - ColorColumn = { fg = C.none, bg = C.grey_4 }, - CursorLineNr = { fg = C.fg, bg = C.none }, - Conceal = { fg = C.grey, bg = C.none }, - CursorColumn = { fg = C.none, bg = C.grey_4 }, - CursorLine = { fg = C.none, bg = C.grey_8 }, - Directory = { fg = C.blue, bg = C.none }, - DiffAdd = { fg = C.grey_3, bg = C.green }, - DiffChange = { fg = C.yellow, bg = C.none }, - DiffDelete = { fg = C.grey_3, bg = C.red }, - DiffText = { fg = C.grey_3, bg = C.yellow }, - ErrorMsg = { fg = C.red, bg = C.none }, - WinSeparator = { fg = C.grey_4, bg = C.none }, - Folded = { fg = C.grey, bg = C.none }, - FoldColumn = { fg = C.none, bg = C.none }, - IncSearch = { fg = C.yellow, bg = C.grey }, - LineNr = { fg = C.grey_1, bg = C.none }, - NonText = { fg = C.grey_1, bg = C.none }, - Pmenu = { fg = C.fg, bg = C.bg }, - PmenuSel = { fg = C.none, bg = C.grey_4 }, - PmenuSbar = { fg = C.none, bg = C.grey_3 }, - PmenuThumb = { fg = C.none, bg = C.fg }, - Question = { fg = C.purple, bg = C.none }, - QuickFixLine = { fg = C.grey_3, bg = C.yellow }, - Search = { fg = C.grey_3, bg = C.yellow }, - SignColumn = { fg = C.none, bg = C.none }, - SpecialKey = { fg = C.grey_1, bg = C.none }, - SpellBad = { undercurl = true }, - SpellCap = { undercurl = true }, - SpellLocal = { undercurl = true }, - SpellRare = { undercurl = true }, - StatusLine = { fg = C.fg, bg = C.grey_4 }, - StatusLineNC = { fg = C.grey, bg = C.none }, - StatusLineTerm = { fg = C.fg, bg = C.grey_4 }, - StatusLineTermNC = { fg = C.grey_4, bg = C.none }, - WinBar = { fg = C.grey_2, bg = C.bg }, - WinBarNC = { fg = C.grey, bg = C.black }, - TabLine = { fg = C.grey, bg = C.none }, - TabLineSel = { fg = C.fg, bg = C.none }, - TabLineFill = { fg = C.none, bg = C.grey_3 }, - Terminal = { fg = C.fg, bg = C.grey_3 }, - Visual = { fg = C.none, bg = C.grey_5 }, - VisualNOS = { fg = C.grey_5, bg = C.none }, - WarningMsg = { fg = C.yellow, bg = C.none }, - WildMenu = { fg = C.grey_3, bg = C.blue }, - EndOfBuffer = { fg = C.bg, bg = C.none }, - FloatBorder = { fg = C.grey_6, bg = C.bg }, - MatchParen = { fg = C.none, bg = C.grey_5 }, -} - -return base diff --git a/dot_config/nvim/lua/default_theme/colors.lua b/dot_config/nvim/lua/default_theme/colors.lua deleted file mode 100644 index 1fe8d76..0000000 --- a/dot_config/nvim/lua/default_theme/colors.lua +++ /dev/null @@ -1,82 +0,0 @@ -local colors = { - none = "NONE", - fg = "#abb2bf", - bg = "#1e222a", - bg_1 = "#303742", - black = "#181a1f", - black_1 = "#1f1f25", - green = "#98c379", - green_1 = "#89b06d", - green_2 = "#95be76", - white = "#dedede", - white_1 = "#afb2bb", - white_2 = "#c9c9c9", - blue = "#61afef", - blue_1 = "#40d9ff", - blue_2 = "#1b1f27", - blue_3 = "#8094B4", - blue_4 = "#90c7f3", - orange = "#d19a66", - orange_1 = "#ff9640", - orange_2 = "#ff8800", - yellow = "#e5c07b", - yellow_1 = "#ebae34", - yellow_2 = "#d1b071", - red = "#e06c75", - red_1 = "#ec5f67", - red_2 = "#ffbba6", - red_3 = "#cc626a", - red_4 = "#d47d85", - red_5 = "#e9989e", - grey = "#5c6370", - grey_1 = "#4b5263", - grey_2 = "#777d86", - grey_3 = "#282c34", - grey_4 = "#2c323c", - grey_5 = "#3e4452", - grey_6 = "#3b4048", - grey_7 = "#5c5c5c", - grey_8 = "#252931", - grey_9 = "#787e87", - grey_10 = "#D3D3D3", - gold = "#ffcc00", - cyan = "#56b6c2", - cyan_1 = "#88cbd4", - purple = "#c678dd", - purple_1 = "#a9a1e1", - purple_2 = "#c2bdea", - - -- icon colors - c = "#519aba", - css = "#61afef", - deb = "#a1b7ee", - docker = "#384d54", - html = "#de8c92", - jpeg = "#c882e7", - jpg = "#c882e7", - js = "#ebcb8b", - jsx = "#519ab8", - kt = "#7bc99c", - lock = "#c4c720", - lua = "#51a0cf", - mp3 = "#d39ede", - mp4 = "#9ea3de", - out = "#abb2bf", - png = "#c882e7", - py = "#a3b8ef", - rb = "#ff75a0", - robots = "#abb2bf", - rpm = "#fca2aa", - rs = "#dea584", - toml = "#39bf39", - ts = "#519aba", - ttf = "#abb2bf", - vue = "#7bc99c", - woff = "#abb2bf", - woff2 = "#abb2bf", - zip = "#f9d71c", - md = "#519aba", - pkg = "#d39ede", -} - -return astronvim.user_plugin_opts("default_theme.colors", colors) diff --git a/dot_config/nvim/lua/default_theme/init.lua b/dot_config/nvim/lua/default_theme/init.lua deleted file mode 100644 index 4101d8e..0000000 --- a/dot_config/nvim/lua/default_theme/init.lua +++ /dev/null @@ -1,68 +0,0 @@ -vim.cmd.highlight "clear" -if vim.fn.exists "syntax_on" then vim.cmd.syntax "reset" end -vim.o.background = "dark" -vim.o.termguicolors = true -vim.g.colors_name = "default_theme" - -local user_plugin_opts = astronvim.user_plugin_opts - -C = require "default_theme.colors" - -local highlights = {} - -for _, module in ipairs { "base", "lsp" } do - highlights = vim.tbl_deep_extend("force", highlights, require("default_theme." .. module)) -end - -for plugin, enabled in - pairs(user_plugin_opts("default_theme.plugins", { - aerial = true, - beacon = false, - bufferline = true, - cmp = true, - dapui = true, - dashboard = true, - gitsigns = true, - highlighturl = true, - hop = false, - indent_blankline = true, - lightspeed = false, - ["neo-tree"] = true, - notify = true, - ["nvim-tree"] = false, - ["nvim-web-devicons"] = true, - rainbow = true, - symbols_outline = false, - telescope = true, - treesitter = true, - vimwiki = false, - ["which-key"] = true, - })) -do - if enabled then highlights = vim.tbl_deep_extend("force", highlights, require("default_theme.plugins." .. plugin)) end -end - -for group, spec in pairs(user_plugin_opts("default_theme.highlights", highlights)) do - vim.api.nvim_set_hl(0, group, spec) -end - -astronvim.vim_opts { - g = { - terminal_color_0 = C.terminal_color_0 or C.bg, - terminal_color_1 = C.terminal_color_1 or C.red, - terminal_color_2 = C.terminal_color_2 or C.green_1, - terminal_color_3 = C.terminal_color_3 or C.yellow_1, - terminal_color_4 = C.terminal_color_4 or C.blue, - terminal_color_5 = C.terminal_color_5 or C.purple_1, - terminal_color_6 = C.terminal_color_6 or C.cyan, - terminal_color_7 = C.terminal_color_7 or C.white, - terminal_color_8 = C.terminal_color_8 or C.white_1, - terminal_color_9 = C.terminal_color_9 or C.red_5, - terminal_color_10 = C.terminal_color_10 or C.green, - terminal_color_11 = C.terminal_color_11 or C.yellow, - terminal_color_12 = C.terminal_color_12 or C.blue_4, - terminal_color_13 = C.terminal_color_13 or C.purple_2, - terminal_color_14 = C.terminal_color_14 or C.cyan_1, - terminal_color_15 = C.terminal_color_15 or C.fg, - }, -} diff --git a/dot_config/nvim/lua/default_theme/lsp.lua b/dot_config/nvim/lua/default_theme/lsp.lua deleted file mode 100644 index 2bb6573..0000000 --- a/dot_config/nvim/lua/default_theme/lsp.lua +++ /dev/null @@ -1,26 +0,0 @@ -local lsp = { - DiagnosticError = { fg = C.red_1 }, - DiagnosticHint = { fg = C.yellow_1 }, - DiagnosticInfo = { fg = C.white_2 }, - DiagnosticWarn = { fg = C.orange_1 }, - DiagnosticInformation = { fg = C.yellow, bold = true }, - DiagnosticTruncateLine = { fg = C.white_1, bold = true }, - DiagnosticUnderlineError = { sp = C.red_2, undercurl = true }, - DiagnosticUnderlineHint = { sp = C.red_2, undercurl = true }, - DiagnosticUnderlineInfo = { sp = C.red_2, undercurl = true }, - DiagnosticUnderlineWarn = { sp = C.red_2, undercurl = true }, - LspCodeLens = { fg = C.grey_2 }, - LspCodeLensSeparator = { fg = C.grey }, - LspDiagnosticsFloatingError = { fg = C.red_1 }, - LspDiagnosticsFloatingHint = { fg = C.yellow_1 }, - LspDiagnosticsFloatingInfor = { fg = C.white_2 }, - LspDiagnosticsFloatingWarn = { fg = C.orange_1 }, - LspFloatWinBorder = { fg = C.white_1 }, - LspFloatWinNormal = { fg = C.fg, bg = C.black_1 }, - LspReferenceRead = { fg = C.none, bg = C.grey_5 }, - LspReferenceText = { fg = C.none, bg = C.grey_5 }, - LspReferenceWrite = { fg = C.none, bg = C.grey_5 }, - ProviderTruncateLine = { fg = C.white_1 }, -} - -return lsp diff --git a/dot_config/nvim/lua/default_theme/plugins/aerial.lua b/dot_config/nvim/lua/default_theme/plugins/aerial.lua deleted file mode 100644 index 2e295ff..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/aerial.lua +++ /dev/null @@ -1,31 +0,0 @@ -return { - AerialArrayIcon = { link = "@constant" }, - AerialBooleanIcon = { link = "@boolean" }, - AerialClassIcon = { link = "@type" }, - AerialConstantIcon = { link = "@constant" }, - AerialConstructorIcon = { link = "@constructor" }, - AerialEnumIcon = { link = "@type" }, - AerialEnumMemberIcon = { link = "@field" }, - AerialEventIcon = { link = "@type" }, - AerialFieldIcon = { link = "@field" }, - AerialFileIcon = { link = "@text.uri" }, - AerialFunctionIcon = { link = "@function" }, - AerialGuide = { fg = C.grey_2 }, - AerialInterfaceIcon = { link = "@type" }, - AerialKeyIcon = { link = "@type" }, - AerialLine = { fg = C.yellow, bg = C.none }, - AerialMethodIcon = { link = "@method" }, - AerialModuleIcon = { link = "@namespace" }, - AerialNamespaceIcon = { link = "@namespace" }, - AerialNullIcon = { link = "@type" }, - AerialNumberIcon = { link = "@number" }, - AerialObjectIcon = { link = "@type" }, - AerialOperatorIcon = { link = "@operator" }, - AerialPackageIcon = { link = "@namespace" }, - AerialPropertyIcon = { link = "@property" }, - AerialStringIcon = { link = "@string" }, - AerialStructIcon = { link = "@type" }, - AerialTypeIcon = { link = "@type" }, - AerialTypeParameterIcon = { link = "@parameter" }, - AerialVariableIcon = { link = "@variable" }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/beacon.lua b/dot_config/nvim/lua/default_theme/plugins/beacon.lua deleted file mode 100644 index 43b34b8..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/beacon.lua +++ /dev/null @@ -1 +0,0 @@ -return { Beacon = { bg = C.blue } } diff --git a/dot_config/nvim/lua/default_theme/plugins/bufferline.lua b/dot_config/nvim/lua/default_theme/plugins/bufferline.lua deleted file mode 100644 index 324a475..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/bufferline.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - BufferLineBufferVisible = { fg = C.fg, bg = C.bg }, - BufferLineBufferSelected = { fg = C.white, bg = C.bg, bold = true }, - BufferLineTab = { fg = C.grey_9, bg = C.bg }, - BufferLineTabSelected = { fg = C.fg, bg = C.bg }, - BufferLineTabClose = { fg = C.red_4, bg = C.bg }, - BufferLineIndicatorSelected = { fg = C.bg, bg = C.bg }, - BufferLineCloseButtonVisible = { fg = C.grey_10, bg = C.bg }, - BufferLineCloseButtonSelected = { fg = C.red_4, bg = C.bg }, - BufferLineModifiedVisible = { fg = C.fg, bg = C.bg }, - BufferLineModifiedSelected = { fg = C.green_2, bg = C.bg }, - BufferLineError = { fg = C.red_1, bg = C.red_1 }, - BufferLineErrorDiagnostic = { fg = C.red_1, bg = C.red_1 }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/cmp.lua b/dot_config/nvim/lua/default_theme/plugins/cmp.lua deleted file mode 100644 index 09fadcb..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/cmp.lua +++ /dev/null @@ -1,34 +0,0 @@ -return { - CmpItemAbbr = { fg = C.fg }, - CmpItemAbbrDefault = { fg = C.fg }, - CmpItemAbbrDeprecated = { fg = C.grey_2 }, - CmpItemAbbrMatch = { fg = C.white }, - CmpItemAbbrMatchFuzzy = { fg = C.white }, - CmpItemKind = { fg = C.yellow }, - CmpItemKindClass = { link = "@type" }, - CmpItemKindColor = { link = "@constant" }, - CmpItemKindConstant = { link = "@constant" }, - CmpItemKindConstructor = { link = "@constructor" }, - CmpItemKindEnum = { link = "@type" }, - CmpItemKindEnumMember = { link = "@field" }, - CmpItemKindEvent = { link = "@type" }, - CmpItemKindField = { link = "@field" }, - CmpItemKindFile = { link = "@text.uri" }, - CmpItemKindFolder = { link = "@constant" }, - CmpItemKindFunction = { link = "@function" }, - CmpItemKindInterface = { link = "@type" }, - CmpItemKindKeyword = { link = "@keyword" }, - CmpItemKindMethod = { link = "@method" }, - CmpItemKindModule = { link = "@namespace" }, - CmpItemKindOperator = { link = "@operator" }, - CmpItemKindProperty = { link = "@property" }, - CmpItemKindReference = { link = "@type" }, - CmpItemKindSnippet = { link = "@constant" }, - CmpItemKindStruct = { link = "@type" }, - CmpItemKindText = { link = "@text" }, - CmpItemKindTypeParameter = { link = "@type" }, - CmpItemKindUnit = { link = "@constant" }, - CmpItemKindValue = { link = "@constant" }, - CmpItemKindVariable = { link = "@variable" }, - CmpItemMenuDefault = { fg = C.fg }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/dashboard.lua b/dot_config/nvim/lua/default_theme/plugins/dashboard.lua deleted file mode 100644 index 4aa0598..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/dashboard.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - DashboardHeader = { fg = C.cyan }, - DashboardShortcut = { fg = C.yellow }, - DashboardFooter = { fg = C.cyan }, - DashboardCenter = { fg = C.blue }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/gitsigns.lua b/dot_config/nvim/lua/default_theme/plugins/gitsigns.lua deleted file mode 100644 index 7c2b159..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/gitsigns.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - GitSignsAdd = { fg = C.green, bg = C.none }, - GitSignsChange = { fg = C.orange_1, bg = C.none }, - GitSignsDelete = { fg = C.red_1, bg = C.none }, - MoreMsg = { fg = C.green, bold = true }, - ModeMsg = { fg = C.grey, bold = true }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/highlighturl.lua b/dot_config/nvim/lua/default_theme/plugins/highlighturl.lua deleted file mode 100644 index c69fdf0..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/highlighturl.lua +++ /dev/null @@ -1 +0,0 @@ -return { HighlightURL = { underline = true } } diff --git a/dot_config/nvim/lua/default_theme/plugins/hop.lua b/dot_config/nvim/lua/default_theme/plugins/hop.lua deleted file mode 100644 index 7d3b1ac..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/hop.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - HopNextKey = { fg = C.red, bold = true }, - HopNextKey1 = { fg = C.cyan, bold = true }, - HopNextKey2 = { fg = C.blue }, - HopUnmatched = { fg = C.grey }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/indent_blankline.lua b/dot_config/nvim/lua/default_theme/plugins/indent_blankline.lua deleted file mode 100644 index b79419a..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/indent_blankline.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - IndentBlanklineSpaceChar = { fg = C.grey_6, nocombine = true }, - IndentBlanklineChar = { fg = C.grey_6, nocombine = true }, - IndentBlanklineContextStart = { fg = C.grey_7, underline = true }, - IndentBlanklineContextChar = { fg = C.grey_7, nocombine = true }, - IndentBlanklineSpaceCharBlankline = { fg = C.grey_6, nocombine = true }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/lightspeed.lua b/dot_config/nvim/lua/default_theme/plugins/lightspeed.lua deleted file mode 100644 index e891d61..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/lightspeed.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - LightspeedLabel = { fg = C.red_3, underline = true }, - LightspeedLabelOverlapped = { fg = C.blue, underline = true }, - LightspeedLabelDistant = { fg = C.red_1, underline = true }, - LightspeedLabelDistantOverlapped = { fg = C.blue_1, underline = true }, - LightspeedShortcut = { fg = C.black, bg = C.red_3, bold = true, underline = true }, - LightspeedShortcutOverlapped = { fg = C.black, bg = C.blue, bold = true, underline = true }, - LightspeedMaskedChar = { fg = C.green_1 }, - LightspeedGreyWash = { fg = C.grey_2, bg = C.none }, - LightspeedUnlabeledMatch = { fg = C.white, bold = true }, - LightspeedOneCharMatch = { fg = C.green, bg = C.red_3, bold = true }, - LightspeedUniqueChar = { fg = C.white, bold = true }, - LightspeedPendingOpArea = { fg = C.yellow }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/neo-tree.lua b/dot_config/nvim/lua/default_theme/plugins/neo-tree.lua deleted file mode 100644 index 810e56b..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/neo-tree.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - NeoTreeDirectoryIcon = { fg = C.blue }, - NeoTreeRootName = { fg = C.fg, bold = true }, - NeoTreeFileName = { fg = C.fg }, - NeoTreeFileIcon = { fg = C.fg }, - NeoTreeFileNameOpened = { fg = C.green }, - NeoTreeIndentMarker = { fg = C.blue_3 }, - NeoTreeGitAdded = { fg = C.green }, - NeoTreeGitConflict = { fg = C.red }, - NeoTreeGitModified = { fg = C.orange }, - NeoTreeGitUntracked = { fg = C.yellow }, - NeoTreeNormal = { bg = C.blue_2 }, - NeoTreeNormalNC = { bg = C.blue_2 }, - NeoTreeSymbolicLinkTarget = { fg = C.cyan }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/notify.lua b/dot_config/nvim/lua/default_theme/plugins/notify.lua deleted file mode 100644 index 39ccf67..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/notify.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - NotifyBackground = { bg = C.bg }, - NotifyERRORBorder = { fg = C.red }, - NotifyWARNBorder = { fg = C.orange_1 }, - NotifyINFOBorder = { fg = C.green }, - NotifyDEBUGBorder = { fg = C.cyan }, - NotifyTRACERBorder = { fg = C.purple }, - NotifyERRORIcon = { fg = C.red }, - NotifyWARNIcon = { fg = C.orange_1 }, - NotifyINFOIcon = { fg = C.green }, - NotifyDEBUGIcon = { fg = C.cyan }, - NotifyTRACEIcon = { fg = C.purple }, - NotifyERRORTitle = { fg = C.red }, - NotifyWARNTitle = { fg = C.orange_1 }, - NotifyINFOTitle = { fg = C.green }, - NotifyDEBUGTitle = { fg = C.cyan }, - NotifyTRACETitle = { fg = C.purple }, - NotifyERRORBody = { fg = C.fg }, - NotifyWARNBody = { fg = C.fg }, - NotifyINFOBody = { fg = C.fg }, - NotifyDEBUGBody = { fg = C.fg }, - NotifyTRACEBody = { fg = C.fg }, - NotifyLogTime = { fg = C.grey_2 }, - NotifyLogTitle = { fg = C.blue }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/nvim-tree.lua b/dot_config/nvim/lua/default_theme/plugins/nvim-tree.lua deleted file mode 100644 index 48114ff..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/nvim-tree.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - NvimTreeFolderIcon = { fg = C.blue }, - NvimTreeExecFile = { fg = C.green }, - NvimTreeOpenedFile = { fg = C.green }, - NvimTreeRootFolder = { fg = C.bg }, - NvimTreeEndOfBuffer = { fg = C.bg }, - NvimTreeNormal = { bg = C.blue_2 }, - NvimTreeNormalNC = { bg = C.blue_2 }, - NvimTreeVertSplit = { fg = C.blue_2, bg = C.blue_2 }, - NvimTreeImageFile = { fg = C.purple }, - NvimTreeSymlink = { fg = C.cyan }, - NvimTreeSpecialFile = { fg = C.yellow }, - NvimTreeGitDeleted = { fg = C.red }, - NvimTreeGitMerge = { fg = C.orange }, - NvimTreeGitRenamed = { fg = C.purple }, - NvimTreeGitStaged = { fg = C.green }, - NvimTreeGitDirty = { fg = C.red }, - NvimTreeGitNew = { fg = C.yellow }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/nvim-web-devicons.lua b/dot_config/nvim/lua/default_theme/plugins/nvim-web-devicons.lua deleted file mode 100644 index d76961d..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/nvim-web-devicons.lua +++ /dev/null @@ -1,34 +0,0 @@ -return { - DevIconC = { fg = C.c }, - DevIconCss = { fg = C.css }, - DevIconDeb = { fg = C.deb }, - DevIconDockerfile = { fg = C.docker }, - DevIconHtml = { fg = C.html }, - DevIconJpeg = { fg = C.jpeg }, - DevIconJpg = { fg = C.jpg }, - DevIconJs = { fg = C.js }, - DevIconJsx = { fg = C.jsx }, - DevIconKotlin = { fg = C.kt }, - DevIconLock = { fg = C.lock }, - DevIconLua = { fg = C.lua }, - DevIconMp3 = { fg = C.mp3 }, - DevIconMp4 = { fg = C.mp4 }, - DevIconOut = { fg = C.out }, - DevIconPng = { fg = C.png }, - DevIconPy = { fg = C.py }, - DevIconRb = { fg = C.rb }, - DevIconRobots = { fg = C.robots }, - DevIconRpm = { fg = C.rpm }, - DevIconRs = { fg = C.rs }, - DevIconToml = { fg = C.toml }, - DevIconTrueTypeFont = { fg = C.ttf }, - DevIconTs = { fg = C.ts }, - DevIconVue = { fg = C.vue }, - DevIconWebOpenFontFormat = { fg = C.woff }, - DevIconWebOpenFontFormat2 = { fg = C.woff2 }, - DevIconXz = { fg = C.zip }, - DevIconZip = { fg = C.zip }, - DevIconMd = { fg = C.md }, - DevIconPackageJson = { fg = C.pkg }, - DevIconPackageLockJson = { fg = C.pkg }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/rainbow.lua b/dot_config/nvim/lua/default_theme/plugins/rainbow.lua deleted file mode 100644 index 2165c07..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/rainbow.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - rainbowcol1 = { fg = "Gold" }, - rainbowcol2 = { fg = "Orchid" }, - rainbowcol3 = { fg = "LightSkyBlue" }, - rainbowcol4 = { fg = "Gold" }, - rainbowcol5 = { fg = "Orchid" }, - rainbowcol6 = { fg = "LightSkyBlue" }, - rainbowcol7 = { fg = "Orchid" }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/symbols_outline.lua b/dot_config/nvim/lua/default_theme/plugins/symbols_outline.lua deleted file mode 100644 index 362e49e..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/symbols_outline.lua +++ /dev/null @@ -1 +0,0 @@ -return { FocusedSymbol = { fg = C.yellow, bg = C.none } } diff --git a/dot_config/nvim/lua/default_theme/plugins/telescope.lua b/dot_config/nvim/lua/default_theme/plugins/telescope.lua deleted file mode 100644 index 3d0a8f0..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/telescope.lua +++ /dev/null @@ -1,57 +0,0 @@ -return { - TelescopeResultsTitle = { fg = C.green }, - TelescopePromptTitle = { fg = C.blue }, - TelescopePreviewTitle = { fg = C.purple }, - TelescopeResultsBorder = { fg = C.fg }, - TelescopePromptBorder = { fg = C.fg }, - TelescopePreviewBorder = { fg = C.fg }, - TelescopeSelectionCaret = { fg = C.red }, - TelescopeMatching = { fg = C.yellow }, - TelescopeSelection = { bg = C.grey_5 }, - TelescopeMultiSelection = { fg = C.blue }, - TelescopeMultiIcon = { fg = C.blue }, - TelescopeNormal = { fg = C.fg, bg = C.bg }, - TelescopePreviewNormal = { fg = C.fg, bg = C.bg }, - TelescopePromptNormal = { fg = C.fg, bg = C.bg }, - TelescopeResultsNormal = { fg = C.fg, bg = C.bg }, - TelescopeBorder = { fg = C.fg }, - TelescopeTitle = { fg = C.fg }, - TelescopePromptCounter = { fg = C.grey_1 }, - TelescopePromptPrefix = { fg = C.blue }, - TelescopePreviewLine = { bg = C.grey_5 }, - TelescopePreviewMatch = { fg = C.yellow }, - TelescopePreviewPipe = { fg = C.yellow }, - TelescopePreviewCharDev = { fg = C.yellow }, - TelescopePreviewDirectory = { fg = C.blue }, - TelescopePreviewBlock = { fg = C.yellow }, - TelescopePreviewLink = { fg = C.blue }, - TelescopePreviewSocket = { fg = C.purple }, - TelescopePreviewRead = { fg = C.yellow }, - TelescopePreviewWrite = { fg = C.purple }, - TelescopePreviewExecute = { fg = C.green }, - TelescopePreviewHyphen = { fg = C.grey_1 }, - TelescopePreviewSticky = { fg = C.blue }, - TelescopePreviewSize = { fg = C.green }, - TelescopePreviewUser = { fg = C.yellow }, - TelescopePreviewGroup = { fg = C.yellow }, - TelescopePreviewDate = { fg = C.blue }, - TelescopePreviewMessage = { fg = C.fg }, - TelescopePreviewMessageFillchar = { fg = C.fg }, - TelescopeResultsClass = { fg = C.yellow }, - TelescopeResultsConstant = { fg = C.yellow }, - TelescopeResultsField = { fg = C.red }, - TelescopeResultsFunction = { fg = C.blue }, - TelescopeResultsMethod = { fg = C.blue }, - TelescopeResultsOperator = { fg = C.cyan }, - TelescopeResultsStruct = { fg = C.purple }, - TelescopeResultsVariable = { fg = C.red }, - TelescopeResultsLineNr = { fg = C.grey_1 }, - TelescopeResultsIdentifier = { fg = C.blue }, - TelescopeResultsNumber = { fg = C.orange }, - TelescopeResultsComment = { fg = C.grey_2 }, - TelescopeResultsSpecialComment = { fg = C.grey }, - TelescopeResultsDiffChange = { fg = C.none, bg = C.yellow }, - TelescopeResultsDiffAdd = { fg = C.none, bg = C.green }, - TelescopeResultsDiffDelete = { fg = C.none, bg = C.red }, - TelescopeResultsDiffUntracked = { fg = C.none, bg = C.grey_1 }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/treesitter.lua b/dot_config/nvim/lua/default_theme/plugins/treesitter.lua deleted file mode 100644 index 66380af..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/treesitter.lua +++ /dev/null @@ -1,63 +0,0 @@ -local treesitter = { - ["@annotation"] = { fg = C.yellow }, - ["@attribute"] = { fg = C.red }, - ["@boolean"] = { fg = C.orange }, - ["@character"] = { fg = C.green }, - ["@conditional"] = { fg = C.purple }, - ["@constant"] = { fg = C.yellow }, - ["@constant.builtin"] = { fg = C.orange }, - ["@constant.macro"] = { fg = C.red }, - ["@constant.rust"] = { fg = C.cyan }, - ["@constructor"] = { fg = C.yellow }, - ["@error"] = { fg = C.red }, - ["@exception"] = { fg = C.purple }, - ["@field"] = { fg = C.red }, - ["@float"] = { fg = C.orange }, - ["@function"] = { fg = C.blue }, - ["@function.builtin"] = { fg = C.blue }, - ["@function.macro"] = { fg = C.yellow }, - ["@function.macro.rust"] = { fg = C.orange }, - ["@include"] = { fg = C.purple }, - ["@keyword"] = { fg = C.purple }, - ["@keyword.function"] = { fg = C.purple }, - ["@keyword.function.rust"] = { fg = C.orange }, - ["@keyword.operator"] = { fg = C.purple }, - ["@label"] = { fg = C.blue }, - ["@literal.markdown"] = { fg = C.green }, - ["@method"] = { fg = C.blue }, - ["@namespace"] = { fg = C.purple }, - ["@namespace.rust"] = { fg = C.yellow }, - ["@none.markdown"] = { fg = C.fg }, - ["@number"] = { fg = C.orange }, - ["@operator"] = { fg = C.cyan }, - ["@parameter"] = { fg = C.red }, - ["@parameter.reference"] = { fg = C.cyan }, - ["@property"] = { fg = C.yellow }, - ["@punctuation.bracket"] = { fg = C.fg }, - ["@punctuation.delimiter"] = { fg = C.fg }, - ["@punctuation.delimiter.markdown"] = { fg = C.fg }, - ["@punctuation.special"] = { fg = C.fg }, - ["@punctuation.special.markdown"] = { fg = C.red }, - ["@repeat"] = { fg = C.purple }, - ["@string"] = { fg = C.green }, - ["@string.escape"] = { fg = C.red }, - ["@string.regex"] = { fg = C.green }, - ["@tag"] = { fg = C.red }, - ["@tag.delimiter"] = { fg = C.fg }, - ["@text"] = { fg = C.fg }, - ["@text.emphasis"] = { fg = C.purple, italic = true }, - ["@text.literal"] = { fg = C.fg }, - ["@text.reference"] = { fg = C.yellow }, - ["@text.strong"] = { fg = C.blue, bold = true }, - ["@text.title"] = { fg = C.fg }, - ["@text.underline"] = { fg = C.fg }, - ["@text.uri"] = { fg = C.green }, - ["@title.markdown"] = { fg = C.red }, - ["@type"] = { fg = C.blue }, - ["@type.builtin"] = { fg = C.blue }, - ["@type.rust"] = { fg = C.yellow }, - ["@variable"] = { fg = C.red }, - ["@variable.builtin"] = { fg = C.yellow }, -} - -return treesitter diff --git a/dot_config/nvim/lua/default_theme/plugins/vimwiki.lua b/dot_config/nvim/lua/default_theme/plugins/vimwiki.lua deleted file mode 100644 index 8be9dec..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/vimwiki.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - VimwikiLink = { fg = C.cyan, bg = C.none }, - VimwikiHeaderChar = { fg = C.grey, bg = C.none }, - VimwikiHR = { fg = C.yellow, bg = C.none }, - VimwikiList = { fg = C.orange, bg = C.none }, - VimwikiTag = { fg = C.orange, bg = C.none }, - VimwikiMarkers = { fg = C.grey, bg = C.none }, - VimwikiHeader1 = { fg = C.orange, bg = C.none, bold = true }, - VimwikiHeader2 = { fg = C.green, bg = C.none, bold = true }, - VimwikiHeader3 = { fg = C.blue, bg = C.none, bold = true }, - VimwikiHeader4 = { fg = C.cyan, bg = C.none, bold = true }, - VimwikiHeader5 = { fg = C.yellow, bg = C.none, bold = true }, - VimwikiHeader6 = { fg = C.purple, bg = C.none, bold = true }, -} diff --git a/dot_config/nvim/lua/default_theme/plugins/which-key.lua b/dot_config/nvim/lua/default_theme/plugins/which-key.lua deleted file mode 100644 index 7bc6da2..0000000 --- a/dot_config/nvim/lua/default_theme/plugins/which-key.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - WhichKeyFloat = { fg = C.fg }, - WhichKeyDesc = { fg = C.blue }, - WhichKeyGroup = { fg = C.blue }, -} diff --git a/dot_config/nvim/lua/default_theme/treesitter.lua b/dot_config/nvim/lua/default_theme/treesitter.lua deleted file mode 100644 index c5ea515..0000000 --- a/dot_config/nvim/lua/default_theme/treesitter.lua +++ /dev/null @@ -1,59 +0,0 @@ -local treesitter = { - TSError = { fg = C.red }, - TSPunctDelimiter = { fg = C.fg }, - TSPunctBracket = { fg = C.fg }, - TSPunctSpecial = { fg = C.fg }, - TSConstant = { fg = C.yellow }, - TSConstBuiltin = { fg = C.orange }, - TSConstMacro = { fg = C.red }, - TSStringRegex = { fg = C.green }, - TSString = { fg = C.green }, - TSStringEscap = { fg = C.red }, - TSCharacter = { fg = C.green }, - TSNumber = { fg = C.orange }, - TSBoolean = { fg = C.orange }, - TSFloat = { fg = C.green }, - TSAnnotation = { fg = C.yellow }, - TSAttribute = { fg = C.red }, - TSNamespace = { fg = C.purple }, - TSFuncBuiltin = { fg = C.blue }, - TSFunction = { fg = C.blue }, - TSFuncMacro = { fg = C.yellow }, - TSParameter = { fg = C.red }, - TSParameterReference = { fg = C.cyan }, - TSMethod = { fg = C.blue }, - TSField = { fg = C.red }, - TSProperty = { fg = C.yellow }, - TSConstructor = { fg = C.yellow }, - TSConditional = { fg = C.purple }, - TSRepeat = { fg = C.purple }, - TSLabel = { fg = C.blue }, - TSKeyword = { fg = C.purple }, - TSKeywordFunction = { fg = C.purple }, - TSKeywordOperator = { fg = C.purple }, - TSOperator = { fg = C.cyan }, - TSException = { fg = C.purple }, - TSType = { fg = C.blue }, - TSTypeBuiltin = { fg = C.blue }, - TSStructure = { fg = C.purple }, - TSInclude = { fg = C.purple }, - TSVariable = { fg = C.red }, - TSVariableBuiltin = { fg = C.yellow }, - TSText = { fg = C.fg }, - TSTextReference = { fg = C.yellow }, - TSStrong = { fg = C.blue, style = "bold" }, - TSEmphasis = { fg = C.purple, style = "italic" }, - TSUnderline = { fg = C.fg }, - TSTitle = { fg = C.fg }, - TSLiteral = { fg = C.fg }, - TSURI = { fg = C.green }, - TSTag = { fg = C.red }, - TSTagDelimiter = { fg = C.fg }, - markdownTSNone = { fg = C.fg }, - markdownTSTitle = { fg = C.red }, - markdownTSLiteral = { fg = C.green }, - markdownTSPunctSpecial = { fg = C.red }, - markdownTSPunctDelimiter = { fg = C.fg }, -} - -return treesitter diff --git a/dot_config/nvim/lua/default_theme/utils.lua b/dot_config/nvim/lua/default_theme/utils.lua deleted file mode 100644 index cfb45b7..0000000 --- a/dot_config/nvim/lua/default_theme/utils.lua +++ /dev/null @@ -1,24 +0,0 @@ -local M = {} - -local user_settings = astronvim.user_plugin_opts "default_theme" - -function M.parse_diagnostic_style(default) - if type(user_settings.diagnostics_style) == "table" then - default = vim.tbl_deep_extend("force", user_settings.diagnostics_style, default) - elseif type(user_settings.diagnostics_style) == "string" then - default.style = user_settings.diagnostics_style - end - return default -end - -function M.parse_style(spec) - if spec.style then - for match in (spec.style .. ","):gmatch "(.-)," do - spec[match] = true - end - spec.style = nil - end - return spec -end - -return M diff --git a/dot_config/nvim/lua/user_example/init.lua b/dot_config/nvim/lua/user_example/init.lua deleted file mode 100644 index df6eb85..0000000 --- a/dot_config/nvim/lua/user_example/init.lua +++ /dev/null @@ -1,336 +0,0 @@ --- AstroNvim Configuration Table --- All configuration changes should go inside of the table below - --- You can think of a Lua "table" as a dictionary like data structure the --- normal format is "key = value". These also handle array like data structures --- where a value with no key simply has an implicit numeric key -local config = { - - -- Configure AstroNvim updates - updater = { - remote = "origin", -- remote to use - channel = "nightly", -- "stable" or "nightly" - version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY) - branch = "main", -- branch name (NIGHTLY ONLY) - commit = nil, -- commit hash (NIGHTLY ONLY) - pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only) - skip_prompts = false, -- skip prompts about breaking changes - show_changelog = true, -- show the changelog after performing an update - auto_reload = false, -- automatically reload and sync packer after a successful update - auto_quit = false, -- automatically quit the current session after a successful update - -- remotes = { -- easily add new remotes to track - -- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url - -- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut, - -- ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork - -- }, - }, - - -- Set colorscheme to use - colorscheme = "default_theme", - - -- Add highlight groups in any theme - highlights = { - -- init = { -- this table overrides highlights in all themes - -- Normal = { bg = "#000000" }, - -- } - -- duskfox = { -- a table of overrides/changes to the duskfox theme - -- Normal = { bg = "#000000" }, - -- }, - }, - - -- set vim options here (vim.. = value) - options = { - opt = { - -- set to true or false etc. - relativenumber = true, -- sets vim.opt.relativenumber - number = true, -- sets vim.opt.number - spell = false, -- sets vim.opt.spell - signcolumn = "auto", -- sets vim.opt.signcolumn to auto - wrap = false, -- sets vim.opt.wrap - }, - g = { - mapleader = " ", -- sets vim.g.mapleader - autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled) - cmp_enabled = true, -- enable completion at start - autopairs_enabled = true, -- enable autopairs at start - diagnostics_enabled = true, -- enable diagnostics at start - status_diagnostics_enabled = true, -- enable diagnostics in statusline - icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing) - ui_notifications_enabled = true, -- disable notifications when toggling UI elements - }, - }, - -- If you need more control, you can use the function()...end notation - -- options = function(local_vim) - -- local_vim.opt.relativenumber = true - -- local_vim.g.mapleader = " " - -- local_vim.opt.whichwrap = vim.opt.whichwrap - { 'b', 's' } -- removing option from list - -- local_vim.opt.shortmess = vim.opt.shortmess + { I = true } -- add to option list - -- - -- return local_vim - -- end, - - -- Set dashboard header - header = { - " █████ ███████ ████████ ██████ ██████", - "██ ██ ██ ██ ██ ██ ██ ██", - "███████ ███████ ██ ██████ ██ ██", - "██ ██ ██ ██ ██ ██ ██ ██", - "██ ██ ███████ ██ ██ ██ ██████", - " ", - " ███  ██ ██  ██ ██ ███  ███", - " ████  ██ ██  ██ ██ ████  ████", - " ██ ██  ██ ██  ██ ██ ██ ████ ██", - " ██  ██ ██  ██  ██  ██ ██  ██  ██", - " ██   ████   ████   ██ ██      ██", - }, - - -- Default theme configuration - default_theme = { - -- Modify the color palette for the default theme - colors = { - fg = "#abb2bf", - bg = "#1e222a", - }, - highlights = function(hl) -- or a function that returns a new table of colors to set - local C = require "default_theme.colors" - - hl.Normal = { fg = C.fg, bg = C.bg } - - -- New approach instead of diagnostic_style - hl.DiagnosticError.italic = true - hl.DiagnosticHint.italic = true - hl.DiagnosticInfo.italic = true - hl.DiagnosticWarn.italic = true - - return hl - end, - -- enable or disable highlighting for extra plugins - plugins = { - aerial = true, - beacon = false, - bufferline = true, - cmp = true, - dashboard = true, - highlighturl = true, - hop = false, - indent_blankline = true, - lightspeed = false, - ["neo-tree"] = true, - notify = true, - ["nvim-tree"] = false, - ["nvim-web-devicons"] = true, - rainbow = true, - symbols_outline = false, - telescope = true, - treesitter = true, - vimwiki = false, - ["which-key"] = true, - }, - }, - - -- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on - diagnostics = { - virtual_text = true, - underline = true, - }, - - -- Extend LSP configuration - lsp = { - -- enable servers that you already have installed without mason - servers = { - -- "pyright" - }, - formatting = { - -- control auto formatting on save - format_on_save = { - enabled = true, -- enable or disable format on save globally - allow_filetypes = { -- enable format on save for specified filetypes only - -- "go", - }, - ignore_filetypes = { -- disable format on save for specified filetypes - -- "python", - }, - }, - disabled = { -- disable formatting capabilities for the listed language servers - -- "sumneko_lua", - }, - timeout_ms = 1000, -- default format timeout - -- filter = function(client) -- fully override the default formatting function - -- return true - -- end - }, - -- easily add or disable built in mappings added during LSP attaching - mappings = { - n = { - -- ["lf"] = false -- disable formatting keymap - }, - }, - -- add to the global LSP on_attach function - -- on_attach = function(client, bufnr) - -- end, - - -- override the mason server-registration function - -- server_registration = function(server, opts) - -- require("lspconfig")[server].setup(opts) - -- end, - - -- Add overrides for LSP server settings, the keys are the name of the server - ["server-settings"] = { - -- example for addings schemas to yamlls - -- yamlls = { -- override table for require("lspconfig").yamlls.setup({...}) - -- settings = { - -- yaml = { - -- schemas = { - -- ["http://json.schemastore.org/github-workflow"] = ".github/workflows/*.{yml,yaml}", - -- ["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}", - -- ["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}", - -- }, - -- }, - -- }, - -- }, - }, - }, - - -- Mapping data with "desc" stored directly by vim.keymap.set(). - -- - -- Please use this mappings table to set keyboard mapping since this is the - -- lower level configuration and more robust one. (which-key will - -- automatically pick-up stored data by this setting.) - mappings = { - -- first key is the mode - n = { - -- second key is the lefthand side of the map - -- mappings seen under group name "Buffer" - ["bb"] = { "tabnew", desc = "New tab" }, - ["bc"] = { "BufferLinePickClose", desc = "Pick to close" }, - ["bj"] = { "BufferLinePick", desc = "Pick to jump" }, - ["bt"] = { "BufferLineSortByTabs", desc = "Sort by tabs" }, - -- quick save - -- [""] = { ":w!", desc = "Save File" }, -- change description but the same command - }, - t = { - -- setting a mapping to false will disable it - -- [""] = false, - }, - }, - - -- Configure plugins - plugins = { - init = { - -- You can disable default plugins as follows: - -- ["goolord/alpha-nvim"] = { disable = true }, - - -- You can also add new plugins here as well: - -- Add plugins, the packer syntax without the "use" - -- { "andweeb/presence.nvim" }, - -- { - -- "ray-x/lsp_signature.nvim", - -- event = "BufRead", - -- config = function() - -- require("lsp_signature").setup() - -- end, - -- }, - - -- We also support a key value style plugin definition similar to NvChad: - -- ["ray-x/lsp_signature.nvim"] = { - -- event = "BufRead", - -- config = function() - -- require("lsp_signature").setup() - -- end, - -- }, - }, - -- All other entries override the require("").setup({...}) call for default plugins - ["null-ls"] = function(config) -- overrides `require("null-ls").setup(config)` - -- config variable is the default configuration table for the setup function call - -- local null_ls = require "null-ls" - - -- Check supported formatters and linters - -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting - -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics - config.sources = { - -- Set a formatter - -- null_ls.builtins.formatting.stylua, - -- null_ls.builtins.formatting.prettier, - } - return config -- return final config table - end, - treesitter = { -- overrides `require("treesitter").setup(...)` - -- ensure_installed = { "lua" }, - }, - -- use mason-lspconfig to configure LSP installations - ["mason-lspconfig"] = { -- overrides `require("mason-lspconfig").setup(...)` - -- ensure_installed = { "sumneko_lua" }, - }, - -- use mason-null-ls to configure Formatters/Linter installation for null-ls sources - ["mason-null-ls"] = { -- overrides `require("mason-null-ls").setup(...)` - -- ensure_installed = { "prettier", "stylua" }, - }, - ["mason-nvim-dap"] = { -- overrides `require("mason-nvim-dap").setup(...)` - -- ensure_installed = { "python" }, - }, - }, - - -- LuaSnip Options - luasnip = { - -- Extend filetypes - filetype_extend = { - -- javascript = { "javascriptreact" }, - }, - -- Configure luasnip loaders (vscode, lua, and/or snipmate) - vscode = { - -- Add paths for including more VS Code style snippets in luasnip - paths = {}, - }, - }, - - -- CMP Source Priorities - -- modify here the priorities of default cmp sources - -- higher value == higher priority - -- The value can also be set to a boolean for disabling default sources: - -- false == disabled - -- true == 1000 - cmp = { - source_priority = { - nvim_lsp = 1000, - luasnip = 750, - buffer = 500, - path = 250, - }, - }, - - -- Modify which-key registration (Use this with mappings table in the above.) - ["which-key"] = { - -- Add bindings which show up as group name - register = { - -- first key is the mode, n == normal mode - n = { - -- second key is the prefix, prefixes - [""] = { - -- third key is the key to bring up next level and its displayed - -- group name in which-key top level menu - ["b"] = { name = "Buffer" }, - }, - }, - }, - }, - - -- This function is run last and is a good place to configuring - -- augroups/autocommands and custom filetypes also this just pure lua so - -- anything that doesn't fit in the normal config locations above can go here - polish = function() - -- Set up custom filetypes - -- vim.filetype.add { - -- extension = { - -- foo = "fooscript", - -- }, - -- filename = { - -- ["Foofile"] = "fooscript", - -- }, - -- pattern = { - -- ["~/%.config/foo/.*"] = "fooscript", - -- }, - -- } - end, -} - -return config diff --git a/dot_config/nvim/packer_snapshot b/dot_config/nvim/packer_snapshot deleted file mode 100644 index daf26c7..0000000 --- a/dot_config/nvim/packer_snapshot +++ /dev/null @@ -1 +0,0 @@ -{"better-escape.nvim": {"commit": "d5ee0ce"}, "nvim-dap": {"commit": "8f396b7"}, "telescope-fzf-native.nvim": {"commit": "ae9d95d"}, "packer.nvim": {"commit": "64ae65f"}, "nvim-notify": {"commit": "b005821"}, "mason-null-ls.nvim": {"commit": "3058cab"}, "nvim-lspconfig": {"commit": "c720632"}, "smart-splits.nvim": {"commit": "dd244e8"}, "nvim-window-picker": {"commit": "a53a3b7"}, "null-ls.nvim": {"commit": "b3d2ebd"}, "mason-lspconfig.nvim": {"commit": "4674ed1"}, "which-key.nvim": {"commit": "61553ae"}, "bufferline.nvim": {"commit": "4ecfa81"}, "nvim-autopairs": {"commit": "9fa9961"}, "cmp_luasnip": {"commit": "1809552"}, "friendly-snippets": {"commit": "9b3e497"}, "nvim-colorizer.lua": {"commit": "760e27d"}, "lspkind.nvim": {"commit": "c68b3a0"}, "gitsigns.nvim": {"commit": "d076301"}, "SchemaStore.nvim": {"commit": "cb67722"}, "dressing.nvim": {"commit": "ed44aa7"}, "indent-blankline.nvim": {"commit": "db7cbcb"}, "nvim-ts-autotag": {"commit": "fdefe46"}, "neo-tree.nvim": {"commit": "7c6903b"}, "telescope.nvim": {"commit": "cabf991"}, "nvim-ts-context-commentstring": {"commit": "32d9627"}, "Comment.nvim": {"commit": "5f01c1a"}, "mason.nvim": {"commit": "66f02fd"}, "aerial.nvim": {"commit": "50d28ad"}, "alpha-nvim": {"commit": "21a0f25"}, "cmp-nvim-lsp": {"commit": "5922477"}, "LuaSnip": {"commit": "5ce70a0"}, "nvim-dap-ui": {"commit": "54365d2"}, "heirline.nvim": {"commit": "f684e4c"}, "nvim-web-devicons": {"commit": "189ad37"}, "neovim-session-manager": {"commit": "24ceb4b"}, "nvim-treesitter": {"commit": "440401c"}, "nui.nvim": {"commit": "d12a697"}, "impatient.nvim": {"commit": "d3dd30f"}, "indent-o-matic": {"commit": "749b7cb"}, "mason-nvim-dap.nvim": {"commit": "88257d5"}, "toggleterm.nvim": {"commit": "3ba6838"}, "plenary.nvim": {"commit": "4b7e520"}, "bufdelete.nvim": {"commit": "f79e9d1"}, "nvim-cmp": {"commit": "93f385c"}, "nvim-ts-rainbow": {"commit": "064fd6c"}, "cmp-path": {"commit": "91ff86c"}, "cmp-buffer": {"commit": "3022dbc"}} diff --git a/dot_config/waybar/config.jsonc b/dot_config/waybar/config.jsonc index b568b92..2d3882b 100644 --- a/dot_config/waybar/config.jsonc +++ b/dot_config/waybar/config.jsonc @@ -1,7 +1,7 @@ { // "layer": "top", // Waybar at top layer // "position": "bottom", // Waybar position (top|bottom|left|right) - "height": 35, // Waybar height (to be removed for auto height) + "height": 38, // Waybar height (to be removed for auto height) // "width": 1280, // Waybar width "spacing": 8, // Gaps between modules (4px) // Choose the order of the modules @@ -86,6 +86,7 @@ "critical": 15 }, "format": "{capacity}% {icon}", + "format-charging": "{capacity}% {icon} ", "format-icons": [ "", "", @@ -96,7 +97,7 @@ "max-length": 25 }, "custom/spotify": { - "format": " {icon}{}", + "format": "{icon}{}", "escape": true, "return-type": "json", "format-icons": { @@ -105,10 +106,8 @@ }, "max-length": 40, // "interval": 30, - "on-click": "spt playback --toggle", + "on-click": "playerctl play-pause", "on-click-right": "kitty spt", - //"exec": "zscroll --delay 0.2 --match-command \"spt playback\" --update-check true \"spt playback\" &", - "exec": "playerctl -a metadata --format '{\"text\": \"{{markup_escape(title)}} - {{artist}}\", \"tooltip\": \"{{markup_escape(title)}} - {{artist}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F", - "exec-if": "pgrep spotify" + "exec": "playerctl -a metadata --format '{\"text\": \"{{markup_escape(title)}} - {{artist}}\", \"tooltip\": \"{{markup_escape(title)}} - {{artist}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F" } } diff --git a/dot_config/waybar/style.css b/dot_config/waybar/style.css index 544e84b..dd88186 100644 --- a/dot_config/waybar/style.css +++ b/dot_config/waybar/style.css @@ -5,6 +5,7 @@ font-size: 13px; min-height: 0; /*padding-right: 2px;*/ + background: rgba(17, 21, 26, 0.4); } window#waybar {