├── .gitignore ├── LICENSE ├── README.md ├── ftdetect └── zon.lua ├── ftplugin ├── gitcommit.lua ├── help.lua ├── lua │ └── mapping.lua ├── python.lua ├── zig.lua └── zsh.lua ├── init.lua ├── lua ├── config │ ├── autocmds.lua │ ├── defaults.lua │ ├── init.lua │ ├── keymaps │ │ ├── editor.lua │ │ ├── init.lua │ │ └── lsp.lua │ ├── lazy.lua │ ├── options.lua │ ├── syntax.lua │ └── utils.lua └── plugins │ ├── colorscheme.lua │ ├── completions.lua │ ├── dap.lua │ ├── dashboard.lua │ ├── editor.lua │ ├── gitsigns.lua │ ├── lsp.lua │ ├── neorg.lua │ ├── statusbar.lua │ ├── telescope.lua │ ├── tree.lua │ ├── treesitter.lua │ └── ui.lua ├── luajit.yml ├── selene.toml └── stylua.toml /.gitignore: -------------------------------------------------------------------------------- 1 | lazy-lock.json 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Awesome Neovim Configuration 2 | 3 | This repo it to make setting up of [neovim][nvim] >= 0.9 a breeze. 4 | The setup is powered and managed by [💤 lazy.nvim][lazy-nvim] plugin manager 5 | 6 | >If you like [_**helix**_](https://github.com/helix-editor/helix), which I am drifting to gradually, check out my [_**helix config**_][awesome-helix] 7 | 8 | ## ✨ Features Supported 9 | - ⚡ zig, 󰙱 C ,  C++, 󰢱 lua and all other language compilers 10 | - 📦 linters and static analysis through null-ls 11 | - 🥂 lsp servers configured with nvim-lspconfig 12 | - 🧹 autocompletion, formatters and all other features supported by neovim's builtin lsp 13 | - 🦸 Any build system 14 | - ✴️ Treesitter syntax highlighting 15 | - 🔥 Transform your Neovim editor into a full-fledged IDE 16 | - 💤 Easily customize and extend config 17 | - 🚀 Blazingly fast using 💤 [lazy.nvim][lazy-nvim] and the new lua-loader that byte-compiles and caches lua files 18 | 19 | 20 | ## 😍 Screenshots 21 | 22 | ###  C++ 23 | ![c++ with code action](https://user-images.githubusercontent.com/22438427/232250467-a2b64fcd-fe02-4376-9ff3-a4062e6e53d3.png) 24 | ![c++ with errors](https://user-images.githubusercontent.com/22438427/232250501-06f54292-46ad-44e7-945b-6d0ddb655621.png) 25 | 26 | ### ⚡ Zig 27 | ![Zig(onedark colorscheme) with error](https://user-images.githubusercontent.com/22438427/232316211-99bbe5cf-ccf3-4727-a7ae-79cb889e4cad.png) 28 | ![Zig(onedark colorscheme) struct hovered](https://user-images.githubusercontent.com/22438427/232316227-5b01cbe5-6ddf-41f7-a257-e9a2c5d08d3a.png) 29 | 30 | ### 󰢱 Lua 31 | ![Lua with with errors](https://user-images.githubusercontent.com/22438427/232250603-e33108ab-235b-42f6-b12a-478ac259d93e.png) 32 | ![Lua with preview definition](https://user-images.githubusercontent.com/22438427/232250636-0500c2c7-04db-4438-b9b9-5e04a2f2ac02.png) 33 | 34 | ### 🚀 Startup Time 35 | ![startup time with zig](https://user-images.githubusercontent.com/22438427/232324710-31e6eff9-15a6-4968-9998-503e7dc55cdf.png) 36 | 37 | ## ⚡️ Requirement 38 | - Neovim >= **0.9.0** (needs to be built with **LuaJIT**) 39 | - git >= **2.40.0** (gitsigns ...) 40 | - tree-sitter >= **0.20.8** (to enable automatically installing missing parsers when entering buffers) 41 | - a [Nerd Font](https://www.nerdfonts.com/) **_(optional, for nvim-tree, lualine, bufferline)_** 42 | 43 | 44 | >__NOTE__ the languages supported out of the box are 45 | > zig, c++, c, lua, bash/zsh, glsl, json 46 | > __But__ support for other languages like(js, ts, html5+, css3+, vue, markdown, nix) can easily be add by using 47 | > its required [lsp server configuration](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md) 48 | and installing the server and other accompanying tools for development like linters, static analysers, formatter 49 | 50 | 51 | ## 📂 Directory structure 52 | ``` 53 | 📂 ~/.config/nvim 54 | ├── 📂 ftplugin 55 | │ └── 📂 lua 56 | │ │ └──  mapping.lua 57 | │ ├──  gitcommit.lua 58 | │ ├──  help.lua 59 | │ └──  zsh.lua 60 | ├── 📂 lua 61 | │ └── 📂 config 62 | │ │ ├──  autocmds.lua 63 | │ │ ├──  defaults.lua 64 | │ │ ├──  init.lua 65 | │ │ ├──  keymaps.lua 66 | │ │ ├──  lazy.lua 67 | │ │ ├──  options.lua 68 | │ │ ├──  syntax.lua 69 | │ │ └──  utils.lua 70 | │ └── 📂 plugins 71 | │ ├──  cmp.lua 72 | │ ├──  colorscheme.lua 73 | │ ├──  editor.lua 74 | │ ├──  gitsigns.lua 75 | │ ├──  lsp.lua 76 | │ ├──  neorg.lua 77 | │ ├──  snip.lua 78 | │ ├──  telescope.lua 79 | │ ├──  tree.lua 80 | │ ├──  treesitter.lua 81 | │ └──  ui.lua 82 | ├──  init.lua 83 | ├──  lazy-lock.json 84 | ├──  LICENSE 85 | └──  README.md 86 | ``` 87 | 88 | `ftplugin` directory contains files for setting `options` or `mappings` specific to filetypes 89 | 90 | `lua/config` directory contains editor `autocmds`, `keymaps`, `options`, `defaults`, `syntax files`, `utils fn's` and 91 | `lazy.nvim` configuration 92 | 93 | `lua/plugins` directory contains all `plugins` configurations and their `mappings` 94 | 95 | `init` initializing/start point for nvim editor 96 | 97 | 98 | --- 99 | 100 | 101 | ## 🚀 Getting Started 102 | 103 | You can find **awesome-neovim** [here][awesome-nvim] 104 | 105 |
Follow the steps below to use awesome-neovim 106 | 107 | - fork this repo into your account 108 | 109 | GitHub [how to fork a repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo) 110 | 111 | 112 | - Make a backup of your current Neovim files at `$XDG_CONFIG_HOME/nvim` and `$XDG_DATA_HOME/nvim`: 113 | 114 | ```sh 115 | mv ~/.config/nvim ~/.config/nvim.bak 116 | mv ~/.local/share/nvim ~/.local/share/nvim.bak 117 | ``` 118 | 119 | - Clone the repo into `$XDG_CONFIG_HOME/nvim` or `$HOME/.config/nvim` 120 | 121 | ```sh 122 | git clone https://github.com/${YOUR-USERNAME}/awesome-neovim $XDG_CONFIG_HOME/nvim 123 | 124 | ``` 125 | 126 | - Start Neovim! 127 | 128 | ```sh 129 | nvim 130 | ``` 131 |
132 | 133 | 134 | --- 135 | 136 | 137 | ## ⚙️ For information on how to use [lazy.nvim][lazy-nvim] 138 | 139 | You can thoroughly go through awesome-neovim configuration and if 140 | more clarification is required read [lazy's][lazy-nvim] README 141 | 142 | **for help using the various plugins and extensions** 143 | 144 | ```zsh 145 | :help local-addtions 146 | ``` 147 | 148 | To view the help pages and instruction manual on the various extensions 149 | 150 | 151 | [awesome-nvim]: https://github.com/Ultra-Code/awesome-neovim 152 | [lazy-nvim]: https://github.com/folke/lazy.nvim 153 | [nvim]: https://github.com/neovim/neovim/ 154 | [awesome-helix]: https://github.com/Ultra-Code/awesome-helix 155 | 156 | ## 👏 Credit 157 | - *Huge credit to* [_@folke_](https://github.com/folke), *I learnt a lot from his lazy config* [repo](https://github.com/LazyVim/LazyVim) 158 | - *Big Shout Out to the creators of the various plugins which make nvim terrific* 159 | - *Another to all the creators of the various neovim extensions.* 160 | 161 | >And Last but not the least __God Bless The Vim && Neovim Community for this hyperextensible and hackable text editor__ 162 | -------------------------------------------------------------------------------- /ftdetect/zon.lua: -------------------------------------------------------------------------------- 1 | --add zon as a zig file 2 | vim.filetype.add({ 3 | extension = { 4 | zon = "zig", 5 | }, 6 | filename = { 7 | ["build.zig.zon"] = "zig", 8 | }, 9 | pattern = { 10 | [".*%.zig.zon$"] = "zig", 11 | }, 12 | }) 13 | -------------------------------------------------------------------------------- /ftplugin/gitcommit.lua: -------------------------------------------------------------------------------- 1 | vim.opt_local.textwidth = 72 2 | -------------------------------------------------------------------------------- /ftplugin/help.lua: -------------------------------------------------------------------------------- 1 | vim.treesitter.start() 2 | -------------------------------------------------------------------------------- /ftplugin/lua/mapping.lua: -------------------------------------------------------------------------------- 1 | local utils = require("config.utils") 2 | local map = vim.keymap.set 3 | 4 | -- reload/source current file 5 | map("n", ".", function() 6 | vim.cmd([[luafile %]]) 7 | vim.notify("reloaded " .. vim.fn.expand("%")) 8 | end, { buffer = true, desc = "reload current lua file" }) 9 | 10 | -- reload a particular module 11 | map("n", "rm", function() 12 | vim.ui.input({ 13 | prompt = "Enter the name of the module you want to reload:", 14 | default = nil, 15 | completion = "file", 16 | }, function(module_name) 17 | if module_name == "" then 18 | return 19 | else 20 | utils.reload_one(module_name) 21 | vim.notify( 22 | "!Reloaded Nvim Module " .. module_name .. ".lua!", 23 | vim.log.levels.INFO 24 | ) 25 | end 26 | end) 27 | end, { buffer = true, desc = "reload a particular lua module" }) 28 | 29 | -- reload all nvim configuration modules 30 | -- map("n", "ra", function() 31 | -- utils.reload_all() 32 | -- vim.notify("!Reloaded All Nvim Modules!", vim.log.levels.INFO) 33 | -- end, { buffer = true, desc = "reload all modules" }) 34 | -------------------------------------------------------------------------------- /ftplugin/python.lua: -------------------------------------------------------------------------------- 1 | -- match textwidth with black 2 | vim.opt_local.textwidth = 99 3 | -------------------------------------------------------------------------------- /ftplugin/zig.lua: -------------------------------------------------------------------------------- 1 | -- h ftplugin |Disabling| 2 | -- vim.b.did_ftplugin = 1 3 | -- disable auto fomart with ast check 4 | vim.g.zig_fmt_autosave = 0 5 | -------------------------------------------------------------------------------- /ftplugin/zsh.lua: -------------------------------------------------------------------------------- 1 | vim.opt_local.filetype = "zsh" 2 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | --Enable the new |lua-loader| that byte-compiles and caches lua files. 2 | vim.loader.enable() 3 | 4 | -- setup editor options -> syntax -> autocmds -> mappings 5 | require("config") 6 | 7 | -- bootstrap lazy.nvim 8 | require("config.lazy") 9 | -------------------------------------------------------------------------------- /lua/config/autocmds.lua: -------------------------------------------------------------------------------- 1 | local autocmd = vim.api.nvim_create_autocmd -- create autocmd 2 | local utils = require("config.utils") 3 | local map = utils.map 4 | local augroup = utils.augroup 5 | 6 | -- define autocmd in a group so that you can clear it easily 7 | autocmd({ "TermOpen" }, { 8 | group = augroup("Terminal"), 9 | pattern = { "*" }, 10 | callback = function() 11 | vim.wo.number = false 12 | vim.wo.relativenumber = false 13 | vim.api.nvim_command("startinsert") 14 | end, 15 | }) 16 | 17 | -- Highlight on yank 18 | autocmd("TextYankPost", { 19 | group = augroup("highlight_yank"), 20 | callback = function() 21 | vim.highlight.on_yank() 22 | end, 23 | }) 24 | 25 | -- resize splits if window got resized 26 | autocmd({ "VimResized" }, { 27 | group = augroup("resize_splits"), 28 | callback = function() 29 | vim.cmd("wincmd =") 30 | vim.cmd("tabdo wincmd =") 31 | end, 32 | }) 33 | 34 | -- go to the last known loc/position when opening a file/buffer 35 | -- :h restore-position and :h restore-cursor 36 | autocmd("BufReadPost", { 37 | group = augroup("restore cursor"), 38 | pattern = { "*" }, 39 | callback = function() 40 | local mark = vim.api.nvim_buf_get_mark(0, '"') 41 | local lcount = vim.api.nvim_buf_line_count(0) 42 | if mark[1] >= 1 and mark[1] <= lcount then 43 | pcall(vim.api.nvim_win_set_cursor, 0, mark) 44 | end 45 | end, 46 | }) 47 | 48 | -- close some filetypes with 49 | autocmd("FileType", { 50 | group = augroup("close_with_q"), 51 | pattern = { 52 | "PlenaryTestPopup", 53 | "help", 54 | "lspinfo", 55 | "man", 56 | "notify", 57 | "qf", 58 | "query", -- :InspectTree 59 | "spectre_panel", 60 | "startuptime", 61 | "tsplayground", 62 | }, 63 | callback = function(event) 64 | -- :help api-autocmd 65 | -- nvim_create_autocmd's callback receives a table argument with fields 66 | -- event = {id,event,group?,match,buf,file,data(arbituary data)} 67 | vim.bo[event.buf].buflisted = false 68 | map( 69 | "n", 70 | "q", 71 | "close", 72 | { buffer = event.buf, silent = true }, 73 | "close some filetype windows with " 74 | ) 75 | end, 76 | }) 77 | 78 | -- wrap and check for spell in text filetypes 79 | autocmd("FileType", { 80 | group = augroup("wrap_spell"), 81 | pattern = { "gitcommit", "markdown", "norg" }, 82 | callback = function() 83 | vim.opt_local.wrap = true 84 | vim.opt_local.spell = true 85 | end, 86 | }) 87 | 88 | local diagnostics_options = require("config.defaults").diagnostics_options 89 | -- automatically show diagnostics on current line 90 | autocmd({ "CursorHold" }, { 91 | callback = function() 92 | vim.diagnostic.open_float(nil, diagnostics_options.float) 93 | end, 94 | }) 95 | 96 | -- Remove Trailing whitespaces in all files 97 | autocmd({ "BufWritePre" }, { pattern = { "*" }, command = [[%s/\s\+$//e]] }) 98 | 99 | -- Remove Trailing windows carriage return in all files 100 | if vim.fn.has("win64") == 1 or vim.fn.has("wsl") == 1 then 101 | autocmd({ "BufWritePre" }, { pattern = { "*" }, command = [[%s/\r$//e]] }) 102 | end 103 | 104 | -- Enable auto formating at textwidth 105 | autocmd({ "FileType" }, { 106 | group = augroup("FormatOptions"), 107 | pattern = { "*" }, 108 | -- INFO: https://stackoverflow.com/questions/16030639/vim-formatoptions-or/16035812#16035812 109 | -- https://stackoverflow.com/questions/76259118/neovim-vim-optremove-doesnt-actually-change-the-option 110 | callback = function() 111 | vim.opt.formatoptions = { 112 | t = true, 113 | c = true, 114 | r = true, 115 | o = true, 116 | q = true, 117 | ["]"] = true, 118 | j = true, 119 | } 120 | end, 121 | }) 122 | -------------------------------------------------------------------------------- /lua/config/defaults.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- icons used by other plugins 3 | icons = { 4 | diagnostics = { 5 | Error = "󰅚 ", --🅴," ""󰢃 " 6 | Warn = "󰀪 ", --🆆," " 7 | Hint = "󰌶", --🅸," " "󰛩 " 8 | Info = " ", --🅷," ","󰗡 " 9 | }, 10 | debugger = { 11 | DapBreakpoint = " ", --▶️breakpoints 12 | DapBreakpointCondition = " ", --conditional breakpoints 13 | DapLogPoint = " ", --log points 14 | DapStopped = " ", --🟥indicate where the debugee is stopped 15 | DapBreakpointRejected = " ", --indicate breakpoints rejected by the debug 16 | }, 17 | git = { 18 | add = { text = "│" }, --" ","▎" 19 | change = { text = "!" }, --" ", 20 | delete = { text = "_" }, --" ","" 21 | topdelete = { text = "‾" }, 22 | changedelete = { text = "~" }, 23 | untracked = { text = "┆" }, 24 | }, 25 | kinds = { 26 | Array = " ", 27 | Boolean = " ", 28 | Class = " ", --"󰠱 ", 29 | Color = " ", --"󰏘 ", "󰸌 " 30 | Constant = " ", 31 | Constructor = "", 32 | Copilot = " ", 33 | Enum = " ", 34 | EnumMember = "", 35 | Event = " ", --"", 36 | Field = "󰄶 ", --"󰘻 ","󰄷 " 37 | File = "󰈙", -- 󰷈 󱪗 󱪝 38 | Folder = " ", --󰉋  39 | Function = "󰊕", --"󰡱 " 40 | Interface = " ", --"", 41 | Keyword = "󰌋 ", --"󱕵" 42 | Method = "󰆧 ", 43 | Module = " ", 44 | Namespace = " ", 45 | Null = " ", 46 | Number = " ", 47 | Object = " ", 48 | Operator = " ", --"󰆕", 49 | Package = "󰏗 ", 50 | Property = " ", --" ",󱉯 51 | Reference = " ", --"", 52 | Snippet = " ", 53 | String = " ", 54 | Struct = " ", --" ", 55 | Text = "󰊄 ", --" ",󰚞 56 | TypeParameter = " ", 57 | Unit = " ", --"", 58 | Value = "󰎠", 59 | Variable = "󰘛 ", 60 | }, 61 | }, 62 | -- options from nvim_open_win()| vim.diagnostic.open_float() 63 | -- | vim.lsp.util.open_floating_preview()| vim.diagnostic.config() 64 | ---@type table 65 | diagnostics_options = { 66 | virtual_text = false, 67 | -- virtual_text = { 68 | -- severity = { min = vim.diagnostic.severity.WARN, max = vim.diagnostic.severity.ERROR }, 69 | -- source = "if_many", 70 | -- spacing = 0, 71 | -- prefix = "●", 72 | -- }, 73 | float = { 74 | --nvim_open_win() options 75 | relative = "cursor", 76 | -- "single": A single line box. 77 | -- "double": A double line box. 78 | -- "rounded": Like "single", but with rounded corners "╭" 79 | -- "solid": Adds padding by a single whitespace cell. 80 | -- "shadow": A drop shadow effect by blending with the 81 | -- "none": No border (default). 82 | border = "shadow", 83 | -- vim.lsp.util.open_floating_preview() 84 | max_width = math.floor(vim.o.columns * 0.84), 85 | max_height = math.floor(vim.o.lines * 0.6), 86 | close_events = { 87 | "BufLeave", 88 | "CursorMoved", 89 | "InsertEnter", 90 | "FocusLost", 91 | }, 92 | focusable = false, 93 | zindex = 3, 94 | focus = false, 95 | -- vim.diagnostic.open_float() 96 | source = "if_many", 97 | severity_sort = true, 98 | }, 99 | update_in_insert = false, 100 | -- This affects the order in which signs and virtual text are displayed 101 | severity_sort = true, 102 | }, 103 | } 104 | -------------------------------------------------------------------------------- /lua/config/init.lua: -------------------------------------------------------------------------------- 1 | -- Load editor options 2 | require("config.options") 3 | 4 | local utils = require("config.utils") 5 | -- Load editor syntax, autocmds and keymaps 6 | utils.lazy_load({ "config.syntax", "config.autocmds", "config.keymaps" }) 7 | 8 | local diagnostics_options = require("config.defaults").diagnostics_options 9 | -- configure floating window 10 | vim.diagnostic.config(diagnostics_options) 11 | 12 | -- setup borders for handlers 13 | vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { 14 | border = diagnostics_options.float.border, 15 | }) 16 | -- 17 | vim.lsp.handlers["textDocument/signatureHelp"] = 18 | vim.lsp.with(vim.lsp.handlers.signature_help, { 19 | border = diagnostics_options.float.border, 20 | }) 21 | 22 | -- configure diagnostics signs 23 | for name, icon in pairs(require("config.defaults").icons.diagnostics) do 24 | name = "DiagnosticSign" .. name 25 | vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) 26 | end 27 | 28 | -- configure debugger diagnostics signs 29 | for name, icon in pairs(require("config.defaults").icons.debugger) do 30 | vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) 31 | end 32 | -------------------------------------------------------------------------------- /lua/config/keymaps/editor.lua: -------------------------------------------------------------------------------- 1 | local utils = require("config.utils") 2 | local map = utils.map 3 | 4 | local opt = { remap = true } 5 | 6 | vim.cmd([[ cabbrev ht tab help]]) --map("c","h","tab help") 7 | 8 | map("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" }) 9 | map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" }) 10 | 11 | -- search visually selected region on current line 12 | map("v", "//", [[y/\V=escape(@",'/\')]], opt) 13 | 14 | -- Map jk to ESC 15 | map({ "i", "v" }, "jk", "", { remap = false, nowait = true }) 16 | 17 | map("n", "B", "m`0i``i", opt) -- J(join) B(BackJoin): move text after cursor to next line 18 | 19 | -- keep pasting over the same thing, ie. delete content and paste something in it place 20 | map("n", "p", [[m`0"_DP``]], opt, "keep pasting overwriting text") 21 | map("v", "p", [[m`"_dP``]], opt, "keep pasting over the same thing") 22 | 23 | -- delete content without clobbering registers 24 | map( 25 | { "n", "v" }, 26 | "d", 27 | [["_d]], 28 | { remap = false }, 29 | "delete content without clobbering registers" 30 | ) 31 | 32 | -- Switch CWD to the directory of the open buffer 33 | map( 34 | { "n", "v", "o" }, 35 | "cd", 36 | "cd %:p:h:pwd", 37 | opt, 38 | "switch to cwd" 39 | ) 40 | 41 | -- === Moving around, tabs, windows and buffers === -- 42 | -- To use `ALT+{h,j,k,l}` to navigate windows from any mode 43 | map({ "t", "i" }, "", [[h]]) 44 | map({ "t", "i" }, "", [[j]]) 45 | map({ "t", "i" }, "", [[k]]) 46 | map({ "t", "i" }, "", [[l]]) 47 | -- Move to window using the hjkl keys 48 | map("n", "", "h", { desc = "Go to left window" }) 49 | map("n", "", "j", { desc = "Go to lower window" }) 50 | map("n", "", "k", { desc = "Go to upper window" }) 51 | map("n", "", "l", { desc = "Go to right window" }) 52 | 53 | local mode = { "n", "v", "o" } 54 | 55 | -- buffers 56 | if utils.has("bufferline.nvim") then 57 | map("n", "", "BufferLineCyclePrev", { desc = "Prev buffer" }) 58 | map("n", "", "BufferLineCycleNext", { desc = "Next buffer" }) 59 | map("n", "[b", "BufferLineCyclePrev", { desc = "Prev buffer" }) 60 | map("n", "]b", "BufferLineCycleNext", { desc = "Next buffer" }) 61 | else 62 | map("n", "", "bprevious", { desc = "Prev buffer" }) 63 | map("n", "", "bnext", { desc = "Next buffer" }) 64 | -- move back to the previous buffer in the buffer list 65 | map("n", "[b", "bprevious", { desc = "Prev buffer" }) 66 | -- move forward to the next buffer in the buffer list 67 | map("n", "]b", "bnext", { desc = "Next buffer" }) 68 | end 69 | map("n", "bb", "b#", { desc = "Switch to Previous Buffer" }) 70 | map("n", "`", "b#", { desc = "Switch to Previous Buffer" }) 71 | -- move to the first buffer in the buffer list 72 | map("n", "b1", "bfirst", opt, "goto first buffer") 73 | -- move to the last buffer in the buffer list 74 | map("n", "b9", "blast", opt, "goto last buffer") 75 | -- Close the current buffer 76 | map("n", "bd", "bdelete", opt, "delete current buffer") 77 | -- Close all buffers except current 78 | map("n", "bo", "%bdeleteedit#bdelete#", opt) 79 | -- Edit new file 80 | map("n", "bn", "enew", { desc = "New File" }) 81 | -- Useful mappings for managing tabs 82 | map(mode, "t1", "tabfirst", opt, "goto first tab") 83 | map(mode, "t9", "tablast", opt, "goto last tab") 84 | map(mode, "td", "tabclose", opt, "close tab") 85 | map(mode, "tn", "tabnew", opt, "new tab") 86 | map( 87 | mode, 88 | "to", 89 | "tabonly", 90 | opt, 91 | "close all tabs except current" 92 | ) 93 | --TODO: tabmove should take an input 94 | map(mode, "tm", "tabmove", opt, "move tab") 95 | map(mode, "]t", "tabnext", opt, "goto next tab") 96 | map(mode, "[t", "tabprevious", opt, "goto previous tab") 97 | 98 | -- tabs 99 | map("n", "l", "tablast", { desc = "Last Tab" }) 100 | map("n", "f", "tabfirst", { desc = "First Tab" }) 101 | map("n", "", "tabnew", { desc = "New Tab" }) 102 | map("n", "]", "tabnext", { desc = "Next Tab" }) 103 | map("n", "d", "tabclose", { desc = "Close Tab" }) 104 | map("n", "[", "tabprevious", { desc = "Previous Tab" }) 105 | 106 | -- Resize window using arrow keys 107 | map("n", "", "resize +2", { desc = "Increase window height" }) 108 | map("n", "", "resize -2", { desc = "Decrease window height" }) 109 | map( 110 | "n", 111 | "", 112 | "vertical resize -2", 113 | { desc = "Decrease window width" } 114 | ) 115 | map( 116 | "n", 117 | "", 118 | "vertical resize +2", 119 | { desc = "Increase window width" } 120 | ) 121 | 122 | -- windows 123 | map("n", "ww", "p", { desc = "Other window" }) 124 | map("n", "wd", "c", { desc = "Delete window" }) 125 | map("n", "w-", "s", { desc = "Split window below" }) 126 | map("n", "w|", "v", { desc = "Split window right" }) 127 | map("n", "-", "s", { desc = "Split window below" }) 128 | map("n", "|", "v", { desc = "Split window right" }) 129 | map("n", "=", "=", { desc = "resize and make windows equal" }) 130 | 131 | -- Move Lines 132 | map("n", "", "m .+1==", { desc = "Move down" }) 133 | map("n", "", "m .-2==", { desc = "Move up" }) 134 | map("i", "", "m .+1==gi", { desc = "Move down" }) 135 | map("i", "", "m .-2==gi", { desc = "Move up" }) 136 | map("v", "", ":m '>+1gv=gv", { desc = "Move down" }) 137 | map("v", "", ":m '<-2gv=gv", { desc = "Move up" }) 138 | 139 | -- save file 140 | map({ "i", "v", "n", "s" }, "", function() 141 | vim.cmd([[w]]) 142 | end, { desc = "Save file" }) 143 | 144 | -- quit 145 | map("n", "", function() 146 | vim.cmd([[qall]]) 147 | end, { desc = "Quit all" }) 148 | 149 | -- === Terminal === " 150 | -- Mapping to open terminal emulator in nvim 151 | -- open terminal on alt+t 152 | map({ "n", "t" }, "", function() 153 | vim.cmd.split({ "term://" .. vim.env.SHELL }) 154 | vim.cmd.resize({ 15 }) 155 | end) 156 | -- mapping to close terminal emulator 157 | map("t", "", [[:bd!]]) 158 | 159 | -- better up/down 160 | map("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) 161 | map("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) 162 | 163 | -- Clear search with 164 | map( 165 | { "i", "n" }, 166 | "", 167 | "noh", 168 | { desc = "Escape and clear hlsearch" } 169 | ) 170 | 171 | -- lazy 172 | map("n", "l", ":Lazy", { desc = "Lazy" }) 173 | 174 | -- toggle options 175 | -- === Spell checking === " 176 | --vim.cmd [[set spell!]] also works 177 | map("n", "us", function() 178 | utils.toggle("spell") 179 | end, { desc = "Toggle Spelling" }) 180 | 181 | map("n", "uw", function() 182 | utils.toggle("wrap") 183 | end, { desc = "Toggle Word Wrap" }) 184 | 185 | map("n", "ul", function() 186 | utils.toggle("relativenumber") 187 | utils.toggle("number") 188 | end, { desc = "Toggle Line Numbers" }) 189 | 190 | map("n", "uc", function() 191 | local disable_conceal = 0 192 | local enable_conceal = 3 193 | local conceallevel = vim.o.conceallevel > 0 and disable_conceal 194 | or enable_conceal 195 | 196 | local filetype = vim.filetype.match({ buf = 0 }) 197 | 198 | if filetype == "norg" and utils.has("neorg") then 199 | utils.toggle("conceallevel", nil, { 0, conceallevel }) 200 | vim.cmd([[Neorg toggle-concealer]]) 201 | else 202 | utils.toggle("conceallevel", nil, { 0, conceallevel }) 203 | end 204 | end, { desc = "Toggle Conceal" }) 205 | 206 | map("n", "ue", function() 207 | utils.toggle("listchars", nil, { 208 | { tab = [[→→]], trail = "•", extends = "»", precedes = "«" }, 209 | { 210 | tab = [[→→]], 211 | trail = "•", 212 | extends = "»", 213 | precedes = "«", 214 | eol = "↴", 215 | }, 216 | }) 217 | end, { desc = "Toggle EOL" }) 218 | -------------------------------------------------------------------------------- /lua/config/keymaps/init.lua: -------------------------------------------------------------------------------- 1 | require("config.keymaps.editor") 2 | require("config.keymaps.lsp") 3 | -------------------------------------------------------------------------------- /lua/config/keymaps/lsp.lua: -------------------------------------------------------------------------------- 1 | local autocmd = vim.api.nvim_create_autocmd -- create autocmd 2 | local utils = require("config.utils") 3 | local map = utils.map 4 | local augroup = utils.augroup 5 | 6 | -- map the following keys after the language server attaches to a buffer 7 | -- See `:help vim.lsp.*` for doc mentation on any of the below functions 8 | -- :lua =vim.lsp.get_active_clients()[1].server_capabilities to get capabilities of lsp attached to buffer 9 | utils.on_attach(function(client, bufnr) 10 | local opts = { buffer = bufnr } 11 | 12 | if 13 | vim.version.gt(vim.version(), { 0, 9, 0 }) 14 | and client.server_capabilities.inlayHintProvider 15 | then 16 | vim.lsp.inlay_hint.enable(true) 17 | end 18 | if client.server_capabilities.hoverProvider then 19 | map("n", "K", function() 20 | vim.lsp.buf.hover() 21 | end, opts, "get hover info") 22 | end 23 | if client.server_capabilities.semanticTokensProvider then 24 | map("n", "us", function() 25 | utils.toggle("enable_semantic_tokens", { global = true }, nil) 26 | if vim.g["enable_semantic_tokens"] then 27 | vim.lsp.semantic_tokens.start(bufnr, client.id) 28 | else 29 | vim.lsp.semantic_tokens.stop(bufnr, client.id) 30 | end 31 | end, opts, "toggle semantic token highlighting") 32 | end 33 | if client.server_capabilities.signatureHelpProvider then 34 | map( 35 | "n", 36 | "k", 37 | vim.lsp.buf.signature_help, 38 | opts, 39 | "get fn signature help" 40 | ) 41 | end 42 | if client.server_capabilities.declarationProvider then 43 | map( 44 | "n", 45 | "gD", 46 | vim.lsp.buf.declaration, 47 | opts, 48 | "goto declaration" 49 | ) 50 | end 51 | if client.server_capabilities.completionProvider then 52 | vim.bo[bufnr].omnifunc = "v:lua.vim.lsp.omnifunc" 53 | end 54 | if client.server_capabilities.definitionProvider then 55 | vim.bo[bufnr].tagfunc = "v:lua.vim.lsp.tagfunc" 56 | map("n", "gd", function() 57 | if utils.has("lspsaga.nvim") then 58 | vim.cmd([[Lspsaga goto_definition]]) 59 | else 60 | vim.lsp.buf.definition() 61 | end 62 | end, opts, "goto definition") 63 | 64 | if utils.has("lspsaga.nvim") then 65 | map("n", "pd", function() 66 | vim.cmd([[Lspsaga peek_definition]]) 67 | end, opts, "peek definition") 68 | end 69 | end 70 | if client.server_capabilities.typeDefinitionProvider then 71 | map("n", "gt", function() 72 | if utils.has("lspsaga.nvim") then 73 | vim.cmd([[Lspsaga goto_type_definition]]) 74 | else 75 | vim.lsp.buf.type_definition() 76 | end 77 | end, opts, "goto type definition") 78 | 79 | if utils.has("lspsaga.nvim") then 80 | map("n", "pt", function() 81 | vim.cmd([[Lspsaga peek_type_definition]]) 82 | end, opts, "peek type definition") 83 | end 84 | end 85 | if client.server_capabilities.implementationProvider then 86 | map("n", "gi", function() 87 | if utils.has("lspsaga.nvim") then 88 | vim.cmd([[Lspsaga finder imp+def]]) 89 | else 90 | vim.lsp.buf.implementation() 91 | end 92 | end, opts, "goto type implementation") 93 | end 94 | if client.server_capabilities.referencesProvider then 95 | map("n", "gr", function() 96 | if utils.has("lspsaga.nvim") then 97 | vim.cmd([[Lspsaga finder ref]]) 98 | else 99 | vim.lsp.buf.references({}) 100 | end 101 | end, opts, "goto type references") 102 | end 103 | if client.server_capabilities.documentHighlightProvider then 104 | vim.api.nvim_set_hl(0, "LspReferenceRead", { 105 | link = "DiffText", 106 | }) 107 | vim.api.nvim_set_hl(0, "LspReferenceText", { 108 | link = "IncSearch", 109 | }) 110 | vim.api.nvim_set_hl(0, "LspRefDiffTexterenceWrite", { 111 | link = "WildMenu", 112 | }) 113 | local doc_highlight = augroup("lsp_document_highlight") 114 | local enable_highlight = function() 115 | autocmd({ "CursorHold", "CursorHoldI" }, { 116 | group = doc_highlight, 117 | buffer = bufnr, 118 | callback = vim.lsp.buf.document_highlight, 119 | }) 120 | autocmd("CursorMoved", { 121 | group = doc_highlight, 122 | buffer = bufnr, 123 | callback = vim.lsp.buf.clear_references, 124 | }) 125 | end 126 | local disable_highlight = function() 127 | vim.lsp.buf.clear_references() 128 | vim.api.nvim_clear_autocmds({ 129 | buffer = bufnr, 130 | group = doc_highlight, 131 | }) 132 | end 133 | map("n", "uh", function() 134 | utils.toggle( 135 | "highlight", 136 | {}, 137 | { enable_highlight, disable_highlight } 138 | ) 139 | vim.b[vim.fn.bufnr()]["highlight"]() 140 | end, opts, "toggle document highlight") 141 | end 142 | if client.server_capabilities.documentSymbolProvider then 143 | map( 144 | "n", 145 | "ds", 146 | vim.lsp.buf.document_symbol, 147 | opts, 148 | "document symbols" 149 | ) 150 | end 151 | if client.server_capabilities.codeActionProvider then 152 | map({ "n", "v" }, "ca", function() 153 | if utils.has("lspsaga.nvim") then 154 | vim.cmd([[Lspsaga code_action]]) 155 | else 156 | vim.lsp.buf.code_action() 157 | end 158 | end, opts, "code action") 159 | end 160 | if client.server_capabilities.documentFormattingProvider then 161 | map("n", "uf", function() 162 | utils.toggle("autoformat", { global = true }) 163 | autocmd("BufWritePre", { 164 | group = augroup("LspFormat"), 165 | callback = function() 166 | if vim.g["autoformat"] then 167 | vim.lsp.buf.format({ async = true }) 168 | end 169 | end, 170 | }) 171 | end, opts, "toggle autoformat") 172 | 173 | map("n", "f", function() 174 | vim.lsp.buf.format({ async = true }) 175 | end, opts, "range format buffer") 176 | end 177 | if client.server_capabilities.documentRangeFormattingProvider then 178 | map("v", "f", function() 179 | vim.lsp.buf.format({ async = true }) 180 | end, opts, "range format buffer") 181 | end 182 | if client.server_capabilities.renameProvider then 183 | map("n", "rn", function() 184 | vim.lsp.buf.rename() 185 | end, opts, "rename symbol") 186 | 187 | if utils.has("lspsaga.nvim") then 188 | map("n", "rnw", function() 189 | vim.cmd([[Lspsaga project_replace]]) 190 | end, opts, "rename across workspace") 191 | end 192 | end 193 | if client.server_capabilities.callHierarchyProvider then 194 | map("n", "ci", function() 195 | if utils.has("lspsaga.nvim") then 196 | vim.cmd([[Lspsaga incoming_calls]]) 197 | else 198 | vim.lsp.buf.incoming_calls() 199 | end 200 | end, opts, "incoming calls") 201 | map("n", "co", function() 202 | if utils.has("lspsaga.nvim") then 203 | vim.cmd([[Lspsaga outgoing_calls]]) 204 | else 205 | vim.lsp.buf.outgoing_calls() 206 | end 207 | end, opts, "outgoing calls") 208 | end 209 | if client.server_capabilities.workspaceSymbolProvider then 210 | map( 211 | "n", 212 | "ws", 213 | vim.lsp.buf.workspace_symbol, 214 | opts, 215 | "list workspace symbols" 216 | ) 217 | end 218 | 219 | map("n", "[d", function() 220 | if utils.has("lspsaga.nvim") then 221 | vim.cmd([[Lspsaga diagnostic_jump_prev]]) 222 | else 223 | vim.diagnostic.goto_prev() 224 | end 225 | end, opts, "goto previous diagnostics") 226 | map("n", "]d", function() 227 | if utils.has("lspsaga.nvim") then 228 | vim.cmd([[Lspsaga diagnostic_jump_next]]) 229 | else 230 | vim.diagnostic.goto_next() 231 | end 232 | end, opts, "goto next diagnostics") 233 | 234 | if utils.has("lspsaga.nvim") then 235 | map("n", "wd", function() 236 | vim.cmd([[Lspsaga show_workspace_diagnostics]]) --can use ++normal to show in loclist 237 | end, opts, "workspace diagnostics") 238 | map("n", "bd", function() 239 | vim.cmd([[Lspsaga show_buf_diagnostics]]) 240 | end, opts, "workspace diagnostics") 241 | map("n", "wo", function() 242 | vim.cmd([[Lspsaga outline]]) 243 | end, opts, "workspace outline") 244 | end 245 | map("n", "sl", vim.diagnostic.setloclist, opts, "set loclist") 246 | map("n", "of", vim.diagnostic.open_float, opts, "open float") 247 | 248 | map("n", "wf", function() 249 | vim.print(vim.lsp.buf.list_workspace_folders()) 250 | end, opts, "list workspace folders") 251 | map("n", "rd", function() 252 | print( 253 | "Language server " 254 | .. (vim.lsp.buf.server_ready() and "is ready" or "is not ready") 255 | ) 256 | end, opts, "check if lsp is ready") 257 | end) 258 | -------------------------------------------------------------------------------- /lua/config/lazy.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | 3 | if not vim.loop.fs_stat(lazypath) then 4 | vim.fn.system({ 5 | "git", 6 | "clone", 7 | "--filter=blob:none", 8 | "https://github.com/folke/lazy.nvim.git", 9 | "--branch=stable", 10 | lazypath, 11 | }) 12 | end 13 | vim.opt.rtp:prepend(vim.env.LAZY or lazypath) 14 | 15 | require("lazy").setup({ 16 | spec = { 17 | { import = "plugins" }, 18 | }, 19 | defaults = { 20 | lazy = false, 21 | }, 22 | -- automatically check for plugin updates 23 | checker = { enabled = false }, 24 | change_detection = { 25 | -- automatically check for config file changes and reload the ui 26 | enabled = true, 27 | -- get a notification when changes are found 28 | notify = false, 29 | }, 30 | performance = { 31 | cache = { 32 | enabled = true, 33 | }, 34 | rtp = { 35 | -- disable some rtp plugins 36 | disabled_plugins = { 37 | -- Vim plugin for editing compressed files. 38 | "gzip", 39 | -- tarPlugin.vim -- a Vim plugin for browsing tarfiles 40 | "tarPlugin", 41 | -- Vim plugin for converting a syntax highlighted file to HTML. 42 | "tohtml", 43 | -- zipPlugin.vim: Handles browsing zipfiles 44 | "zipPlugin", 45 | -- netrwPlugin.vim: Handles file transfer and remote directory listing across a network 46 | -- support of plugins written in other languages 47 | "netrwPlugin", 48 | "rplugin", 49 | -- Vim plugin for downloading spell files 50 | -- "spellfile", 51 | -- matchit.vim: (global plugin) Extended "%" matching 52 | -- "matchit", 53 | -- Vim plugin for showing matching parens 54 | -- "matchparen", 55 | -- "tutor", 56 | -- "man", 57 | -- "shada", 58 | -- "health", 59 | -- "editorconfig", 60 | -- "nvim", 61 | }, 62 | }, 63 | }, 64 | }) 65 | -------------------------------------------------------------------------------- /lua/config/options.lua: -------------------------------------------------------------------------------- 1 | local opt = vim.opt 2 | local opt_global = vim.opt_global 3 | local fn = vim.fn -- invoke vim-functions in lua 4 | 5 | vim.g.editorconfig = false 6 | vim.g.mapleader = [[ ]] 7 | vim.g.maplocalleader = [[\]] 8 | 9 | -- Set clipboard to the + registers only 10 | -- if you want to use the * also add ,unnamed 11 | -- Also enable clipboard for WSL 12 | if fn.has("wsl") == 1 then 13 | vim.g.clipboard = { 14 | name = "WslClipboard", 15 | copy = { 16 | ["+"] = "/mnt/c/WINDOWS/system32/clip.exe", 17 | ["*"] = "/mnt/c/WINDOWS/system32/clip.exe", 18 | }, 19 | paste = { 20 | ["+"] = '/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))', 21 | ["*"] = '/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))', 22 | }, 23 | cache_enabled = 0, 24 | } 25 | opt.clipboard:append({ "unnamedplus" }) 26 | else 27 | opt.clipboard:append({ "unnamedplus" }) 28 | end 29 | 30 | opt.termguicolors = true 31 | 32 | -- Show line numbers 33 | opt.number = true 34 | 35 | -- open new split panes to right and below 36 | opt.splitright = true 37 | opt.splitbelow = true 38 | 39 | -- Show the line number relative to the line with the cursor in front of each line. 40 | opt.relativenumber = true 41 | 42 | --Make a backup before overwriting a file. The backup is removed after the file was successfully written 43 | -- unless the 'backup' option is also on. 44 | opt.writebackup = true 45 | 46 | --Make a backup before overwriting a file. Leave it around after the file has been successfully written. 47 | --this make sure you alway have a backup of a file around,meaning in cases where there is no swapfile 48 | --to recover from you can use the backup file directly 49 | opt.backup = true 50 | 51 | --List of directories for the backup file 52 | opt_global.backupdir = { "/tmp//" } 53 | 54 | -- tells neovim how backups are done 55 | opt.backupcopy = "auto" 56 | 57 | -- The extension to be used for vim backup files 58 | opt.backupext = ".vimbak" 59 | 60 | -- enable saving unsaved/unwritten files in a *.swp file 61 | opt.swapfile = true 62 | 63 | -- saves undo history to an undo file when writing a buffer to a file, and restores undo 64 | -- history from the same file on buffer read. 65 | opt.undofile = true 66 | 67 | -- Maximum number of changes that can be undone. 68 | opt.undolevels = 30000 69 | 70 | -- You will have bad experience for diagnostic messages when it's default 4000. 71 | opt.updatetime = 100 72 | 73 | -- Time in milliseconds to wait for a mapped sequence to complete. 74 | opt.timeoutlen = 500 75 | 76 | -- don't give |ins-completion-menu| messages. 77 | opt.shortmess:append({ c = true, W = true, I = true }) 78 | 79 | -- always merge sign column and number column into one 80 | opt.signcolumn = "yes" 81 | 82 | -- Don't let autocomplete affect usual typing habits 83 | opt_global.completeopt = { "menu", "menuone", "noselect" } 84 | 85 | opt.conceallevel = 3 -- Hide * markup for bold and italic 86 | opt.concealcursor = "nc" --Sets the modes in which text in the cursor line can also be concealed. 87 | 88 | opt.cursorline = true -- Enable highlighting of the current line 89 | 90 | opt.pumblend = 10 -- Popup blend 91 | opt.pumheight = 10 -- Maximum number of entries in a popup 92 | 93 | -- This option allows you to switch between multiple buffers 94 | -- without saving a changed buffer 95 | opt.hidden = false 96 | 97 | -- Automatically enable mouse usage 98 | opt.mouse = "a" 99 | 100 | -- enable mouse move event 101 | opt.mousemoveevent = false 102 | 103 | -- enable line wrap 104 | opt.wrap = true 105 | 106 | -- Wrap-broken line prefix 107 | opt.showbreak = [[↪ ]] 108 | 109 | -- wrap long lines at a character in `breakat` 110 | opt.linebreak = true 111 | 112 | --wrapped line will continue visually indented 113 | opt.breakindent = true 114 | 115 | -- Maximum width (number of cols) of text that is being inserted 116 | opt.textwidth = 80 117 | 118 | -- set to +1 to highlight column after textwidth 119 | -- opt.colorcolumn = "+1" 120 | 121 | -- Highlight matching brace 122 | opt.showmatch = true 123 | 124 | -- TODO: improve completions by using k{dict} and s{tsr} .:h 'complete' 125 | -- text complete with CTRL-N or CTRL-P 126 | opt.complete = "kspell" 127 | 128 | -- Enable spell checking for español y ingles-- 129 | opt.spelllang = { "en" } --"en,es" 130 | 131 | -- Show best nine spell checking candidates at most 132 | opt_global.spellsuggest = { "best", "9" } 133 | 134 | -- When a word is CamelCased, assume "Cased" is a separate word: every upper-case character 135 | -- in a word that comes after a lower case character indicates the start of a new word. 136 | opt.spelloptions = "camel" 137 | 138 | -- make diff mode always open in vertical split 139 | opt_global.diffopt:append({ "vertical" }) 140 | 141 | -- Use visual bell (no beeping) 142 | opt.visualbell = true 143 | 144 | -- Always case-insensitive 145 | opt.ignorecase = true 146 | 147 | -- Enable smart-case search 148 | opt.smartcase = true 149 | 150 | -- case insensitive auto completion 151 | opt.wildignorecase = true 152 | 153 | --Set 'tabstop' and 'shiftwidth' to whatever you prefer and use 'expandtab'. 154 | --This way you will always insert spaces. The formatting will never be messed up when 'tabstop' is changed. 155 | --Number of spaces that a in the file counts for 156 | opt.tabstop = 4 157 | 158 | -- Number of auto-indent spaces 159 | opt.shiftwidth = 4 160 | 161 | -- Number of spaces per Tab 162 | -- When 'softtabstop' is negative, the value of 'shiftwidth' is used. 163 | opt.softtabstop = -1 164 | 165 | -- always expands tab to spaces. It is good when peers use different editor. 166 | opt.expandtab = true 167 | 168 | -- Prompt confirmation dialogs 169 | opt.confirm = true 170 | 171 | -- Command line height 172 | opt.cmdheight = 0 173 | 174 | -- Auto-write all file changes 175 | opt.autowriteall = true 176 | 177 | --When this option is set, the screen will not be redrawn while executing 178 | --macros, registers and other commands that have not been typed 179 | opt.lazyredraw = false 180 | 181 | -- Display unprintable characters f12 - switches 182 | opt.list = true 183 | 184 | -- Unprintable chars mapping 185 | -- {tab = "••"|">~",eol = "↴"|"¶"|"$", nbsp = "␣"|"%", space = "_" } 186 | opt.listchars = 187 | { tab = [[→→]], trail = "•", extends = "»", precedes = "«" } 188 | 189 | -- Enable folding 190 | opt.foldmethod = "expr" 191 | 192 | opt.foldexpr = "v:lua.vim.treesitter.foldexpr()" 193 | 194 | -- diable folding at startup 195 | opt.foldenable = false 196 | 197 | -- set the number of screen lines above which a fold is displayed closed 198 | opt.foldminlines = 5 199 | -------------------------------------------------------------------------------- /lua/config/syntax.lua: -------------------------------------------------------------------------------- 1 | -- :h highlight-args and :h cterm-colors 2 | vim.api.nvim_set_hl(0, "Search", { 3 | ctermfg = 0, 4 | ctermbg = 11, 5 | cterm = { bold = true }, 6 | bg = "Blue", 7 | fg = "Magenta", 8 | standout = true, 9 | underdotted = true, 10 | }) 11 | -------------------------------------------------------------------------------- /lua/config/utils.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | function _G.dump(...) 4 | vim.print(...) 5 | end 6 | 7 | function M.reload_all() 8 | for name, _ in pairs(package.loaded) do 9 | if name:match("^config") or name:match("^plugins") then 10 | package.loaded[name] = nil 11 | end 12 | end 13 | -- Reload after/ directory 14 | local glob = vim.fn.stdpath("config") .. "/ftplugin/**/*.lua" 15 | local ftplugin_lua_filepaths = vim.fn.glob(glob, true, true) 16 | 17 | for _, filepath in ipairs(ftplugin_lua_filepaths) do 18 | dofile(filepath) 19 | end 20 | 21 | dofile(vim.env.MYVIMRC) 22 | end 23 | 24 | function M.reload_one(module) 25 | for name, _ in pairs(package.loaded) do 26 | if name:match("^" .. module) then 27 | package.loaded[name] = nil 28 | require(name) 29 | return 30 | end 31 | end 32 | end 33 | 34 | --{ "git", "rg", { "fd", "fdfind" }, "lazygit" } 35 | M.check_if_cmd_exist = function(cmds) 36 | local result = {} 37 | for _, cmd in ipairs(cmds) do 38 | local name = type(cmd) == "string" and cmd or vim.inspect(cmd) 39 | local commands = type(cmd) == "string" and { cmd } or cmd 40 | ---@cast commands string[] 41 | local found = false 42 | for _, c in ipairs(commands) do 43 | if vim.fn.executable(c) == 1 then 44 | name = c 45 | found = true 46 | end 47 | result[name] = { found } 48 | end 49 | end 50 | return result 51 | end 52 | 53 | ---@param editor_variable? {global: boolean} 54 | ---@param values? {[1]:any, [2]:any} 55 | ---@param option string 56 | function M.toggle(option, editor_variable, values) 57 | if values then 58 | if not editor_variable then 59 | if vim.deep_equal(vim.opt_local[option]:get(), values[1]) then 60 | vim.opt_local[option] = values[2] 61 | else 62 | vim.opt_local[option] = values[1] 63 | end 64 | vim.notify( 65 | "set editor option " 66 | .. option 67 | .. " to " 68 | .. tostring(vim.opt_local[option]:get()), 69 | vim.log.levels.INFO, 70 | { title = "toggle editor option" } 71 | ) 72 | else 73 | if not editor_variable.global then 74 | local bufnr = vim.api.nvim_get_current_buf() 75 | if vim.b[bufnr][option] == values[1] then 76 | vim.b[bufnr][option] = values[2] 77 | else 78 | --if option is unset or nil 79 | vim.b[bufnr][option] = values[1] 80 | end 81 | --:h debug.getinfo() or lua_getinfo() to get information about a function 82 | vim.notify( 83 | "set option " 84 | .. option 85 | .. " to " 86 | .. tostring(vim.b[bufnr][option]), 87 | vim.log.levels.INFO, 88 | { 89 | title = "toggle local option", 90 | } 91 | ) 92 | else 93 | if vim.g[option] == values[1] then 94 | vim.g[option] = values[2] 95 | else 96 | --if option is unset or nil 97 | vim.g[option] = values[1] 98 | end 99 | vim.notify( 100 | "set global option " 101 | .. option 102 | .. " to " 103 | .. tostring(vim.g[option]), 104 | vim.log.levels.INFO, 105 | { 106 | title = "toggle global option", 107 | } 108 | ) 109 | end 110 | end 111 | else 112 | if not editor_variable then 113 | vim.opt_local[option] = not vim.opt_local[option]:get() 114 | vim.notify( 115 | "set editor option " 116 | .. option 117 | .. " to " 118 | .. tostring(vim.opt_local[option]:get()), 119 | vim.log.levels.INFO, 120 | { 121 | title = "toggle editor option", 122 | } 123 | ) 124 | else 125 | if not editor_variable.global then 126 | local bufnr = vim.api.nvim_get_current_buf() 127 | vim.b[bufnr][option] = not vim.b[bufnr][option] and true 128 | or false 129 | vim.notify( 130 | "set option " 131 | .. option 132 | .. " to " 133 | .. tostring(vim.b[bufnr][option]), 134 | vim.log.levels.INFO, 135 | { 136 | title = "toggle local option", 137 | } 138 | ) 139 | else 140 | vim.g[option] = not vim.g[option] 141 | vim.notify( 142 | "set global option " 143 | .. option 144 | .. " to " 145 | .. tostring(vim.g[option]), 146 | vim.log.levels.INFO, 147 | { 148 | title = "toggle global option", 149 | } 150 | ) 151 | end 152 | end 153 | end 154 | end 155 | 156 | ---@param fn fun() 157 | function M.on_very_lazy(fn) 158 | vim.api.nvim_create_autocmd("User", { 159 | group = vim.api.nvim_create_augroup("Lazy", { clear = true }), 160 | pattern = "VeryLazy", 161 | callback = function() 162 | fn() 163 | end, 164 | }) 165 | end 166 | 167 | ---@param modules string[] 168 | --modules like "autocmds" | "options" | "keymaps" 169 | M.lazy_load = function(modules) 170 | -- when no file is opened at startup 171 | if vim.fn.argc(-1) == 0 then 172 | -- autocmds and keymaps can wait to load 173 | -- always load lazyvim, then user file 174 | M.on_very_lazy(function() 175 | for i = 1, #modules do 176 | require(modules[i]) 177 | end 178 | end) 179 | else 180 | -- load them now so they affect the opened buffers 181 | for i = 1, #modules do 182 | require(modules[i]) 183 | end 184 | end 185 | end 186 | 187 | ---@param on_attach fun(client, bufnr) 188 | function M.on_attach(on_attach) 189 | vim.api.nvim_create_autocmd("LspAttach", { 190 | callback = function(args) 191 | local bufnr = args.buf 192 | local client = vim.lsp.get_client_by_id(args.data.client_id) 193 | on_attach(client, bufnr) 194 | end, 195 | }) 196 | end 197 | 198 | ---@param plugin string 199 | function M.has(plugin) 200 | if package.loaded["lazy"] then 201 | return require("lazy.core.config").plugins[plugin] ~= nil 202 | else 203 | local plugin_name = 204 | vim.split(plugin, ".", { plain = true, trimempty = true }) 205 | return package.loaded[plugin_name[1]] ~= nil 206 | end 207 | end 208 | 209 | ---@param description? string 210 | ---@param opt table 211 | local function mdesc(opt, description) 212 | return vim.tbl_extend("force", opt, { desc = description }) 213 | end 214 | 215 | ---@param mode string|table 216 | ---@param lhs string 217 | ---@param rhs string|function 218 | ---@param opts? table 219 | ---@param desc? string 220 | M.map = function(mode, lhs, rhs, opts, desc) 221 | opts = opts and opts or {} 222 | opts = mdesc(opts, desc) 223 | vim.keymap.set(mode, lhs, rhs, opts) 224 | end 225 | 226 | M.augroup = function(name) 227 | return vim.api.nvim_create_augroup(name, { clear = true }) 228 | end 229 | 230 | return M 231 | -------------------------------------------------------------------------------- /lua/plugins/colorscheme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- catppuccin 3 | { 4 | "catppuccin/nvim", 5 | name = "catppuccin", 6 | lazy = true, 7 | -- event = {"BufReadPre","BufNewFile"}, 8 | opts = { 9 | flavour = "macchiato", -- latte, frappe, macchiato, mocha 10 | background = { 11 | -- :h background 12 | light = "latte", 13 | dark = "mocha", 14 | }, 15 | transparent_background = false, 16 | show_end_of_buffer = false, -- show the '~' characters after the end of buffers 17 | term_colors = true, 18 | dim_inactive = { 19 | enabled = true, 20 | shade = "dark", 21 | percentage = 0.15, 22 | }, 23 | no_italic = false, -- Force no italic 24 | no_bold = false, -- Force no bold 25 | styles = { 26 | comments = { "italic" }, 27 | conditionals = { "italic" }, 28 | loops = {}, 29 | functions = {}, 30 | keywords = {}, 31 | strings = {}, 32 | variables = {}, 33 | numbers = {}, 34 | booleans = {}, 35 | properties = {}, 36 | types = {}, 37 | operators = {}, 38 | }, 39 | color_overrides = {}, 40 | -- custom_highlights = function(colors) -- Global highlight, will be replaced with custom_highlights if exists 41 | -- return { 42 | -- -- Comment = { fg = colors.peach, style = { "italic" } }, 43 | -- -- ["@field"] = { fg = colors.blue }, 44 | -- } 45 | -- end, 46 | -- For more plugins integrations (https://github.com/catppuccin/nvim#integrations) 47 | integrations = { 48 | cmp = true, 49 | gitsigns = true, 50 | nvimtree = true, 51 | telescope = true, 52 | notify = true, 53 | hop = true, 54 | markdown = true, 55 | noice = true, 56 | treesitter = true, 57 | symbols_outline = true, 58 | lsp_trouble = true, 59 | which_key = true, 60 | native_lsp = { 61 | enabled = true, 62 | virtual_text = { 63 | errors = { "italic" }, 64 | hints = { "italic" }, 65 | warnings = { "italic" }, 66 | information = { "italic" }, 67 | }, 68 | underlines = { 69 | errors = { "underline" }, 70 | hints = { "underline" }, 71 | warnings = { "underline" }, 72 | information = { "underline" }, 73 | }, 74 | }, 75 | }, 76 | }, 77 | config = function(_, opts) 78 | require("catppuccin").setup(opts) 79 | vim.cmd.colorscheme("catppuccin") 80 | end, 81 | }, 82 | -- Onedark colorscheme 83 | { 84 | "navarasu/onedark.nvim", 85 | event = { "BufReadPre", "BufNewFile" }, 86 | config = function(_, opts) 87 | require("onedark").setup(opts) 88 | require("onedark").load() 89 | end, 90 | opts = { 91 | -- Main options -- 92 | style = "darker", -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light' 93 | transparent = false, -- Show/hide background 94 | term_colors = true, -- Change terminal color as per the selected theme style 95 | ending_tildes = false, -- Show the end-of-buffer tildes. By default they are hidden 96 | cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu 97 | -- toggle theme style --- 98 | toggle_style_key = "ts", -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example "ts" 99 | -- List of styles to toggle between 100 | toggle_style_list = { 101 | "dark", 102 | "darker", 103 | "cool", 104 | "deep", 105 | "warm", 106 | "warmer", 107 | "light", 108 | }, 109 | -- Change code style --- 110 | -- Options are italic, bold, underline, none 111 | -- You can configure multiple style with comma seperated, For e.g., keywords = 'italic,bold' 112 | code_style = { 113 | comments = "italic", 114 | keywords = "none", 115 | functions = "none", 116 | strings = "none", 117 | variables = "none", 118 | }, 119 | -- Lualine options -- 120 | lualine = { 121 | transparent = false, -- lualine center bar transparency 122 | }, 123 | -- Custom Highlights -- 124 | colors = {}, -- Override default colors 125 | highlights = {}, -- Override highlight groups 126 | -- Plugins Config -- 127 | diagnostics = { 128 | darker = true, -- darker colors for diagnostic 129 | undercurl = true, -- use undercurl instead of underline for diagnostics 130 | background = true, -- use background color for virtual text 131 | }, 132 | }, 133 | }, 134 | } 135 | -------------------------------------------------------------------------------- /lua/plugins/completions.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- snippets 3 | { 4 | "L3MON4D3/LuaSnip", 5 | lazy = true, 6 | dependencies = { 7 | { "saadparwaiz1/cmp_luasnip", lazy = true }, -- luasnip completion source for nvim-cmp 8 | { 9 | "rafamadriz/friendly-snippets", 10 | lazy = true, 11 | config = function() 12 | require("luasnip.loaders.from_vscode").lazy_load() 13 | end, 14 | }, 15 | }, 16 | }, 17 | -- completion engine 18 | { 19 | "hrsh7th/nvim-cmp", 20 | event = "InsertEnter", -- load cmp on InsertEnter 21 | -- these dependencies will only be loaded when cmp loads 22 | -- dependencies are always lazy-loaded unless specified otherwise 23 | dependencies = { 24 | -- Autocompletion plugin 25 | -- Completion Sources -- 26 | { "hrsh7th/cmp-nvim-lsp", lazy = true }, -- nvim-cmp source for neovim builtin LSP client 27 | { "hrsh7th/cmp-path", lazy = true }, -- nvim-cmp source for path 28 | { "hrsh7th/cmp-buffer", lazy = true }, -- nvim-cmp source for buffer words 29 | { "hrsh7th/cmp-nvim-lua", lazy = true }, -- nvim-cmp source for nvim lua 30 | { "hrsh7th/cmp-emoji", lazy = true }, -- nvim-cmp source for emoji 31 | { "hrsh7th/cmp-cmdline", lazy = true }, --nvim-cmp source for vim's cmdline. 32 | }, 33 | opts = function() 34 | local has_words_before = function() 35 | local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 36 | return col ~= 0 37 | and vim.api 38 | .nvim_buf_get_lines(0, line - 1, line, true)[1] 39 | :sub(col, col) 40 | :match("%s") 41 | == nil 42 | end 43 | 44 | local cmp = require("cmp") 45 | local luasnip = require("luasnip") 46 | -- local diagnostics_options = require("config.defaults").diagnostics_options 47 | 48 | return { 49 | snippet = { 50 | expand = function(args) 51 | -- For `luasnip` user. 52 | luasnip.lsp_expand(args.body) 53 | end, 54 | }, 55 | -- window = { 56 | -- completion = { border = diagnostics_options.float.border }, 57 | -- documentation = { border = diagnostics_options.float.border }, 58 | -- }, 59 | formatting = { 60 | format = function(entry, vim_item) 61 | local icons = require("config.defaults").icons.kinds 62 | -- Kind icons 63 | -- This concatonates the icons with the name of the item kind 64 | vim_item.kind = string.format( 65 | "%s", 66 | icons[vim_item.kind], 67 | vim_item.kind 68 | ) 69 | -- Source 70 | vim_item.menu = ({ 71 | buffer = "[Buffer]", 72 | nvim_lsp = "[LSP]", 73 | luasnip = "[LuaSnip]", 74 | nvim_lua = "[Lua]", 75 | path = "[Path]", 76 | emoji = "[Emoji]", 77 | neorg = "[Neorg]", 78 | spell = "[Spell]", 79 | })[entry.source.name] 80 | return vim_item 81 | end, 82 | }, 83 | mapping = cmp.mapping.preset.insert({ 84 | [""] = cmp.mapping.scroll_docs(-4), 85 | [""] = cmp.mapping.scroll_docs(4), 86 | [""] = cmp.mapping.complete({ 87 | TriggerOnly = "triggerOnly", 88 | }), 89 | [""] = cmp.mapping.select_next_item(), 90 | [""] = cmp.mapping.select_prev_item(), 91 | [""] = cmp.mapping({ 92 | i = cmp.mapping.abort(), 93 | c = cmp.mapping.close(), 94 | }), 95 | [""] = cmp.mapping.confirm({ select = false }), 96 | [""] = cmp.mapping(function(fallback) 97 | if cmp.visible() then 98 | cmp.select_next_item() 99 | elseif luasnip.expand_or_jumpable() then 100 | luasnip.expand_or_jump() 101 | elseif has_words_before() then 102 | cmp.complete() 103 | else 104 | -- The fallback function sends a already mapped key. In this case, it's probably ``. 105 | fallback() 106 | end 107 | end, { "i", "s" }), 108 | [""] = cmp.mapping(function(fallback) 109 | if cmp.visible() then 110 | cmp.select_prev_item() 111 | elseif luasnip.jumpable(-1) then 112 | luasnip.jump(-1) 113 | else 114 | fallback() 115 | end 116 | end, { "i", "s" }), 117 | }), 118 | sources = cmp.config.sources({ 119 | { name = "nvim_lsp" }, 120 | { name = "buffer" }, 121 | { name = "luasnip" }, 122 | { name = "path" }, 123 | { name = "nvim_lua" }, 124 | { name = "emoji" }, 125 | { name = "neorg" }, 126 | }), 127 | } 128 | end, 129 | config = function(_, opts) 130 | local cmp = require("cmp") 131 | cmp.setup(opts) 132 | 133 | -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). 134 | cmp.setup.cmdline({ "/", "?" }, { 135 | mapping = cmp.mapping.preset.cmdline(), 136 | sources = { 137 | { name = "buffer" }, 138 | }, 139 | }) 140 | 141 | -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). 142 | cmp.setup.cmdline(":", { 143 | mapping = cmp.mapping.preset.cmdline(), 144 | sources = { 145 | { name = "path" }, 146 | { name = "cmdline" }, 147 | }, 148 | }) 149 | end, 150 | }, 151 | } 152 | -------------------------------------------------------------------------------- /lua/plugins/dap.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "mfussenegger/nvim-dap", 4 | keys = { 5 | { 6 | "dR", 7 | function() 8 | require("dap").run_to_cursor() 9 | end, 10 | desc = "Run to Cursor", 11 | }, 12 | { 13 | "dE", 14 | function() 15 | require("dapui").eval(vim.fn.input("[Expression] > ")) 16 | end, 17 | desc = "Evaluate Input", 18 | }, 19 | { 20 | "de", 21 | function() 22 | require("dapui").eval() 23 | end, 24 | mode = { "n", "v" }, 25 | desc = "Evaluate", 26 | }, 27 | { 28 | "dC", 29 | function() 30 | require("dap").set_breakpoint( 31 | vim.fn.input("[Condition] > ") 32 | ) 33 | end, 34 | desc = "Conditional Breakpoint", 35 | }, 36 | { 37 | "dL", 38 | function() 39 | require("dap").set_breakpoint( 40 | nil, 41 | nil, 42 | vim.fn.input("Log point message: ") 43 | ) 44 | end, 45 | silent = true, 46 | desc = "Set Breakpoint", 47 | }, 48 | { 49 | "dU", 50 | function() 51 | require("dapui").toggle() 52 | end, 53 | desc = "Toggle UI", 54 | }, 55 | { 56 | "dp", 57 | function() 58 | require("dap").pause.toggle() 59 | end, 60 | desc = "Pause", 61 | }, 62 | { 63 | "dr", 64 | function() 65 | require("dap").repl.toggle() 66 | end, 67 | desc = "Toggle REPL", 68 | }, 69 | { 70 | "dt", 71 | function() 72 | require("dap").toggle_breakpoint() 73 | end, 74 | desc = "Toggle Breakpoint", 75 | }, 76 | { 77 | "dB", 78 | function() 79 | require("dap").step_back() 80 | end, 81 | desc = "Step Back", 82 | }, 83 | { 84 | "dc", 85 | function() 86 | require("dap").continue() 87 | end, 88 | desc = "Continue", 89 | }, 90 | { 91 | "ds", 92 | function() 93 | require("dap").continue() 94 | end, 95 | desc = "Start", 96 | }, 97 | { 98 | "dd", 99 | function() 100 | require("dap").disconnect() 101 | end, 102 | desc = "Disconnect", 103 | }, 104 | { 105 | "dg", 106 | function() 107 | require("dap").session() 108 | end, 109 | desc = "Get Session", 110 | }, 111 | { 112 | "dh", 113 | function() 114 | require("dap.ui.widgets").hover() 115 | end, 116 | desc = "Hover Variables", 117 | }, 118 | { 119 | "dS", 120 | function() 121 | require("dap.ui.widgets").scopes() 122 | end, 123 | desc = "Scopes", 124 | }, 125 | { 126 | "di", 127 | function() 128 | require("dap").step_into() 129 | end, 130 | desc = "Step Into", 131 | }, 132 | { 133 | "do", 134 | function() 135 | require("dap").step_over() 136 | end, 137 | desc = "Step Over", 138 | }, 139 | { 140 | "du", 141 | function() 142 | require("dap").step_out() 143 | end, 144 | desc = "Step Out", 145 | }, 146 | { 147 | "dq", 148 | function() 149 | require("dap").close() 150 | end, 151 | desc = "Quit", 152 | }, 153 | { 154 | "dx", 155 | function() 156 | require("dap").terminate() 157 | end, 158 | desc = "Terminate", 159 | }, 160 | { 161 | "dO", 162 | function() 163 | require("dap").repl.open() 164 | end, 165 | silent = true, 166 | desc = "Repl Open", 167 | }, 168 | { 169 | "dl", 170 | function() 171 | require("dap").run_last() 172 | end, 173 | silent = true, 174 | desc = "Run Last", 175 | }, 176 | }, 177 | dependencies = { 178 | --TODO: maybe I don't really need plugin an could use nvim-dap ui widget 179 | { 180 | "rcarriga/nvim-dap-ui", 181 | lazy = true, 182 | opts = { 183 | icons = { 184 | expanded = "▾", 185 | collapsed = "▸", 186 | current_frame = "▸", 187 | }, 188 | mappings = { 189 | -- Use a table to apply multiple mappings 190 | expand = { "", "<2-LeftMouse>" }, 191 | open = "o", 192 | remove = "d", 193 | edit = "e", 194 | repl = "r", 195 | toggle = "t", 196 | }, 197 | -- Use this to override mappings for specific elements 198 | element_mappings = { 199 | -- Example: 200 | -- stacks = { 201 | -- open = "", 202 | -- expand = "o", 203 | -- } 204 | }, 205 | -- Expand lines larger than the window 206 | -- Requires >= 0.7 207 | expand_lines = vim.fn.has("nvim-0.7") == 1, 208 | -- Layouts define sections of the screen to place windows. 209 | -- The position can be "left", "right", "top" or "bottom". 210 | -- The size specifies the height/width depending on position. It can be an Int 211 | -- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while 212 | -- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns) 213 | -- Elements are the elements shown in the layout (in order). 214 | -- Layouts are opened in order so that earlier layouts take priority in window sizing. 215 | layouts = { 216 | { 217 | elements = { 218 | -- Elements can be strings or table with id and size keys. 219 | { id = "scopes", size = 0.4 }, 220 | "breakpoints", 221 | "stacks", 222 | "watches", 223 | }, 224 | size = 40, -- 40 columns 225 | position = "left", 226 | }, 227 | { 228 | elements = { 229 | "repl", 230 | -- "console", 231 | }, 232 | size = 0.25, -- 25% of total lines 233 | position = "bottom", 234 | }, 235 | }, 236 | controls = { 237 | -- Requires Neovim nightly (or 0.8 when released) 238 | enabled = true, 239 | -- Display controls in this element 240 | element = "repl", 241 | icons = { 242 | pause = "", 243 | play = "", 244 | step_into = "", 245 | step_over = "", 246 | step_out = "", 247 | step_back = "", 248 | run_last = "↻", 249 | terminate = "", 250 | }, 251 | }, 252 | floating = { 253 | max_height = nil, -- These can be integers or a float between 0 and 1. 254 | max_width = nil, -- Floats will be treated as percentage of your screen. 255 | border = "single", -- Border style. Can be "single", "double" or "rounded" 256 | mappings = { 257 | close = { "q", "" }, 258 | }, 259 | }, 260 | windows = { indent = 1 }, 261 | render = { 262 | max_type_length = nil, -- Can be integer or nil. 263 | max_value_lines = 100, -- Can be integer or nil. 264 | }, 265 | }, 266 | config = function(_, opts) 267 | local dapui = require("dapui") 268 | dapui.setup(opts) 269 | 270 | --TODO: lazy load dapui so dap is lazy loaded 271 | local dap = require("dap") 272 | dap.listeners.after.event_initialized["dapui_config"] = function() 273 | dapui.open() 274 | end 275 | dap.listeners.before.event_terminated["dapui_config"] = function() 276 | dapui.close() 277 | end 278 | dap.listeners.before.event_exited["dapui_config"] = function() 279 | dapui.close() 280 | end 281 | end, 282 | }, 283 | }, 284 | config = function() 285 | local dap = require("dap") 286 | 287 | dap.adapters.lldb = { 288 | type = "executable", 289 | command = "/usr/bin/lldb-vscode", -- adjust as needed, must be absolute path 290 | name = "lldb", 291 | } 292 | 293 | dap.adapters.gdb = { 294 | type = "executable", 295 | command = "gdb", 296 | args = { "-i", "dap" }, 297 | } 298 | 299 | dap.configurations.cpp = { 300 | { 301 | name = "Launch", 302 | type = "lldb", 303 | request = "launch", 304 | program = function() 305 | return vim.fn.input( 306 | "Path to executable: ", 307 | vim.fn.getcwd() .. "/", 308 | "file" 309 | ) 310 | end, 311 | cwd = "${workspaceFolder}", 312 | stopOnEntry = false, 313 | args = {}, 314 | }, 315 | { 316 | -- If you get an "Operation not permitted" error using this, try disabling YAMA: 317 | -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope 318 | name = "Attach to process", 319 | type = "cpp", -- Adjust this to match your adapter name (`dap.adapters.`) 320 | request = "attach", 321 | pid = require("dap.utils").pick_process, 322 | args = {}, 323 | }, 324 | } 325 | 326 | dap.configurations.c = dap.configurations.cpp 327 | dap.configurations.zig = { 328 | { 329 | name = "Launch", 330 | type = "gdb", 331 | request = "launch", 332 | program = function() 333 | return vim.fn.input( 334 | "Path to executable: ", 335 | vim.fn.getcwd() .. "/zig-out/bin/", 336 | "file" 337 | ) 338 | end, 339 | cwd = "${workspaceFolder}", 340 | console = "integratedTerminal", 341 | }, 342 | } 343 | 344 | dap.configurations.rust = { 345 | vim.tbl_deep_extend("force", dap.configurations.cpp[1], { 346 | initCommands = function() 347 | -- Find out where to look for the pretty printer Python module 348 | local rustc_sysroot = 349 | vim.fn.trim(vim.fn.system("rustc --print sysroot")) 350 | 351 | local script_import = 'command script import "' 352 | .. rustc_sysroot 353 | .. '/lib/rustlib/etc/lldb_lookup.py"' 354 | local commands_file = rustc_sysroot 355 | .. "/lib/rustlib/etc/lldb_commands" 356 | 357 | local commands = {} 358 | local file = io.open(commands_file, "r") 359 | if file then 360 | for line in file:lines() do 361 | table.insert(commands, line) 362 | end 363 | file:close() 364 | end 365 | table.insert(commands, 1, script_import) 366 | 367 | return commands 368 | end, 369 | }), 370 | unpack(dap.configurations.cpp, 2, #dap.configurations.cpp), 371 | } 372 | 373 | dap.adapters.delve = { 374 | type = "server", 375 | port = "${port}", 376 | executable = { 377 | command = "dlv", 378 | args = { "dap", "-l", "127.0.0.1:${port}" }, 379 | }, 380 | } 381 | 382 | -- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md 383 | dap.configurations.go = { 384 | { 385 | type = "delve", 386 | name = "Debug", 387 | request = "launch", 388 | program = "${file}", 389 | }, 390 | { 391 | type = "delve", 392 | name = "Debug test", -- configuration for debugging test files 393 | request = "launch", 394 | mode = "test", 395 | program = "${file}", 396 | }, 397 | -- works with go.mod packages and sub packages 398 | { 399 | type = "delve", 400 | name = "Debug test (go.mod)", 401 | request = "launch", 402 | mode = "test", 403 | program = "./${relativeFileDirname}", 404 | }, 405 | } 406 | 407 | dap.adapters.python = { 408 | type = "executable", 409 | command = "/bin/python", 410 | args = { "-m", "debugpy.adapter" }, 411 | } 412 | 413 | dap.configurations.python = { 414 | { 415 | type = "python", 416 | request = "launch", 417 | name = "Launch file", 418 | program = "${file}", 419 | pythonPath = function() 420 | return "/usr/bin/python" 421 | end, 422 | }, 423 | } 424 | dap.adapters.nlua = function(callback, config) 425 | callback({ 426 | type = "server", 427 | host = config.host, 428 | port = config.port, 429 | }) 430 | end 431 | 432 | dap.configurations.lua = { 433 | { 434 | type = "nlua", 435 | request = "attach", 436 | name = "Attach to running Neovim instance", 437 | host = function() 438 | local value = vim.fn.input("Host [127.0.0.1]: ") 439 | if value ~= "" then 440 | return value 441 | end 442 | return "127.0.0.1" 443 | end, 444 | port = function() 445 | local val = tonumber(vim.fn.input("Port: ", "8086")) 446 | assert(val, "Please provide a port number") 447 | return val 448 | end, 449 | }, 450 | } 451 | end, 452 | }, 453 | } 454 | -------------------------------------------------------------------------------- /lua/plugins/dashboard.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvimdev/dashboard-nvim", 4 | event = "VimEnter", 5 | init = function() 6 | vim.cmd([[hi DashboardHeader guifg=#ee872d gui=bold]]) 7 | vim.cmd([[hi DashboardProjectTitle guifg=#d55fde gui=bold]]) 8 | vim.cmd([[hi DashboardProjectIcon guifg=#89ca78]]) 9 | vim.cmd([[hi DashboardMruTitle guifg=#d55fde gui=bold]]) 10 | vim.cmd([[hi DashboardShortCut guifg=#89ca78 gui=bold]]) 11 | end, 12 | opts = { 13 | theme = "hyper", 14 | config = { 15 | header = { 16 | [[]], 17 | [[███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗]], 18 | [[████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║]], 19 | [[██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║]], 20 | [[██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║]], 21 | [[██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║]], 22 | [[╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]], 23 | [[]], 24 | }, 25 | shortcut = { 26 | { 27 | icon = " ", -- 28 | desc = " Files", 29 | group = "Label", 30 | key = "f", 31 | action = "Telescope find_files", 32 | }, 33 | { 34 | desc = " Find text", 35 | group = "@property", 36 | key = "g", 37 | action = "Telescope live_grep ", 38 | }, 39 | { 40 | desc = " New file", 41 | group = "Macro", 42 | key = "n", 43 | action = "NvimTreeToggle", 44 | }, 45 | { 46 | desc = " Config", 47 | group = "DiagnosticHint", 48 | key = "c", 49 | action = "e $MYVIMRC ", 50 | }, 51 | { 52 | desc = " Quit", 53 | group = "Number", 54 | key = "q", 55 | action = "qa", 56 | }, 57 | -- { 58 | -- desc = " Recent files", 59 | -- group = "", 60 | -- key = "r", 61 | -- action = "Telescope oldfiles ", 62 | -- }, 63 | -- { 64 | -- desc = "󰊳 Update", 65 | -- group = "@property", 66 | -- key = "u", 67 | -- action = "Lazy update", 68 | -- }, 69 | -- { 70 | -- icon="", 71 | -- icon_hl = "@variable", 72 | -- desc = "Apps", 73 | -- group = "DiagnosticHint", 74 | -- key = "a", 75 | -- action = "Telescope app", 76 | -- }, 77 | -- { 78 | -- desc = " dotfiles", 79 | -- group = "Number", 80 | -- key = "d", 81 | -- action = "Telescope dotfiles", 82 | -- }, 83 | }, 84 | }, 85 | hide = { 86 | statusline = true, -- hide statusline default is true 87 | tabline = false, -- hide the tabline 88 | winbar = true, -- hide winbar 89 | }, 90 | }, 91 | }, 92 | } 93 | -------------------------------------------------------------------------------- /lua/plugins/editor.lua: -------------------------------------------------------------------------------- 1 | -- every spec file under config.plugins will be loaded automatically by lazy.nvim 2 | return { 3 | 4 | -- auto pairs 5 | { 6 | "windwp/nvim-autopairs", 7 | event = "VeryLazy", 8 | config = function(_, opts) 9 | require("nvim-autopairs").setup(opts) 10 | end, 11 | }, 12 | -- comments 13 | { 14 | "numToStr/Comment.nvim", 15 | event = "VeryLazy", 16 | config = function(_, opts) 17 | require("Comment").setup(opts) 18 | end, 19 | }, 20 | -- library used by other plugins 21 | { "nvim-lua/plenary.nvim", lazy = true }, 22 | { "nvim-tree/nvim-web-devicons", lazy = true }, -- Glyphs and Icons for neovim 23 | 24 | -- todo comments 25 | { 26 | "folke/todo-comments.nvim", 27 | event = "VeryLazy", 28 | cmd = { "TodoTelescope", "TodoLocList" }, 29 | config = true, 30 | -- stylua: ignore 31 | keys = { 32 | { "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" }, 33 | { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" }, 34 | { "tt", "TodoTelescope", desc = "List Todo in Telescope" }, 35 | { "tl", "TodoLocList", desc = "List Todo in LocList" }, 36 | }, 37 | }, 38 | -- which-key 39 | { 40 | "folke/which-key.nvim", 41 | event = "VeryLazy", 42 | opts = { 43 | spec = { 44 | { 45 | mode = { "n", "v" }, 46 | { "", group = "tabs" }, 47 | { "b", group = "buffer/BufferLine" }, 48 | { "c", group = "code" }, 49 | { "d", group = "debugger" }, 50 | { "f", group = "file/find" }, 51 | { "g", group = "git" }, 52 | { "gh", group = "hunks" }, 53 | { "h", group = "gitsigns/hop" }, 54 | { "q", group = "quit/session" }, 55 | { "s", group = "search" }, 56 | { "u", group = "ui/toggle" }, 57 | { "w", group = "windows" }, 58 | { "x", group = "diagnostics/quickfix" }, 59 | { "u", group = "toggle" }, 60 | { "[", group = "prev" }, 61 | { "]", group = "next" }, 62 | { "g", group = "goto" }, 63 | { "gz", group = "surround" }, 64 | }, 65 | }, 66 | plugins = { 67 | marks = true, -- shows a list of your marks on ' and ` 68 | registers = true, -- shows your registers on " in NORMAL or in INSERT mode 69 | -- the presets plugin, adds help for a bunch of default keybindings in Neovim 70 | -- No actual key bindings are created 71 | spelling = { 72 | enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions 73 | suggestions = 20, -- how many suggestions should be shown in the list? 74 | }, 75 | presets = { 76 | operators = true, -- adds help for operators like d, y, ... 77 | motions = true, -- adds help for motions 78 | text_objects = true, -- help for text objects triggered after entering an operator 79 | windows = true, -- default bindings on 80 | nav = true, -- misc bindings to work with windows 81 | z = true, -- bindings for folds, spelling and others prefixed with z 82 | g = true, -- bindings for prefixed with g 83 | }, 84 | }, 85 | }, 86 | config = function(_, opts) 87 | local wk = require("which-key") 88 | wk.setup(opts) 89 | end, 90 | }, 91 | } 92 | -------------------------------------------------------------------------------- /lua/plugins/gitsigns.lua: -------------------------------------------------------------------------------- 1 | local defaults = require("config.defaults") 2 | return { 3 | -- git signs 4 | { 5 | "lewis6991/gitsigns.nvim", 6 | event = { "BufReadPre", "BufNewFile" }, 7 | opts = { 8 | signs = defaults.icons.git, 9 | signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` 10 | numhl = false, -- Toggle with `:Gitsigns toggle_numhl` 11 | linehl = false, -- Toggle with `:Gitsigns toggle_linehl` 12 | word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` 13 | current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` 14 | -- Options passed to nvim_open_win 15 | preview_config = { 16 | border = defaults.diagnostics_options.float.border, 17 | style = "minimal", 18 | relative = "cursor", 19 | row = 0, 20 | col = 1, 21 | }, 22 | --disable gitsigns using trouble for :Gitsigns setqflist or 23 | --:Gitsigns seqloclist by default if installed 24 | trouble = false, 25 | on_attach = function(bufnr) 26 | local gs = package.loaded.gitsigns 27 | 28 | local function map(mode, l, r, opts) 29 | opts = opts 30 | and vim.tbl_extend( 31 | "force", 32 | opts, 33 | { buffer = bufnr } 34 | ) 35 | or {} 36 | vim.keymap.set(mode, l, r, opts) 37 | end 38 | 39 | -- Navigation 40 | map("n", "]h", function() 41 | if vim.wo.diff then 42 | return "]c" 43 | end 44 | vim.schedule(function() 45 | gs.next_hunk() 46 | end) 47 | return "" 48 | end, { expr = true, desc = "next hunk" }) 49 | 50 | map("n", "[h", function() 51 | if vim.wo.diff then 52 | return "[c" 53 | end 54 | vim.schedule(function() 55 | gs.prev_hunk() 56 | end) 57 | return "" 58 | end, { expr = true, desc = "previous hunk" }) 59 | 60 | -- Actions 61 | map("n", "hs", gs.stage_hunk, { desc = "stage hunks" }) 62 | map("v", "hs", function() 63 | gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) 64 | end, { desc = "stage hunks" }) 65 | map("n", "hr", gs.reset_hunk, { desc = "reset hunks" }) 66 | map("v", "hr", function() 67 | gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) 68 | end, { desc = "reset hunks" }) 69 | map("n", "hS", function() 70 | gs.stage_buffer() 71 | end, { desc = "stage buffer" }) 72 | map("n", "hu", function() 73 | gs.undo_stage_hunk() 74 | end, { desc = "unstage hunk" }) 75 | map("n", "hR", function() 76 | gs.reset_buffer() 77 | end, { desc = "reset buffer" }) 78 | map("n", "hp", function() 79 | gs.preview_hunk() 80 | end, { desc = "preview hunk" }) 81 | map("n", "hb", function() 82 | gs.blame_line({ full = true }) 83 | end, { desc = "blame line" }) 84 | map("n", "tb", function() 85 | gs.toggle_current_line_blame() 86 | end, { desc = "toggle line blame" }) 87 | map("n", "hd", function() 88 | gs.diffthis() 89 | end, { desc = "diff this" }) 90 | map("n", "hD", function() 91 | gs.diffthis("~") 92 | end, { desc = "diff entire buffer" }) 93 | map("n", "td", function() 94 | gs.toggle_deleted() 95 | end, { desc = "toggle deleted" }) 96 | 97 | -- Text object 98 | map( 99 | { "o", "x" }, 100 | "ih", 101 | "Gitsigns select_hunk", 102 | { desc = "select hunks" } 103 | ) 104 | end, 105 | }, 106 | }, 107 | } 108 | -------------------------------------------------------------------------------- /lua/plugins/lsp.lua: -------------------------------------------------------------------------------- 1 | local float = require("config.defaults").diagnostics_options.float 2 | return { 3 | { 4 | "neovim/nvim-lspconfig", 5 | event = { "BufReadPre", "BufNewFile" }, 6 | dependencies = { 7 | { 8 | "ray-x/lsp_signature.nvim", 9 | opts = { 10 | bind = true, 11 | max_height = float.max_height, 12 | max_width = float.max_width, 13 | hint_inline = function() 14 | return vim.version.gt(vim.version(), { 0, 9, 0 }) 15 | end, 16 | handler_opts = { 17 | border = float.border, 18 | }, 19 | }, 20 | }, 21 | { 22 | "folke/neodev.nvim", 23 | ft = "lua", 24 | opts = { 25 | pathStrict = true, 26 | library = { plugins = { "nvim-dap-ui" }, types = true }, 27 | }, 28 | }, 29 | }, 30 | opts = { 31 | -- LSP Server Settings 32 | servers = { 33 | -- cssls = {}, 34 | -- html = {}, 35 | -- jsonls = {}, 36 | -- tailwindcss = {}, 37 | -- tsserver = {}, 38 | -- volar = {}, 39 | bashls = { 40 | filetypes = { "bash", "sh" }, 41 | }, 42 | mojo = {}, 43 | -- use pylsp-mypy for mypy 44 | -- use python-lsp-ruff for ruff 45 | -- use pylsp-inlay-hints for inlay hints 46 | pylsp = {}, 47 | phan = {}, 48 | phpactor = {}, 49 | psalm = {}, 50 | clangd = { 51 | cmd = { 52 | "clangd", 53 | "--clang-tidy", 54 | "-j=5", 55 | "--malloc-trim", 56 | }, 57 | filetypes = { "c" }, -- "cpp" 58 | }, 59 | zls = {}, 60 | rust_analyzer = { 61 | settings = { 62 | ["rust-analyzer"] = { 63 | check = { 64 | command = "clippy", 65 | features = "all", 66 | }, 67 | }, 68 | }, 69 | }, 70 | lua_ls = { 71 | cmd = { 72 | "lua-language-server", 73 | "-E", 74 | "/usr/share/lua-language-server/main.lua", 75 | }, 76 | on_init = function(client) 77 | if client.workspace_folders then 78 | local path = client.workspace_folders[1].name 79 | if 80 | vim.uv.fs_stat(path .. "/.luarc.json") 81 | or vim.uv.fs_stat(path .. "/.luarc.jsonc") 82 | then 83 | return 84 | end 85 | end 86 | end, 87 | settings = { 88 | Lua = { 89 | runtime = { 90 | -- LuaJIT in the case of Neovim 91 | version = "LuaJIT", 92 | }, 93 | diagnostics = { 94 | -- Get the language server to recognize the `vim` global 95 | globals = { "vim" }, 96 | }, 97 | workspace = { 98 | -- Make the server aware of Neovim runtime files 99 | library = vim.env.VIMRUNTIME, 100 | -- This feature causes the lsp to use the "environment emulation" feature to suggest 101 | -- applying a library/framework when a certain keyword or filename has been found 102 | checkThirdParty = false, 103 | }, 104 | -- disable lua_ls default formater since I use stylua 105 | format = { enable = false }, 106 | hint = { enable = true, setType = true }, 107 | }, 108 | }, 109 | }, 110 | }, 111 | -- you can do any additional lsp server setup here 112 | setup = { 113 | lua_ls = function(server, opts) 114 | require("lspconfig")[server].setup(opts) 115 | end, 116 | }, 117 | }, 118 | config = function(_, opts) 119 | local on_attach = function(client, bufnr) 120 | _ = client 121 | _ = bufnr 122 | -- if vim.filetype.match({ buf = bufnr }) == "lua" then 123 | -- end 124 | require("lspconfig.ui.windows").default_options = { 125 | border = float.border, 126 | } 127 | end 128 | 129 | local function setup(server, server_config) 130 | if opts.setup[server] then 131 | if opts.setup[server](server, server_config) then 132 | return 133 | end 134 | end 135 | require("lspconfig")[server].setup(server_config) 136 | end 137 | 138 | local servers = opts.servers 139 | local capabilities = require("cmp_nvim_lsp").default_capabilities( 140 | vim.lsp.protocol.make_client_capabilities() 141 | ) 142 | 143 | for server, _ in pairs(servers) do 144 | local server_config = vim.tbl_deep_extend("force", { 145 | capabilities = vim.deepcopy(capabilities), 146 | on_attach = on_attach, 147 | }, servers[server] or {}) 148 | 149 | setup(server, server_config) 150 | end 151 | end, 152 | }, 153 | { 154 | "nvimdev/lspsaga.nvim", 155 | event = "LspAttach", 156 | opts = { 157 | ui = { 158 | border = float.border, 159 | }, 160 | outline = { 161 | layout = "float", 162 | }, 163 | }, 164 | }, 165 | { 166 | "nvimtools/none-ls.nvim", 167 | event = { "BufReadPre", "BufNewFile" }, 168 | opts = function() 169 | local null_ls = require("null-ls") 170 | return { 171 | diagnostics_format = "#{m} (#{s})", 172 | sources = { 173 | -- cpp 174 | null_ls.builtins.diagnostics.cppcheck.with({ 175 | extra_args = { 176 | "--inconclusive", 177 | }, 178 | }), 179 | -- lua 180 | null_ls.builtins.diagnostics.selene, 181 | null_ls.builtins.formatting.stylua, 182 | -- php 183 | null_ls.builtins.diagnostics.phpstan, 184 | null_ls.builtins.formatting.phpcsfixer, 185 | -- shell 186 | null_ls.builtins.diagnostics.zsh.with({ 187 | filetypes = { "zsh" }, 188 | }), 189 | null_ls.builtins.hover.printenv.with({ 190 | filetypes = { "zsh", "bash", "sh", "dosbatch", "ps1" }, 191 | }), 192 | -- Docker 193 | null_ls.builtins.diagnostics.hadolint, 194 | -- opengl 195 | null_ls.builtins.diagnostics.glslc.with({ 196 | -- use opengl instead of vulkan1.0 197 | extra_args = { "--target-env=opengl" }, 198 | }), 199 | }, 200 | } 201 | end, 202 | }, 203 | } 204 | -------------------------------------------------------------------------------- /lua/plugins/neorg.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-neorg/neorg", 4 | -- lazy-load on filetype 5 | ft = "norg", 6 | build = function() 7 | vim.cmd("Neorg sync-parsers") 8 | end, 9 | opts = { 10 | load = { 11 | ["core.defaults"] = {}, -- Tells neorg to load the module called core.defaults with no extra data 12 | ["core.keybinds"] = { -- Configure core.keybinds 13 | config = { 14 | default_keybinds = true, -- Generate the default keybinds 15 | neorg_leader = "n", -- default neorg mapleader 16 | }, 17 | }, 18 | ["core.concealer"] = {}, 19 | ["core.dirman"] = { 20 | config = { 21 | -- Define your workspaces here! 22 | workspaces = { 23 | -- You can give it any name and any directory, get creative! 24 | notes = "~/.local/neorg", 25 | }, 26 | }, 27 | }, 28 | ["core.completion"] = { 29 | config = { 30 | engine = "nvim-cmp", 31 | }, 32 | }, 33 | }, 34 | }, 35 | }, 36 | } 37 | -------------------------------------------------------------------------------- /lua/plugins/statusbar.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- Tabline 3 | -- A snazzy buffer line (with minimal tab integration) for Neovim 4 | { 5 | "akinsho/bufferline.nvim", 6 | event = { "BufReadPost", "BufNewFile" }, 7 | keys = { 8 | -- pick a buffer to view from the buffer list 9 | { "bs", "BufferLinePick", desc = "select buffer" }, 10 | -- pick a buffer to closes from the buffer list 11 | { 12 | "bc", 13 | "BufferLinePickClose", 14 | desc = "close selected buffer", 15 | }, 16 | { 17 | "bcl", 18 | "BufferLineCloseLeft", 19 | desc = "close buffers to the left", 20 | }, 21 | { 22 | "bcr", 23 | "BufferLineCloseRight", 24 | desc = "close buffers to the right", 25 | }, 26 | { 27 | "bcu", 28 | "BufferLineGroupClose ungrouped", 29 | desc = "close ungrouped buffers", 30 | }, 31 | { 32 | "bcp", 33 | "BufferLineGroupClose pinned", 34 | desc = "close pinned buffers", 35 | }, 36 | { 37 | "bp", 38 | "BufferLineTogglePin", 39 | desc = "Toggle pin", 40 | }, 41 | { 42 | "bP", 43 | "BufferLineGroupToggle pinned", 44 | desc = "Toggle displaying pinned buffers", 45 | }, 46 | { 47 | "bU", 48 | "BufferLineGroupToggle ungrouped", 49 | desc = "Toggle displaying ungrouped buffers", 50 | }, 51 | }, 52 | opts = { 53 | options = { 54 | numbers = function(opts) 55 | return string.format( 56 | "%s|%s", 57 | opts.id, 58 | opts.raise(opts.ordinal) 59 | ) 60 | end, 61 | max_name_length = 18, 62 | max_prefix_length = 15, -- prefix used when a buffer is de-duplicated 63 | tab_size = 18, 64 | offsets = { 65 | { 66 | filetype = "NvimTree", 67 | text = "File Explorer", 68 | text_align = "left", --[[| "center" | "right",]] 69 | }, 70 | }, 71 | hover = { 72 | enabled = true, 73 | delay = 200, 74 | reveal = { "close" }, 75 | }, 76 | show_buffer_icons = true, --| false, -- disable filetype icons for buffers 77 | show_buffer_close_icons = true, --| false, 78 | show_close_icon = true, --| false, 79 | show_tab_indicators = true, --| false, 80 | persist_buffer_sort = true, -- whether or not custom sorted buffers should persist 81 | -- can also be a table containing 2 custom separators 82 | -- [focused and unfocused]. eg: { '|', '|' } 83 | separator_style = "slant", --| "thick" | "thin" | { 'any', 'any' }, 84 | enforce_regular_tabs = false, --| true, 85 | always_show_bufferline = true, --| false, 86 | diagnostics = "nvim_lsp", 87 | --- count is an integer representing total count of errors 88 | --- level is a string "error" | "warning" 89 | --- diagnostics_dict is a dictionary from error level ("error", "warning" or "info")to number of errors for each level. 90 | --- this should return a string 91 | --- Don't get too fancy as this function will be executed a lot 92 | diagnostics_indicator = function( 93 | count, 94 | level, 95 | diagnostics_dict, 96 | context 97 | ) 98 | _ = context 99 | _ = diagnostics_dict 100 | local icon = level:match("error") and " " 101 | or (level:match("warning") and " " or "") 102 | return " " .. icon .. count 103 | end, 104 | groups = { 105 | options = { 106 | toggle_hidden_on_enter = true, -- when you re-enter a hidden group this options re-opens that group so the buffer is visible 107 | }, 108 | items = { 109 | { 110 | name = "Tests", -- Mandatory 111 | highlight = { underline = true, sp = "blue" }, -- Optional 112 | priority = 2, -- determines where it will appear relative to other groups (Optional) 113 | icon = "", -- Optional 114 | matcher = function(buf) -- Mandatory 115 | return buf.name:match("%_test") 116 | or buf.name:match("%_spec") 117 | end, 118 | }, 119 | { 120 | name = "Docs", 121 | highlight = { undercurl = true, sp = "green" }, 122 | auto_close = false, -- whether or not close this group if it doesn't contain the current buffer 123 | matcher = function(buf) 124 | return buf.name:match("%.md") 125 | or buf.name:match("%.txt") 126 | end, 127 | separator = { -- Optional 128 | -- style = require('bufferline.groups').separator.tab 129 | }, 130 | }, 131 | }, 132 | }, 133 | }, 134 | }, 135 | }, 136 | 137 | -- statusline 138 | { 139 | "nvim-lualine/lualine.nvim", 140 | event = { "BufReadPost", "BufNewFile" }, 141 | opts = function() 142 | local function total_num_lines() 143 | return vim.api.nvim_buf_line_count(0) 144 | end 145 | 146 | return { 147 | options = { 148 | theme = "onedark", -- "auto", "catppuccin", 149 | component_separators = "|", 150 | section_separators = { left = "", right = "" }, 151 | }, 152 | sections = { 153 | lualine_a = { 154 | { 155 | "mode", 156 | separator = { left = "" }, 157 | right_padding = 2, 158 | }, 159 | }, 160 | lualine_b = { "branch", "diff" }, 161 | lualine_c = { 162 | { 163 | "filename", 164 | file_status = true, -- displays file status (readonly status, modified status) 165 | path = 1, -- 0 = just filename, 1 = relative path, 2 = absolute path 166 | }, 167 | }, 168 | lualine_x = { "encoding", "fileformat" }, 169 | lualine_y = { "filetype", total_num_lines }, 170 | lualine_z = { 171 | { 172 | "location", 173 | separator = { right = "" }, 174 | left_padding = 2, 175 | }, 176 | }, 177 | }, 178 | } 179 | end, 180 | }, 181 | } 182 | -------------------------------------------------------------------------------- /lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | --TODO: use immediately invoked function expression for vimgrep_arguments .ie 2 | --(fn()statement end)() 3 | --HACK: move mappings from previous configuration here 4 | --https://github.com/nvim-telescope/telescope.nvim/blob/master/lua/telescope/builtin/__files.lua 5 | --HELP: telescope nvim 6 | local function is_git_repo() 7 | vim.fn.system("git rev-parse --is-inside-work-tree") 8 | ---@diagnostic disable-next-line: undefined-field 9 | return vim.v.shell_error == 0 10 | end 11 | -- this will return a function that calls telescope. 12 | -- cwd will default to lazyvim.util.get_root 13 | -- for `files`, git_files or find_files will be chosen depending on .git 14 | local telescope_builtin = function(builtin, opts) 15 | local params = { builtin = builtin, opts = opts or {} } 16 | 17 | return function() 18 | builtin = params.builtin 19 | opts = params.opts 20 | if builtin == "files" then 21 | if is_git_repo() then 22 | opts.show_untracked = true 23 | builtin = "git_files" 24 | else 25 | builtin = "find_files" 26 | end 27 | -- live_grep_from_project_git_root 28 | -- TODO: test with and without the `get_git_root` 29 | elseif builtin == "live_grep" then 30 | local function get_git_root() 31 | local dot_git_path = vim.fn.finddir(".git", ".;") 32 | return vim.fn.fnamemodify(dot_git_path, ":h") 33 | end 34 | 35 | if is_git_repo() then 36 | opts.cwd = get_git_root() 37 | end 38 | end 39 | require("telescope.builtin")[builtin](opts) 40 | end 41 | end 42 | 43 | return { 44 | -- fuzzy finder 45 | { 46 | "nvim-telescope/telescope.nvim", 47 | cmd = "Telescope", 48 | keys = { 49 | { 50 | ",", 51 | telescope_builtin("buffers", { show_all_buffers = true }), 52 | desc = "Switch Buffer", 53 | }, 54 | { 55 | "fb", 56 | telescope_builtin("buffers"), 57 | desc = "Buffers", 58 | }, 59 | { 60 | ":", 61 | telescope_builtin("command_history"), 62 | desc = "Command History", 63 | }, 64 | -- find 65 | { 66 | "", 67 | telescope_builtin("files"), 68 | desc = "Find Files (root dir)", 69 | }, 70 | { 71 | "ff", 72 | telescope_builtin("files"), 73 | desc = "Find Files (root dir)", 74 | }, 75 | { 76 | "fr", 77 | telescope_builtin("oldfiles"), 78 | desc = "Recent", 79 | }, 80 | -- git 81 | { 82 | "gc", 83 | telescope_builtin("git_commits"), 84 | desc = "commits", 85 | }, 86 | { 87 | "gs", 88 | telescope_builtin("git_status"), 89 | desc = "status", 90 | }, 91 | -- search 92 | { 93 | "sa", 94 | telescope_builtin("autocommands"), 95 | desc = "Auto Commands", 96 | }, 97 | { 98 | "sb", 99 | telescope_builtin("current_buffer_fuzzy_find"), 100 | desc = "Buffer", 101 | }, 102 | { 103 | "sc", 104 | telescope_builtin("command_history"), 105 | desc = "Command History", 106 | }, 107 | { 108 | "sC", 109 | telescope_builtin("commands"), 110 | desc = "Commands", 111 | }, 112 | { 113 | "/", 114 | telescope_builtin("live_grep"), 115 | desc = "Find in Files (Grep)", 116 | }, 117 | { 118 | "sg", 119 | telescope_builtin("live_grep"), 120 | desc = "Grep (root dir)", 121 | }, 122 | { 123 | "sh", 124 | telescope_builtin("help_tags"), 125 | desc = "Help Pages", 126 | }, 127 | { 128 | "sH", 129 | telescope_builtin("highlights"), 130 | desc = "Search Highlight Groups", 131 | }, 132 | { 133 | "sk", 134 | telescope_builtin("keymaps"), 135 | desc = "Key Maps", 136 | }, 137 | { 138 | "sM", 139 | telescope_builtin("man_pages"), 140 | desc = "Man Pages", 141 | }, 142 | { 143 | "sm", 144 | telescope_builtin("marks"), 145 | desc = "Jump to Mark", 146 | }, 147 | { 148 | "so", 149 | telescope_builtin("vim_options"), 150 | desc = "Options", 151 | }, 152 | { 153 | "sw", 154 | telescope_builtin("grep_string"), 155 | desc = "Word (root dir)", 156 | }, 157 | { 158 | "uC", 159 | telescope_builtin("colorscheme", { enable_preview = true }), 160 | desc = "Colorscheme with preview", 161 | }, 162 | { 163 | "ss", 164 | telescope_builtin("lsp_document_symbols"), 165 | desc = "List Symbols (current buffer)", 166 | }, 167 | { 168 | "sS", 169 | telescope_builtin("lsp_workspace_symbols"), 170 | desc = "List Symbols (Workspace)", 171 | }, 172 | { 173 | "sr", 174 | telescope_builtin("lsp_references"), 175 | desc = "List LSP references for word under the cursor", 176 | }, 177 | { 178 | "R", 179 | telescope_builtin("resume"), 180 | desc = "Resume", 181 | }, 182 | { 183 | "sd", 184 | telescope_builtin("diagnostics", { bufnr = 0 }), 185 | desc = "Lists Diagnostics for the current buffer", 186 | }, 187 | { 188 | "sD", 189 | telescope_builtin("diagnostics"), 190 | desc = "Lists all Diagnostics for all open buffers", 191 | }, 192 | }, 193 | opts = function() 194 | local actions = require("telescope.actions") 195 | return { 196 | defaults = { 197 | prompt_prefix = " ", 198 | selection_caret = " ", 199 | mappings = { 200 | i = { 201 | [""] = actions.close, 202 | [""] = function() 203 | telescope_builtin( 204 | "find_files", 205 | { no_ignore = true } 206 | )() 207 | end, 208 | [""] = function() 209 | telescope_builtin( 210 | "find_files", 211 | { hidden = true } 212 | )() 213 | end, 214 | [""] = function(...) 215 | return require("telescope.actions").cycle_history_next( 216 | ... 217 | ) 218 | end, 219 | [""] = function(...) 220 | return require("telescope.actions").cycle_history_prev( 221 | ... 222 | ) 223 | end, 224 | [""] = function(...) 225 | return require("telescope.actions").preview_scrolling_down( 226 | ... 227 | ) 228 | end, 229 | [""] = function(...) 230 | return require("telescope.actions").preview_scrolling_up( 231 | ... 232 | ) 233 | end, 234 | }, 235 | n = { 236 | ["q"] = function(...) 237 | return require("telescope.actions").close(...) 238 | end, 239 | [""] = actions.close, 240 | }, 241 | }, 242 | vimgrep_arguments = (function() 243 | if is_git_repo() then 244 | return { 245 | "git", 246 | "grep", 247 | "--full-name", 248 | "--line-number", 249 | "--column", 250 | "--extended-regexp", 251 | "--ignore-case", 252 | "--no-color", 253 | "--recursive", 254 | "--recurse-submodules", 255 | "-I", 256 | } 257 | else 258 | return { 259 | "grep", 260 | "--extended-regexp", 261 | "--color=never", 262 | "--with-filename", 263 | "--line-number", 264 | "-b", -- grep doesn't support a `--column` option :( 265 | "--ignore-case", 266 | "--recursive", 267 | "--no-messages", 268 | "--exclude-dir=*cache*", 269 | "--exclude-dir=*.git", 270 | "--exclude=.*", 271 | "--binary-files=without-match", 272 | } 273 | end 274 | end)(), 275 | }, 276 | } 277 | end, 278 | }, 279 | } 280 | -------------------------------------------------------------------------------- /lua/plugins/tree.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 3 | -- === UI === -- 4 | -- A Neovim File explorer 5 | { 6 | "nvim-tree/nvim-tree.lua", 7 | cmd = "NvimTreeToggle", 8 | keys = { 9 | { 10 | "n", 11 | function() 12 | require("nvim-tree.api").tree.toggle({ 13 | focus = true, 14 | find_file = true, 15 | }) 16 | end, 17 | mode = "n", 18 | silent = true, 19 | desc = "toggle tree", 20 | }, 21 | }, 22 | init = function() 23 | local autocmd = vim.api.nvim_create_autocmd 24 | 25 | autocmd("BufEnter", { 26 | group = vim.api.nvim_create_augroup( 27 | "NvimTreeClose", 28 | { clear = true } 29 | ), 30 | pattern = "NvimTree_*", 31 | callback = function() 32 | local layout = vim.api.nvim_call_function("winlayout", {}) 33 | if 34 | layout[1] == "leaf" 35 | and vim.api.nvim_buf_get_option( 36 | vim.api.nvim_win_get_buf(layout[2]), 37 | "filetype" 38 | ) == "NvimTree" 39 | and layout[3] == nil 40 | then 41 | vim.cmd("confirm quit") 42 | end 43 | end, 44 | }) 45 | 46 | -- when no file/directory is opened at startup 47 | -- skip nvim-tree so that dashboard can load 48 | local cmdline_args = -1 49 | if vim.fn.argc(cmdline_args) == 0 then 50 | return 51 | else 52 | autocmd({ "VimEnter" }, { 53 | -- open nvim-tree for noname buffers and directory 54 | callback = function(args) 55 | -- buffer is a [No Name] 56 | local no_name = args.file == "" 57 | and vim.bo[args.buf].buftype == "" 58 | -- buffer is a directory 59 | local directory = vim.fn.isdirectory(args.file) == 1 60 | 61 | if not directory and not no_name then 62 | return 63 | end 64 | 65 | local api = require("nvim-tree.api") 66 | 67 | if directory then 68 | -- change to the directory 69 | vim.cmd.cd(args.file) 70 | -- open the tree 71 | api.tree.open() 72 | else 73 | -- open the tree, find the file but don't focus it 74 | api.tree.toggle({ focus = false, find_file = true }) 75 | end 76 | end, 77 | }) 78 | end 79 | end, 80 | config = function(_, opts) 81 | require("nvim-tree").setup(opts) 82 | end, 83 | opts = function(_, _) 84 | local function on_attach(bufnr) 85 | local api = require("nvim-tree.api") 86 | 87 | local function opts(desc) 88 | return { 89 | desc = "nvim-tree: " .. desc, 90 | buffer = bufnr, 91 | noremap = true, 92 | silent = true, 93 | nowait = true, 94 | } 95 | end 96 | local map = vim.keymap.set 97 | 98 | -- Default mappings. Feel free to modify or remove as you wish. 99 | -- 100 | -- BEGIN_DEFAULT_ON_ATTACH 101 | map("n", "g?", api.tree.toggle_help, opts("Help")) 102 | 103 | map("n", "", api.tree.change_root_to_node, opts("CD")) 104 | map("n", "C", api.tree.change_root_to_node, opts("CD")) 105 | 106 | map("n", "E", api.tree.expand_all, opts("Expand All")) 107 | map("n", "q", api.tree.close, opts("Close")) 108 | map("n", "R", api.tree.reload, opts("Refresh")) 109 | map("n", "S", api.tree.search_node, opts("Search")) 110 | map( 111 | "n", 112 | "U", 113 | api.tree.toggle_custom_filter, 114 | opts("Toggle Hidden") 115 | ) 116 | map( 117 | "n", 118 | "H", 119 | api.tree.toggle_hidden_filter, 120 | opts("Toggle Dotfiles") 121 | ) 122 | map("n", "W", api.tree.collapse_all, opts("Collapse")) 123 | 124 | map( 125 | "n", 126 | "", 127 | api.node.open.replace_tree_buffer, 128 | opts("Open: In Place") 129 | ) 130 | map("n", "", api.node.open.edit, opts("Open")) 131 | map("n", "o", api.node.open.edit, opts("Open")) 132 | map( 133 | "n", 134 | "O", 135 | api.node.open.no_window_picker, 136 | opts("Open: No Window Picker") 137 | ) 138 | 139 | map("n", "", api.node.show_info_popup, opts("File Info")) 140 | 141 | map( 142 | "n", 143 | "", 144 | api.fs.rename_sub, 145 | opts("Rename: Omit Filename") 146 | ) 147 | map("n", "e", api.fs.rename_basename, opts("Rename: Basename")) 148 | map("n", "r", api.fs.rename, opts("Rename File")) 149 | map("n", "a", api.fs.create, opts("Create File")) 150 | map("n", "c", api.fs.copy.node, opts("Copy File")) 151 | map("n", "y", api.fs.copy.filename, opts("Copy Name")) 152 | map( 153 | "n", 154 | "Y", 155 | api.fs.copy.relative_path, 156 | opts("Copy Relative Path") 157 | ) 158 | map( 159 | "n", 160 | "gy", 161 | api.fs.copy.absolute_path, 162 | opts("Copy Absolute Path") 163 | ) 164 | map("n", "d", api.fs.remove, opts("Delete")) 165 | map("n", "D", api.fs.trash, opts("Trash")) 166 | map("n", "p", api.fs.paste, opts("Paste")) 167 | map("n", "x", api.fs.cut, opts("Cut")) 168 | 169 | map( 170 | "n", 171 | "", 172 | api.node.open.vertical, 173 | opts("Open: Vertical Split") 174 | ) 175 | map( 176 | "n", 177 | "", 178 | api.node.open.horizontal, 179 | opts("Open: Horizontal Split") 180 | ) 181 | map("n", "", api.node.open.tab, opts("Open: New Tab")) 182 | 183 | map( 184 | "n", 185 | "", 186 | api.node.navigate.parent_close, 187 | opts("Close Directory") 188 | ) 189 | 190 | map("n", "", api.node.open.preview, opts("Open Preview")) 191 | 192 | map( 193 | "n", 194 | ">", 195 | api.node.navigate.sibling.next, 196 | opts("Next Sibling") 197 | ) 198 | map( 199 | "n", 200 | "<", 201 | api.node.navigate.sibling.prev, 202 | opts("Previous Sibling") 203 | ) 204 | map( 205 | "n", 206 | "J", 207 | api.node.navigate.sibling.last, 208 | opts("Last Sibling") 209 | ) 210 | map( 211 | "n", 212 | "K", 213 | api.node.navigate.sibling.first, 214 | opts("First Sibling") 215 | ) 216 | map( 217 | "n", 218 | "P", 219 | api.node.navigate.parent, 220 | opts("Parent Directory") 221 | ) 222 | map("n", "-", api.tree.change_root_to_parent, opts("Up")) 223 | 224 | map("n", ".", api.node.run.cmd, opts("Run File Command")) 225 | map("n", "s", api.node.run.system, opts("Run System")) 226 | 227 | map("n", "bmv", api.marks.bulk.move, opts("Move Bookmarked")) 228 | map("n", "m", api.marks.toggle, opts("Toggle Bookmark")) 229 | 230 | map("n", "[c", api.node.navigate.git.prev, opts("Prev Git")) 231 | map("n", "]c", api.node.navigate.git.next, opts("Next Git")) 232 | map( 233 | "n", 234 | "B", 235 | api.tree.toggle_no_buffer_filter, 236 | opts("Toggle No Buffer") 237 | ) 238 | map( 239 | "n", 240 | "C", 241 | api.tree.toggle_git_clean_filter, 242 | opts("Toggle Git Clean") 243 | ) 244 | map( 245 | "n", 246 | "I", 247 | api.tree.toggle_gitignore_filter, 248 | opts("Toggle Git Ignore") 249 | ) 250 | 251 | map( 252 | "n", 253 | "]e", 254 | api.node.navigate.diagnostics.next, 255 | opts("Next Diagnostic") 256 | ) 257 | map( 258 | "n", 259 | "[e", 260 | api.node.navigate.diagnostics.prev, 261 | opts("Prev Diagnostic") 262 | ) 263 | 264 | map("n", "F", api.live_filter.clear, opts("Clean Filter")) 265 | map("n", "f", api.live_filter.start, opts("Filter")) 266 | -- END_DEFAULT_ON_ATTACH 267 | 268 | --Example of mappings with a custom action_cb 269 | -- map('n', 'P', function() 270 | -- local node = api.tree.get_node_under_cursor() 271 | -- if node ~= nil then 272 | -- print(node.absolute_path) 273 | -- end 274 | -- end, opts('Print Node Path')) 275 | end 276 | 277 | return { 278 | on_attach = on_attach, 279 | -- hijack the cursor in the tree to put it at the start of the filename 280 | hijack_cursor = true, 281 | -- reload the explorer every time a buffer is written to 282 | auto_reload_on_write = true, 283 | -- Completely disable netrw 284 | disable_netrw = true, 285 | -- hijack netrw window on startup 286 | hijack_netrw = true, 287 | -- open in place of the unnamed buffer if it's empty. 288 | hijack_unnamed_buffer_when_opening = true, 289 | -- hijacks new directory buffers when they are opened (`:e dir`). 290 | hijack_directories = { 291 | -- enable the feature. Disable this option if you use vim-dirvish or dirbuf.nvim. 292 | -- If |hijack_netrw| and |disable_netrw| are `false`, this feature will be disabled. 293 | enable = true, 294 | -- opens the tree if the tree was previously closed. 295 | auto_open = true, 296 | }, 297 | -- updates the root directory of the tree on `DirChanged` (when your run `:cd` usually) 298 | -- and refresh the tree 299 | sync_root_with_cwd = false, 300 | -- Automatically reloads the tree on `BufEnter` nvim-tree. 301 | reload_on_bufenter = false, 302 | --Will change cwd of nvim-tree to that of new buffer's when opening nvim-tree. 303 | respect_buf_cwd = false, 304 | -- Use |vim.ui.select| style prompts. Necessary when using a UI prompt decorator 305 | -- such as dressing.nvim or telescope-ui-select.nvim 306 | select_prompts = false, 307 | -- Changes how files within the same directory are sorted. 308 | -- Can be one of "name", "case_sensitive", "modification_time", "extension", 309 | -- "suffix", "filetype" or a function. "extension" uses all suffixes e.g. foo.tar.gz -> .tar.gz 310 | -- "suffix" uses the last e.g. .gz 311 | sort = { 312 | sorter = "name", 313 | -- Sort folders before files. Has no effect when |nvim-tree.sort.sorter| is a function 314 | folders_first = false, 315 | -- Sort files before folders. Has no effect when |nvim-tree.sort.sorter| is a 316 | -- function. If set to `true` it overrides |nvim-tree.sort.folders_first| folders_first = true, 317 | files_first = false, 318 | }, 319 | -- window / buffer setup 320 | view = { 321 | -- When entering nvim-tree, reposition the view so that the current node is 322 | --initially centralized, see |zz|. 323 | centralize_selection = false, 324 | -- Enable |cursorline| in the tree window. 325 | cursorline = true, 326 | -- Idle milliseconds before some reload / refresh operations. 327 | -- Increase if you experience performance issues around screen refresh. 328 | debounce_delay = 30, 329 | -- side of the tree, can be 'left' | 'right' 330 | side = "left", 331 | -- preserve window proportions when opening a file. 332 | -- If `false`, the height and width of windows other than nvim-tree will be equalized. 333 | preserve_window_proportions = true, 334 | -- print the line number in front of each line. 335 | number = false, 336 | -- show the line number relative to the line with the cursor in front of each line. 337 | -- If the option `view.number` is also `true`, the number on the cursor line will be the line number instead of `0`. 338 | relativenumber = false, 339 | --show diagnostic sign column. Value can be `"yes"`, `"auto"`, `"no"` 340 | signcolumn = "yes", 341 | -- Width of the window: can be a `%` string, a number representing columns, a 342 | -- function or a table. 343 | -- A table indicates that the view should be dynamically sized based on the 344 | -- longest line (previously `view.adaptive_size`). 345 | width = { 346 | -- Minimum dynamic width. 347 | min = "25%", 348 | -- Maximum dynamic width, -1 for unbounded. 349 | max = "45%", 350 | -- Extra padding to the right. 351 | padding = 1, 352 | }, 353 | -- Configuration options for floating window 354 | float = { 355 | -- Tree window will be floating. 356 | enable = false, 357 | -- Close the floating tree window when it loses focus. 358 | quit_on_focus_loss = true, 359 | -- Floating window config. See |nvim_open_win| for more details. 360 | open_win_config = { 361 | relative = "editor", 362 | border = "rounded", 363 | width = 30, 364 | height = 30, 365 | row = 1, 366 | col = 1, 367 | }, 368 | }, 369 | }, 370 | -- UI rendering setup 371 | renderer = { 372 | -- Appends a trailing slash to folder names. 373 | add_trailing = false, 374 | -- Compact folders that only contain a single folder into one node in the file tree. 375 | group_empty = false, 376 | -- Display node whose name length is wider than the width of nvim-tree window in floating window. 377 | full_name = false, 378 | -- Number of spaces for an each tree nesting level. Minimum 1. 379 | indent_width = 2, 380 | -- A list of filenames that gets highlighted with `NvimTreeSpecialFile`. 381 | special_files = { 382 | "Cargo.toml", 383 | "Makefile", 384 | "README.md", 385 | "build.zig", 386 | "build.zig.zon", 387 | }, 388 | -- Whether to show the destination of the symlink. 389 | symlink_destination = true, 390 | -- Enable file highlight for git attributes using `NvimTreeGit*` highlight groups. 391 | -- Requires |nvim-tree.git.enable| 392 | highlight_git = true, 393 | -- Enable highlight for diagnostics using `LspDiagnosticsError*Text` highlight groups. 394 | -- Requires |nvim-tree.diagnostics.enable| 395 | highlight_diagnostics = true, 396 | -- Highlight icons and/or names for |bufloaded()| files using the 397 | -- NvimTreeOpenedFile highlight group. 398 | -- See |nvim-tree-api.navigate.opened.next()| and |nvim-tree-api.navigate.opened.prev()| 399 | -- Value can be "none", "icon", "name" or "all". 400 | highlight_opened_files = "icon", 401 | -- Highlight icons and/or names for modified files using the 402 | -- `NvimTreeModifiedFile` highlight group. 403 | -- Requires |nvim-tree.modified.enable| 404 | -- Value can be `"none"`, `"icon"`, `"name"` or `"all"` 405 | highlight_modified = "icon", 406 | -- Highlight bookmarked using the NvimTreeBookmarkHL group. 407 | -- Value can be "none", "icon", "name" or "all" 408 | highlight_bookmarks = "name", 409 | -- Enable highlight for clipboard items using the NvimTreeCutHL and 410 | -- NvimTreeCopiedHL groups. 411 | -- Value can be "none", "icon", "name" or "all". 412 | highlight_clipboard = "name", 413 | -- Configuration options for tree indent markers. 414 | indent_markers = { 415 | -- Display indent markers when folders are open 416 | enable = false, 417 | -- Display folder arrows in the same column as indent marker 418 | -- when using |renderer.icons.show.folder_arrow| 419 | inline_arrows = true, 420 | -- Icons shown before the file/directory. Length 1. 421 | icons = { 422 | corner = "└", 423 | edge = "│", 424 | item = "│", 425 | bottom = "─", 426 | none = " ", 427 | }, 428 | }, 429 | }, 430 | -- update the focused file on `BufEnter`, un-collapses the folders recursively until it finds the file 431 | update_focused_file = { 432 | -- enables the feature 433 | enable = true, 434 | -- Update the root directory of the tree if the file is not under current 435 | -- root directory. It prefers vim's cwd and `root_dirs`. 436 | -- Otherwise it falls back to the folder containing the file. 437 | -- Only relevant when `update_focused_file.enable` is `true` 438 | update_root = true, 439 | -- list of buffer names / filetypes that will not update the cwd if the file 440 | -- isn't found under the current root directory 441 | -- only relevant when `update_focused_file.update_root` is true and `update_focused_file.enable` is true 442 | ignore_list = {}, 443 | }, 444 | -- git integration with icons and colors 445 | git = { 446 | -- enable / disable the feature 447 | enable = true, 448 | -- Show status icons of children when directory itself has no status icon. 449 | show_on_dirs = true, 450 | -- Show status icons of children on directories that are open. 451 | -- Only relevant when `git.show_on_dirs` is `true`. 452 | show_on_open_dirs = true, 453 | -- Kills the git process after some time if it takes too long. 454 | -- Git integration will be disabled after 10 git jobs exceed this timeout. 455 | timeout = 400, 456 | }, 457 | -- LSP diagnostics 458 | diagnostics = { 459 | enable = true, 460 | debounce_delay = 50, 461 | show_on_dirs = true, 462 | show_on_open_dirs = true, 463 | severity = { 464 | min = vim.diagnostic.severity.INFO, 465 | max = vim.diagnostic.severity.ERROR, 466 | }, 467 | }, 468 | -- Indicate which file have unsaved modification 469 | modified = { 470 | -- You will still need to set |renderer.icons.show.modified| `= true` or 471 | -- |renderer.highlight_modified| `= true` to be able to see modified status in the tree. 472 | enable = true, 473 | -- Show modified indication on directory whose children are modified. 474 | show_on_dirs = true, 475 | -- Show modified indication on open directories. 476 | -- Only relevant when |modified.show_on_dirs| is `true`. 477 | show_on_open_dirs = true, 478 | }, 479 | --filtering options 480 | filters = { 481 | -- Ignore files based on `.gitignore`. Requires |git.enable| `= true` 482 | -- Toggle via |nvim-tree-api.tree.toggle_gitignore_filter()| 483 | git_ignored = true, 484 | -- do not show dotfiles: files starting with a `.` 485 | -- Toggle via |nvim-tree-api.tree.toggle_hidden_filter()| 486 | dotfiles = true, 487 | -- Do not show files with no git status. This will show ignored files when 488 | -- |nvim-tree.filters.git_ignored| is set, as they are effectively dirty. 489 | -- Toggle via |nvim-tree-api.tree.toggle_git_clean_filter()| 490 | git_clean = false, 491 | -- Custom list of vim regex for file/directory names that will not be shown. 492 | -- Backslashes must be escaped e.g. "^\\.git". See |string-match|. 493 | -- Toggle via |nvim-tree-api.tree.toggle_custom_filter()| 494 | custom = {}, 495 | --list of directories or files to exclude from filtering: always show them. 496 | --Overrides `git.ignore`, `filters.dotfiles` and `filters.custom`. 497 | exclude = {}, 498 | }, 499 | --configuration for various actions 500 | actions = { 501 | --When enabled, copied text will be stored in registers '+' (system), otherwise, it will be stored in '1' and '"'. 502 | use_system_clipboard = true, 503 | -- vim |current-directory| behaviour. 504 | change_dir = { 505 | --change the working directory when changing directories in the tree. 506 | enable = true, 507 | -- Use `:cd` instead of `:lcd` when changing directories. 508 | -- Consider that this might cause issues with the |nvim-tree.sync_root_with_cwd| option. 509 | global = false, 510 | --restrict changing to a directory above the global current working directory. 511 | restrict_above_cwd = false, 512 | }, 513 | -- Configuration options for opening a file from nvim-tree. 514 | open_file = { 515 | --closes the explorer when opening a file. 516 | --It will also disable preventing a buffer overriding the tree. 517 | quit_on_open = true, 518 | --resizes the tree when opening a file 519 | resize_window = false, 520 | --window picker configuration 521 | window_picker = { 522 | --If not enabled, files will open in window from which you last opened the tree. 523 | enable = true, 524 | }, 525 | }, 526 | -- Close any window displaying a file when removing the file from the tree. 527 | remove_file = { close_window = true }, 528 | }, 529 | -- Configuration for tab behaviour. 530 | tab = { 531 | -- Configuration for syncing nvim-tree across tabs. 532 | sync = { 533 | -- Opens the tree automatically when switching tabpage or opening a new 534 | -- tabpage if the tree was previously open. 535 | open = false, 536 | -- Closes the tree across all tabpages when the tree is closed. 537 | close = false, 538 | }, 539 | }, 540 | } 541 | end, 542 | }, 543 | } 544 | -------------------------------------------------------------------------------- /lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | -- === Syntax Plugins === 2 | return { 3 | -- Nvim Treesitter configurations and abstraction layer 4 | { 5 | "nvim-treesitter/nvim-treesitter", 6 | event = { "BufReadPost", "BufNewFile" }, 7 | keys = { 8 | { "", desc = "Increment selection" }, 9 | { "", desc = "Decrement selection", mode = "x" }, 10 | }, 11 | build = function() 12 | vim.cmd("TSUpdate") 13 | end, 14 | opts = { 15 | -- A list of parser names, or "all" (the 1st five listed parsers should always be installed) 16 | -- For web dev "jsonc", "typescript", "css", "html", "vue", 17 | ensure_installed = { 18 | "c", 19 | "lua", 20 | "vim", 21 | "vimdoc", 22 | "query", 23 | "cpp", 24 | "zig", 25 | "norg", 26 | "bash", 27 | "glsl", 28 | "markdown", 29 | "markdown_inline", 30 | }, 31 | -- Install parsers synchronously (only applied to `ensure_installed`) 32 | sync_install = false, 33 | -- Automatically install missing parsers when entering buffer 34 | -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally 35 | auto_install = true, 36 | ignore_install = {}, -- List of parsers to ignore installing 37 | highlight = { 38 | enable = true, -- false will disable the whole extension 39 | disable = {}, -- list of language that will be disabled 40 | }, 41 | --Incremental selection based on the named nodes from the grammar. 42 | incremental_selection = { 43 | enable = true, 44 | keymaps = { 45 | init_selection = "", 46 | node_incremental = "", 47 | scope_incremental = "", 48 | node_decremental = "", 49 | }, 50 | }, 51 | --Indentation based on treesitter for the = operator. 52 | indent = { 53 | enable = true, 54 | }, 55 | autopairs = { enable = true }, 56 | }, 57 | config = function(_, opts) 58 | require("nvim-treesitter.configs").setup(opts) 59 | end, 60 | }, 61 | { 62 | "nvim-treesitter/nvim-treesitter-textobjects", 63 | keys = { 64 | { "tsto", desc = "Enable Treesitter textobjects" }, 65 | }, 66 | opts = { 67 | textobjects = { 68 | select = { 69 | enable = true, 70 | -- Automatically jump forward to textobj, similar to targets.vim 71 | lookahead = true, 72 | keymaps = { 73 | -- You can use the capture groups defined in textobjects.scm 74 | ["af"] = { 75 | query = "@function.outer", 76 | desc = "select a function", 77 | }, 78 | ["if"] = { 79 | query = "@function.inner", 80 | desc = "select inner function", 81 | }, 82 | ["ac"] = { 83 | query = "@class.outer", 84 | desc = "select a class", 85 | }, 86 | ["ic"] = { 87 | query = "@class.inner", 88 | desc = "Select inner part of a class region", 89 | }, 90 | -- You can also use captures from other query groups like `locals.scm` 91 | ["as"] = { 92 | query = "@scope", 93 | query_group = "locals", 94 | desc = "Select language scope", 95 | }, 96 | }, 97 | -- You can choose the select mode (default is charwise 'v') 98 | -- 99 | -- Can also be a function which gets passed a table with the keys 100 | -- * query_string: eg '@function.inner' 101 | -- * method: eg 'v' or 'o' 102 | -- and should return the mode ('v', 'V', or '') or a table 103 | -- mapping query_strings to modes. 104 | selection_modes = { 105 | ["@parameter.outer"] = "v", -- charwise 106 | ["@function.outer"] = "V", -- linewise 107 | ["@class.outer"] = "", -- blockwise 108 | }, 109 | -- If you set this to `true` (default is `false`) then any textobject is 110 | -- extended to include preceding or succeeding whitespace. Succeeding 111 | -- whitespace has priority in order to act similarly to eg the built-in 112 | -- `ap`. 113 | -- 114 | -- Can also be a function which gets passed a table with the keys 115 | -- * query_string: eg '@function.inner' 116 | -- * selection_mode: eg 'v' 117 | -- and should return true of false 118 | include_surrounding_whitespace = true, 119 | }, 120 | swap = { 121 | enable = true, 122 | swap_next = { 123 | ["a"] = "@parameter.inner", 124 | }, 125 | swap_previous = { 126 | ["A"] = "@parameter.inner", 127 | }, 128 | }, 129 | move = { 130 | enable = true, 131 | set_jumps = true, -- whether to set jumps in the jumplist 132 | goto_next_start = { 133 | ["]m"] = "@function.outer", 134 | ["]]"] = { 135 | query = "@class.outer", 136 | desc = "Next class start", 137 | }, 138 | -- 139 | -- You can use regex matching (i.e. lua pattern) and/or pass a list in a "query" key to group multiple queires. 140 | ["]o"] = "@loop.*", 141 | -- ["]o"] = { query = { "@loop.inner", "@loop.outer" } } 142 | -- 143 | -- You can pass a query group to use query from `queries//.scm file in your runtime path. 144 | --Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm. 145 | ["]s"] = { 146 | query = "@scope", 147 | query_group = "locals", 148 | desc = "Next scope", 149 | }, 150 | ["]z"] = { 151 | query = "@fold", 152 | query_group = "folds", 153 | desc = "Next fold", 154 | }, 155 | }, 156 | goto_next_end = { 157 | ["]M"] = "@function.outer", 158 | ["]O"] = "@loop.*", 159 | ["]["] = "@class.outer", 160 | }, 161 | goto_previous_start = { 162 | ["[m"] = "@function.outer", 163 | ["[o"] = "@loop.*", 164 | ["[["] = "@class.outer", 165 | }, 166 | goto_previous_end = { 167 | ["[M"] = "@function.outer", 168 | ["[O"] = "@loop.*", 169 | ["[]"] = "@class.outer", 170 | }, 171 | -- Below will go to either the start or the end, whichever is closer. 172 | -- Use if you want more granular movements 173 | -- Make it even more gradual by adding multiple queries and regex. 174 | goto_next = { 175 | ["]f"] = "@conditional.outer", 176 | }, 177 | goto_previous = { 178 | ["[f"] = "@conditional.outer", 179 | }, 180 | }, 181 | lsp_interop = { 182 | enable = true, 183 | border = "none", 184 | floating_preview_opts = {}, 185 | peek_definition_code = { 186 | ["if"] = "@function.outer", 187 | ["iF"] = "@class.outer", 188 | }, 189 | }, 190 | }, 191 | }, 192 | config = function(_, opts) 193 | local ts_repeat_move = 194 | require("nvim-treesitter.textobjects.repeatable_move") 195 | 196 | -- Repeat movement with ; and , 197 | -- ensure ; goes forward and , goes backward regardless of the last direction 198 | vim.keymap.set( 199 | { "n", "x", "o" }, 200 | ";", 201 | ts_repeat_move.repeat_last_move_next 202 | ) 203 | vim.keymap.set( 204 | { "n", "x", "o" }, 205 | ",", 206 | ts_repeat_move.repeat_last_move_previous 207 | ) 208 | 209 | -- vim way: ; goes to the direction you were moving. 210 | -- vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move) 211 | -- vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite) 212 | 213 | -- This repeats the last query with always previous direction and to the start of the range. 214 | -- vim.keymap.set({ "n", "x", "o" }, "", function() 215 | -- ts_repeat_move.repeat_last_move({forward = false, start = true}) 216 | -- end) 217 | 218 | -- This repeats the last query with always next direction and to the end of the range. 219 | -- vim.keymap.set({ "n", "x", "o" }, "", function() 220 | -- ts_repeat_move.repeat_last_move({forward = true, start = false}) 221 | -- end) 222 | require("nvim-treesitter.configs").setup(opts) 223 | end, 224 | }, 225 | } 226 | -------------------------------------------------------------------------------- /lua/plugins/ui.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- indent guides for Neovim 3 | { 4 | "lukas-reineke/indent-blankline.nvim", 5 | event = { "BufReadPre", "BufNewFile" }, 6 | main = "ibl", 7 | opts = { 8 | indent = { 9 | char = "▏", 10 | }, 11 | }, 12 | }, 13 | 14 | -- active indent guide and indent text objects 15 | { 16 | "echasnovski/mini.indentscope", 17 | event = { "BufReadPre", "BufNewFile" }, 18 | opts = { 19 | -- symbol = "▏", 20 | symbol = "│", 21 | options = { try_as_border = true }, 22 | }, 23 | init = function() 24 | vim.api.nvim_create_autocmd("FileType", { 25 | pattern = { 26 | "help", 27 | "alpha", 28 | "dashboard", 29 | "neo-tree", 30 | "Trouble", 31 | "lazy", 32 | "mason", 33 | "notify", 34 | "toggleterm", 35 | "lazyterm", 36 | }, 37 | callback = function() 38 | vim.b.miniindentscope_disable = true 39 | end, 40 | }) 41 | end, 42 | }, 43 | -- better vim.ui 44 | { "MunifTanjim/nui.nvim", lazy = true }, 45 | -- Better `vim.notify()` 46 | { 47 | "rcarriga/nvim-notify", 48 | lazy = true, 49 | keys = { 50 | { 51 | "un", 52 | function() 53 | require("notify").dismiss({ silent = true, pending = true }) 54 | end, 55 | desc = "Clear notifications", 56 | }, 57 | }, 58 | opts = { timeout = 3000 }, 59 | }, 60 | { 61 | "folke/noice.nvim", 62 | event = "VeryLazy", 63 | opts = { 64 | lsp = { 65 | progress = { 66 | enabled = false, 67 | }, 68 | override = { 69 | -- override the default lsp markdown formatter with Noice 70 | ["vim.lsp.util.convert_input_to_markdown_lines"] = true, 71 | -- override the lsp markdown formatter with Noice 72 | ["vim.lsp.util.stylize_markdown"] = true, 73 | -- override cmp documentation with Noice (needs the other options to work) 74 | ["cmp.entry.get_documentation"] = true, 75 | }, 76 | --NOTE: install parsers for markdown and markdown_inline to see markdown documentation 77 | hover = { 78 | enabled = true, 79 | }, 80 | signature = { 81 | enabled = false, 82 | }, 83 | message = { 84 | enabled = true, -- Messages shown by lsp servers 85 | }, 86 | }, 87 | health = { 88 | checker = false, -- Disable if you don't want health checks to run 89 | }, 90 | presets = { 91 | -- you can enable a preset by setting it to true, or a table that will override the preset config 92 | -- you can also add custom presets that you can enable/disable with enabled=true 93 | bottom_search = false, -- use a classic bottom cmdline for search 94 | command_palette = true, -- position the cmdline and popupmenu together 95 | long_message_to_split = false, -- long messages will be sent to a split 96 | inc_rename = false, -- enables an input dialog for inc-rename.nvim 97 | lsp_doc_border = false, -- add a border to hover docs and signature help 98 | }, 99 | }, 100 | }, 101 | } 102 | -------------------------------------------------------------------------------- /luajit.yml: -------------------------------------------------------------------------------- 1 | base: lua51 2 | name: neovim 3 | globals: 4 | after_each: 5 | args: 6 | - type: function 7 | assert.equals: 8 | args: 9 | - type: any 10 | - type: any 11 | - required: false 12 | type: any 13 | assert.falsy: 14 | args: 15 | - type: any 16 | assert.has_error: 17 | any: true 18 | assert.is_not: 19 | any: true 20 | assert.matches: 21 | any: true 22 | assert.same: 23 | args: 24 | - type: any 25 | - type: any 26 | assert.spy: 27 | args: 28 | - type: any 29 | assert.stub: 30 | args: 31 | - type: any 32 | assert.truthy: 33 | args: 34 | - type: any 35 | before_each: 36 | args: 37 | - type: function 38 | describe: 39 | args: 40 | - type: string 41 | - type: function 42 | it: 43 | args: 44 | - type: string 45 | - type: function 46 | jit: 47 | any: true 48 | vim: 49 | any: true 50 | bit: 51 | any: true 52 | -------------------------------------------------------------------------------- /selene.toml: -------------------------------------------------------------------------------- 1 | std = "luajit" 2 | -------------------------------------------------------------------------------- /stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 80 2 | indent_type = "Spaces" 3 | 4 | [sort_requires] 5 | enabled = true 6 | --------------------------------------------------------------------------------